@takeshape/schema 8.70.0 → 8.72.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/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/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/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/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
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"title": "Shape Schema All Of",
|
|
216
216
|
"type": "object",
|
|
217
217
|
"properties": {
|
|
218
|
-
"allOf": {"$ref":
|
|
218
|
+
"allOf": {"$ref": "#/definitions/objectOrRefArray"}
|
|
219
219
|
},
|
|
220
220
|
"required": ["allOf"],
|
|
221
221
|
"additionalProperties": false
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
{
|
|
228
228
|
"type": "object",
|
|
229
229
|
"properties": {
|
|
230
|
-
"allOf": {"$ref":
|
|
230
|
+
"allOf": {"$ref": "#/definitions/objectOrRefArray"}
|
|
231
231
|
},
|
|
232
232
|
"required": ["allOf"]
|
|
233
233
|
}
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"title": "ShapeSchemaExtends",
|
|
238
238
|
"type": "object",
|
|
239
239
|
"properties": {
|
|
240
|
-
"extends": {"$ref":
|
|
240
|
+
"extends": {"$ref": "#/definitions/objectOrRefArray"}
|
|
241
241
|
},
|
|
242
242
|
"required": ["extends"],
|
|
243
243
|
"additionalProperties": false
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
{
|
|
250
250
|
"type": "object",
|
|
251
251
|
"properties": {
|
|
252
|
-
"extends": {"$ref":
|
|
252
|
+
"extends": {"$ref": "#/definitions/objectOrRefArray"}
|
|
253
253
|
},
|
|
254
254
|
"required": ["extends"]
|
|
255
255
|
}
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
"title": "Shape Schema One Of",
|
|
260
260
|
"type": "object",
|
|
261
261
|
"properties": {
|
|
262
|
-
"oneOf": {"$ref":
|
|
262
|
+
"oneOf": {"$ref": "#/definitions/objectOrRefArray"}
|
|
263
263
|
},
|
|
264
264
|
"required": ["oneOf"],
|
|
265
265
|
"additionalProperties": false
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
{
|
|
272
272
|
"type": "object",
|
|
273
273
|
"properties": {
|
|
274
|
-
"oneOf": {"$ref":
|
|
274
|
+
"oneOf": {"$ref": "#/definitions/objectOrRefArray"}
|
|
275
275
|
},
|
|
276
276
|
"required": ["oneOf"],
|
|
277
277
|
"additionalProperties": false
|
|
@@ -1439,7 +1439,7 @@
|
|
|
1439
1439
|
"$ref": "#/definitions/schemaArray"
|
|
1440
1440
|
},
|
|
1441
1441
|
"extends": {
|
|
1442
|
-
"$ref":
|
|
1442
|
+
"$ref": "#/definitions/objectOrRefArray"
|
|
1443
1443
|
},
|
|
1444
1444
|
"@relationship": {
|
|
1445
1445
|
"$ref": "#/definitions/relationship"
|
|
@@ -3,24 +3,71 @@
|
|
|
3
3
|
"$id": "https://schema.takeshape.io/project-schema#",
|
|
4
4
|
"title": "Any Project Schema",
|
|
5
5
|
"oneOf": [
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
6
|
+
{
|
|
7
|
+
"$ref": "https://schema.takeshape.io/project-schema/v1.0.0#"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.0.0#"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.1.0#"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.2.0#"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.3.0#"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.4.0#"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.5.0#"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.5.1#"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.6.0#"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.7.0#"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.8.0#"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.9.0#"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.10.0#"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.11.0#"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.12.0#"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.12.1#"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.12.2#"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.12.3#"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.13.0#"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.14.0#"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"$ref": "https://schema.takeshape.io/project-schema/v3.15.0#"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"$ref": "https://schema.takeshape.io/project-schema/v4.0.0#"
|
|
71
|
+
}
|
|
25
72
|
]
|
|
26
73
|
}
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProjectSchema, DirectiveMappingArray, DirectiveMappingMap, DirectiveConfig, ParameterSerializeOptions, ParameterSerializeContentOptions, ParameterSerializeStyleOptions, BasicResolver, ComposeResolver, GraphqlResolver, TakeshapeResolver, RestResolver, AwsLambdaResolver, UtilResolver, ObjectSchema, ReturnShapeArraySchema, ShapeSchemaEnum, RefSchema, RefSchemaLegacy, PropertySchema, AnyServiceConfig, ServiceAuthentication, BearerAuthentication, BasicAuthentication, OAuth2Authentication, OAuth2BearerAuthentication, SearchParamsAuthentication, CustomAuthentication, ParameterOp, ParameterOpNested, ParameterOpMapping, ParameterOpValue, ParameterOpOp, ParameterSerializeStyleOptionsForSearchParams, ParameterSerializeStyleOptionsForPathParams, OneOfSchema, AllOfSchema, ExtendsSchema } from '../project-schema';
|
|
2
2
|
import type { Maybe } from '@takeshape/util';
|
|
3
3
|
import type { ShopifyServiceConfig, RESTServiceConfig, GraphQLServiceConfig, OpenAPIServiceConfig, EncryptedServiceConfig, SchemaWithArgs, SchemaWithRef, ServiceConfigWithOAuth2Authentication, ServiceConfigWithCustomAuthentication, LatestProjectSchemaWithServices, ProjectSchemaV3X } from './types';
|
|
4
4
|
import { ArgsType, RefType } from './types';
|
|
@@ -13,35 +13,7 @@ export declare function isGraphqlResolver(resolver: BasicResolver): resolver is
|
|
|
13
13
|
export declare function isRestResolver(resolver: BasicResolver): resolver is RestResolver;
|
|
14
14
|
export declare function isAwsLambdaResolver(resolver: BasicResolver): resolver is AwsLambdaResolver;
|
|
15
15
|
export declare function isUtilResolver(resolver: BasicResolver): resolver is UtilResolver;
|
|
16
|
-
/** Project Schema Version Utils **/
|
|
17
|
-
export declare const isProjectSchemaV1: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV1_0_0;
|
|
18
|
-
export declare const isProjectSchemaV3: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_0_0;
|
|
19
|
-
export declare const isProjectSchemaV3_1: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_1_0;
|
|
20
|
-
export declare const isProjectSchemaV3_2: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_2_0;
|
|
21
|
-
export declare const isProjectSchemaV3_3: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_3_0;
|
|
22
|
-
export declare const isProjectSchemaV3_4: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_4_0;
|
|
23
|
-
export declare const isProjectSchemaV3_5: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_5_0;
|
|
24
|
-
export declare const isProjectSchemaV3_5_1: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_5_1;
|
|
25
|
-
export declare const isProjectSchemaV3_6: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_6_0;
|
|
26
|
-
export declare const isProjectSchemaV3_7: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_7_0;
|
|
27
|
-
export declare const isProjectSchemaV3_8: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_8_0;
|
|
28
|
-
export declare const isProjectSchemaV3_9: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_9_0;
|
|
29
|
-
export declare const isProjectSchemaV3_10: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_10_0;
|
|
30
|
-
export declare const isProjectSchemaV3_11: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_11_0;
|
|
31
|
-
export declare const isProjectSchemaV3_12: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_12_0;
|
|
32
|
-
export declare const isProjectSchemaV3_12_1: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_12_1;
|
|
33
|
-
export declare const isProjectSchemaV3_12_2: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_12_2;
|
|
34
|
-
export declare const isProjectSchemaV3_12_3: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_12_3;
|
|
35
|
-
export declare const isProjectSchemaV3_13_0: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_13_0;
|
|
36
|
-
export declare const isProjectSchemaV3_14_0: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_14_0;
|
|
37
|
-
export declare const isProjectSchemaV3_15_0: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchemaV3_13_0;
|
|
38
|
-
export declare const isLatestProjectSchema: (projectSchema: AnyProjectSchema) => projectSchema is ProjectSchema;
|
|
39
|
-
export declare function isV1XSchema(maybeSchema: unknown): maybeSchema is ProjectSchemaV1_0_0;
|
|
40
16
|
export declare function isV3XSchema(maybeSchema: unknown): maybeSchema is ProjectSchemaV3X;
|
|
41
|
-
/**
|
|
42
|
-
* Determine whether a given project schema is any project schema.
|
|
43
|
-
*/
|
|
44
|
-
export declare function isAnyProjectSchema(value: unknown): value is AnyProjectSchema;
|
|
45
17
|
export declare function isProjectSchemaWithServices(schema: ProjectSchema): schema is LatestProjectSchemaWithServices;
|
|
46
18
|
/** Directive Mapping Utils **/
|
|
47
19
|
/**
|
package/lib/types/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,gCAAgC,E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ports.getArgsType = void 0;
|
|
7
7
|
exports.isAllOfSchema = isAllOfSchema;
|
|
8
|
-
exports.isAnyProjectSchema = isAnyProjectSchema;
|
|
9
8
|
exports.isAnyServiceConfig = isAnyServiceConfig;
|
|
10
9
|
exports.isArraySchema = isArraySchema;
|
|
11
10
|
exports.isAwsLambdaResolver = isAwsLambdaResolver;
|
|
@@ -22,7 +21,6 @@ exports.isEnumSchema = isEnumSchema;
|
|
|
22
21
|
exports.isExtendsSchema = isExtendsSchema;
|
|
23
22
|
exports.isGraphQLServiceConfig = isGraphQLServiceConfig;
|
|
24
23
|
exports.isGraphqlResolver = isGraphqlResolver;
|
|
25
|
-
exports.isLatestProjectSchema = void 0;
|
|
26
24
|
exports.isOAuth2Authentication = isOAuth2Authentication;
|
|
27
25
|
exports.isOAuth2BearerAuthentication = isOAuth2BearerAuthentication;
|
|
28
26
|
exports.isObjectSchema = isObjectSchema;
|
|
@@ -37,7 +35,6 @@ exports.isParameterSerializeContentOptions = isParameterSerializeContentOptions;
|
|
|
37
35
|
exports.isParameterSerializeStyleForPathParams = isParameterSerializeStyleForPathParams;
|
|
38
36
|
exports.isParameterSerializeStyleForSearchParams = isParameterSerializeStyleForSearchParams;
|
|
39
37
|
exports.isParameterSerializeStyleOptions = isParameterSerializeStyleOptions;
|
|
40
|
-
exports.isProjectSchemaV3_9 = exports.isProjectSchemaV3_8 = exports.isProjectSchemaV3_7 = exports.isProjectSchemaV3_6 = exports.isProjectSchemaV3_5_1 = exports.isProjectSchemaV3_5 = exports.isProjectSchemaV3_4 = exports.isProjectSchemaV3_3 = exports.isProjectSchemaV3_2 = exports.isProjectSchemaV3_15_0 = exports.isProjectSchemaV3_14_0 = exports.isProjectSchemaV3_13_0 = exports.isProjectSchemaV3_12_3 = exports.isProjectSchemaV3_12_2 = exports.isProjectSchemaV3_12_1 = exports.isProjectSchemaV3_12 = exports.isProjectSchemaV3_11 = exports.isProjectSchemaV3_10 = exports.isProjectSchemaV3_1 = exports.isProjectSchemaV3 = exports.isProjectSchemaV1 = void 0;
|
|
41
38
|
exports.isProjectSchemaWithServices = isProjectSchemaWithServices;
|
|
42
39
|
exports.isRESTServiceConfig = isRESTServiceConfig;
|
|
43
40
|
exports.isRefSchema = isRefSchema;
|
|
@@ -50,15 +47,12 @@ exports.isServiceConfigWithOAuth2Authentication = isServiceConfigWithOAuth2Authe
|
|
|
50
47
|
exports.isShopifyServiceConfig = isShopifyServiceConfig;
|
|
51
48
|
exports.isTakeshapeResolver = isTakeshapeResolver;
|
|
52
49
|
exports.isUtilResolver = isUtilResolver;
|
|
53
|
-
exports.isV1XSchema = isV1XSchema;
|
|
54
50
|
exports.isV3XSchema = isV3XSchema;
|
|
55
51
|
|
|
56
52
|
var _util = require("@takeshape/util");
|
|
57
53
|
|
|
58
54
|
var _types = require("./types");
|
|
59
55
|
|
|
60
|
-
var _eq = _interopRequireDefault(require("semver/functions/eq"));
|
|
61
|
-
|
|
62
56
|
var _coerce = _interopRequireDefault(require("semver/functions/coerce"));
|
|
63
57
|
|
|
64
58
|
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
|
|
@@ -67,8 +61,6 @@ var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
|
67
61
|
|
|
68
62
|
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
69
63
|
|
|
70
|
-
var _isUndefined = _interopRequireDefault(require("lodash/isUndefined"));
|
|
71
|
-
|
|
72
64
|
var _has = _interopRequireDefault(require("lodash/has"));
|
|
73
65
|
|
|
74
66
|
var _schemas = require("../schemas");
|
|
@@ -120,65 +112,6 @@ function isUtilResolver(resolver) {
|
|
|
120
112
|
return utilResolver.properties.name.enum.includes(resolver.name);
|
|
121
113
|
}
|
|
122
114
|
|
|
123
|
-
function createVersionPredicate(schemaVersion) {
|
|
124
|
-
const expectedSemver = (0, _coerce.default)(schemaVersion);
|
|
125
|
-
return projectSchema => {
|
|
126
|
-
const schemaSemver = (0, _coerce.default)(projectSchema.schemaVersion ?? '1');
|
|
127
|
-
return Boolean(expectedSemver && schemaSemver && (0, _eq.default)(schemaSemver, expectedSemver));
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/** Project Schema Version Utils **/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const isProjectSchemaV1 = createVersionPredicate('1');
|
|
134
|
-
exports.isProjectSchemaV1 = isProjectSchemaV1;
|
|
135
|
-
const isProjectSchemaV3 = createVersionPredicate('3');
|
|
136
|
-
exports.isProjectSchemaV3 = isProjectSchemaV3;
|
|
137
|
-
const isProjectSchemaV3_1 = createVersionPredicate('3.1.0');
|
|
138
|
-
exports.isProjectSchemaV3_1 = isProjectSchemaV3_1;
|
|
139
|
-
const isProjectSchemaV3_2 = createVersionPredicate('3.2.0');
|
|
140
|
-
exports.isProjectSchemaV3_2 = isProjectSchemaV3_2;
|
|
141
|
-
const isProjectSchemaV3_3 = createVersionPredicate('3.3.0');
|
|
142
|
-
exports.isProjectSchemaV3_3 = isProjectSchemaV3_3;
|
|
143
|
-
const isProjectSchemaV3_4 = createVersionPredicate('3.4.0');
|
|
144
|
-
exports.isProjectSchemaV3_4 = isProjectSchemaV3_4;
|
|
145
|
-
const isProjectSchemaV3_5 = createVersionPredicate('3.5.0');
|
|
146
|
-
exports.isProjectSchemaV3_5 = isProjectSchemaV3_5;
|
|
147
|
-
const isProjectSchemaV3_5_1 = createVersionPredicate('3.5.1');
|
|
148
|
-
exports.isProjectSchemaV3_5_1 = isProjectSchemaV3_5_1;
|
|
149
|
-
const isProjectSchemaV3_6 = createVersionPredicate('3.6.0');
|
|
150
|
-
exports.isProjectSchemaV3_6 = isProjectSchemaV3_6;
|
|
151
|
-
const isProjectSchemaV3_7 = createVersionPredicate('3.7.0');
|
|
152
|
-
exports.isProjectSchemaV3_7 = isProjectSchemaV3_7;
|
|
153
|
-
const isProjectSchemaV3_8 = createVersionPredicate('3.8.0');
|
|
154
|
-
exports.isProjectSchemaV3_8 = isProjectSchemaV3_8;
|
|
155
|
-
const isProjectSchemaV3_9 = createVersionPredicate('3.9.0');
|
|
156
|
-
exports.isProjectSchemaV3_9 = isProjectSchemaV3_9;
|
|
157
|
-
const isProjectSchemaV3_10 = createVersionPredicate('3.10.0');
|
|
158
|
-
exports.isProjectSchemaV3_10 = isProjectSchemaV3_10;
|
|
159
|
-
const isProjectSchemaV3_11 = createVersionPredicate('3.11.0');
|
|
160
|
-
exports.isProjectSchemaV3_11 = isProjectSchemaV3_11;
|
|
161
|
-
const isProjectSchemaV3_12 = createVersionPredicate('3.12.0');
|
|
162
|
-
exports.isProjectSchemaV3_12 = isProjectSchemaV3_12;
|
|
163
|
-
const isProjectSchemaV3_12_1 = createVersionPredicate('3.12.1');
|
|
164
|
-
exports.isProjectSchemaV3_12_1 = isProjectSchemaV3_12_1;
|
|
165
|
-
const isProjectSchemaV3_12_2 = createVersionPredicate('3.12.2');
|
|
166
|
-
exports.isProjectSchemaV3_12_2 = isProjectSchemaV3_12_2;
|
|
167
|
-
const isProjectSchemaV3_12_3 = createVersionPredicate('3.12.3');
|
|
168
|
-
exports.isProjectSchemaV3_12_3 = isProjectSchemaV3_12_3;
|
|
169
|
-
const isProjectSchemaV3_13_0 = createVersionPredicate('3.13.0');
|
|
170
|
-
exports.isProjectSchemaV3_13_0 = isProjectSchemaV3_13_0;
|
|
171
|
-
const isProjectSchemaV3_14_0 = createVersionPredicate('3.14.0');
|
|
172
|
-
exports.isProjectSchemaV3_14_0 = isProjectSchemaV3_14_0;
|
|
173
|
-
const isProjectSchemaV3_15_0 = createVersionPredicate('3.15.0');
|
|
174
|
-
exports.isProjectSchemaV3_15_0 = isProjectSchemaV3_15_0;
|
|
175
|
-
const isLatestProjectSchema = createVersionPredicate(_schemas.CURRENT_SCHEMA_VERSION);
|
|
176
|
-
exports.isLatestProjectSchema = isLatestProjectSchema;
|
|
177
|
-
|
|
178
|
-
function isV1XSchema(maybeSchema) {
|
|
179
|
-
return (0, _util.isRecord)(maybeSchema) && (0, _isString.default)(maybeSchema.projectId) && (0, _util.isRecord)(maybeSchema.contentTypes) && ((0, _isUndefined.default)(maybeSchema.schemaVersion) || maybeSchema.schemaVersion === '1' || maybeSchema.schemaVersion === '1.0.0');
|
|
180
|
-
}
|
|
181
|
-
|
|
182
115
|
function isV3XSchema(maybeSchema) {
|
|
183
116
|
if (!(0, _util.isRecord)(maybeSchema) || !(0, _isString.default)(maybeSchema.projectId) || !(0, _isString.default)(maybeSchema.schemaVersion)) {
|
|
184
117
|
return false;
|
|
@@ -187,19 +120,6 @@ function isV3XSchema(maybeSchema) {
|
|
|
187
120
|
const version = (0, _coerce.default)(maybeSchema.schemaVersion);
|
|
188
121
|
return version ? (0, _satisfies.default)(version, '^3.0.0') : false;
|
|
189
122
|
}
|
|
190
|
-
/**
|
|
191
|
-
* Determine whether a given project schema is any project schema.
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
function isAnyProjectSchema(value) {
|
|
196
|
-
if (!(0, _util.isRecord)(value)) {
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const maybeSchema = value;
|
|
201
|
-
return (0, _util.isRecord)(value) && (0, _isString.default)(maybeSchema.projectId) && (isV1XSchema(maybeSchema) || isV3XSchema(maybeSchema));
|
|
202
|
-
}
|
|
203
123
|
|
|
204
124
|
function isProjectSchemaWithServices(schema) {
|
|
205
125
|
return typeof schema.dataKey !== 'undefined' && typeof schema.services !== 'undefined';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.72.0",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"examples"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@takeshape/errors": "8.
|
|
25
|
-
"@takeshape/json-schema": "8.
|
|
26
|
-
"@takeshape/util": "8.
|
|
24
|
+
"@takeshape/errors": "8.72.0",
|
|
25
|
+
"@takeshape/json-schema": "8.72.0",
|
|
26
|
+
"@takeshape/util": "8.72.0",
|
|
27
27
|
"ajv": "^7.0.4",
|
|
28
28
|
"ajv-formats": "^1.5.1",
|
|
29
29
|
"blueimp-md5": "^2.10.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"test:migrate-examples": "jest src/__tests__/_examples.test.ts --updateSnapshot",
|
|
56
56
|
"test-changed": "pnpm run test -- --changedSince=master",
|
|
57
57
|
"typecheck": "tsc --noEmit",
|
|
58
|
-
"json2ts": "node scripts/json-schema-to-typescript",
|
|
58
|
+
"json2ts": "node scripts/json-schema-to-typescript.mjs",
|
|
59
59
|
"clean": "rimraf build lib es *.tsbuildinfo",
|
|
60
60
|
"build": "pnpm clean && pnpm build:types && pnpm build:js && pnpm build:es && pnpm build:json && pnpm build:copy",
|
|
61
61
|
"build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json",
|