@darco2903/cdn-api 1.0.7-beta.0 → 1.0.7-beta.1

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.
Files changed (71) hide show
  1. package/README.md +49 -9
  2. package/dist/client.d.ts +1039 -0
  3. package/{src/client.ts → dist/client.js} +15 -18
  4. package/{src/common.ts → dist/common.d.ts} +4 -4
  5. package/dist/common.js +4 -0
  6. package/dist/consts.d.ts +5 -0
  7. package/{src/consts.ts → dist/consts.js} +4 -8
  8. package/dist/contract/auth.d.ts +35 -0
  9. package/{src/contract/auth.ts → dist/contract/auth.js} +18 -22
  10. package/dist/contract/endpoint.d.ts +396 -0
  11. package/{src/contract/endpoint.ts → dist/contract/endpoint.js} +42 -53
  12. package/dist/contract/index.d.ts +2039 -0
  13. package/{src/contract/index.ts → dist/contract/index.js} +22 -27
  14. package/dist/contract/key.d.ts +15 -0
  15. package/{src/contract/key.ts → dist/contract/key.js} +15 -19
  16. package/dist/contract/list.d.ts +134 -0
  17. package/{src/contract/list.ts → dist/contract/list.js} +28 -30
  18. package/dist/contract/record.d.ts +412 -0
  19. package/{src/contract/record.ts → dist/contract/record.js} +71 -82
  20. package/dist/contract/service.d.ts +240 -0
  21. package/{src/contract/service.ts → dist/contract/service.js} +33 -44
  22. package/dist/contract/stats.d.ts +32 -0
  23. package/{src/contract/stats.ts → dist/contract/stats.js} +34 -36
  24. package/dist/contract/upload.d.ts +790 -0
  25. package/{src/contract/upload.ts → dist/contract/upload.js} +78 -82
  26. package/{src/index.ts → dist/index.d.ts} +2 -2
  27. package/dist/index.js +2 -0
  28. package/dist/server.d.ts +10 -0
  29. package/dist/server.js +58 -0
  30. package/{src/socket/index.ts → dist/socket/index.d.ts} +2 -2
  31. package/dist/socket/index.js +2 -0
  32. package/dist/socket/interface/index.d.ts +5 -0
  33. package/dist/socket/interface/index.js +1 -0
  34. package/{src/socket/interface/template.ts → dist/socket/interface/template.d.ts} +6 -7
  35. package/dist/socket/interface/template.js +1 -0
  36. package/dist/socket/types.d.ts +3 -0
  37. package/dist/socket/types.js +1 -0
  38. package/dist/types/creds.d.ts +8 -0
  39. package/{src/types/creds.ts → dist/types/creds.js} +5 -7
  40. package/dist/types/endpoint.d.ts +25 -0
  41. package/{src/types/endpoint.ts → dist/types/endpoint.js} +12 -19
  42. package/{src/types/index.ts → dist/types/index.d.ts} +6 -6
  43. package/dist/types/index.js +6 -0
  44. package/dist/types/jwt.d.ts +128 -0
  45. package/dist/types/jwt.js +33 -0
  46. package/dist/types/record.d.ts +97 -0
  47. package/{src/types/record.ts → dist/types/record.js} +25 -35
  48. package/dist/types/stats.d.ts +15 -0
  49. package/{src/types/stats.ts → dist/types/stats.js} +6 -9
  50. package/dist/types/upload.d.ts +45 -0
  51. package/{src/types/upload.ts → dist/types/upload.js} +12 -18
  52. package/dist/types.d.ts +32 -0
  53. package/dist/types.js +27 -0
  54. package/dist/uploader.d.ts +1044 -0
  55. package/{src/uploader.ts → dist/uploader.js} +72 -99
  56. package/package.json +2 -2
  57. package/.gitattributes +0 -2
  58. package/.github/workflows/release.yml +0 -116
  59. package/TODO.md +0 -0
  60. package/prettier.config.js +0 -24
  61. package/src/server.ts +0 -89
  62. package/src/socket/interface/index.ts +0 -12
  63. package/src/socket/types.ts +0 -7
  64. package/src/types/jwt.ts +0 -78
  65. package/src/types.ts +0 -38
  66. package/tests/keys/private.pem +0 -5
  67. package/tests/keys/public.pem +0 -4
  68. package/tests/keys.ts +0 -11
  69. package/tests/tsconfig.json +0 -12
  70. package/tests/vitest/jwt.test.ts +0 -38
  71. package/tsconfig.json +0 -14
@@ -0,0 +1,1039 @@
1
+ export * from "./common.js";
2
+ import type { CdnClientSocket } from "./socket/index.js";
3
+ export declare function createClient(origin: string): {
4
+ list: {
5
+ public: (args?: {
6
+ cache?: RequestCache | undefined;
7
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
8
+ extraHeaders?: ({
9
+ authorization?: undefined;
10
+ } & Record<string, string | undefined>) | undefined;
11
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
12
+ headers?: {
13
+ authorization?: string | undefined;
14
+ } | undefined;
15
+ } | undefined) => Promise<{
16
+ status: 200;
17
+ body: {
18
+ filename: string;
19
+ size: number;
20
+ storage_id: string;
21
+ mime_type: string;
22
+ endpoints: {
23
+ endpoint: string;
24
+ }[];
25
+ }[];
26
+ headers: Headers;
27
+ } | {
28
+ status: 500;
29
+ body: {
30
+ code: "INTERNAL_SERVER_ERROR";
31
+ name: "APIError";
32
+ error: string;
33
+ };
34
+ headers: Headers;
35
+ } | {
36
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 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;
37
+ body: unknown;
38
+ headers: Headers;
39
+ }>;
40
+ admin: (args?: {
41
+ cache?: RequestCache | undefined;
42
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
43
+ extraHeaders?: ({
44
+ authorization?: undefined;
45
+ } & Record<string, string | undefined>) | undefined;
46
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
47
+ headers?: {
48
+ authorization?: string | undefined;
49
+ } | undefined;
50
+ } | undefined) => Promise<{
51
+ status: 200;
52
+ body: {
53
+ type: "user" | "service" | "system";
54
+ filename: string;
55
+ active: boolean;
56
+ visible: boolean;
57
+ role: number;
58
+ size: number;
59
+ created_at: Date;
60
+ updated_at: Date;
61
+ storage_id: string;
62
+ mime_type: string;
63
+ endpoints: {
64
+ created_at: Date;
65
+ updated_at: Date;
66
+ endpoint: string;
67
+ }[];
68
+ user_id: string | null;
69
+ }[];
70
+ headers: Headers;
71
+ } | {
72
+ status: 401;
73
+ body: {
74
+ code: "UNAUTHORIZED";
75
+ name: "APIError";
76
+ error: "Unauthorized";
77
+ };
78
+ headers: Headers;
79
+ } | {
80
+ status: 403;
81
+ body: {
82
+ code: "FORBIDDEN";
83
+ name: "APIError";
84
+ error: "Forbidden";
85
+ };
86
+ headers: Headers;
87
+ } | {
88
+ status: 500;
89
+ body: {
90
+ code: "INTERNAL_SERVER_ERROR";
91
+ name: "APIError";
92
+ error: string;
93
+ };
94
+ headers: Headers;
95
+ } | {
96
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 402 | 404 | 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;
97
+ body: unknown;
98
+ headers: Headers;
99
+ }>;
100
+ };
101
+ record: {
102
+ get: (args: {
103
+ params: {
104
+ storage_id: string;
105
+ };
106
+ cache?: RequestCache | undefined;
107
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
108
+ extraHeaders?: ({
109
+ authorization?: undefined;
110
+ } & Record<string, string | undefined>) | undefined;
111
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
112
+ headers?: {
113
+ authorization?: string | undefined;
114
+ } | undefined;
115
+ }) => Promise<{
116
+ status: 200;
117
+ body: {
118
+ type: "user" | "service" | "system";
119
+ filename: string;
120
+ active: boolean;
121
+ visible: boolean;
122
+ role: number;
123
+ size: number;
124
+ created_at: Date;
125
+ updated_at: Date;
126
+ storage_id: string;
127
+ mime_type: string;
128
+ endpoints: {
129
+ created_at: Date;
130
+ updated_at: Date;
131
+ endpoint: string;
132
+ }[];
133
+ user_id: string | null;
134
+ };
135
+ headers: Headers;
136
+ } | {
137
+ status: 401;
138
+ body: {
139
+ code: "UNAUTHORIZED";
140
+ name: "APIError";
141
+ error: "Unauthorized";
142
+ };
143
+ headers: Headers;
144
+ } | {
145
+ status: 403;
146
+ body: {
147
+ code: "FORBIDDEN";
148
+ name: "APIError";
149
+ error: "Forbidden";
150
+ };
151
+ headers: Headers;
152
+ } | {
153
+ status: 404;
154
+ body: {
155
+ code: "NOT_FOUND";
156
+ name: "APIError";
157
+ error: "Record not found";
158
+ };
159
+ headers: Headers;
160
+ } | {
161
+ status: 500;
162
+ body: {
163
+ code: "INTERNAL_SERVER_ERROR";
164
+ name: "APIError";
165
+ error: string;
166
+ };
167
+ headers: Headers;
168
+ } | {
169
+ 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;
170
+ body: unknown;
171
+ headers: Headers;
172
+ }>;
173
+ update: (args: {
174
+ body: {
175
+ filename: string;
176
+ active?: boolean | undefined;
177
+ visible?: boolean | undefined;
178
+ role?: number | undefined;
179
+ } | {
180
+ role: number;
181
+ filename?: string | undefined;
182
+ active?: boolean | undefined;
183
+ visible?: boolean | undefined;
184
+ } | {
185
+ active: boolean;
186
+ filename?: string | undefined;
187
+ visible?: boolean | undefined;
188
+ role?: number | undefined;
189
+ } | {
190
+ visible: boolean;
191
+ filename?: string | undefined;
192
+ active?: boolean | undefined;
193
+ role?: number | undefined;
194
+ };
195
+ params: {
196
+ storage_id: string;
197
+ };
198
+ cache?: RequestCache | undefined;
199
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
200
+ extraHeaders?: ({
201
+ authorization?: undefined;
202
+ } & Record<string, string | undefined>) | undefined;
203
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
204
+ headers?: {
205
+ authorization?: string | undefined;
206
+ } | undefined;
207
+ }) => Promise<{
208
+ status: 200;
209
+ body: null;
210
+ headers: Headers;
211
+ } | {
212
+ status: 400;
213
+ body: {
214
+ name: "ZodError";
215
+ issues: import("zod").objectOutputType<{
216
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
217
+ message: import("zod").ZodOptional<import("zod").ZodString>;
218
+ code: import("zod").ZodNativeEnum<{
219
+ invalid_type: "invalid_type";
220
+ invalid_literal: "invalid_literal";
221
+ custom: "custom";
222
+ invalid_union: "invalid_union";
223
+ invalid_union_discriminator: "invalid_union_discriminator";
224
+ invalid_enum_value: "invalid_enum_value";
225
+ unrecognized_keys: "unrecognized_keys";
226
+ invalid_arguments: "invalid_arguments";
227
+ invalid_return_type: "invalid_return_type";
228
+ invalid_date: "invalid_date";
229
+ invalid_string: "invalid_string";
230
+ too_small: "too_small";
231
+ too_big: "too_big";
232
+ invalid_intersection_types: "invalid_intersection_types";
233
+ not_multiple_of: "not_multiple_of";
234
+ not_finite: "not_finite";
235
+ }>;
236
+ }, import("zod").ZodAny, "strip">[];
237
+ };
238
+ headers: Headers;
239
+ } | {
240
+ status: 401;
241
+ body: {
242
+ code: "UNAUTHORIZED";
243
+ name: "APIError";
244
+ error: "Unauthorized";
245
+ };
246
+ headers: Headers;
247
+ } | {
248
+ status: 403;
249
+ body: {
250
+ code: "FORBIDDEN";
251
+ name: "APIError";
252
+ error: "Forbidden";
253
+ };
254
+ headers: Headers;
255
+ } | {
256
+ status: 404;
257
+ body: {
258
+ code: "NOT_FOUND";
259
+ name: "APIError";
260
+ error: "Record not found";
261
+ };
262
+ headers: Headers;
263
+ } | {
264
+ status: 500;
265
+ body: {
266
+ code: "INTERNAL_SERVER_ERROR";
267
+ name: "APIError";
268
+ error: string;
269
+ };
270
+ headers: Headers;
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;
273
+ body: unknown;
274
+ headers: Headers;
275
+ }>;
276
+ delete: (args: {
277
+ params: {
278
+ storage_id: string;
279
+ };
280
+ cache?: RequestCache | undefined;
281
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
282
+ extraHeaders?: ({
283
+ authorization?: undefined;
284
+ } & Record<string, string | undefined>) | undefined;
285
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
286
+ headers?: {
287
+ authorization?: string | undefined;
288
+ } | undefined;
289
+ }) => Promise<{
290
+ status: 200;
291
+ body: null;
292
+ headers: Headers;
293
+ } | {
294
+ status: 401;
295
+ body: {
296
+ code: "UNAUTHORIZED";
297
+ name: "APIError";
298
+ error: "Unauthorized";
299
+ };
300
+ headers: Headers;
301
+ } | {
302
+ status: 403;
303
+ body: {
304
+ code: "FORBIDDEN";
305
+ name: "APIError";
306
+ error: "Forbidden";
307
+ };
308
+ headers: Headers;
309
+ } | {
310
+ status: 404;
311
+ body: {
312
+ code: "NOT_FOUND";
313
+ name: "APIError";
314
+ error: "Record not found";
315
+ };
316
+ headers: Headers;
317
+ } | {
318
+ status: 500;
319
+ body: {
320
+ code: "INTERNAL_SERVER_ERROR";
321
+ name: "APIError";
322
+ error: string;
323
+ };
324
+ headers: Headers;
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;
327
+ body: unknown;
328
+ headers: Headers;
329
+ }>;
330
+ };
331
+ service: {
332
+ update: (args: {
333
+ body: FormData | {};
334
+ headers: {
335
+ authorization: string;
336
+ };
337
+ cache?: RequestCache | undefined;
338
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
339
+ extraHeaders?: ({
340
+ authorization?: undefined;
341
+ } & Record<string, string | undefined>) | undefined;
342
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
343
+ }) => Promise<{
344
+ status: 200;
345
+ body: null;
346
+ headers: Headers;
347
+ } | {
348
+ status: 400;
349
+ body: {
350
+ code: "BAD_REQUEST";
351
+ name: "APIError";
352
+ error: string;
353
+ };
354
+ headers: Headers;
355
+ } | {
356
+ status: 401;
357
+ body: {
358
+ code: "UNAUTHORIZED";
359
+ name: "APIError";
360
+ error: "Invalid CDN token";
361
+ };
362
+ headers: Headers;
363
+ } | {
364
+ status: 429;
365
+ body: {
366
+ code: "TOO_MANY_REQUESTS";
367
+ name: "APIError";
368
+ error: string;
369
+ };
370
+ headers: Headers;
371
+ } | {
372
+ status: 500;
373
+ body: {
374
+ code: "INTERNAL_SERVER_ERROR";
375
+ name: "APIError";
376
+ error: string;
377
+ };
378
+ headers: Headers;
379
+ } | {
380
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
381
+ body: unknown;
382
+ headers: Headers;
383
+ }>;
384
+ delete: (args: {
385
+ headers: {
386
+ authorization: string;
387
+ };
388
+ cache?: RequestCache | undefined;
389
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
390
+ extraHeaders?: ({
391
+ authorization?: undefined;
392
+ } & Record<string, string | undefined>) | undefined;
393
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
394
+ }) => Promise<{
395
+ status: 200;
396
+ body: null;
397
+ headers: Headers;
398
+ } | {
399
+ status: 400;
400
+ body: {
401
+ name: "ZodError";
402
+ issues: import("zod").objectOutputType<{
403
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
404
+ message: import("zod").ZodOptional<import("zod").ZodString>;
405
+ code: import("zod").ZodNativeEnum<{
406
+ invalid_type: "invalid_type";
407
+ invalid_literal: "invalid_literal";
408
+ custom: "custom";
409
+ invalid_union: "invalid_union";
410
+ invalid_union_discriminator: "invalid_union_discriminator";
411
+ invalid_enum_value: "invalid_enum_value";
412
+ unrecognized_keys: "unrecognized_keys";
413
+ invalid_arguments: "invalid_arguments";
414
+ invalid_return_type: "invalid_return_type";
415
+ invalid_date: "invalid_date";
416
+ invalid_string: "invalid_string";
417
+ too_small: "too_small";
418
+ too_big: "too_big";
419
+ invalid_intersection_types: "invalid_intersection_types";
420
+ not_multiple_of: "not_multiple_of";
421
+ not_finite: "not_finite";
422
+ }>;
423
+ }, import("zod").ZodAny, "strip">[];
424
+ };
425
+ headers: Headers;
426
+ } | {
427
+ status: 401;
428
+ body: {
429
+ code: "UNAUTHORIZED";
430
+ name: "APIError";
431
+ error: "Invalid CDN token";
432
+ };
433
+ headers: Headers;
434
+ } | {
435
+ status: 404;
436
+ body: {
437
+ code: "NOT_FOUND";
438
+ name: "APIError";
439
+ error: "Service asset not found";
440
+ };
441
+ headers: Headers;
442
+ } | {
443
+ status: 500;
444
+ body: {
445
+ code: "INTERNAL_SERVER_ERROR";
446
+ name: "APIError";
447
+ error: string;
448
+ };
449
+ headers: Headers;
450
+ } | {
451
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 403 | 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;
452
+ body: unknown;
453
+ headers: Headers;
454
+ }>;
455
+ };
456
+ stats: {
457
+ global: (args?: {
458
+ cache?: RequestCache | undefined;
459
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
460
+ extraHeaders?: Record<string, string | undefined> | undefined;
461
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
462
+ } | undefined) => Promise<{
463
+ status: 200;
464
+ body: {
465
+ record_count: number;
466
+ total_size: number;
467
+ max_size: number;
468
+ };
469
+ headers: Headers;
470
+ } | {
471
+ status: 500;
472
+ body: {
473
+ code: "INTERNAL_SERVER_ERROR";
474
+ name: "APIError";
475
+ error: string;
476
+ };
477
+ headers: Headers;
478
+ } | {
479
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 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;
480
+ body: unknown;
481
+ headers: Headers;
482
+ }>;
483
+ };
484
+ upload: {
485
+ upload: (args: {
486
+ body: FormData | {
487
+ data: string;
488
+ file?: any;
489
+ };
490
+ cache?: RequestCache | undefined;
491
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
492
+ extraHeaders?: ({
493
+ authorization?: undefined;
494
+ } & Record<string, string | undefined>) | undefined;
495
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
496
+ headers?: {
497
+ authorization?: string | undefined;
498
+ } | undefined;
499
+ }) => Promise<{
500
+ status: 200;
501
+ body: null;
502
+ headers: Headers;
503
+ } | {
504
+ status: 400;
505
+ body: {
506
+ name: "ZodError";
507
+ issues: import("zod").objectOutputType<{
508
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
509
+ message: import("zod").ZodOptional<import("zod").ZodString>;
510
+ code: import("zod").ZodNativeEnum<{
511
+ invalid_type: "invalid_type";
512
+ invalid_literal: "invalid_literal";
513
+ custom: "custom";
514
+ invalid_union: "invalid_union";
515
+ invalid_union_discriminator: "invalid_union_discriminator";
516
+ invalid_enum_value: "invalid_enum_value";
517
+ unrecognized_keys: "unrecognized_keys";
518
+ invalid_arguments: "invalid_arguments";
519
+ invalid_return_type: "invalid_return_type";
520
+ invalid_date: "invalid_date";
521
+ invalid_string: "invalid_string";
522
+ too_small: "too_small";
523
+ too_big: "too_big";
524
+ invalid_intersection_types: "invalid_intersection_types";
525
+ not_multiple_of: "not_multiple_of";
526
+ not_finite: "not_finite";
527
+ }>;
528
+ }, import("zod").ZodAny, "strip">[];
529
+ } | {
530
+ code: "BAD_REQUEST";
531
+ name: "APIError";
532
+ error: string;
533
+ };
534
+ headers: Headers;
535
+ } | {
536
+ status: 401;
537
+ body: {
538
+ code: "UNAUTHORIZED";
539
+ name: "APIError";
540
+ error: "Unauthorized";
541
+ };
542
+ headers: Headers;
543
+ } | {
544
+ status: 403;
545
+ body: {
546
+ code: "FORBIDDEN";
547
+ name: "APIError";
548
+ error: "Forbidden";
549
+ };
550
+ headers: Headers;
551
+ } | {
552
+ status: 500;
553
+ body: {
554
+ code: "INTERNAL_SERVER_ERROR";
555
+ name: "APIError";
556
+ error: string;
557
+ };
558
+ headers: Headers;
559
+ } | {
560
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 404 | 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;
561
+ body: unknown;
562
+ headers: Headers;
563
+ }>;
564
+ uploadInit: (args: {
565
+ body: {
566
+ filename: string;
567
+ active: boolean;
568
+ visible: boolean;
569
+ role: number;
570
+ size: number;
571
+ mimeType: string;
572
+ parts: number;
573
+ };
574
+ cache?: RequestCache | undefined;
575
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
576
+ extraHeaders?: Record<string, string | undefined> | undefined;
577
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
578
+ }) => Promise<{
579
+ status: 200;
580
+ body: {
581
+ uploadId: string;
582
+ };
583
+ headers: Headers;
584
+ } | {
585
+ status: 400;
586
+ body: {
587
+ name: "ZodError";
588
+ issues: import("zod").objectOutputType<{
589
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
590
+ message: import("zod").ZodOptional<import("zod").ZodString>;
591
+ code: import("zod").ZodNativeEnum<{
592
+ invalid_type: "invalid_type";
593
+ invalid_literal: "invalid_literal";
594
+ custom: "custom";
595
+ invalid_union: "invalid_union";
596
+ invalid_union_discriminator: "invalid_union_discriminator";
597
+ invalid_enum_value: "invalid_enum_value";
598
+ unrecognized_keys: "unrecognized_keys";
599
+ invalid_arguments: "invalid_arguments";
600
+ invalid_return_type: "invalid_return_type";
601
+ invalid_date: "invalid_date";
602
+ invalid_string: "invalid_string";
603
+ too_small: "too_small";
604
+ too_big: "too_big";
605
+ invalid_intersection_types: "invalid_intersection_types";
606
+ not_multiple_of: "not_multiple_of";
607
+ not_finite: "not_finite";
608
+ }>;
609
+ }, import("zod").ZodAny, "strip">[];
610
+ } | {
611
+ code: "BAD_REQUEST";
612
+ name: "APIError";
613
+ error: string;
614
+ };
615
+ headers: Headers;
616
+ } | {
617
+ status: 401;
618
+ body: {
619
+ code: "UNAUTHORIZED";
620
+ name: "APIError";
621
+ error: "Unauthorized";
622
+ };
623
+ headers: Headers;
624
+ } | {
625
+ status: 403;
626
+ body: {
627
+ code: "FORBIDDEN";
628
+ name: "APIError";
629
+ error: "Forbidden";
630
+ };
631
+ headers: Headers;
632
+ } | {
633
+ status: 500;
634
+ body: {
635
+ code: "INTERNAL_SERVER_ERROR";
636
+ name: "APIError";
637
+ error: string;
638
+ };
639
+ headers: Headers;
640
+ } | {
641
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 404 | 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;
642
+ body: unknown;
643
+ headers: Headers;
644
+ }>;
645
+ uploadPart: (args: {
646
+ body: FormData | {
647
+ file?: any;
648
+ };
649
+ params: {
650
+ upload_id: string;
651
+ part: string;
652
+ };
653
+ cache?: RequestCache | undefined;
654
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
655
+ extraHeaders?: Record<string, string | undefined> | undefined;
656
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
657
+ }) => Promise<{
658
+ status: 200;
659
+ body: null;
660
+ headers: Headers;
661
+ } | {
662
+ status: 400;
663
+ body: {
664
+ name: "ZodError";
665
+ issues: import("zod").objectOutputType<{
666
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
667
+ message: import("zod").ZodOptional<import("zod").ZodString>;
668
+ code: import("zod").ZodNativeEnum<{
669
+ invalid_type: "invalid_type";
670
+ invalid_literal: "invalid_literal";
671
+ custom: "custom";
672
+ invalid_union: "invalid_union";
673
+ invalid_union_discriminator: "invalid_union_discriminator";
674
+ invalid_enum_value: "invalid_enum_value";
675
+ unrecognized_keys: "unrecognized_keys";
676
+ invalid_arguments: "invalid_arguments";
677
+ invalid_return_type: "invalid_return_type";
678
+ invalid_date: "invalid_date";
679
+ invalid_string: "invalid_string";
680
+ too_small: "too_small";
681
+ too_big: "too_big";
682
+ invalid_intersection_types: "invalid_intersection_types";
683
+ not_multiple_of: "not_multiple_of";
684
+ not_finite: "not_finite";
685
+ }>;
686
+ }, import("zod").ZodAny, "strip">[];
687
+ } | {
688
+ code: "BAD_REQUEST";
689
+ name: "APIError";
690
+ error: string;
691
+ };
692
+ headers: Headers;
693
+ } | {
694
+ status: 401;
695
+ body: {
696
+ code: "UNAUTHORIZED";
697
+ name: "APIError";
698
+ error: "Unauthorized";
699
+ };
700
+ headers: Headers;
701
+ } | {
702
+ status: 403;
703
+ body: {
704
+ code: "FORBIDDEN";
705
+ name: "APIError";
706
+ error: "Forbidden";
707
+ };
708
+ headers: Headers;
709
+ } | {
710
+ status: 404;
711
+ body: {
712
+ code: "NOT_FOUND";
713
+ name: "APIError";
714
+ error: string;
715
+ };
716
+ headers: Headers;
717
+ } | {
718
+ status: 409;
719
+ body: {
720
+ code: "CONFLICT";
721
+ name: "APIError";
722
+ error: string;
723
+ };
724
+ headers: Headers;
725
+ } | {
726
+ status: 500;
727
+ body: {
728
+ code: "INTERNAL_SERVER_ERROR";
729
+ name: "APIError";
730
+ error: string;
731
+ };
732
+ headers: Headers;
733
+ } | {
734
+ 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;
735
+ body: unknown;
736
+ headers: Headers;
737
+ }>;
738
+ uploadEnd: (args: {
739
+ params: {
740
+ upload_id: string;
741
+ };
742
+ cache?: RequestCache | undefined;
743
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
744
+ extraHeaders?: Record<string, string | undefined> | undefined;
745
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
746
+ }) => Promise<{
747
+ status: 200;
748
+ body: null;
749
+ headers: Headers;
750
+ } | {
751
+ status: 400;
752
+ body: {
753
+ name: "ZodError";
754
+ issues: import("zod").objectOutputType<{
755
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
756
+ message: import("zod").ZodOptional<import("zod").ZodString>;
757
+ code: import("zod").ZodNativeEnum<{
758
+ invalid_type: "invalid_type";
759
+ invalid_literal: "invalid_literal";
760
+ custom: "custom";
761
+ invalid_union: "invalid_union";
762
+ invalid_union_discriminator: "invalid_union_discriminator";
763
+ invalid_enum_value: "invalid_enum_value";
764
+ unrecognized_keys: "unrecognized_keys";
765
+ invalid_arguments: "invalid_arguments";
766
+ invalid_return_type: "invalid_return_type";
767
+ invalid_date: "invalid_date";
768
+ invalid_string: "invalid_string";
769
+ too_small: "too_small";
770
+ too_big: "too_big";
771
+ invalid_intersection_types: "invalid_intersection_types";
772
+ not_multiple_of: "not_multiple_of";
773
+ not_finite: "not_finite";
774
+ }>;
775
+ }, import("zod").ZodAny, "strip">[];
776
+ };
777
+ headers: Headers;
778
+ } | {
779
+ status: 401;
780
+ body: {
781
+ code: "UNAUTHORIZED";
782
+ name: "APIError";
783
+ error: "Unauthorized";
784
+ };
785
+ headers: Headers;
786
+ } | {
787
+ status: 403;
788
+ body: {
789
+ code: "FORBIDDEN";
790
+ name: "APIError";
791
+ error: "Forbidden";
792
+ };
793
+ headers: Headers;
794
+ } | {
795
+ status: 404;
796
+ body: {
797
+ code: "NOT_FOUND";
798
+ name: "APIError";
799
+ error: string;
800
+ };
801
+ headers: Headers;
802
+ } | {
803
+ status: 500;
804
+ body: {
805
+ code: "INTERNAL_SERVER_ERROR";
806
+ name: "APIError";
807
+ error: string;
808
+ };
809
+ headers: Headers;
810
+ } | {
811
+ 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;
812
+ body: unknown;
813
+ headers: Headers;
814
+ }>;
815
+ };
816
+ publicKey: (args?: {
817
+ cache?: RequestCache | undefined;
818
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
819
+ extraHeaders?: Record<string, string | undefined> | undefined;
820
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
821
+ } | undefined) => Promise<{
822
+ status: 200;
823
+ body: {
824
+ publicKey: string;
825
+ };
826
+ headers: Headers;
827
+ } | {
828
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
829
+ body: unknown;
830
+ headers: Headers;
831
+ }>;
832
+ auth: {
833
+ access: (args?: {
834
+ cache?: RequestCache | undefined;
835
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
836
+ extraHeaders?: ({
837
+ authorization?: undefined;
838
+ } & Record<string, string | undefined>) | undefined;
839
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
840
+ headers?: {
841
+ authorization?: string | undefined;
842
+ } | undefined;
843
+ } | undefined) => Promise<{
844
+ status: 200;
845
+ body: {
846
+ access: boolean;
847
+ };
848
+ headers: Headers;
849
+ } | {
850
+ status: 500;
851
+ body: {
852
+ code: "INTERNAL_SERVER_ERROR";
853
+ name: "APIError";
854
+ error: string;
855
+ };
856
+ headers: Headers;
857
+ } | {
858
+ status: 201 | 202 | 203 | 204 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 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;
859
+ body: unknown;
860
+ headers: Headers;
861
+ }>;
862
+ };
863
+ endpoint: {
864
+ create: (args: {
865
+ body: {
866
+ endpoint: string;
867
+ storage_id: string;
868
+ };
869
+ cache?: RequestCache | undefined;
870
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
871
+ extraHeaders?: ({
872
+ authorization?: undefined;
873
+ } & Record<string, string | undefined>) | undefined;
874
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
875
+ headers?: {
876
+ authorization?: string | undefined;
877
+ } | undefined;
878
+ }) => Promise<{
879
+ status: 200;
880
+ body: null;
881
+ headers: Headers;
882
+ } | {
883
+ status: 400;
884
+ body: {
885
+ name: "ZodError";
886
+ issues: import("zod").objectOutputType<{
887
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
888
+ message: import("zod").ZodOptional<import("zod").ZodString>;
889
+ code: import("zod").ZodNativeEnum<{
890
+ invalid_type: "invalid_type";
891
+ invalid_literal: "invalid_literal";
892
+ custom: "custom";
893
+ invalid_union: "invalid_union";
894
+ invalid_union_discriminator: "invalid_union_discriminator";
895
+ invalid_enum_value: "invalid_enum_value";
896
+ unrecognized_keys: "unrecognized_keys";
897
+ invalid_arguments: "invalid_arguments";
898
+ invalid_return_type: "invalid_return_type";
899
+ invalid_date: "invalid_date";
900
+ invalid_string: "invalid_string";
901
+ too_small: "too_small";
902
+ too_big: "too_big";
903
+ invalid_intersection_types: "invalid_intersection_types";
904
+ not_multiple_of: "not_multiple_of";
905
+ not_finite: "not_finite";
906
+ }>;
907
+ }, import("zod").ZodAny, "strip">[];
908
+ };
909
+ headers: Headers;
910
+ } | {
911
+ status: 401;
912
+ body: {
913
+ code: "UNAUTHORIZED";
914
+ name: "APIError";
915
+ error: "Unauthorized";
916
+ };
917
+ headers: Headers;
918
+ } | {
919
+ status: 403;
920
+ body: {
921
+ code: "FORBIDDEN";
922
+ name: "APIError";
923
+ error: "Forbidden";
924
+ };
925
+ headers: Headers;
926
+ } | {
927
+ status: 404;
928
+ body: {
929
+ code: "NOT_FOUND";
930
+ name: "APIError";
931
+ error: "Record not found";
932
+ };
933
+ headers: Headers;
934
+ } | {
935
+ status: 409;
936
+ body: {
937
+ code: "CONFLICT";
938
+ name: "APIError";
939
+ error: "Endpoint already exists";
940
+ };
941
+ headers: Headers;
942
+ } | {
943
+ status: 500;
944
+ body: {
945
+ code: "INTERNAL_SERVER_ERROR";
946
+ name: "APIError";
947
+ error: string;
948
+ };
949
+ headers: Headers;
950
+ } | {
951
+ 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;
952
+ body: unknown;
953
+ headers: Headers;
954
+ }>;
955
+ delete: (args: {
956
+ body: {
957
+ endpoint: string;
958
+ };
959
+ cache?: RequestCache | undefined;
960
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
961
+ extraHeaders?: ({
962
+ authorization?: undefined;
963
+ } & Record<string, string | undefined>) | undefined;
964
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
965
+ headers?: {
966
+ authorization?: string | undefined;
967
+ } | undefined;
968
+ }) => Promise<{
969
+ status: 200;
970
+ body: null;
971
+ headers: Headers;
972
+ } | {
973
+ status: 400;
974
+ body: {
975
+ name: "ZodError";
976
+ issues: import("zod").objectOutputType<{
977
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
978
+ message: import("zod").ZodOptional<import("zod").ZodString>;
979
+ code: import("zod").ZodNativeEnum<{
980
+ invalid_type: "invalid_type";
981
+ invalid_literal: "invalid_literal";
982
+ custom: "custom";
983
+ invalid_union: "invalid_union";
984
+ invalid_union_discriminator: "invalid_union_discriminator";
985
+ invalid_enum_value: "invalid_enum_value";
986
+ unrecognized_keys: "unrecognized_keys";
987
+ invalid_arguments: "invalid_arguments";
988
+ invalid_return_type: "invalid_return_type";
989
+ invalid_date: "invalid_date";
990
+ invalid_string: "invalid_string";
991
+ too_small: "too_small";
992
+ too_big: "too_big";
993
+ invalid_intersection_types: "invalid_intersection_types";
994
+ not_multiple_of: "not_multiple_of";
995
+ not_finite: "not_finite";
996
+ }>;
997
+ }, import("zod").ZodAny, "strip">[];
998
+ };
999
+ headers: Headers;
1000
+ } | {
1001
+ status: 401;
1002
+ body: {
1003
+ code: "UNAUTHORIZED";
1004
+ name: "APIError";
1005
+ error: "Unauthorized";
1006
+ };
1007
+ headers: Headers;
1008
+ } | {
1009
+ status: 403;
1010
+ body: {
1011
+ code: "FORBIDDEN";
1012
+ name: "APIError";
1013
+ error: "Forbidden";
1014
+ };
1015
+ headers: Headers;
1016
+ } | {
1017
+ status: 404;
1018
+ body: {
1019
+ code: "NOT_FOUND";
1020
+ name: "APIError";
1021
+ error: "Endpoint not found";
1022
+ };
1023
+ headers: Headers;
1024
+ } | {
1025
+ status: 500;
1026
+ body: {
1027
+ code: "INTERNAL_SERVER_ERROR";
1028
+ name: "APIError";
1029
+ error: string;
1030
+ };
1031
+ headers: Headers;
1032
+ } | {
1033
+ 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;
1034
+ body: unknown;
1035
+ headers: Headers;
1036
+ }>;
1037
+ };
1038
+ };
1039
+ export declare function createSocket(origin: string): CdnClientSocket;