@takeshape/schema 11.87.0 → 11.88.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 +29 -68
- package/dist/create-input-schema.js +13 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/migration/index.d.ts +1 -0
- package/dist/migration/index.js +3 -1
- package/dist/migration/to/v3.55.0.d.ts +4 -0
- package/dist/migration/to/v3.55.0.js +10 -0
- package/dist/project-schema/index.d.ts +4 -1
- package/dist/project-schema/index.js +2 -1
- package/dist/project-schema/latest.d.ts +2 -2
- package/dist/project-schema/migrate.js +4 -1
- package/dist/project-schema/v3.55.0.d.ts +2344 -0
- package/dist/project-schema/v3.55.0.js +7 -0
- package/dist/refs.js +12 -6
- package/dist/resolvers/takeshape/assets/asset-image-meta.d.ts +77 -0
- package/dist/resolvers/takeshape/assets/asset-image-meta.js +95 -0
- package/dist/resolvers/takeshape/assets/asset-image-params.d.ts +899 -0
- package/dist/resolvers/takeshape/assets/asset-image-params.js +723 -0
- package/dist/resolvers/takeshape/assets/asset-image.d.ts +15 -0
- package/dist/resolvers/takeshape/assets/asset-image.js +12 -0
- package/dist/resolvers/takeshape/assets/asset.d.ts +123 -0
- package/dist/resolvers/takeshape/assets/asset.js +105 -0
- package/dist/resolvers/takeshape/assets/constants.d.ts +11 -0
- package/dist/resolvers/takeshape/assets/constants.js +11 -0
- package/dist/runtime-schema.js +2 -1
- package/dist/schema-util.js +9 -2
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.js +4 -2
- package/dist/schemas/project-schema/latest.json +6 -3
- package/dist/schemas/project-schema/v3.55.0.json +3515 -0
- package/dist/schemas/project-schema.json +3 -0
- package/examples/latest/agent-schema.json +1 -1
- package/examples/latest/all-fields-shapes-inline.json +1 -1
- package/examples/latest/all-fields-shapes.json +1 -1
- package/examples/latest/betzino.json +1 -1
- package/examples/latest/blog-schema.json +1 -1
- package/examples/latest/brewery-schema.json +1 -1
- package/examples/latest/clear-cache-schema.json +1 -1
- package/examples/latest/complex-project-schema.json +1 -1
- package/examples/latest/complex-schema.json +1 -1
- package/examples/latest/edit-schema.json +1 -1
- package/examples/latest/fabric-ecommerce.json +1 -1
- package/examples/latest/frank-and-fred-schema.json +1 -1
- package/examples/latest/klirr-schema.json +1 -1
- package/examples/latest/layers/rick-and-morty-layer.json +1 -1
- package/examples/latest/layers/shopify-layer-2023-01.json +1 -1
- package/examples/latest/layers/shopify-storefront-2023-04.json +1 -1
- package/examples/latest/layers/wordpress-2024-01.json +1 -1
- package/examples/latest/massive-schema.json +1 -1
- package/examples/latest/mill-components-schema.json +1 -1
- package/examples/latest/nested-shape-arrays.json +1 -1
- package/examples/latest/one-earth.json +1 -1
- package/examples/latest/pet-oneof-array.json +1 -1
- package/examples/latest/post-schema.json +1 -1
- package/examples/latest/pruned-shopify-product-schema.json +1 -1
- package/examples/latest/rag-example.json +1 -1
- package/examples/latest/real-world-schema.json +1 -1
- package/examples/latest/recursive-repeater-schema.json +1 -1
- package/examples/latest/recursive-schema.json +1 -1
- package/examples/latest/rick-and-morty-ast.json +1 -1
- package/examples/latest/rick-and-morty-graphql.json +1 -1
- package/examples/latest/rick-and-morty-rest.json +1 -1
- package/examples/latest/rick-and-morty-user-schema.json +1 -1
- package/examples/latest/rick-and-morty-with-indexing.json +1 -1
- package/examples/latest/schema-where-filter.json +1 -1
- package/examples/latest/schema-with-repeater-draftjs.json +1 -1
- package/examples/latest/schema-with-rick-and-morty.json +1 -1
- package/examples/latest/shape-books-v3_2_0.json +1 -1
- package/examples/latest/shape-books.json +1 -1
- package/examples/latest/shape-editor-schema-edited.json +1 -1
- package/examples/latest/shape-editor-schema-initial.json +1 -1
- package/examples/latest/shapedb-crud-every-prop-type.json +1 -1
- package/examples/latest/shopify-lookbook.json +1 -1
- package/examples/latest/shopify-product-2022-07.json +1 -1
- package/examples/latest/shopify-product-2023-04.json +1 -1
- package/examples/latest/shopify-store-with-widget.json +1 -1
- package/examples/latest/stripe-product-runtime-schema.json +1 -1
- package/examples/latest/stripe-starter-resolved.json +1 -1
- package/examples/latest/user-schema-no-required.json +1 -1
- package/examples/latest/user-schema-with-defaults.json +1 -1
- package/examples/latest/valvoline-ai-demo.json +1 -1
- package/examples/latest/vector-search-schema.json +1 -1
- package/package.json +5 -5
package/dist/refs.js
CHANGED
|
@@ -555,12 +555,18 @@ export function getAllPropertyRefs(projectSchema) {
|
|
|
555
555
|
if (propName === 'to' && isString(value) && parentIsResolver(path, 'delegate')) {
|
|
556
556
|
pushRef(value);
|
|
557
557
|
}
|
|
558
|
-
else if (propName === 'tools'
|
|
559
|
-
Array.isArray(value) &&
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
558
|
+
else if (propName === 'tools') {
|
|
559
|
+
if (Array.isArray(value) &&
|
|
560
|
+
(parentIsGenerateState(path) || parentIsResolver(path, ['ai:generateText', 'ai:chat']))) {
|
|
561
|
+
const tools = value;
|
|
562
|
+
for (const tool of tools) {
|
|
563
|
+
pushRef(getToolRef(tool));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
else if (isRecord(value) && path[0] === 'ai-experimental') {
|
|
567
|
+
for (const tool of Object.values(value)) {
|
|
568
|
+
pushRef(tool.ref);
|
|
569
|
+
}
|
|
564
570
|
}
|
|
565
571
|
}
|
|
566
572
|
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
export declare const imgixImageMeta: {
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly PixelWidth: {
|
|
6
|
+
readonly type: "integer";
|
|
7
|
+
};
|
|
8
|
+
readonly PixelHeight: {
|
|
9
|
+
readonly type: "integer";
|
|
10
|
+
};
|
|
11
|
+
readonly DPIWidth: {
|
|
12
|
+
readonly type: "integer";
|
|
13
|
+
};
|
|
14
|
+
readonly DPIHeight: {
|
|
15
|
+
readonly type: "integer";
|
|
16
|
+
};
|
|
17
|
+
readonly ProfileName: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
};
|
|
20
|
+
readonly 'Content-Type': {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
};
|
|
23
|
+
readonly 'Content-Length': {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly required: ["PixelHeight", "PixelWidth", "Content-Type", "Content-Length"];
|
|
28
|
+
};
|
|
29
|
+
export type ImgixImageMeta = FromSchema<typeof imgixImageMeta>;
|
|
30
|
+
export declare const validateImgixImageMeta: import("ajv").ValidateFunction<{
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
DPIWidth?: number | undefined;
|
|
33
|
+
DPIHeight?: number | undefined;
|
|
34
|
+
ProfileName?: string | undefined;
|
|
35
|
+
PixelWidth: number;
|
|
36
|
+
PixelHeight: number;
|
|
37
|
+
"Content-Type": string;
|
|
38
|
+
"Content-Length": string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const schema: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly properties: {
|
|
43
|
+
readonly pixelHeight: {
|
|
44
|
+
readonly type: "integer";
|
|
45
|
+
};
|
|
46
|
+
readonly pixelWidth: {
|
|
47
|
+
readonly type: "integer";
|
|
48
|
+
};
|
|
49
|
+
readonly dpiHeight: {
|
|
50
|
+
readonly type: "integer";
|
|
51
|
+
};
|
|
52
|
+
readonly dpiWidth: {
|
|
53
|
+
readonly type: "integer";
|
|
54
|
+
};
|
|
55
|
+
readonly profileName: {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
};
|
|
58
|
+
readonly contentType: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
};
|
|
61
|
+
readonly contentLength: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly required: ["pixelHeight", "pixelWidth", "contentType", "contentLength"];
|
|
66
|
+
readonly additionalProperties: false;
|
|
67
|
+
};
|
|
68
|
+
export type AssetImageMeta = FromSchema<typeof schema>;
|
|
69
|
+
export declare const validate: import("ajv").ValidateFunction<{
|
|
70
|
+
dpiHeight?: number | undefined;
|
|
71
|
+
dpiWidth?: number | undefined;
|
|
72
|
+
profileName?: string | undefined;
|
|
73
|
+
pixelHeight: number;
|
|
74
|
+
pixelWidth: number;
|
|
75
|
+
contentType: string;
|
|
76
|
+
contentLength: string;
|
|
77
|
+
}>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createTypedValidator } from '@takeshape/json-schema';
|
|
2
|
+
// Example imgix metadata
|
|
3
|
+
// {
|
|
4
|
+
// Orientation: 0,
|
|
5
|
+
// TransparentPercentage: 0,
|
|
6
|
+
// Output: {},
|
|
7
|
+
// DPIWidth: 96,
|
|
8
|
+
// 'Content-Length': '244871',
|
|
9
|
+
// 'Content-Type': 'image/jpeg',
|
|
10
|
+
// PixelHeight: 1024,
|
|
11
|
+
// PixelWidth: 1024,
|
|
12
|
+
// ProfileName: 'sRGB IEC61966-2.1',
|
|
13
|
+
// DPIHeight: 96
|
|
14
|
+
// }
|
|
15
|
+
//
|
|
16
|
+
// {
|
|
17
|
+
// Exif: { PixelXDimension: 640, PixelYDimension: 640, ColorSpace: 1 },
|
|
18
|
+
// Orientation: 1,
|
|
19
|
+
// 'Content-Type': 'image/png',
|
|
20
|
+
// TransparentPercentage: 0,
|
|
21
|
+
// Output: {},
|
|
22
|
+
// DPIWidth: 72,
|
|
23
|
+
// 'Content-Length': '687902',
|
|
24
|
+
// PixelWidth: 640,
|
|
25
|
+
// TIFF: {
|
|
26
|
+
// ResolutionUnit: 2,
|
|
27
|
+
// Orientation: 1,
|
|
28
|
+
// XResolution: 72,
|
|
29
|
+
// ExifTag: 90,
|
|
30
|
+
// YResolution: 72
|
|
31
|
+
// },
|
|
32
|
+
// GPS: {},
|
|
33
|
+
// PixelHeight: 640,
|
|
34
|
+
// XMP: { Orientation: '1' },
|
|
35
|
+
// DPIHeight: 72,
|
|
36
|
+
// ProfileName: 'sRGB IEC61966-2.1'
|
|
37
|
+
// }
|
|
38
|
+
export const imgixImageMeta = {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
PixelWidth: {
|
|
42
|
+
type: 'integer'
|
|
43
|
+
},
|
|
44
|
+
PixelHeight: {
|
|
45
|
+
type: 'integer'
|
|
46
|
+
},
|
|
47
|
+
DPIWidth: {
|
|
48
|
+
type: 'integer'
|
|
49
|
+
},
|
|
50
|
+
DPIHeight: {
|
|
51
|
+
type: 'integer'
|
|
52
|
+
},
|
|
53
|
+
ProfileName: {
|
|
54
|
+
type: 'string'
|
|
55
|
+
},
|
|
56
|
+
'Content-Type': {
|
|
57
|
+
type: 'string'
|
|
58
|
+
},
|
|
59
|
+
'Content-Length': {
|
|
60
|
+
type: 'string'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
required: ['PixelHeight', 'PixelWidth', 'Content-Type', 'Content-Length']
|
|
64
|
+
};
|
|
65
|
+
export const validateImgixImageMeta = createTypedValidator(imgixImageMeta);
|
|
66
|
+
export const schema = {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
pixelHeight: {
|
|
70
|
+
type: 'integer'
|
|
71
|
+
},
|
|
72
|
+
pixelWidth: {
|
|
73
|
+
type: 'integer'
|
|
74
|
+
},
|
|
75
|
+
dpiHeight: {
|
|
76
|
+
type: 'integer'
|
|
77
|
+
},
|
|
78
|
+
dpiWidth: {
|
|
79
|
+
type: 'integer'
|
|
80
|
+
},
|
|
81
|
+
profileName: {
|
|
82
|
+
type: 'string'
|
|
83
|
+
},
|
|
84
|
+
contentType: {
|
|
85
|
+
type: 'string'
|
|
86
|
+
},
|
|
87
|
+
contentLength: {
|
|
88
|
+
type: 'string'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
// These should be available on every image
|
|
92
|
+
required: ['pixelHeight', 'pixelWidth', 'contentType', 'contentLength'],
|
|
93
|
+
additionalProperties: false
|
|
94
|
+
};
|
|
95
|
+
export const validate = createTypedValidator(schema);
|