@noodleseed/one 0.172.1 → 0.173.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/dist/commands/solutions-draft-source.d.ts +9 -0
- package/dist/commands/solutions-draft-source.d.ts.map +1 -0
- package/dist/commands/solutions-draft-source.js +67 -0
- package/dist/commands/solutions-draft-source.js.map +1 -0
- package/dist/commands/solutions-drafts.d.ts +5 -0
- package/dist/commands/solutions-drafts.d.ts.map +1 -0
- package/dist/commands/solutions-drafts.js +159 -0
- package/dist/commands/solutions-drafts.js.map +1 -0
- package/dist/commands/solutions-ops.d.ts.map +1 -1
- package/dist/commands/solutions-ops.js +7 -1
- package/dist/commands/solutions-ops.js.map +1 -1
- package/dist/commands/solutions-page.d.ts +5 -0
- package/dist/commands/solutions-page.d.ts.map +1 -0
- package/dist/commands/solutions-page.js +85 -0
- package/dist/commands/solutions-page.js.map +1 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-drafts.js +141 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-page.js +57 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +4 -0
- package/node_modules/@noodle-borg/service/dist/application-drafts/contracts.js +11 -0
- package/node_modules/@noodle-borg/service/dist/application-drafts/paths.js +26 -0
- package/node_modules/@noodle-borg/service/dist/business-information/business-page-paths.js +14 -0
- package/node_modules/@noodle-borg/service/dist/business-information/business-page.d.ts +39 -0
- package/node_modules/@noodle-borg/service/dist/business-information/business-page.js +81 -0
- package/node_modules/@noodle-borg/service/dist/business-information/contracts.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-business-pages.js +37 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +3 -0
- package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-executable.js +11 -3
- package/node_modules/@noodle-borg/service/dist/routes/application-drafts.js +162 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-channels.js +3 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +22 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-pages.js +158 -0
- package/node_modules/@noodle-borg/service/dist/routes/service-probes.js +31 -0
- package/node_modules/@noodle-borg/service/dist/service.js +14 -18
- package/node_modules/@noodle-borg/service/dist/solution-installation-activation.js +3 -3
- package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.d.ts +3 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.js +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-drafts.d.ts +322 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-drafts.js +152 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-org-transfer.d.ts +8 -8
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-read.d.ts +5 -5
- package/node_modules/@noodle-borg/wire-contracts/dist/business-page.d.ts +157 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-page.js +105 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-workspaces.d.ts +22 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-workspaces.js +15 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/distribution.d.ts +10 -10
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +3 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Bounded browser-authoring input; not the compiled deployment artifact allowance. */
|
|
3
|
+
export declare const APPLICATION_DRAFT_LIMITS: Readonly<{
|
|
4
|
+
draftsPerApp: 10;
|
|
5
|
+
draftsPerWorkspace: 50;
|
|
6
|
+
sourceBytesPerWorkspace: number;
|
|
7
|
+
receiptsPerWorkspace: 10000;
|
|
8
|
+
retryWindowMs: number;
|
|
9
|
+
revisionsPerDraft: 100;
|
|
10
|
+
files: 64;
|
|
11
|
+
pathChars: 240;
|
|
12
|
+
fileBytes: number;
|
|
13
|
+
totalBytes: number;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const ApplicationDraftSourceSchema: z.ZodObject<{
|
|
16
|
+
entrypoint: z.ZodString;
|
|
17
|
+
files: z.ZodArray<z.ZodObject<{
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
content: z.ZodString;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type ApplicationDraftSource = z.infer<typeof ApplicationDraftSourceSchema>;
|
|
23
|
+
export declare const ApplicationDraftIdSchema: z.ZodString;
|
|
24
|
+
export declare const ApplicationDraftCreateRequestSchema: z.ZodObject<{
|
|
25
|
+
environment: z.ZodString;
|
|
26
|
+
source: z.ZodObject<{
|
|
27
|
+
entrypoint: z.ZodString;
|
|
28
|
+
files: z.ZodArray<z.ZodObject<{
|
|
29
|
+
path: z.ZodString;
|
|
30
|
+
content: z.ZodString;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export declare const ApplicationDraftEditRequestSchema: z.ZodObject<{
|
|
36
|
+
expectedRevision: z.ZodNumber;
|
|
37
|
+
source: z.ZodObject<{
|
|
38
|
+
entrypoint: z.ZodString;
|
|
39
|
+
files: z.ZodArray<z.ZodObject<{
|
|
40
|
+
path: z.ZodString;
|
|
41
|
+
content: z.ZodString;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export declare const ApplicationDraftUndoRequestSchema: z.ZodObject<{
|
|
46
|
+
expectedRevision: z.ZodNumber;
|
|
47
|
+
targetRevision: z.ZodNumber;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
export declare const ApplicationDraftRevisionRequestSchema: z.ZodObject<{
|
|
50
|
+
expectedRevision: z.ZodNumber;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export declare const ApplicationDraftSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
org: z.ZodString;
|
|
55
|
+
app: z.ZodString;
|
|
56
|
+
environment: z.ZodString;
|
|
57
|
+
revision: z.ZodNumber;
|
|
58
|
+
sourceDigest: z.ZodString;
|
|
59
|
+
source: z.ZodObject<{
|
|
60
|
+
entrypoint: z.ZodString;
|
|
61
|
+
files: z.ZodArray<z.ZodObject<{
|
|
62
|
+
path: z.ZodString;
|
|
63
|
+
content: z.ZodString;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
67
|
+
createdAt: z.ZodISODateTime;
|
|
68
|
+
createdBySubject: z.ZodString;
|
|
69
|
+
updatedAt: z.ZodISODateTime;
|
|
70
|
+
updatedBySubject: z.ZodString;
|
|
71
|
+
origin: z.ZodEnum<{
|
|
72
|
+
manual: "manual";
|
|
73
|
+
guided: "guided";
|
|
74
|
+
ai: "ai";
|
|
75
|
+
undo: "undo";
|
|
76
|
+
import: "import";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export type ApplicationDraft = z.infer<typeof ApplicationDraftSchema>;
|
|
80
|
+
export declare const ApplicationDraftSummarySchema: z.ZodObject<{
|
|
81
|
+
createdAt: z.ZodISODateTime;
|
|
82
|
+
org: z.ZodString;
|
|
83
|
+
app: z.ZodString;
|
|
84
|
+
origin: z.ZodEnum<{
|
|
85
|
+
manual: "manual";
|
|
86
|
+
guided: "guided";
|
|
87
|
+
ai: "ai";
|
|
88
|
+
undo: "undo";
|
|
89
|
+
import: "import";
|
|
90
|
+
}>;
|
|
91
|
+
environment: z.ZodString;
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
revision: z.ZodNumber;
|
|
94
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
95
|
+
sourceDigest: z.ZodString;
|
|
96
|
+
createdBySubject: z.ZodString;
|
|
97
|
+
updatedAt: z.ZodISODateTime;
|
|
98
|
+
updatedBySubject: z.ZodString;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
export type ApplicationDraftSummary = z.infer<typeof ApplicationDraftSummarySchema>;
|
|
101
|
+
export declare const ApplicationDraftResponseSchema: z.ZodObject<{
|
|
102
|
+
ok: z.ZodLiteral<true>;
|
|
103
|
+
data: z.ZodObject<{
|
|
104
|
+
draft: z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
org: z.ZodString;
|
|
107
|
+
app: z.ZodString;
|
|
108
|
+
environment: z.ZodString;
|
|
109
|
+
revision: z.ZodNumber;
|
|
110
|
+
sourceDigest: z.ZodString;
|
|
111
|
+
source: z.ZodObject<{
|
|
112
|
+
entrypoint: z.ZodString;
|
|
113
|
+
files: z.ZodArray<z.ZodObject<{
|
|
114
|
+
path: z.ZodString;
|
|
115
|
+
content: z.ZodString;
|
|
116
|
+
}, z.core.$strict>>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
119
|
+
createdAt: z.ZodISODateTime;
|
|
120
|
+
createdBySubject: z.ZodString;
|
|
121
|
+
updatedAt: z.ZodISODateTime;
|
|
122
|
+
updatedBySubject: z.ZodString;
|
|
123
|
+
origin: z.ZodEnum<{
|
|
124
|
+
manual: "manual";
|
|
125
|
+
guided: "guided";
|
|
126
|
+
ai: "ai";
|
|
127
|
+
undo: "undo";
|
|
128
|
+
import: "import";
|
|
129
|
+
}>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
}, z.core.$strict>;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
export declare const ApplicationDraftHistoryResponseSchema: z.ZodObject<{
|
|
134
|
+
ok: z.ZodLiteral<true>;
|
|
135
|
+
data: z.ZodObject<{
|
|
136
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
137
|
+
createdAt: z.ZodISODateTime;
|
|
138
|
+
org: z.ZodString;
|
|
139
|
+
app: z.ZodString;
|
|
140
|
+
origin: z.ZodEnum<{
|
|
141
|
+
manual: "manual";
|
|
142
|
+
guided: "guided";
|
|
143
|
+
ai: "ai";
|
|
144
|
+
undo: "undo";
|
|
145
|
+
import: "import";
|
|
146
|
+
}>;
|
|
147
|
+
environment: z.ZodString;
|
|
148
|
+
id: z.ZodString;
|
|
149
|
+
revision: z.ZodNumber;
|
|
150
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
151
|
+
sourceDigest: z.ZodString;
|
|
152
|
+
createdBySubject: z.ZodString;
|
|
153
|
+
updatedAt: z.ZodISODateTime;
|
|
154
|
+
updatedBySubject: z.ZodString;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
export declare const ApplicationDraftHistoryClientResponseSchema: z.ZodObject<{
|
|
159
|
+
ok: z.ZodLiteral<true>;
|
|
160
|
+
data: z.ZodObject<{
|
|
161
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
162
|
+
createdAt: z.ZodISODateTime;
|
|
163
|
+
org: z.ZodString;
|
|
164
|
+
app: z.ZodString;
|
|
165
|
+
origin: z.ZodEnum<{
|
|
166
|
+
manual: "manual";
|
|
167
|
+
guided: "guided";
|
|
168
|
+
ai: "ai";
|
|
169
|
+
undo: "undo";
|
|
170
|
+
import: "import";
|
|
171
|
+
}>;
|
|
172
|
+
environment: z.ZodString;
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
revision: z.ZodNumber;
|
|
175
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
176
|
+
sourceDigest: z.ZodString;
|
|
177
|
+
createdBySubject: z.ZodString;
|
|
178
|
+
updatedAt: z.ZodISODateTime;
|
|
179
|
+
updatedBySubject: z.ZodString;
|
|
180
|
+
}, z.core.$strict>>;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
export declare const ApplicationDraftDiffSchema: z.ZodObject<{
|
|
184
|
+
draftId: z.ZodString;
|
|
185
|
+
fromRevision: z.ZodNumber;
|
|
186
|
+
toRevision: z.ZodNumber;
|
|
187
|
+
fromDigest: z.ZodString;
|
|
188
|
+
toDigest: z.ZodString;
|
|
189
|
+
fromEntrypoint: z.ZodString;
|
|
190
|
+
toEntrypoint: z.ZodString;
|
|
191
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
192
|
+
path: z.ZodString;
|
|
193
|
+
before: z.ZodNullable<z.ZodString>;
|
|
194
|
+
after: z.ZodNullable<z.ZodString>;
|
|
195
|
+
}, z.core.$strict>>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
export type ApplicationDraftDiff = z.infer<typeof ApplicationDraftDiffSchema>;
|
|
198
|
+
export declare const ApplicationDraftDiffResponseSchema: z.ZodObject<{
|
|
199
|
+
ok: z.ZodLiteral<true>;
|
|
200
|
+
data: z.ZodObject<{
|
|
201
|
+
diff: z.ZodObject<{
|
|
202
|
+
draftId: z.ZodString;
|
|
203
|
+
fromRevision: z.ZodNumber;
|
|
204
|
+
toRevision: z.ZodNumber;
|
|
205
|
+
fromDigest: z.ZodString;
|
|
206
|
+
toDigest: z.ZodString;
|
|
207
|
+
fromEntrypoint: z.ZodString;
|
|
208
|
+
toEntrypoint: z.ZodString;
|
|
209
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
210
|
+
path: z.ZodString;
|
|
211
|
+
before: z.ZodNullable<z.ZodString>;
|
|
212
|
+
after: z.ZodNullable<z.ZodString>;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
}, z.core.$strict>;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
export declare const ApplicationDraftDiffClientResponseSchema: z.ZodObject<{
|
|
218
|
+
ok: z.ZodLiteral<true>;
|
|
219
|
+
data: z.ZodObject<{
|
|
220
|
+
diff: z.ZodObject<{
|
|
221
|
+
draftId: z.ZodString;
|
|
222
|
+
fromRevision: z.ZodNumber;
|
|
223
|
+
toRevision: z.ZodNumber;
|
|
224
|
+
fromDigest: z.ZodString;
|
|
225
|
+
toDigest: z.ZodString;
|
|
226
|
+
fromEntrypoint: z.ZodString;
|
|
227
|
+
toEntrypoint: z.ZodString;
|
|
228
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
229
|
+
path: z.ZodString;
|
|
230
|
+
before: z.ZodNullable<z.ZodString>;
|
|
231
|
+
after: z.ZodNullable<z.ZodString>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
}, z.core.$strict>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
export declare const ApplicationDraftDiffRequestSchema: z.ZodObject<{
|
|
237
|
+
from: z.ZodNumber;
|
|
238
|
+
to: z.ZodNumber;
|
|
239
|
+
}, z.core.$strict>;
|
|
240
|
+
export declare const ApplicationDraftClientResponseSchema: z.ZodObject<{
|
|
241
|
+
ok: z.ZodLiteral<true>;
|
|
242
|
+
data: z.ZodObject<{
|
|
243
|
+
draft: z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
org: z.ZodString;
|
|
246
|
+
app: z.ZodString;
|
|
247
|
+
environment: z.ZodString;
|
|
248
|
+
revision: z.ZodNumber;
|
|
249
|
+
sourceDigest: z.ZodString;
|
|
250
|
+
source: z.ZodObject<{
|
|
251
|
+
entrypoint: z.ZodString;
|
|
252
|
+
files: z.ZodArray<z.ZodObject<{
|
|
253
|
+
path: z.ZodString;
|
|
254
|
+
content: z.ZodString;
|
|
255
|
+
}, z.core.$strict>>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
258
|
+
createdAt: z.ZodISODateTime;
|
|
259
|
+
createdBySubject: z.ZodString;
|
|
260
|
+
updatedAt: z.ZodISODateTime;
|
|
261
|
+
updatedBySubject: z.ZodString;
|
|
262
|
+
origin: z.ZodEnum<{
|
|
263
|
+
manual: "manual";
|
|
264
|
+
guided: "guided";
|
|
265
|
+
ai: "ai";
|
|
266
|
+
undo: "undo";
|
|
267
|
+
import: "import";
|
|
268
|
+
}>;
|
|
269
|
+
}, z.core.$strict>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
}, z.core.$strip>;
|
|
272
|
+
export declare const ApplicationDraftListResponseSchema: z.ZodObject<{
|
|
273
|
+
ok: z.ZodLiteral<true>;
|
|
274
|
+
data: z.ZodObject<{
|
|
275
|
+
drafts: z.ZodArray<z.ZodObject<{
|
|
276
|
+
createdAt: z.ZodISODateTime;
|
|
277
|
+
org: z.ZodString;
|
|
278
|
+
app: z.ZodString;
|
|
279
|
+
origin: z.ZodEnum<{
|
|
280
|
+
manual: "manual";
|
|
281
|
+
guided: "guided";
|
|
282
|
+
ai: "ai";
|
|
283
|
+
undo: "undo";
|
|
284
|
+
import: "import";
|
|
285
|
+
}>;
|
|
286
|
+
environment: z.ZodString;
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
revision: z.ZodNumber;
|
|
289
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
290
|
+
sourceDigest: z.ZodString;
|
|
291
|
+
createdBySubject: z.ZodString;
|
|
292
|
+
updatedAt: z.ZodISODateTime;
|
|
293
|
+
updatedBySubject: z.ZodString;
|
|
294
|
+
}, z.core.$strict>>;
|
|
295
|
+
}, z.core.$strict>;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
export declare const ApplicationDraftListClientResponseSchema: z.ZodObject<{
|
|
298
|
+
ok: z.ZodLiteral<true>;
|
|
299
|
+
data: z.ZodObject<{
|
|
300
|
+
drafts: z.ZodArray<z.ZodObject<{
|
|
301
|
+
createdAt: z.ZodISODateTime;
|
|
302
|
+
org: z.ZodString;
|
|
303
|
+
app: z.ZodString;
|
|
304
|
+
origin: z.ZodEnum<{
|
|
305
|
+
manual: "manual";
|
|
306
|
+
guided: "guided";
|
|
307
|
+
ai: "ai";
|
|
308
|
+
undo: "undo";
|
|
309
|
+
import: "import";
|
|
310
|
+
}>;
|
|
311
|
+
environment: z.ZodString;
|
|
312
|
+
id: z.ZodString;
|
|
313
|
+
revision: z.ZodNumber;
|
|
314
|
+
baseRelease: z.ZodOptional<z.ZodString>;
|
|
315
|
+
sourceDigest: z.ZodString;
|
|
316
|
+
createdBySubject: z.ZodString;
|
|
317
|
+
updatedAt: z.ZodISODateTime;
|
|
318
|
+
updatedBySubject: z.ZodString;
|
|
319
|
+
}, z.core.$strict>>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
}, z.core.$strip>;
|
|
322
|
+
//# sourceMappingURL=application-drafts.d.ts.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Bounded browser-authoring input; not the compiled deployment artifact allowance. */
|
|
3
|
+
export const APPLICATION_DRAFT_LIMITS = Object.freeze({
|
|
4
|
+
draftsPerApp: 10,
|
|
5
|
+
draftsPerWorkspace: 50,
|
|
6
|
+
sourceBytesPerWorkspace: 32 * 1024 * 1024,
|
|
7
|
+
receiptsPerWorkspace: 10_000,
|
|
8
|
+
retryWindowMs: 24 * 60 * 60 * 1000,
|
|
9
|
+
revisionsPerDraft: 100,
|
|
10
|
+
files: 64,
|
|
11
|
+
pathChars: 240,
|
|
12
|
+
fileBytes: 256 * 1024,
|
|
13
|
+
totalBytes: 1024 * 1024,
|
|
14
|
+
});
|
|
15
|
+
const sourcePath = z
|
|
16
|
+
.string()
|
|
17
|
+
.max(APPLICATION_DRAFT_LIMITS.pathChars)
|
|
18
|
+
.regex(/^(?:[A-Za-z0-9_][A-Za-z0-9_.-]*\/)*[A-Za-z0-9_][A-Za-z0-9_.-]*\.(?:ts|tsx|css)$/);
|
|
19
|
+
const sourceText = z
|
|
20
|
+
.string()
|
|
21
|
+
.max(APPLICATION_DRAFT_LIMITS.fileBytes)
|
|
22
|
+
.refine((value) => new TextEncoder().encode(value).byteLength <= APPLICATION_DRAFT_LIMITS.fileBytes, 'Source file exceeds the UTF-8 byte allowance');
|
|
23
|
+
function sourceSchema(additive) {
|
|
24
|
+
const object = additive ? z.object : z.strictObject;
|
|
25
|
+
return object({
|
|
26
|
+
entrypoint: sourcePath.refine((path) => /\.tsx?$/.test(path), 'Entrypoint must be TypeScript'),
|
|
27
|
+
files: z
|
|
28
|
+
.array(object({ path: sourcePath, content: sourceText }))
|
|
29
|
+
.min(1)
|
|
30
|
+
.max(APPLICATION_DRAFT_LIMITS.files),
|
|
31
|
+
}).superRefine((source, context) => {
|
|
32
|
+
const paths = source.files.map((file) => file.path);
|
|
33
|
+
if (new Set(paths).size !== paths.length) {
|
|
34
|
+
context.addIssue({ code: 'custom', message: 'Source paths must be unique', path: ['files'] });
|
|
35
|
+
}
|
|
36
|
+
if (!paths.includes(source.entrypoint)) {
|
|
37
|
+
context.addIssue({ code: 'custom', message: 'Entrypoint must exist', path: ['entrypoint'] });
|
|
38
|
+
}
|
|
39
|
+
const bytes = source.files.reduce((total, file) => total + new TextEncoder().encode(file.content).byteLength, 0);
|
|
40
|
+
if (bytes > APPLICATION_DRAFT_LIMITS.totalBytes) {
|
|
41
|
+
context.addIssue({
|
|
42
|
+
code: 'custom',
|
|
43
|
+
message: 'Draft source exceeds the byte allowance',
|
|
44
|
+
path: ['files'],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export const ApplicationDraftSourceSchema = sourceSchema(false);
|
|
50
|
+
export const ApplicationDraftIdSchema = z.string().uuid();
|
|
51
|
+
const revision = z.number().int().positive().max(2147483647);
|
|
52
|
+
const digest = z.string().regex(/^[a-f0-9]{64}$/);
|
|
53
|
+
const environment = z.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/);
|
|
54
|
+
export const ApplicationDraftCreateRequestSchema = z.strictObject({
|
|
55
|
+
environment,
|
|
56
|
+
source: ApplicationDraftSourceSchema,
|
|
57
|
+
baseRelease: z.string().min(1).max(200).optional(),
|
|
58
|
+
});
|
|
59
|
+
export const ApplicationDraftEditRequestSchema = z.strictObject({
|
|
60
|
+
expectedRevision: revision,
|
|
61
|
+
source: ApplicationDraftSourceSchema,
|
|
62
|
+
});
|
|
63
|
+
export const ApplicationDraftUndoRequestSchema = z.strictObject({
|
|
64
|
+
expectedRevision: revision,
|
|
65
|
+
targetRevision: revision,
|
|
66
|
+
});
|
|
67
|
+
export const ApplicationDraftRevisionRequestSchema = z.strictObject({
|
|
68
|
+
expectedRevision: revision,
|
|
69
|
+
});
|
|
70
|
+
function draftSchema(additive) {
|
|
71
|
+
const object = additive ? z.object : z.strictObject;
|
|
72
|
+
return object({
|
|
73
|
+
id: ApplicationDraftIdSchema,
|
|
74
|
+
org: environment,
|
|
75
|
+
app: environment,
|
|
76
|
+
environment,
|
|
77
|
+
revision,
|
|
78
|
+
sourceDigest: digest,
|
|
79
|
+
source: sourceSchema(additive),
|
|
80
|
+
baseRelease: z.string().min(1).max(200).optional(),
|
|
81
|
+
createdAt: z.iso.datetime(),
|
|
82
|
+
createdBySubject: z.string().min(1).max(500),
|
|
83
|
+
updatedAt: z.iso.datetime(),
|
|
84
|
+
updatedBySubject: z.string().min(1).max(500),
|
|
85
|
+
origin: z.enum(['manual', 'guided', 'ai', 'undo', 'import']),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export const ApplicationDraftSchema = draftSchema(false);
|
|
89
|
+
export const ApplicationDraftSummarySchema = ApplicationDraftSchema.omit({ source: true });
|
|
90
|
+
export const ApplicationDraftResponseSchema = z.strictObject({
|
|
91
|
+
ok: z.literal(true),
|
|
92
|
+
data: z.strictObject({ draft: ApplicationDraftSchema }),
|
|
93
|
+
});
|
|
94
|
+
function historyResponse(additive) {
|
|
95
|
+
const object = additive ? z.object : z.strictObject;
|
|
96
|
+
return object({
|
|
97
|
+
ok: z.literal(true),
|
|
98
|
+
data: object({
|
|
99
|
+
revisions: z
|
|
100
|
+
.array(draftSchema(additive).omit({ source: true }))
|
|
101
|
+
.max(APPLICATION_DRAFT_LIMITS.revisionsPerDraft),
|
|
102
|
+
}),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export const ApplicationDraftHistoryResponseSchema = historyResponse(false);
|
|
106
|
+
export const ApplicationDraftHistoryClientResponseSchema = historyResponse(true);
|
|
107
|
+
function diffSchema(additive) {
|
|
108
|
+
const object = additive ? z.object : z.strictObject;
|
|
109
|
+
return object({
|
|
110
|
+
draftId: ApplicationDraftIdSchema,
|
|
111
|
+
fromRevision: revision,
|
|
112
|
+
toRevision: revision,
|
|
113
|
+
fromDigest: digest,
|
|
114
|
+
toDigest: digest,
|
|
115
|
+
fromEntrypoint: sourcePath,
|
|
116
|
+
toEntrypoint: sourcePath,
|
|
117
|
+
changes: z
|
|
118
|
+
.array(object({ path: sourcePath, before: sourceText.nullable(), after: sourceText.nullable() }))
|
|
119
|
+
.max(APPLICATION_DRAFT_LIMITS.files * 2),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export const ApplicationDraftDiffSchema = diffSchema(false);
|
|
123
|
+
export const ApplicationDraftDiffResponseSchema = z.strictObject({
|
|
124
|
+
ok: z.literal(true),
|
|
125
|
+
data: z.strictObject({ diff: ApplicationDraftDiffSchema }),
|
|
126
|
+
});
|
|
127
|
+
export const ApplicationDraftDiffClientResponseSchema = z.object({
|
|
128
|
+
ok: z.literal(true),
|
|
129
|
+
data: z.object({ diff: diffSchema(true) }),
|
|
130
|
+
});
|
|
131
|
+
export const ApplicationDraftDiffRequestSchema = z.strictObject({ from: revision, to: revision });
|
|
132
|
+
export const ApplicationDraftClientResponseSchema = z.object({
|
|
133
|
+
ok: z.literal(true),
|
|
134
|
+
data: z.object({ draft: draftSchema(true) }),
|
|
135
|
+
});
|
|
136
|
+
export const ApplicationDraftListResponseSchema = z.strictObject({
|
|
137
|
+
ok: z.literal(true),
|
|
138
|
+
data: z.strictObject({
|
|
139
|
+
drafts: z
|
|
140
|
+
.array(ApplicationDraftSchema.omit({ source: true }))
|
|
141
|
+
.max(APPLICATION_DRAFT_LIMITS.draftsPerApp),
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
144
|
+
export const ApplicationDraftListClientResponseSchema = z.object({
|
|
145
|
+
ok: z.literal(true),
|
|
146
|
+
data: z.object({
|
|
147
|
+
drafts: z
|
|
148
|
+
.array(draftSchema(true).omit({ source: true }))
|
|
149
|
+
.max(APPLICATION_DRAFT_LIMITS.draftsPerApp),
|
|
150
|
+
}),
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=application-drafts.js.map
|
|
@@ -94,8 +94,8 @@ export declare function createBillingOrganizationTransferSchemas(loose: boolean)
|
|
|
94
94
|
displayName: z.ZodString;
|
|
95
95
|
state: z.ZodEnum<{
|
|
96
96
|
active: "active";
|
|
97
|
-
inactive: "inactive";
|
|
98
97
|
draft: "draft";
|
|
98
|
+
inactive: "inactive";
|
|
99
99
|
}>;
|
|
100
100
|
plan: z.ZodNullable<z.ZodObject<{
|
|
101
101
|
code: z.ZodString;
|
|
@@ -153,8 +153,8 @@ export declare function createBillingOrganizationTransferSchemas(loose: boolean)
|
|
|
153
153
|
displayName: z.ZodString;
|
|
154
154
|
state: z.ZodEnum<{
|
|
155
155
|
active: "active";
|
|
156
|
-
inactive: "inactive";
|
|
157
156
|
draft: "draft";
|
|
157
|
+
inactive: "inactive";
|
|
158
158
|
}>;
|
|
159
159
|
plan: z.ZodNullable<z.ZodObject<{
|
|
160
160
|
code: z.ZodString;
|
|
@@ -240,8 +240,8 @@ export declare const BillingOrganizationTransferPreviewResponseSchema: z.ZodObje
|
|
|
240
240
|
displayName: z.ZodString;
|
|
241
241
|
state: z.ZodEnum<{
|
|
242
242
|
active: "active";
|
|
243
|
-
inactive: "inactive";
|
|
244
243
|
draft: "draft";
|
|
244
|
+
inactive: "inactive";
|
|
245
245
|
}>;
|
|
246
246
|
plan: z.ZodNullable<z.ZodObject<{
|
|
247
247
|
code: z.ZodString;
|
|
@@ -299,8 +299,8 @@ export declare const BillingOrganizationTransferApplyResponseSchema: z.ZodObject
|
|
|
299
299
|
displayName: z.ZodString;
|
|
300
300
|
state: z.ZodEnum<{
|
|
301
301
|
active: "active";
|
|
302
|
-
inactive: "inactive";
|
|
303
302
|
draft: "draft";
|
|
303
|
+
inactive: "inactive";
|
|
304
304
|
}>;
|
|
305
305
|
plan: z.ZodNullable<z.ZodObject<{
|
|
306
306
|
code: z.ZodString;
|
|
@@ -385,8 +385,8 @@ export declare const BillingOrganizationTransferPreviewClientResponseSchema: z.Z
|
|
|
385
385
|
displayName: z.ZodString;
|
|
386
386
|
state: z.ZodEnum<{
|
|
387
387
|
active: "active";
|
|
388
|
-
inactive: "inactive";
|
|
389
388
|
draft: "draft";
|
|
389
|
+
inactive: "inactive";
|
|
390
390
|
}>;
|
|
391
391
|
plan: z.ZodNullable<z.ZodObject<{
|
|
392
392
|
code: z.ZodString;
|
|
@@ -444,8 +444,8 @@ export declare const BillingOrganizationTransferApplyClientResponseSchema: z.Zod
|
|
|
444
444
|
displayName: z.ZodString;
|
|
445
445
|
state: z.ZodEnum<{
|
|
446
446
|
active: "active";
|
|
447
|
-
inactive: "inactive";
|
|
448
447
|
draft: "draft";
|
|
448
|
+
inactive: "inactive";
|
|
449
449
|
}>;
|
|
450
450
|
plan: z.ZodNullable<z.ZodObject<{
|
|
451
451
|
code: z.ZodString;
|
|
@@ -510,8 +510,8 @@ export declare const BillingOrganizationTransferArtifactSchema: z.ZodDiscriminat
|
|
|
510
510
|
displayName: z.ZodString;
|
|
511
511
|
state: z.ZodEnum<{
|
|
512
512
|
active: "active";
|
|
513
|
-
inactive: "inactive";
|
|
514
513
|
draft: "draft";
|
|
514
|
+
inactive: "inactive";
|
|
515
515
|
}>;
|
|
516
516
|
plan: z.ZodNullable<z.ZodObject<{
|
|
517
517
|
code: z.ZodString;
|
|
@@ -575,8 +575,8 @@ export declare const BillingOrganizationTransferArtifactSchema: z.ZodDiscriminat
|
|
|
575
575
|
displayName: z.ZodString;
|
|
576
576
|
state: z.ZodEnum<{
|
|
577
577
|
active: "active";
|
|
578
|
-
inactive: "inactive";
|
|
579
578
|
draft: "draft";
|
|
579
|
+
inactive: "inactive";
|
|
580
580
|
}>;
|
|
581
581
|
plan: z.ZodNullable<z.ZodObject<{
|
|
582
582
|
code: z.ZodString;
|
|
@@ -122,8 +122,8 @@ export declare const BillingAccountSummarySchema: z.ZodObject<{
|
|
|
122
122
|
displayName: z.ZodString;
|
|
123
123
|
state: z.ZodEnum<{
|
|
124
124
|
active: "active";
|
|
125
|
-
inactive: "inactive";
|
|
126
125
|
draft: "draft";
|
|
126
|
+
inactive: "inactive";
|
|
127
127
|
}>;
|
|
128
128
|
createdAt: z.ZodString;
|
|
129
129
|
role: z.ZodEnum<{
|
|
@@ -240,8 +240,8 @@ export declare const BillingAccountsListResponseSchema: z.ZodObject<{
|
|
|
240
240
|
displayName: z.ZodString;
|
|
241
241
|
state: z.ZodEnum<{
|
|
242
242
|
active: "active";
|
|
243
|
-
inactive: "inactive";
|
|
244
243
|
draft: "draft";
|
|
244
|
+
inactive: "inactive";
|
|
245
245
|
}>;
|
|
246
246
|
createdAt: z.ZodString;
|
|
247
247
|
role: z.ZodEnum<{
|
|
@@ -296,8 +296,8 @@ export declare const BillingAccountResponseSchema: z.ZodObject<{
|
|
|
296
296
|
displayName: z.ZodString;
|
|
297
297
|
state: z.ZodEnum<{
|
|
298
298
|
active: "active";
|
|
299
|
-
inactive: "inactive";
|
|
300
299
|
draft: "draft";
|
|
300
|
+
inactive: "inactive";
|
|
301
301
|
}>;
|
|
302
302
|
createdAt: z.ZodString;
|
|
303
303
|
role: z.ZodEnum<{
|
|
@@ -547,8 +547,8 @@ export declare const BillingAccountsListClientResponseSchema: z.ZodObject<{
|
|
|
547
547
|
displayName: z.ZodString;
|
|
548
548
|
state: z.ZodEnum<{
|
|
549
549
|
active: "active";
|
|
550
|
-
inactive: "inactive";
|
|
551
550
|
draft: "draft";
|
|
551
|
+
inactive: "inactive";
|
|
552
552
|
}>;
|
|
553
553
|
createdAt: z.ZodString;
|
|
554
554
|
role: z.ZodEnum<{
|
|
@@ -603,8 +603,8 @@ export declare const BillingAccountClientResponseSchema: z.ZodObject<{
|
|
|
603
603
|
displayName: z.ZodString;
|
|
604
604
|
state: z.ZodEnum<{
|
|
605
605
|
active: "active";
|
|
606
|
-
inactive: "inactive";
|
|
607
606
|
draft: "draft";
|
|
607
|
+
inactive: "inactive";
|
|
608
608
|
}>;
|
|
609
609
|
createdAt: z.ZodString;
|
|
610
610
|
role: z.ZodEnum<{
|