@tailorkit/client-platform 0.1.0-beta.14 → 0.1.0-beta.17

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.
@@ -3,9 +3,29 @@ import {
3
3
  } from "./chunk-TZBKIIYQ.js";
4
4
 
5
5
  // src/client/sdk.gen.ts
6
- var appsList = (options) => (options.client ?? client).get({
7
- url: "/apps",
8
- ...options
6
+ var appsRuntimeSession = (options) => (options.client ?? client).post({
7
+ url: "/apps/{appId}/runtime/session",
8
+ ...options,
9
+ headers: {
10
+ "Content-Type": "application/json",
11
+ ...options.headers
12
+ }
13
+ });
14
+ var appsList = (options) => (options.client ?? client).post({
15
+ url: "/apps/list",
16
+ ...options,
17
+ headers: {
18
+ "Content-Type": "application/json",
19
+ ...options.headers
20
+ }
21
+ });
22
+ var appsGet = (options) => (options.client ?? client).post({
23
+ url: "/apps/{appId}/lookup",
24
+ ...options,
25
+ headers: {
26
+ "Content-Type": "application/json",
27
+ ...options.headers
28
+ }
9
29
  });
10
30
  var appsCreate = (options) => (options.client ?? client).post({
11
31
  url: "/apps",
@@ -17,11 +37,11 @@ var appsCreate = (options) => (options.client ?? client).post({
17
37
  });
18
38
  var appsDelete = (options) => (options.client ?? client).delete({
19
39
  url: "/apps/{appId}",
20
- ...options
21
- });
22
- var appsGet = (options) => (options.client ?? client).get({
23
- url: "/apps/{appId}",
24
- ...options
40
+ ...options,
41
+ headers: {
42
+ "Content-Type": "application/json",
43
+ ...options.headers
44
+ }
25
45
  });
26
46
  var appsUpdate = (options) => (options.client ?? client).put({
27
47
  url: "/apps/{appId}",
@@ -79,9 +99,21 @@ var cliAuthVerifyToken = (options) => (options.client ?? client).post({
79
99
  ...options.headers
80
100
  }
81
101
  });
82
- var deploymentsList = (options) => (options.client ?? client).get({
83
- url: "/deployments",
84
- ...options
102
+ var deploymentsList = (options) => (options.client ?? client).post({
103
+ url: "/deployments/list",
104
+ ...options,
105
+ headers: {
106
+ "Content-Type": "application/json",
107
+ ...options.headers
108
+ }
109
+ });
110
+ var deploymentsGet = (options) => (options.client ?? client).post({
111
+ url: "/deployments/{deploymentId}/lookup",
112
+ ...options,
113
+ headers: {
114
+ "Content-Type": "application/json",
115
+ ...options.headers
116
+ }
85
117
  });
86
118
  var deploymentsCreate = (options) => (options.client ?? client).post({
87
119
  url: "/deployments",
@@ -91,10 +123,6 @@ var deploymentsCreate = (options) => (options.client ?? client).post({
91
123
  ...options.headers
92
124
  }
93
125
  });
94
- var deploymentsGet = (options) => (options.client ?? client).get({
95
- url: "/deployments/{deploymentId}",
96
- ...options
97
- });
98
126
  var deploymentsPublish = (options) => (options.client ?? client).post({
99
127
  url: "/deployments/{deploymentId}",
100
128
  ...options,
@@ -103,6 +131,14 @@ var deploymentsPublish = (options) => (options.client ?? client).post({
103
131
  ...options.headers
104
132
  }
105
133
  });
134
+ var deploymentsRuntime = (options) => (options.client ?? client).post({
135
+ url: "/apps/{appId}/runtime",
136
+ ...options,
137
+ headers: {
138
+ "Content-Type": "application/json",
139
+ ...options.headers
140
+ }
141
+ });
106
142
  var previewStart = (options) => (options.client ?? client).post({
107
143
  url: "/preview/start",
108
144
  ...options,
@@ -141,10 +177,11 @@ var previewAccepted = (options) => (options.client ?? client).post({
141
177
  });
142
178
 
143
179
  export {
180
+ appsRuntimeSession,
144
181
  appsList,
182
+ appsGet,
145
183
  appsCreate,
146
184
  appsDelete,
147
- appsGet,
148
185
  appsUpdate,
149
186
  appsDeploy,
150
187
  cliAuthApprove,
@@ -153,9 +190,10 @@ export {
153
190
  cliAuthStart,
154
191
  cliAuthVerifyToken,
155
192
  deploymentsList,
156
- deploymentsCreate,
157
193
  deploymentsGet,
194
+ deploymentsCreate,
158
195
  deploymentsPublish,
196
+ deploymentsRuntime,
159
197
  previewStart,
160
198
  previewStop,
161
199
  previewInvitation,
@@ -2,6 +2,7 @@
2
2
  import { createORPCClient } from "@orpc/client";
3
3
  import { RPCLink } from "@orpc/client/websocket";
4
4
  import { z } from "zod";
5
+ var ACTIVE_PREVIEW_CONFLICT_REASON = "ACTIVE_PREVIEW_EXISTS";
5
6
  var identifier = z.string().regex(/^[A-Za-z0-9_-]{1,128}$/u);
6
7
  var base64 = z.string().max(4 * Math.ceil(256 * 1024 / 3)).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u);
7
8
  var hasControlCharacters = (value) => [...value].some((character) => (character.codePointAt(0) ?? 0) < 32);
@@ -77,7 +78,9 @@ var buildIdOutput = z.object({ buildId: identifier });
77
78
  var acceptedOutput = z.object({ accepted: z.literal(true) });
78
79
  var commitOutput = z.object({ revision: z.number().int().positive() });
79
80
  function createPreviewWebSocketClient(websocket) {
80
- const rpc = createORPCClient(new RPCLink({ websocket }));
81
+ const rpc = createORPCClient(
82
+ new RPCLink({ connect: () => websocket })
83
+ );
81
84
  return {
82
85
  beginBuild: async (input) => buildIdOutput.parse(await rpc.beginBuild(beginInput.parse(input))),
83
86
  uploadChunk: async (input) => acceptedOutput.parse(await rpc.uploadChunk(uploadInput.parse(input))),
@@ -95,6 +98,7 @@ function createPreviewWebSocketClient(websocket) {
95
98
  }
96
99
 
97
100
  export {
101
+ ACTIVE_PREVIEW_CONFLICT_REASON,
98
102
  previewFileManifestSchema,
99
103
  previewBuildManifestSchema,
100
104
  previewEventSchema,
@@ -1,2 +1,2 @@
1
- export { appsCreate, appsDelete, appsDeploy, appsGet, appsList, appsUpdate, cliAuthApprove, cliAuthDeny, cliAuthPoll, cliAuthStart, cliAuthVerifyToken, deploymentsCreate, deploymentsGet, deploymentsList, deploymentsPublish, type Options, previewAccept, previewAccepted, previewInvitation, previewStart, previewStop, } from "./sdk.gen.js";
2
- export type { AppsCreateData, AppsCreateResponse, AppsCreateResponses, AppsDeleteData, AppsDeleteResponse, AppsDeleteResponses, AppsDeployData, AppsDeployResponse, AppsDeployResponses, AppsGetData, AppsGetResponse, AppsGetResponses, AppsListData, AppsListResponse, AppsListResponses, AppsUpdateData, AppsUpdateResponse, AppsUpdateResponses, CliAuthApproveData, CliAuthApproveResponse, CliAuthApproveResponses, CliAuthDenyData, CliAuthDenyResponse, CliAuthDenyResponses, CliAuthPollData, CliAuthPollResponse, CliAuthPollResponses, CliAuthStartData, CliAuthStartResponse, CliAuthStartResponses, CliAuthVerifyTokenData, CliAuthVerifyTokenResponse, CliAuthVerifyTokenResponses, ClientOptions, DeploymentsCreateData, DeploymentsCreateResponse, DeploymentsCreateResponses, DeploymentsGetData, DeploymentsGetResponse, DeploymentsGetResponses, DeploymentsListData, DeploymentsListResponse, DeploymentsListResponses, DeploymentsPublishData, DeploymentsPublishResponse, DeploymentsPublishResponses, PreviewAcceptData, PreviewAcceptedData, PreviewAcceptedResponse, PreviewAcceptedResponses, PreviewAcceptResponse, PreviewAcceptResponses, PreviewInvitationData, PreviewInvitationResponse, PreviewInvitationResponses, PreviewStartData, PreviewStartResponse, PreviewStartResponses, PreviewStopData, PreviewStopResponse, PreviewStopResponses, } from "./types.gen.js";
1
+ export { appsCreate, appsDelete, appsDeploy, appsGet, appsList, appsRuntimeSession, appsUpdate, cliAuthApprove, cliAuthDeny, cliAuthPoll, cliAuthStart, cliAuthVerifyToken, deploymentsCreate, deploymentsGet, deploymentsList, deploymentsPublish, deploymentsRuntime, type Options, previewAccept, previewAccepted, previewInvitation, previewStart, previewStop, } from "./sdk.gen.js";
2
+ export type { AppsCreateData, AppsCreateResponse, AppsCreateResponses, AppsDeleteData, AppsDeleteResponse, AppsDeleteResponses, AppsDeployData, AppsDeployResponse, AppsDeployResponses, AppsGetData, AppsGetResponse, AppsGetResponses, AppsListData, AppsListResponse, AppsListResponses, AppsRuntimeSessionData, AppsRuntimeSessionResponse, AppsRuntimeSessionResponses, AppsUpdateData, AppsUpdateResponse, AppsUpdateResponses, CliAuthApproveData, CliAuthApproveResponse, CliAuthApproveResponses, CliAuthDenyData, CliAuthDenyResponse, CliAuthDenyResponses, CliAuthPollData, CliAuthPollResponse, CliAuthPollResponses, CliAuthStartData, CliAuthStartResponse, CliAuthStartResponses, CliAuthVerifyTokenData, CliAuthVerifyTokenResponse, CliAuthVerifyTokenResponses, ClientOptions, DeploymentsCreateData, DeploymentsCreateResponse, DeploymentsCreateResponses, DeploymentsGetData, DeploymentsGetResponse, DeploymentsGetResponses, DeploymentsListData, DeploymentsListResponse, DeploymentsListResponses, DeploymentsPublishData, DeploymentsPublishResponse, DeploymentsPublishResponses, DeploymentsRuntimeData, DeploymentsRuntimeResponse, DeploymentsRuntimeResponses, PreviewAcceptData, PreviewAcceptedData, PreviewAcceptedResponse, PreviewAcceptedResponses, PreviewAcceptResponse, PreviewAcceptResponses, PreviewInvitationData, PreviewInvitationResponse, PreviewInvitationResponses, PreviewStartData, PreviewStartResponse, PreviewStartResponses, PreviewStopData, PreviewStopResponse, PreviewStopResponses, Schema0, } from "./types.gen.js";
@@ -5,6 +5,7 @@ import {
5
5
  appsDeploy,
6
6
  appsGet,
7
7
  appsList,
8
+ appsRuntimeSession,
8
9
  appsUpdate,
9
10
  cliAuthApprove,
10
11
  cliAuthDeny,
@@ -15,12 +16,13 @@ import {
15
16
  deploymentsGet,
16
17
  deploymentsList,
17
18
  deploymentsPublish,
19
+ deploymentsRuntime,
18
20
  previewAccept,
19
21
  previewAccepted,
20
22
  previewInvitation,
21
23
  previewStart,
22
24
  previewStop
23
- } from "../chunk-S6GBD6TR.js";
25
+ } from "../chunk-MFXQKOYT.js";
24
26
  import "../chunk-TZBKIIYQ.js";
25
27
  import "../chunk-X5TBL4RL.js";
26
28
  import "../chunk-VUBA7FI4.js";
@@ -38,6 +40,7 @@ export {
38
40
  appsDeploy,
39
41
  appsGet,
40
42
  appsList,
43
+ appsRuntimeSession,
41
44
  appsUpdate,
42
45
  cliAuthApprove,
43
46
  cliAuthDeny,
@@ -48,6 +51,7 @@ export {
48
51
  deploymentsGet,
49
52
  deploymentsList,
50
53
  deploymentsPublish,
54
+ deploymentsRuntime,
51
55
  previewAccept,
52
56
  previewAccepted,
53
57
  previewInvitation,
@@ -1,5 +1,5 @@
1
1
  import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from "./client/index.js";
2
- import type { AppsCreateData, AppsCreateResponses, AppsDeleteData, AppsDeleteResponses, AppsDeployData, AppsDeployResponses, AppsGetData, AppsGetResponses, AppsListData, AppsListResponses, AppsUpdateData, AppsUpdateResponses, CliAuthApproveData, CliAuthApproveResponses, CliAuthDenyData, CliAuthDenyResponses, CliAuthPollData, CliAuthPollResponses, CliAuthStartData, CliAuthStartResponses, CliAuthVerifyTokenData, CliAuthVerifyTokenResponses, DeploymentsCreateData, DeploymentsCreateResponses, DeploymentsGetData, DeploymentsGetResponses, DeploymentsListData, DeploymentsListResponses, DeploymentsPublishData, DeploymentsPublishResponses, PreviewAcceptData, PreviewAcceptedData, PreviewAcceptedResponses, PreviewAcceptResponses, PreviewInvitationData, PreviewInvitationResponses, PreviewStartData, PreviewStartResponses, PreviewStopData, PreviewStopResponses } from "./types.gen.js";
2
+ import type { AppsCreateData, AppsCreateResponses, AppsDeleteData, AppsDeleteResponses, AppsDeployData, AppsDeployResponses, AppsGetData, AppsGetResponses, AppsListData, AppsListResponses, AppsRuntimeSessionData, AppsRuntimeSessionResponses, AppsUpdateData, AppsUpdateResponses, CliAuthApproveData, CliAuthApproveResponses, CliAuthDenyData, CliAuthDenyResponses, CliAuthPollData, CliAuthPollResponses, CliAuthStartData, CliAuthStartResponses, CliAuthVerifyTokenData, CliAuthVerifyTokenResponses, DeploymentsCreateData, DeploymentsCreateResponses, DeploymentsGetData, DeploymentsGetResponses, DeploymentsListData, DeploymentsListResponses, DeploymentsPublishData, DeploymentsPublishResponses, DeploymentsRuntimeData, DeploymentsRuntimeResponses, PreviewAcceptData, PreviewAcceptedData, PreviewAcceptedResponses, PreviewAcceptResponses, PreviewInvitationData, PreviewInvitationResponses, PreviewStartData, PreviewStartResponses, PreviewStopData, PreviewStopResponses } from "./types.gen.js";
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -13,10 +13,11 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
13
13
  */
14
14
  meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
15
15
  };
16
+ export declare const appsRuntimeSession: <ThrowOnError extends boolean = false>(options: Options<AppsRuntimeSessionData, ThrowOnError>) => RequestResult<AppsRuntimeSessionResponses, unknown, ThrowOnError>;
16
17
  export declare const appsList: <ThrowOnError extends boolean = false>(options: Options<AppsListData, ThrowOnError>) => RequestResult<AppsListResponses, unknown, ThrowOnError>;
18
+ export declare const appsGet: <ThrowOnError extends boolean = false>(options: Options<AppsGetData, ThrowOnError>) => RequestResult<AppsGetResponses, unknown, ThrowOnError>;
17
19
  export declare const appsCreate: <ThrowOnError extends boolean = false>(options: Options<AppsCreateData, ThrowOnError>) => RequestResult<AppsCreateResponses, unknown, ThrowOnError>;
18
20
  export declare const appsDelete: <ThrowOnError extends boolean = false>(options: Options<AppsDeleteData, ThrowOnError>) => RequestResult<AppsDeleteResponses, unknown, ThrowOnError>;
19
- export declare const appsGet: <ThrowOnError extends boolean = false>(options: Options<AppsGetData, ThrowOnError>) => RequestResult<AppsGetResponses, unknown, ThrowOnError>;
20
21
  export declare const appsUpdate: <ThrowOnError extends boolean = false>(options: Options<AppsUpdateData, ThrowOnError>) => RequestResult<AppsUpdateResponses, unknown, ThrowOnError>;
21
22
  export declare const appsDeploy: <ThrowOnError extends boolean = false>(options: Options<AppsDeployData, ThrowOnError>) => RequestResult<AppsDeployResponses, unknown, ThrowOnError>;
22
23
  export declare const cliAuthApprove: <ThrowOnError extends boolean = false>(options: Options<CliAuthApproveData, ThrowOnError>) => RequestResult<CliAuthApproveResponses, unknown, ThrowOnError>;
@@ -25,9 +26,10 @@ export declare const cliAuthPoll: <ThrowOnError extends boolean = false>(options
25
26
  export declare const cliAuthStart: <ThrowOnError extends boolean = false>(options: Options<CliAuthStartData, ThrowOnError>) => RequestResult<CliAuthStartResponses, unknown, ThrowOnError>;
26
27
  export declare const cliAuthVerifyToken: <ThrowOnError extends boolean = false>(options: Options<CliAuthVerifyTokenData, ThrowOnError>) => RequestResult<CliAuthVerifyTokenResponses, unknown, ThrowOnError>;
27
28
  export declare const deploymentsList: <ThrowOnError extends boolean = false>(options: Options<DeploymentsListData, ThrowOnError>) => RequestResult<DeploymentsListResponses, unknown, ThrowOnError>;
28
- export declare const deploymentsCreate: <ThrowOnError extends boolean = false>(options: Options<DeploymentsCreateData, ThrowOnError>) => RequestResult<DeploymentsCreateResponses, unknown, ThrowOnError>;
29
29
  export declare const deploymentsGet: <ThrowOnError extends boolean = false>(options: Options<DeploymentsGetData, ThrowOnError>) => RequestResult<DeploymentsGetResponses, unknown, ThrowOnError>;
30
+ export declare const deploymentsCreate: <ThrowOnError extends boolean = false>(options: Options<DeploymentsCreateData, ThrowOnError>) => RequestResult<DeploymentsCreateResponses, unknown, ThrowOnError>;
30
31
  export declare const deploymentsPublish: <ThrowOnError extends boolean = false>(options: Options<DeploymentsPublishData, ThrowOnError>) => RequestResult<DeploymentsPublishResponses, unknown, ThrowOnError>;
32
+ export declare const deploymentsRuntime: <ThrowOnError extends boolean = false>(options: Options<DeploymentsRuntimeData, ThrowOnError>) => RequestResult<DeploymentsRuntimeResponses, unknown, ThrowOnError>;
31
33
  export declare const previewStart: <ThrowOnError extends boolean = false>(options: Options<PreviewStartData, ThrowOnError>) => RequestResult<PreviewStartResponses, unknown, ThrowOnError>;
32
34
  export declare const previewStop: <ThrowOnError extends boolean = false>(options: Options<PreviewStopData, ThrowOnError>) => RequestResult<PreviewStopResponses, unknown, ThrowOnError>;
33
35
  export declare const previewInvitation: <ThrowOnError extends boolean = false>(options: Options<PreviewInvitationData, ThrowOnError>) => RequestResult<PreviewInvitationResponses, unknown, ThrowOnError>;
@@ -4,6 +4,7 @@ import {
4
4
  appsDeploy,
5
5
  appsGet,
6
6
  appsList,
7
+ appsRuntimeSession,
7
8
  appsUpdate,
8
9
  cliAuthApprove,
9
10
  cliAuthDeny,
@@ -14,12 +15,13 @@ import {
14
15
  deploymentsGet,
15
16
  deploymentsList,
16
17
  deploymentsPublish,
18
+ deploymentsRuntime,
17
19
  previewAccept,
18
20
  previewAccepted,
19
21
  previewInvitation,
20
22
  previewStart,
21
23
  previewStop
22
- } from "../chunk-S6GBD6TR.js";
24
+ } from "../chunk-MFXQKOYT.js";
23
25
  import "../chunk-TZBKIIYQ.js";
24
26
  import "../chunk-X5TBL4RL.js";
25
27
  import "../chunk-VUBA7FI4.js";
@@ -37,6 +39,7 @@ export {
37
39
  appsDeploy,
38
40
  appsGet,
39
41
  appsList,
42
+ appsRuntimeSession,
40
43
  appsUpdate,
41
44
  cliAuthApprove,
42
45
  cliAuthDeny,
@@ -47,6 +50,7 @@ export {
47
50
  deploymentsGet,
48
51
  deploymentsList,
49
52
  deploymentsPublish,
53
+ deploymentsRuntime,
50
54
  previewAccept,
51
55
  previewAccepted,
52
56
  previewInvitation,
@@ -1,15 +1,49 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: "https://tailorkit.dev/api/platform" | (string & {});
3
3
  };
4
+ export type Schema0 = string | number | boolean | null | Array<Schema0> | {
5
+ [key: string]: Schema0;
6
+ };
7
+ export type AppsRuntimeSessionData = {
8
+ body: {
9
+ scopes: Array<{
10
+ name: string;
11
+ value: {
12
+ [key: string]: Schema0;
13
+ };
14
+ }>;
15
+ };
16
+ path: {
17
+ appId: string;
18
+ };
19
+ query?: never;
20
+ url: "/apps/{appId}/runtime/session";
21
+ };
22
+ export type AppsRuntimeSessionResponses = {
23
+ /**
24
+ * OK
25
+ */
26
+ 200: {
27
+ token: string;
28
+ expiresAt: number;
29
+ url: string;
30
+ };
31
+ };
32
+ export type AppsRuntimeSessionResponse = AppsRuntimeSessionResponses[keyof AppsRuntimeSessionResponses];
4
33
  export type AppsListData = {
5
- body?: never;
6
- path?: never;
7
- query: {
34
+ body: {
8
35
  page?: number;
9
36
  pageSize?: number;
10
- scopeId: string;
37
+ scopes: Array<{
38
+ name: string;
39
+ value: {
40
+ [key: string]: Schema0;
41
+ };
42
+ }>;
11
43
  };
12
- url: "/apps";
44
+ path?: never;
45
+ query?: never;
46
+ url: "/apps/list";
13
47
  };
14
48
  export type AppsListResponses = {
15
49
  /**
@@ -20,7 +54,12 @@ export type AppsListResponses = {
20
54
  id: string;
21
55
  publicId: string;
22
56
  projectId: string;
23
- scopeId: string;
57
+ scope: {
58
+ name: string;
59
+ value: {
60
+ [key: string]: Schema0;
61
+ };
62
+ };
24
63
  name: string;
25
64
  description: string | null;
26
65
  currentDeploymentId: string | null;
@@ -53,17 +92,22 @@ export type AppsListResponses = {
53
92
  };
54
93
  };
55
94
  export type AppsListResponse = AppsListResponses[keyof AppsListResponses];
56
- export type AppsCreateData = {
95
+ export type AppsGetData = {
57
96
  body: {
58
- name: string;
59
- description: string | null;
60
- scopeId: string;
97
+ scopes: Array<{
98
+ name: string;
99
+ value: {
100
+ [key: string]: Schema0;
101
+ };
102
+ }>;
103
+ };
104
+ path: {
105
+ appId: string;
61
106
  };
62
- path?: never;
63
107
  query?: never;
64
- url: "/apps";
108
+ url: "/apps/{appId}/lookup";
65
109
  };
66
- export type AppsCreateResponses = {
110
+ export type AppsGetResponses = {
67
111
  /**
68
112
  * OK
69
113
  */
@@ -71,7 +115,12 @@ export type AppsCreateResponses = {
71
115
  id: string;
72
116
  publicId: string;
73
117
  projectId: string;
74
- scopeId: string;
118
+ scope: {
119
+ name: string;
120
+ value: {
121
+ [key: string]: Schema0;
122
+ };
123
+ };
75
124
  name: string;
76
125
  description: string | null;
77
126
  currentDeploymentId: string | null;
@@ -97,37 +146,23 @@ export type AppsCreateResponses = {
97
146
  };
98
147
  };
99
148
  };
100
- export type AppsCreateResponse = AppsCreateResponses[keyof AppsCreateResponses];
101
- export type AppsDeleteData = {
102
- body?: never;
103
- path: {
104
- appId: string;
105
- };
106
- query: {
107
- scopeId: string;
108
- };
109
- url: "/apps/{appId}";
110
- };
111
- export type AppsDeleteResponses = {
112
- /**
113
- * OK
114
- */
115
- 200: {
116
- id: string;
117
- };
118
- };
119
- export type AppsDeleteResponse = AppsDeleteResponses[keyof AppsDeleteResponses];
120
- export type AppsGetData = {
121
- body?: never;
122
- path: {
123
- appId: string;
124
- };
125
- query: {
126
- scopeId: string;
149
+ export type AppsGetResponse = AppsGetResponses[keyof AppsGetResponses];
150
+ export type AppsCreateData = {
151
+ body: {
152
+ name: string;
153
+ description: string | null;
154
+ scope: {
155
+ name: string;
156
+ value: {
157
+ [key: string]: Schema0;
158
+ };
159
+ };
127
160
  };
128
- url: "/apps/{appId}";
161
+ path?: never;
162
+ query?: never;
163
+ url: "/apps";
129
164
  };
130
- export type AppsGetResponses = {
165
+ export type AppsCreateResponses = {
131
166
  /**
132
167
  * OK
133
168
  */
@@ -135,7 +170,12 @@ export type AppsGetResponses = {
135
170
  id: string;
136
171
  publicId: string;
137
172
  projectId: string;
138
- scopeId: string;
173
+ scope: {
174
+ name: string;
175
+ value: {
176
+ [key: string]: Schema0;
177
+ };
178
+ };
139
179
  name: string;
140
180
  description: string | null;
141
181
  currentDeploymentId: string | null;
@@ -161,18 +201,46 @@ export type AppsGetResponses = {
161
201
  };
162
202
  };
163
203
  };
164
- export type AppsGetResponse = AppsGetResponses[keyof AppsGetResponses];
204
+ export type AppsCreateResponse = AppsCreateResponses[keyof AppsCreateResponses];
205
+ export type AppsDeleteData = {
206
+ body: {
207
+ scope: {
208
+ name: string;
209
+ value: {
210
+ [key: string]: Schema0;
211
+ };
212
+ };
213
+ };
214
+ path: {
215
+ appId: string;
216
+ };
217
+ query?: never;
218
+ url: "/apps/{appId}";
219
+ };
220
+ export type AppsDeleteResponses = {
221
+ /**
222
+ * OK
223
+ */
224
+ 200: {
225
+ id: string;
226
+ };
227
+ };
228
+ export type AppsDeleteResponse = AppsDeleteResponses[keyof AppsDeleteResponses];
165
229
  export type AppsUpdateData = {
166
230
  body: {
167
231
  name: string;
168
232
  description: string | null;
233
+ scope: {
234
+ name: string;
235
+ value: {
236
+ [key: string]: Schema0;
237
+ };
238
+ };
169
239
  };
170
240
  path: {
171
241
  appId: string;
172
242
  };
173
- query: {
174
- scopeId: string;
175
- };
243
+ query?: never;
176
244
  url: "/apps/{appId}";
177
245
  };
178
246
  export type AppsUpdateResponses = {
@@ -183,7 +251,12 @@ export type AppsUpdateResponses = {
183
251
  id: string;
184
252
  publicId: string;
185
253
  projectId: string;
186
- scopeId: string;
254
+ scope: {
255
+ name: string;
256
+ value: {
257
+ [key: string]: Schema0;
258
+ };
259
+ };
187
260
  name: string;
188
261
  description: string | null;
189
262
  currentDeploymentId: string | null;
@@ -213,13 +286,17 @@ export type AppsUpdateResponse = AppsUpdateResponses[keyof AppsUpdateResponses];
213
286
  export type AppsDeployData = {
214
287
  body: {
215
288
  deploymentId: string;
289
+ scope: {
290
+ name: string;
291
+ value: {
292
+ [key: string]: Schema0;
293
+ };
294
+ };
216
295
  };
217
296
  path: {
218
297
  appId: string;
219
298
  };
220
- query: {
221
- scopeId: string;
222
- };
299
+ query?: never;
223
300
  url: "/apps/{appId}/deploy";
224
301
  };
225
302
  export type AppsDeployResponses = {
@@ -230,7 +307,12 @@ export type AppsDeployResponses = {
230
307
  id: string;
231
308
  publicId: string;
232
309
  projectId: string;
233
- scopeId: string;
310
+ scope: {
311
+ name: string;
312
+ value: {
313
+ [key: string]: Schema0;
314
+ };
315
+ };
234
316
  name: string;
235
317
  description: string | null;
236
318
  currentDeploymentId: string | null;
@@ -259,7 +341,12 @@ export type AppsDeployResponses = {
259
341
  export type AppsDeployResponse = AppsDeployResponses[keyof AppsDeployResponses];
260
342
  export type CliAuthApproveData = {
261
343
  body: {
262
- scopeId: string;
344
+ scope: {
345
+ name: string;
346
+ value: {
347
+ [key: string]: Schema0;
348
+ };
349
+ };
263
350
  userCode: string;
264
351
  };
265
352
  path?: never;
@@ -310,7 +397,12 @@ export type CliAuthPollResponses = {
310
397
  status: "denied";
311
398
  } | {
312
399
  deployToken: string;
313
- scopeId: string;
400
+ scope: {
401
+ name: string;
402
+ value: {
403
+ [key: string]: Schema0;
404
+ };
405
+ };
314
406
  status: "approved";
315
407
  } | {
316
408
  status: "expired";
@@ -349,20 +441,30 @@ export type CliAuthVerifyTokenResponses = {
349
441
  * OK
350
442
  */
351
443
  200: {
352
- scopeId: string;
444
+ scope: {
445
+ name: string;
446
+ value: {
447
+ [key: string]: Schema0;
448
+ };
449
+ };
353
450
  };
354
451
  };
355
452
  export type CliAuthVerifyTokenResponse = CliAuthVerifyTokenResponses[keyof CliAuthVerifyTokenResponses];
356
453
  export type DeploymentsListData = {
357
- body?: never;
358
- path?: never;
359
- query: {
454
+ body: {
360
455
  page?: number;
361
456
  pageSize?: number;
362
457
  appId: string;
363
- scopeId: string;
458
+ scopes: Array<{
459
+ name: string;
460
+ value: {
461
+ [key: string]: Schema0;
462
+ };
463
+ }>;
364
464
  };
365
- url: "/deployments";
465
+ path?: never;
466
+ query?: never;
467
+ url: "/deployments/list";
366
468
  };
367
469
  export type DeploymentsListResponses = {
368
470
  /**
@@ -390,6 +492,40 @@ export type DeploymentsListResponses = {
390
492
  };
391
493
  };
392
494
  export type DeploymentsListResponse = DeploymentsListResponses[keyof DeploymentsListResponses];
495
+ export type DeploymentsGetData = {
496
+ body: {
497
+ scopes: Array<{
498
+ name: string;
499
+ value: {
500
+ [key: string]: Schema0;
501
+ };
502
+ }>;
503
+ };
504
+ path: {
505
+ deploymentId: string;
506
+ };
507
+ query?: never;
508
+ url: "/deployments/{deploymentId}/lookup";
509
+ };
510
+ export type DeploymentsGetResponses = {
511
+ /**
512
+ * OK
513
+ */
514
+ 200: {
515
+ id: string;
516
+ publicId: string;
517
+ appId: string;
518
+ status: "uploading" | "deploying" | "verifying" | "published";
519
+ clientEntryFileId: string | null;
520
+ logoLightFileId: string | null;
521
+ logoDarkFileId: string | null;
522
+ logoLightPath: string | null;
523
+ logoDarkPath: string | null;
524
+ createdAt: string;
525
+ updatedAt: string;
526
+ };
527
+ };
528
+ export type DeploymentsGetResponse = DeploymentsGetResponses[keyof DeploymentsGetResponses];
393
529
  export type DeploymentsCreateData = {
394
530
  body: {
395
531
  appId: string;
@@ -402,6 +538,13 @@ export type DeploymentsCreateData = {
402
538
  objectKey: "client.js";
403
539
  }
404
540
  ];
541
+ server?: {
542
+ checksum: string;
543
+ contentLength: number;
544
+ contentType: "application/javascript";
545
+ encoding: "utf-8";
546
+ objectKey: "server.js";
547
+ };
405
548
  logos?: {
406
549
  dark?: {
407
550
  checksum: string;
@@ -414,7 +557,12 @@ export type DeploymentsCreateData = {
414
557
  contentType: "image/svg+xml" | "image/png" | "image/webp";
415
558
  };
416
559
  };
417
- scopeId: string;
560
+ scope: {
561
+ name: string;
562
+ value: {
563
+ [key: string]: Schema0;
564
+ };
565
+ };
418
566
  };
419
567
  path?: never;
420
568
  query?: never;
@@ -443,6 +591,24 @@ export type DeploymentsCreateResponses = {
443
591
  };
444
592
  uploadUrl: string;
445
593
  }>;
594
+ server?: {
595
+ file: {
596
+ id: string;
597
+ appDeploymentId: string;
598
+ objectKey: string;
599
+ contentType: "application/javascript" | "image/svg+xml" | "image/png" | "image/webp";
600
+ encoding: "utf-8" | null;
601
+ contentLength: number;
602
+ checksum: string | null;
603
+ status: "uploading" | "verifying" | "verified" | "failed";
604
+ createdAt: string;
605
+ updatedAt: string;
606
+ };
607
+ headers?: {
608
+ [key: string]: string;
609
+ };
610
+ uploadUrl: string;
611
+ };
446
612
  deployment: {
447
613
  id: string;
448
614
  publicId: string;
@@ -497,17 +663,23 @@ export type DeploymentsCreateResponses = {
497
663
  };
498
664
  };
499
665
  export type DeploymentsCreateResponse = DeploymentsCreateResponses[keyof DeploymentsCreateResponses];
500
- export type DeploymentsGetData = {
501
- body?: never;
666
+ export type DeploymentsPublishData = {
667
+ body: {
668
+ scope: {
669
+ name: string;
670
+ value: {
671
+ [key: string]: Schema0;
672
+ };
673
+ };
674
+ rollout?: boolean;
675
+ };
502
676
  path: {
503
677
  deploymentId: string;
504
678
  };
505
- query: {
506
- scopeId: string;
507
- };
679
+ query?: never;
508
680
  url: "/deployments/{deploymentId}";
509
681
  };
510
- export type DeploymentsGetResponses = {
682
+ export type DeploymentsPublishResponses = {
511
683
  /**
512
684
  * OK
513
685
  */
@@ -525,41 +697,36 @@ export type DeploymentsGetResponses = {
525
697
  updatedAt: string;
526
698
  };
527
699
  };
528
- export type DeploymentsGetResponse = DeploymentsGetResponses[keyof DeploymentsGetResponses];
529
- export type DeploymentsPublishData = {
700
+ export type DeploymentsPublishResponse = DeploymentsPublishResponses[keyof DeploymentsPublishResponses];
701
+ export type DeploymentsRuntimeData = {
530
702
  body: {
531
- scopeId: string;
532
- rollout?: boolean;
703
+ [key: string]: unknown;
533
704
  };
534
705
  path: {
535
- deploymentId: string;
706
+ appId: string;
536
707
  };
537
708
  query?: never;
538
- url: "/deployments/{deploymentId}";
709
+ url: "/apps/{appId}/runtime";
539
710
  };
540
- export type DeploymentsPublishResponses = {
711
+ export type DeploymentsRuntimeResponses = {
541
712
  /**
542
713
  * OK
543
714
  */
544
715
  200: {
545
- id: string;
546
- publicId: string;
716
+ projectId: string;
547
717
  appId: string;
548
- status: "uploading" | "deploying" | "verifying" | "published";
549
- clientEntryFileId: string | null;
550
- logoLightFileId: string | null;
551
- logoDarkFileId: string | null;
552
- logoLightPath: string | null;
553
- logoDarkPath: string | null;
554
- createdAt: string;
555
- updatedAt: string;
718
+ deploymentId: string;
719
+ objectKey: string;
720
+ checksum: string;
721
+ contentLength: number;
556
722
  };
557
723
  };
558
- export type DeploymentsPublishResponse = DeploymentsPublishResponses[keyof DeploymentsPublishResponses];
724
+ export type DeploymentsRuntimeResponse = DeploymentsRuntimeResponses[keyof DeploymentsRuntimeResponses];
559
725
  export type PreviewStartData = {
560
726
  body: {
561
727
  appId: string;
562
728
  deployToken: string;
729
+ replaceActive?: boolean;
563
730
  };
564
731
  path?: never;
565
732
  query?: never;
@@ -593,7 +760,7 @@ export type PreviewStopResponses = {
593
760
  * OK
594
761
  */
595
762
  200: {
596
- [key: string]: unknown;
763
+ [key: string]: never;
597
764
  };
598
765
  };
599
766
  export type PreviewStopResponse = PreviewStopResponses[keyof PreviewStopResponses];
@@ -618,7 +785,12 @@ export type PreviewInvitationResponses = {
618
785
  export type PreviewInvitationResponse = PreviewInvitationResponses[keyof PreviewInvitationResponses];
619
786
  export type PreviewAcceptData = {
620
787
  body: {
621
- scopeId: string;
788
+ scope: {
789
+ name: string;
790
+ value: {
791
+ [key: string]: Schema0;
792
+ };
793
+ };
622
794
  };
623
795
  path: {
624
796
  shareId: string;
@@ -639,7 +811,12 @@ export type PreviewAcceptResponse = PreviewAcceptResponses[keyof PreviewAcceptRe
639
811
  export type PreviewAcceptedData = {
640
812
  body: {
641
813
  grantIds: Array<string>;
642
- scopeId: string;
814
+ scopes: Array<{
815
+ name: string;
816
+ value: {
817
+ [key: string]: Schema0;
818
+ };
819
+ }>;
643
820
  };
644
821
  path?: never;
645
822
  query?: never;
@@ -655,7 +832,12 @@ export type PreviewAcceptedResponses = {
655
832
  id: string;
656
833
  publicId: string;
657
834
  projectId: string;
658
- scopeId: string;
835
+ scope: {
836
+ name: string;
837
+ value: {
838
+ [key: string]: Schema0;
839
+ };
840
+ };
659
841
  name: string;
660
842
  description: string | null;
661
843
  currentDeploymentId: string | null;
package/dist/index.js CHANGED
@@ -2,12 +2,13 @@ import {
2
2
  createClientConfig
3
3
  } from "./chunk-5IRC5P4W.js";
4
4
  import {
5
+ ACTIVE_PREVIEW_CONFLICT_REASON,
5
6
  createPreviewWebSocketClient,
6
7
  previewBuildManifestSchema,
7
8
  previewEventSchema,
8
9
  previewFileManifestSchema,
9
10
  previewMetadataSchema
10
- } from "./chunk-W4IZZ2X7.js";
11
+ } from "./chunk-RFNELX3J.js";
11
12
  import "./chunk-5X7JZMEF.js";
12
13
  import {
13
14
  appsCreate,
@@ -15,6 +16,7 @@ import {
15
16
  appsDeploy,
16
17
  appsGet,
17
18
  appsList,
19
+ appsRuntimeSession,
18
20
  appsUpdate,
19
21
  cliAuthApprove,
20
22
  cliAuthDeny,
@@ -25,12 +27,13 @@ import {
25
27
  deploymentsGet,
26
28
  deploymentsList,
27
29
  deploymentsPublish,
30
+ deploymentsRuntime,
28
31
  previewAccept,
29
32
  previewAccepted,
30
33
  previewInvitation,
31
34
  previewStart,
32
35
  previewStop
33
- } from "./chunk-S6GBD6TR.js";
36
+ } from "./chunk-MFXQKOYT.js";
34
37
  import "./chunk-TZBKIIYQ.js";
35
38
  import "./chunk-X5TBL4RL.js";
36
39
  import "./chunk-VUBA7FI4.js";
@@ -43,11 +46,13 @@ import "./chunk-TZPDFAYB.js";
43
46
  import "./chunk-ZLGFMDTV.js";
44
47
  import "./chunk-JETBOCXO.js";
45
48
  export {
49
+ ACTIVE_PREVIEW_CONFLICT_REASON,
46
50
  appsCreate,
47
51
  appsDelete,
48
52
  appsDeploy,
49
53
  appsGet,
50
54
  appsList,
55
+ appsRuntimeSession,
51
56
  appsUpdate,
52
57
  cliAuthApprove,
53
58
  cliAuthDeny,
@@ -60,6 +65,7 @@ export {
60
65
  deploymentsGet,
61
66
  deploymentsList,
62
67
  deploymentsPublish,
68
+ deploymentsRuntime,
63
69
  previewAccept,
64
70
  previewAccepted,
65
71
  previewBuildManifestSchema,
package/dist/preview.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { z } from "zod";
2
+ /** Stable error discriminator for an app that already has an active preview. */
3
+ export declare const ACTIVE_PREVIEW_CONFLICT_REASON: "ACTIVE_PREVIEW_EXISTS";
2
4
  export declare const previewFileManifestSchema: z.ZodObject<{
3
5
  path: z.ZodString;
4
6
  contentType: z.ZodString;
package/dist/preview.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import {
2
+ ACTIVE_PREVIEW_CONFLICT_REASON,
2
3
  createPreviewWebSocketClient,
3
4
  previewBuildManifestSchema,
4
5
  previewEventSchema,
5
6
  previewFileManifestSchema,
6
7
  previewMetadataSchema
7
- } from "./chunk-W4IZZ2X7.js";
8
+ } from "./chunk-RFNELX3J.js";
8
9
  export {
10
+ ACTIVE_PREVIEW_CONFLICT_REASON,
9
11
  createPreviewWebSocketClient,
10
12
  previewBuildManifestSchema,
11
13
  previewEventSchema,
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tailorkit/client-platform",
3
- "version": "0.1.0-beta.14",
3
+ "version": "0.1.0-beta.17",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/AlfieJones/tailorkit.git",
7
+ "url": "git+https://github.com/tailorkit-labs/TailorKit.git",
8
8
  "directory": "packages/client-platform"
9
9
  },
10
10
  "files": [
@@ -33,22 +33,21 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@orpc/client": "^1.15.0",
37
- "zod": "^4.6.2"
36
+ "@orpc/client": "2.0.0-beta.40",
37
+ "zod": "^4.6.5"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@hey-api/openapi-ts": "next",
41
41
  "@tailorkit/api-platform": "0.0.0",
42
42
  "@tailorkit/config": "0.0.0",
43
- "@types/node": "26.2.0",
43
+ "@types/node": "26.6.3",
44
44
  "tsup": "^8.5.1",
45
- "typescript": "^7.0.2",
46
- "vitest": "^5.0.0"
45
+ "typescript": "^7.0.2"
47
46
  },
48
47
  "scripts": {
49
48
  "build": "tsup 'src/**/*.ts' --format esm --target node20 --clean && tsc -p tsconfig.build.json",
50
- "generate": "openapi-ts && node ./scripts/restore-openapi-params.mjs && node ./scripts/normalize-esm-imports.mjs && oxfmt src/client",
49
+ "generate": "openapi-ts && node ./scripts/restore-openapi-params.mjs && node ./scripts/normalize-esm-imports.mjs && vp fmt src/client",
51
50
  "check-types": "tsc --noEmit",
52
- "test": "vitest run"
51
+ "test": "vp test run"
53
52
  }
54
53
  }