@darco2903/cdn-api 1.1.8 → 1.2.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.
package/dist/client.d.ts CHANGED
@@ -205,8 +205,8 @@ export declare function createClient(origin: string): {
205
205
  authorization?: string | undefined;
206
206
  } | undefined;
207
207
  }) => Promise<{
208
- status: 200;
209
- body: null;
208
+ status: 204;
209
+ body: undefined;
210
210
  headers: Headers;
211
211
  } | {
212
212
  status: 400;
@@ -269,7 +269,7 @@ export declare function createClient(origin: string): {
269
269
  };
270
270
  headers: Headers;
271
271
  } | {
272
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
272
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
273
273
  body: unknown;
274
274
  headers: Headers;
275
275
  }>;
@@ -287,8 +287,8 @@ export declare function createClient(origin: string): {
287
287
  authorization?: string | undefined;
288
288
  } | undefined;
289
289
  }) => Promise<{
290
- status: 200;
291
- body: null;
290
+ status: 204;
291
+ body: undefined;
292
292
  headers: Headers;
293
293
  } | {
294
294
  status: 401;
@@ -323,7 +323,7 @@ export declare function createClient(origin: string): {
323
323
  };
324
324
  headers: Headers;
325
325
  } | {
326
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
326
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
327
327
  body: unknown;
328
328
  headers: Headers;
329
329
  }>;
@@ -875,8 +875,8 @@ export declare function createClient(origin: string): {
875
875
  authorization?: string | undefined;
876
876
  } | undefined;
877
877
  }) => Promise<{
878
- status: 200;
879
- body: null;
878
+ status: 204;
879
+ body: undefined;
880
880
  headers: Headers;
881
881
  } | {
882
882
  status: 400;
@@ -904,6 +904,10 @@ export declare function createClient(origin: string): {
904
904
  not_finite: "not_finite";
905
905
  }>;
906
906
  }, import("zod").ZodAny, "strip">[];
907
+ } | {
908
+ code: "BAD_REQUEST";
909
+ name: "APIError";
910
+ error: "Endpoint path is invalid";
907
911
  };
908
912
  headers: Headers;
909
913
  } | {
@@ -947,7 +951,7 @@ export declare function createClient(origin: string): {
947
951
  };
948
952
  headers: Headers;
949
953
  } | {
950
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
954
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
951
955
  body: unknown;
952
956
  headers: Headers;
953
957
  }>;
@@ -965,8 +969,8 @@ export declare function createClient(origin: string): {
965
969
  authorization?: string | undefined;
966
970
  } | undefined;
967
971
  }) => Promise<{
968
- status: 200;
969
- body: null;
972
+ status: 204;
973
+ body: undefined;
970
974
  headers: Headers;
971
975
  } | {
972
976
  status: 400;
@@ -1029,7 +1033,7 @@ export declare function createClient(origin: string): {
1029
1033
  };
1030
1034
  headers: Headers;
1031
1035
  } | {
1032
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
1036
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
1033
1037
  body: unknown;
1034
1038
  headers: Headers;
1035
1039
  }>;
@@ -21,8 +21,8 @@ declare const _default: {
21
21
  authorization?: string | undefined;
22
22
  }>;
23
23
  responses: {
24
- 200: z.ZodNull;
25
- 400: z.ZodObject<{
24
+ 204: z.ZodUndefined;
25
+ 400: z.ZodUnion<[z.ZodObject<{
26
26
  name: z.ZodLiteral<"ZodError">;
27
27
  issues: z.ZodArray<z.ZodObject<{
28
28
  path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
@@ -136,7 +136,19 @@ declare const _default: {
136
136
  not_finite: "not_finite";
137
137
  }>;
138
138
  }, z.ZodAny, "strip">[];
139
- }>;
139
+ }>, z.ZodObject<{
140
+ code: z.ZodType<"BAD_REQUEST", z.ZodTypeDef, "BAD_REQUEST">;
141
+ error: z.ZodType<"Endpoint path is invalid", z.ZodTypeDef, "Endpoint path is invalid">;
142
+ name: z.ZodLiteral<"APIError">;
143
+ }, "strip", z.ZodTypeAny, {
144
+ code: "BAD_REQUEST";
145
+ name: "APIError";
146
+ error: "Endpoint path is invalid";
147
+ }, {
148
+ code: "BAD_REQUEST";
149
+ name: "APIError";
150
+ error: "Endpoint path is invalid";
151
+ }>]>;
140
152
  401: z.ZodObject<{
141
153
  code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
142
154
  error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
@@ -222,7 +234,7 @@ declare const _default: {
222
234
  authorization?: string | undefined;
223
235
  }>;
224
236
  responses: {
225
- 200: z.ZodNull;
237
+ 204: z.ZodUndefined;
226
238
  400: z.ZodObject<{
227
239
  name: z.ZodLiteral<"ZodError">;
228
240
  issues: z.ZodArray<z.ZodObject<{
@@ -14,8 +14,11 @@ export default c.router({
14
14
  endpoint: endpointPathSchema,
15
15
  }),
16
16
  responses: {
17
- 200: apiSuccess(z.null()),
18
- 400: ZodErrorSchema,
17
+ 204: apiSuccess(z.undefined()),
18
+ 400: z.union([
19
+ ZodErrorSchema,
20
+ apiError(z.literal("BAD_REQUEST"), z.literal("Endpoint path is invalid")),
21
+ ]),
19
22
  401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
20
23
  403: apiError(z.literal("FORBIDDEN"), z.literal("Forbidden")),
21
24
  404: apiError(z.literal("NOT_FOUND"), z.literal("Record not found")),
@@ -31,7 +34,7 @@ export default c.router({
31
34
  endpoint: endpointPathSchema,
32
35
  }),
33
36
  responses: {
34
- 200: apiSuccess(z.null()),
37
+ 204: apiSuccess(z.undefined()),
35
38
  400: ZodErrorSchema,
36
39
  401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
37
40
  403: apiError(z.literal("FORBIDDEN"), z.literal("Forbidden")),
@@ -370,7 +370,7 @@ declare const _default: {
370
370
  authorization?: string | undefined;
371
371
  }>;
372
372
  responses: {
373
- 200: import("zod").ZodNull;
373
+ 204: import("zod").ZodUndefined;
374
374
  400: import("zod").ZodObject<{
375
375
  name: import("zod").ZodLiteral<"ZodError">;
376
376
  issues: import("zod").ZodArray<import("zod").ZodObject<{
@@ -551,7 +551,7 @@ declare const _default: {
551
551
  authorization?: string | undefined;
552
552
  }>;
553
553
  responses: {
554
- 200: import("zod").ZodNull;
554
+ 204: import("zod").ZodUndefined;
555
555
  401: import("zod").ZodObject<{
556
556
  code: import("zod").ZodType<"UNAUTHORIZED", import("zod").ZodTypeDef, "UNAUTHORIZED">;
557
557
  error: import("zod").ZodType<"Unauthorized", import("zod").ZodTypeDef, "Unauthorized">;
@@ -1736,8 +1736,8 @@ declare const _default: {
1736
1736
  authorization?: string | undefined;
1737
1737
  }>;
1738
1738
  responses: {
1739
- 200: import("zod").ZodNull;
1740
- 400: import("zod").ZodObject<{
1739
+ 204: import("zod").ZodUndefined;
1740
+ 400: import("zod").ZodUnion<[import("zod").ZodObject<{
1741
1741
  name: import("zod").ZodLiteral<"ZodError">;
1742
1742
  issues: import("zod").ZodArray<import("zod").ZodObject<{
1743
1743
  path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
@@ -1851,7 +1851,19 @@ declare const _default: {
1851
1851
  not_finite: "not_finite";
1852
1852
  }>;
1853
1853
  }, import("zod").ZodAny, "strip">[];
1854
- }>;
1854
+ }>, import("zod").ZodObject<{
1855
+ code: import("zod").ZodType<"BAD_REQUEST", import("zod").ZodTypeDef, "BAD_REQUEST">;
1856
+ error: import("zod").ZodType<"Endpoint path is invalid", import("zod").ZodTypeDef, "Endpoint path is invalid">;
1857
+ name: import("zod").ZodLiteral<"APIError">;
1858
+ }, "strip", import("zod").ZodTypeAny, {
1859
+ code: "BAD_REQUEST";
1860
+ name: "APIError";
1861
+ error: "Endpoint path is invalid";
1862
+ }, {
1863
+ code: "BAD_REQUEST";
1864
+ name: "APIError";
1865
+ error: "Endpoint path is invalid";
1866
+ }>]>;
1855
1867
  401: import("zod").ZodObject<{
1856
1868
  code: import("zod").ZodType<"UNAUTHORIZED", import("zod").ZodTypeDef, "UNAUTHORIZED">;
1857
1869
  error: import("zod").ZodType<"Unauthorized", import("zod").ZodTypeDef, "Unauthorized">;
@@ -1937,7 +1949,7 @@ declare const _default: {
1937
1949
  authorization?: string | undefined;
1938
1950
  }>;
1939
1951
  responses: {
1940
- 200: import("zod").ZodNull;
1952
+ 204: import("zod").ZodUndefined;
1941
1953
  400: import("zod").ZodObject<{
1942
1954
  name: import("zod").ZodLiteral<"ZodError">;
1943
1955
  issues: import("zod").ZodArray<import("zod").ZodObject<{
@@ -199,7 +199,7 @@ declare const _default: {
199
199
  authorization?: string | undefined;
200
200
  }>;
201
201
  responses: {
202
- 200: z.ZodNull;
202
+ 204: z.ZodUndefined;
203
203
  400: z.ZodObject<{
204
204
  name: z.ZodLiteral<"ZodError">;
205
205
  issues: z.ZodArray<z.ZodObject<{
@@ -380,7 +380,7 @@ declare const _default: {
380
380
  authorization?: string | undefined;
381
381
  }>;
382
382
  responses: {
383
- 200: z.ZodNull;
383
+ 204: z.ZodUndefined;
384
384
  401: z.ZodObject<{
385
385
  code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
386
386
  error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
@@ -48,7 +48,7 @@ export default c.router({
48
48
  }),
49
49
  ]),
50
50
  responses: {
51
- 200: apiSuccess(z.null()),
51
+ 204: apiSuccess(z.undefined()),
52
52
  400: ZodErrorSchema,
53
53
  401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
54
54
  403: apiError(z.literal("FORBIDDEN"), z.literal("Forbidden")),
@@ -61,7 +61,7 @@ export default c.router({
61
61
  path: "/record/:storage_id",
62
62
  headers: authHeaderSchema,
63
63
  responses: {
64
- 200: apiSuccess(z.null()),
64
+ 204: apiSuccess(z.undefined()),
65
65
  401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
66
66
  403: apiError(z.literal("FORBIDDEN"), z.literal("Forbidden")),
67
67
  404: apiError(z.literal("NOT_FOUND"), z.literal("Record not found")),
@@ -207,8 +207,8 @@ export default class Uploader {
207
207
  authorization?: string | undefined;
208
208
  } | undefined;
209
209
  }) => Promise<{
210
- status: 200;
211
- body: null;
210
+ status: 204;
211
+ body: undefined;
212
212
  headers: Headers;
213
213
  } | {
214
214
  status: 400;
@@ -271,7 +271,7 @@ export default class Uploader {
271
271
  };
272
272
  headers: Headers;
273
273
  } | {
274
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
274
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
275
275
  body: unknown;
276
276
  headers: Headers;
277
277
  }>;
@@ -289,8 +289,8 @@ export default class Uploader {
289
289
  authorization?: string | undefined;
290
290
  } | undefined;
291
291
  }) => Promise<{
292
- status: 200;
293
- body: null;
292
+ status: 204;
293
+ body: undefined;
294
294
  headers: Headers;
295
295
  } | {
296
296
  status: 401;
@@ -325,7 +325,7 @@ export default class Uploader {
325
325
  };
326
326
  headers: Headers;
327
327
  } | {
328
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
328
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
329
329
  body: unknown;
330
330
  headers: Headers;
331
331
  }>;
@@ -877,8 +877,8 @@ export default class Uploader {
877
877
  authorization?: string | undefined;
878
878
  } | undefined;
879
879
  }) => Promise<{
880
- status: 200;
881
- body: null;
880
+ status: 204;
881
+ body: undefined;
882
882
  headers: Headers;
883
883
  } | {
884
884
  status: 400;
@@ -906,6 +906,10 @@ export default class Uploader {
906
906
  not_finite: "not_finite";
907
907
  }>;
908
908
  }, import("zod").ZodAny, "strip">[];
909
+ } | {
910
+ code: "BAD_REQUEST";
911
+ name: "APIError";
912
+ error: "Endpoint path is invalid";
909
913
  };
910
914
  headers: Headers;
911
915
  } | {
@@ -949,7 +953,7 @@ export default class Uploader {
949
953
  };
950
954
  headers: Headers;
951
955
  } | {
952
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
956
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
953
957
  body: unknown;
954
958
  headers: Headers;
955
959
  }>;
@@ -967,8 +971,8 @@ export default class Uploader {
967
971
  authorization?: string | undefined;
968
972
  } | undefined;
969
973
  }) => Promise<{
970
- status: 200;
971
- body: null;
974
+ status: 204;
975
+ body: undefined;
972
976
  headers: Headers;
973
977
  } | {
974
978
  status: 400;
@@ -1031,7 +1035,7 @@ export default class Uploader {
1031
1035
  };
1032
1036
  headers: Headers;
1033
1037
  } | {
1034
- status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
1038
+ status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
1035
1039
  body: unknown;
1036
1040
  headers: Headers;
1037
1041
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darco2903/cdn-api",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",