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

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,50 @@
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
+ userId: string;
16
+ installationId: string;
17
+ };
18
+ path: {
19
+ appId: string;
20
+ };
21
+ query?: never;
22
+ url: "/apps/{appId}/runtime/session";
23
+ };
24
+ export type AppsRuntimeSessionResponses = {
25
+ /**
26
+ * OK
27
+ */
28
+ 200: {
29
+ token: string;
30
+ expiresAt: number;
31
+ };
32
+ };
33
+ export type AppsRuntimeSessionResponse = AppsRuntimeSessionResponses[keyof AppsRuntimeSessionResponses];
4
34
  export type AppsListData = {
5
- body?: never;
6
- path?: never;
7
- query: {
35
+ body: {
8
36
  page?: number;
9
37
  pageSize?: number;
10
- scopeId: string;
38
+ scopes: Array<{
39
+ name: string;
40
+ value: {
41
+ [key: string]: Schema0;
42
+ };
43
+ }>;
11
44
  };
12
- url: "/apps";
45
+ path?: never;
46
+ query?: never;
47
+ url: "/apps/list";
13
48
  };
14
49
  export type AppsListResponses = {
15
50
  /**
@@ -20,7 +55,12 @@ export type AppsListResponses = {
20
55
  id: string;
21
56
  publicId: string;
22
57
  projectId: string;
23
- scopeId: string;
58
+ scope: {
59
+ name: string;
60
+ value: {
61
+ [key: string]: Schema0;
62
+ };
63
+ };
24
64
  name: string;
25
65
  description: string | null;
26
66
  currentDeploymentId: string | null;
@@ -53,17 +93,22 @@ export type AppsListResponses = {
53
93
  };
54
94
  };
55
95
  export type AppsListResponse = AppsListResponses[keyof AppsListResponses];
56
- export type AppsCreateData = {
96
+ export type AppsGetData = {
57
97
  body: {
58
- name: string;
59
- description: string | null;
60
- scopeId: string;
98
+ scopes: Array<{
99
+ name: string;
100
+ value: {
101
+ [key: string]: Schema0;
102
+ };
103
+ }>;
104
+ };
105
+ path: {
106
+ appId: string;
61
107
  };
62
- path?: never;
63
108
  query?: never;
64
- url: "/apps";
109
+ url: "/apps/{appId}/lookup";
65
110
  };
66
- export type AppsCreateResponses = {
111
+ export type AppsGetResponses = {
67
112
  /**
68
113
  * OK
69
114
  */
@@ -71,7 +116,12 @@ export type AppsCreateResponses = {
71
116
  id: string;
72
117
  publicId: string;
73
118
  projectId: string;
74
- scopeId: string;
119
+ scope: {
120
+ name: string;
121
+ value: {
122
+ [key: string]: Schema0;
123
+ };
124
+ };
75
125
  name: string;
76
126
  description: string | null;
77
127
  currentDeploymentId: string | null;
@@ -97,37 +147,23 @@ export type AppsCreateResponses = {
97
147
  };
98
148
  };
99
149
  };
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;
150
+ export type AppsGetResponse = AppsGetResponses[keyof AppsGetResponses];
151
+ export type AppsCreateData = {
152
+ body: {
153
+ name: string;
154
+ description: string | null;
155
+ scope: {
156
+ name: string;
157
+ value: {
158
+ [key: string]: Schema0;
159
+ };
160
+ };
127
161
  };
128
- url: "/apps/{appId}";
162
+ path?: never;
163
+ query?: never;
164
+ url: "/apps";
129
165
  };
130
- export type AppsGetResponses = {
166
+ export type AppsCreateResponses = {
131
167
  /**
132
168
  * OK
133
169
  */
@@ -135,7 +171,12 @@ export type AppsGetResponses = {
135
171
  id: string;
136
172
  publicId: string;
137
173
  projectId: string;
138
- scopeId: string;
174
+ scope: {
175
+ name: string;
176
+ value: {
177
+ [key: string]: Schema0;
178
+ };
179
+ };
139
180
  name: string;
140
181
  description: string | null;
141
182
  currentDeploymentId: string | null;
@@ -161,18 +202,46 @@ export type AppsGetResponses = {
161
202
  };
162
203
  };
163
204
  };
164
- export type AppsGetResponse = AppsGetResponses[keyof AppsGetResponses];
205
+ export type AppsCreateResponse = AppsCreateResponses[keyof AppsCreateResponses];
206
+ export type AppsDeleteData = {
207
+ body: {
208
+ scope: {
209
+ name: string;
210
+ value: {
211
+ [key: string]: Schema0;
212
+ };
213
+ };
214
+ };
215
+ path: {
216
+ appId: string;
217
+ };
218
+ query?: never;
219
+ url: "/apps/{appId}";
220
+ };
221
+ export type AppsDeleteResponses = {
222
+ /**
223
+ * OK
224
+ */
225
+ 200: {
226
+ id: string;
227
+ };
228
+ };
229
+ export type AppsDeleteResponse = AppsDeleteResponses[keyof AppsDeleteResponses];
165
230
  export type AppsUpdateData = {
166
231
  body: {
167
232
  name: string;
168
233
  description: string | null;
234
+ scope: {
235
+ name: string;
236
+ value: {
237
+ [key: string]: Schema0;
238
+ };
239
+ };
169
240
  };
170
241
  path: {
171
242
  appId: string;
172
243
  };
173
- query: {
174
- scopeId: string;
175
- };
244
+ query?: never;
176
245
  url: "/apps/{appId}";
177
246
  };
178
247
  export type AppsUpdateResponses = {
@@ -183,7 +252,12 @@ export type AppsUpdateResponses = {
183
252
  id: string;
184
253
  publicId: string;
185
254
  projectId: string;
186
- scopeId: string;
255
+ scope: {
256
+ name: string;
257
+ value: {
258
+ [key: string]: Schema0;
259
+ };
260
+ };
187
261
  name: string;
188
262
  description: string | null;
189
263
  currentDeploymentId: string | null;
@@ -213,13 +287,17 @@ export type AppsUpdateResponse = AppsUpdateResponses[keyof AppsUpdateResponses];
213
287
  export type AppsDeployData = {
214
288
  body: {
215
289
  deploymentId: string;
290
+ scope: {
291
+ name: string;
292
+ value: {
293
+ [key: string]: Schema0;
294
+ };
295
+ };
216
296
  };
217
297
  path: {
218
298
  appId: string;
219
299
  };
220
- query: {
221
- scopeId: string;
222
- };
300
+ query?: never;
223
301
  url: "/apps/{appId}/deploy";
224
302
  };
225
303
  export type AppsDeployResponses = {
@@ -230,7 +308,12 @@ export type AppsDeployResponses = {
230
308
  id: string;
231
309
  publicId: string;
232
310
  projectId: string;
233
- scopeId: string;
311
+ scope: {
312
+ name: string;
313
+ value: {
314
+ [key: string]: Schema0;
315
+ };
316
+ };
234
317
  name: string;
235
318
  description: string | null;
236
319
  currentDeploymentId: string | null;
@@ -259,7 +342,12 @@ export type AppsDeployResponses = {
259
342
  export type AppsDeployResponse = AppsDeployResponses[keyof AppsDeployResponses];
260
343
  export type CliAuthApproveData = {
261
344
  body: {
262
- scopeId: string;
345
+ scope: {
346
+ name: string;
347
+ value: {
348
+ [key: string]: Schema0;
349
+ };
350
+ };
263
351
  userCode: string;
264
352
  };
265
353
  path?: never;
@@ -310,7 +398,12 @@ export type CliAuthPollResponses = {
310
398
  status: "denied";
311
399
  } | {
312
400
  deployToken: string;
313
- scopeId: string;
401
+ scope: {
402
+ name: string;
403
+ value: {
404
+ [key: string]: Schema0;
405
+ };
406
+ };
314
407
  status: "approved";
315
408
  } | {
316
409
  status: "expired";
@@ -349,20 +442,30 @@ export type CliAuthVerifyTokenResponses = {
349
442
  * OK
350
443
  */
351
444
  200: {
352
- scopeId: string;
445
+ scope: {
446
+ name: string;
447
+ value: {
448
+ [key: string]: Schema0;
449
+ };
450
+ };
353
451
  };
354
452
  };
355
453
  export type CliAuthVerifyTokenResponse = CliAuthVerifyTokenResponses[keyof CliAuthVerifyTokenResponses];
356
454
  export type DeploymentsListData = {
357
- body?: never;
358
- path?: never;
359
- query: {
455
+ body: {
360
456
  page?: number;
361
457
  pageSize?: number;
362
458
  appId: string;
363
- scopeId: string;
459
+ scopes: Array<{
460
+ name: string;
461
+ value: {
462
+ [key: string]: Schema0;
463
+ };
464
+ }>;
364
465
  };
365
- url: "/deployments";
466
+ path?: never;
467
+ query?: never;
468
+ url: "/deployments/list";
366
469
  };
367
470
  export type DeploymentsListResponses = {
368
471
  /**
@@ -390,6 +493,40 @@ export type DeploymentsListResponses = {
390
493
  };
391
494
  };
392
495
  export type DeploymentsListResponse = DeploymentsListResponses[keyof DeploymentsListResponses];
496
+ export type DeploymentsGetData = {
497
+ body: {
498
+ scopes: Array<{
499
+ name: string;
500
+ value: {
501
+ [key: string]: Schema0;
502
+ };
503
+ }>;
504
+ };
505
+ path: {
506
+ deploymentId: string;
507
+ };
508
+ query?: never;
509
+ url: "/deployments/{deploymentId}/lookup";
510
+ };
511
+ export type DeploymentsGetResponses = {
512
+ /**
513
+ * OK
514
+ */
515
+ 200: {
516
+ id: string;
517
+ publicId: string;
518
+ appId: string;
519
+ status: "uploading" | "deploying" | "verifying" | "published";
520
+ clientEntryFileId: string | null;
521
+ logoLightFileId: string | null;
522
+ logoDarkFileId: string | null;
523
+ logoLightPath: string | null;
524
+ logoDarkPath: string | null;
525
+ createdAt: string;
526
+ updatedAt: string;
527
+ };
528
+ };
529
+ export type DeploymentsGetResponse = DeploymentsGetResponses[keyof DeploymentsGetResponses];
393
530
  export type DeploymentsCreateData = {
394
531
  body: {
395
532
  appId: string;
@@ -402,6 +539,13 @@ export type DeploymentsCreateData = {
402
539
  objectKey: "client.js";
403
540
  }
404
541
  ];
542
+ server?: {
543
+ checksum: string;
544
+ contentLength: number;
545
+ contentType: "application/javascript";
546
+ encoding: "utf-8";
547
+ objectKey: "server.js";
548
+ };
405
549
  logos?: {
406
550
  dark?: {
407
551
  checksum: string;
@@ -414,7 +558,12 @@ export type DeploymentsCreateData = {
414
558
  contentType: "image/svg+xml" | "image/png" | "image/webp";
415
559
  };
416
560
  };
417
- scopeId: string;
561
+ scope: {
562
+ name: string;
563
+ value: {
564
+ [key: string]: Schema0;
565
+ };
566
+ };
418
567
  };
419
568
  path?: never;
420
569
  query?: never;
@@ -443,6 +592,24 @@ export type DeploymentsCreateResponses = {
443
592
  };
444
593
  uploadUrl: string;
445
594
  }>;
595
+ server?: {
596
+ file: {
597
+ id: string;
598
+ appDeploymentId: string;
599
+ objectKey: string;
600
+ contentType: "application/javascript" | "image/svg+xml" | "image/png" | "image/webp";
601
+ encoding: "utf-8" | null;
602
+ contentLength: number;
603
+ checksum: string | null;
604
+ status: "uploading" | "verifying" | "verified" | "failed";
605
+ createdAt: string;
606
+ updatedAt: string;
607
+ };
608
+ headers?: {
609
+ [key: string]: string;
610
+ };
611
+ uploadUrl: string;
612
+ };
446
613
  deployment: {
447
614
  id: string;
448
615
  publicId: string;
@@ -497,17 +664,23 @@ export type DeploymentsCreateResponses = {
497
664
  };
498
665
  };
499
666
  export type DeploymentsCreateResponse = DeploymentsCreateResponses[keyof DeploymentsCreateResponses];
500
- export type DeploymentsGetData = {
501
- body?: never;
667
+ export type DeploymentsPublishData = {
668
+ body: {
669
+ scope: {
670
+ name: string;
671
+ value: {
672
+ [key: string]: Schema0;
673
+ };
674
+ };
675
+ rollout?: boolean;
676
+ };
502
677
  path: {
503
678
  deploymentId: string;
504
679
  };
505
- query: {
506
- scopeId: string;
507
- };
680
+ query?: never;
508
681
  url: "/deployments/{deploymentId}";
509
682
  };
510
- export type DeploymentsGetResponses = {
683
+ export type DeploymentsPublishResponses = {
511
684
  /**
512
685
  * OK
513
686
  */
@@ -525,41 +698,36 @@ export type DeploymentsGetResponses = {
525
698
  updatedAt: string;
526
699
  };
527
700
  };
528
- export type DeploymentsGetResponse = DeploymentsGetResponses[keyof DeploymentsGetResponses];
529
- export type DeploymentsPublishData = {
701
+ export type DeploymentsPublishResponse = DeploymentsPublishResponses[keyof DeploymentsPublishResponses];
702
+ export type DeploymentsRuntimeData = {
530
703
  body: {
531
- scopeId: string;
532
- rollout?: boolean;
704
+ [key: string]: unknown;
533
705
  };
534
706
  path: {
535
- deploymentId: string;
707
+ appId: string;
536
708
  };
537
709
  query?: never;
538
- url: "/deployments/{deploymentId}";
710
+ url: "/apps/{appId}/runtime";
539
711
  };
540
- export type DeploymentsPublishResponses = {
712
+ export type DeploymentsRuntimeResponses = {
541
713
  /**
542
714
  * OK
543
715
  */
544
716
  200: {
545
- id: string;
546
- publicId: string;
717
+ projectId: string;
547
718
  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;
719
+ deploymentId: string;
720
+ objectKey: string;
721
+ checksum: string;
722
+ contentLength: number;
556
723
  };
557
724
  };
558
- export type DeploymentsPublishResponse = DeploymentsPublishResponses[keyof DeploymentsPublishResponses];
725
+ export type DeploymentsRuntimeResponse = DeploymentsRuntimeResponses[keyof DeploymentsRuntimeResponses];
559
726
  export type PreviewStartData = {
560
727
  body: {
561
728
  appId: string;
562
729
  deployToken: string;
730
+ replaceActive?: boolean;
563
731
  };
564
732
  path?: never;
565
733
  query?: never;
@@ -593,7 +761,7 @@ export type PreviewStopResponses = {
593
761
  * OK
594
762
  */
595
763
  200: {
596
- [key: string]: unknown;
764
+ [key: string]: never;
597
765
  };
598
766
  };
599
767
  export type PreviewStopResponse = PreviewStopResponses[keyof PreviewStopResponses];
@@ -618,7 +786,12 @@ export type PreviewInvitationResponses = {
618
786
  export type PreviewInvitationResponse = PreviewInvitationResponses[keyof PreviewInvitationResponses];
619
787
  export type PreviewAcceptData = {
620
788
  body: {
621
- scopeId: string;
789
+ scope: {
790
+ name: string;
791
+ value: {
792
+ [key: string]: Schema0;
793
+ };
794
+ };
622
795
  };
623
796
  path: {
624
797
  shareId: string;
@@ -639,7 +812,12 @@ export type PreviewAcceptResponse = PreviewAcceptResponses[keyof PreviewAcceptRe
639
812
  export type PreviewAcceptedData = {
640
813
  body: {
641
814
  grantIds: Array<string>;
642
- scopeId: string;
815
+ scopes: Array<{
816
+ name: string;
817
+ value: {
818
+ [key: string]: Schema0;
819
+ };
820
+ }>;
643
821
  };
644
822
  path?: never;
645
823
  query?: never;
@@ -655,7 +833,12 @@ export type PreviewAcceptedResponses = {
655
833
  id: string;
656
834
  publicId: string;
657
835
  projectId: string;
658
- scopeId: string;
836
+ scope: {
837
+ name: string;
838
+ value: {
839
+ [key: string]: Schema0;
840
+ };
841
+ };
659
842
  name: string;
660
843
  description: string | null;
661
844
  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.16",
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
  }