@takeshape/schema 8.69.0 → 8.74.0
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/es/index.js +1 -0
- package/es/migration/index.js +33 -107
- package/es/migration/to/v3.0.0.js +3 -3
- package/es/migration/to/v3.1.0.js +3 -3
- package/es/migration/to/v3.10.0.js +3 -3
- package/es/migration/to/v3.11.0.js +7 -6
- package/es/migration/to/v3.12.0.js +3 -3
- package/es/migration/to/v3.12.1.js +3 -3
- package/es/migration/to/v3.12.2.js +3 -3
- package/es/migration/to/v3.12.3.js +4 -4
- package/es/migration/to/v3.13.0.js +3 -3
- package/es/migration/to/v3.14.0.js +3 -3
- package/es/migration/to/v3.15.0.js +3 -3
- package/es/migration/to/v3.2.0.js +3 -3
- package/es/migration/to/v3.3.0.js +3 -3
- package/es/migration/to/v3.4.0.js +3 -3
- package/es/migration/to/v3.5.0.js +3 -3
- package/es/migration/to/v3.5.1.js +3 -3
- package/es/migration/to/v3.6.0.js +3 -3
- package/es/migration/to/v3.7.0.js +3 -3
- package/es/migration/to/v3.8.0.js +3 -3
- package/es/migration/to/v3.9.0.js +3 -3
- package/es/project-schema/index.js +64 -22
- package/es/project-schema/migrate.js +102 -0
- package/es/schema-util.js +1 -1
- package/es/schemas/index.js +34 -34
- package/es/schemas/index.ts +66 -66
- package/es/schemas/project-schema/latest.json +2359 -0
- package/es/schemas/project-schema/v1.0.0.json +1 -1
- package/es/schemas/project-schema/v3.0.0.json +1 -1
- package/es/schemas/project-schema/v3.15.0.json +7 -7
- package/es/schemas/project-schema.json +66 -19
- package/es/taxonomies.js +1 -1
- package/es/template-shapes/where.js +2 -2
- package/es/types/utils.js +1 -51
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +14 -0
- package/lib/migration/index.d.ts +23 -4
- package/lib/migration/index.d.ts.map +1 -1
- package/lib/migration/index.js +32 -111
- package/lib/migration/to/v3.0.0.d.ts +3 -2
- package/lib/migration/to/v3.0.0.d.ts.map +1 -1
- package/lib/migration/to/v3.0.0.js +3 -3
- package/lib/migration/to/v3.1.0.d.ts +3 -3
- package/lib/migration/to/v3.1.0.d.ts.map +1 -1
- package/lib/migration/to/v3.1.0.js +3 -3
- package/lib/migration/to/v3.10.0.d.ts +3 -2
- package/lib/migration/to/v3.10.0.d.ts.map +1 -1
- package/lib/migration/to/v3.10.0.js +3 -3
- package/lib/migration/to/v3.11.0.d.ts +3 -3
- package/lib/migration/to/v3.11.0.d.ts.map +1 -1
- package/lib/migration/to/v3.11.0.js +7 -6
- package/lib/migration/to/v3.12.0.d.ts +3 -2
- package/lib/migration/to/v3.12.0.d.ts.map +1 -1
- package/lib/migration/to/v3.12.0.js +3 -3
- package/lib/migration/to/v3.12.1.d.ts +3 -2
- package/lib/migration/to/v3.12.1.d.ts.map +1 -1
- package/lib/migration/to/v3.12.1.js +3 -3
- package/lib/migration/to/v3.12.2.d.ts +3 -2
- package/lib/migration/to/v3.12.2.d.ts.map +1 -1
- package/lib/migration/to/v3.12.2.js +3 -3
- package/lib/migration/to/v3.12.3.d.ts +3 -2
- package/lib/migration/to/v3.12.3.d.ts.map +1 -1
- package/lib/migration/to/v3.12.3.js +4 -4
- package/lib/migration/to/v3.13.0.d.ts +3 -2
- package/lib/migration/to/v3.13.0.d.ts.map +1 -1
- package/lib/migration/to/v3.13.0.js +3 -3
- package/lib/migration/to/v3.14.0.d.ts +3 -2
- package/lib/migration/to/v3.14.0.d.ts.map +1 -1
- package/lib/migration/to/v3.14.0.js +3 -3
- package/lib/migration/to/v3.15.0.d.ts +3 -2
- package/lib/migration/to/v3.15.0.d.ts.map +1 -1
- package/lib/migration/to/v3.15.0.js +3 -3
- package/lib/migration/to/v3.2.0.d.ts +3 -2
- package/lib/migration/to/v3.2.0.d.ts.map +1 -1
- package/lib/migration/to/v3.2.0.js +3 -3
- package/lib/migration/to/v3.3.0.d.ts +3 -3
- package/lib/migration/to/v3.3.0.d.ts.map +1 -1
- package/lib/migration/to/v3.3.0.js +3 -3
- package/lib/migration/to/v3.4.0.d.ts +3 -2
- package/lib/migration/to/v3.4.0.d.ts.map +1 -1
- package/lib/migration/to/v3.4.0.js +3 -3
- package/lib/migration/to/v3.5.0.d.ts +3 -2
- package/lib/migration/to/v3.5.0.d.ts.map +1 -1
- package/lib/migration/to/v3.5.0.js +3 -3
- package/lib/migration/to/v3.5.1.d.ts +3 -2
- package/lib/migration/to/v3.5.1.d.ts.map +1 -1
- package/lib/migration/to/v3.5.1.js +3 -3
- package/lib/migration/to/v3.6.0.d.ts +3 -2
- package/lib/migration/to/v3.6.0.d.ts.map +1 -1
- package/lib/migration/to/v3.6.0.js +3 -3
- package/lib/migration/to/v3.7.0.d.ts +3 -2
- package/lib/migration/to/v3.7.0.d.ts.map +1 -1
- package/lib/migration/to/v3.7.0.js +3 -3
- package/lib/migration/to/v3.8.0.d.ts +3 -2
- package/lib/migration/to/v3.8.0.d.ts.map +1 -1
- package/lib/migration/to/v3.8.0.js +3 -3
- package/lib/migration/to/v3.9.0.d.ts +3 -2
- package/lib/migration/to/v3.9.0.d.ts.map +1 -1
- package/lib/migration/to/v3.9.0.js +3 -3
- package/lib/migration/types.d.ts +1 -0
- package/lib/migration/types.d.ts.map +1 -1
- package/lib/project-schema/index.d.ts +66 -43
- package/lib/project-schema/index.d.ts.map +1 -1
- package/lib/project-schema/index.js +139 -23
- package/lib/project-schema/migrate.d.ts +5 -0
- package/lib/project-schema/migrate.d.ts.map +1 -0
- package/lib/project-schema/migrate.js +113 -0
- package/lib/project-schema/v1.0.0.d.ts +1 -1
- package/lib/project-schema/v1.0.0.d.ts.map +1 -1
- package/lib/project-schema/v3.0.0.d.ts +1 -1
- package/lib/project-schema/v3.0.0.d.ts.map +1 -1
- package/lib/schema-util.js +1 -1
- package/lib/schemas/index.d.ts +7009 -7009
- package/lib/schemas/index.js +34 -34
- package/lib/schemas/index.ts +66 -66
- package/lib/schemas/project-schema/latest.json +2359 -0
- package/lib/schemas/project-schema/v1.0.0.json +1 -1
- package/lib/schemas/project-schema/v3.0.0.json +1 -1
- package/lib/schemas/project-schema/v3.15.0.json +7 -7
- package/lib/schemas/project-schema.json +66 -19
- package/lib/taxonomies.js +1 -1
- package/lib/template-shapes/where.js +2 -2
- package/lib/types/utils.d.ts +1 -29
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types/utils.js +0 -80
- package/package.json +5 -5
package/es/index.js
CHANGED
package/es/migration/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import migrateToV3_5 from './to/v3.5.0';
|
|
1
|
+
import migrateToV3_0_0 from './to/v3.0.0';
|
|
2
|
+
import migrateToV3_1_0 from './to/v3.1.0';
|
|
3
|
+
import migrateToV3_2_0 from './to/v3.2.0';
|
|
4
|
+
import migrateToV3_3_0 from './to/v3.3.0';
|
|
5
|
+
import migrateToV3_4_0 from './to/v3.4.0';
|
|
6
|
+
import migrateToV3_5_0 from './to/v3.5.0';
|
|
8
7
|
import migrateToV3_5_1 from './to/v3.5.1';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import migrateToV3_6_0 from './to/v3.6.0';
|
|
9
|
+
import migrateToV3_7_0 from './to/v3.7.0';
|
|
10
|
+
import migrateToV3_8_0 from './to/v3.8.0';
|
|
12
11
|
import migrateToV3_9_0 from './to/v3.9.0';
|
|
13
|
-
import
|
|
12
|
+
import migrateToV3_10_0 from './to/v3.10.0';
|
|
14
13
|
import migrateToV3_11_0 from './to/v3.11.0';
|
|
15
14
|
import migrateToV3_12_0 from './to/v3.12.0';
|
|
16
15
|
import migrateToV3_12_1 from './to/v3.12.1';
|
|
@@ -19,100 +18,27 @@ import migrateToV3_12_3 from './to/v3.12.3';
|
|
|
19
18
|
import migrateToV3_13_0 from './to/v3.13.0';
|
|
20
19
|
import migrateToV3_14_0 from './to/v3.14.0';
|
|
21
20
|
import migrateToV3_15_0 from './to/v3.15.0';
|
|
21
|
+
export const migrateTo = {
|
|
22
|
+
'v3.0.0': migrateToV3_0_0,
|
|
23
|
+
'v3.1.0': migrateToV3_1_0,
|
|
24
|
+
'v3.2.0': migrateToV3_2_0,
|
|
25
|
+
'v3.3.0': migrateToV3_3_0,
|
|
26
|
+
'v3.4.0': migrateToV3_4_0,
|
|
27
|
+
'v3.5.0': migrateToV3_5_0,
|
|
28
|
+
'v3.5.1': migrateToV3_5_1,
|
|
29
|
+
'v3.6.0': migrateToV3_6_0,
|
|
30
|
+
'v3.7.0': migrateToV3_7_0,
|
|
31
|
+
'v3.8.0': migrateToV3_8_0,
|
|
32
|
+
'v3.9.0': migrateToV3_9_0,
|
|
33
|
+
'v3.10.0': migrateToV3_10_0,
|
|
34
|
+
'v3.11.0': migrateToV3_11_0,
|
|
35
|
+
'v3.12.0': migrateToV3_12_0,
|
|
36
|
+
'v3.12.1': migrateToV3_12_1,
|
|
37
|
+
'v3.12.2': migrateToV3_12_2,
|
|
38
|
+
'v3.12.3': migrateToV3_12_3,
|
|
39
|
+
'v3.13.0': migrateToV3_13_0,
|
|
40
|
+
'v3.14.0': migrateToV3_14_0,
|
|
41
|
+
'v3.15.0': migrateToV3_15_0
|
|
42
|
+
};
|
|
22
43
|
export * from './utils';
|
|
23
|
-
export const listTypePrefix = 'PaginatedList';
|
|
24
|
-
|
|
25
|
-
export async function migrateToLatestProjectSchema(context, projectSchema) {
|
|
26
|
-
if (projectSchema.schemaVersion === '4.0.0') {
|
|
27
|
-
throw new Error('You are using an unreleased schema version. Migration is not possible');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (isProjectSchemaV1(projectSchema)) {
|
|
31
|
-
projectSchema = migrateToV3(projectSchema);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (isProjectSchemaV3(projectSchema)) {
|
|
35
|
-
projectSchema = await migrateToV3_1(context, projectSchema);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (isProjectSchemaV3_1(projectSchema)) {
|
|
39
|
-
projectSchema = migrateToV3_2(projectSchema);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (isProjectSchemaV3_2(projectSchema)) {
|
|
43
|
-
projectSchema = await migrateToV3_3(context, projectSchema);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (isProjectSchemaV3_3(projectSchema)) {
|
|
47
|
-
projectSchema = migrateToV3_4(projectSchema);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (isProjectSchemaV3_4(projectSchema)) {
|
|
51
|
-
projectSchema = migrateToV3_5(projectSchema);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (isProjectSchemaV3_5(projectSchema)) {
|
|
55
|
-
projectSchema = migrateToV3_5_1(projectSchema);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (isProjectSchemaV3_5_1(projectSchema)) {
|
|
59
|
-
projectSchema = migrateToV3_6(projectSchema);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (isProjectSchemaV3_6(projectSchema)) {
|
|
63
|
-
projectSchema = migrateToV3_7(projectSchema);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (isProjectSchemaV3_7(projectSchema)) {
|
|
67
|
-
projectSchema = migrateToV3_8(projectSchema);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (isProjectSchemaV3_8(projectSchema)) {
|
|
71
|
-
projectSchema = migrateToV3_9_0(projectSchema);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (isProjectSchemaV3_9(projectSchema)) {
|
|
75
|
-
projectSchema = migrateToV3_10(projectSchema);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (isProjectSchemaV3_10(projectSchema)) {
|
|
79
|
-
projectSchema = migrateToV3_11_0(context, projectSchema);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (isProjectSchemaV3_11(projectSchema)) {
|
|
83
|
-
projectSchema = migrateToV3_12_0(projectSchema);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (isProjectSchemaV3_12(projectSchema)) {
|
|
87
|
-
projectSchema = migrateToV3_12_1(projectSchema);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (isProjectSchemaV3_12_1(projectSchema)) {
|
|
91
|
-
projectSchema = migrateToV3_12_2(projectSchema);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (isProjectSchemaV3_12_2(projectSchema)) {
|
|
95
|
-
projectSchema = migrateToV3_12_3(projectSchema);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (isProjectSchemaV3_12_3(projectSchema)) {
|
|
99
|
-
projectSchema = migrateToV3_13_0(projectSchema);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (isProjectSchemaV3_13_0(projectSchema)) {
|
|
103
|
-
projectSchema = migrateToV3_14_0(projectSchema);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (isProjectSchemaV3_14_0(projectSchema)) {
|
|
107
|
-
projectSchema = migrateToV3_15_0(projectSchema);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return projectSchema;
|
|
111
|
-
}
|
|
112
|
-
export async function ensureLatest(context, schema) {
|
|
113
|
-
if (!schema || isLatestProjectSchema(schema)) {
|
|
114
|
-
return schema;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return migrateToLatestProjectSchema(context, schema);
|
|
118
|
-
}
|
|
44
|
+
export const listTypePrefix = 'PaginatedList';
|
|
@@ -233,7 +233,7 @@ function contentTypeToShape(contentType, contentTypeId) {
|
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
const migrate = async (_, projectSchema) => {
|
|
237
237
|
const {
|
|
238
238
|
contentTypes,
|
|
239
239
|
created,
|
|
@@ -258,6 +258,6 @@ function migrateToV3_0_0(projectSchema) {
|
|
|
258
258
|
shapes,
|
|
259
259
|
forms
|
|
260
260
|
});
|
|
261
|
-
}
|
|
261
|
+
};
|
|
262
262
|
|
|
263
|
-
export default
|
|
263
|
+
export default migrate;
|
|
@@ -185,7 +185,7 @@ function mapAuthType(authType, auth) {
|
|
|
185
185
|
return 'unknown';
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
async
|
|
188
|
+
const migrate = async (context, projectSchema) => {
|
|
189
189
|
const {
|
|
190
190
|
encryptFn,
|
|
191
191
|
decryptFn
|
|
@@ -213,6 +213,6 @@ async function migrateToV3_1(context, projectSchema) {
|
|
|
213
213
|
services,
|
|
214
214
|
schemaVersion: '3.1.0'
|
|
215
215
|
});
|
|
216
|
-
}
|
|
216
|
+
};
|
|
217
217
|
|
|
218
|
-
export default
|
|
218
|
+
export default migrate;
|
|
@@ -75,7 +75,7 @@ function migrateShapeToV3_10(shape) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
const migrate = async (_, projectSchema) => {
|
|
79
79
|
const {
|
|
80
80
|
queries,
|
|
81
81
|
mutations,
|
|
@@ -90,6 +90,6 @@ function migrateToV3_10(projectSchema) {
|
|
|
90
90
|
shapes: mapValues(shapes, migrateShapeToV3_10),
|
|
91
91
|
schemaVersion: '3.10.0'
|
|
92
92
|
};
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
|
|
95
|
-
export default
|
|
95
|
+
export default migrate;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import fromPairs from 'lodash/fromPairs';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const migrate = async (context, projectSchema) => {
|
|
4
|
+
const {
|
|
5
|
+
decryptFn,
|
|
6
|
+
encryptFn
|
|
7
|
+
} = context;
|
|
7
8
|
const migratedServices = [];
|
|
8
9
|
|
|
9
10
|
for (const [serviceKey, serviceConfig] of Object.entries(projectSchema.services ?? {})) {
|
|
@@ -94,6 +95,6 @@ function migrateToV3_11_0({
|
|
|
94
95
|
services: fromPairs(migratedServices),
|
|
95
96
|
schemaVersion: '3.11.0'
|
|
96
97
|
};
|
|
97
|
-
}
|
|
98
|
+
};
|
|
98
99
|
|
|
99
|
-
export default
|
|
100
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.12.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.12.1'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.12.2'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -13,10 +13,10 @@ function hasWebhook(projectSchema, config) {
|
|
|
13
13
|
return resolver && 'service' in resolver && (projectSchema === null || projectSchema === void 0 ? void 0 : (_projectSchema$servic = projectSchema.services) === null || _projectSchema$servic === void 0 ? void 0 : _projectSchema$servic[resolver.service].provider) === 'shopify';
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const migrate = async (_, {
|
|
17
17
|
indexedShapes: oldIndexedShapes,
|
|
18
18
|
...projectSchema
|
|
19
|
-
}) {
|
|
19
|
+
}) => {
|
|
20
20
|
if (!oldIndexedShapes) {
|
|
21
21
|
return { ...projectSchema,
|
|
22
22
|
schemaVersion: '3.12.3'
|
|
@@ -76,6 +76,6 @@ function migrateToV3_12_3({
|
|
|
76
76
|
schemaVersion: '3.12.3',
|
|
77
77
|
indexedShapes
|
|
78
78
|
};
|
|
79
|
-
}
|
|
79
|
+
};
|
|
80
80
|
|
|
81
|
-
export default
|
|
81
|
+
export default migrate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { visit } from '@takeshape/util';
|
|
2
2
|
import get from 'lodash/get';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const migrate = async (_, projectSchema) => {
|
|
5
5
|
visit(projectSchema, ['@relationship'], (relationship, path) => {
|
|
6
6
|
const parent = get(projectSchema, path.slice(0, -1));
|
|
7
7
|
parent['@backreference'] = {
|
|
@@ -16,6 +16,6 @@ function migrateToV3_13_0(projectSchema) {
|
|
|
16
16
|
return { ...projectSchema,
|
|
17
17
|
schemaVersion: '3.13.0'
|
|
18
18
|
};
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
|
-
export default
|
|
21
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.14.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.15.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.2.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
async
|
|
1
|
+
const migrate = async (context, projectSchema) => {
|
|
2
2
|
const {
|
|
3
3
|
generateDataKeyFn
|
|
4
4
|
} = context;
|
|
@@ -11,6 +11,6 @@ async function migrateToV3_3(context, projectSchema) {
|
|
|
11
11
|
schemaVersion: '3.3.0',
|
|
12
12
|
dataKey
|
|
13
13
|
};
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
|
|
16
|
-
export default
|
|
16
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.4.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.5.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.5.1'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.6.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.7.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const migrate = async (_, projectSchema) => {
|
|
2
2
|
/**
|
|
3
3
|
* No migration needed all changes are backwards compatible.
|
|
4
4
|
*/
|
|
5
5
|
return { ...projectSchema,
|
|
6
6
|
schemaVersion: '3.8.0'
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default migrate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { visit } from '@takeshape/util';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const migrate = async (_, projectSchema) => {
|
|
4
4
|
/**
|
|
5
5
|
* Resolver props that are guaranteed in this version, and dependent on the
|
|
6
6
|
* resolver type. Ensure they exist.
|
|
@@ -78,6 +78,6 @@ function migrateToV3_9_0(projectSchema) {
|
|
|
78
78
|
return { ...projectSchema,
|
|
79
79
|
schemaVersion: '3.9.0'
|
|
80
80
|
};
|
|
81
|
-
}
|
|
81
|
+
};
|
|
82
82
|
|
|
83
|
-
export default
|
|
83
|
+
export default migrate;
|
|
@@ -1,25 +1,67 @@
|
|
|
1
1
|
// This file is generated by "pnpm json2ts"
|
|
2
2
|
export * from './latest';
|
|
3
|
-
export * from './v4.0.0';
|
|
4
|
-
export * from './v3.15.0';
|
|
5
|
-
export * from './v3.14.0';
|
|
6
|
-
export * from './v3.13.0';
|
|
7
|
-
export * from './v3.12.3';
|
|
8
|
-
export * from './v3.12.2';
|
|
9
|
-
export * from './v3.12.1';
|
|
10
|
-
export * from './v3.12.0';
|
|
11
|
-
export * from './v3.11.0';
|
|
12
|
-
export * from './v3.10.0';
|
|
13
|
-
export * from './v3.9.0';
|
|
14
|
-
export * from './v3.8.0';
|
|
15
|
-
export * from './v3.7.0';
|
|
16
|
-
export * from './v3.6.0';
|
|
17
|
-
export * from './v3.5.1';
|
|
18
|
-
export * from './v3.5.0';
|
|
19
|
-
export * from './v3.4.0';
|
|
20
|
-
export * from './v3.3.0';
|
|
21
|
-
export * from './v3.2.0';
|
|
22
|
-
export * from './v3.1.0';
|
|
23
|
-
export * from './v3.0.0';
|
|
24
3
|
export * from './v1.0.0';
|
|
25
|
-
export
|
|
4
|
+
export * from './v3.0.0';
|
|
5
|
+
export * from './v3.1.0';
|
|
6
|
+
export * from './v3.2.0';
|
|
7
|
+
export * from './v3.3.0';
|
|
8
|
+
export * from './v3.4.0';
|
|
9
|
+
export * from './v3.5.0';
|
|
10
|
+
export * from './v3.5.1';
|
|
11
|
+
export * from './v3.6.0';
|
|
12
|
+
export * from './v3.7.0';
|
|
13
|
+
export * from './v3.8.0';
|
|
14
|
+
export * from './v3.9.0';
|
|
15
|
+
export * from './v3.10.0';
|
|
16
|
+
export * from './v3.11.0';
|
|
17
|
+
export * from './v3.12.0';
|
|
18
|
+
export * from './v3.12.1';
|
|
19
|
+
export * from './v3.12.2';
|
|
20
|
+
export * from './v3.12.3';
|
|
21
|
+
export * from './v3.13.0';
|
|
22
|
+
export * from './v3.14.0';
|
|
23
|
+
export * from './v3.15.0';
|
|
24
|
+
export * from './v4.0.0';
|
|
25
|
+
|
|
26
|
+
// Schema type utilities
|
|
27
|
+
function createVersionPredicate(expectedVersion) {
|
|
28
|
+
return projectSchema => {
|
|
29
|
+
let {
|
|
30
|
+
schemaVersion
|
|
31
|
+
} = projectSchema;
|
|
32
|
+
|
|
33
|
+
if (!schemaVersion || schemaVersion === '1') {
|
|
34
|
+
schemaVersion = '1.0.0';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (schemaVersion === '3') {
|
|
38
|
+
schemaVersion = '3.0.0';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return Boolean(expectedVersion && schemaVersion && expectedVersion === schemaVersion);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const isProjectSchemaV1_0_0 = createVersionPredicate('1.0.0');
|
|
46
|
+
export const isProjectSchemaV3_0_0 = createVersionPredicate('3.0.0');
|
|
47
|
+
export const isProjectSchemaV3_1_0 = createVersionPredicate('3.1.0');
|
|
48
|
+
export const isProjectSchemaV3_2_0 = createVersionPredicate('3.2.0');
|
|
49
|
+
export const isProjectSchemaV3_3_0 = createVersionPredicate('3.3.0');
|
|
50
|
+
export const isProjectSchemaV3_4_0 = createVersionPredicate('3.4.0');
|
|
51
|
+
export const isProjectSchemaV3_5_0 = createVersionPredicate('3.5.0');
|
|
52
|
+
export const isProjectSchemaV3_5_1 = createVersionPredicate('3.5.1');
|
|
53
|
+
export const isProjectSchemaV3_6_0 = createVersionPredicate('3.6.0');
|
|
54
|
+
export const isProjectSchemaV3_7_0 = createVersionPredicate('3.7.0');
|
|
55
|
+
export const isProjectSchemaV3_8_0 = createVersionPredicate('3.8.0');
|
|
56
|
+
export const isProjectSchemaV3_9_0 = createVersionPredicate('3.9.0');
|
|
57
|
+
export const isProjectSchemaV3_10_0 = createVersionPredicate('3.10.0');
|
|
58
|
+
export const isProjectSchemaV3_11_0 = createVersionPredicate('3.11.0');
|
|
59
|
+
export const isProjectSchemaV3_12_0 = createVersionPredicate('3.12.0');
|
|
60
|
+
export const isProjectSchemaV3_12_1 = createVersionPredicate('3.12.1');
|
|
61
|
+
export const isProjectSchemaV3_12_2 = createVersionPredicate('3.12.2');
|
|
62
|
+
export const isProjectSchemaV3_12_3 = createVersionPredicate('3.12.3');
|
|
63
|
+
export const isProjectSchemaV3_13_0 = createVersionPredicate('3.13.0');
|
|
64
|
+
export const isProjectSchemaV3_14_0 = createVersionPredicate('3.14.0');
|
|
65
|
+
export const isProjectSchemaV3_15_0 = createVersionPredicate('3.15.0');
|
|
66
|
+
export const isLatestProjectSchema = createVersionPredicate('3.15.0');
|
|
67
|
+
export const isProjectSchemaV4_0_0 = createVersionPredicate('4.0.0');
|