@fragno-dev/backoffice-api 0.0.0-stage → 0.0.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.md +16 -0
- package/README.md +90 -2
- package/dist/api.d.ts +35 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +10 -0
- package/dist/api.js.map +1 -0
- package/dist/errors.d.ts +45 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +35 -0
- package/dist/errors.js.map +1 -0
- package/dist/openapi.d.ts +46 -0
- package/dist/openapi.d.ts.map +1 -0
- package/dist/openapi.js +205 -0
- package/dist/openapi.js.map +1 -0
- package/dist/v0/account.d.ts +171 -0
- package/dist/v0/account.d.ts.map +1 -0
- package/dist/v0/account.js +78 -0
- package/dist/v0/account.js.map +1 -0
- package/dist/v0/api.d.ts +3437 -0
- package/dist/v0/api.d.ts.map +1 -0
- package/dist/v0/api.js +52 -0
- package/dist/v0/api.js.map +1 -0
- package/dist/v0/app-actions.d.ts +105 -0
- package/dist/v0/app-actions.d.ts.map +1 -0
- package/dist/v0/app-actions.js +100 -0
- package/dist/v0/app-actions.js.map +1 -0
- package/dist/v0/apps.d.ts +417 -0
- package/dist/v0/apps.d.ts.map +1 -0
- package/dist/v0/apps.js +163 -0
- package/dist/v0/apps.js.map +1 -0
- package/dist/v0/automation.d.ts +730 -0
- package/dist/v0/automation.d.ts.map +1 -0
- package/dist/v0/automation.js +355 -0
- package/dist/v0/automation.js.map +1 -0
- package/dist/v0/capabilities.d.ts +97 -0
- package/dist/v0/capabilities.d.ts.map +1 -0
- package/dist/v0/capabilities.js +41 -0
- package/dist/v0/capabilities.js.map +1 -0
- package/dist/v0/client.d.ts +39 -0
- package/dist/v0/client.d.ts.map +1 -0
- package/dist/v0/client.js +61 -0
- package/dist/v0/client.js.map +1 -0
- package/dist/v0/events.d.ts +789 -0
- package/dist/v0/events.d.ts.map +1 -0
- package/dist/v0/events.js +153 -0
- package/dist/v0/events.js.map +1 -0
- package/dist/v0/forms.d.ts +172 -0
- package/dist/v0/forms.d.ts.map +1 -0
- package/dist/v0/forms.js +88 -0
- package/dist/v0/forms.js.map +1 -0
- package/dist/v0/hooks.d.ts +61 -0
- package/dist/v0/hooks.d.ts.map +1 -0
- package/dist/v0/hooks.js +49 -0
- package/dist/v0/hooks.js.map +1 -0
- package/dist/v0/identity.d.ts +73 -0
- package/dist/v0/identity.d.ts.map +1 -0
- package/dist/v0/identity.js +46 -0
- package/dist/v0/identity.js.map +1 -0
- package/dist/v0/integrations.d.ts +847 -0
- package/dist/v0/integrations.d.ts.map +1 -0
- package/dist/v0/integrations.js +255 -0
- package/dist/v0/integrations.js.map +1 -0
- package/dist/v0/javascript.d.ts +160 -0
- package/dist/v0/javascript.d.ts.map +1 -0
- package/dist/v0/javascript.js +123 -0
- package/dist/v0/javascript.js.map +1 -0
- package/dist/v0/marketplace.d.ts +825 -0
- package/dist/v0/marketplace.d.ts.map +1 -0
- package/dist/v0/marketplace.js +284 -0
- package/dist/v0/marketplace.js.map +1 -0
- package/dist/v0/organization.d.ts +182 -0
- package/dist/v0/organization.d.ts.map +1 -0
- package/dist/v0/organization.js +88 -0
- package/dist/v0/organization.js.map +1 -0
- package/dist/v0/otp.d.ts +37 -0
- package/dist/v0/otp.d.ts.map +1 -0
- package/dist/v0/otp.js +29 -0
- package/dist/v0/otp.js.map +1 -0
- package/dist/v0/pi.d.ts +322 -0
- package/dist/v0/pi.d.ts.map +1 -0
- package/dist/v0/pi.js +146 -0
- package/dist/v0/pi.js.map +1 -0
- package/dist/v0/sandbox.d.ts +173 -0
- package/dist/v0/sandbox.d.ts.map +1 -0
- package/dist/v0/sandbox.js +97 -0
- package/dist/v0/sandbox.js.map +1 -0
- package/dist/v0/shared/bytes.d.ts +12 -0
- package/dist/v0/shared/bytes.d.ts.map +1 -0
- package/dist/v0/shared/bytes.js +16 -0
- package/dist/v0/shared/bytes.js.map +1 -0
- package/dist/v0/shared/datetime.d.ts +10 -0
- package/dist/v0/shared/datetime.d.ts.map +1 -0
- package/dist/v0/shared/datetime.js +14 -0
- package/dist/v0/shared/datetime.js.map +1 -0
- package/dist/v0/shared/json.d.ts +9 -0
- package/dist/v0/shared/json.d.ts.map +1 -0
- package/dist/v0/shared/json.js +14 -0
- package/dist/v0/shared/json.js.map +1 -0
- package/dist/v0/shared/pagination.d.ts +11 -0
- package/dist/v0/shared/pagination.d.ts.map +1 -0
- package/dist/v0/shared/pagination.js +11 -0
- package/dist/v0/shared/pagination.js.map +1 -0
- package/dist/v0/shared/permissions.d.ts +279 -0
- package/dist/v0/shared/permissions.d.ts.map +1 -0
- package/dist/v0/shared/permissions.js +285 -0
- package/dist/v0/shared/permissions.js.map +1 -0
- package/dist/v0/shared/pi-agent-name.d.ts +10 -0
- package/dist/v0/shared/pi-agent-name.d.ts.map +1 -0
- package/dist/v0/shared/pi-agent-name.js +11 -0
- package/dist/v0/shared/pi-agent-name.js.map +1 -0
- package/dist/v0/shared/scope.d.ts +305 -0
- package/dist/v0/shared/scope.d.ts.map +1 -0
- package/dist/v0/shared/scope.js +279 -0
- package/dist/v0/shared/scope.js.map +1 -0
- package/dist/v0/state.d.ts +512 -0
- package/dist/v0/state.d.ts.map +1 -0
- package/dist/v0/state.js +267 -0
- package/dist/v0/state.js.map +1 -0
- package/dist/v0/store.d.ts +138 -0
- package/dist/v0/store.d.ts.map +1 -0
- package/dist/v0/store.js +83 -0
- package/dist/v0/store.js.map +1 -0
- package/dist/v0/upload.d.ts +568 -0
- package/dist/v0/upload.d.ts.map +1 -0
- package/dist/v0/upload.js +109 -0
- package/dist/v0/upload.js.map +1 -0
- package/dist/v0/web.d.ts +47 -0
- package/dist/v0/web.d.ts.map +1 -0
- package/dist/v0/web.js +31 -0
- package/dist/v0/web.js.map +1 -0
- package/dist/v0/workflow.d.ts +267 -0
- package/dist/v0/workflow.d.ts.map +1 -0
- package/dist/v0/workflow.js +116 -0
- package/dist/v0/workflow.js.map +1 -0
- package/package.json +64 -3
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/v0/upload.d.ts
|
|
3
|
+
declare const preparedUploadedFileReferenceSchema: z.ZodLazy<z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
5
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"org">;
|
|
7
|
+
orgId: z.ZodString;
|
|
8
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
9
|
+
kind: z.ZodLiteral<"user">;
|
|
10
|
+
userId: z.ZodString;
|
|
11
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"app">;
|
|
13
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
14
|
+
kind: z.ZodLiteral<"org">;
|
|
15
|
+
orgId: z.ZodString;
|
|
16
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
17
|
+
kind: z.ZodLiteral<"user">;
|
|
18
|
+
userId: z.ZodString;
|
|
19
|
+
}, z.core.$strict>>], "kind">>;
|
|
20
|
+
appId: z.ZodString;
|
|
21
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"project">;
|
|
23
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"org">;
|
|
25
|
+
orgId: z.ZodString;
|
|
26
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"user">;
|
|
28
|
+
userId: z.ZodString;
|
|
29
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<"app">;
|
|
31
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
32
|
+
kind: z.ZodLiteral<"org">;
|
|
33
|
+
orgId: z.ZodString;
|
|
34
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"user">;
|
|
36
|
+
userId: z.ZodString;
|
|
37
|
+
}, z.core.$strict>>], "kind">>;
|
|
38
|
+
appId: z.ZodString;
|
|
39
|
+
}, z.core.$strict>>], "kind">;
|
|
40
|
+
projectId: z.ZodString;
|
|
41
|
+
}, z.core.$strict>>], "kind">>;
|
|
42
|
+
uploadId: z.ZodString;
|
|
43
|
+
provider: z.ZodString;
|
|
44
|
+
fileKey: z.ZodString;
|
|
45
|
+
filename: z.ZodString;
|
|
46
|
+
sizeBytes: z.ZodNumber;
|
|
47
|
+
contentType: z.ZodString;
|
|
48
|
+
expiresAt: z.ZodISODateTime;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
declare const uploadPreparedInputSchema: z.ZodLazy<z.ZodObject<{
|
|
51
|
+
file: z.ZodLazy<z.ZodObject<{
|
|
52
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
53
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
54
|
+
kind: z.ZodLiteral<"org">;
|
|
55
|
+
orgId: z.ZodString;
|
|
56
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
57
|
+
kind: z.ZodLiteral<"user">;
|
|
58
|
+
userId: z.ZodString;
|
|
59
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"app">;
|
|
61
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"org">;
|
|
63
|
+
orgId: z.ZodString;
|
|
64
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
65
|
+
kind: z.ZodLiteral<"user">;
|
|
66
|
+
userId: z.ZodString;
|
|
67
|
+
}, z.core.$strict>>], "kind">>;
|
|
68
|
+
appId: z.ZodString;
|
|
69
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
70
|
+
kind: z.ZodLiteral<"project">;
|
|
71
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"org">;
|
|
73
|
+
orgId: z.ZodString;
|
|
74
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
75
|
+
kind: z.ZodLiteral<"user">;
|
|
76
|
+
userId: z.ZodString;
|
|
77
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
78
|
+
kind: z.ZodLiteral<"app">;
|
|
79
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
80
|
+
kind: z.ZodLiteral<"org">;
|
|
81
|
+
orgId: z.ZodString;
|
|
82
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
83
|
+
kind: z.ZodLiteral<"user">;
|
|
84
|
+
userId: z.ZodString;
|
|
85
|
+
}, z.core.$strict>>], "kind">>;
|
|
86
|
+
appId: z.ZodString;
|
|
87
|
+
}, z.core.$strict>>], "kind">;
|
|
88
|
+
projectId: z.ZodString;
|
|
89
|
+
}, z.core.$strict>>], "kind">>;
|
|
90
|
+
uploadId: z.ZodString;
|
|
91
|
+
provider: z.ZodString;
|
|
92
|
+
fileKey: z.ZodString;
|
|
93
|
+
filename: z.ZodString;
|
|
94
|
+
sizeBytes: z.ZodNumber;
|
|
95
|
+
contentType: z.ZodString;
|
|
96
|
+
expiresAt: z.ZodISODateTime;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
type PreparedUploadedFileReference = z.infer<typeof preparedUploadedFileReferenceSchema>;
|
|
100
|
+
declare const uploadedFileReferenceSchema: z.ZodLazy<z.ZodObject<{
|
|
101
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
102
|
+
kind: z.ZodLiteral<"org">;
|
|
103
|
+
orgId: z.ZodString;
|
|
104
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
105
|
+
kind: z.ZodLiteral<"user">;
|
|
106
|
+
userId: z.ZodString;
|
|
107
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"app">;
|
|
109
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
110
|
+
kind: z.ZodLiteral<"org">;
|
|
111
|
+
orgId: z.ZodString;
|
|
112
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
113
|
+
kind: z.ZodLiteral<"user">;
|
|
114
|
+
userId: z.ZodString;
|
|
115
|
+
}, z.core.$strict>>], "kind">>;
|
|
116
|
+
appId: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
118
|
+
kind: z.ZodLiteral<"project">;
|
|
119
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
120
|
+
kind: z.ZodLiteral<"org">;
|
|
121
|
+
orgId: z.ZodString;
|
|
122
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
123
|
+
kind: z.ZodLiteral<"user">;
|
|
124
|
+
userId: z.ZodString;
|
|
125
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
126
|
+
kind: z.ZodLiteral<"app">;
|
|
127
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
128
|
+
kind: z.ZodLiteral<"org">;
|
|
129
|
+
orgId: z.ZodString;
|
|
130
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
131
|
+
kind: z.ZodLiteral<"user">;
|
|
132
|
+
userId: z.ZodString;
|
|
133
|
+
}, z.core.$strict>>], "kind">>;
|
|
134
|
+
appId: z.ZodString;
|
|
135
|
+
}, z.core.$strict>>], "kind">;
|
|
136
|
+
projectId: z.ZodString;
|
|
137
|
+
}, z.core.$strict>>], "kind">>;
|
|
138
|
+
sizeBytes: z.ZodNumber;
|
|
139
|
+
provider: z.ZodString;
|
|
140
|
+
uploadId: z.ZodString;
|
|
141
|
+
fileKey: z.ZodString;
|
|
142
|
+
filename: z.ZodString;
|
|
143
|
+
contentType: z.ZodString;
|
|
144
|
+
kind: z.ZodLiteral<"uploaded-file">;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
type UploadedFileReference = z.infer<typeof uploadedFileReferenceSchema>;
|
|
147
|
+
declare const uploadDiscardPreparedOutputSchema: z.ZodLazy<z.ZodObject<{
|
|
148
|
+
discarded: z.ZodLiteral<true>;
|
|
149
|
+
uploadId: z.ZodString;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
declare const uploadStorageSchema: z.ZodLazy<z.ZodObject<{
|
|
152
|
+
defaultProvider: z.ZodNullable<z.ZodLazy<z.ZodEnum<{
|
|
153
|
+
database: "database";
|
|
154
|
+
r2: "r2";
|
|
155
|
+
"r2-binding": "r2-binding";
|
|
156
|
+
}>>>;
|
|
157
|
+
providers: z.ZodArray<z.ZodLazy<z.ZodEnum<{
|
|
158
|
+
database: "database";
|
|
159
|
+
r2: "r2";
|
|
160
|
+
"r2-binding": "r2-binding";
|
|
161
|
+
}>>>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
declare const uploadStorageConfigureInputSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
164
|
+
provider: z.ZodLiteral<"database">;
|
|
165
|
+
default: z.ZodLazy<z.ZodBoolean>;
|
|
166
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
167
|
+
provider: z.ZodLiteral<"r2-binding">;
|
|
168
|
+
bindingName: z.ZodString;
|
|
169
|
+
default: z.ZodLazy<z.ZodBoolean>;
|
|
170
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
+
provider: z.ZodLiteral<"r2">;
|
|
172
|
+
bucket: z.ZodString;
|
|
173
|
+
endpoint: z.ZodURL;
|
|
174
|
+
accessKeyId: z.ZodString;
|
|
175
|
+
secretAccessKey: z.ZodString;
|
|
176
|
+
region: z.ZodString;
|
|
177
|
+
sessionToken: z.ZodNullable<z.ZodString>;
|
|
178
|
+
pathStyle: z.ZodBoolean;
|
|
179
|
+
default: z.ZodLazy<z.ZodBoolean>;
|
|
180
|
+
}, z.core.$strict>], "provider">>;
|
|
181
|
+
declare const uploadOperations: {
|
|
182
|
+
"upload.storage.get": {
|
|
183
|
+
description: string;
|
|
184
|
+
permissions: {
|
|
185
|
+
readonly namespace: "connections";
|
|
186
|
+
readonly permission: "read";
|
|
187
|
+
}[];
|
|
188
|
+
input: z.ZodVoid;
|
|
189
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
190
|
+
defaultProvider: z.ZodNullable<z.ZodLazy<z.ZodEnum<{
|
|
191
|
+
database: "database";
|
|
192
|
+
r2: "r2";
|
|
193
|
+
"r2-binding": "r2-binding";
|
|
194
|
+
}>>>;
|
|
195
|
+
providers: z.ZodArray<z.ZodLazy<z.ZodEnum<{
|
|
196
|
+
database: "database";
|
|
197
|
+
r2: "r2";
|
|
198
|
+
"r2-binding": "r2-binding";
|
|
199
|
+
}>>>;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
};
|
|
202
|
+
"upload.storage.configure": {
|
|
203
|
+
description: string;
|
|
204
|
+
permissions: {
|
|
205
|
+
readonly namespace: "connections";
|
|
206
|
+
readonly permission: "manage";
|
|
207
|
+
}[];
|
|
208
|
+
input: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
209
|
+
provider: z.ZodLiteral<"database">;
|
|
210
|
+
default: z.ZodLazy<z.ZodBoolean>;
|
|
211
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
212
|
+
provider: z.ZodLiteral<"r2-binding">;
|
|
213
|
+
bindingName: z.ZodString;
|
|
214
|
+
default: z.ZodLazy<z.ZodBoolean>;
|
|
215
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
216
|
+
provider: z.ZodLiteral<"r2">;
|
|
217
|
+
bucket: z.ZodString;
|
|
218
|
+
endpoint: z.ZodURL;
|
|
219
|
+
accessKeyId: z.ZodString;
|
|
220
|
+
secretAccessKey: z.ZodString;
|
|
221
|
+
region: z.ZodString;
|
|
222
|
+
sessionToken: z.ZodNullable<z.ZodString>;
|
|
223
|
+
pathStyle: z.ZodBoolean;
|
|
224
|
+
default: z.ZodLazy<z.ZodBoolean>;
|
|
225
|
+
}, z.core.$strict>], "provider">>;
|
|
226
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
227
|
+
defaultProvider: z.ZodNullable<z.ZodLazy<z.ZodEnum<{
|
|
228
|
+
database: "database";
|
|
229
|
+
r2: "r2";
|
|
230
|
+
"r2-binding": "r2-binding";
|
|
231
|
+
}>>>;
|
|
232
|
+
providers: z.ZodArray<z.ZodLazy<z.ZodEnum<{
|
|
233
|
+
database: "database";
|
|
234
|
+
r2: "r2";
|
|
235
|
+
"r2-binding": "r2-binding";
|
|
236
|
+
}>>>;
|
|
237
|
+
}, z.core.$strict>>;
|
|
238
|
+
};
|
|
239
|
+
"upload.prepared.read": {
|
|
240
|
+
description: string;
|
|
241
|
+
permissions: {
|
|
242
|
+
readonly namespace: "upload";
|
|
243
|
+
readonly permission: "read";
|
|
244
|
+
}[];
|
|
245
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
246
|
+
file: z.ZodLazy<z.ZodObject<{
|
|
247
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
248
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
249
|
+
kind: z.ZodLiteral<"org">;
|
|
250
|
+
orgId: z.ZodString;
|
|
251
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
252
|
+
kind: z.ZodLiteral<"user">;
|
|
253
|
+
userId: z.ZodString;
|
|
254
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
255
|
+
kind: z.ZodLiteral<"app">;
|
|
256
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
257
|
+
kind: z.ZodLiteral<"org">;
|
|
258
|
+
orgId: z.ZodString;
|
|
259
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
260
|
+
kind: z.ZodLiteral<"user">;
|
|
261
|
+
userId: z.ZodString;
|
|
262
|
+
}, z.core.$strict>>], "kind">>;
|
|
263
|
+
appId: z.ZodString;
|
|
264
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
265
|
+
kind: z.ZodLiteral<"project">;
|
|
266
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
267
|
+
kind: z.ZodLiteral<"org">;
|
|
268
|
+
orgId: z.ZodString;
|
|
269
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
270
|
+
kind: z.ZodLiteral<"user">;
|
|
271
|
+
userId: z.ZodString;
|
|
272
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
273
|
+
kind: z.ZodLiteral<"app">;
|
|
274
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
275
|
+
kind: z.ZodLiteral<"org">;
|
|
276
|
+
orgId: z.ZodString;
|
|
277
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
278
|
+
kind: z.ZodLiteral<"user">;
|
|
279
|
+
userId: z.ZodString;
|
|
280
|
+
}, z.core.$strict>>], "kind">>;
|
|
281
|
+
appId: z.ZodString;
|
|
282
|
+
}, z.core.$strict>>], "kind">;
|
|
283
|
+
projectId: z.ZodString;
|
|
284
|
+
}, z.core.$strict>>], "kind">>;
|
|
285
|
+
uploadId: z.ZodString;
|
|
286
|
+
provider: z.ZodString;
|
|
287
|
+
fileKey: z.ZodString;
|
|
288
|
+
filename: z.ZodString;
|
|
289
|
+
sizeBytes: z.ZodNumber;
|
|
290
|
+
contentType: z.ZodString;
|
|
291
|
+
expiresAt: z.ZodISODateTime;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
encoding: z.ZodOptional<z.ZodEnum<{
|
|
294
|
+
base64: "base64";
|
|
295
|
+
utf8: "utf8";
|
|
296
|
+
}>>;
|
|
297
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
}, z.core.$strip>>;
|
|
299
|
+
output: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
300
|
+
encoding: z.ZodLiteral<"utf8">;
|
|
301
|
+
text: z.ZodString;
|
|
302
|
+
file: z.ZodLazy<z.ZodObject<{
|
|
303
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
304
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
305
|
+
kind: z.ZodLiteral<"org">;
|
|
306
|
+
orgId: z.ZodString;
|
|
307
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
308
|
+
kind: z.ZodLiteral<"user">;
|
|
309
|
+
userId: z.ZodString;
|
|
310
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"app">;
|
|
312
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
313
|
+
kind: z.ZodLiteral<"org">;
|
|
314
|
+
orgId: z.ZodString;
|
|
315
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
316
|
+
kind: z.ZodLiteral<"user">;
|
|
317
|
+
userId: z.ZodString;
|
|
318
|
+
}, z.core.$strict>>], "kind">>;
|
|
319
|
+
appId: z.ZodString;
|
|
320
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
321
|
+
kind: z.ZodLiteral<"project">;
|
|
322
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
323
|
+
kind: z.ZodLiteral<"org">;
|
|
324
|
+
orgId: z.ZodString;
|
|
325
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
326
|
+
kind: z.ZodLiteral<"user">;
|
|
327
|
+
userId: z.ZodString;
|
|
328
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
329
|
+
kind: z.ZodLiteral<"app">;
|
|
330
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
331
|
+
kind: z.ZodLiteral<"org">;
|
|
332
|
+
orgId: z.ZodString;
|
|
333
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
334
|
+
kind: z.ZodLiteral<"user">;
|
|
335
|
+
userId: z.ZodString;
|
|
336
|
+
}, z.core.$strict>>], "kind">>;
|
|
337
|
+
appId: z.ZodString;
|
|
338
|
+
}, z.core.$strict>>], "kind">;
|
|
339
|
+
projectId: z.ZodString;
|
|
340
|
+
}, z.core.$strict>>], "kind">>;
|
|
341
|
+
uploadId: z.ZodString;
|
|
342
|
+
provider: z.ZodString;
|
|
343
|
+
fileKey: z.ZodString;
|
|
344
|
+
filename: z.ZodString;
|
|
345
|
+
sizeBytes: z.ZodNumber;
|
|
346
|
+
contentType: z.ZodString;
|
|
347
|
+
expiresAt: z.ZodISODateTime;
|
|
348
|
+
}, z.core.$strict>>;
|
|
349
|
+
byteLength: z.ZodLazy<z.ZodNumber>;
|
|
350
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
351
|
+
encoding: z.ZodLiteral<"base64">;
|
|
352
|
+
base64: z.ZodLazy<z.ZodBase64>;
|
|
353
|
+
file: z.ZodLazy<z.ZodObject<{
|
|
354
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
355
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
356
|
+
kind: z.ZodLiteral<"org">;
|
|
357
|
+
orgId: z.ZodString;
|
|
358
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
359
|
+
kind: z.ZodLiteral<"user">;
|
|
360
|
+
userId: z.ZodString;
|
|
361
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
362
|
+
kind: z.ZodLiteral<"app">;
|
|
363
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
364
|
+
kind: z.ZodLiteral<"org">;
|
|
365
|
+
orgId: z.ZodString;
|
|
366
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
367
|
+
kind: z.ZodLiteral<"user">;
|
|
368
|
+
userId: z.ZodString;
|
|
369
|
+
}, z.core.$strict>>], "kind">>;
|
|
370
|
+
appId: z.ZodString;
|
|
371
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
372
|
+
kind: z.ZodLiteral<"project">;
|
|
373
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
374
|
+
kind: z.ZodLiteral<"org">;
|
|
375
|
+
orgId: z.ZodString;
|
|
376
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
377
|
+
kind: z.ZodLiteral<"user">;
|
|
378
|
+
userId: z.ZodString;
|
|
379
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
380
|
+
kind: z.ZodLiteral<"app">;
|
|
381
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
382
|
+
kind: z.ZodLiteral<"org">;
|
|
383
|
+
orgId: z.ZodString;
|
|
384
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
385
|
+
kind: z.ZodLiteral<"user">;
|
|
386
|
+
userId: z.ZodString;
|
|
387
|
+
}, z.core.$strict>>], "kind">>;
|
|
388
|
+
appId: z.ZodString;
|
|
389
|
+
}, z.core.$strict>>], "kind">;
|
|
390
|
+
projectId: z.ZodString;
|
|
391
|
+
}, z.core.$strict>>], "kind">>;
|
|
392
|
+
uploadId: z.ZodString;
|
|
393
|
+
provider: z.ZodString;
|
|
394
|
+
fileKey: z.ZodString;
|
|
395
|
+
filename: z.ZodString;
|
|
396
|
+
sizeBytes: z.ZodNumber;
|
|
397
|
+
contentType: z.ZodString;
|
|
398
|
+
expiresAt: z.ZodISODateTime;
|
|
399
|
+
}, z.core.$strict>>;
|
|
400
|
+
byteLength: z.ZodLazy<z.ZodNumber>;
|
|
401
|
+
}, z.core.$strip>], "encoding">>;
|
|
402
|
+
};
|
|
403
|
+
"upload.prepared.commit": {
|
|
404
|
+
description: string;
|
|
405
|
+
permissions: {
|
|
406
|
+
readonly namespace: "upload";
|
|
407
|
+
readonly permission: "modify";
|
|
408
|
+
}[];
|
|
409
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
410
|
+
file: z.ZodLazy<z.ZodObject<{
|
|
411
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
412
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
413
|
+
kind: z.ZodLiteral<"org">;
|
|
414
|
+
orgId: z.ZodString;
|
|
415
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
416
|
+
kind: z.ZodLiteral<"user">;
|
|
417
|
+
userId: z.ZodString;
|
|
418
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
419
|
+
kind: z.ZodLiteral<"app">;
|
|
420
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
421
|
+
kind: z.ZodLiteral<"org">;
|
|
422
|
+
orgId: z.ZodString;
|
|
423
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
424
|
+
kind: z.ZodLiteral<"user">;
|
|
425
|
+
userId: z.ZodString;
|
|
426
|
+
}, z.core.$strict>>], "kind">>;
|
|
427
|
+
appId: z.ZodString;
|
|
428
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
429
|
+
kind: z.ZodLiteral<"project">;
|
|
430
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
431
|
+
kind: z.ZodLiteral<"org">;
|
|
432
|
+
orgId: z.ZodString;
|
|
433
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
434
|
+
kind: z.ZodLiteral<"user">;
|
|
435
|
+
userId: z.ZodString;
|
|
436
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
437
|
+
kind: z.ZodLiteral<"app">;
|
|
438
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
439
|
+
kind: z.ZodLiteral<"org">;
|
|
440
|
+
orgId: z.ZodString;
|
|
441
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
442
|
+
kind: z.ZodLiteral<"user">;
|
|
443
|
+
userId: z.ZodString;
|
|
444
|
+
}, z.core.$strict>>], "kind">>;
|
|
445
|
+
appId: z.ZodString;
|
|
446
|
+
}, z.core.$strict>>], "kind">;
|
|
447
|
+
projectId: z.ZodString;
|
|
448
|
+
}, z.core.$strict>>], "kind">>;
|
|
449
|
+
uploadId: z.ZodString;
|
|
450
|
+
provider: z.ZodString;
|
|
451
|
+
fileKey: z.ZodString;
|
|
452
|
+
filename: z.ZodString;
|
|
453
|
+
sizeBytes: z.ZodNumber;
|
|
454
|
+
contentType: z.ZodString;
|
|
455
|
+
expiresAt: z.ZodISODateTime;
|
|
456
|
+
}, z.core.$strict>>;
|
|
457
|
+
}, z.core.$strip>>;
|
|
458
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
459
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
460
|
+
kind: z.ZodLiteral<"org">;
|
|
461
|
+
orgId: z.ZodString;
|
|
462
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
463
|
+
kind: z.ZodLiteral<"user">;
|
|
464
|
+
userId: z.ZodString;
|
|
465
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
466
|
+
kind: z.ZodLiteral<"app">;
|
|
467
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
468
|
+
kind: z.ZodLiteral<"org">;
|
|
469
|
+
orgId: z.ZodString;
|
|
470
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
471
|
+
kind: z.ZodLiteral<"user">;
|
|
472
|
+
userId: z.ZodString;
|
|
473
|
+
}, z.core.$strict>>], "kind">>;
|
|
474
|
+
appId: z.ZodString;
|
|
475
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
476
|
+
kind: z.ZodLiteral<"project">;
|
|
477
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
478
|
+
kind: z.ZodLiteral<"org">;
|
|
479
|
+
orgId: z.ZodString;
|
|
480
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
481
|
+
kind: z.ZodLiteral<"user">;
|
|
482
|
+
userId: z.ZodString;
|
|
483
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
484
|
+
kind: z.ZodLiteral<"app">;
|
|
485
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
486
|
+
kind: z.ZodLiteral<"org">;
|
|
487
|
+
orgId: z.ZodString;
|
|
488
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
489
|
+
kind: z.ZodLiteral<"user">;
|
|
490
|
+
userId: z.ZodString;
|
|
491
|
+
}, z.core.$strict>>], "kind">>;
|
|
492
|
+
appId: z.ZodString;
|
|
493
|
+
}, z.core.$strict>>], "kind">;
|
|
494
|
+
projectId: z.ZodString;
|
|
495
|
+
}, z.core.$strict>>], "kind">>;
|
|
496
|
+
sizeBytes: z.ZodNumber;
|
|
497
|
+
provider: z.ZodString;
|
|
498
|
+
uploadId: z.ZodString;
|
|
499
|
+
fileKey: z.ZodString;
|
|
500
|
+
filename: z.ZodString;
|
|
501
|
+
contentType: z.ZodString;
|
|
502
|
+
kind: z.ZodLiteral<"uploaded-file">;
|
|
503
|
+
}, z.core.$strict>>;
|
|
504
|
+
};
|
|
505
|
+
"upload.prepared.discard": {
|
|
506
|
+
description: string;
|
|
507
|
+
permissions: {
|
|
508
|
+
readonly namespace: "upload";
|
|
509
|
+
readonly permission: "modify";
|
|
510
|
+
}[];
|
|
511
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
512
|
+
file: z.ZodLazy<z.ZodObject<{
|
|
513
|
+
kind: z.ZodLiteral<"prepared-upload">;
|
|
514
|
+
scope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
515
|
+
kind: z.ZodLiteral<"org">;
|
|
516
|
+
orgId: z.ZodString;
|
|
517
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
518
|
+
kind: z.ZodLiteral<"user">;
|
|
519
|
+
userId: z.ZodString;
|
|
520
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
521
|
+
kind: z.ZodLiteral<"app">;
|
|
522
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
523
|
+
kind: z.ZodLiteral<"org">;
|
|
524
|
+
orgId: z.ZodString;
|
|
525
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
526
|
+
kind: z.ZodLiteral<"user">;
|
|
527
|
+
userId: z.ZodString;
|
|
528
|
+
}, z.core.$strict>>], "kind">>;
|
|
529
|
+
appId: z.ZodString;
|
|
530
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
531
|
+
kind: z.ZodLiteral<"project">;
|
|
532
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
533
|
+
kind: z.ZodLiteral<"org">;
|
|
534
|
+
orgId: z.ZodString;
|
|
535
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
536
|
+
kind: z.ZodLiteral<"user">;
|
|
537
|
+
userId: z.ZodString;
|
|
538
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
539
|
+
kind: z.ZodLiteral<"app">;
|
|
540
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
541
|
+
kind: z.ZodLiteral<"org">;
|
|
542
|
+
orgId: z.ZodString;
|
|
543
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
544
|
+
kind: z.ZodLiteral<"user">;
|
|
545
|
+
userId: z.ZodString;
|
|
546
|
+
}, z.core.$strict>>], "kind">>;
|
|
547
|
+
appId: z.ZodString;
|
|
548
|
+
}, z.core.$strict>>], "kind">;
|
|
549
|
+
projectId: z.ZodString;
|
|
550
|
+
}, z.core.$strict>>], "kind">>;
|
|
551
|
+
uploadId: z.ZodString;
|
|
552
|
+
provider: z.ZodString;
|
|
553
|
+
fileKey: z.ZodString;
|
|
554
|
+
filename: z.ZodString;
|
|
555
|
+
sizeBytes: z.ZodNumber;
|
|
556
|
+
contentType: z.ZodString;
|
|
557
|
+
expiresAt: z.ZodISODateTime;
|
|
558
|
+
}, z.core.$strict>>;
|
|
559
|
+
}, z.core.$strip>>;
|
|
560
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
561
|
+
discarded: z.ZodLiteral<true>;
|
|
562
|
+
uploadId: z.ZodString;
|
|
563
|
+
}, z.core.$strip>>;
|
|
564
|
+
};
|
|
565
|
+
};
|
|
566
|
+
//#endregion
|
|
567
|
+
export { PreparedUploadedFileReference, UploadedFileReference, preparedUploadedFileReferenceSchema, uploadDiscardPreparedOutputSchema, uploadOperations, uploadPreparedInputSchema, uploadStorageConfigureInputSchema, uploadStorageSchema, uploadedFileReferenceSchema };
|
|
568
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","names":[],"sources":["../../src/v0/upload.ts"],"mappings":";;cAOa,qCAAmC,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcnC,2BAAyB,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAM1B,gCAAgC,EAAE,aAAa;cAE9C,6BAA2B,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAM5B,wBAAwB,EAAE,aAAa;cAEtC,mCAAiC,EAAA,QAAA,EAAA;;;;cAkBjC,qBAAmB,EAAA,QAAA,EAAA;;;;;;;;;;;;cAiBnB,mCAAiC,EAAA,QAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;cA6BjC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { BACKOFFICE_PERMISSION } from "./shared/permissions.js";
|
|
2
|
+
import { backofficeRoutableScopeSchema } from "./shared/scope.js";
|
|
3
|
+
import { base64BytesSchema } from "./shared/bytes.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/v0/upload.ts
|
|
6
|
+
const preparedUploadedFileReferenceSchema = z.lazy(() => z.strictObject({
|
|
7
|
+
kind: z.literal("prepared-upload"),
|
|
8
|
+
scope: backofficeRoutableScopeSchema,
|
|
9
|
+
uploadId: z.string().min(1).max(240),
|
|
10
|
+
provider: z.string().min(1).max(120),
|
|
11
|
+
fileKey: z.string().min(1).max(1024),
|
|
12
|
+
filename: z.string().min(1).max(500),
|
|
13
|
+
sizeBytes: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
14
|
+
contentType: z.string().min(1).max(240),
|
|
15
|
+
expiresAt: z.iso.datetime()
|
|
16
|
+
}));
|
|
17
|
+
const uploadPreparedInputSchema = z.lazy(() => z.object({ file: preparedUploadedFileReferenceSchema }));
|
|
18
|
+
const uploadedFileReferenceSchema = z.lazy(() => preparedUploadedFileReferenceSchema._zod.innerType.omit({
|
|
19
|
+
kind: true,
|
|
20
|
+
expiresAt: true
|
|
21
|
+
}).extend({ kind: z.literal("uploaded-file") }));
|
|
22
|
+
const uploadDiscardPreparedOutputSchema = z.lazy(() => z.object({
|
|
23
|
+
discarded: z.literal(true),
|
|
24
|
+
uploadId: z.string().trim().min(1)
|
|
25
|
+
}));
|
|
26
|
+
const uploadReadPreparedOutputFields = {
|
|
27
|
+
file: preparedUploadedFileReferenceSchema,
|
|
28
|
+
byteLength: z.lazy(() => z.number().int().nonnegative())
|
|
29
|
+
};
|
|
30
|
+
const uploadProviderSchema = z.lazy(() => z.enum([
|
|
31
|
+
"database",
|
|
32
|
+
"r2",
|
|
33
|
+
"r2-binding"
|
|
34
|
+
])).meta({ id: "UploadProvider" });
|
|
35
|
+
const uploadStorageSchema = z.lazy(() => z.strictObject({
|
|
36
|
+
defaultProvider: uploadProviderSchema.nullable().describe("The provider new uploads use; null until one is configured."),
|
|
37
|
+
providers: z.array(uploadProviderSchema).describe("Providers with stored configuration.")
|
|
38
|
+
})).meta({ id: "UploadStorage" });
|
|
39
|
+
const uploadStorageDefaultSchema = z.lazy(() => z.boolean().describe("Whether new uploads use this provider. Files already stored stay where they are."));
|
|
40
|
+
const uploadStorageConfigureInputSchema = z.lazy(() => z.discriminatedUnion("provider", [
|
|
41
|
+
z.strictObject({
|
|
42
|
+
provider: z.literal("database").describe("Files stored in Backoffice's own database."),
|
|
43
|
+
default: uploadStorageDefaultSchema
|
|
44
|
+
}),
|
|
45
|
+
z.strictObject({
|
|
46
|
+
provider: z.literal("r2-binding").describe("An R2 bucket bound to the Worker."),
|
|
47
|
+
bindingName: z.string().trim().min(1).describe("Name of the Worker's R2 bucket binding."),
|
|
48
|
+
default: uploadStorageDefaultSchema
|
|
49
|
+
}),
|
|
50
|
+
z.strictObject({
|
|
51
|
+
provider: z.literal("r2").describe("An R2 bucket reached through its S3 API."),
|
|
52
|
+
bucket: z.string().trim().min(1),
|
|
53
|
+
endpoint: z.url().describe("The account's S3 API endpoint."),
|
|
54
|
+
accessKeyId: z.string().trim().min(1).describe("Secret."),
|
|
55
|
+
secretAccessKey: z.string().trim().min(1).describe("Secret."),
|
|
56
|
+
region: z.string().trim().min(1).describe("Usually auto."),
|
|
57
|
+
sessionToken: z.string().trim().min(1).nullable().describe("Secret; null when unused."),
|
|
58
|
+
pathStyle: z.boolean().describe("Address the bucket in the path rather than the host name."),
|
|
59
|
+
default: uploadStorageDefaultSchema
|
|
60
|
+
})
|
|
61
|
+
])).meta({ id: "UploadStorageConfigureInput" });
|
|
62
|
+
const uploadOperations = {
|
|
63
|
+
"upload.storage.get": {
|
|
64
|
+
description: "Read the organization's upload storage: the configured providers and the one new uploads use.",
|
|
65
|
+
permissions: [BACKOFFICE_PERMISSION.connections.read],
|
|
66
|
+
input: z.void(),
|
|
67
|
+
output: uploadStorageSchema
|
|
68
|
+
},
|
|
69
|
+
"upload.storage.configure": {
|
|
70
|
+
description: "Store one upload storage provider's configuration for the organization, replacing that provider's earlier configuration. Secrets are never returned.",
|
|
71
|
+
permissions: [BACKOFFICE_PERMISSION.connections.manage],
|
|
72
|
+
input: uploadStorageConfigureInputSchema,
|
|
73
|
+
output: uploadStorageSchema
|
|
74
|
+
},
|
|
75
|
+
"upload.prepared.read": {
|
|
76
|
+
description: "Read one prepared private upload as UTF-8 text or base64-encoded bytes.",
|
|
77
|
+
permissions: [BACKOFFICE_PERMISSION.upload.read],
|
|
78
|
+
input: z.lazy(() => z.object({
|
|
79
|
+
file: preparedUploadedFileReferenceSchema,
|
|
80
|
+
encoding: z.enum(["utf8", "base64"]).optional(),
|
|
81
|
+
maxBytes: z.number().int().positive().max(50 * 1024 * 1024).optional()
|
|
82
|
+
})),
|
|
83
|
+
output: z.lazy(() => z.discriminatedUnion("encoding", [z.object({
|
|
84
|
+
...uploadReadPreparedOutputFields,
|
|
85
|
+
encoding: z.literal("utf8"),
|
|
86
|
+
text: z.string()
|
|
87
|
+
}), z.object({
|
|
88
|
+
...uploadReadPreparedOutputFields,
|
|
89
|
+
encoding: z.literal("base64"),
|
|
90
|
+
base64: base64BytesSchema
|
|
91
|
+
})]))
|
|
92
|
+
},
|
|
93
|
+
"upload.prepared.commit": {
|
|
94
|
+
description: "Commit a prepared private upload so the file persists.",
|
|
95
|
+
permissions: [BACKOFFICE_PERMISSION.upload.modify],
|
|
96
|
+
input: uploadPreparedInputSchema,
|
|
97
|
+
output: uploadedFileReferenceSchema
|
|
98
|
+
},
|
|
99
|
+
"upload.prepared.discard": {
|
|
100
|
+
description: "Discard a temporary prepared private upload.",
|
|
101
|
+
permissions: [BACKOFFICE_PERMISSION.upload.modify],
|
|
102
|
+
input: uploadPreparedInputSchema,
|
|
103
|
+
output: uploadDiscardPreparedOutputSchema
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
export { preparedUploadedFileReferenceSchema, uploadDiscardPreparedOutputSchema, uploadOperations, uploadPreparedInputSchema, uploadStorageConfigureInputSchema, uploadStorageSchema, uploadedFileReferenceSchema };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=upload.js.map
|