@takeshape/schema 11.70.2 → 11.71.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/__tests__/refs.test.js +62 -1
- package/dist/migration/index.d.ts +1 -0
- package/dist/migration/index.js +3 -1
- package/dist/migration/to/v3.54.0.d.ts +4 -0
- package/dist/migration/to/v3.54.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 +27 -8
- package/dist/project-schema/migrate.js +4 -1
- package/dist/project-schema/v3.54.0.d.ts +2322 -0
- package/dist/project-schema/v3.54.0.js +7 -0
- package/dist/refs.d.ts +10 -0
- package/dist/refs.js +26 -1
- package/dist/resolvers/ai/__tests__/rag-query.test.d.ts +1 -0
- package/dist/resolvers/ai/__tests__/rag-query.test.js +49 -0
- package/dist/resolvers/ai/rag-query.d.ts +49 -0
- package/dist/resolvers/ai/rag-query.js +40 -0
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.js +4 -2
- package/dist/schemas/project-schema/latest.json +38 -2
- package/dist/schemas/project-schema/v3.54.0.json +3512 -0
- package/dist/schemas/project-schema.json +3 -0
- package/dist/util/has-arg.d.ts +3 -2
- package/dist/util/has-arg.js +14 -2
- 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 +4 -39
- 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 +53 -16
- 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/examples/source/rag-example.json +3 -38
- package/package.json +8 -5
package/dist/util/has-arg.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Args, ProjectSchemaJSON } from '../project-schema/index.ts';
|
|
2
|
-
import type
|
|
1
|
+
import type { Args, ObjectSchema, ProjectSchemaJSON } from '../project-schema/index.ts';
|
|
2
|
+
import { type SchemaWithArgs } from '../types/index.ts';
|
|
3
3
|
export declare function getArgs(prop: SchemaWithArgs): Args | undefined;
|
|
4
|
+
export declare function getArgsSchema(projectSchema: ProjectSchemaJSON, args: Args): ObjectSchema | undefined;
|
|
4
5
|
export declare function hasArg(projectSchema: ProjectSchemaJSON, prop: SchemaWithArgs, argPath: string | string[]): boolean;
|
package/dist/util/has-arg.js
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
import { refExpressionToRefItem, refItemToShape } from "../refs.js";
|
|
2
|
+
import { isObjectSchema } from "../types/index.js";
|
|
1
3
|
import { findSchemaAtPath } from "./find-shape-at-path.js";
|
|
2
4
|
export function getArgs(prop) {
|
|
3
5
|
return '@args' in prop ? prop['@args'] : 'args' in prop ? prop.args : undefined;
|
|
4
6
|
}
|
|
7
|
+
export function getArgsSchema(projectSchema, args) {
|
|
8
|
+
if (typeof args === 'object') {
|
|
9
|
+
return args;
|
|
10
|
+
}
|
|
11
|
+
const ref = refExpressionToRefItem(projectSchema, args);
|
|
12
|
+
const shapeSchema = refItemToShape(projectSchema, ref)?.schema;
|
|
13
|
+
if (shapeSchema && isObjectSchema(shapeSchema)) {
|
|
14
|
+
return shapeSchema;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
5
17
|
export function hasArg(projectSchema, prop, argPath) {
|
|
6
18
|
const args = getArgs(prop);
|
|
7
19
|
if (!args) {
|
|
8
20
|
return false;
|
|
9
21
|
}
|
|
10
|
-
const schema =
|
|
22
|
+
const schema = getArgsSchema(projectSchema, args);
|
|
11
23
|
const pathArray = Array.isArray(argPath) ? argPath : argPath.split('.');
|
|
12
|
-
return Boolean(findSchemaAtPath(projectSchema, schema, pathArray));
|
|
24
|
+
return Boolean(schema && findSchemaAtPath(projectSchema, schema, pathArray));
|
|
13
25
|
}
|
|
@@ -52781,6 +52781,6 @@
|
|
|
52781
52781
|
}
|
|
52782
52782
|
}
|
|
52783
52783
|
},
|
|
52784
|
-
"schemaVersion": "3.
|
|
52784
|
+
"schemaVersion": "3.54.0",
|
|
52785
52785
|
"services": {}
|
|
52786
52786
|
}
|
|
@@ -10474,5 +10474,5 @@
|
|
|
10474
10474
|
}
|
|
10475
10475
|
}
|
|
10476
10476
|
},
|
|
10477
|
-
"schemaVersion": "3.
|
|
10477
|
+
"schemaVersion": "3.54.0"
|
|
10478
10478
|
}
|
|
@@ -23446,6 +23446,6 @@
|
|
|
23446
23446
|
}
|
|
23447
23447
|
}
|
|
23448
23448
|
},
|
|
23449
|
-
"schemaVersion": "3.
|
|
23449
|
+
"schemaVersion": "3.54.0",
|
|
23450
23450
|
"services": {}
|
|
23451
23451
|
}
|
|
@@ -35163,6 +35163,6 @@
|
|
|
35163
35163
|
}
|
|
35164
35164
|
}
|
|
35165
35165
|
},
|
|
35166
|
-
"schemaVersion": "3.
|
|
35166
|
+
"schemaVersion": "3.54.0",
|
|
35167
35167
|
"services": {}
|
|
35168
35168
|
}
|
|
@@ -86168,5 +86168,5 @@
|
|
|
86168
86168
|
"shape": "Shopify_WebhookSubscriptionUpdatePayload"
|
|
86169
86169
|
}
|
|
86170
86170
|
},
|
|
86171
|
-
"schemaVersion": "3.
|
|
86171
|
+
"schemaVersion": "3.54.0"
|
|
86172
86172
|
}
|
|
@@ -15937,5 +15937,5 @@
|
|
|
15937
15937
|
"shape": "ShopifyStorefront_CustomerUpdatePayload"
|
|
15938
15938
|
}
|
|
15939
15939
|
},
|
|
15940
|
-
"schemaVersion": "3.
|
|
15940
|
+
"schemaVersion": "3.54.0"
|
|
15941
15941
|
}
|
|
@@ -26892,5 +26892,5 @@
|
|
|
26892
26892
|
"shape": "WP_UpdateUserPayload"
|
|
26893
26893
|
}
|
|
26894
26894
|
},
|
|
26895
|
-
"schemaVersion": "3.
|
|
26895
|
+
"schemaVersion": "3.54.0"
|
|
26896
26896
|
}
|
|
@@ -14766,6 +14766,6 @@
|
|
|
14766
14766
|
}
|
|
14767
14767
|
}
|
|
14768
14768
|
},
|
|
14769
|
-
"schemaVersion": "3.
|
|
14769
|
+
"schemaVersion": "3.54.0",
|
|
14770
14770
|
"services": {}
|
|
14771
14771
|
}
|
|
@@ -8,43 +8,8 @@
|
|
|
8
8
|
"getRelatedProductList": {
|
|
9
9
|
"shape": "PaginatedList<shopify:Product>",
|
|
10
10
|
"resolver": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"name": "ai:createEmbedding",
|
|
14
|
-
"id": "createEmbedding",
|
|
15
|
-
"service": "openai",
|
|
16
|
-
"model": "text-embedding-3-small",
|
|
17
|
-
"args": {
|
|
18
|
-
"ops": [
|
|
19
|
-
{
|
|
20
|
-
"path": "input",
|
|
21
|
-
"mapping": "$args.text"
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"shapeName": "Shopify_Product",
|
|
28
|
-
"name": "takeshape:vectorSearch",
|
|
29
|
-
"service": "takeshape",
|
|
30
|
-
"args": {
|
|
31
|
-
"ops": [
|
|
32
|
-
{
|
|
33
|
-
"path": "vector.name",
|
|
34
|
-
"value": "vector"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"path": "vector.value",
|
|
38
|
-
"mapping": "$resolvers.createEmbedding"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"path": "size",
|
|
42
|
-
"mapping": "$args.size"
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]
|
|
11
|
+
"name": "ai:embeddingSearch",
|
|
12
|
+
"vectorProperty": "shopify:Product.vector"
|
|
48
13
|
},
|
|
49
14
|
"args": {
|
|
50
15
|
"type": "object",
|
|
@@ -179,7 +144,7 @@
|
|
|
179
144
|
}
|
|
180
145
|
},
|
|
181
146
|
{
|
|
182
|
-
"name": "ai:
|
|
147
|
+
"name": "ai:generateText",
|
|
183
148
|
"service": "openai",
|
|
184
149
|
"model": "gpt-3.5-turbo",
|
|
185
150
|
"systemPrompt": "You are a helpful assistant.",
|
|
@@ -314,6 +279,6 @@
|
|
|
314
279
|
}
|
|
315
280
|
}
|
|
316
281
|
},
|
|
317
|
-
"schemaVersion": "3.
|
|
282
|
+
"schemaVersion": "3.54.0",
|
|
318
283
|
"apiVersion": "2"
|
|
319
284
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"projectId": "a8b9ea5b-2522-442d-9b68-be0bef4a1a74",
|
|
3
3
|
"defaultLocale": "en-us",
|
|
4
|
-
"locales": [
|
|
4
|
+
"locales": [
|
|
5
|
+
"en-us"
|
|
6
|
+
],
|
|
5
7
|
"queries": {
|
|
6
8
|
"Rick_characters": {
|
|
7
9
|
"resolver": {
|
|
@@ -12,8 +14,12 @@
|
|
|
12
14
|
"args": {
|
|
13
15
|
"type": "object",
|
|
14
16
|
"properties": {
|
|
15
|
-
"page": {
|
|
16
|
-
|
|
17
|
+
"page": {
|
|
18
|
+
"type": "integer"
|
|
19
|
+
},
|
|
20
|
+
"filter": {
|
|
21
|
+
"@ref": "rick:FilterCharacter"
|
|
22
|
+
}
|
|
17
23
|
}
|
|
18
24
|
},
|
|
19
25
|
"shape": "Rick_Characters"
|
|
@@ -24,7 +30,9 @@
|
|
|
24
30
|
"shapeName": "Rick_Character",
|
|
25
31
|
"name": "takeshape:queryApiIndex",
|
|
26
32
|
"service": "takeshape",
|
|
27
|
-
"options": {
|
|
33
|
+
"options": {
|
|
34
|
+
"indexedShape": "Rick_Character"
|
|
35
|
+
}
|
|
28
36
|
},
|
|
29
37
|
"description": "Fetch Rick_Character data from the API Index.",
|
|
30
38
|
"args": "TSListArgs<Rick_Character>"
|
|
@@ -37,8 +45,15 @@
|
|
|
37
45
|
},
|
|
38
46
|
"args": {
|
|
39
47
|
"type": "object",
|
|
40
|
-
"properties": {
|
|
41
|
-
|
|
48
|
+
"properties": {
|
|
49
|
+
"id": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"@tag": "id"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"required": [
|
|
55
|
+
"id"
|
|
56
|
+
]
|
|
42
57
|
},
|
|
43
58
|
"shape": "Rick_Character"
|
|
44
59
|
}
|
|
@@ -51,16 +66,30 @@
|
|
|
51
66
|
"title": "Rick Character",
|
|
52
67
|
"cache": {
|
|
53
68
|
"enabled": true,
|
|
54
|
-
"triggers": [
|
|
55
|
-
|
|
69
|
+
"triggers": [
|
|
70
|
+
{
|
|
71
|
+
"type": "schedule",
|
|
72
|
+
"loader": "list",
|
|
73
|
+
"interval": 1440
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"fragment": {
|
|
77
|
+
"maxDepth": 2
|
|
78
|
+
}
|
|
56
79
|
},
|
|
57
80
|
"loaders": {
|
|
58
|
-
"list": {
|
|
59
|
-
|
|
81
|
+
"list": {
|
|
82
|
+
"query": "rick:Query.characters"
|
|
83
|
+
},
|
|
84
|
+
"get": {
|
|
85
|
+
"query": "rick:Query.character"
|
|
86
|
+
}
|
|
60
87
|
},
|
|
61
88
|
"schema": {
|
|
62
89
|
"extends": [
|
|
63
|
-
{
|
|
90
|
+
{
|
|
91
|
+
"@ref": "rick:Character"
|
|
92
|
+
},
|
|
64
93
|
{
|
|
65
94
|
"type": "object",
|
|
66
95
|
"properties": {
|
|
@@ -79,12 +108,18 @@
|
|
|
79
108
|
"forms": {
|
|
80
109
|
"Rick_Character": {
|
|
81
110
|
"default": {
|
|
82
|
-
"properties": {
|
|
83
|
-
|
|
111
|
+
"properties": {
|
|
112
|
+
"custom": {
|
|
113
|
+
"widget": "singleLineText"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"order": [
|
|
117
|
+
"custom"
|
|
118
|
+
]
|
|
84
119
|
}
|
|
85
120
|
}
|
|
86
121
|
},
|
|
87
|
-
"schemaVersion": "3.
|
|
122
|
+
"schemaVersion": "3.54.0",
|
|
88
123
|
"apiVersion": "2",
|
|
89
124
|
"services": {
|
|
90
125
|
"rick": {
|
|
@@ -98,7 +133,9 @@
|
|
|
98
133
|
"endpoint": "https://rickandmortyapi.com/graphql",
|
|
99
134
|
"introspectedAt": "2025-04-23T18:13:21.722Z"
|
|
100
135
|
},
|
|
101
|
-
"healthCheck": {
|
|
136
|
+
"healthCheck": {
|
|
137
|
+
"checkName": "graphqlIntrospection"
|
|
138
|
+
}
|
|
102
139
|
}
|
|
103
140
|
}
|
|
104
|
-
}
|
|
141
|
+
}
|
|
@@ -49144,7 +49144,7 @@
|
|
|
49144
49144
|
}
|
|
49145
49145
|
}
|
|
49146
49146
|
},
|
|
49147
|
-
"schemaVersion": "3.
|
|
49147
|
+
"schemaVersion": "3.54.0",
|
|
49148
49148
|
"apiVersion": "2",
|
|
49149
49149
|
"services": {
|
|
49150
49150
|
"shopify": {
|
|
@@ -12297,5 +12297,5 @@
|
|
|
12297
12297
|
}
|
|
12298
12298
|
}
|
|
12299
12299
|
},
|
|
12300
|
-
"schemaVersion": "3.
|
|
12300
|
+
"schemaVersion": "3.54.0"
|
|
12301
12301
|
}
|
|
@@ -28916,5 +28916,5 @@
|
|
|
28916
28916
|
}
|
|
28917
28917
|
}
|
|
28918
28918
|
},
|
|
28919
|
-
"schemaVersion": "3.
|
|
28919
|
+
"schemaVersion": "3.54.0"
|
|
28920
28920
|
}
|