@editframe/api 0.17.6-beta.0 → 0.18.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { Client } from '../client.js';
3
- export declare const ImageFileMimeTypes: z.ZodEnum<["image/jpeg", "image/png", "image/jpg", "image/webp"]>;
3
+ export declare const ImageFileMimeTypes: z.ZodEnum<["image/jpeg", "image/png", "image/jpg", "image/webp", "image/svg+xml"]>;
4
4
  export declare const CreateImageFilePayload: z.ZodEffects<z.ZodObject<{
5
5
  /**
6
6
  * The md5 hash of the image file.
@@ -17,7 +17,7 @@ export declare const CreateImageFilePayload: z.ZodEffects<z.ZodObject<{
17
17
  /**
18
18
  * The mime type of the image file. Optional if the filename has a known file extension.
19
19
  */
20
- mime_type: z.ZodOptional<z.ZodEnum<["image/jpeg", "image/png", "image/jpg", "image/webp"]>>;
20
+ mime_type: z.ZodOptional<z.ZodEnum<["image/jpeg", "image/png", "image/jpg", "image/webp", "image/svg+xml"]>>;
21
21
  /**
22
22
  * The filename of the image file.
23
23
  */
@@ -32,28 +32,28 @@ export declare const CreateImageFilePayload: z.ZodEffects<z.ZodObject<{
32
32
  width?: number | undefined;
33
33
  height?: number | undefined;
34
34
  md5?: string | undefined;
35
- mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | undefined;
35
+ mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | "image/svg+xml" | undefined;
36
36
  }, {
37
37
  filename: string;
38
38
  byte_size: number;
39
39
  width?: number | undefined;
40
40
  height?: number | undefined;
41
41
  md5?: string | undefined;
42
- mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | undefined;
42
+ mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | "image/svg+xml" | undefined;
43
43
  }>, {
44
44
  filename: string;
45
45
  byte_size: number;
46
46
  width?: number | undefined;
47
47
  height?: number | undefined;
48
48
  md5?: string | undefined;
49
- mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | undefined;
49
+ mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | "image/svg+xml" | undefined;
50
50
  }, {
51
51
  filename: string;
52
52
  byte_size: number;
53
53
  width?: number | undefined;
54
54
  height?: number | undefined;
55
55
  md5?: string | undefined;
56
- mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | undefined;
56
+ mime_type?: "image/jpeg" | "image/png" | "image/jpg" | "image/webp" | "image/svg+xml" | undefined;
57
57
  }>;
58
58
  export type CreateImageFilePayload = z.infer<typeof CreateImageFilePayload>;
59
59
  export interface CreateImageFileResult {
@@ -8,7 +8,8 @@ const ImageFileMimeTypes = z.enum([
8
8
  "image/jpeg",
9
9
  "image/png",
10
10
  "image/jpg",
11
- "image/webp"
11
+ "image/webp",
12
+ "image/svg+xml"
12
13
  ]);
13
14
  function getFileExtension(path) {
14
15
  const match = path.match(/\.([^.]+)$/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/api",
3
- "version": "0.17.6-beta.0",
3
+ "version": "0.18.3-beta.0",
4
4
  "description": "API functions for EditFrame",
5
5
  "exports": {
6
6
  ".": {
@@ -45,7 +45,7 @@
45
45
  "vite-plugin-dts": "^4.5.4"
46
46
  },
47
47
  "dependencies": {
48
- "@editframe/assets": "0.17.6-beta.0",
48
+ "@editframe/assets": "0.18.3-beta.0",
49
49
  "@vitejs/plugin-react": "^4.3.4",
50
50
  "debug": "^4.3.5",
51
51
  "eventsource-parser": "^3.0.0",
@@ -14,6 +14,7 @@ export const ImageFileMimeTypes = z.enum([
14
14
  "image/png",
15
15
  "image/jpg",
16
16
  "image/webp",
17
+ "image/svg+xml",
17
18
  ]);
18
19
 
19
20
  function getFileExtension(path: string) {
@@ -1,17 +1,23 @@
1
- import { describe, expect, test } from "vitest";
1
+ import { HttpResponse, http } from "msw";
2
+ import { setupServer } from "msw/node";
3
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from "vitest";
4
+ import { Client } from "../client.js";
2
5
  import {
3
6
  getIsobmffProcessInfo,
4
7
  getIsobmffProcessProgress,
5
8
  } from "./process-isobmff.js";
6
9
 
7
- import { useMSW } from "TEST/useMSW.js";
8
- import { http, HttpResponse } from "msw";
9
- import { Client } from "../client.js";
10
-
11
10
  const client = new Client("ef_TEST_TOKEN", "http://localhost");
11
+ const server = setupServer();
12
12
 
13
13
  describe("process-isobmff", () => {
14
- const server = useMSW();
14
+ beforeAll(() => {
15
+ server.listen();
16
+ process.env.EF_TOKEN = "ef_SECRET_TOKEN";
17
+ process.env.EF_HOST = "http://localhost:3000";
18
+ });
19
+ afterAll(() => server.close());
20
+ afterEach(() => server.resetHandlers());
15
21
  describe("getIsobmffProcessInfo", () => {
16
22
  test("returns the process info", async () => {
17
23
  server.use(