@takeshape/schema 8.203.3 → 8.203.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"v3.9.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.9.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EASpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAE9C,QAAA,MAAM,OAAO,EAAE,eAAe,CAAC,mBAAmB,EAAE,mBAAmB,CAqEtE,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"v3.9.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.9.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EASpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAe9C,QAAA,MAAM,OAAO,EAAE,eAAe,CAAC,mBAAmB,EAAE,mBAAmB,CAqEtE,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -7,6 +7,24 @@ exports.default = void 0;
7
7
 
8
8
  var _util = require("@takeshape/util");
9
9
 
10
+ var _omit = _interopRequireDefault(require("lodash/omit"));
11
+
12
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function omitOptions(resolver, names) {
17
+ if (resolver.options) {
18
+ const newOptions = (0, _omit.default)(resolver.options, names);
19
+
20
+ if ((0, _isEmpty.default)(newOptions)) {
21
+ delete resolver.options;
22
+ } else {
23
+ resolver.options = newOptions;
24
+ }
25
+ }
26
+ }
27
+
10
28
  const migrate = async (_, projectSchema) => {
11
29
  /**
12
30
  * Resolver props that are guaranteed in this version, and dependent on the
@@ -15,51 +33,48 @@ const migrate = async (_, projectSchema) => {
15
33
  const ensureResolverOptions = resolver => {
16
34
  if (resolver.name.startsWith('takeshape')) {
17
35
  if (!resolver.shapeName) {
18
- var _resolver$options, _resolver$options2, _resolver$options3, _resolver$options4;
36
+ var _resolver$options, _resolver$options2;
19
37
 
20
38
  resolver.shapeName = ((_resolver$options = resolver.options) === null || _resolver$options === void 0 ? void 0 : _resolver$options.model) ?? ((_resolver$options2 = resolver.options) === null || _resolver$options2 === void 0 ? void 0 : _resolver$options2.indexedShape) ?? '';
21
- (_resolver$options3 = resolver.options) === null || _resolver$options3 === void 0 ? true : delete _resolver$options3.model;
22
- (_resolver$options4 = resolver.options) === null || _resolver$options4 === void 0 ? true : delete _resolver$options4.indexedShape;
39
+ omitOptions(resolver, ['model', 'indexedShape']);
23
40
  }
24
41
  }
25
42
 
26
43
  if (resolver.name.startsWith('graphql')) {
27
44
  if (!resolver.fieldName) {
28
- var _resolver$options5, _resolver$options6;
45
+ var _resolver$options3;
29
46
 
30
- resolver.fieldName = ((_resolver$options5 = resolver.options) === null || _resolver$options5 === void 0 ? void 0 : _resolver$options5.fieldName) ?? '';
31
- (_resolver$options6 = resolver.options) === null || _resolver$options6 === void 0 ? true : delete _resolver$options6.fieldName;
47
+ resolver.fieldName = ((_resolver$options3 = resolver.options) === null || _resolver$options3 === void 0 ? void 0 : _resolver$options3.fieldName) ?? '';
48
+ omitOptions(resolver, ['fieldName']);
32
49
  }
33
50
  }
34
51
 
35
52
  if (resolver.name.startsWith('awsLambda')) {
36
53
  if (!resolver.functionName) {
37
- var _resolver$options7, _resolver$options8;
54
+ var _resolver$options4;
38
55
 
39
- resolver.functionName = ((_resolver$options7 = resolver.options) === null || _resolver$options7 === void 0 ? void 0 : _resolver$options7.functionName) ?? '';
40
- (_resolver$options8 = resolver.options) === null || _resolver$options8 === void 0 ? true : delete _resolver$options8.functionName;
56
+ resolver.functionName = ((_resolver$options4 = resolver.options) === null || _resolver$options4 === void 0 ? void 0 : _resolver$options4.functionName) ?? '';
57
+ omitOptions(resolver, ['functionName']);
41
58
  }
42
59
  }
43
60
 
44
61
  if (resolver.name.startsWith('rest')) {
45
62
  if (!resolver.path) {
46
- var _resolver$options11;
47
-
48
63
  if (resolver.pathParams) {
49
- var _resolver$options9;
64
+ var _resolver$options5;
50
65
 
51
66
  resolver.path = { ...resolver.pathParams,
52
67
  serialize: { ...resolver.pathParams.serialize,
53
- template: (_resolver$options9 = resolver.options) === null || _resolver$options9 === void 0 ? void 0 : _resolver$options9.path
68
+ template: (_resolver$options5 = resolver.options) === null || _resolver$options5 === void 0 ? void 0 : _resolver$options5.path
54
69
  }
55
70
  };
56
71
  } else {
57
- var _resolver$options10;
72
+ var _resolver$options6;
58
73
 
59
- resolver.path = ((_resolver$options10 = resolver.options) === null || _resolver$options10 === void 0 ? void 0 : _resolver$options10.path) ?? '';
74
+ resolver.path = ((_resolver$options6 = resolver.options) === null || _resolver$options6 === void 0 ? void 0 : _resolver$options6.path) ?? '';
60
75
  }
61
76
 
62
- (_resolver$options11 = resolver.options) === null || _resolver$options11 === void 0 ? true : delete _resolver$options11.path;
77
+ omitOptions(resolver, ['path']);
63
78
  }
64
79
  }
65
80
  /**
@@ -8,11 +8,11 @@ export declare function isBuiltinShape(shapeName: string): boolean;
8
8
  export declare function isBuiltinQuery(name: string): boolean;
9
9
  export declare function isBuiltinMutation(name: string): boolean;
10
10
  export declare function isBuiltinType(projectSchema: ProjectSchema, refSchema: SchemaWithRef): boolean;
11
- export declare const schemaMetadataKeys: string[];
12
- export declare const commonSchemaKeys: string[];
13
- export declare const scalarSchemaKeys: string[];
14
- export declare const objectSchemaKeys: string[];
15
- export declare const arraySchemaKeys: string[];
11
+ export declare const schemaMetadataKeys: readonly ["$comment", "title", "description", "@l10n", "@deprecationReason", "@tag", "@tags", "@syncLocaleStructure", "@sensitive"];
12
+ export declare const commonSchemaKeys: readonly ["type", "default", "readOnly", "$comment", "title", "description", "@l10n", "@deprecationReason", "@tag", "@tags", "@syncLocaleStructure", "@sensitive"];
13
+ export declare const scalarSchemaKeys: readonly ["type", "default", "readOnly", "$comment", "title", "description", "@l10n", "@deprecationReason", "@tag", "@tags", "@syncLocaleStructure", "@sensitive", "format", "oneOf", "multipleOf", "maximum", "exclusiveMaximum", "minimum", "exclusiveMinimum", "maxLength", "minLength", "pattern"];
14
+ export declare const objectSchemaKeys: readonly ["type", "default", "readOnly", "$comment", "title", "description", "@l10n", "@deprecationReason", "@tag", "@tags", "@syncLocaleStructure", "@sensitive", "properties", "required"];
15
+ export declare const arraySchemaKeys: readonly ["type", "default", "readOnly", "$comment", "title", "description", "@l10n", "@deprecationReason", "@tag", "@tags", "@syncLocaleStructure", "@sensitive", "items", "additionalItems", "maxItems", "minItems", "uniqueItems"];
16
16
  export declare const multipleRelationshipSchemaKeys: string[];
17
17
  export declare const nonStructuralSchemaKeys: string[];
18
18
  export declare function getServiceIdFieldName(serviceFieldName: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"schema-util.d.ts","sourceRoot":"","sources":["../../src/schema-util.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAEd,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EAGX,WAAW,EAEZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAElB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACd,MAAM,eAAe,CAAC;AAUvB,OAAO,EAAC,KAAK,EAA8B,MAAM,iBAAiB,CAAC;AAenE,OAAO,EASL,OAAO,EAIP,eAAe,EACf,eAAe,EACf,qBAAqB,EAKtB,MAAM,QAAQ,CAAC;AAMhB,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;A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C;AAEF,oBAAY,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,WAAW,CAAC,CAAC;AAgC9E;;GAEG;AACH,eAAO,MAAM,SAAS,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MAAM,GAAG,SAC9C,CAAC;AAC/D;;GAEG;AACH,eAAO,MAAM,YAAY,kBACR,kBAAkB,aACtB,MAAM,YACP,MAAM,KACf,MAAM,GAAG,SAA4E,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,WAAW,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MACrC,CAAC;AACjE;;;GAGG;AACH,eAAO,MAAM,cAAc,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MACrC,CAAC;AAEpE,oBAAY,2BAA2B,GACnC,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,sBAAsB,cAAe,MAAM,YAAY,2BAA2B,KAAG,MAGjG,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAQ3F"}
@@ -1,4 +1,18 @@
1
1
  import { visit } from '@takeshape/util';
2
+ import omit from 'lodash/omit';
3
+ import isEmpty from 'lodash/isEmpty';
4
+
5
+ function omitOptions(resolver, names) {
6
+ if (resolver.options) {
7
+ const newOptions = omit(resolver.options, names);
8
+
9
+ if (isEmpty(newOptions)) {
10
+ delete resolver.options;
11
+ } else {
12
+ resolver.options = newOptions;
13
+ }
14
+ }
15
+ }
2
16
 
3
17
  const migrate = async (_, projectSchema) => {
4
18
  /**
@@ -8,51 +22,48 @@ const migrate = async (_, projectSchema) => {
8
22
  const ensureResolverOptions = resolver => {
9
23
  if (resolver.name.startsWith('takeshape')) {
10
24
  if (!resolver.shapeName) {
11
- var _resolver$options, _resolver$options2, _resolver$options3, _resolver$options4;
25
+ var _resolver$options, _resolver$options2;
12
26
 
13
27
  resolver.shapeName = ((_resolver$options = resolver.options) === null || _resolver$options === void 0 ? void 0 : _resolver$options.model) ?? ((_resolver$options2 = resolver.options) === null || _resolver$options2 === void 0 ? void 0 : _resolver$options2.indexedShape) ?? '';
14
- (_resolver$options3 = resolver.options) === null || _resolver$options3 === void 0 ? true : delete _resolver$options3.model;
15
- (_resolver$options4 = resolver.options) === null || _resolver$options4 === void 0 ? true : delete _resolver$options4.indexedShape;
28
+ omitOptions(resolver, ['model', 'indexedShape']);
16
29
  }
17
30
  }
18
31
 
19
32
  if (resolver.name.startsWith('graphql')) {
20
33
  if (!resolver.fieldName) {
21
- var _resolver$options5, _resolver$options6;
34
+ var _resolver$options3;
22
35
 
23
- resolver.fieldName = ((_resolver$options5 = resolver.options) === null || _resolver$options5 === void 0 ? void 0 : _resolver$options5.fieldName) ?? '';
24
- (_resolver$options6 = resolver.options) === null || _resolver$options6 === void 0 ? true : delete _resolver$options6.fieldName;
36
+ resolver.fieldName = ((_resolver$options3 = resolver.options) === null || _resolver$options3 === void 0 ? void 0 : _resolver$options3.fieldName) ?? '';
37
+ omitOptions(resolver, ['fieldName']);
25
38
  }
26
39
  }
27
40
 
28
41
  if (resolver.name.startsWith('awsLambda')) {
29
42
  if (!resolver.functionName) {
30
- var _resolver$options7, _resolver$options8;
43
+ var _resolver$options4;
31
44
 
32
- resolver.functionName = ((_resolver$options7 = resolver.options) === null || _resolver$options7 === void 0 ? void 0 : _resolver$options7.functionName) ?? '';
33
- (_resolver$options8 = resolver.options) === null || _resolver$options8 === void 0 ? true : delete _resolver$options8.functionName;
45
+ resolver.functionName = ((_resolver$options4 = resolver.options) === null || _resolver$options4 === void 0 ? void 0 : _resolver$options4.functionName) ?? '';
46
+ omitOptions(resolver, ['functionName']);
34
47
  }
35
48
  }
36
49
 
37
50
  if (resolver.name.startsWith('rest')) {
38
51
  if (!resolver.path) {
39
- var _resolver$options11;
40
-
41
52
  if (resolver.pathParams) {
42
- var _resolver$options9;
53
+ var _resolver$options5;
43
54
 
44
55
  resolver.path = { ...resolver.pathParams,
45
56
  serialize: { ...resolver.pathParams.serialize,
46
- template: (_resolver$options9 = resolver.options) === null || _resolver$options9 === void 0 ? void 0 : _resolver$options9.path
57
+ template: (_resolver$options5 = resolver.options) === null || _resolver$options5 === void 0 ? void 0 : _resolver$options5.path
47
58
  }
48
59
  };
49
60
  } else {
50
- var _resolver$options10;
61
+ var _resolver$options6;
51
62
 
52
- resolver.path = ((_resolver$options10 = resolver.options) === null || _resolver$options10 === void 0 ? void 0 : _resolver$options10.path) ?? '';
63
+ resolver.path = ((_resolver$options6 = resolver.options) === null || _resolver$options6 === void 0 ? void 0 : _resolver$options6.path) ?? '';
53
64
  }
54
65
 
55
- (_resolver$options11 = resolver.options) === null || _resolver$options11 === void 0 ? true : delete _resolver$options11.path;
66
+ omitOptions(resolver, ['path']);
56
67
  }
57
68
  }
58
69
  /**
@@ -168,7 +168,6 @@
168
168
  "resolver": {
169
169
  "name": "takeshape:get",
170
170
  "service": "takeshape:local",
171
- "options": {},
172
171
  "shapeName": "Product"
173
172
  },
174
173
  "shape": "Product",
@@ -179,7 +178,6 @@
179
178
  "resolver": {
180
179
  "name": "takeshape:list",
181
180
  "service": "takeshape:local",
182
- "options": {},
183
181
  "shapeName": "Product"
184
182
  },
185
183
  "shape": "PaginatedList<Product>",
@@ -319,7 +317,6 @@
319
317
  },
320
318
  "name": "takeshape:update",
321
319
  "service": "takeshape:local",
322
- "options": {},
323
320
  "shapeName": "Product"
324
321
  },
325
322
  {
@@ -572,7 +569,6 @@
572
569
  },
573
570
  "name": "takeshape:create",
574
571
  "service": "takeshape:local",
575
- "options": {},
576
572
  "shapeName": "Product"
577
573
  },
578
574
  {
@@ -590,7 +586,6 @@
590
586
  },
591
587
  "name": "takeshape:create",
592
588
  "service": "takeshape:local",
593
- "options": {},
594
589
  "shapeName": "Product"
595
590
  }
596
591
  ],
@@ -619,7 +614,6 @@
619
614
  "resolver": {
620
615
  "name": "takeshape:duplicate",
621
616
  "service": "takeshape:local",
622
- "options": {},
623
617
  "shapeName": "Product"
624
618
  },
625
619
  "shape": "DuplicateResult<Product>",
@@ -630,7 +624,6 @@
630
624
  "resolver": {
631
625
  "name": "takeshape:delete",
632
626
  "service": "takeshape:local",
633
- "options": {},
634
627
  "shapeName": "Product"
635
628
  },
636
629
  "shape": "DeleteResult<Product>",
@@ -745,7 +738,6 @@
745
738
  "@resolver": {
746
739
  "name": "graphql:query",
747
740
  "service": "michaels-store-takeshape",
748
- "options": {},
749
741
  "argsMapping": {
750
742
  "id": [
751
743
  [