@takeshape/schema 9.70.0 → 9.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.
Files changed (73) hide show
  1. package/dist/migration/index.d.ts +1 -0
  2. package/dist/migration/index.d.ts.map +1 -1
  3. package/dist/migration/index.js +4 -1
  4. package/dist/migration/to/v3.39.0.d.ts +5 -0
  5. package/dist/migration/to/v3.39.0.d.ts.map +1 -0
  6. package/dist/migration/to/v3.39.0.js +62 -0
  7. package/dist/project-schema/index.d.ts +4 -1
  8. package/dist/project-schema/index.d.ts.map +1 -1
  9. package/dist/project-schema/index.js +20 -3
  10. package/dist/project-schema/latest.d.ts +9 -3
  11. package/dist/project-schema/latest.d.ts.map +1 -1
  12. package/dist/project-schema/migrate.d.ts.map +1 -1
  13. package/dist/project-schema/migrate.js +4 -0
  14. package/dist/project-schema/v3.39.0.d.ts +1530 -0
  15. package/dist/project-schema/v3.39.0.d.ts.map +1 -0
  16. package/dist/project-schema/v3.39.0.js +5 -0
  17. package/dist/schemas/index.d.ts +2 -2
  18. package/dist/schemas/index.d.ts.map +1 -1
  19. package/dist/schemas/index.js +6 -4
  20. package/dist/schemas/index.ts +4 -2
  21. package/dist/schemas/project-schema/latest.json +11 -3
  22. package/dist/schemas/project-schema/v3.38.0.json +1 -1
  23. package/dist/schemas/project-schema/v3.39.0.json +3218 -0
  24. package/dist/schemas/project-schema.json +3 -0
  25. package/dist/validate.js +1 -1
  26. package/es/migration/index.js +3 -1
  27. package/es/migration/to/v3.39.0.js +54 -0
  28. package/es/project-schema/index.js +3 -1
  29. package/es/project-schema/migrate.js +5 -1
  30. package/es/project-schema/v3.39.0.js +1 -0
  31. package/es/schemas/index.js +4 -3
  32. package/es/schemas/index.ts +4 -2
  33. package/es/schemas/project-schema/latest.json +11 -3
  34. package/es/schemas/project-schema/v3.38.0.json +1 -1
  35. package/es/schemas/project-schema/v3.39.0.json +3218 -0
  36. package/es/schemas/project-schema.json +3 -0
  37. package/es/validate.js +1 -1
  38. package/examples/latest/betzino.json +1 -1
  39. package/examples/latest/blog-schema.json +1 -1
  40. package/examples/latest/brewery-schema.json +1 -1
  41. package/examples/latest/complex-project-schema.json +1 -1
  42. package/examples/latest/complex-schema.json +1 -1
  43. package/examples/latest/edit-schema.json +1 -1
  44. package/examples/latest/fabric-ecommerce.json +1 -1
  45. package/examples/latest/frank-and-fred-schema.json +1 -1
  46. package/examples/latest/klirr-schema.json +1 -1
  47. package/examples/latest/massive-schema.json +1 -1
  48. package/examples/latest/mill-components-schema.json +1 -1
  49. package/examples/latest/nested-shape-arrays.json +66 -20
  50. package/examples/latest/one-earth.json +1 -1
  51. package/examples/latest/pet-oneof-array.json +1 -1
  52. package/examples/latest/post-schema.json +1 -1
  53. package/examples/latest/pruned-shopify-product-schema.json +1 -1
  54. package/examples/latest/real-world-schema.json +1 -1
  55. package/examples/latest/recursive-repeater-schema.json +1 -1
  56. package/examples/latest/recursive-schema.json +1 -1
  57. package/examples/latest/rick-and-morty-ast.json +1 -1
  58. package/examples/latest/rick-and-morty-graphql.json +1 -1
  59. package/examples/latest/rick-and-morty-rest.json +1 -1
  60. package/examples/latest/schema-with-repeater-draftjs.json +1 -1
  61. package/examples/latest/shape-books-v3_2_0.json +1 -1
  62. package/examples/latest/shape-books.json +1 -1
  63. package/examples/latest/shape-editor-schema-edited.json +1 -1
  64. package/examples/latest/shape-editor-schema-initial.json +1 -1
  65. package/examples/latest/shopify-lookbook.json +1 -1
  66. package/examples/latest/shopify-product-2022-07.json +1 -1
  67. package/examples/latest/shopify-product-2023-04.json +1 -1
  68. package/examples/latest/shopify-store-with-widget.json +1 -1
  69. package/examples/latest/stripe-product-runtime-schema.json +1 -1
  70. package/examples/latest/stripe-starter-resolved.json +1 -1
  71. package/examples/latest/user-schema-no-required.json +1 -1
  72. package/examples/latest/user-schema-with-defaults.json +1 -1
  73. package/package.json +5 -5
@@ -144,6 +144,9 @@
144
144
  {
145
145
  "$ref": "https://schema.takeshape.io/project-schema/v3.38.0#"
146
146
  },
147
+ {
148
+ "$ref": "https://schema.takeshape.io/project-schema/v3.39.0#"
149
+ },
147
150
  {
148
151
  "$ref": "https://schema.takeshape.io/project-schema/v4.0.0#"
149
152
  }
package/dist/validate.js CHANGED
@@ -189,7 +189,7 @@ function enumerateBasicResolvers(resolver, path) {
189
189
  const visit = (resolver, path) => {
190
190
  if ((0, _utils.isComposeResolver)(resolver)) {
191
191
  resolver.compose.forEach((resolver, i) => {
192
- visit(resolver, [...path, i]);
192
+ visit(resolver, [...path, 'compose', i]);
193
193
  });
194
194
  } else {
195
195
  results.push([resolver, path]);
@@ -44,6 +44,7 @@ import migrateToV3_35_0 from './to/v3.35.0';
44
44
  import migrateToV3_36_0 from './to/v3.36.0';
45
45
  import migrateToV3_37_0 from './to/v3.37.0';
46
46
  import migrateToV3_38_0 from './to/v3.38.0';
47
+ import migrateToV3_39_0 from './to/v3.39.0';
47
48
  export const migrateTo = {
48
49
  'v3.0.0': migrateToV3_0_0,
49
50
  'v3.1.0': migrateToV3_1_0,
@@ -90,7 +91,8 @@ export const migrateTo = {
90
91
  'v3.35.0': migrateToV3_35_0,
91
92
  'v3.36.0': migrateToV3_36_0,
92
93
  'v3.37.0': migrateToV3_37_0,
93
- 'v3.38.0': migrateToV3_38_0
94
+ 'v3.38.0': migrateToV3_38_0,
95
+ 'v3.39.0': migrateToV3_39_0
94
96
  };
95
97
  export * from './utils';
96
98
  export const listTypePrefix = 'PaginatedList';
@@ -0,0 +1,54 @@
1
+ import { isSearchParamsAuthentication, isServiceAuthentication } from '../../types';
2
+
3
+ const migrate = async ({
4
+ decryptFn,
5
+ encryptFn
6
+ }, projectSchema) => {
7
+ /**
8
+ * Move unencrypted searchParams out of the authentication object.
9
+ */
10
+ Object.values(projectSchema.services ?? {}).forEach(serviceConfig => {
11
+ if (serviceConfig.authentication) {
12
+ const authentication = decryptFn(serviceConfig.authentication);
13
+
14
+ if (isServiceAuthentication(authentication) && isSearchParamsAuthentication(authentication)) {
15
+ if (serviceConfig.provider === 'judgeMe') {
16
+ const shopDomain = authentication.params.find(param => param.name === 'shop_domain');
17
+
18
+ if (shopDomain) {
19
+ serviceConfig.options = { ...serviceConfig.options,
20
+ searchParams: {
21
+ shop_domain: shopDomain.value
22
+ }
23
+ };
24
+ delete serviceConfig.options.shopDomain;
25
+ }
26
+
27
+ authentication.params = authentication.params.filter(param => param.name !== 'shop_domain');
28
+ }
29
+
30
+ if (serviceConfig.provider === 'reviewsIo') {
31
+ const storeId = authentication.params.find(param => param.name === 'store');
32
+
33
+ if (storeId) {
34
+ serviceConfig.options = { ...serviceConfig.options,
35
+ searchParams: {
36
+ store: storeId.value
37
+ }
38
+ };
39
+ delete serviceConfig.options.storeId;
40
+ }
41
+
42
+ authentication.params = authentication.params.filter(param => param.name !== 'store');
43
+ }
44
+
45
+ serviceConfig.authentication = encryptFn(authentication);
46
+ }
47
+ }
48
+ });
49
+ return { ...projectSchema,
50
+ schemaVersion: '3.39.0'
51
+ };
52
+ };
53
+
54
+ export default migrate;
@@ -47,6 +47,7 @@ export * from './v3.35.0';
47
47
  export * from './v3.36.0';
48
48
  export * from './v3.37.0';
49
49
  export * from './v3.38.0';
50
+ export * from './v3.39.0';
50
51
  export * from './v4.0.0';
51
52
 
52
53
  // Schema type utilities
@@ -115,5 +116,6 @@ export const isProjectSchemaJSONV3_35_0 = createVersionPredicate('3.35.0');
115
116
  export const isProjectSchemaJSONV3_36_0 = createVersionPredicate('3.36.0');
116
117
  export const isProjectSchemaJSONV3_37_0 = createVersionPredicate('3.37.0');
117
118
  export const isProjectSchemaJSONV3_38_0 = createVersionPredicate('3.38.0');
118
- export const isLatestProjectSchemaJSON = createVersionPredicate('3.38.0');
119
+ export const isProjectSchemaJSONV3_39_0 = createVersionPredicate('3.39.0');
120
+ export const isLatestProjectSchemaJSON = createVersionPredicate('3.39.0');
119
121
  export const isProjectSchemaJSONV4_0_0 = createVersionPredicate('4.0.0');
@@ -1,6 +1,6 @@
1
1
  // This file is generated by "pnpm json2ts"
2
2
  import { migrateTo } from '../migration';
3
- import { isProjectSchemaJSONV1_0_0, isProjectSchemaJSONV3_0_0, isProjectSchemaJSONV3_1_0, isProjectSchemaJSONV3_2_0, isProjectSchemaJSONV3_3_0, isProjectSchemaJSONV3_4_0, isProjectSchemaJSONV3_5_0, isProjectSchemaJSONV3_5_1, isProjectSchemaJSONV3_6_0, isProjectSchemaJSONV3_7_0, isProjectSchemaJSONV3_8_0, isProjectSchemaJSONV3_9_0, isProjectSchemaJSONV3_10_0, isProjectSchemaJSONV3_11_0, isProjectSchemaJSONV3_12_0, isProjectSchemaJSONV3_12_1, isProjectSchemaJSONV3_12_2, isProjectSchemaJSONV3_12_3, isProjectSchemaJSONV3_13_0, isProjectSchemaJSONV3_14_0, isProjectSchemaJSONV3_15_0, isProjectSchemaJSONV3_16_0, isProjectSchemaJSONV3_17_0, isProjectSchemaJSONV3_17_1, isProjectSchemaJSONV3_18_0, isProjectSchemaJSONV3_18_1, isProjectSchemaJSONV3_18_2, isProjectSchemaJSONV3_19_0, isProjectSchemaJSONV3_20_0, isProjectSchemaJSONV3_21_0, isProjectSchemaJSONV3_22_0, isProjectSchemaJSONV3_23_0, isProjectSchemaJSONV3_24_0, isProjectSchemaJSONV3_25_0, isProjectSchemaJSONV3_26_0, isProjectSchemaJSONV3_27_0, isProjectSchemaJSONV3_28_0, isProjectSchemaJSONV3_29_0, isProjectSchemaJSONV3_30_0, isProjectSchemaJSONV3_31_0, isProjectSchemaJSONV3_32_0, isProjectSchemaJSONV3_33_0, isProjectSchemaJSONV3_34_0, isProjectSchemaJSONV3_35_0, isProjectSchemaJSONV3_36_0, isProjectSchemaJSONV3_37_0, isProjectSchemaJSONV4_0_0, isLatestProjectSchemaJSON } from './index'; // eslint-disable-next-line complexity
3
+ import { isProjectSchemaJSONV1_0_0, isProjectSchemaJSONV3_0_0, isProjectSchemaJSONV3_1_0, isProjectSchemaJSONV3_2_0, isProjectSchemaJSONV3_3_0, isProjectSchemaJSONV3_4_0, isProjectSchemaJSONV3_5_0, isProjectSchemaJSONV3_5_1, isProjectSchemaJSONV3_6_0, isProjectSchemaJSONV3_7_0, isProjectSchemaJSONV3_8_0, isProjectSchemaJSONV3_9_0, isProjectSchemaJSONV3_10_0, isProjectSchemaJSONV3_11_0, isProjectSchemaJSONV3_12_0, isProjectSchemaJSONV3_12_1, isProjectSchemaJSONV3_12_2, isProjectSchemaJSONV3_12_3, isProjectSchemaJSONV3_13_0, isProjectSchemaJSONV3_14_0, isProjectSchemaJSONV3_15_0, isProjectSchemaJSONV3_16_0, isProjectSchemaJSONV3_17_0, isProjectSchemaJSONV3_17_1, isProjectSchemaJSONV3_18_0, isProjectSchemaJSONV3_18_1, isProjectSchemaJSONV3_18_2, isProjectSchemaJSONV3_19_0, isProjectSchemaJSONV3_20_0, isProjectSchemaJSONV3_21_0, isProjectSchemaJSONV3_22_0, isProjectSchemaJSONV3_23_0, isProjectSchemaJSONV3_24_0, isProjectSchemaJSONV3_25_0, isProjectSchemaJSONV3_26_0, isProjectSchemaJSONV3_27_0, isProjectSchemaJSONV3_28_0, isProjectSchemaJSONV3_29_0, isProjectSchemaJSONV3_30_0, isProjectSchemaJSONV3_31_0, isProjectSchemaJSONV3_32_0, isProjectSchemaJSONV3_33_0, isProjectSchemaJSONV3_34_0, isProjectSchemaJSONV3_35_0, isProjectSchemaJSONV3_36_0, isProjectSchemaJSONV3_37_0, isProjectSchemaJSONV3_38_0, isProjectSchemaJSONV4_0_0, isLatestProjectSchemaJSON } from './index'; // eslint-disable-next-line complexity
4
4
 
5
5
  export async function migrateToLatestProjectSchema(context, projectSchema) {
6
6
  if (isLatestProjectSchemaJSON(projectSchema)) {
@@ -191,6 +191,10 @@ export async function migrateToLatestProjectSchema(context, projectSchema) {
191
191
  projectSchema = await migrateTo['v3.38.0'](context, projectSchema);
192
192
  }
193
193
 
194
+ if (isProjectSchemaJSONV3_38_0(projectSchema)) {
195
+ projectSchema = await migrateTo['v3.39.0'](context, projectSchema);
196
+ }
197
+
194
198
  if (isProjectSchemaJSONV4_0_0(projectSchema)) {
195
199
  throw new Error('You are using an unreleased schema version. Migration is not possible');
196
200
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  // This file is generated by "pnpm json2ts"
2
- export const CURRENT_SCHEMA_VERSION = '3.38.0';
2
+ export const CURRENT_SCHEMA_VERSION = '3.39.0';
3
3
  export { default as anyProjectSchema } from './project-schema.json';
4
- export { default as latestSchemaJson } from './project-schema/v3.38.0.json';
4
+ export { default as latestSchemaJson } from './project-schema/v3.39.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';
@@ -61,5 +61,6 @@ import projectSchemaV3_35_0 from './project-schema/v3.35.0.json';
61
61
  import projectSchemaV3_36_0 from './project-schema/v3.36.0.json';
62
62
  import projectSchemaV3_37_0 from './project-schema/v3.37.0.json';
63
63
  import projectSchemaV3_38_0 from './project-schema/v3.38.0.json';
64
+ import projectSchemaV3_39_0 from './project-schema/v3.39.0.json';
64
65
  import projectSchemaV4_0_0 from './project-schema/v4.0.0.json';
65
- export const allProjectSchemas = [metaSchemaV1_0_0, projectSchemaV1_0_0, metaSchemaV3_0_0, projectSchemaV3_0_0, metaSchemaV3_1_0, projectSchemaV3_1_0, metaSchemaV3_2_0, projectSchemaV3_2_0, metaSchemaV3_3_0, projectSchemaV3_3_0, metaSchemaV3_4_0, projectSchemaV3_4_0, metaSchemaV3_5_0, projectSchemaV3_5_0, metaSchemaV3_5_1, projectSchemaV3_5_1, metaSchemaV3_6_0, projectSchemaV3_6_0, metaSchemaV3_7_0, projectSchemaV3_7_0, metaSchemaV3_8_0, projectSchemaV3_8_0, metaSchemaV3_9_0, projectSchemaV3_9_0, projectSchemaV3_10_0, projectSchemaV3_11_0, projectSchemaV3_12_0, projectSchemaV3_12_1, projectSchemaV3_12_2, projectSchemaV3_12_3, projectSchemaV3_13_0, projectSchemaV3_14_0, projectSchemaV3_15_0, projectSchemaV3_16_0, projectSchemaV3_17_0, projectSchemaV3_17_1, projectSchemaV3_18_0, projectSchemaV3_18_1, projectSchemaV3_18_2, projectSchemaV3_19_0, projectSchemaV3_20_0, projectSchemaV3_21_0, projectSchemaV3_22_0, projectSchemaV3_23_0, projectSchemaV3_24_0, projectSchemaV3_25_0, projectSchemaV3_26_0, projectSchemaV3_27_0, projectSchemaV3_28_0, projectSchemaV3_29_0, projectSchemaV3_30_0, projectSchemaV3_31_0, projectSchemaV3_32_0, projectSchemaV3_33_0, projectSchemaV3_34_0, projectSchemaV3_35_0, projectSchemaV3_36_0, projectSchemaV3_37_0, projectSchemaV3_38_0, projectSchemaV4_0_0];
66
+ export const allProjectSchemas = [metaSchemaV1_0_0, projectSchemaV1_0_0, metaSchemaV3_0_0, projectSchemaV3_0_0, metaSchemaV3_1_0, projectSchemaV3_1_0, metaSchemaV3_2_0, projectSchemaV3_2_0, metaSchemaV3_3_0, projectSchemaV3_3_0, metaSchemaV3_4_0, projectSchemaV3_4_0, metaSchemaV3_5_0, projectSchemaV3_5_0, metaSchemaV3_5_1, projectSchemaV3_5_1, metaSchemaV3_6_0, projectSchemaV3_6_0, metaSchemaV3_7_0, projectSchemaV3_7_0, metaSchemaV3_8_0, projectSchemaV3_8_0, metaSchemaV3_9_0, projectSchemaV3_9_0, projectSchemaV3_10_0, projectSchemaV3_11_0, projectSchemaV3_12_0, projectSchemaV3_12_1, projectSchemaV3_12_2, projectSchemaV3_12_3, projectSchemaV3_13_0, projectSchemaV3_14_0, projectSchemaV3_15_0, projectSchemaV3_16_0, projectSchemaV3_17_0, projectSchemaV3_17_1, projectSchemaV3_18_0, projectSchemaV3_18_1, projectSchemaV3_18_2, projectSchemaV3_19_0, projectSchemaV3_20_0, projectSchemaV3_21_0, projectSchemaV3_22_0, projectSchemaV3_23_0, projectSchemaV3_24_0, projectSchemaV3_25_0, projectSchemaV3_26_0, projectSchemaV3_27_0, projectSchemaV3_28_0, projectSchemaV3_29_0, projectSchemaV3_30_0, projectSchemaV3_31_0, projectSchemaV3_32_0, projectSchemaV3_33_0, projectSchemaV3_34_0, projectSchemaV3_35_0, projectSchemaV3_36_0, projectSchemaV3_37_0, projectSchemaV3_38_0, projectSchemaV3_39_0, projectSchemaV4_0_0];
@@ -1,7 +1,7 @@
1
1
  // This file is generated by "pnpm json2ts"
2
- export const CURRENT_SCHEMA_VERSION = '3.38.0';
2
+ export const CURRENT_SCHEMA_VERSION = '3.39.0';
3
3
  export {default as anyProjectSchema} from './project-schema.json';
4
- export {default as latestSchemaJson} from './project-schema/v3.38.0.json';
4
+ export {default as latestSchemaJson} from './project-schema/v3.39.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';
@@ -61,6 +61,7 @@ import projectSchemaV3_35_0 from './project-schema/v3.35.0.json';
61
61
  import projectSchemaV3_36_0 from './project-schema/v3.36.0.json';
62
62
  import projectSchemaV3_37_0 from './project-schema/v3.37.0.json';
63
63
  import projectSchemaV3_38_0 from './project-schema/v3.38.0.json';
64
+ import projectSchemaV3_39_0 from './project-schema/v3.39.0.json';
64
65
  import projectSchemaV4_0_0 from './project-schema/v4.0.0.json';
65
66
  export const allProjectSchemas = [
66
67
  metaSchemaV1_0_0,
@@ -122,5 +123,6 @@ export const allProjectSchemas = [
122
123
  projectSchemaV3_36_0,
123
124
  projectSchemaV3_37_0,
124
125
  projectSchemaV3_38_0,
126
+ projectSchemaV3_39_0,
125
127
  projectSchemaV4_0_0
126
128
  ];
@@ -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.38.0#",
3
+ "$id": "https://schema.takeshape.io/project-schema/v3.39.0#",
4
4
  "title": "Project Schema JSON",
5
5
  "definitions": {
6
6
  "schemaArray": {
@@ -2834,6 +2834,14 @@
2834
2834
  "pattern": "[0-9A-Za-z_-]+"
2835
2835
  }
2836
2836
  },
2837
+ "requestSearchParams": {
2838
+ "title": "Request Search Params",
2839
+ "description": "Any custom search params to set with the health check request.",
2840
+ "type": "object",
2841
+ "propertyNames": {
2842
+ "pattern": "[0-9A-Za-z_-]+"
2843
+ }
2844
+ },
2837
2845
  "requestBody": {
2838
2846
  "title": "Request Body",
2839
2847
  "description": "A custom body to send along with the ping request.",
@@ -3140,7 +3148,7 @@
3140
3148
  "schemaVersion": {
3141
3149
  "type": "string",
3142
3150
  "enum": [
3143
- "3.38.0"
3151
+ "3.39.0"
3144
3152
  ],
3145
3153
  "description": "The version of the schema format your project is using. We increase the version as we make breaking changes to the schema format."
3146
3154
  },
@@ -3207,4 +3215,4 @@
3207
3215
  "mutations",
3208
3216
  "workflows"
3209
3217
  ]
3210
- }
3218
+ }
@@ -3207,4 +3207,4 @@
3207
3207
  "mutations",
3208
3208
  "workflows"
3209
3209
  ]
3210
- }
3210
+ }