@elek-io/core 0.9.1 → 0.11.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/browser/index.browser.d.ts +5280 -1242
- package/dist/browser/index.browser.js +353 -339
- package/dist/browser/index.browser.js.map +1 -1
- package/dist/node/index.node.d.ts +5279 -1241
- package/dist/node/index.node.js +1165 -662
- package/dist/node/index.node.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// src/schema/assetSchema.ts
|
|
2
|
-
import
|
|
2
|
+
import z4 from "zod";
|
|
3
3
|
|
|
4
4
|
// src/schema/baseSchema.ts
|
|
5
5
|
import z from "zod";
|
|
6
|
-
var environmentSchema = z.enum(["production", "development", "test"]);
|
|
7
6
|
var supportedLanguageSchema = z.enum([
|
|
8
7
|
/**
|
|
9
8
|
* Bulgarian
|
|
@@ -58,39 +57,6 @@ var supportedLanguageSchema = z.enum([
|
|
|
58
57
|
// (Simplified) Chinese
|
|
59
58
|
]);
|
|
60
59
|
var supportedIconSchema = z.enum(["home", "plus", "foobar"]);
|
|
61
|
-
var supportedAssetMimeTypeSchema = z.enum([
|
|
62
|
-
"image/avif",
|
|
63
|
-
"image/gif",
|
|
64
|
-
"image/jpeg",
|
|
65
|
-
"image/png",
|
|
66
|
-
"image/svg+xml",
|
|
67
|
-
"image/webp",
|
|
68
|
-
"application/pdf",
|
|
69
|
-
"application/zip",
|
|
70
|
-
"video/mp4",
|
|
71
|
-
"video/webm",
|
|
72
|
-
"audio/webm",
|
|
73
|
-
"audio/flac"
|
|
74
|
-
]);
|
|
75
|
-
var supportedAssetExtensionSchema = z.enum([
|
|
76
|
-
"avif",
|
|
77
|
-
"gif",
|
|
78
|
-
"jpg",
|
|
79
|
-
"jpeg",
|
|
80
|
-
"png",
|
|
81
|
-
"svg",
|
|
82
|
-
"webp",
|
|
83
|
-
"pdf",
|
|
84
|
-
"zip",
|
|
85
|
-
"mp4",
|
|
86
|
-
"webm",
|
|
87
|
-
"flac",
|
|
88
|
-
"json"
|
|
89
|
-
]);
|
|
90
|
-
var supportedAssetTypeSchema = z.object({
|
|
91
|
-
extension: supportedAssetExtensionSchema,
|
|
92
|
-
mimeType: supportedAssetMimeTypeSchema
|
|
93
|
-
});
|
|
94
60
|
var objectTypeSchema = z.enum([
|
|
95
61
|
"project",
|
|
96
62
|
"asset",
|
|
@@ -99,6 +65,7 @@ var objectTypeSchema = z.enum([
|
|
|
99
65
|
"value",
|
|
100
66
|
"sharedValue"
|
|
101
67
|
]);
|
|
68
|
+
var logLevelSchema = z.enum(["error", "warn", "info", "debug"]);
|
|
102
69
|
var versionSchema = z.string();
|
|
103
70
|
var uuidSchema = z.string().uuid("shared.invalidUuid");
|
|
104
71
|
var translatableStringSchema = z.record(
|
|
@@ -120,6 +87,10 @@ function translatableArrayOf(schema) {
|
|
|
120
87
|
// src/schema/fileSchema.ts
|
|
121
88
|
import z2 from "zod";
|
|
122
89
|
var baseFileSchema = z2.object({
|
|
90
|
+
/**
|
|
91
|
+
* The object type of the file
|
|
92
|
+
*/
|
|
93
|
+
objectType: objectTypeSchema.readonly(),
|
|
123
94
|
/**
|
|
124
95
|
* The ID of the file
|
|
125
96
|
*
|
|
@@ -135,40 +106,150 @@ var baseFileSchema = z2.object({
|
|
|
135
106
|
*/
|
|
136
107
|
updated: z2.string().datetime().nullable()
|
|
137
108
|
});
|
|
138
|
-
var
|
|
109
|
+
var fileReferenceSchema = z2.object({
|
|
110
|
+
id: uuidSchema,
|
|
111
|
+
extension: z2.string().optional()
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// src/schema/gitSchema.ts
|
|
115
|
+
import { z as z3 } from "zod";
|
|
116
|
+
var gitSignatureSchema = z3.object({
|
|
117
|
+
name: z3.string(),
|
|
118
|
+
email: z3.string()
|
|
119
|
+
});
|
|
120
|
+
var gitMessageSchema = z3.object({
|
|
121
|
+
method: z3.enum(["create", "update", "delete", "upgrade"]),
|
|
122
|
+
reference: z3.object({
|
|
123
|
+
objectType: objectTypeSchema,
|
|
124
|
+
/**
|
|
125
|
+
* ID of the objectType
|
|
126
|
+
*/
|
|
127
|
+
id: uuidSchema,
|
|
128
|
+
/**
|
|
129
|
+
* Only present if the objectType is of "entry"
|
|
130
|
+
*/
|
|
131
|
+
collectionId: uuidSchema.optional()
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
var gitTagSchema = z3.object({
|
|
135
|
+
id: uuidSchema,
|
|
136
|
+
message: z3.string(),
|
|
137
|
+
author: gitSignatureSchema,
|
|
138
|
+
datetime: z3.string().datetime()
|
|
139
|
+
});
|
|
140
|
+
var gitCommitSchema = z3.object({
|
|
141
|
+
/**
|
|
142
|
+
* SHA-1 hash of the commit
|
|
143
|
+
*/
|
|
144
|
+
hash: z3.string(),
|
|
145
|
+
message: gitMessageSchema,
|
|
146
|
+
author: gitSignatureSchema,
|
|
147
|
+
datetime: z3.string().datetime(),
|
|
148
|
+
tag: gitTagSchema.nullable()
|
|
149
|
+
});
|
|
150
|
+
var gitInitOptionsSchema = z3.object({
|
|
151
|
+
/**
|
|
152
|
+
* Use the specified name for the initial branch in the newly created repository. If not specified, fall back to the default name (currently master, but this is subject to change in the future; the name can be customized via the init.defaultBranch configuration variable).
|
|
153
|
+
*/
|
|
154
|
+
initialBranch: z3.string()
|
|
155
|
+
});
|
|
156
|
+
var gitCloneOptionsSchema = z3.object({
|
|
157
|
+
/**
|
|
158
|
+
* Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches. If you want to clone submodules shallowly, also pass --shallow-submodules.
|
|
159
|
+
*/
|
|
160
|
+
depth: z3.number(),
|
|
139
161
|
/**
|
|
140
|
-
*
|
|
162
|
+
* Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.
|
|
163
|
+
*/
|
|
164
|
+
singleBranch: z3.boolean(),
|
|
165
|
+
/**
|
|
166
|
+
* Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting repository.
|
|
167
|
+
*/
|
|
168
|
+
branch: z3.string(),
|
|
169
|
+
/**
|
|
170
|
+
* Make a bare Git repository. That is, instead of creating <directory> and placing the administrative files in <directory>`/.git`, make the <directory> itself the $GIT_DIR.
|
|
171
|
+
* Used primarily to copy an existing local repository to a server, where you want to set up the repository as a central point to work with others.
|
|
141
172
|
*
|
|
142
|
-
* The
|
|
143
|
-
* That's why the language cannot be changed after creating the file.
|
|
173
|
+
* The destination path for the cloned repository should end with a .git by convention.
|
|
144
174
|
*
|
|
145
|
-
* @
|
|
175
|
+
* @see https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server
|
|
146
176
|
*/
|
|
147
|
-
|
|
177
|
+
bare: z3.boolean()
|
|
148
178
|
});
|
|
149
|
-
var
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
179
|
+
var gitMergeOptionsSchema = z3.object({
|
|
180
|
+
squash: z3.boolean()
|
|
181
|
+
});
|
|
182
|
+
var gitSwitchOptionsSchema = z3.object({
|
|
183
|
+
/**
|
|
184
|
+
* If true, creates a new local branch and then switches to it
|
|
185
|
+
*
|
|
186
|
+
* @see https://git-scm.com/docs/git-switch#Documentation/git-switch.txt---createltnew-branchgt
|
|
187
|
+
*/
|
|
188
|
+
isNew: z3.boolean().optional()
|
|
189
|
+
});
|
|
190
|
+
var gitLogOptionsSchema = z3.object({
|
|
191
|
+
/**
|
|
192
|
+
* Limit the result to given number of commits
|
|
193
|
+
*/
|
|
194
|
+
limit: z3.number().optional(),
|
|
195
|
+
/**
|
|
196
|
+
* Only list commits that are between given SHAs or tag names
|
|
197
|
+
*
|
|
198
|
+
* Note that the commits of from and to are not included in the result
|
|
199
|
+
*/
|
|
200
|
+
between: z3.object({
|
|
201
|
+
/**
|
|
202
|
+
* From the oldest commit
|
|
203
|
+
*/
|
|
204
|
+
from: z3.string(),
|
|
205
|
+
/**
|
|
206
|
+
* To the newest commit
|
|
207
|
+
*
|
|
208
|
+
* Defaults to the current HEAD
|
|
209
|
+
*/
|
|
210
|
+
to: z3.string().optional()
|
|
211
|
+
}),
|
|
212
|
+
/**
|
|
213
|
+
* Only shows commits of given file
|
|
214
|
+
*/
|
|
215
|
+
filePath: z3.string().optional()
|
|
216
|
+
});
|
|
217
|
+
var createGitTagSchema = gitTagSchema.pick({
|
|
218
|
+
message: true
|
|
219
|
+
}).extend({
|
|
220
|
+
path: z3.string(),
|
|
221
|
+
hash: z3.string().optional()
|
|
222
|
+
});
|
|
223
|
+
var readGitTagSchema = z3.object({
|
|
224
|
+
path: z3.string(),
|
|
225
|
+
id: uuidSchema.readonly()
|
|
226
|
+
});
|
|
227
|
+
var deleteGitTagSchema = readGitTagSchema.extend({});
|
|
228
|
+
var countGitTagsSchema = z3.object({
|
|
229
|
+
path: z3.string()
|
|
153
230
|
});
|
|
154
231
|
|
|
155
232
|
// src/schema/assetSchema.ts
|
|
156
233
|
var assetFileSchema = baseFileSchema.extend({
|
|
157
|
-
objectType:
|
|
158
|
-
name:
|
|
159
|
-
description:
|
|
160
|
-
extension:
|
|
161
|
-
mimeType:
|
|
234
|
+
objectType: z4.literal(objectTypeSchema.Enum.asset).readonly(),
|
|
235
|
+
name: z4.string(),
|
|
236
|
+
description: z4.string(),
|
|
237
|
+
extension: z4.string().readonly(),
|
|
238
|
+
mimeType: z4.string().readonly(),
|
|
162
239
|
/**
|
|
163
240
|
* Total size in bytes
|
|
164
241
|
*/
|
|
165
|
-
size:
|
|
242
|
+
size: z4.number().readonly()
|
|
166
243
|
});
|
|
167
244
|
var assetSchema = assetFileSchema.extend({
|
|
168
245
|
/**
|
|
169
246
|
* Absolute path on this filesystem
|
|
170
247
|
*/
|
|
171
|
-
absolutePath:
|
|
248
|
+
absolutePath: z4.string().readonly(),
|
|
249
|
+
/**
|
|
250
|
+
* Commit history of this Asset
|
|
251
|
+
*/
|
|
252
|
+
history: z4.array(gitCommitSchema)
|
|
172
253
|
});
|
|
173
254
|
var assetExportSchema = assetSchema.extend({});
|
|
174
255
|
var createAssetSchema = assetFileSchema.pick({
|
|
@@ -179,12 +260,20 @@ var createAssetSchema = assetFileSchema.pick({
|
|
|
179
260
|
/**
|
|
180
261
|
* Path of the file to add as a new Asset
|
|
181
262
|
*/
|
|
182
|
-
filePath:
|
|
263
|
+
filePath: z4.string().readonly()
|
|
183
264
|
});
|
|
184
265
|
var readAssetSchema = assetFileSchema.pick({
|
|
185
266
|
id: true
|
|
186
267
|
}).extend({
|
|
187
|
-
projectId: uuidSchema.readonly()
|
|
268
|
+
projectId: uuidSchema.readonly(),
|
|
269
|
+
commitHash: z4.string().optional().readonly()
|
|
270
|
+
});
|
|
271
|
+
var saveAssetSchema = assetFileSchema.pick({
|
|
272
|
+
id: true
|
|
273
|
+
}).extend({
|
|
274
|
+
projectId: uuidSchema.readonly(),
|
|
275
|
+
filePath: z4.string().readonly(),
|
|
276
|
+
commitHash: z4.string().optional().readonly()
|
|
188
277
|
});
|
|
189
278
|
var updateAssetSchema = assetFileSchema.pick({
|
|
190
279
|
id: true,
|
|
@@ -195,7 +284,7 @@ var updateAssetSchema = assetFileSchema.pick({
|
|
|
195
284
|
/**
|
|
196
285
|
* Path of the new file to update the Asset with
|
|
197
286
|
*/
|
|
198
|
-
newFilePath:
|
|
287
|
+
newFilePath: z4.string().readonly().optional()
|
|
199
288
|
});
|
|
200
289
|
var deleteAssetSchema = assetFileSchema.pick({
|
|
201
290
|
id: true,
|
|
@@ -203,92 +292,93 @@ var deleteAssetSchema = assetFileSchema.pick({
|
|
|
203
292
|
}).extend({
|
|
204
293
|
projectId: uuidSchema.readonly()
|
|
205
294
|
});
|
|
206
|
-
var countAssetsSchema =
|
|
295
|
+
var countAssetsSchema = z4.object({ projectId: uuidSchema.readonly() });
|
|
207
296
|
|
|
208
297
|
// src/schema/collectionSchema.ts
|
|
209
|
-
import
|
|
298
|
+
import z8 from "zod";
|
|
210
299
|
|
|
211
300
|
// src/schema/entrySchema.ts
|
|
212
|
-
import
|
|
301
|
+
import z6 from "zod";
|
|
213
302
|
|
|
214
303
|
// src/schema/valueSchema.ts
|
|
215
|
-
import
|
|
216
|
-
var ValueTypeSchema =
|
|
304
|
+
import z5 from "zod";
|
|
305
|
+
var ValueTypeSchema = z5.enum([
|
|
217
306
|
"string",
|
|
218
307
|
"number",
|
|
219
308
|
"boolean",
|
|
220
309
|
"reference"
|
|
221
310
|
]);
|
|
222
|
-
var valueContentReferenceBase =
|
|
311
|
+
var valueContentReferenceBase = z5.object({
|
|
223
312
|
id: uuidSchema
|
|
224
313
|
});
|
|
225
|
-
var valueContentReferenceWithLanguageBase = valueContentReferenceBase.extend({
|
|
226
|
-
language: supportedLanguageSchema
|
|
227
|
-
});
|
|
228
314
|
var valueContentReferenceToAssetSchema = valueContentReferenceBase.extend({
|
|
229
|
-
objectType:
|
|
315
|
+
objectType: z5.literal(objectTypeSchema.Enum.asset)
|
|
230
316
|
});
|
|
231
317
|
var valueContentReferenceToCollectionSchema = valueContentReferenceBase.extend({
|
|
232
|
-
objectType:
|
|
318
|
+
objectType: z5.literal(objectTypeSchema.Enum.collection)
|
|
233
319
|
});
|
|
234
320
|
var valueContentReferenceToEntrySchema = valueContentReferenceBase.extend({
|
|
235
|
-
objectType:
|
|
321
|
+
objectType: z5.literal(objectTypeSchema.Enum.entry)
|
|
236
322
|
});
|
|
237
|
-
var valueContentReferenceSchema =
|
|
323
|
+
var valueContentReferenceSchema = z5.union([
|
|
238
324
|
valueContentReferenceToAssetSchema,
|
|
239
325
|
valueContentReferenceToCollectionSchema,
|
|
240
326
|
valueContentReferenceToEntrySchema
|
|
241
327
|
// valueContentReferenceToSharedValueSchema,
|
|
242
328
|
]);
|
|
243
|
-
var resolvedValueContentReferenceSchema =
|
|
329
|
+
var resolvedValueContentReferenceSchema = z5.union([
|
|
244
330
|
assetSchema,
|
|
245
|
-
|
|
331
|
+
z5.lazy(() => entrySchema)
|
|
246
332
|
// Circular dependency / recursive type @see https://github.com/colinhacks/zod?tab=readme-ov-file#recursive-types
|
|
247
333
|
// resolvedValueContentReferenceToSharedValueSchema,
|
|
248
334
|
]);
|
|
249
|
-
var directValueBaseSchema =
|
|
250
|
-
objectType:
|
|
335
|
+
var directValueBaseSchema = z5.object({
|
|
336
|
+
objectType: z5.literal(objectTypeSchema.Enum.value).readonly(),
|
|
251
337
|
fieldDefinitionId: uuidSchema.readonly()
|
|
252
338
|
});
|
|
253
339
|
var directStringValueSchema = directValueBaseSchema.extend({
|
|
254
|
-
valueType:
|
|
340
|
+
valueType: z5.literal(ValueTypeSchema.Enum.string).readonly(),
|
|
255
341
|
content: translatableStringSchema
|
|
256
342
|
});
|
|
257
343
|
var directNumberValueSchema = directValueBaseSchema.extend({
|
|
258
|
-
valueType:
|
|
344
|
+
valueType: z5.literal(ValueTypeSchema.Enum.number).readonly(),
|
|
259
345
|
content: translatableNumberSchema
|
|
260
346
|
});
|
|
261
347
|
var directBooleanValueSchema = directValueBaseSchema.extend({
|
|
262
|
-
valueType:
|
|
348
|
+
valueType: z5.literal(ValueTypeSchema.Enum.boolean).readonly(),
|
|
263
349
|
content: translatableBooleanSchema
|
|
264
350
|
});
|
|
265
|
-
var directValueSchema =
|
|
351
|
+
var directValueSchema = z5.union([
|
|
266
352
|
directStringValueSchema,
|
|
267
353
|
directNumberValueSchema,
|
|
268
354
|
directBooleanValueSchema
|
|
269
355
|
]);
|
|
270
|
-
var referencedValueSchema =
|
|
271
|
-
objectType:
|
|
356
|
+
var referencedValueSchema = z5.object({
|
|
357
|
+
objectType: z5.literal(objectTypeSchema.Enum.value).readonly(),
|
|
272
358
|
fieldDefinitionId: uuidSchema.readonly(),
|
|
273
|
-
valueType:
|
|
359
|
+
valueType: z5.literal(ValueTypeSchema.Enum.reference).readonly(),
|
|
274
360
|
content: translatableArrayOf(valueContentReferenceSchema)
|
|
275
361
|
});
|
|
276
|
-
var valueSchema =
|
|
362
|
+
var valueSchema = z5.union([directValueSchema, referencedValueSchema]);
|
|
277
363
|
var resolvedReferencedValueSchema = referencedValueSchema.extend({
|
|
278
364
|
content: translatableArrayOf(resolvedValueContentReferenceSchema)
|
|
279
365
|
});
|
|
280
|
-
var resolvedValueSchema =
|
|
366
|
+
var resolvedValueSchema = z5.union([
|
|
281
367
|
directValueSchema,
|
|
282
368
|
resolvedReferencedValueSchema
|
|
283
369
|
]);
|
|
284
370
|
|
|
285
371
|
// src/schema/entrySchema.ts
|
|
286
372
|
var entryFileSchema = baseFileSchema.extend({
|
|
287
|
-
objectType:
|
|
288
|
-
values:
|
|
373
|
+
objectType: z6.literal(objectTypeSchema.Enum.entry).readonly(),
|
|
374
|
+
values: z6.array(valueSchema)
|
|
289
375
|
});
|
|
290
376
|
var entrySchema = entryFileSchema.extend({
|
|
291
|
-
values:
|
|
377
|
+
values: z6.array(z6.lazy(() => resolvedValueSchema)),
|
|
378
|
+
/**
|
|
379
|
+
* Commit history of this Entry
|
|
380
|
+
*/
|
|
381
|
+
history: z6.array(gitCommitSchema)
|
|
292
382
|
});
|
|
293
383
|
var entryExportSchema = entrySchema.extend({});
|
|
294
384
|
var createEntrySchema = entryFileSchema.omit({
|
|
@@ -299,14 +389,15 @@ var createEntrySchema = entryFileSchema.omit({
|
|
|
299
389
|
}).extend({
|
|
300
390
|
projectId: uuidSchema.readonly(),
|
|
301
391
|
collectionId: uuidSchema.readonly(),
|
|
302
|
-
values:
|
|
392
|
+
values: z6.array(valueSchema)
|
|
303
393
|
});
|
|
304
|
-
var readEntrySchema =
|
|
394
|
+
var readEntrySchema = z6.object({
|
|
305
395
|
id: uuidSchema.readonly(),
|
|
306
396
|
projectId: uuidSchema.readonly(),
|
|
307
|
-
collectionId: uuidSchema.readonly()
|
|
397
|
+
collectionId: uuidSchema.readonly(),
|
|
398
|
+
commitHash: z6.string().optional().readonly()
|
|
308
399
|
});
|
|
309
|
-
var updateEntrySchema =
|
|
400
|
+
var updateEntrySchema = entryFileSchema.omit({
|
|
310
401
|
objectType: true,
|
|
311
402
|
created: true,
|
|
312
403
|
updated: true
|
|
@@ -315,14 +406,14 @@ var updateEntrySchema = entrySchema.omit({
|
|
|
315
406
|
collectionId: uuidSchema.readonly()
|
|
316
407
|
});
|
|
317
408
|
var deleteEntrySchema = readEntrySchema.extend({});
|
|
318
|
-
var countEntriesSchema =
|
|
409
|
+
var countEntriesSchema = z6.object({
|
|
319
410
|
projectId: uuidSchema.readonly(),
|
|
320
411
|
collectionId: uuidSchema.readonly()
|
|
321
412
|
});
|
|
322
413
|
|
|
323
414
|
// src/schema/fieldSchema.ts
|
|
324
|
-
import { z as
|
|
325
|
-
var FieldTypeSchema =
|
|
415
|
+
import { z as z7 } from "zod";
|
|
416
|
+
var FieldTypeSchema = z7.enum([
|
|
326
417
|
// String Values
|
|
327
418
|
"text",
|
|
328
419
|
"textarea",
|
|
@@ -344,67 +435,67 @@ var FieldTypeSchema = z6.enum([
|
|
|
344
435
|
"entry"
|
|
345
436
|
// 'sharedValue', // @todo
|
|
346
437
|
]);
|
|
347
|
-
var FieldWidthSchema =
|
|
348
|
-
var FieldDefinitionBaseSchema =
|
|
438
|
+
var FieldWidthSchema = z7.enum(["12", "6", "4", "3"]);
|
|
439
|
+
var FieldDefinitionBaseSchema = z7.object({
|
|
349
440
|
id: uuidSchema.readonly(),
|
|
350
441
|
label: translatableStringSchema,
|
|
351
442
|
description: translatableStringSchema,
|
|
352
|
-
isRequired:
|
|
353
|
-
isDisabled:
|
|
354
|
-
isUnique:
|
|
443
|
+
isRequired: z7.boolean(),
|
|
444
|
+
isDisabled: z7.boolean(),
|
|
445
|
+
isUnique: z7.boolean(),
|
|
355
446
|
inputWidth: FieldWidthSchema
|
|
356
447
|
});
|
|
357
448
|
var StringFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend(
|
|
358
449
|
{
|
|
359
|
-
valueType:
|
|
360
|
-
defaultValue:
|
|
450
|
+
valueType: z7.literal(ValueTypeSchema.Enum.string),
|
|
451
|
+
defaultValue: z7.string().nullable()
|
|
361
452
|
}
|
|
362
453
|
);
|
|
363
454
|
var textFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(
|
|
364
455
|
{
|
|
365
|
-
fieldType:
|
|
366
|
-
min:
|
|
367
|
-
max:
|
|
456
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.text),
|
|
457
|
+
min: z7.number().nullable(),
|
|
458
|
+
max: z7.number().nullable()
|
|
368
459
|
}
|
|
369
460
|
);
|
|
370
461
|
var textareaFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({
|
|
371
|
-
fieldType:
|
|
372
|
-
min:
|
|
373
|
-
max:
|
|
462
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.textarea),
|
|
463
|
+
min: z7.number().nullable(),
|
|
464
|
+
max: z7.number().nullable()
|
|
374
465
|
});
|
|
375
466
|
var emailFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({
|
|
376
|
-
fieldType:
|
|
377
|
-
defaultValue:
|
|
467
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.email),
|
|
468
|
+
defaultValue: z7.string().email().nullable()
|
|
378
469
|
});
|
|
379
470
|
var urlFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({
|
|
380
|
-
fieldType:
|
|
381
|
-
defaultValue:
|
|
471
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.url),
|
|
472
|
+
defaultValue: z7.string().url().nullable()
|
|
382
473
|
});
|
|
383
474
|
var ipFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({
|
|
384
|
-
fieldType:
|
|
385
|
-
defaultValue:
|
|
475
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.ip),
|
|
476
|
+
defaultValue: z7.string().ip().nullable()
|
|
386
477
|
});
|
|
387
478
|
var dateFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(
|
|
388
479
|
{
|
|
389
|
-
fieldType:
|
|
390
|
-
defaultValue:
|
|
480
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.date),
|
|
481
|
+
defaultValue: z7.string().date().nullable()
|
|
391
482
|
}
|
|
392
483
|
);
|
|
393
484
|
var timeFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend(
|
|
394
485
|
{
|
|
395
|
-
fieldType:
|
|
396
|
-
defaultValue:
|
|
486
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.time),
|
|
487
|
+
defaultValue: z7.string().time().nullable()
|
|
397
488
|
}
|
|
398
489
|
);
|
|
399
490
|
var datetimeFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({
|
|
400
|
-
fieldType:
|
|
401
|
-
defaultValue:
|
|
491
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.datetime),
|
|
492
|
+
defaultValue: z7.string().datetime().nullable()
|
|
402
493
|
});
|
|
403
494
|
var telephoneFieldDefinitionSchema = StringFieldDefinitionBaseSchema.extend({
|
|
404
|
-
fieldType:
|
|
495
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.telephone)
|
|
405
496
|
// defaultValue: z.string().e164(), @todo when zod v4 releases @see https://github.com/colinhacks/zod/pull/3476
|
|
406
497
|
});
|
|
407
|
-
var stringFieldDefinitionSchema =
|
|
498
|
+
var stringFieldDefinitionSchema = z7.union([
|
|
408
499
|
textFieldDefinitionSchema,
|
|
409
500
|
textareaFieldDefinitionSchema,
|
|
410
501
|
emailFieldDefinitionSchema,
|
|
@@ -417,50 +508,49 @@ var stringFieldDefinitionSchema = z6.union([
|
|
|
417
508
|
]);
|
|
418
509
|
var NumberFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend(
|
|
419
510
|
{
|
|
420
|
-
valueType:
|
|
421
|
-
min:
|
|
422
|
-
max:
|
|
423
|
-
isUnique:
|
|
424
|
-
defaultValue:
|
|
511
|
+
valueType: z7.literal(ValueTypeSchema.Enum.number),
|
|
512
|
+
min: z7.number().nullable(),
|
|
513
|
+
max: z7.number().nullable(),
|
|
514
|
+
isUnique: z7.literal(false),
|
|
515
|
+
defaultValue: z7.number().nullable()
|
|
425
516
|
}
|
|
426
517
|
);
|
|
427
518
|
var numberFieldDefinitionSchema = NumberFieldDefinitionBaseSchema.extend({
|
|
428
|
-
fieldType:
|
|
519
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.number)
|
|
429
520
|
});
|
|
430
521
|
var rangeFieldDefinitionSchema = NumberFieldDefinitionBaseSchema.extend({
|
|
431
|
-
fieldType:
|
|
522
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.range),
|
|
432
523
|
// Overwrite from nullable to required because a range needs min, max and default to work and is required, since it always returns a number
|
|
433
|
-
isRequired:
|
|
434
|
-
min:
|
|
435
|
-
max:
|
|
436
|
-
defaultValue:
|
|
524
|
+
isRequired: z7.literal(true),
|
|
525
|
+
min: z7.number(),
|
|
526
|
+
max: z7.number(),
|
|
527
|
+
defaultValue: z7.number()
|
|
437
528
|
});
|
|
438
529
|
var BooleanFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend({
|
|
439
|
-
valueType:
|
|
530
|
+
valueType: z7.literal(ValueTypeSchema.Enum.boolean),
|
|
440
531
|
// Overwrite from nullable to required because a boolean needs a default to work and is required, since it always is either true or false
|
|
441
|
-
isRequired:
|
|
442
|
-
defaultValue:
|
|
443
|
-
isUnique:
|
|
532
|
+
isRequired: z7.literal(true),
|
|
533
|
+
defaultValue: z7.boolean(),
|
|
534
|
+
isUnique: z7.literal(false)
|
|
444
535
|
});
|
|
445
536
|
var toggleFieldDefinitionSchema = BooleanFieldDefinitionBaseSchema.extend({
|
|
446
|
-
fieldType:
|
|
537
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.toggle)
|
|
447
538
|
});
|
|
448
539
|
var ReferenceFieldDefinitionBaseSchema = FieldDefinitionBaseSchema.extend({
|
|
449
|
-
valueType:
|
|
540
|
+
valueType: z7.literal(ValueTypeSchema.Enum.reference)
|
|
450
541
|
});
|
|
451
542
|
var assetFieldDefinitionSchema = ReferenceFieldDefinitionBaseSchema.extend({
|
|
452
|
-
fieldType:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
max: z6.number().nullable()
|
|
543
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.asset),
|
|
544
|
+
min: z7.number().nullable(),
|
|
545
|
+
max: z7.number().nullable()
|
|
456
546
|
});
|
|
457
547
|
var entryFieldDefinitionSchema = ReferenceFieldDefinitionBaseSchema.extend({
|
|
458
|
-
fieldType:
|
|
459
|
-
ofCollections:
|
|
460
|
-
min:
|
|
461
|
-
max:
|
|
548
|
+
fieldType: z7.literal(FieldTypeSchema.Enum.entry),
|
|
549
|
+
ofCollections: z7.array(uuidSchema),
|
|
550
|
+
min: z7.number().nullable(),
|
|
551
|
+
max: z7.number().nullable()
|
|
462
552
|
});
|
|
463
|
-
var fieldDefinitionSchema =
|
|
553
|
+
var fieldDefinitionSchema = z7.union([
|
|
464
554
|
stringFieldDefinitionSchema,
|
|
465
555
|
numberFieldDefinitionSchema,
|
|
466
556
|
rangeFieldDefinitionSchema,
|
|
@@ -487,10 +577,10 @@ function getValueContentSchemaFromFieldDefinition(fieldDefinition) {
|
|
|
487
577
|
}
|
|
488
578
|
}
|
|
489
579
|
function getBooleanValueContentSchema() {
|
|
490
|
-
return
|
|
580
|
+
return z7.boolean();
|
|
491
581
|
}
|
|
492
582
|
function getNumberValueContentSchema(definition) {
|
|
493
|
-
let schema =
|
|
583
|
+
let schema = z7.number();
|
|
494
584
|
if (definition.min) {
|
|
495
585
|
schema = schema.min(definition.min);
|
|
496
586
|
}
|
|
@@ -503,7 +593,7 @@ function getNumberValueContentSchema(definition) {
|
|
|
503
593
|
return schema;
|
|
504
594
|
}
|
|
505
595
|
function getStringValueContentSchema(definition) {
|
|
506
|
-
let schema =
|
|
596
|
+
let schema = z7.string().trim();
|
|
507
597
|
if ("min" in definition && definition.min) {
|
|
508
598
|
schema = schema.min(definition.min);
|
|
509
599
|
}
|
|
@@ -542,12 +632,12 @@ function getReferenceValueContentSchema(definition) {
|
|
|
542
632
|
switch (definition.fieldType) {
|
|
543
633
|
case FieldTypeSchema.Enum.asset:
|
|
544
634
|
{
|
|
545
|
-
schema =
|
|
635
|
+
schema = z7.array(valueContentReferenceToAssetSchema);
|
|
546
636
|
}
|
|
547
637
|
break;
|
|
548
638
|
case FieldTypeSchema.Enum.entry:
|
|
549
639
|
{
|
|
550
|
-
schema =
|
|
640
|
+
schema = z7.array(valueContentReferenceToEntrySchema);
|
|
551
641
|
}
|
|
552
642
|
break;
|
|
553
643
|
}
|
|
@@ -565,24 +655,29 @@ function getReferenceValueContentSchema(definition) {
|
|
|
565
655
|
|
|
566
656
|
// src/schema/collectionSchema.ts
|
|
567
657
|
var collectionFileSchema = baseFileSchema.extend({
|
|
568
|
-
objectType:
|
|
569
|
-
name:
|
|
658
|
+
objectType: z8.literal(objectTypeSchema.Enum.collection).readonly(),
|
|
659
|
+
name: z8.object({
|
|
570
660
|
singular: translatableStringSchema,
|
|
571
661
|
plural: translatableStringSchema
|
|
572
662
|
}),
|
|
573
|
-
slug:
|
|
574
|
-
singular:
|
|
575
|
-
plural:
|
|
663
|
+
slug: z8.object({
|
|
664
|
+
singular: z8.string(),
|
|
665
|
+
plural: z8.string()
|
|
576
666
|
}),
|
|
577
667
|
description: translatableStringSchema,
|
|
578
668
|
icon: supportedIconSchema,
|
|
579
|
-
fieldDefinitions:
|
|
669
|
+
fieldDefinitions: z8.array(fieldDefinitionSchema)
|
|
670
|
+
});
|
|
671
|
+
var collectionSchema = collectionFileSchema.extend({
|
|
672
|
+
/**
|
|
673
|
+
* Commit history of this Collection
|
|
674
|
+
*/
|
|
675
|
+
history: z8.array(gitCommitSchema)
|
|
580
676
|
});
|
|
581
|
-
var collectionSchema = collectionFileSchema.extend({});
|
|
582
677
|
var collectionExportSchema = collectionSchema.extend({
|
|
583
|
-
entries:
|
|
678
|
+
entries: z8.array(entryExportSchema)
|
|
584
679
|
});
|
|
585
|
-
var createCollectionSchema =
|
|
680
|
+
var createCollectionSchema = collectionFileSchema.omit({
|
|
586
681
|
id: true,
|
|
587
682
|
objectType: true,
|
|
588
683
|
created: true,
|
|
@@ -590,9 +685,10 @@ var createCollectionSchema = collectionSchema.omit({
|
|
|
590
685
|
}).extend({
|
|
591
686
|
projectId: uuidSchema.readonly()
|
|
592
687
|
});
|
|
593
|
-
var readCollectionSchema =
|
|
688
|
+
var readCollectionSchema = z8.object({
|
|
594
689
|
id: uuidSchema.readonly(),
|
|
595
|
-
projectId: uuidSchema.readonly()
|
|
690
|
+
projectId: uuidSchema.readonly(),
|
|
691
|
+
commitHash: z8.string().optional().readonly()
|
|
596
692
|
});
|
|
597
693
|
var updateCollectionSchema = collectionFileSchema.pick({
|
|
598
694
|
id: true,
|
|
@@ -605,149 +701,45 @@ var updateCollectionSchema = collectionFileSchema.pick({
|
|
|
605
701
|
projectId: uuidSchema.readonly()
|
|
606
702
|
});
|
|
607
703
|
var deleteCollectionSchema = readCollectionSchema.extend({});
|
|
608
|
-
var countCollectionsSchema =
|
|
704
|
+
var countCollectionsSchema = z8.object({
|
|
609
705
|
projectId: uuidSchema.readonly()
|
|
610
706
|
});
|
|
611
707
|
|
|
612
708
|
// src/schema/coreSchema.ts
|
|
613
|
-
import { z as z8 } from "zod";
|
|
614
|
-
var elekIoCoreOptionsSchema = z8.object({
|
|
615
|
-
/**
|
|
616
|
-
* The environment elek.io Core is currently running in
|
|
617
|
-
*/
|
|
618
|
-
environment: environmentSchema,
|
|
619
|
-
/**
|
|
620
|
-
* The current version of elek.io Core
|
|
621
|
-
*/
|
|
622
|
-
version: versionSchema,
|
|
623
|
-
file: z8.object({
|
|
624
|
-
json: z8.object({
|
|
625
|
-
/**
|
|
626
|
-
* If set, adds indentation with spaces (number) or escape character (string)
|
|
627
|
-
* and line break characters to saved JSON files on disk, to make them easier to read.
|
|
628
|
-
* Defaults to 2 spaces of indentation.
|
|
629
|
-
*/
|
|
630
|
-
indentation: z8.union([z8.number(), z8.string()])
|
|
631
|
-
})
|
|
632
|
-
})
|
|
633
|
-
});
|
|
634
|
-
var constructorElekIoCoreSchema = elekIoCoreOptionsSchema.omit({
|
|
635
|
-
version: true
|
|
636
|
-
}).partial({
|
|
637
|
-
environment: true,
|
|
638
|
-
file: true
|
|
639
|
-
}).optional();
|
|
640
|
-
|
|
641
|
-
// src/schema/gitSchema.ts
|
|
642
709
|
import { z as z9 } from "zod";
|
|
643
|
-
var
|
|
644
|
-
|
|
645
|
-
name: z9.string(),
|
|
646
|
-
email: z9.string()
|
|
647
|
-
});
|
|
648
|
-
var gitCommitSchema = z9.object({
|
|
649
|
-
/**
|
|
650
|
-
* SHA-1 hash of the commit
|
|
651
|
-
*/
|
|
652
|
-
hash: z9.string(),
|
|
653
|
-
message: z9.string(),
|
|
654
|
-
author: gitSignatureSchema,
|
|
655
|
-
datetime: z9.string().datetime(),
|
|
656
|
-
tag: z9.string().nullable()
|
|
657
|
-
});
|
|
658
|
-
var GitCommitIconNative = /* @__PURE__ */ ((GitCommitIconNative2) => {
|
|
659
|
-
GitCommitIconNative2["INIT"] = ":tada:";
|
|
660
|
-
GitCommitIconNative2["CREATE"] = ":heavy_plus_sign:";
|
|
661
|
-
GitCommitIconNative2["UPDATE"] = ":wrench:";
|
|
662
|
-
GitCommitIconNative2["DELETE"] = ":fire:";
|
|
663
|
-
return GitCommitIconNative2;
|
|
664
|
-
})(GitCommitIconNative || {});
|
|
665
|
-
var gitCommitIconSchema = z9.nativeEnum(GitCommitIconNative);
|
|
666
|
-
var gitInitOptionsSchema = z9.object({
|
|
667
|
-
/**
|
|
668
|
-
* Use the specified name for the initial branch in the newly created repository. If not specified, fall back to the default name (currently master, but this is subject to change in the future; the name can be customized via the init.defaultBranch configuration variable).
|
|
669
|
-
*/
|
|
670
|
-
initialBranch: z9.string()
|
|
671
|
-
});
|
|
672
|
-
var gitCloneOptionsSchema = z9.object({
|
|
673
|
-
/**
|
|
674
|
-
* Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches. If you want to clone submodules shallowly, also pass --shallow-submodules.
|
|
675
|
-
*/
|
|
676
|
-
depth: z9.number(),
|
|
677
|
-
/**
|
|
678
|
-
* Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.
|
|
679
|
-
*/
|
|
680
|
-
singleBranch: z9.boolean(),
|
|
681
|
-
/**
|
|
682
|
-
* Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting repository.
|
|
683
|
-
*/
|
|
684
|
-
branch: z9.string()
|
|
685
|
-
});
|
|
686
|
-
var gitSwitchOptionsSchema = z9.object({
|
|
687
|
-
/**
|
|
688
|
-
* If true, creates a new local branch and then switches to it
|
|
689
|
-
*
|
|
690
|
-
* @see https://git-scm.com/docs/git-switch#Documentation/git-switch.txt---createltnew-branchgt
|
|
691
|
-
*/
|
|
692
|
-
isNew: z9.boolean().optional()
|
|
693
|
-
});
|
|
694
|
-
var gitLogOptionsSchema = z9.object({
|
|
695
|
-
/**
|
|
696
|
-
* Limit the result to given number of commits
|
|
697
|
-
*/
|
|
698
|
-
limit: z9.number().optional(),
|
|
699
|
-
/**
|
|
700
|
-
* Only list commits that are between given SHAs or tag names
|
|
701
|
-
*
|
|
702
|
-
* Note that the commits of from and to are not included in the result
|
|
703
|
-
*/
|
|
704
|
-
between: z9.object({
|
|
710
|
+
var elekIoCoreOptionsSchema = z9.object({
|
|
711
|
+
log: z9.object({
|
|
705
712
|
/**
|
|
706
|
-
*
|
|
713
|
+
* The lowest level that should be logged
|
|
714
|
+
*
|
|
715
|
+
* @default 'info'
|
|
707
716
|
*/
|
|
708
|
-
|
|
717
|
+
level: logLevelSchema
|
|
718
|
+
}),
|
|
719
|
+
file: z9.object({
|
|
709
720
|
/**
|
|
710
|
-
*
|
|
721
|
+
* If set to true, caches files in memory to speed up access
|
|
711
722
|
*
|
|
712
|
-
*
|
|
723
|
+
* @default true
|
|
713
724
|
*/
|
|
714
|
-
|
|
725
|
+
cache: z9.boolean()
|
|
715
726
|
})
|
|
716
727
|
});
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
id: uuidSchema,
|
|
722
|
-
message: z10.string(),
|
|
723
|
-
author: gitSignatureSchema,
|
|
724
|
-
datetime: z10.string().datetime()
|
|
725
|
-
});
|
|
726
|
-
var createGitTagSchema = gitTagSchema.pick({
|
|
727
|
-
message: true
|
|
728
|
-
}).extend({
|
|
729
|
-
path: gitRepositoryPathSchema,
|
|
730
|
-
hash: gitCommitSchema.shape.hash.optional()
|
|
731
|
-
});
|
|
732
|
-
var readGitTagSchema = z10.object({
|
|
733
|
-
path: gitRepositoryPathSchema,
|
|
734
|
-
id: uuidSchema.readonly()
|
|
735
|
-
});
|
|
736
|
-
var deleteGitTagSchema = readGitTagSchema.extend({});
|
|
737
|
-
var countGitTagsSchema = z10.object({
|
|
738
|
-
path: gitRepositoryPathSchema
|
|
739
|
-
});
|
|
728
|
+
var constructorElekIoCoreSchema = elekIoCoreOptionsSchema.partial({
|
|
729
|
+
log: true,
|
|
730
|
+
file: true
|
|
731
|
+
}).optional();
|
|
740
732
|
|
|
741
733
|
// src/schema/projectSchema.ts
|
|
742
|
-
import { z as
|
|
743
|
-
var projectStatusSchema =
|
|
744
|
-
var projectSettingsSchema =
|
|
745
|
-
language:
|
|
734
|
+
import { z as z10 } from "zod";
|
|
735
|
+
var projectStatusSchema = z10.enum(["foo", "bar", "todo"]);
|
|
736
|
+
var projectSettingsSchema = z10.object({
|
|
737
|
+
language: z10.object({
|
|
746
738
|
default: supportedLanguageSchema,
|
|
747
|
-
supported:
|
|
739
|
+
supported: z10.array(supportedLanguageSchema)
|
|
748
740
|
})
|
|
749
741
|
});
|
|
750
|
-
var projectFolderSchema =
|
|
742
|
+
var projectFolderSchema = z10.enum([
|
|
751
743
|
"assets",
|
|
752
744
|
"collections",
|
|
753
745
|
"shared-values",
|
|
@@ -756,19 +748,36 @@ var projectFolderSchema = z11.enum([
|
|
|
756
748
|
// 'public',
|
|
757
749
|
// 'theme',
|
|
758
750
|
]);
|
|
751
|
+
var projectBranchSchema = z10.enum(["production", "work"]);
|
|
759
752
|
var projectFileSchema = baseFileSchema.extend({
|
|
760
|
-
objectType:
|
|
753
|
+
objectType: z10.literal(objectTypeSchema.Enum.project).readonly(),
|
|
761
754
|
coreVersion: versionSchema,
|
|
762
|
-
name:
|
|
763
|
-
description:
|
|
755
|
+
name: z10.string().trim().min(1, "shared.projectNameRequired"),
|
|
756
|
+
description: z10.string().trim().min(1, "shared.projectDescriptionRequired"),
|
|
764
757
|
version: versionSchema,
|
|
765
758
|
status: projectStatusSchema,
|
|
766
759
|
settings: projectSettingsSchema
|
|
767
760
|
});
|
|
768
|
-
var projectSchema = projectFileSchema.extend({
|
|
761
|
+
var projectSchema = projectFileSchema.extend({
|
|
762
|
+
remoteOriginUrl: z10.string().nullable(),
|
|
763
|
+
/**
|
|
764
|
+
* Commit history of this Project
|
|
765
|
+
*/
|
|
766
|
+
history: z10.array(gitCommitSchema),
|
|
767
|
+
/**
|
|
768
|
+
* Full commit history of this Project
|
|
769
|
+
* including all Assets, Collections, Entries and other files
|
|
770
|
+
*/
|
|
771
|
+
fullHistory: z10.array(gitCommitSchema)
|
|
772
|
+
});
|
|
773
|
+
var outdatedProjectSchema = projectFileSchema.pick({
|
|
774
|
+
id: true,
|
|
775
|
+
name: true,
|
|
776
|
+
coreVersion: true
|
|
777
|
+
});
|
|
769
778
|
var projectExportSchema = projectSchema.extend({
|
|
770
|
-
assets:
|
|
771
|
-
collections:
|
|
779
|
+
assets: z10.array(assetExportSchema),
|
|
780
|
+
collections: z10.array(collectionExportSchema)
|
|
772
781
|
});
|
|
773
782
|
var createProjectSchema = projectSchema.pick({
|
|
774
783
|
name: true,
|
|
@@ -778,8 +787,9 @@ var createProjectSchema = projectSchema.pick({
|
|
|
778
787
|
description: true,
|
|
779
788
|
settings: true
|
|
780
789
|
});
|
|
781
|
-
var readProjectSchema =
|
|
782
|
-
id: uuidSchema.readonly()
|
|
790
|
+
var readProjectSchema = z10.object({
|
|
791
|
+
id: uuidSchema.readonly(),
|
|
792
|
+
commitHash: z10.string().optional().readonly()
|
|
783
793
|
});
|
|
784
794
|
var updateProjectSchema = projectSchema.pick({
|
|
785
795
|
id: true,
|
|
@@ -791,11 +801,17 @@ var updateProjectSchema = projectSchema.pick({
|
|
|
791
801
|
description: true,
|
|
792
802
|
settings: true
|
|
793
803
|
});
|
|
794
|
-
var upgradeProjectSchema =
|
|
795
|
-
id: uuidSchema.readonly()
|
|
804
|
+
var upgradeProjectSchema = z10.object({
|
|
805
|
+
id: uuidSchema.readonly(),
|
|
806
|
+
/**
|
|
807
|
+
* Force the upgrade even if the Project is up-to-date
|
|
808
|
+
*/
|
|
809
|
+
force: z10.boolean().optional()
|
|
796
810
|
});
|
|
797
|
-
var deleteProjectSchema = readProjectSchema.extend({
|
|
798
|
-
|
|
811
|
+
var deleteProjectSchema = readProjectSchema.extend({
|
|
812
|
+
force: z10.boolean().optional()
|
|
813
|
+
});
|
|
814
|
+
var projectUpgradeSchema = z10.object({
|
|
799
815
|
/**
|
|
800
816
|
* The Core version the Project will be upgraded to
|
|
801
817
|
*/
|
|
@@ -803,45 +819,45 @@ var projectUpgradeSchema = z11.object({
|
|
|
803
819
|
/**
|
|
804
820
|
* Function that will be executed in the process of upgrading a Project
|
|
805
821
|
*/
|
|
806
|
-
run:
|
|
822
|
+
run: z10.function().args(projectFileSchema).returns(z10.promise(z10.void()))
|
|
807
823
|
});
|
|
808
|
-
var cloneProjectSchema =
|
|
809
|
-
url:
|
|
824
|
+
var cloneProjectSchema = z10.object({
|
|
825
|
+
url: z10.string()
|
|
810
826
|
});
|
|
811
|
-
var listBranchesProjectSchema =
|
|
827
|
+
var listBranchesProjectSchema = z10.object({
|
|
812
828
|
id: uuidSchema.readonly()
|
|
813
829
|
});
|
|
814
|
-
var currentBranchProjectSchema =
|
|
830
|
+
var currentBranchProjectSchema = z10.object({
|
|
815
831
|
id: uuidSchema.readonly()
|
|
816
832
|
});
|
|
817
|
-
var switchBranchProjectSchema =
|
|
833
|
+
var switchBranchProjectSchema = z10.object({
|
|
818
834
|
id: uuidSchema.readonly(),
|
|
819
|
-
branch:
|
|
835
|
+
branch: z10.string(),
|
|
820
836
|
options: gitSwitchOptionsSchema.optional()
|
|
821
837
|
});
|
|
822
|
-
var getRemoteOriginUrlProjectSchema =
|
|
838
|
+
var getRemoteOriginUrlProjectSchema = z10.object({
|
|
823
839
|
id: uuidSchema.readonly()
|
|
824
840
|
});
|
|
825
|
-
var setRemoteOriginUrlProjectSchema =
|
|
841
|
+
var setRemoteOriginUrlProjectSchema = z10.object({
|
|
826
842
|
id: uuidSchema.readonly(),
|
|
827
|
-
url:
|
|
843
|
+
url: z10.string()
|
|
828
844
|
});
|
|
829
|
-
var getChangesProjectSchema =
|
|
845
|
+
var getChangesProjectSchema = z10.object({
|
|
830
846
|
id: uuidSchema.readonly()
|
|
831
847
|
});
|
|
832
|
-
var synchronizeProjectSchema =
|
|
848
|
+
var synchronizeProjectSchema = z10.object({
|
|
833
849
|
id: uuidSchema.readonly()
|
|
834
850
|
});
|
|
835
|
-
var searchProjectSchema =
|
|
851
|
+
var searchProjectSchema = z10.object({
|
|
836
852
|
id: uuidSchema.readonly(),
|
|
837
|
-
query:
|
|
853
|
+
query: z10.string(),
|
|
838
854
|
language: supportedLanguageSchema,
|
|
839
|
-
type:
|
|
855
|
+
type: z10.array(objectTypeSchema).optional()
|
|
840
856
|
});
|
|
841
857
|
|
|
842
858
|
// src/schema/serviceSchema.ts
|
|
843
|
-
import { z as
|
|
844
|
-
var serviceTypeSchema =
|
|
859
|
+
import { z as z11 } from "zod";
|
|
860
|
+
var serviceTypeSchema = z11.enum([
|
|
845
861
|
"Git",
|
|
846
862
|
"GitTag",
|
|
847
863
|
"User",
|
|
@@ -853,10 +869,10 @@ var serviceTypeSchema = z12.enum([
|
|
|
853
869
|
"Entry",
|
|
854
870
|
"Value"
|
|
855
871
|
]);
|
|
856
|
-
var listSchema =
|
|
872
|
+
var listSchema = z11.object({
|
|
857
873
|
projectId: uuidSchema,
|
|
858
|
-
limit:
|
|
859
|
-
offset:
|
|
874
|
+
limit: z11.number().optional(),
|
|
875
|
+
offset: z11.number().optional()
|
|
860
876
|
});
|
|
861
877
|
var listCollectionsSchema = listSchema;
|
|
862
878
|
var listEntriesSchema = listSchema.extend({
|
|
@@ -866,33 +882,33 @@ var listAssetsSchema = listSchema;
|
|
|
866
882
|
var listProjectsSchema = listSchema.omit({
|
|
867
883
|
projectId: true
|
|
868
884
|
});
|
|
869
|
-
var listGitTagsSchema =
|
|
870
|
-
path:
|
|
885
|
+
var listGitTagsSchema = z11.object({
|
|
886
|
+
path: z11.string()
|
|
871
887
|
});
|
|
872
888
|
|
|
873
889
|
// src/schema/userSchema.ts
|
|
874
|
-
import
|
|
875
|
-
var UserTypeSchema =
|
|
890
|
+
import z12 from "zod";
|
|
891
|
+
var UserTypeSchema = z12.enum(["local", "cloud"]);
|
|
876
892
|
var baseUserSchema = gitSignatureSchema.extend({
|
|
877
893
|
userType: UserTypeSchema,
|
|
878
894
|
language: supportedLanguageSchema,
|
|
879
|
-
window:
|
|
880
|
-
width:
|
|
881
|
-
height:
|
|
882
|
-
position:
|
|
883
|
-
x:
|
|
884
|
-
y:
|
|
895
|
+
window: z12.object({
|
|
896
|
+
width: z12.number(),
|
|
897
|
+
height: z12.number(),
|
|
898
|
+
position: z12.object({
|
|
899
|
+
x: z12.number(),
|
|
900
|
+
y: z12.number()
|
|
885
901
|
})
|
|
886
902
|
}).nullable()
|
|
887
903
|
});
|
|
888
904
|
var localUserSchema = baseUserSchema.extend({
|
|
889
|
-
userType:
|
|
905
|
+
userType: z12.literal(UserTypeSchema.Enum.local)
|
|
890
906
|
});
|
|
891
907
|
var cloudUserSchema = baseUserSchema.extend({
|
|
892
|
-
userType:
|
|
908
|
+
userType: z12.literal(UserTypeSchema.Enum.cloud),
|
|
893
909
|
id: uuidSchema
|
|
894
910
|
});
|
|
895
|
-
var userFileSchema =
|
|
911
|
+
var userFileSchema = z12.union([localUserSchema, cloudUserSchema]);
|
|
896
912
|
var userSchema = userFileSchema;
|
|
897
913
|
var setUserSchema = userSchema;
|
|
898
914
|
|
|
@@ -930,7 +946,6 @@ export {
|
|
|
930
946
|
assetFileSchema,
|
|
931
947
|
assetSchema,
|
|
932
948
|
baseFileSchema,
|
|
933
|
-
baseFileWithLanguageSchema,
|
|
934
949
|
baseUserSchema,
|
|
935
950
|
cloneProjectSchema,
|
|
936
951
|
cloudUserSchema,
|
|
@@ -967,18 +982,17 @@ export {
|
|
|
967
982
|
entryFieldDefinitionSchema,
|
|
968
983
|
entryFileSchema,
|
|
969
984
|
entrySchema,
|
|
970
|
-
environmentSchema,
|
|
971
985
|
fieldDefinitionSchema,
|
|
972
986
|
fileReferenceSchema,
|
|
973
987
|
getChangesProjectSchema,
|
|
974
988
|
getRemoteOriginUrlProjectSchema,
|
|
975
989
|
getValueContentSchemaFromFieldDefinition,
|
|
976
990
|
gitCloneOptionsSchema,
|
|
977
|
-
gitCommitIconSchema,
|
|
978
991
|
gitCommitSchema,
|
|
979
992
|
gitInitOptionsSchema,
|
|
980
993
|
gitLogOptionsSchema,
|
|
981
|
-
|
|
994
|
+
gitMergeOptionsSchema,
|
|
995
|
+
gitMessageSchema,
|
|
982
996
|
gitSignatureSchema,
|
|
983
997
|
gitSwitchOptionsSchema,
|
|
984
998
|
gitTagSchema,
|
|
@@ -990,8 +1004,11 @@ export {
|
|
|
990
1004
|
listGitTagsSchema,
|
|
991
1005
|
listProjectsSchema,
|
|
992
1006
|
localUserSchema,
|
|
1007
|
+
logLevelSchema,
|
|
993
1008
|
numberFieldDefinitionSchema,
|
|
994
1009
|
objectTypeSchema,
|
|
1010
|
+
outdatedProjectSchema,
|
|
1011
|
+
projectBranchSchema,
|
|
995
1012
|
projectExportSchema,
|
|
996
1013
|
projectFileSchema,
|
|
997
1014
|
projectFolderSchema,
|
|
@@ -1009,15 +1026,13 @@ export {
|
|
|
1009
1026
|
resolvedReferencedValueSchema,
|
|
1010
1027
|
resolvedValueContentReferenceSchema,
|
|
1011
1028
|
resolvedValueSchema,
|
|
1029
|
+
saveAssetSchema,
|
|
1012
1030
|
searchProjectSchema,
|
|
1013
1031
|
serviceTypeSchema,
|
|
1014
1032
|
setRemoteOriginUrlProjectSchema,
|
|
1015
1033
|
setUserSchema,
|
|
1016
1034
|
slug,
|
|
1017
1035
|
stringFieldDefinitionSchema,
|
|
1018
|
-
supportedAssetExtensionSchema,
|
|
1019
|
-
supportedAssetMimeTypeSchema,
|
|
1020
|
-
supportedAssetTypeSchema,
|
|
1021
1036
|
supportedIconSchema,
|
|
1022
1037
|
supportedLanguageSchema,
|
|
1023
1038
|
switchBranchProjectSchema,
|
|
@@ -1046,7 +1061,6 @@ export {
|
|
|
1046
1061
|
valueContentReferenceToAssetSchema,
|
|
1047
1062
|
valueContentReferenceToCollectionSchema,
|
|
1048
1063
|
valueContentReferenceToEntrySchema,
|
|
1049
|
-
valueContentReferenceWithLanguageBase,
|
|
1050
1064
|
valueSchema,
|
|
1051
1065
|
versionSchema
|
|
1052
1066
|
};
|