@tailorkit/client-platform 0.1.0-beta.1 → 0.1.0-beta.3

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.
@@ -0,0 +1,508 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export type ClientOptions = {
4
+ baseUrl: "https://tailorkit.dev/api/platform" | (string & {});
5
+ };
6
+
7
+ export type AppsListData = {
8
+ body?: never;
9
+ path?: never;
10
+ query: {
11
+ page?: number;
12
+ pageSize?: number;
13
+ scopeId: string;
14
+ };
15
+ url: "/apps";
16
+ };
17
+
18
+ export type AppsListResponses = {
19
+ /**
20
+ * OK
21
+ */
22
+ 200: {
23
+ items: Array<{
24
+ id: string;
25
+ publicId: string;
26
+ projectId: string;
27
+ scopeId: string;
28
+ name: string;
29
+ description: string | null;
30
+ currentDeploymentId: string | null;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ currentDeployment: {
34
+ id: string;
35
+ publicId: string;
36
+ appId: string;
37
+ status: "uploading" | "deploying" | "verifying" | "published";
38
+ clientEntryFileId: string | null;
39
+ createdAt: string;
40
+ updatedAt: string;
41
+ } | null;
42
+ clientPath?: string;
43
+ }>;
44
+ pagination: {
45
+ hasMore: boolean;
46
+ page: number;
47
+ pageSize: number;
48
+ };
49
+ };
50
+ };
51
+
52
+ export type AppsListResponse = AppsListResponses[keyof AppsListResponses];
53
+
54
+ export type AppsCreateData = {
55
+ body: {
56
+ name: string;
57
+ description: string | null;
58
+ scopeId: string;
59
+ };
60
+ path?: never;
61
+ query?: never;
62
+ url: "/apps";
63
+ };
64
+
65
+ export type AppsCreateResponses = {
66
+ /**
67
+ * OK
68
+ */
69
+ 200: {
70
+ id: string;
71
+ publicId: string;
72
+ projectId: string;
73
+ scopeId: string;
74
+ name: string;
75
+ description: string | null;
76
+ currentDeploymentId: string | null;
77
+ createdAt: string;
78
+ updatedAt: string;
79
+ currentDeployment: {
80
+ id: string;
81
+ publicId: string;
82
+ appId: string;
83
+ status: "uploading" | "deploying" | "verifying" | "published";
84
+ clientEntryFileId: string | null;
85
+ createdAt: string;
86
+ updatedAt: string;
87
+ } | null;
88
+ clientPath?: string;
89
+ };
90
+ };
91
+
92
+ export type AppsCreateResponse = AppsCreateResponses[keyof AppsCreateResponses];
93
+
94
+ export type AppsDeleteData = {
95
+ body?: never;
96
+ path: {
97
+ appId: string;
98
+ };
99
+ query: {
100
+ scopeId: string;
101
+ };
102
+ url: "/apps/{appId}";
103
+ };
104
+
105
+ export type AppsDeleteResponses = {
106
+ /**
107
+ * OK
108
+ */
109
+ 200: {
110
+ id: string;
111
+ };
112
+ };
113
+
114
+ export type AppsDeleteResponse = AppsDeleteResponses[keyof AppsDeleteResponses];
115
+
116
+ export type AppsGetData = {
117
+ body?: never;
118
+ path: {
119
+ appId: string;
120
+ };
121
+ query: {
122
+ scopeId: string;
123
+ };
124
+ url: "/apps/{appId}";
125
+ };
126
+
127
+ export type AppsGetResponses = {
128
+ /**
129
+ * OK
130
+ */
131
+ 200: {
132
+ id: string;
133
+ publicId: string;
134
+ projectId: string;
135
+ scopeId: string;
136
+ name: string;
137
+ description: string | null;
138
+ currentDeploymentId: string | null;
139
+ createdAt: string;
140
+ updatedAt: string;
141
+ currentDeployment: {
142
+ id: string;
143
+ publicId: string;
144
+ appId: string;
145
+ status: "uploading" | "deploying" | "verifying" | "published";
146
+ clientEntryFileId: string | null;
147
+ createdAt: string;
148
+ updatedAt: string;
149
+ } | null;
150
+ clientPath?: string;
151
+ };
152
+ };
153
+
154
+ export type AppsGetResponse = AppsGetResponses[keyof AppsGetResponses];
155
+
156
+ export type AppsUpdateData = {
157
+ body: {
158
+ name: string;
159
+ description: string | null;
160
+ };
161
+ path: {
162
+ appId: string;
163
+ };
164
+ query: {
165
+ scopeId: string;
166
+ };
167
+ url: "/apps/{appId}";
168
+ };
169
+
170
+ export type AppsUpdateResponses = {
171
+ /**
172
+ * OK
173
+ */
174
+ 200: {
175
+ id: string;
176
+ publicId: string;
177
+ projectId: string;
178
+ scopeId: string;
179
+ name: string;
180
+ description: string | null;
181
+ currentDeploymentId: string | null;
182
+ createdAt: string;
183
+ updatedAt: string;
184
+ currentDeployment: {
185
+ id: string;
186
+ publicId: string;
187
+ appId: string;
188
+ status: "uploading" | "deploying" | "verifying" | "published";
189
+ clientEntryFileId: string | null;
190
+ createdAt: string;
191
+ updatedAt: string;
192
+ } | null;
193
+ clientPath?: string;
194
+ };
195
+ };
196
+
197
+ export type AppsUpdateResponse = AppsUpdateResponses[keyof AppsUpdateResponses];
198
+
199
+ export type AppsDeployData = {
200
+ body: {
201
+ deploymentId: string;
202
+ };
203
+ path: {
204
+ appId: string;
205
+ };
206
+ query: {
207
+ scopeId: string;
208
+ };
209
+ url: "/apps/{appId}/deploy";
210
+ };
211
+
212
+ export type AppsDeployResponses = {
213
+ /**
214
+ * OK
215
+ */
216
+ 200: {
217
+ id: string;
218
+ publicId: string;
219
+ projectId: string;
220
+ scopeId: string;
221
+ name: string;
222
+ description: string | null;
223
+ currentDeploymentId: string | null;
224
+ createdAt: string;
225
+ updatedAt: string;
226
+ currentDeployment: {
227
+ id: string;
228
+ publicId: string;
229
+ appId: string;
230
+ status: "uploading" | "deploying" | "verifying" | "published";
231
+ clientEntryFileId: string | null;
232
+ createdAt: string;
233
+ updatedAt: string;
234
+ } | null;
235
+ clientPath?: string;
236
+ };
237
+ };
238
+
239
+ export type AppsDeployResponse = AppsDeployResponses[keyof AppsDeployResponses];
240
+
241
+ export type CliAuthApproveData = {
242
+ body: {
243
+ scopeId: string;
244
+ userCode: string;
245
+ };
246
+ path?: never;
247
+ query?: never;
248
+ url: "/cli-auth/approve";
249
+ };
250
+
251
+ export type CliAuthApproveResponses = {
252
+ /**
253
+ * OK
254
+ */
255
+ 200: {
256
+ id: string;
257
+ };
258
+ };
259
+
260
+ export type CliAuthApproveResponse = CliAuthApproveResponses[keyof CliAuthApproveResponses];
261
+
262
+ export type CliAuthDenyData = {
263
+ body: {
264
+ userCode: string;
265
+ };
266
+ path?: never;
267
+ query?: never;
268
+ url: "/cli-auth/deny";
269
+ };
270
+
271
+ export type CliAuthDenyResponses = {
272
+ /**
273
+ * OK
274
+ */
275
+ 200: {
276
+ id: string;
277
+ };
278
+ };
279
+
280
+ export type CliAuthDenyResponse = CliAuthDenyResponses[keyof CliAuthDenyResponses];
281
+
282
+ export type CliAuthPollData = {
283
+ body: {
284
+ deviceCode: string;
285
+ };
286
+ path?: never;
287
+ query?: never;
288
+ url: "/cli-auth/poll";
289
+ };
290
+
291
+ export type CliAuthPollResponses = {
292
+ /**
293
+ * OK
294
+ */
295
+ 200:
296
+ | {
297
+ status: "pending";
298
+ }
299
+ | {
300
+ status: "denied";
301
+ }
302
+ | {
303
+ deployToken: string;
304
+ scopeId: string;
305
+ status: "approved";
306
+ }
307
+ | {
308
+ status: "expired";
309
+ };
310
+ };
311
+
312
+ export type CliAuthPollResponse = CliAuthPollResponses[keyof CliAuthPollResponses];
313
+
314
+ export type CliAuthStartData = {
315
+ body: {
316
+ [key: string]: unknown;
317
+ };
318
+ path?: never;
319
+ query?: never;
320
+ url: "/cli-auth/start";
321
+ };
322
+
323
+ export type CliAuthStartResponses = {
324
+ /**
325
+ * OK
326
+ */
327
+ 200: {
328
+ deviceCode: string;
329
+ expiresAt: string;
330
+ userCode: string;
331
+ };
332
+ };
333
+
334
+ export type CliAuthStartResponse = CliAuthStartResponses[keyof CliAuthStartResponses];
335
+
336
+ export type CliAuthVerifyTokenData = {
337
+ body: {
338
+ deployToken: string;
339
+ };
340
+ path?: never;
341
+ query?: never;
342
+ url: "/cli-auth/verify-token";
343
+ };
344
+
345
+ export type CliAuthVerifyTokenResponses = {
346
+ /**
347
+ * OK
348
+ */
349
+ 200: {
350
+ scopeId: string;
351
+ };
352
+ };
353
+
354
+ export type CliAuthVerifyTokenResponse =
355
+ CliAuthVerifyTokenResponses[keyof CliAuthVerifyTokenResponses];
356
+
357
+ export type DeploymentsListData = {
358
+ body?: never;
359
+ path?: never;
360
+ query: {
361
+ page?: number;
362
+ pageSize?: number;
363
+ appId: string;
364
+ scopeId: string;
365
+ };
366
+ url: "/deployments";
367
+ };
368
+
369
+ export type DeploymentsListResponses = {
370
+ /**
371
+ * OK
372
+ */
373
+ 200: {
374
+ items: Array<{
375
+ id: string;
376
+ publicId: string;
377
+ appId: string;
378
+ status: "uploading" | "deploying" | "verifying" | "published";
379
+ clientEntryFileId: string | null;
380
+ createdAt: string;
381
+ updatedAt: string;
382
+ }>;
383
+ pagination: {
384
+ hasMore: boolean;
385
+ page: number;
386
+ pageSize: number;
387
+ };
388
+ };
389
+ };
390
+
391
+ export type DeploymentsListResponse = DeploymentsListResponses[keyof DeploymentsListResponses];
392
+
393
+ export type DeploymentsCreateData = {
394
+ body: {
395
+ appId: string;
396
+ assets: [
397
+ {
398
+ contentType: "application/javascript";
399
+ encoding: "utf-8";
400
+ checksum: string;
401
+ contentLength: number;
402
+ objectKey: "client.js";
403
+ },
404
+ ];
405
+ scopeId: string;
406
+ };
407
+ path?: never;
408
+ query?: never;
409
+ url: "/deployments";
410
+ };
411
+
412
+ export type DeploymentsCreateResponses = {
413
+ /**
414
+ * OK
415
+ */
416
+ 200: {
417
+ assets: [
418
+ {
419
+ file: {
420
+ id: string;
421
+ appDeploymentId: string;
422
+ objectKey: string;
423
+ contentType: "application/javascript";
424
+ encoding: "utf-8";
425
+ contentLength: number;
426
+ checksum: string | null;
427
+ status: "uploading" | "verifying" | "verified" | "failed";
428
+ createdAt: string;
429
+ updatedAt: string;
430
+ };
431
+ headers?: {
432
+ [key: string]: string;
433
+ };
434
+ uploadUrl: string;
435
+ },
436
+ ];
437
+ deployment: {
438
+ id: string;
439
+ publicId: string;
440
+ appId: string;
441
+ status: "uploading" | "deploying" | "verifying" | "published";
442
+ clientEntryFileId: string | null;
443
+ createdAt: string;
444
+ updatedAt: string;
445
+ };
446
+ };
447
+ };
448
+
449
+ export type DeploymentsCreateResponse =
450
+ DeploymentsCreateResponses[keyof DeploymentsCreateResponses];
451
+
452
+ export type DeploymentsGetData = {
453
+ body?: never;
454
+ path: {
455
+ deploymentId: string;
456
+ };
457
+ query: {
458
+ scopeId: string;
459
+ };
460
+ url: "/deployments/{deploymentId}";
461
+ };
462
+
463
+ export type DeploymentsGetResponses = {
464
+ /**
465
+ * OK
466
+ */
467
+ 200: {
468
+ id: string;
469
+ publicId: string;
470
+ appId: string;
471
+ status: "uploading" | "deploying" | "verifying" | "published";
472
+ clientEntryFileId: string | null;
473
+ createdAt: string;
474
+ updatedAt: string;
475
+ };
476
+ };
477
+
478
+ export type DeploymentsGetResponse = DeploymentsGetResponses[keyof DeploymentsGetResponses];
479
+
480
+ export type DeploymentsPublishData = {
481
+ body: {
482
+ scopeId: string;
483
+ rollout?: boolean;
484
+ };
485
+ path: {
486
+ deploymentId: string;
487
+ };
488
+ query?: never;
489
+ url: "/deployments/{deploymentId}";
490
+ };
491
+
492
+ export type DeploymentsPublishResponses = {
493
+ /**
494
+ * OK
495
+ */
496
+ 200: {
497
+ id: string;
498
+ publicId: string;
499
+ appId: string;
500
+ status: "uploading" | "deploying" | "verifying" | "published";
501
+ clientEntryFileId: string | null;
502
+ createdAt: string;
503
+ updatedAt: string;
504
+ };
505
+ };
506
+
507
+ export type DeploymentsPublishResponse =
508
+ DeploymentsPublishResponses[keyof DeploymentsPublishResponses];
package/src/client.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { CreateClientConfig } from "./client/client";
2
+
3
+ export const createClientConfig: CreateClientConfig = (config = {}) => ({
4
+ ...config,
5
+ baseUrl: config.baseUrl ?? "https://tailorkit.dev/api/platform",
6
+ });
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./client/index";
2
+ export * from "./client";