@tailorkit/client-platform 0.1.0-beta.13 → 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.
package/dist/index.js CHANGED
@@ -1,6 +1,14 @@
1
1
  import {
2
2
  createClientConfig
3
3
  } from "./chunk-5IRC5P4W.js";
4
+ import {
5
+ ACTIVE_PREVIEW_CONFLICT_REASON,
6
+ createPreviewWebSocketClient,
7
+ previewBuildManifestSchema,
8
+ previewEventSchema,
9
+ previewFileManifestSchema,
10
+ previewMetadataSchema
11
+ } from "./chunk-RFNELX3J.js";
4
12
  import "./chunk-5X7JZMEF.js";
5
13
  import {
6
14
  appsCreate,
@@ -8,6 +16,7 @@ import {
8
16
  appsDeploy,
9
17
  appsGet,
10
18
  appsList,
19
+ appsRuntimeSession,
11
20
  appsUpdate,
12
21
  cliAuthApprove,
13
22
  cliAuthDeny,
@@ -18,10 +27,13 @@ import {
18
27
  deploymentsGet,
19
28
  deploymentsList,
20
29
  deploymentsPublish,
21
- previewResolve,
30
+ deploymentsRuntime,
31
+ previewAccept,
32
+ previewAccepted,
33
+ previewInvitation,
22
34
  previewStart,
23
35
  previewStop
24
- } from "./chunk-QGZU6HXU.js";
36
+ } from "./chunk-MFXQKOYT.js";
25
37
  import "./chunk-TZBKIIYQ.js";
26
38
  import "./chunk-X5TBL4RL.js";
27
39
  import "./chunk-VUBA7FI4.js";
@@ -34,11 +46,13 @@ import "./chunk-TZPDFAYB.js";
34
46
  import "./chunk-ZLGFMDTV.js";
35
47
  import "./chunk-JETBOCXO.js";
36
48
  export {
49
+ ACTIVE_PREVIEW_CONFLICT_REASON,
37
50
  appsCreate,
38
51
  appsDelete,
39
52
  appsDeploy,
40
53
  appsGet,
41
54
  appsList,
55
+ appsRuntimeSession,
42
56
  appsUpdate,
43
57
  cliAuthApprove,
44
58
  cliAuthDeny,
@@ -46,11 +60,19 @@ export {
46
60
  cliAuthStart,
47
61
  cliAuthVerifyToken,
48
62
  createClientConfig,
63
+ createPreviewWebSocketClient,
49
64
  deploymentsCreate,
50
65
  deploymentsGet,
51
66
  deploymentsList,
52
67
  deploymentsPublish,
53
- previewResolve,
68
+ deploymentsRuntime,
69
+ previewAccept,
70
+ previewAccepted,
71
+ previewBuildManifestSchema,
72
+ previewEventSchema,
73
+ previewFileManifestSchema,
74
+ previewInvitation,
75
+ previewMetadataSchema,
54
76
  previewStart,
55
77
  previewStop
56
78
  };
@@ -0,0 +1,91 @@
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";
4
+ export declare const previewFileManifestSchema: z.ZodObject<{
5
+ path: z.ZodString;
6
+ contentType: z.ZodString;
7
+ size: z.ZodNumber;
8
+ chunks: z.ZodNumber;
9
+ sha256: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const previewBuildManifestSchema: z.ZodObject<{
12
+ files: z.ZodArray<z.ZodObject<{
13
+ path: z.ZodString;
14
+ contentType: z.ZodString;
15
+ size: z.ZodNumber;
16
+ chunks: z.ZodNumber;
17
+ sha256: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ export declare const previewEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
21
+ type: z.ZodLiteral<"begin">;
22
+ buildId: z.ZodString;
23
+ revision: z.ZodNumber;
24
+ manifest: z.ZodObject<{
25
+ files: z.ZodArray<z.ZodObject<{
26
+ path: z.ZodString;
27
+ contentType: z.ZodString;
28
+ size: z.ZodNumber;
29
+ chunks: z.ZodNumber;
30
+ sha256: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ type: z.ZodLiteral<"chunk">;
35
+ revision: z.ZodNumber;
36
+ fileIndex: z.ZodNumber;
37
+ chunkIndex: z.ZodNumber;
38
+ base64: z.ZodString;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ type: z.ZodLiteral<"complete">;
41
+ revision: z.ZodNumber;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ type: z.ZodLiteral<"ended">;
44
+ }, z.core.$strip>], "type">;
45
+ export declare const previewMetadataSchema: z.ZodObject<{
46
+ sessionId: z.ZodUUID;
47
+ expiresAt: z.ZodString;
48
+ websocketUrl: z.ZodURL;
49
+ token: z.ZodString;
50
+ }, z.core.$strip>;
51
+ export type PreviewFileManifest = z.infer<typeof previewFileManifestSchema>;
52
+ export type PreviewBuildManifest = z.infer<typeof previewBuildManifestSchema>;
53
+ export type PreviewEvent = z.infer<typeof previewEventSchema>;
54
+ declare const beginInput: z.ZodObject<{
55
+ manifest: z.ZodObject<{
56
+ files: z.ZodArray<z.ZodObject<{
57
+ path: z.ZodString;
58
+ contentType: z.ZodString;
59
+ size: z.ZodNumber;
60
+ chunks: z.ZodNumber;
61
+ sha256: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ }, z.core.$strip>;
64
+ }, z.core.$strip>;
65
+ declare const uploadInput: z.ZodObject<{
66
+ buildId: z.ZodString;
67
+ fileIndex: z.ZodNumber;
68
+ chunkIndex: z.ZodNumber;
69
+ base64: z.ZodString;
70
+ }, z.core.$strip>;
71
+ declare const buildIdOutput: z.ZodObject<{
72
+ buildId: z.ZodString;
73
+ }, z.core.$strip>;
74
+ declare const acceptedOutput: z.ZodObject<{
75
+ accepted: z.ZodLiteral<true>;
76
+ }, z.core.$strip>;
77
+ declare const commitOutput: z.ZodObject<{
78
+ revision: z.ZodNumber;
79
+ }, z.core.$strip>;
80
+ export interface PreviewWebSocketClient {
81
+ beginBuild(input: z.input<typeof beginInput>): Promise<z.infer<typeof buildIdOutput>>;
82
+ uploadChunk(input: z.input<typeof uploadInput>): Promise<z.infer<typeof acceptedOutput>>;
83
+ commitBuild(input: {
84
+ buildId: string;
85
+ }): Promise<z.infer<typeof commitOutput>>;
86
+ heartbeat(): Promise<z.infer<typeof acceptedOutput>>;
87
+ subscribe(): Promise<AsyncIterable<PreviewEvent>>;
88
+ }
89
+ /** Validates every preview WebSocket request, response, and streamed event. */
90
+ export declare function createPreviewWebSocketClient(websocket: WebSocket): PreviewWebSocketClient;
91
+ export {};
@@ -0,0 +1,16 @@
1
+ import {
2
+ ACTIVE_PREVIEW_CONFLICT_REASON,
3
+ createPreviewWebSocketClient,
4
+ previewBuildManifestSchema,
5
+ previewEventSchema,
6
+ previewFileManifestSchema,
7
+ previewMetadataSchema
8
+ } from "./chunk-RFNELX3J.js";
9
+ export {
10
+ ACTIVE_PREVIEW_CONFLICT_REASON,
11
+ createPreviewWebSocketClient,
12
+ previewBuildManifestSchema,
13
+ previewEventSchema,
14
+ previewFileManifestSchema,
15
+ previewMetadataSchema
16
+ };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tailorkit/client-platform",
3
- "version": "0.1.0-beta.13",
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": [
@@ -24,30 +24,30 @@
24
24
  "types": "./dist/client/*.d.ts",
25
25
  "import": "./dist/client/*.js"
26
26
  },
27
- "./preview-tunnel": {
28
- "types": "./dist/preview-tunnel.d.ts",
29
- "import": "./dist/preview-tunnel.js"
27
+ "./preview": {
28
+ "types": "./dist/preview.d.ts",
29
+ "import": "./dist/preview.js"
30
30
  }
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@orpc/client": "^1.15.0"
36
+ "@orpc/client": "2.0.0-beta.40",
37
+ "zod": "^4.6.5"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@hey-api/openapi-ts": "next",
40
41
  "@tailorkit/api-platform": "0.0.0",
41
42
  "@tailorkit/config": "0.0.0",
42
- "@types/node": "26.2.0",
43
+ "@types/node": "26.6.3",
43
44
  "tsup": "^8.5.1",
44
- "typescript": "^7.0.2",
45
- "vitest": "^5.0.0"
45
+ "typescript": "^7.0.2"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsup 'src/**/*.ts' --format esm --target node20 --clean && tsc -p tsconfig.build.json",
49
- "generate": "openapi-ts && node ./scripts/restore-openapi-params.mjs && oxfmt src/client",
49
+ "generate": "openapi-ts && node ./scripts/restore-openapi-params.mjs && node ./scripts/normalize-esm-imports.mjs && vp fmt src/client",
50
50
  "check-types": "tsc --noEmit",
51
- "test": "vitest run"
51
+ "test": "vp test run"
52
52
  }
53
53
  }
@@ -1,3 +0,0 @@
1
- import type { PreviewTunnelRouterClient } from "@tailorkit/api-platform/preview-tunnel";
2
- /** Creates the typed oRPC client for an authenticated preview tunnel WebSocket. */
3
- export declare function createPreviewTunnelClient(websocket: WebSocket): PreviewTunnelRouterClient;
@@ -1,9 +0,0 @@
1
- // src/preview-tunnel.ts
2
- import { createORPCClient } from "@orpc/client";
3
- import { RPCLink } from "@orpc/client/websocket";
4
- function createPreviewTunnelClient(websocket) {
5
- return createORPCClient(new RPCLink({ websocket }));
6
- }
7
- export {
8
- createPreviewTunnelClient
9
- };