@takeshape/schema 9.38.1 → 9.40.1

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.
Files changed (109) hide show
  1. package/dist/content-schema-transform.d.ts +1 -1
  2. package/dist/content-schema-transform.d.ts.map +1 -1
  3. package/dist/content-schema-transform.js +1 -1
  4. package/dist/migration/index.d.ts +1 -0
  5. package/dist/migration/index.d.ts.map +1 -1
  6. package/dist/migration/index.js +4 -1
  7. package/dist/migration/to/v3.32.0.d.ts +5 -0
  8. package/dist/migration/to/v3.32.0.d.ts.map +1 -0
  9. package/dist/migration/to/v3.32.0.js +107 -0
  10. package/dist/migration/types.d.ts +1 -3
  11. package/dist/migration/types.d.ts.map +1 -1
  12. package/dist/mocks.d.ts +3 -2
  13. package/dist/mocks.d.ts.map +1 -1
  14. package/dist/mocks.js +14 -0
  15. package/dist/project-schema/index.d.ts +4 -1
  16. package/dist/project-schema/index.d.ts.map +1 -1
  17. package/dist/project-schema/index.js +20 -3
  18. package/dist/project-schema/latest.d.ts +79 -88
  19. package/dist/project-schema/latest.d.ts.map +1 -1
  20. package/dist/project-schema/migrate.d.ts.map +1 -1
  21. package/dist/project-schema/migrate.js +4 -0
  22. package/dist/project-schema/v3.31.0.d.ts +1 -1
  23. package/dist/project-schema/v3.31.0.d.ts.map +1 -1
  24. package/dist/project-schema/v3.32.0.d.ts +1440 -0
  25. package/dist/project-schema/v3.32.0.d.ts.map +1 -0
  26. package/dist/project-schema/v3.32.0.js +5 -0
  27. package/dist/refs.d.ts +20 -1
  28. package/dist/refs.d.ts.map +1 -1
  29. package/dist/refs.js +90 -17
  30. package/dist/schema-util.d.ts +12 -10
  31. package/dist/schema-util.d.ts.map +1 -1
  32. package/dist/schema-util.js +31 -23
  33. package/dist/schemas/index.d.ts +2 -2
  34. package/dist/schemas/index.d.ts.map +1 -1
  35. package/dist/schemas/index.js +6 -4
  36. package/dist/schemas/index.ts +4 -2
  37. package/dist/schemas/project-schema/latest.json +59 -67
  38. package/dist/schemas/project-schema/v3.31.0.json +1 -4
  39. package/dist/schemas/project-schema/v3.32.0.json +3081 -0
  40. package/dist/schemas/project-schema.json +3 -0
  41. package/dist/template-shapes/templates.js +1 -1
  42. package/dist/template-shapes/where.js +2 -2
  43. package/dist/types/types.d.ts +6 -4
  44. package/dist/types/types.d.ts.map +1 -1
  45. package/dist/types/utils.d.ts +4 -2
  46. package/dist/types/utils.d.ts.map +1 -1
  47. package/dist/types/utils.js +22 -1
  48. package/dist/util/api-indexing.d.ts +4 -5
  49. package/dist/util/api-indexing.d.ts.map +1 -1
  50. package/dist/util/api-indexing.js +25 -16
  51. package/dist/util/merge.js +1 -1
  52. package/dist/util/patch-schema.d.ts.map +1 -1
  53. package/dist/util/patch-schema.js +1 -1
  54. package/dist/validate.d.ts.map +1 -1
  55. package/dist/validate.js +97 -31
  56. package/es/content-schema-transform.js +1 -1
  57. package/es/migration/index.js +3 -1
  58. package/es/migration/to/v3.32.0.js +98 -0
  59. package/es/mocks.js +12 -0
  60. package/es/project-schema/index.js +3 -1
  61. package/es/project-schema/migrate.js +5 -1
  62. package/es/project-schema/v3.32.0.js +1 -0
  63. package/es/refs.js +78 -17
  64. package/es/schema-util.js +24 -17
  65. package/es/schemas/index.js +4 -3
  66. package/es/schemas/index.ts +4 -2
  67. package/es/schemas/project-schema/latest.json +59 -67
  68. package/es/schemas/project-schema/v3.31.0.json +1 -4
  69. package/es/schemas/project-schema/v3.32.0.json +3081 -0
  70. package/es/schemas/project-schema.json +3 -0
  71. package/es/template-shapes/templates.js +2 -2
  72. package/es/template-shapes/where.js +3 -3
  73. package/es/types/utils.js +15 -0
  74. package/es/util/api-indexing.js +23 -16
  75. package/es/util/merge.js +1 -1
  76. package/es/util/patch-schema.js +1 -1
  77. package/es/validate.js +96 -31
  78. package/examples/latest/betzino.json +1 -1
  79. package/examples/latest/blog-schema.json +1 -1
  80. package/examples/latest/brewery-schema.json +1 -1
  81. package/examples/latest/complex-project-schema.json +1 -1
  82. package/examples/latest/complex-schema.json +1 -1
  83. package/examples/latest/fabric-ecommerce.json +1 -1
  84. package/examples/latest/frank-and-fred-schema.json +1 -1
  85. package/examples/latest/klirr-schema.json +1 -1
  86. package/examples/latest/massive-schema.json +1 -1
  87. package/examples/latest/mill-components-schema.json +1 -1
  88. package/examples/latest/one-earth.json +1 -1
  89. package/examples/latest/pet-oneof-array.json +1 -1
  90. package/examples/latest/post-schema.json +1 -1
  91. package/examples/latest/pruned-shopify-product-schema.json +1 -1
  92. package/examples/latest/real-world-schema.json +1 -1
  93. package/examples/latest/recursive-repeater-schema.json +1 -1
  94. package/examples/latest/recursive-schema.json +1 -1
  95. package/examples/latest/rick-and-morty-ast.json +1 -1
  96. package/examples/latest/rick-and-morty-graphql.json +1 -1
  97. package/examples/latest/rick-and-morty-rest.json +1 -1
  98. package/examples/latest/schema-with-repeater-draftjs.json +1 -1
  99. package/examples/latest/shape-books-v3_2_0.json +1 -1
  100. package/examples/latest/shape-books.json +1 -1
  101. package/examples/latest/shopify-lookbook.json +1 -1
  102. package/examples/latest/shopify-product-2022-07.json +1 -1
  103. package/examples/latest/shopify-product-2023-04.json +1 -1
  104. package/examples/latest/shopify-store-with-widget.json +1 -1
  105. package/examples/latest/stripe-product-runtime-schema.json +22 -23
  106. package/examples/latest/stripe-starter-resolved.json +1 -1
  107. package/examples/latest/user-schema-no-required.json +1 -1
  108. package/examples/latest/user-schema-with-defaults.json +1 -1
  109. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  // This file is generated by "pnpm json2ts"
2
- export const CURRENT_SCHEMA_VERSION = '3.31.0';
2
+ export const CURRENT_SCHEMA_VERSION = '3.32.0';
3
3
  export {default as anyProjectSchema} from './project-schema.json';
4
- export {default as latestSchemaJson} from './project-schema/v3.31.0.json';
4
+ export {default as latestSchemaJson} from './project-schema/v3.32.0.json';
5
5
  import metaSchemaV1_0_0 from './project-schema/meta-schema-v1.0.0.json';
6
6
  import projectSchemaV1_0_0 from './project-schema/v1.0.0.json';
7
7
  import metaSchemaV3_0_0 from './project-schema/meta-schema-v3.0.0.json';
@@ -54,6 +54,7 @@ import projectSchemaV3_28_0 from './project-schema/v3.28.0.json';
54
54
  import projectSchemaV3_29_0 from './project-schema/v3.29.0.json';
55
55
  import projectSchemaV3_30_0 from './project-schema/v3.30.0.json';
56
56
  import projectSchemaV3_31_0 from './project-schema/v3.31.0.json';
57
+ import projectSchemaV3_32_0 from './project-schema/v3.32.0.json';
57
58
  import projectSchemaV4_0_0 from './project-schema/v4.0.0.json';
58
59
  export const allProjectSchemas = [
59
60
  metaSchemaV1_0_0,
@@ -108,5 +109,6 @@ export const allProjectSchemas = [
108
109
  projectSchemaV3_29_0,
109
110
  projectSchemaV3_30_0,
110
111
  projectSchemaV3_31_0,
112
+ projectSchemaV3_32_0,
111
113
  projectSchemaV4_0_0
112
114
  ];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schema.takeshape.io/project-schema/v3.31.0#",
3
+ "$id": "https://schema.takeshape.io/project-schema/v3.32.0#",
4
4
  "title": "Project Schema",
5
5
  "definitions": {
6
6
  "schemaArray": {
@@ -1045,9 +1045,6 @@
1045
1045
  "propertyName": "name"
1046
1046
  },
1047
1047
  "oneOf": [
1048
- {
1049
- "$ref": "#/definitions/utilResolver"
1050
- },
1051
1048
  {
1052
1049
  "$ref": "#/definitions/takeshapeResolver"
1053
1050
  },
@@ -2060,6 +2057,12 @@
2060
2057
  "workflow": {
2061
2058
  "type": "string"
2062
2059
  },
2060
+ "loaders": {
2061
+ "$ref": "#/definitions/shapeLoaders"
2062
+ },
2063
+ "cache": {
2064
+ "$ref": "#/definitions/shapeCacheConfig"
2065
+ },
2063
2066
  "schema": {
2064
2067
  "$ref": "#/definitions/shapeSchema"
2065
2068
  }
@@ -2111,69 +2114,62 @@
2111
2114
  }
2112
2115
  }
2113
2116
  },
2114
- "indexedShapeMap": {
2115
- "title": "Indexed Shape Map",
2116
- "type": "object",
2117
- "patternProperties": {
2118
- "[0-9A-Za-z_-]+": {
2119
- "$ref": "#/definitions/indexedShapeConfig"
2120
- }
2121
- }
2122
- },
2123
- "indexedShapeConfig": {
2124
- "title": "Indexed Shape Config",
2117
+ "shapeCacheConfig": {
2118
+ "title": "ShapeCacheConfig",
2125
2119
  "type": "object",
2126
2120
  "properties": {
2121
+ "enabled": {
2122
+ "type": "boolean"
2123
+ },
2127
2124
  "idField": {
2128
2125
  "type": "string"
2129
2126
  },
2130
2127
  "searchSummaryField": {
2131
2128
  "type": "string"
2132
2129
  },
2133
- "query": {
2134
- "$ref": "#/definitions/indexedShapeQueryConfig"
2135
- },
2136
- "queries": {
2137
- "$ref": "#/definitions/indexedShapeQueriesConfig"
2130
+ "fragment": {
2131
+ "$ref": "#/definitions/cachedFragmentConfig"
2138
2132
  },
2139
2133
  "triggers": {
2140
2134
  "type": "array",
2141
2135
  "items": {
2142
- "$ref": "#/definitions/indexedShapeTriggersConfig"
2136
+ "$ref": "#/definitions/cacheTriggerConfig"
2143
2137
  }
2144
2138
  }
2145
2139
  },
2146
2140
  "additionalProperties": false,
2147
2141
  "required": [
2148
- "queries",
2149
- "triggers"
2142
+ "enabled"
2150
2143
  ]
2151
2144
  },
2152
- "indexedShapeQueriesConfig": {
2153
- "title": "Indexed Shape Queries Config",
2145
+ "shapeLoaders": {
2146
+ "title": "ShapeLoaders",
2154
2147
  "type": "object",
2155
2148
  "properties": {
2156
2149
  "list": {
2157
2150
  "oneOf": [
2158
2151
  {
2159
- "$ref": "#/definitions/storedIndexedShapeListQueryConfig"
2152
+ "$ref": "#/definitions/storedListQueryLoaderConfig"
2160
2153
  },
2161
2154
  {
2162
2155
  "type": "array",
2163
2156
  "items": {
2164
- "$ref": "#/definitions/storedIndexedShapeListQueryConfig"
2157
+ "$ref": "#/definitions/storedListQueryLoaderConfig"
2165
2158
  }
2166
2159
  }
2167
2160
  ]
2168
2161
  },
2169
2162
  "get": {
2170
- "$ref": "#/definitions/indexedShapeGetQueryConfig"
2163
+ "$ref": "#/definitions/getQueryLoaderConfig"
2171
2164
  }
2172
2165
  },
2173
- "additionalProperties": false
2166
+ "additionalProperties": false,
2167
+ "required": [
2168
+ "list"
2169
+ ]
2174
2170
  },
2175
- "indexedShapeQueryConfig": {
2176
- "title": "Indexed Shape Query Config",
2171
+ "cachedFragmentConfig": {
2172
+ "title": "Cached Fragment Config",
2177
2173
  "type": "object",
2178
2174
  "properties": {
2179
2175
  "ignoreFields": {
@@ -2191,11 +2187,11 @@
2191
2187
  },
2192
2188
  "additionalProperties": false
2193
2189
  },
2194
- "indexedShapeListQueryConfig": {
2195
- "title": "Indexed Shape List Query Config",
2190
+ "listQueryLoaderConfig": {
2191
+ "title": "ListQueryLoaderConfig",
2196
2192
  "type": "object",
2197
2193
  "properties": {
2198
- "name": {
2194
+ "query": {
2199
2195
  "type": "string"
2200
2196
  },
2201
2197
  "args": {
@@ -2208,14 +2204,14 @@
2208
2204
  },
2209
2205
  "additionalProperties": false,
2210
2206
  "required": [
2211
- "name"
2207
+ "query"
2212
2208
  ]
2213
2209
  },
2214
- "storedIndexedShapeListQueryConfig": {
2215
- "title": "Stored Indexed Shape List Query Config",
2210
+ "storedListQueryLoaderConfig": {
2211
+ "title": "StoredListQueryLoaderConfig",
2216
2212
  "type": "object",
2217
2213
  "properties": {
2218
- "name": {
2214
+ "query": {
2219
2215
  "type": "string"
2220
2216
  },
2221
2217
  "args": {
@@ -2239,14 +2235,14 @@
2239
2235
  },
2240
2236
  "additionalProperties": false,
2241
2237
  "required": [
2242
- "name"
2238
+ "query"
2243
2239
  ]
2244
2240
  },
2245
- "indexedShapeGetQueryConfig": {
2246
- "title": "Indexed Shape Get Query Config",
2241
+ "getQueryLoaderConfig": {
2242
+ "title": "GetQueryLoaderConfig",
2247
2243
  "type": "object",
2248
2244
  "properties": {
2249
- "name": {
2245
+ "query": {
2250
2246
  "type": "string"
2251
2247
  },
2252
2248
  "args": {
@@ -2259,7 +2255,7 @@
2259
2255
  },
2260
2256
  "additionalProperties": false,
2261
2257
  "required": [
2262
- "name"
2258
+ "query"
2263
2259
  ]
2264
2260
  },
2265
2261
  "paginationConfig": {
@@ -2301,7 +2297,7 @@
2301
2297
  "hasMorePath": {
2302
2298
  "type": "string"
2303
2299
  },
2304
- "itemsToIndexPath": {
2300
+ "itemsPath": {
2305
2301
  "type": "string"
2306
2302
  }
2307
2303
  },
@@ -2312,7 +2308,7 @@
2312
2308
  "cursorPath",
2313
2309
  "pageSizeArg",
2314
2310
  "hasMorePath",
2315
- "itemsToIndexPath"
2311
+ "itemsPath"
2316
2312
  ]
2317
2313
  },
2318
2314
  "paginationPageConfig": {
@@ -2334,7 +2330,7 @@
2334
2330
  "pageSizeArg": {
2335
2331
  "type": "string"
2336
2332
  },
2337
- "itemsToIndexPath": {
2333
+ "itemsPath": {
2338
2334
  "type": "string"
2339
2335
  },
2340
2336
  "pageTotalPath": {
@@ -2345,7 +2341,7 @@
2345
2341
  "required": [
2346
2342
  "type",
2347
2343
  "pageArg",
2348
- "itemsToIndexPath",
2344
+ "itemsPath",
2349
2345
  "pageTotalPath"
2350
2346
  ]
2351
2347
  },
@@ -2368,7 +2364,7 @@
2368
2364
  "pageSizeArg": {
2369
2365
  "type": "string"
2370
2366
  },
2371
- "itemsToIndexPath": {
2367
+ "itemsPath": {
2372
2368
  "type": "string"
2373
2369
  },
2374
2370
  "itemTotalPath": {
@@ -2379,23 +2375,23 @@
2379
2375
  "required": [
2380
2376
  "type",
2381
2377
  "offsetArg",
2382
- "itemsToIndexPath",
2378
+ "itemsPath",
2383
2379
  "itemTotalPath"
2384
2380
  ]
2385
2381
  },
2386
- "indexedShapeTriggersConfig": {
2387
- "title": "Indexed Shape Triggers Config",
2382
+ "cacheTriggerConfig": {
2383
+ "title": "CacheTriggerConfig",
2388
2384
  "oneOf": [
2389
2385
  {
2390
- "$ref": "#/definitions/indexedShapeScheduleTriggerConfig"
2386
+ "$ref": "#/definitions/cacheScheduleTriggerConfig"
2391
2387
  },
2392
2388
  {
2393
- "$ref": "#/definitions/indexedShapeWebhookTriggerConfig"
2389
+ "$ref": "#/definitions/cacheWebhookTriggerConfig"
2394
2390
  }
2395
2391
  ]
2396
2392
  },
2397
- "indexedShapeScheduleTriggerConfig": {
2398
- "title": "Indexed Shape Schedule Trigger Config",
2393
+ "cacheScheduleTriggerConfig": {
2394
+ "title": "CacheScheduleTriggerConfig",
2399
2395
  "type": "object",
2400
2396
  "properties": {
2401
2397
  "type": {
@@ -2404,7 +2400,7 @@
2404
2400
  "schedule"
2405
2401
  ]
2406
2402
  },
2407
- "query": {
2403
+ "loader": {
2408
2404
  "enum": [
2409
2405
  "get",
2410
2406
  "list"
@@ -2417,12 +2413,12 @@
2417
2413
  "additionalProperties": false,
2418
2414
  "required": [
2419
2415
  "type",
2420
- "query",
2416
+ "loader",
2421
2417
  "interval"
2422
2418
  ]
2423
2419
  },
2424
- "indexedShapeWebhookTriggerConfig": {
2425
- "title": "Indexed Shape Webhook Trigger Config",
2420
+ "cacheWebhookTriggerConfig": {
2421
+ "title": "CacheWebhookTriggerConfig",
2426
2422
  "type": "object",
2427
2423
  "properties": {
2428
2424
  "type": {
@@ -2431,7 +2427,7 @@
2431
2427
  "webhook"
2432
2428
  ]
2433
2429
  },
2434
- "query": {
2430
+ "loader": {
2435
2431
  "enum": [
2436
2432
  "get",
2437
2433
  "list"
@@ -2450,7 +2446,7 @@
2450
2446
  "additionalProperties": false,
2451
2447
  "required": [
2452
2448
  "type",
2453
- "query",
2449
+ "loader",
2454
2450
  "service",
2455
2451
  "events"
2456
2452
  ]
@@ -3015,7 +3011,7 @@
3015
3011
  "schemaVersion": {
3016
3012
  "type": "string",
3017
3013
  "enum": [
3018
- "3.31.0"
3014
+ "3.32.0"
3019
3015
  ],
3020
3016
  "description": "The version of the schema format your project is using. We increase the version as we make breaking changes to the schema format."
3021
3017
  },
@@ -3057,10 +3053,6 @@
3057
3053
  "$ref": "#/definitions/shapeMap",
3058
3054
  "description": "A Shape is a schema object for structuring and storing data from one or more sources, including the TakeShape data store and connected services."
3059
3055
  },
3060
- "indexedShapes": {
3061
- "$ref": "#/definitions/indexedShapeMap",
3062
- "description": "Experimental shape indexing configuration if you are curious about learning more message @asprouse in the TakeShape Slack"
3063
- },
3064
3056
  "forms": {
3065
3057
  "$ref": "#/definitions/formMap",
3066
3058
  "description": "Forms define a visual interface for editing Shapes in the TakeShape UI."
@@ -3086,4 +3078,4 @@
3086
3078
  "mutations",
3087
3079
  "workflows"
3088
3080
  ]
3089
- }
3081
+ }
@@ -1045,9 +1045,6 @@
1045
1045
  "propertyName": "name"
1046
1046
  },
1047
1047
  "oneOf": [
1048
- {
1049
- "$ref": "#/definitions/utilResolver"
1050
- },
1051
1048
  {
1052
1049
  "$ref": "#/definitions/takeshapeResolver"
1053
1050
  },
@@ -3086,4 +3083,4 @@
3086
3083
  "mutations",
3087
3084
  "workflows"
3088
3085
  ]
3089
- }
3086
+ }