@takeshape/schema 9.40.1 → 9.41.2
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/builtin-schema.js +10 -10
- package/dist/schema-util.js +1 -1
- package/dist/template-shapes/templates.d.ts +1 -1
- package/dist/template-shapes/templates.d.ts.map +1 -1
- package/dist/template-shapes/templates.js +16 -8
- package/dist/template-shapes/where.js +2 -2
- package/es/builtin-schema.js +10 -10
- package/es/schema-util.js +1 -1
- package/es/template-shapes/templates.js +15 -7
- package/es/template-shapes/where.js +3 -3
- package/examples/latest/betzino.json +51 -51
- package/examples/latest/real-world-schema.json +0 -240
- package/examples/latest/rick-and-morty-ast.json +51 -51
- package/examples/latest/rick-and-morty-graphql.json +51 -51
- package/examples/latest/shopify-product-2022-07.json +201 -201
- package/examples/latest/shopify-product-2023-04.json +201 -201
- package/examples/latest/shopify-store-with-widget.json +51 -51
- package/examples/latest/stripe-product-runtime-schema.json +201 -201
- package/examples/latest/stripe-starter-resolved.json +51 -51
- package/examples/source/betzino.json +52 -52
- package/examples/source/real-world-schema.json +4 -172
- package/examples/source/rick-and-morty-ast.json +302 -117
- package/examples/source/rick-and-morty-graphql.json +213 -92
- package/examples/source/shopify-product-2022-07.json +202 -202
- package/examples/source/shopify-product-2023-04.json +202 -202
- package/examples/source/shopify-store-with-widget.json +485 -135
- package/examples/source/stripe-product-runtime-schema.json +202 -202
- package/examples/source/stripe-starter-resolved.json +52 -52
- package/package.json +5 -5
package/dist/builtin-schema.js
CHANGED
|
@@ -247,9 +247,9 @@ const builtInShapes = {
|
|
|
247
247
|
required: ['filename', 'path']
|
|
248
248
|
}
|
|
249
249
|
},
|
|
250
|
-
|
|
250
|
+
TSStaticSite: {
|
|
251
251
|
id: 'SITE',
|
|
252
|
-
name: '
|
|
252
|
+
name: 'TSStaticSite',
|
|
253
253
|
title: 'Static Site',
|
|
254
254
|
model: {
|
|
255
255
|
type: 'multiple'
|
|
@@ -330,7 +330,7 @@ const builtInShapes = {
|
|
|
330
330
|
title: 'Environment Variables',
|
|
331
331
|
'@l10n': false,
|
|
332
332
|
items: {
|
|
333
|
-
$ref: '#/shapes/
|
|
333
|
+
$ref: '#/shapes/TSStaticSiteEnvironmentVariables/schema'
|
|
334
334
|
},
|
|
335
335
|
'@mapping': 'shapedb:TsStaticSite.9fj4UiNxY'
|
|
336
336
|
},
|
|
@@ -339,7 +339,7 @@ const builtInShapes = {
|
|
|
339
339
|
title: 'Publish Triggers',
|
|
340
340
|
'@l10n': false,
|
|
341
341
|
items: {
|
|
342
|
-
$ref: '#/shapes/
|
|
342
|
+
$ref: '#/shapes/TSStaticSiteTriggers/schema'
|
|
343
343
|
}
|
|
344
344
|
},
|
|
345
345
|
templateHash: {
|
|
@@ -352,9 +352,9 @@ const builtInShapes = {
|
|
|
352
352
|
required: ['title', 'provider', 'destination']
|
|
353
353
|
}
|
|
354
354
|
},
|
|
355
|
-
|
|
355
|
+
TSStaticSiteEnvironmentVariables: {
|
|
356
356
|
id: '9fj4UiNxY',
|
|
357
|
-
name: '
|
|
357
|
+
name: 'TSStaticSiteEnvironmentVariables',
|
|
358
358
|
title: 'Static Site EnvironmentVariables',
|
|
359
359
|
schema: {
|
|
360
360
|
type: 'object',
|
|
@@ -372,9 +372,9 @@ const builtInShapes = {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
},
|
|
375
|
-
|
|
376
|
-
id: '
|
|
377
|
-
name: '
|
|
375
|
+
TSStaticSiteTriggers: {
|
|
376
|
+
id: 'TSStaticSiteTriggers',
|
|
377
|
+
name: 'TSStaticSiteTriggers',
|
|
378
378
|
title: 'Static Site Triggers',
|
|
379
379
|
schema: {
|
|
380
380
|
type: 'object',
|
|
@@ -436,7 +436,7 @@ const builtInForms = {
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
},
|
|
439
|
-
|
|
439
|
+
TSStaticSite: {
|
|
440
440
|
default: {
|
|
441
441
|
order: ['title', 'provider', 'destination', 'idKey', 'secretKey', 'environmentVariables'],
|
|
442
442
|
properties: {
|
package/dist/schema-util.js
CHANGED
|
@@ -480,7 +480,7 @@ function applyBuiltinPropertiesToShape(projectSchema, shape) {
|
|
|
480
480
|
} // Dependencies of these built-in shapes are automatically added by getBuiltinsUsed
|
|
481
481
|
|
|
482
482
|
|
|
483
|
-
const requiredBuiltinShapes = ['Asset', 'TSRelationship', '
|
|
483
|
+
const requiredBuiltinShapes = ['Asset', 'TSRelationship', 'TSStaticSite', 'TSUser'];
|
|
484
484
|
/**
|
|
485
485
|
* Get all built-in shapes that are depended on by the given project schema.
|
|
486
486
|
* Required built-in shapes are always included.
|
|
@@ -19,7 +19,7 @@ export declare const TSSearchSortInput: Shape;
|
|
|
19
19
|
export declare const commonSearchProps: Record<string, PropertySchema>;
|
|
20
20
|
export declare const localeProps: ObjectSchema;
|
|
21
21
|
export declare const termsProps: ObjectSchema;
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const TSContentStructureInput: Shape;
|
|
23
23
|
export declare function getPaginatedListShape(context: unknown, shape: Shape): ResolvedTemplate;
|
|
24
24
|
export declare function getSearchResultsShape(context: unknown, shape: Shape): ResolvedTemplate;
|
|
25
25
|
export declare function getIDQueryArgs(templateName: string): (context: unknown, shape: Shape) => ResolvedTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/template-shapes/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAiB,cAAc,EAAE,KAAK,EAAc,MAAM,mBAAmB,CAAC;AACvG,OAAO,KAAK,EAAC,gBAAgB,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,SAAS,YAoJH,OAAO,SAAS,KAAK,KAAG,gBAAgB,AApJP,CAAC;AACrD,eAAO,MAAM,kBAAkB,YAmJZ,OAAO,SAA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,KAAG,gBAAgB,CA0BlE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.commonSearchProps = exports.commonSearchArgs = exports.UpdateResult = exports.UpdateArgs = exports.TSSearchSortInput = exports.TSSearchArgs = exports.TSListArgs = exports.TSGetSingletonArgs = exports.TSGetArgs = exports.SearchResults = exports.PaginatedList = exports.DuplicateResult = exports.DuplicateArgs = exports.DeleteResult = exports.DeleteArgs = exports.CreateResult = exports.CreateArgs =
|
|
6
|
+
exports.commonSearchProps = exports.commonSearchArgs = exports.UpdateResult = exports.UpdateArgs = exports.TSSearchSortInput = exports.TSSearchArgs = exports.TSListArgs = exports.TSGetSingletonArgs = exports.TSGetArgs = exports.TSContentStructureInput = exports.SearchResults = exports.PaginatedList = exports.DuplicateResult = exports.DuplicateArgs = exports.DeleteResult = exports.DeleteArgs = exports.CreateResult = exports.CreateArgs = void 0;
|
|
7
7
|
exports.getIDQueryArgs = getIDQueryArgs;
|
|
8
8
|
exports.getInputShapeName = getInputShapeName;
|
|
9
9
|
exports.getMutationArgs = getMutationArgs;
|
|
@@ -126,7 +126,7 @@ const termsProps = {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
exports.termsProps = termsProps;
|
|
129
|
-
const
|
|
129
|
+
const TSContentStructureInput = (0, _schemaUtil.createShape)('TSContentStructureInput', {
|
|
130
130
|
type: 'object',
|
|
131
131
|
properties: {
|
|
132
132
|
path: {
|
|
@@ -145,7 +145,7 @@ const ContentStructureInput = (0, _schemaUtil.createShape)('ContentStructureInpu
|
|
|
145
145
|
}, {
|
|
146
146
|
description: 'Describes a structural update to an array of data.'
|
|
147
147
|
});
|
|
148
|
-
exports.
|
|
148
|
+
exports.TSContentStructureInput = TSContentStructureInput;
|
|
149
149
|
|
|
150
150
|
function getPaginatedListShape(context, shape) {
|
|
151
151
|
const shapeName = `${shape.name}${_migration.listTypePrefix}`;
|
|
@@ -203,7 +203,7 @@ const contentStructureFields = {
|
|
|
203
203
|
structure: {
|
|
204
204
|
type: 'array',
|
|
205
205
|
items: {
|
|
206
|
-
'@ref': 'local:
|
|
206
|
+
'@ref': 'local:TSContentStructureInput'
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -239,7 +239,9 @@ function getIDQueryArgs(templateName) {
|
|
|
239
239
|
|
|
240
240
|
function getMutationInputShapeName(verb) {
|
|
241
241
|
return shapeName => {
|
|
242
|
-
return (0, _util.
|
|
242
|
+
return (0, _util.formatShapeName)([verb, shapeName, 'input'], {
|
|
243
|
+
shapeNameIndex: 1
|
|
244
|
+
});
|
|
243
245
|
};
|
|
244
246
|
}
|
|
245
247
|
/**
|
|
@@ -248,7 +250,11 @@ function getMutationInputShapeName(verb) {
|
|
|
248
250
|
|
|
249
251
|
|
|
250
252
|
function getInputShapeName(shapeName) {
|
|
251
|
-
|
|
253
|
+
if (shapeName === 'TSRelationship') {
|
|
254
|
+
return shapeName;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return `${shapeName}Input`;
|
|
252
258
|
}
|
|
253
259
|
|
|
254
260
|
function getOutputShapeName(name) {
|
|
@@ -341,7 +347,7 @@ function getMutationArgs(templateName, verb) {
|
|
|
341
347
|
return (0, _schemaUtil.createShape)(getInputShapeName(shapeName), rewriteRefs(projectSchema, (0, _createInputSchema.createInputSchema)(shape.schema), getInputShapeName));
|
|
342
348
|
}), 'name')),
|
|
343
349
|
...(addStructure ? {
|
|
344
|
-
|
|
350
|
+
TSContentStructureInput
|
|
345
351
|
} : {})
|
|
346
352
|
}
|
|
347
353
|
};
|
|
@@ -350,7 +356,9 @@ function getMutationArgs(templateName, verb) {
|
|
|
350
356
|
|
|
351
357
|
function getMutationResultType(verb) {
|
|
352
358
|
return (context, shape) => {
|
|
353
|
-
const shapeName = (0, _util.
|
|
359
|
+
const shapeName = (0, _util.formatShapeName)([verb, shape.name, 'result'], {
|
|
360
|
+
shapeNameIndex: 1
|
|
361
|
+
});
|
|
354
362
|
const result = verb === _types.TemplateVerbs.Delete ? {
|
|
355
363
|
type: 'boolean'
|
|
356
364
|
} : {
|
|
@@ -242,7 +242,7 @@ function truncateNames(names) {
|
|
|
242
242
|
function getRelationshipShapeName(refs) {
|
|
243
243
|
return refs.map(ref => {
|
|
244
244
|
const shapeName = ref.split(':')[1];
|
|
245
|
-
return (0, _util.
|
|
245
|
+
return (0, _util.formatShapeName)(shapeName);
|
|
246
246
|
}).sort().join('');
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -287,7 +287,7 @@ function getTypeName(name, prop, shapeName, context) {
|
|
|
287
287
|
|
|
288
288
|
if (type === 'object' || type === 'array') {
|
|
289
289
|
const prefix = `TS${relationshipDepth >= MAX_RELATIONSHIP_DEPTH ? 'Shallow' : ''}Where`;
|
|
290
|
-
const fieldName = `${conflictingProperties !== null && conflictingProperties !== void 0 && conflictingProperties.has(name) ? '_' : ''}${(0, _util.
|
|
290
|
+
const fieldName = `${conflictingProperties !== null && conflictingProperties !== void 0 && conflictingProperties.has(name) ? '_' : ''}${(0, _util.formatShapeName)(name)}`;
|
|
291
291
|
const refItem = (0, _refs.getRefOrItemsRef)(projectSchema, prop);
|
|
292
292
|
const suffix = refItem ? (0, _refs.refItemToShapeName)(refItem) : `${shapeName}${fieldName}`;
|
|
293
293
|
return `${prefix}${suffix}`;
|
package/es/builtin-schema.js
CHANGED
|
@@ -233,9 +233,9 @@ export const builtInShapes = {
|
|
|
233
233
|
required: ['filename', 'path']
|
|
234
234
|
}
|
|
235
235
|
},
|
|
236
|
-
|
|
236
|
+
TSStaticSite: {
|
|
237
237
|
id: 'SITE',
|
|
238
|
-
name: '
|
|
238
|
+
name: 'TSStaticSite',
|
|
239
239
|
title: 'Static Site',
|
|
240
240
|
model: {
|
|
241
241
|
type: 'multiple'
|
|
@@ -316,7 +316,7 @@ export const builtInShapes = {
|
|
|
316
316
|
title: 'Environment Variables',
|
|
317
317
|
'@l10n': false,
|
|
318
318
|
items: {
|
|
319
|
-
$ref: '#/shapes/
|
|
319
|
+
$ref: '#/shapes/TSStaticSiteEnvironmentVariables/schema'
|
|
320
320
|
},
|
|
321
321
|
'@mapping': 'shapedb:TsStaticSite.9fj4UiNxY'
|
|
322
322
|
},
|
|
@@ -325,7 +325,7 @@ export const builtInShapes = {
|
|
|
325
325
|
title: 'Publish Triggers',
|
|
326
326
|
'@l10n': false,
|
|
327
327
|
items: {
|
|
328
|
-
$ref: '#/shapes/
|
|
328
|
+
$ref: '#/shapes/TSStaticSiteTriggers/schema'
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
331
|
templateHash: {
|
|
@@ -338,9 +338,9 @@ export const builtInShapes = {
|
|
|
338
338
|
required: ['title', 'provider', 'destination']
|
|
339
339
|
}
|
|
340
340
|
},
|
|
341
|
-
|
|
341
|
+
TSStaticSiteEnvironmentVariables: {
|
|
342
342
|
id: '9fj4UiNxY',
|
|
343
|
-
name: '
|
|
343
|
+
name: 'TSStaticSiteEnvironmentVariables',
|
|
344
344
|
title: 'Static Site EnvironmentVariables',
|
|
345
345
|
schema: {
|
|
346
346
|
type: 'object',
|
|
@@ -358,9 +358,9 @@ export const builtInShapes = {
|
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
},
|
|
361
|
-
|
|
362
|
-
id: '
|
|
363
|
-
name: '
|
|
361
|
+
TSStaticSiteTriggers: {
|
|
362
|
+
id: 'TSStaticSiteTriggers',
|
|
363
|
+
name: 'TSStaticSiteTriggers',
|
|
364
364
|
title: 'Static Site Triggers',
|
|
365
365
|
schema: {
|
|
366
366
|
type: 'object',
|
|
@@ -421,7 +421,7 @@ export const builtInForms = {
|
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
|
-
|
|
424
|
+
TSStaticSite: {
|
|
425
425
|
default: {
|
|
426
426
|
order: ['title', 'provider', 'destination', 'idKey', 'secretKey', 'environmentVariables'],
|
|
427
427
|
properties: {
|
package/es/schema-util.js
CHANGED
|
@@ -363,7 +363,7 @@ export function applyBuiltinPropertiesToShape(projectSchema, shape) {
|
|
|
363
363
|
};
|
|
364
364
|
} // Dependencies of these built-in shapes are automatically added by getBuiltinsUsed
|
|
365
365
|
|
|
366
|
-
const requiredBuiltinShapes = ['Asset', 'TSRelationship', '
|
|
366
|
+
const requiredBuiltinShapes = ['Asset', 'TSRelationship', 'TSStaticSite', 'TSUser'];
|
|
367
367
|
/**
|
|
368
368
|
* Get all built-in shapes that are depended on by the given project schema.
|
|
369
369
|
* Required built-in shapes are always included.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateVerbs } from './types';
|
|
2
2
|
import { listTypePrefix } from '../migration';
|
|
3
|
-
import { deepClone,
|
|
3
|
+
import { deepClone, formatShapeName, visit } from '@takeshape/util';
|
|
4
4
|
import keyBy from 'lodash/keyBy';
|
|
5
5
|
import { createShape, getShapeDependencies, isCachedShape } from '../schema-util';
|
|
6
6
|
import { getFlattenedTemplateShapeName, getRef, getRefShapeName, refItemToAtRef, refItemToShapeName } from '../refs';
|
|
@@ -79,7 +79,7 @@ export const termsProps = {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
export const
|
|
82
|
+
export const TSContentStructureInput = createShape('TSContentStructureInput', {
|
|
83
83
|
type: 'object',
|
|
84
84
|
properties: {
|
|
85
85
|
path: {
|
|
@@ -152,7 +152,7 @@ const contentStructureFields = {
|
|
|
152
152
|
structure: {
|
|
153
153
|
type: 'array',
|
|
154
154
|
items: {
|
|
155
|
-
'@ref': 'local:
|
|
155
|
+
'@ref': 'local:TSContentStructureInput'
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -186,7 +186,9 @@ export function getIDQueryArgs(templateName) {
|
|
|
186
186
|
|
|
187
187
|
export function getMutationInputShapeName(verb) {
|
|
188
188
|
return shapeName => {
|
|
189
|
-
return
|
|
189
|
+
return formatShapeName([verb, shapeName, 'input'], {
|
|
190
|
+
shapeNameIndex: 1
|
|
191
|
+
});
|
|
190
192
|
};
|
|
191
193
|
}
|
|
192
194
|
/**
|
|
@@ -194,7 +196,11 @@ export function getMutationInputShapeName(verb) {
|
|
|
194
196
|
*/
|
|
195
197
|
|
|
196
198
|
export function getInputShapeName(shapeName) {
|
|
197
|
-
|
|
199
|
+
if (shapeName === 'TSRelationship') {
|
|
200
|
+
return shapeName;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return `${shapeName}Input`;
|
|
198
204
|
}
|
|
199
205
|
export function getOutputShapeName(name) {
|
|
200
206
|
return name.replace(/(?:Input|PartialInput)$/, '');
|
|
@@ -286,7 +292,7 @@ export function getMutationArgs(templateName, verb) {
|
|
|
286
292
|
return createShape(getInputShapeName(shapeName), rewriteRefs(projectSchema, createInputSchema(shape.schema), getInputShapeName));
|
|
287
293
|
}), 'name')),
|
|
288
294
|
...(addStructure ? {
|
|
289
|
-
|
|
295
|
+
TSContentStructureInput
|
|
290
296
|
} : {})
|
|
291
297
|
}
|
|
292
298
|
};
|
|
@@ -294,7 +300,9 @@ export function getMutationArgs(templateName, verb) {
|
|
|
294
300
|
}
|
|
295
301
|
export function getMutationResultType(verb) {
|
|
296
302
|
return (context, shape) => {
|
|
297
|
-
const shapeName =
|
|
303
|
+
const shapeName = formatShapeName([verb, shape.name, 'result'], {
|
|
304
|
+
shapeNameIndex: 1
|
|
305
|
+
});
|
|
298
306
|
const result = verb === TemplateVerbs.Delete ? {
|
|
299
307
|
type: 'boolean'
|
|
300
308
|
} : {
|
|
@@ -3,7 +3,7 @@ import isFunction from 'lodash/isFunction';
|
|
|
3
3
|
import { createSchemaPropertyList, createShape, getAllRefsInShapes, isCachedShape } from '../schema-util';
|
|
4
4
|
import uniqBy from 'lodash/uniqBy';
|
|
5
5
|
import md5 from 'blueimp-md5';
|
|
6
|
-
import { pascalCase, isDefined } from '@takeshape/util';
|
|
6
|
+
import { pascalCase, isDefined, formatShapeName } from '@takeshape/util';
|
|
7
7
|
import { workflowsEnabled } from '../api-version';
|
|
8
8
|
import { followRef, getRef, getRefOrItemsRef, hasRefProperty, hasResolvableRef, refItemToShape, refItemToShapeName } from '../refs';
|
|
9
9
|
import { enumerateOneOfKeys, isUnionSchema } from '../unions';
|
|
@@ -209,7 +209,7 @@ function truncateNames(names) {
|
|
|
209
209
|
function getRelationshipShapeName(refs) {
|
|
210
210
|
return refs.map(ref => {
|
|
211
211
|
const shapeName = ref.split(':')[1];
|
|
212
|
-
return
|
|
212
|
+
return formatShapeName(shapeName);
|
|
213
213
|
}).sort().join('');
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -254,7 +254,7 @@ function getTypeName(name, prop, shapeName, context) {
|
|
|
254
254
|
|
|
255
255
|
if (type === 'object' || type === 'array') {
|
|
256
256
|
const prefix = `TS${relationshipDepth >= MAX_RELATIONSHIP_DEPTH ? 'Shallow' : ''}Where`;
|
|
257
|
-
const fieldName = `${conflictingProperties !== null && conflictingProperties !== void 0 && conflictingProperties.has(name) ? '_' : ''}${
|
|
257
|
+
const fieldName = `${conflictingProperties !== null && conflictingProperties !== void 0 && conflictingProperties.has(name) ? '_' : ''}${formatShapeName(name)}`;
|
|
258
258
|
const refItem = getRefOrItemsRef(projectSchema, prop);
|
|
259
259
|
const suffix = refItem ? refItemToShapeName(refItem) : `${shapeName}${fieldName}`;
|
|
260
260
|
return `${prefix}${suffix}`;
|
|
@@ -7241,7 +7241,7 @@
|
|
|
7241
7241
|
]
|
|
7242
7242
|
}
|
|
7243
7243
|
},
|
|
7244
|
-
"
|
|
7244
|
+
"TSStaticSite": {
|
|
7245
7245
|
"default": {
|
|
7246
7246
|
"order": [
|
|
7247
7247
|
"title",
|
|
@@ -10317,27 +10317,27 @@
|
|
|
10317
10317
|
"shape": "PaginatedList<DismissibleNotification>",
|
|
10318
10318
|
"description": "Returns a list DismissibleNotification in natural order."
|
|
10319
10319
|
},
|
|
10320
|
-
"
|
|
10321
|
-
"args": "TSGetArgs<
|
|
10320
|
+
"getTSStaticSite": {
|
|
10321
|
+
"args": "TSGetArgs<TSStaticSite>",
|
|
10322
10322
|
"resolver": {
|
|
10323
10323
|
"name": "shapedb:get",
|
|
10324
10324
|
"service": "shapedb",
|
|
10325
10325
|
"options": {},
|
|
10326
|
-
"shapeName": "
|
|
10326
|
+
"shapeName": "TSStaticSite"
|
|
10327
10327
|
},
|
|
10328
|
-
"shape": "
|
|
10329
|
-
"description": "Get a
|
|
10328
|
+
"shape": "TSStaticSite",
|
|
10329
|
+
"description": "Get a TSStaticSite by ID"
|
|
10330
10330
|
},
|
|
10331
|
-
"
|
|
10332
|
-
"args": "TSListArgs<
|
|
10331
|
+
"getTSStaticSiteList": {
|
|
10332
|
+
"args": "TSListArgs<TSStaticSite>",
|
|
10333
10333
|
"resolver": {
|
|
10334
10334
|
"name": "shapedb:list",
|
|
10335
10335
|
"service": "shapedb",
|
|
10336
10336
|
"options": {},
|
|
10337
|
-
"shapeName": "
|
|
10337
|
+
"shapeName": "TSStaticSite"
|
|
10338
10338
|
},
|
|
10339
|
-
"shape": "PaginatedList<
|
|
10340
|
-
"description": "Returns a list
|
|
10339
|
+
"shape": "PaginatedList<TSStaticSite>",
|
|
10340
|
+
"description": "Returns a list TSStaticSite in natural order."
|
|
10341
10341
|
},
|
|
10342
10342
|
"getQuickDeposit": {
|
|
10343
10343
|
"args": "TSGetArgs<QuickDeposit>",
|
|
@@ -15699,49 +15699,49 @@
|
|
|
15699
15699
|
"shape": "DeleteResult<DismissibleNotification>",
|
|
15700
15700
|
"description": "Delete DismissibleNotification"
|
|
15701
15701
|
},
|
|
15702
|
-
"
|
|
15703
|
-
"args": "UpdateArgs<
|
|
15702
|
+
"updateTSStaticSite": {
|
|
15703
|
+
"args": "UpdateArgs<TSStaticSite>",
|
|
15704
15704
|
"resolver": {
|
|
15705
15705
|
"name": "shapedb:update",
|
|
15706
15706
|
"service": "shapedb",
|
|
15707
15707
|
"options": {},
|
|
15708
|
-
"shapeName": "
|
|
15708
|
+
"shapeName": "TSStaticSite"
|
|
15709
15709
|
},
|
|
15710
|
-
"shape": "UpdateResult<
|
|
15711
|
-
"description": "Update
|
|
15710
|
+
"shape": "UpdateResult<TSStaticSite>",
|
|
15711
|
+
"description": "Update TSStaticSite"
|
|
15712
15712
|
},
|
|
15713
|
-
"
|
|
15714
|
-
"args": "CreateArgs<
|
|
15713
|
+
"createTSStaticSite": {
|
|
15714
|
+
"args": "CreateArgs<TSStaticSite>",
|
|
15715
15715
|
"resolver": {
|
|
15716
15716
|
"name": "shapedb:create",
|
|
15717
15717
|
"service": "shapedb",
|
|
15718
15718
|
"options": {},
|
|
15719
|
-
"shapeName": "
|
|
15719
|
+
"shapeName": "TSStaticSite"
|
|
15720
15720
|
},
|
|
15721
|
-
"shape": "CreateResult<
|
|
15722
|
-
"description": "Create
|
|
15721
|
+
"shape": "CreateResult<TSStaticSite>",
|
|
15722
|
+
"description": "Create TSStaticSite"
|
|
15723
15723
|
},
|
|
15724
|
-
"
|
|
15725
|
-
"args": "DuplicateArgs<
|
|
15724
|
+
"duplicateTSStaticSite": {
|
|
15725
|
+
"args": "DuplicateArgs<TSStaticSite>",
|
|
15726
15726
|
"resolver": {
|
|
15727
15727
|
"name": "shapedb:duplicate",
|
|
15728
15728
|
"service": "shapedb",
|
|
15729
15729
|
"options": {},
|
|
15730
|
-
"shapeName": "
|
|
15730
|
+
"shapeName": "TSStaticSite"
|
|
15731
15731
|
},
|
|
15732
|
-
"shape": "DuplicateResult<
|
|
15733
|
-
"description": "Duplicate
|
|
15732
|
+
"shape": "DuplicateResult<TSStaticSite>",
|
|
15733
|
+
"description": "Duplicate TSStaticSite"
|
|
15734
15734
|
},
|
|
15735
|
-
"
|
|
15736
|
-
"args": "DeleteArgs<
|
|
15735
|
+
"deleteTSStaticSite": {
|
|
15736
|
+
"args": "DeleteArgs<TSStaticSite>",
|
|
15737
15737
|
"resolver": {
|
|
15738
15738
|
"name": "shapedb:delete",
|
|
15739
15739
|
"service": "shapedb",
|
|
15740
15740
|
"options": {},
|
|
15741
|
-
"shapeName": "
|
|
15741
|
+
"shapeName": "TSStaticSite"
|
|
15742
15742
|
},
|
|
15743
|
-
"shape": "DeleteResult<
|
|
15744
|
-
"description": "Delete
|
|
15743
|
+
"shape": "DeleteResult<TSStaticSite>",
|
|
15744
|
+
"description": "Delete TSStaticSite"
|
|
15745
15745
|
},
|
|
15746
15746
|
"updateQuickDeposit": {
|
|
15747
15747
|
"args": "UpdateArgs<QuickDeposit>",
|
|
@@ -51496,9 +51496,9 @@
|
|
|
51496
51496
|
}
|
|
51497
51497
|
}
|
|
51498
51498
|
},
|
|
51499
|
-
"
|
|
51499
|
+
"TSStaticSite": {
|
|
51500
51500
|
"id": "SITE",
|
|
51501
|
-
"name": "
|
|
51501
|
+
"name": "TSStaticSite",
|
|
51502
51502
|
"title": "Static Site",
|
|
51503
51503
|
"model": {
|
|
51504
51504
|
"type": "multiple"
|
|
@@ -51511,14 +51511,14 @@
|
|
|
51511
51511
|
"title": "Title",
|
|
51512
51512
|
"@l10n": false,
|
|
51513
51513
|
"minLength": 1,
|
|
51514
|
-
"@mapping": "shapedb:
|
|
51514
|
+
"@mapping": "shapedb:TSStaticSite.Ski9jLuXg"
|
|
51515
51515
|
},
|
|
51516
51516
|
"baseUrl": {
|
|
51517
51517
|
"type": "string",
|
|
51518
51518
|
"title": "Base URL",
|
|
51519
51519
|
"@l10n": false,
|
|
51520
51520
|
"minLength": 1,
|
|
51521
|
-
"@mapping": "shapedb:
|
|
51521
|
+
"@mapping": "shapedb:TSStaticSite.Bk3tNmrfE"
|
|
51522
51522
|
},
|
|
51523
51523
|
"provider": {
|
|
51524
51524
|
"type": "string",
|
|
@@ -51563,14 +51563,14 @@
|
|
|
51563
51563
|
"title": "Vercel"
|
|
51564
51564
|
}
|
|
51565
51565
|
],
|
|
51566
|
-
"@mapping": "shapedb:
|
|
51566
|
+
"@mapping": "shapedb:TSStaticSite.SkwbT2hqe"
|
|
51567
51567
|
},
|
|
51568
51568
|
"idKey": {
|
|
51569
51569
|
"type": "string",
|
|
51570
51570
|
"title": "Id Key",
|
|
51571
51571
|
"@l10n": false,
|
|
51572
51572
|
"minLength": 1,
|
|
51573
|
-
"@mapping": "shapedb:
|
|
51573
|
+
"@mapping": "shapedb:TSStaticSite.SyRhi8_me"
|
|
51574
51574
|
},
|
|
51575
51575
|
"secretKey": {
|
|
51576
51576
|
"type": "string",
|
|
@@ -51578,43 +51578,43 @@
|
|
|
51578
51578
|
"@l10n": false,
|
|
51579
51579
|
"@sensitive": true,
|
|
51580
51580
|
"minLength": 1,
|
|
51581
|
-
"@mapping": "shapedb:
|
|
51581
|
+
"@mapping": "shapedb:TSStaticSite.BkIajLdXl"
|
|
51582
51582
|
},
|
|
51583
51583
|
"destination": {
|
|
51584
51584
|
"type": "string",
|
|
51585
51585
|
"title": "Destination",
|
|
51586
51586
|
"@l10n": false,
|
|
51587
51587
|
"minLength": 1,
|
|
51588
|
-
"@mapping": "shapedb:
|
|
51588
|
+
"@mapping": "shapedb:TSStaticSite.Hk6TsIdXl"
|
|
51589
51589
|
},
|
|
51590
51590
|
"privateAcl": {
|
|
51591
51591
|
"type": "boolean",
|
|
51592
51592
|
"title": "Private ACL",
|
|
51593
51593
|
"@l10n": false,
|
|
51594
|
-
"@mapping": "shapedb:
|
|
51594
|
+
"@mapping": "shapedb:TSStaticSite.ByFe48wWU"
|
|
51595
51595
|
},
|
|
51596
51596
|
"environmentVariables": {
|
|
51597
51597
|
"type": "array",
|
|
51598
51598
|
"title": "Environment Variables",
|
|
51599
51599
|
"@l10n": false,
|
|
51600
51600
|
"items": {
|
|
51601
|
-
"$ref": "#/shapes/
|
|
51601
|
+
"$ref": "#/shapes/TSStaticSiteEnvironmentVariables/schema"
|
|
51602
51602
|
},
|
|
51603
|
-
"@mapping": "shapedb:
|
|
51603
|
+
"@mapping": "shapedb:TSStaticSite.9fj4UiNxY"
|
|
51604
51604
|
},
|
|
51605
51605
|
"triggers": {
|
|
51606
51606
|
"type": "array",
|
|
51607
51607
|
"title": "Publish Triggers",
|
|
51608
51608
|
"@l10n": false,
|
|
51609
51609
|
"items": {
|
|
51610
|
-
"$ref": "#/shapes/
|
|
51610
|
+
"$ref": "#/shapes/TSStaticSiteTriggers/schema"
|
|
51611
51611
|
}
|
|
51612
51612
|
},
|
|
51613
51613
|
"templateHash": {
|
|
51614
51614
|
"type": "string",
|
|
51615
51615
|
"title": "Template Hash",
|
|
51616
51616
|
"@l10n": false,
|
|
51617
|
-
"@mapping": "shapedb:
|
|
51617
|
+
"@mapping": "shapedb:TSStaticSite.S1QA3GYI8"
|
|
51618
51618
|
},
|
|
51619
51619
|
"_id": {
|
|
51620
51620
|
"title": "Id",
|
|
@@ -51692,9 +51692,9 @@
|
|
|
51692
51692
|
]
|
|
51693
51693
|
}
|
|
51694
51694
|
},
|
|
51695
|
-
"
|
|
51695
|
+
"TSStaticSiteEnvironmentVariables": {
|
|
51696
51696
|
"id": "9fj4UiNxY",
|
|
51697
|
-
"name": "
|
|
51697
|
+
"name": "TSStaticSiteEnvironmentVariables",
|
|
51698
51698
|
"title": "Static Site EnvironmentVariables",
|
|
51699
51699
|
"schema": {
|
|
51700
51700
|
"type": "object",
|
|
@@ -51702,19 +51702,19 @@
|
|
|
51702
51702
|
"name": {
|
|
51703
51703
|
"type": "string",
|
|
51704
51704
|
"title": "Name",
|
|
51705
|
-
"@mapping": "shapedb:
|
|
51705
|
+
"@mapping": "shapedb:TSStaticSite.J8sbHgfdI"
|
|
51706
51706
|
},
|
|
51707
51707
|
"value": {
|
|
51708
51708
|
"type": "string",
|
|
51709
51709
|
"title": "Value",
|
|
51710
|
-
"@mapping": "shapedb:
|
|
51710
|
+
"@mapping": "shapedb:TSStaticSite.ndhh88DvG"
|
|
51711
51711
|
}
|
|
51712
51712
|
}
|
|
51713
51713
|
}
|
|
51714
51714
|
},
|
|
51715
|
-
"
|
|
51716
|
-
"id": "
|
|
51717
|
-
"name": "
|
|
51715
|
+
"TSStaticSiteTriggers": {
|
|
51716
|
+
"id": "TSStaticSiteTriggers",
|
|
51717
|
+
"name": "TSStaticSiteTriggers",
|
|
51718
51718
|
"title": "Static Site Triggers",
|
|
51719
51719
|
"schema": {
|
|
51720
51720
|
"type": "object",
|