@takeshape/schema 8.31.0 → 8.35.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 (135) hide show
  1. package/es/index.js +3 -3
  2. package/es/migration/index.js +82 -0
  3. package/es/migration/to/v3.0.0.js +245 -0
  4. package/es/migration/to/v3.1.0.js +218 -0
  5. package/es/migration/to/v3.10.0.js +56 -0
  6. package/es/migration/to/v3.11.0.js +99 -0
  7. package/es/migration/to/v3.2.0.js +10 -0
  8. package/es/migration/to/v3.3.0.js +16 -0
  9. package/es/migration/to/v3.4.0.js +10 -0
  10. package/es/migration/to/v3.5.0.js +10 -0
  11. package/es/migration/to/v3.5.1.js +10 -0
  12. package/es/migration/to/v3.6.0.js +10 -0
  13. package/es/migration/to/v3.7.0.js +10 -0
  14. package/es/migration/to/v3.8.0.js +10 -0
  15. package/es/migration/to/v3.9.0.js +83 -0
  16. package/es/migration/types.js +1 -0
  17. package/es/migration/utils.js +23 -0
  18. package/es/mocks.js +1 -0
  19. package/es/project-schema/index.js +1 -0
  20. package/es/project-schema/v3.11.0.js +1 -0
  21. package/es/schema-util.js +15 -10
  22. package/es/schemas/index.js +4 -3
  23. package/es/schemas/index.ts +4 -2
  24. package/es/schemas/project-schema/v3.11.0.json +2135 -0
  25. package/es/services.js +57 -255
  26. package/es/types/types.js +9 -0
  27. package/es/types/utils.js +19 -12
  28. package/examples/latest/blog-schema.json +2 -1
  29. package/examples/latest/brewery-schema.json +2 -1
  30. package/examples/latest/complex-project-schema.json +2 -1
  31. package/examples/latest/fabric-ecommerce.json +2 -2
  32. package/examples/latest/frank-and-fred-schema.json +2 -1
  33. package/examples/latest/massive-schema.json +2 -1
  34. package/examples/latest/mill-components-schema.json +2 -1
  35. package/examples/latest/pet-oneof-array.json +2 -1
  36. package/examples/latest/post-schema.json +2 -1
  37. package/examples/latest/pruned-shopify-product-schema.json +2 -2
  38. package/examples/latest/real-world-schema.json +2 -1
  39. package/examples/latest/recursive-repeater-schema.json +2 -1
  40. package/examples/latest/recursive-schema.json +2 -1
  41. package/examples/latest/rick-and-morty-ast.json +1 -1
  42. package/examples/latest/rick-and-morty-graphql.json +1 -1
  43. package/examples/latest/rick-and-morty-rest.json +1 -1
  44. package/examples/latest/schema-with-repeater-draftjs.json +2 -1
  45. package/examples/latest/shape-books-v3_2_0.json +2 -1
  46. package/examples/latest/shape-books.json +2 -1
  47. package/examples/latest/shopify-lookbook.json +1 -1
  48. package/examples/latest/shopify-store-with-widget.json +2 -2
  49. package/examples/latest/stripe-starter-resolved.json +2 -2
  50. package/examples/latest/user-schema-no-required.json +2 -1
  51. package/examples/latest/user-schema-with-defaults.json +2 -1
  52. package/lib/index.d.ts +3 -3
  53. package/lib/index.d.ts.map +1 -1
  54. package/lib/index.js +13 -36
  55. package/lib/migration/index.d.ts +7 -0
  56. package/lib/migration/index.d.ts.map +1 -0
  57. package/lib/migration/index.js +128 -0
  58. package/lib/migration/to/v3.0.0.d.ts +4 -0
  59. package/lib/migration/to/v3.0.0.d.ts.map +1 -0
  60. package/lib/migration/to/v3.0.0.js +260 -0
  61. package/lib/migration/to/v3.1.0.d.ts +5 -0
  62. package/lib/migration/to/v3.1.0.d.ts.map +1 -0
  63. package/lib/migration/to/v3.1.0.js +233 -0
  64. package/lib/migration/to/v3.10.0.d.ts +4 -0
  65. package/lib/migration/to/v3.10.0.d.ts.map +1 -0
  66. package/lib/migration/to/v3.10.0.js +66 -0
  67. package/lib/migration/to/v3.11.0.d.ts +5 -0
  68. package/lib/migration/to/v3.11.0.d.ts.map +1 -0
  69. package/lib/migration/to/v3.11.0.js +109 -0
  70. package/lib/migration/to/v3.2.0.d.ts +4 -0
  71. package/lib/migration/to/v3.2.0.d.ts.map +1 -0
  72. package/lib/migration/to/v3.2.0.js +18 -0
  73. package/lib/migration/to/v3.3.0.d.ts +5 -0
  74. package/lib/migration/to/v3.3.0.d.ts.map +1 -0
  75. package/lib/migration/to/v3.3.0.js +24 -0
  76. package/lib/migration/to/v3.4.0.d.ts +4 -0
  77. package/lib/migration/to/v3.4.0.d.ts.map +1 -0
  78. package/lib/migration/to/v3.4.0.js +18 -0
  79. package/lib/migration/to/v3.5.0.d.ts +4 -0
  80. package/lib/migration/to/v3.5.0.d.ts.map +1 -0
  81. package/lib/migration/to/v3.5.0.js +18 -0
  82. package/lib/migration/to/v3.5.1.d.ts +4 -0
  83. package/lib/migration/to/v3.5.1.d.ts.map +1 -0
  84. package/lib/migration/to/v3.5.1.js +18 -0
  85. package/lib/migration/to/v3.6.0.d.ts +4 -0
  86. package/lib/migration/to/v3.6.0.d.ts.map +1 -0
  87. package/lib/migration/to/v3.6.0.js +18 -0
  88. package/lib/migration/to/v3.7.0.d.ts +4 -0
  89. package/lib/migration/to/v3.7.0.d.ts.map +1 -0
  90. package/lib/migration/to/v3.7.0.js +18 -0
  91. package/lib/migration/to/v3.8.0.d.ts +4 -0
  92. package/lib/migration/to/v3.8.0.d.ts.map +1 -0
  93. package/lib/migration/to/v3.8.0.js +18 -0
  94. package/lib/migration/to/v3.9.0.d.ts +4 -0
  95. package/lib/migration/to/v3.9.0.d.ts.map +1 -0
  96. package/lib/migration/to/v3.9.0.js +91 -0
  97. package/lib/migration/types.d.ts +14 -0
  98. package/lib/migration/types.d.ts.map +1 -0
  99. package/lib/migration/types.js +5 -0
  100. package/lib/migration/utils.d.ts +5 -0
  101. package/lib/migration/utils.d.ts.map +1 -0
  102. package/lib/migration/utils.js +34 -0
  103. package/lib/mocks.d.ts.map +1 -1
  104. package/lib/mocks.js +1 -0
  105. package/lib/project-schema/index.d.ts +3 -1
  106. package/lib/project-schema/index.d.ts.map +1 -1
  107. package/lib/project-schema/index.js +26 -13
  108. package/lib/project-schema/latest.d.ts +26 -17
  109. package/lib/project-schema/latest.d.ts.map +1 -1
  110. package/lib/project-schema/v3.11.0.d.ts +1211 -0
  111. package/lib/project-schema/v3.11.0.d.ts.map +1 -0
  112. package/lib/project-schema/v3.11.0.js +5 -0
  113. package/lib/schema-util.d.ts.map +1 -1
  114. package/lib/schema-util.js +16 -10
  115. package/lib/schemas/index.d.ts +2051 -2
  116. package/lib/schemas/index.d.ts.map +1 -1
  117. package/lib/schemas/index.js +17 -15
  118. package/lib/schemas/index.ts +4 -2
  119. package/lib/schemas/project-schema/v3.11.0.json +2135 -0
  120. package/lib/services.d.ts +11 -27
  121. package/lib/services.d.ts.map +1 -1
  122. package/lib/services.js +54 -261
  123. package/lib/types/types.d.ts +16 -5
  124. package/lib/types/types.d.ts.map +1 -1
  125. package/lib/types/types.js +9 -0
  126. package/lib/types/utils.d.ts +8 -5
  127. package/lib/types/utils.d.ts.map +1 -1
  128. package/lib/types/utils.js +25 -13
  129. package/lib/validate.d.ts +1 -1
  130. package/lib/validate.d.ts.map +1 -1
  131. package/package.json +6 -5
  132. package/es/migration.js +0 -576
  133. package/lib/migration.d.ts +0 -59
  134. package/lib/migration.d.ts.map +0 -1
  135. package/lib/migration.js +0 -634
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _pReduce = _interopRequireDefault(require("p-reduce"));
9
+
10
+ var _isObject = _interopRequireDefault(require("lodash/isObject"));
11
+
12
+ var _isString = _interopRequireDefault(require("lodash/isString"));
13
+
14
+ var _isUndefined = _interopRequireDefault(require("lodash/isUndefined"));
15
+
16
+ var _util = require("@takeshape/util");
17
+
18
+ var _utils = require("../../types/utils");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ /**
23
+ * `graphql:my-key` `my-key`
24
+ */
25
+ function parseV3ServiceStr(service) {
26
+ const parts = service.split(':');
27
+ return {
28
+ provider: parts.length > 1 ? parts[0] : undefined,
29
+ id: parts.length > 1 ? parts[1] : parts[0]
30
+ };
31
+ }
32
+ /**
33
+ * Ensures a consistent service config, inluding updating the service
34
+ * authentication object.
35
+ */
36
+ // eslint-disable-next-line complexity
37
+
38
+
39
+ function updateServiceConfigV3ToV3_1(serviceConfig, serviceKey) {
40
+ if ((0, _utils.isAnyServiceConfig)(serviceConfig)) {
41
+ if ((0, _isString.default)(serviceConfig.authentication) || (0, _isUndefined.default)(serviceConfig.authentication)) {
42
+ return serviceConfig;
43
+ }
44
+
45
+ return serviceConfig;
46
+ }
47
+
48
+ const {
49
+ auth
50
+ } = serviceConfig;
51
+ const serviceParams = serviceConfig.params || {};
52
+ let {
53
+ provider: serviceKeyProvider,
54
+ id: serviceKeyId
55
+ } = parseV3ServiceStr(serviceKey);
56
+ const authType = serviceParams.authType || undefined;
57
+ const title = serviceParams.name || serviceKeyId;
58
+
59
+ if (serviceKeyId === 'vercel') {
60
+ serviceKeyProvider = 'vercel';
61
+ } else if (serviceKeyId === 'netlify') {
62
+ serviceKeyProvider = 'netlify';
63
+ } // Example schemas had this in params, which are untyped, so adding here just in case
64
+
65
+
66
+ if (serviceParams.type === 'rest') {
67
+ serviceKeyProvider = 'rest';
68
+ } else if (serviceParams.type === 'graphql' && serviceKeyProvider !== 'shopify') {
69
+ serviceKeyProvider = 'graphql';
70
+ }
71
+
72
+ let provider;
73
+ let authenticationType;
74
+ let serviceType;
75
+ let namespace;
76
+
77
+ if (serviceKeyProvider === 'shopify') {
78
+ provider = 'shopify';
79
+ authenticationType = 'oauth2Bearer';
80
+ serviceType = 'graphql';
81
+ namespace = serviceParams.namespace ?? 'Shopify';
82
+ } else if (serviceKeyProvider === 'takeshape') {
83
+ provider = 'takeshape';
84
+ authenticationType = 'none';
85
+ serviceType = 'takeshape';
86
+ namespace = serviceParams.namespace ?? 'TakeShape';
87
+ } else if (serviceKeyProvider === 'bigcommerce') {
88
+ provider = 'bigcommerce';
89
+ authenticationType = 'bearer';
90
+ serviceType = 'graphql';
91
+ namespace = serviceParams.namespace ?? 'BigCommerce';
92
+ } else if (serviceKeyProvider === 'rest') {
93
+ provider = 'generic';
94
+ authenticationType = mapAuthType(authType, auth);
95
+ serviceType = 'rest';
96
+ namespace = serviceParams.namespace ?? (0, _util.pascalCase)(title);
97
+ } else if (serviceKeyProvider === 'graphql') {
98
+ provider = 'generic';
99
+ authenticationType = mapAuthType(authType, auth);
100
+ serviceType = 'graphql';
101
+ namespace = serviceParams.namespace ?? (0, _util.pascalCase)(title);
102
+ } else if (serviceKeyProvider === 'vercel') {
103
+ provider = 'vercel';
104
+ authenticationType = 'oauth2Bearer';
105
+ serviceType = 'deployment';
106
+ } else if (serviceKeyProvider === 'netlify') {
107
+ provider = 'netlify';
108
+ authenticationType = 'oauth2Bearer';
109
+ serviceType = 'deployment';
110
+ } else {
111
+ provider = 'generic';
112
+ authenticationType = mapAuthType(authType, auth);
113
+ serviceType = 'unknown';
114
+ namespace = serviceParams.namespace ?? (0, _util.pascalCase)(title);
115
+ }
116
+
117
+ const updatedServiceConfig = {
118
+ title,
119
+ id: serviceKey,
120
+ provider,
121
+ namespace,
122
+ serviceType,
123
+ authenticationType,
124
+ options: { ...serviceParams
125
+ }
126
+ };
127
+
128
+ if (serviceConfig.auth && (0, _isObject.default)(serviceConfig.auth)) {
129
+ const authentication = updateServiceAuthentication(updatedServiceConfig.authenticationType, serviceConfig.auth, serviceParams);
130
+ return { ...updatedServiceConfig,
131
+ authentication
132
+ };
133
+ }
134
+
135
+ return updatedServiceConfig;
136
+ }
137
+ /**
138
+ * V1/V3 unencrypted `auth` -> V3.1 `authentication
139
+ */
140
+
141
+
142
+ function updateServiceAuthentication(authenticationType, legacyAuth, legacyParams) {
143
+ if (authenticationType === 'oauth2Bearer') {
144
+ return {
145
+ token: legacyAuth.accessToken,
146
+ scope: legacyAuth.scope,
147
+ header: legacyParams.authHeader
148
+ };
149
+ }
150
+
151
+ if (authenticationType === 'searchParams' && legacyParams.authProp) {
152
+ return [{
153
+ name: legacyParams.authProp,
154
+ value: legacyAuth.accessToken
155
+ }];
156
+ }
157
+
158
+ if (authenticationType === 'basic') {
159
+ const [username, password] = Buffer.from(legacyAuth.accessToken, 'base64').toString('utf-8').split(':');
160
+ return {
161
+ username,
162
+ password
163
+ };
164
+ }
165
+
166
+ if (authenticationType === 'bearer') {
167
+ return {
168
+ token: legacyAuth.accessToken,
169
+ header: legacyParams.authHeader
170
+ };
171
+ }
172
+ }
173
+
174
+ function mapAuthType(authType, auth) {
175
+ if (authType === 'none') {
176
+ return 'none';
177
+ }
178
+
179
+ if (authType === 'searchParams') {
180
+ return 'searchParams';
181
+ }
182
+
183
+ if (authType === 'bearer') {
184
+ return 'bearer';
185
+ }
186
+
187
+ if (authType === 'bearer') {
188
+ return 'basic';
189
+ }
190
+
191
+ if (!auth) {
192
+ return 'none';
193
+ }
194
+
195
+ if (auth) {
196
+ return 'bearer';
197
+ }
198
+
199
+ return 'unknown';
200
+ }
201
+
202
+ async function migrateToV3_1(context, projectSchema) {
203
+ const {
204
+ encryptFn,
205
+ decryptFn
206
+ } = context;
207
+ let services;
208
+ /**
209
+ * Services can only be migrated if a dataKey is present, otherwise they will need to be discarded.
210
+ */
211
+
212
+ if (projectSchema.services) {
213
+ services = await (0, _pReduce.default)(Object.entries(projectSchema.services), async (serviceMap, [serviceKey, serviceConfig]) => {
214
+ const auth = serviceConfig.auth && decryptFn(serviceConfig.auth);
215
+ const updatedServiceConfig = updateServiceConfigV3ToV3_1({ ...serviceConfig,
216
+ auth
217
+ }, serviceKey);
218
+ const authentication = updatedServiceConfig === null || updatedServiceConfig === void 0 ? void 0 : updatedServiceConfig.authentication;
219
+ serviceMap[serviceKey] = { ...updatedServiceConfig,
220
+ authentication: authentication && (0, _isObject.default)(authentication) ? encryptFn(authentication) : authentication
221
+ };
222
+ return serviceMap;
223
+ }, {});
224
+ }
225
+
226
+ return (0, _util.deepClone)({ ...projectSchema,
227
+ services,
228
+ schemaVersion: '3.1.0'
229
+ });
230
+ }
231
+
232
+ var _default = migrateToV3_1;
233
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_9_0, ProjectSchemaV3_10_0 } from '../../project-schema';
2
+ declare function migrateToV3_10(projectSchema: ProjectSchemaV3_9_0): ProjectSchemaV3_10_0;
3
+ export default migrateToV3_10;
4
+ //# sourceMappingURL=v3.10.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.10.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.10.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EAOrB,MAAM,sBAAsB,CAAC;AAuC9B,iBAAS,cAAc,CAAC,aAAa,EAAE,mBAAmB,GAAG,oBAAoB,CAUhF;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _mapValues = _interopRequireDefault(require("lodash/mapValues"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ function migrateQueryToV3_10(query, queryName) {
13
+ const {
14
+ args,
15
+ shape
16
+ } = query;
17
+
18
+ if (typeof args === 'object' && ('oneOf' in args || 'allOf' in args || '$ref' in args || '@ref' in args)) {
19
+ // As of 11/15/2021 no production schemas contained queries with these args
20
+ throw new Error(`Query "${queryName}" contains an unsupported arg schema ${JSON.stringify(args)}. Please contact support`);
21
+ }
22
+
23
+ if (typeof shape === 'object' && !shape.items['@ref']) {
24
+ // As of 11/15/2021 no production schemas contained queries with array return shapes that are not @refs
25
+ throw new Error(`Query "${queryName}" contains an unsupported shape schema ${JSON.stringify(shape)}. Please contact support`);
26
+ }
27
+
28
+ return query;
29
+ }
30
+
31
+ function migrateShapeToV3_10(shape) {
32
+ const {
33
+ schema,
34
+ ...rest
35
+ } = shape; // As of 11/15/2021 no production schemas contained shapes with array schemas
36
+
37
+ if ('type' in schema && schema.type === 'array') {
38
+ throw new Error(`Shape ${shape.name} uses an unsupported array schema. Please contact support`);
39
+ }
40
+
41
+ const newSchema = '$ref' in schema || '@ref' in schema ? {
42
+ allOf: [schema]
43
+ } : schema;
44
+ return { ...rest,
45
+ schema: newSchema
46
+ };
47
+ }
48
+
49
+ function migrateToV3_10(projectSchema) {
50
+ const {
51
+ queries,
52
+ mutations,
53
+ shapes,
54
+ schemaVersion,
55
+ ...rest
56
+ } = projectSchema;
57
+ return { ...rest,
58
+ queries: (0, _mapValues.default)(queries, migrateQueryToV3_10),
59
+ mutations: (0, _mapValues.default)(mutations, migrateQueryToV3_10),
60
+ shapes: (0, _mapValues.default)(shapes, migrateShapeToV3_10),
61
+ schemaVersion: '3.10.0'
62
+ };
63
+ }
64
+
65
+ var _default = migrateToV3_10;
66
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ import type { ProjectSchemaV3_10_0, ProjectSchemaV3_11_0 } from '../../project-schema';
2
+ import type { ProjectSchemaMigrationContext } from '../types';
3
+ declare function migrateToV3_11_0({ decryptFn, encryptFn }: ProjectSchemaMigrationContext, projectSchema: ProjectSchemaV3_10_0): ProjectSchemaV3_11_0;
4
+ export default migrateToV3_11_0;
5
+ //# sourceMappingURL=v3.11.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.11.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.11.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EAUrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,UAAU,CAAC;AAG5D,iBAAS,gBAAgB,CACvB,EAAC,SAAS,EAAE,SAAS,EAAC,EAAE,6BAA6B,EACrD,aAAa,EAAE,oBAAoB,GAClC,oBAAoB,CA6FtB;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _fromPairs = _interopRequireDefault(require("lodash/fromPairs"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ function migrateToV3_11_0({
13
+ decryptFn,
14
+ encryptFn
15
+ }, projectSchema) {
16
+ const migratedServices = [];
17
+
18
+ for (const [serviceKey, serviceConfig] of Object.entries(projectSchema.services ?? {})) {
19
+ const {
20
+ authenticationType,
21
+ authentication
22
+ } = serviceConfig; // Migrate authentication, ensuring now required properties
23
+
24
+ if (authentication && authenticationType !== 'unknown' && authenticationType !== 'none') {
25
+ const decrypted = decryptFn(authentication);
26
+
27
+ if (!decrypted) {
28
+ throw new Error(`Service "${serviceKey}" authentication could not be decrypted. Please contact support.`);
29
+ }
30
+
31
+ let migrated;
32
+
33
+ if (authenticationType === 'searchParams') {
34
+ migrated = {
35
+ params: decrypted,
36
+ type: authenticationType
37
+ };
38
+ }
39
+
40
+ if (authenticationType === 'basic') {
41
+ migrated = {
42
+ username: '',
43
+ password: '',
44
+ ...decrypted,
45
+ type: authenticationType
46
+ };
47
+ }
48
+
49
+ if (authenticationType === 'bearer') {
50
+ migrated = {
51
+ token: '',
52
+ ...decrypted,
53
+ type: authenticationType
54
+ };
55
+ }
56
+
57
+ if (authenticationType === 'oauth2Bearer') {
58
+ migrated = {
59
+ token: '',
60
+ ...decrypted,
61
+ type: authenticationType
62
+ };
63
+ }
64
+
65
+ if (authenticationType === 'oauth2') {
66
+ migrated = {
67
+ grantType: 'clientCredentials',
68
+ clientId: '',
69
+ ...decrypted,
70
+ type: authenticationType
71
+ };
72
+ }
73
+
74
+ if (authenticationType === 'aws') {
75
+ migrated = {
76
+ awsAccessKeyId: '',
77
+ awsSecretAccessKey: '',
78
+ ...decrypted,
79
+ type: authenticationType
80
+ };
81
+ }
82
+
83
+ if (authenticationType === 'custom') {
84
+ migrated = { ...decrypted,
85
+ type: authenticationType
86
+ };
87
+ }
88
+
89
+ if (migrated) {
90
+ const migratedServiceConfig = { ...serviceConfig,
91
+ authentication: encryptFn(migrated)
92
+ };
93
+ migratedServices.push([serviceKey, migratedServiceConfig]);
94
+ } else {
95
+ migratedServices.push([serviceKey, serviceConfig]);
96
+ }
97
+ } else {
98
+ migratedServices.push([serviceKey, serviceConfig]);
99
+ }
100
+ }
101
+
102
+ return { ...projectSchema,
103
+ services: (0, _fromPairs.default)(migratedServices),
104
+ schemaVersion: '3.11.0'
105
+ };
106
+ }
107
+
108
+ var _default = migrateToV3_11_0;
109
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_1_0, ProjectSchemaV3_2_0 } from '../../project-schema';
2
+ declare function migrateToV3_2(projectSchema: ProjectSchemaV3_1_0): ProjectSchemaV3_2_0;
3
+ export default migrateToV3_2;
4
+ //# sourceMappingURL=v3.2.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.2.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.2.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_2(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.2.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_2;
18
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ import type { ProjectSchemaV3_2_0, ProjectSchemaV3_3_0 } from '../../project-schema';
2
+ import type { ProjectSchemaMigrationContext } from '../types';
3
+ declare function migrateToV3_3(context: ProjectSchemaMigrationContext, projectSchema: ProjectSchemaV3_2_0): Promise<ProjectSchemaV3_3_0>;
4
+ export default migrateToV3_3;
5
+ //# sourceMappingURL=v3.3.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.3.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.3.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,UAAU,CAAC;AAE5D,iBAAe,aAAa,CAC1B,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,mBAAmB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAY9B;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ async function migrateToV3_3(context, projectSchema) {
9
+ const {
10
+ generateDataKeyFn
11
+ } = context;
12
+ const dataKey = projectSchema.dataKey ? projectSchema.dataKey : await generateDataKeyFn();
13
+ /**
14
+ * Generate a dataKey if none is present.
15
+ */
16
+
17
+ return { ...projectSchema,
18
+ schemaVersion: '3.3.0',
19
+ dataKey
20
+ };
21
+ }
22
+
23
+ var _default = migrateToV3_3;
24
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_3_0, ProjectSchemaV3_4_0 } from '../../project-schema';
2
+ declare function migrateToV3_4(projectSchema: ProjectSchemaV3_3_0): ProjectSchemaV3_4_0;
3
+ export default migrateToV3_4;
4
+ //# sourceMappingURL=v3.4.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.4.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.4.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_4(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.4.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_4;
18
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_4_0, ProjectSchemaV3_5_0 } from '../../project-schema';
2
+ declare function migrateToV3_5(projectSchema: ProjectSchemaV3_4_0): ProjectSchemaV3_5_0;
3
+ export default migrateToV3_5;
4
+ //# sourceMappingURL=v3.5.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.5.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.5.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_5(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.5.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_5;
18
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_5_0, ProjectSchemaV3_5_1 } from '../../project-schema';
2
+ declare function migrateToV3_5_1(projectSchema: ProjectSchemaV3_5_0): ProjectSchemaV3_5_1;
3
+ export default migrateToV3_5_1;
4
+ //# sourceMappingURL=v3.5.1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.5.1.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.5.1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,eAAe,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQhF;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_5_1(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.5.1'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_5_1;
18
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_5_1, ProjectSchemaV3_6_0 } from '../../project-schema';
2
+ declare function migrateToV3_6(projectSchema: ProjectSchemaV3_5_1): ProjectSchemaV3_6_0;
3
+ export default migrateToV3_6;
4
+ //# sourceMappingURL=v3.6.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.6.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.6.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_6(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.6.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_6;
18
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_6_0, ProjectSchemaV3_7_0 } from '../../project-schema';
2
+ declare function migrateToV3_7(projectSchema: ProjectSchemaV3_6_0): ProjectSchemaV3_7_0;
3
+ export default migrateToV3_7;
4
+ //# sourceMappingURL=v3.7.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.7.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.7.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_7(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.7.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_7;
18
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_7_0, ProjectSchemaV3_8_0 } from '../../project-schema';
2
+ declare function migrateToV3_8(projectSchema: ProjectSchemaV3_7_0): ProjectSchemaV3_8_0;
3
+ export default migrateToV3_8;
4
+ //# sourceMappingURL=v3.8.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.8.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.8.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEnF,iBAAS,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_8(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.8.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_8;
18
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_8_0, ProjectSchemaV3_9_0 } from '../../project-schema';
2
+ declare function migrateToV3_9_0(projectSchema: ProjectSchemaV3_8_0): ProjectSchemaV3_9_0;
3
+ export default migrateToV3_9_0;
4
+ //# sourceMappingURL=v3.9.0.d.ts.map