@harnesys/sdk 0.0.0-stage → 1.1.0
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/LICENSE +21 -0
- package/README.md +80 -2
- package/dist/addon-context-factory.d.ts +6 -0
- package/dist/addon-context-factory.js +160 -0
- package/dist/addon-context.d.ts +346 -0
- package/dist/addon-context.js +0 -0
- package/dist/define-addon.d.ts +57 -0
- package/dist/define-addon.js +53 -0
- package/dist/families/config.d.ts +14 -0
- package/dist/families/config.js +16 -0
- package/dist/families/content.d.ts +28 -0
- package/dist/families/content.js +19 -0
- package/dist/families/field-spec.d.ts +100 -0
- package/dist/families/field-spec.js +85 -0
- package/dist/families/hook.d.ts +37 -0
- package/dist/families/hook.js +25 -0
- package/dist/families/job.d.ts +45 -0
- package/dist/families/job.js +26 -0
- package/dist/families/json-schema-value.d.ts +12 -0
- package/dist/families/json-schema-value.js +243 -0
- package/dist/families/json-schema.d.ts +36 -0
- package/dist/families/json-schema.js +101 -0
- package/dist/families/lsp.d.ts +18 -0
- package/dist/families/lsp.js +18 -0
- package/dist/families/mcp.d.ts +18 -0
- package/dist/families/mcp.js +18 -0
- package/dist/families/registry.d.ts +9 -0
- package/dist/families/registry.js +34 -0
- package/dist/families/route.d.ts +38 -0
- package/dist/families/route.js +37 -0
- package/dist/families/source-kind.d.ts +24 -0
- package/dist/families/source-kind.js +21 -0
- package/dist/families/tool-pack.d.ts +68 -0
- package/dist/families/tool-pack.js +57 -0
- package/dist/families/transport.d.ts +52 -0
- package/dist/families/transport.js +29 -0
- package/dist/families/trigger.d.ts +97 -0
- package/dist/families/trigger.js +46 -0
- package/dist/families/view.d.ts +255 -0
- package/dist/families/view.js +87 -0
- package/dist/families/viewer.d.ts +31 -0
- package/dist/families/viewer.js +26 -0
- package/dist/families/worker.d.ts +23 -0
- package/dist/families/worker.js +19 -0
- package/dist/host-client.d.ts +11 -0
- package/dist/host-client.js +30 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/manifest/branding.d.ts +14 -0
- package/dist/manifest/branding.js +18 -0
- package/dist/manifest/connections.d.ts +21 -0
- package/dist/manifest/connections.js +10 -0
- package/dist/manifest/json-schema.d.ts +2 -0
- package/dist/manifest/json-schema.js +13 -0
- package/dist/manifest/l10n.d.ts +9 -0
- package/dist/manifest/l10n.js +28 -0
- package/dist/manifest/manifest.d.ts +112 -0
- package/dist/manifest/manifest.js +45 -0
- package/dist/manifest/validate.d.ts +14 -0
- package/dist/manifest/validate.js +144 -0
- package/dist/permissions/permissions.d.ts +31 -0
- package/dist/permissions/permissions.js +53 -0
- package/dist/process-entry.d.ts +26 -0
- package/dist/process-entry.js +146 -0
- package/dist/protocol/envelope.d.ts +115 -0
- package/dist/protocol/envelope.js +72 -0
- package/dist/protocol/error.d.ts +67 -0
- package/dist/protocol/error.js +61 -0
- package/dist/protocol/handshake.d.ts +55 -0
- package/dist/protocol/handshake.js +26 -0
- package/dist/protocol/map.d.ts +1090 -0
- package/dist/protocol/map.js +127 -0
- package/dist/protocol/meta.d.ts +31 -0
- package/dist/protocol/meta.js +14 -0
- package/dist/protocol/method-spec.d.ts +13 -0
- package/dist/protocol/method-spec.js +9 -0
- package/dist/protocol/org-service-methods.d.ts +135 -0
- package/dist/protocol/org-service-methods.js +106 -0
- package/dist/protocol/shared.d.ts +389 -0
- package/dist/protocol/shared.js +231 -0
- package/dist/protocol/source-methods.d.ts +218 -0
- package/dist/protocol/source-methods.js +18 -0
- package/dist/protocol/thread-service-methods.d.ts +50 -0
- package/dist/protocol/thread-service-methods.js +32 -0
- package/dist/runtime.d.ts +25 -0
- package/dist/runtime.js +229 -0
- package/dist/testing/fake-db.d.ts +15 -0
- package/dist/testing/fake-db.js +120 -0
- package/dist/testing/fake-files.d.ts +9 -0
- package/dist/testing/fake-files.js +87 -0
- package/dist/testing/fake-host.d.ts +115 -0
- package/dist/testing/fake-host.js +217 -0
- package/dist/testing/fake-services.d.ts +63 -0
- package/dist/testing/fake-services.js +277 -0
- package/dist/testing/fixtures.d.ts +5 -0
- package/dist/testing/fixtures.js +101 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +2 -0
- package/package.json +66 -4
- package/src/addon-context-factory.ts +236 -0
- package/src/addon-context.ts +313 -0
- package/src/define-addon.ts +178 -0
- package/src/families/config.ts +24 -0
- package/src/families/content.ts +35 -0
- package/src/families/field-spec.ts +175 -0
- package/src/families/hook.ts +34 -0
- package/src/families/job.ts +41 -0
- package/src/families/json-schema-value.ts +322 -0
- package/src/families/json-schema.ts +167 -0
- package/src/families/lsp.ts +28 -0
- package/src/families/mcp.ts +28 -0
- package/src/families/registry.ts +44 -0
- package/src/families/route.ts +52 -0
- package/src/families/source-kind.ts +34 -0
- package/src/families/tool-pack.ts +92 -0
- package/src/families/transport.ts +52 -0
- package/src/families/trigger.ts +92 -0
- package/src/families/view.ts +144 -0
- package/src/families/viewer.ts +43 -0
- package/src/families/worker.ts +30 -0
- package/src/host-client.ts +52 -0
- package/src/index.ts +345 -0
- package/src/manifest/branding.ts +24 -0
- package/src/manifest/connections.ts +21 -0
- package/src/manifest/json-schema.ts +24 -0
- package/src/manifest/l10n.ts +39 -0
- package/src/manifest/manifest.ts +94 -0
- package/src/manifest/validate.ts +200 -0
- package/src/permissions/permissions.ts +79 -0
- package/src/process-entry.ts +205 -0
- package/src/protocol/envelope.ts +126 -0
- package/src/protocol/error.ts +81 -0
- package/src/protocol/handshake.ts +43 -0
- package/src/protocol/map.ts +339 -0
- package/src/protocol/meta.ts +26 -0
- package/src/protocol/method-spec.ts +40 -0
- package/src/protocol/org-service-methods.ts +148 -0
- package/src/protocol/shared.ts +345 -0
- package/src/protocol/source-methods.ts +61 -0
- package/src/protocol/thread-service-methods.ts +50 -0
- package/src/runtime.ts +332 -0
- package/src/testing/fake-db.ts +140 -0
- package/src/testing/fake-files.ts +114 -0
- package/src/testing/fake-host.ts +350 -0
- package/src/testing/fake-services.ts +345 -0
- package/src/testing/fixtures.ts +106 -0
- package/src/testing/index.ts +12 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SqlParamSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
3
|
+
export declare const DbRowSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
4
|
+
export declare const LogLevelSchema: z.ZodEnum<{
|
|
5
|
+
error: "error";
|
|
6
|
+
debug: "debug";
|
|
7
|
+
info: "info";
|
|
8
|
+
warn: "warn";
|
|
9
|
+
}>;
|
|
10
|
+
export type LogLevel = z.infer<typeof LogLevelSchema>;
|
|
11
|
+
export declare const LogWriteParamsSchema: z.ZodObject<{
|
|
12
|
+
level: z.ZodEnum<{
|
|
13
|
+
error: "error";
|
|
14
|
+
debug: "debug";
|
|
15
|
+
info: "info";
|
|
16
|
+
warn: "warn";
|
|
17
|
+
}>;
|
|
18
|
+
message: z.ZodString;
|
|
19
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type MessageFormat = 'text' | 'markdown' | 'html';
|
|
22
|
+
export interface TransportAttachment {
|
|
23
|
+
id?: string;
|
|
24
|
+
kind?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
mimeType?: string;
|
|
27
|
+
url?: string;
|
|
28
|
+
path?: string;
|
|
29
|
+
dataBase64?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TransportOption {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TransportBindingSummary {
|
|
36
|
+
provider: string;
|
|
37
|
+
channel: string;
|
|
38
|
+
threadId: string;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const TransportBindingSummarySchema: z.ZodObject<{
|
|
42
|
+
provider: z.ZodString;
|
|
43
|
+
channel: z.ZodString;
|
|
44
|
+
threadId: z.ZodString;
|
|
45
|
+
createdAt: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const BindingWriteParamsSchema: z.ZodObject<{
|
|
48
|
+
provider: z.ZodString;
|
|
49
|
+
channel: z.ZodString;
|
|
50
|
+
threadId: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const BindingChannelParamsSchema: z.ZodObject<{
|
|
53
|
+
provider: z.ZodString;
|
|
54
|
+
channel: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare const OkResultSchema: z.ZodObject<{
|
|
57
|
+
ok: z.ZodLiteral<true>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export interface TransportMessage {
|
|
60
|
+
channel: string;
|
|
61
|
+
text: string;
|
|
62
|
+
format?: MessageFormat;
|
|
63
|
+
replyTo?: string;
|
|
64
|
+
topic?: string;
|
|
65
|
+
attachments?: TransportAttachment[];
|
|
66
|
+
options?: TransportOption[];
|
|
67
|
+
}
|
|
68
|
+
export declare const TransportAttachmentSchema: z.ZodObject<{
|
|
69
|
+
id: z.ZodOptional<z.ZodString>;
|
|
70
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
73
|
+
url: z.ZodOptional<z.ZodString>;
|
|
74
|
+
path: z.ZodOptional<z.ZodString>;
|
|
75
|
+
dataBase64: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export declare const TransportOptionSchema: z.ZodObject<{
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
label: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare const TransportMessageSchema: z.ZodObject<{
|
|
82
|
+
channel: z.ZodString;
|
|
83
|
+
text: z.ZodString;
|
|
84
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
text: "text";
|
|
86
|
+
markdown: "markdown";
|
|
87
|
+
html: "html";
|
|
88
|
+
}>>;
|
|
89
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
90
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
91
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
id: z.ZodOptional<z.ZodString>;
|
|
93
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
94
|
+
name: z.ZodOptional<z.ZodString>;
|
|
95
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
96
|
+
url: z.ZodOptional<z.ZodString>;
|
|
97
|
+
path: z.ZodOptional<z.ZodString>;
|
|
98
|
+
dataBase64: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
label: z.ZodString;
|
|
103
|
+
}, z.core.$strip>>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare const HttpAuthSchema: z.ZodObject<{
|
|
106
|
+
connection: z.ZodString;
|
|
107
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
scheme: z.ZodEnum<{
|
|
109
|
+
path: "path";
|
|
110
|
+
bearer: "bearer";
|
|
111
|
+
basic: "basic";
|
|
112
|
+
header: "header";
|
|
113
|
+
}>;
|
|
114
|
+
credentialKey: z.ZodOptional<z.ZodString>;
|
|
115
|
+
header: z.ZodOptional<z.ZodString>;
|
|
116
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export declare const HttpFetchParamsSchema: z.ZodObject<{
|
|
119
|
+
url: z.ZodString;
|
|
120
|
+
method: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
GET: "GET";
|
|
122
|
+
POST: "POST";
|
|
123
|
+
PUT: "PUT";
|
|
124
|
+
PATCH: "PATCH";
|
|
125
|
+
DELETE: "DELETE";
|
|
126
|
+
HEAD: "HEAD";
|
|
127
|
+
}>>;
|
|
128
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
129
|
+
body: z.ZodOptional<z.ZodString>;
|
|
130
|
+
bodyBase64: z.ZodOptional<z.ZodString>;
|
|
131
|
+
responseEncoding: z.ZodOptional<z.ZodEnum<{
|
|
132
|
+
text: "text";
|
|
133
|
+
base64: "base64";
|
|
134
|
+
}>>;
|
|
135
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
connection: z.ZodString;
|
|
137
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
138
|
+
scheme: z.ZodEnum<{
|
|
139
|
+
path: "path";
|
|
140
|
+
bearer: "bearer";
|
|
141
|
+
basic: "basic";
|
|
142
|
+
header: "header";
|
|
143
|
+
}>;
|
|
144
|
+
credentialKey: z.ZodOptional<z.ZodString>;
|
|
145
|
+
header: z.ZodOptional<z.ZodString>;
|
|
146
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
export declare const HttpFetchResultSchema: z.ZodObject<{
|
|
150
|
+
status: z.ZodNumber;
|
|
151
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
152
|
+
body: z.ZodNullable<z.ZodString>;
|
|
153
|
+
bodyBase64: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export declare const CloudRemoteExportSchema: z.ZodObject<{
|
|
156
|
+
mimeType: z.ZodString;
|
|
157
|
+
extension: z.ZodString;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export declare const CloudRemoteEntrySchema: z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
kind: z.ZodEnum<{
|
|
163
|
+
file: "file";
|
|
164
|
+
folder: "folder";
|
|
165
|
+
}>;
|
|
166
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
168
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
169
|
+
export: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
mimeType: z.ZodString;
|
|
171
|
+
extension: z.ZodString;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
export type CloudRemoteEntryWire = z.infer<typeof CloudRemoteEntrySchema>;
|
|
175
|
+
export type CloudRemoteExportWire = z.infer<typeof CloudRemoteExportSchema>;
|
|
176
|
+
export declare const SourceListParamsSchema: z.ZodObject<{
|
|
177
|
+
folderId: z.ZodString;
|
|
178
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
179
|
+
sourceKind: z.ZodString;
|
|
180
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
export declare const SourceListResultSchema: z.ZodObject<{
|
|
183
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
name: z.ZodString;
|
|
186
|
+
kind: z.ZodEnum<{
|
|
187
|
+
file: "file";
|
|
188
|
+
folder: "folder";
|
|
189
|
+
}>;
|
|
190
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
192
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
193
|
+
export: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
mimeType: z.ZodString;
|
|
195
|
+
extension: z.ZodString;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
export declare const SourceStatParamsSchema: z.ZodObject<{
|
|
201
|
+
fileId: z.ZodString;
|
|
202
|
+
sourceKind: z.ZodString;
|
|
203
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
export declare const SourceStatResultSchema: z.ZodObject<{
|
|
206
|
+
entry: z.ZodObject<{
|
|
207
|
+
id: z.ZodString;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
kind: z.ZodEnum<{
|
|
210
|
+
file: "file";
|
|
211
|
+
folder: "folder";
|
|
212
|
+
}>;
|
|
213
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
215
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
216
|
+
export: z.ZodOptional<z.ZodObject<{
|
|
217
|
+
mimeType: z.ZodString;
|
|
218
|
+
extension: z.ZodString;
|
|
219
|
+
}, z.core.$strip>>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
export declare const SourceReadParamsSchema: z.ZodObject<{
|
|
223
|
+
fileId: z.ZodString;
|
|
224
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
225
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
sourceKind: z.ZodString;
|
|
227
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
export declare const SourceBytesResultSchema: z.ZodObject<{
|
|
230
|
+
data: z.ZodString;
|
|
231
|
+
eof: z.ZodBoolean;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export declare const SourceUploadParamsSchema: z.ZodObject<{
|
|
234
|
+
parentId: z.ZodString;
|
|
235
|
+
fileId: z.ZodOptional<z.ZodString>;
|
|
236
|
+
name: z.ZodString;
|
|
237
|
+
data: z.ZodString;
|
|
238
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
239
|
+
sourceKind: z.ZodString;
|
|
240
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
export declare const SourceUploadResultSchema: z.ZodObject<{
|
|
243
|
+
id: z.ZodString;
|
|
244
|
+
name: z.ZodString;
|
|
245
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
export declare const SourceMkdirParamsSchema: z.ZodObject<{
|
|
248
|
+
parentId: z.ZodString;
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
sourceKind: z.ZodString;
|
|
251
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
export declare const SourceMkdirResultSchema: z.ZodObject<{
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
name: z.ZodString;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
export declare const SourceRemoveParamsSchema: z.ZodObject<{
|
|
258
|
+
fileId: z.ZodString;
|
|
259
|
+
sourceKind: z.ZodString;
|
|
260
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
export declare const SourceExportParamsSchema: z.ZodObject<{
|
|
263
|
+
fileId: z.ZodString;
|
|
264
|
+
mimeType: z.ZodString;
|
|
265
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
267
|
+
sourceKind: z.ZodString;
|
|
268
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
export declare const AccountSummarySchema: z.ZodObject<{
|
|
271
|
+
accountId: z.ZodString;
|
|
272
|
+
label: z.ZodString;
|
|
273
|
+
externalAccountId: z.ZodString;
|
|
274
|
+
status: z.ZodString;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
export interface AppCredentials {
|
|
277
|
+
kind: string;
|
|
278
|
+
values: Record<string, unknown>;
|
|
279
|
+
credentials: Record<string, string>;
|
|
280
|
+
}
|
|
281
|
+
export declare const AppCredentialsSchema: z.ZodObject<{
|
|
282
|
+
kind: z.ZodString;
|
|
283
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
284
|
+
credentials: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
export declare const TriggerFireOutcomeSchema: z.ZodObject<{
|
|
287
|
+
outcome: z.ZodEnum<{
|
|
288
|
+
fired: "fired";
|
|
289
|
+
suppressed: "suppressed";
|
|
290
|
+
busy: "busy";
|
|
291
|
+
failed: "failed";
|
|
292
|
+
}>;
|
|
293
|
+
runId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
export declare const InboundAttachmentSchema: z.ZodObject<{
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
298
|
+
path: z.ZodOptional<z.ZodString>;
|
|
299
|
+
dataBase64: z.ZodOptional<z.ZodString>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
export type InboundAttachment = z.infer<typeof InboundAttachmentSchema>;
|
|
302
|
+
export declare const InboundMessageSchema: z.ZodObject<{
|
|
303
|
+
channel: z.ZodString;
|
|
304
|
+
from: z.ZodOptional<z.ZodString>;
|
|
305
|
+
text: z.ZodString;
|
|
306
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
307
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
308
|
+
name: z.ZodString;
|
|
309
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
310
|
+
path: z.ZodOptional<z.ZodString>;
|
|
311
|
+
dataBase64: z.ZodOptional<z.ZodString>;
|
|
312
|
+
}, z.core.$strip>>>;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
export declare const BridgeInboundOutcomeSchema: z.ZodEnum<{
|
|
315
|
+
busy: "busy";
|
|
316
|
+
failed: "failed";
|
|
317
|
+
echo_suppressed: "echo_suppressed";
|
|
318
|
+
dispatched: "dispatched";
|
|
319
|
+
auto_replied: "auto_replied";
|
|
320
|
+
skipped: "skipped";
|
|
321
|
+
}>;
|
|
322
|
+
export type BridgeInboundOutcome = z.infer<typeof BridgeInboundOutcomeSchema>;
|
|
323
|
+
export interface RouteRequest {
|
|
324
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
325
|
+
path: string;
|
|
326
|
+
query: Record<string, string>;
|
|
327
|
+
headers: Record<string, string>;
|
|
328
|
+
body?: unknown;
|
|
329
|
+
/**
|
|
330
|
+
* Original request body as text, before JSON parsing. Signature verifiers
|
|
331
|
+
* need the exact bytes: re-serialized JSON does not match what the sender
|
|
332
|
+
* signed.
|
|
333
|
+
*/
|
|
334
|
+
rawBody?: string;
|
|
335
|
+
}
|
|
336
|
+
export interface RouteHandleResult {
|
|
337
|
+
status: number;
|
|
338
|
+
headers?: Record<string, string>;
|
|
339
|
+
body?: unknown;
|
|
340
|
+
}
|
|
341
|
+
export declare const RouteRequestSchema: z.ZodObject<{
|
|
342
|
+
method: z.ZodEnum<{
|
|
343
|
+
GET: "GET";
|
|
344
|
+
POST: "POST";
|
|
345
|
+
PUT: "PUT";
|
|
346
|
+
PATCH: "PATCH";
|
|
347
|
+
DELETE: "DELETE";
|
|
348
|
+
}>;
|
|
349
|
+
path: z.ZodString;
|
|
350
|
+
query: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
351
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
352
|
+
body: z.ZodOptional<z.ZodUnknown>;
|
|
353
|
+
rawBody: z.ZodOptional<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
export declare const RouteHandleResultSchema: z.ZodObject<{
|
|
356
|
+
status: z.ZodNumber;
|
|
357
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
358
|
+
body: z.ZodOptional<z.ZodUnknown>;
|
|
359
|
+
}, z.core.$strip>;
|
|
360
|
+
export declare const FileStatParamsSchema: z.ZodObject<{
|
|
361
|
+
path: z.ZodString;
|
|
362
|
+
}, z.core.$strip>;
|
|
363
|
+
export declare const FileStatResultSchema: z.ZodObject<{
|
|
364
|
+
path: z.ZodString;
|
|
365
|
+
name: z.ZodString;
|
|
366
|
+
size: z.ZodNumber;
|
|
367
|
+
mediaType: z.ZodString;
|
|
368
|
+
modifiedAt: z.ZodString;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
export declare const FileReadParamsSchema: z.ZodObject<{
|
|
371
|
+
path: z.ZodString;
|
|
372
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
373
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
export declare const FileReadResultSchema: z.ZodObject<{
|
|
376
|
+
data: z.ZodString;
|
|
377
|
+
eof: z.ZodBoolean;
|
|
378
|
+
size: z.ZodNumber;
|
|
379
|
+
mediaType: z.ZodString;
|
|
380
|
+
}, z.core.$strip>;
|
|
381
|
+
export declare const FileWriteParamsSchema: z.ZodObject<{
|
|
382
|
+
path: z.ZodString;
|
|
383
|
+
data: z.ZodString;
|
|
384
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
export declare const FileWriteResultSchema: z.ZodObject<{
|
|
387
|
+
path: z.ZodString;
|
|
388
|
+
size: z.ZodNumber;
|
|
389
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SqlParamSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
3
|
+
export const DbRowSchema = z.record(z.string(), z.unknown());
|
|
4
|
+
export const LogLevelSchema = z.enum(['debug', 'info', 'warn', 'error']);
|
|
5
|
+
export const LogWriteParamsSchema = z.object({
|
|
6
|
+
level: LogLevelSchema,
|
|
7
|
+
message: z.string().min(1),
|
|
8
|
+
fields: z.record(z.string(), z.unknown()).optional(),
|
|
9
|
+
});
|
|
10
|
+
export const TransportBindingSummarySchema = z.object({
|
|
11
|
+
provider: z.string().min(1),
|
|
12
|
+
channel: z.string().min(1),
|
|
13
|
+
threadId: z.string().min(1),
|
|
14
|
+
createdAt: z.string().min(1),
|
|
15
|
+
});
|
|
16
|
+
export const BindingWriteParamsSchema = z.object({
|
|
17
|
+
provider: z.string().min(1),
|
|
18
|
+
channel: z.string().min(1),
|
|
19
|
+
threadId: z.string().min(1),
|
|
20
|
+
});
|
|
21
|
+
export const BindingChannelParamsSchema = z.object({
|
|
22
|
+
provider: z.string().min(1),
|
|
23
|
+
channel: z.string().min(1),
|
|
24
|
+
});
|
|
25
|
+
export const OkResultSchema = z.object({ ok: z.literal(true) });
|
|
26
|
+
export const TransportAttachmentSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
id: z.string().optional(),
|
|
29
|
+
kind: z.string().optional(),
|
|
30
|
+
name: z.string().optional(),
|
|
31
|
+
mimeType: z.string().optional(),
|
|
32
|
+
url: z.string().min(1).optional(),
|
|
33
|
+
path: z.string().min(1).optional(),
|
|
34
|
+
dataBase64: z.string().min(1).optional(),
|
|
35
|
+
})
|
|
36
|
+
.refine((value) => [value.url, value.path, value.dataBase64].filter((entry) => entry !== undefined).length === 1, { message: 'exactly one of url, path or dataBase64 is required' });
|
|
37
|
+
export const TransportOptionSchema = z.object({
|
|
38
|
+
id: z.string().min(1),
|
|
39
|
+
label: z.string().min(1),
|
|
40
|
+
});
|
|
41
|
+
export const TransportMessageSchema = z.object({
|
|
42
|
+
channel: z.string().min(1),
|
|
43
|
+
text: z.string(),
|
|
44
|
+
format: z.enum(['text', 'markdown', 'html']).optional(),
|
|
45
|
+
replyTo: z.string().optional(),
|
|
46
|
+
topic: z.string().optional(),
|
|
47
|
+
attachments: z.array(TransportAttachmentSchema).optional(),
|
|
48
|
+
options: z.array(TransportOptionSchema).optional(),
|
|
49
|
+
});
|
|
50
|
+
export const HttpAuthSchema = z.object({
|
|
51
|
+
connection: z.string().min(1),
|
|
52
|
+
accountId: z.string().optional(),
|
|
53
|
+
scheme: z.enum(['bearer', 'basic', 'header', 'path']),
|
|
54
|
+
credentialKey: z.string().optional(),
|
|
55
|
+
header: z.string().optional(),
|
|
56
|
+
placeholder: z.string().min(1).optional(),
|
|
57
|
+
});
|
|
58
|
+
export const HttpFetchParamsSchema = z.object({
|
|
59
|
+
url: z.string().url(),
|
|
60
|
+
method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD']).default('GET'),
|
|
61
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
62
|
+
body: z.string().optional(),
|
|
63
|
+
bodyBase64: z.string().optional(),
|
|
64
|
+
responseEncoding: z.enum(['text', 'base64']).optional(),
|
|
65
|
+
auth: HttpAuthSchema.optional(),
|
|
66
|
+
});
|
|
67
|
+
export const HttpFetchResultSchema = z.object({
|
|
68
|
+
status: z.number().int(),
|
|
69
|
+
headers: z.record(z.string(), z.string()),
|
|
70
|
+
body: z.string().nullable(),
|
|
71
|
+
bodyBase64: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
export const CloudRemoteExportSchema = z.object({
|
|
74
|
+
mimeType: z.string().min(1),
|
|
75
|
+
extension: z.string().min(1),
|
|
76
|
+
});
|
|
77
|
+
export const CloudRemoteEntrySchema = z.object({
|
|
78
|
+
id: z.string().min(1),
|
|
79
|
+
name: z.string().min(1),
|
|
80
|
+
kind: z.enum(['file', 'folder']),
|
|
81
|
+
size: z.number().int().nonnegative().optional(),
|
|
82
|
+
modifiedAt: z.string().min(1).optional(),
|
|
83
|
+
mimeType: z.string().min(1).optional(),
|
|
84
|
+
export: CloudRemoteExportSchema.optional(),
|
|
85
|
+
});
|
|
86
|
+
const sourceSelector = {
|
|
87
|
+
sourceKind: z.string().min(1),
|
|
88
|
+
accountId: z.string().min(1).optional(),
|
|
89
|
+
};
|
|
90
|
+
export const SourceListParamsSchema = z.object({
|
|
91
|
+
...sourceSelector,
|
|
92
|
+
folderId: z.string().min(1),
|
|
93
|
+
pageToken: z.string().optional(),
|
|
94
|
+
});
|
|
95
|
+
export const SourceListResultSchema = z.object({
|
|
96
|
+
entries: z.array(CloudRemoteEntrySchema),
|
|
97
|
+
nextPageToken: z.string().optional(),
|
|
98
|
+
});
|
|
99
|
+
export const SourceStatParamsSchema = z.object({
|
|
100
|
+
...sourceSelector,
|
|
101
|
+
fileId: z.string().min(1),
|
|
102
|
+
});
|
|
103
|
+
export const SourceStatResultSchema = z.object({
|
|
104
|
+
entry: CloudRemoteEntrySchema,
|
|
105
|
+
});
|
|
106
|
+
export const SourceReadParamsSchema = z.object({
|
|
107
|
+
...sourceSelector,
|
|
108
|
+
fileId: z.string().min(1),
|
|
109
|
+
offset: z.number().int().nonnegative().optional(),
|
|
110
|
+
length: z.number().int().positive().optional(),
|
|
111
|
+
});
|
|
112
|
+
export const SourceBytesResultSchema = z.object({
|
|
113
|
+
data: z.string(),
|
|
114
|
+
eof: z.boolean(),
|
|
115
|
+
});
|
|
116
|
+
export const SourceUploadParamsSchema = z.object({
|
|
117
|
+
...sourceSelector,
|
|
118
|
+
parentId: z.string().min(1),
|
|
119
|
+
fileId: z.string().min(1).optional(),
|
|
120
|
+
name: z.string().min(1),
|
|
121
|
+
data: z.string(),
|
|
122
|
+
mimeType: z.string().min(1).optional(),
|
|
123
|
+
});
|
|
124
|
+
export const SourceUploadResultSchema = z.object({
|
|
125
|
+
id: z.string().min(1),
|
|
126
|
+
name: z.string().min(1),
|
|
127
|
+
modifiedAt: z.string().min(1).optional(),
|
|
128
|
+
});
|
|
129
|
+
export const SourceMkdirParamsSchema = z.object({
|
|
130
|
+
...sourceSelector,
|
|
131
|
+
parentId: z.string().min(1),
|
|
132
|
+
name: z.string().min(1),
|
|
133
|
+
});
|
|
134
|
+
export const SourceMkdirResultSchema = z.object({
|
|
135
|
+
id: z.string().min(1),
|
|
136
|
+
name: z.string().min(1),
|
|
137
|
+
});
|
|
138
|
+
export const SourceRemoveParamsSchema = z.object({
|
|
139
|
+
...sourceSelector,
|
|
140
|
+
fileId: z.string().min(1),
|
|
141
|
+
});
|
|
142
|
+
export const SourceExportParamsSchema = z.object({
|
|
143
|
+
...sourceSelector,
|
|
144
|
+
fileId: z.string().min(1),
|
|
145
|
+
mimeType: z.string().min(1),
|
|
146
|
+
offset: z.number().int().nonnegative().optional(),
|
|
147
|
+
length: z.number().int().positive().optional(),
|
|
148
|
+
});
|
|
149
|
+
export const AccountSummarySchema = z.object({
|
|
150
|
+
accountId: z.string().min(1),
|
|
151
|
+
label: z.string(),
|
|
152
|
+
externalAccountId: z.string(),
|
|
153
|
+
status: z.string(),
|
|
154
|
+
});
|
|
155
|
+
export const AppCredentialsSchema = z.object({
|
|
156
|
+
kind: z.string().min(1),
|
|
157
|
+
values: z.record(z.string(), z.unknown()),
|
|
158
|
+
credentials: z.record(z.string(), z.string()),
|
|
159
|
+
});
|
|
160
|
+
export const TriggerFireOutcomeSchema = z.object({
|
|
161
|
+
outcome: z.enum(['fired', 'suppressed', 'busy', 'failed']),
|
|
162
|
+
runId: z.string().nullable().optional(),
|
|
163
|
+
});
|
|
164
|
+
export const InboundAttachmentSchema = z
|
|
165
|
+
.object({
|
|
166
|
+
name: z.string().min(1),
|
|
167
|
+
mediaType: z.string().min(1).optional(),
|
|
168
|
+
path: z.string().min(1).optional(),
|
|
169
|
+
dataBase64: z.string().min(1).optional(),
|
|
170
|
+
})
|
|
171
|
+
.refine((value) => (value.path === undefined) !== (value.dataBase64 === undefined), {
|
|
172
|
+
message: 'exactly one of path or dataBase64 is required',
|
|
173
|
+
});
|
|
174
|
+
export const InboundMessageSchema = z.object({
|
|
175
|
+
channel: z.string().min(1),
|
|
176
|
+
from: z.string().optional(),
|
|
177
|
+
text: z.string(),
|
|
178
|
+
payload: z.unknown().optional(),
|
|
179
|
+
attachments: z.array(InboundAttachmentSchema).max(10).optional(),
|
|
180
|
+
});
|
|
181
|
+
export const BridgeInboundOutcomeSchema = z.enum([
|
|
182
|
+
'echo_suppressed',
|
|
183
|
+
'dispatched',
|
|
184
|
+
'auto_replied',
|
|
185
|
+
'skipped',
|
|
186
|
+
'busy',
|
|
187
|
+
'failed',
|
|
188
|
+
]);
|
|
189
|
+
export const RouteRequestSchema = z.object({
|
|
190
|
+
method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),
|
|
191
|
+
path: z.string().min(1),
|
|
192
|
+
query: z.record(z.string(), z.string()),
|
|
193
|
+
headers: z.record(z.string(), z.string()),
|
|
194
|
+
body: z.unknown().optional(),
|
|
195
|
+
rawBody: z.string().optional(),
|
|
196
|
+
});
|
|
197
|
+
export const RouteHandleResultSchema = z.object({
|
|
198
|
+
status: z.number().int(),
|
|
199
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
200
|
+
body: z.unknown().optional(),
|
|
201
|
+
});
|
|
202
|
+
export const FileStatParamsSchema = z.object({
|
|
203
|
+
path: z.string().min(1),
|
|
204
|
+
});
|
|
205
|
+
export const FileStatResultSchema = z.object({
|
|
206
|
+
path: z.string().min(1),
|
|
207
|
+
name: z.string().min(1),
|
|
208
|
+
size: z.number().int().nonnegative(),
|
|
209
|
+
mediaType: z.string().min(1),
|
|
210
|
+
modifiedAt: z.string().min(1),
|
|
211
|
+
});
|
|
212
|
+
export const FileReadParamsSchema = z.object({
|
|
213
|
+
path: z.string().min(1),
|
|
214
|
+
offset: z.number().int().nonnegative().optional(),
|
|
215
|
+
length: z.number().int().positive().optional(),
|
|
216
|
+
});
|
|
217
|
+
export const FileReadResultSchema = z.object({
|
|
218
|
+
data: z.string(),
|
|
219
|
+
eof: z.boolean(),
|
|
220
|
+
size: z.number().int().nonnegative(),
|
|
221
|
+
mediaType: z.string().min(1),
|
|
222
|
+
});
|
|
223
|
+
export const FileWriteParamsSchema = z.object({
|
|
224
|
+
path: z.string().min(1),
|
|
225
|
+
data: z.string(),
|
|
226
|
+
append: z.boolean().optional(),
|
|
227
|
+
});
|
|
228
|
+
export const FileWriteResultSchema = z.object({
|
|
229
|
+
path: z.string().min(1),
|
|
230
|
+
size: z.number().int().nonnegative(),
|
|
231
|
+
});
|