@takeshape/schema 7.194.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/README.md +5 -0
- package/es/api-version.js +21 -0
- package/es/auth-schemas.js +0 -0
- package/es/builtin-schema.js +590 -0
- package/es/content-schema-transform.js +192 -0
- package/es/entitlements.js +0 -0
- package/es/enum.js +11 -0
- package/es/get-is-leaf.js +58 -0
- package/es/index.js +25 -0
- package/es/migration.js +413 -0
- package/es/mocks.js +47 -0
- package/es/patterns.js +0 -0
- package/es/project-schema/index.js +10 -0
- package/es/project-schema/v1.0.0.js +0 -0
- package/es/project-schema/v3.0.0.js +0 -0
- package/es/project-schema/v3.1.0.js +0 -0
- package/es/project-schema/v3.2.0.js +0 -0
- package/es/project-schema/v3.3.0.js +0 -0
- package/es/project-schema/v3.4.0.js +0 -0
- package/es/project-schema/v3.5.0.js +0 -0
- package/es/project-schema/v3.5.1.js +0 -0
- package/es/project-schema/v3.6.0.js +0 -0
- package/es/refs.js +301 -0
- package/es/resolvers.js +2 -0
- package/es/scalars.js +4 -0
- package/es/schema-util.js +1197 -0
- package/es/schemas/auth-schemas.json +313 -0
- package/es/schemas/project-schema/meta-schema-v1.0.0.json +209 -0
- package/es/schemas/project-schema/meta-schema-v3.0.0.json +609 -0
- package/es/schemas/project-schema/meta-schema-v3.1.0.json +609 -0
- package/es/schemas/project-schema/meta-schema-v3.2.0.json +613 -0
- package/es/schemas/project-schema/meta-schema-v3.3.0.json +613 -0
- package/es/schemas/project-schema/meta-schema-v3.4.0.json +613 -0
- package/es/schemas/project-schema/meta-schema-v3.5.0.json +627 -0
- package/es/schemas/project-schema/meta-schema-v3.5.1.json +630 -0
- package/es/schemas/project-schema/meta-schema-v3.6.0.json +633 -0
- package/es/schemas/project-schema/v1.0.0.json +321 -0
- package/es/schemas/project-schema/v3.0.0.json +411 -0
- package/es/schemas/project-schema/v3.1.0.json +569 -0
- package/es/schemas/project-schema/v3.2.0.json +577 -0
- package/es/schemas/project-schema/v3.3.0.json +578 -0
- package/es/schemas/project-schema/v3.4.0.json +568 -0
- package/es/schemas/project-schema/v3.5.0.json +568 -0
- package/es/schemas/project-schema/v3.5.1.json +568 -0
- package/es/schemas/project-schema/v3.6.0.json +584 -0
- package/es/schemas/project-schema.json +16 -0
- package/es/schemas/user-schema.json +58 -0
- package/es/services.js +379 -0
- package/es/taxonomies.js +55 -0
- package/es/template-shapes.js +79 -0
- package/es/types.js +202 -0
- package/es/unions.js +137 -0
- package/es/user-schema.js +0 -0
- package/es/util/detect-cycles.js +54 -0
- package/es/util/index.js +1 -0
- package/es/validate.js +764 -0
- package/es/versions.js +4 -0
- package/es/workflows.js +69 -0
- package/examples/.pnpm-debug.log +20 -0
- package/examples/v1_0_0/beer-schema.json +125 -0
- package/examples/v1_0_0/blog-schema.json +192 -0
- package/examples/v1_0_0/brewery-schema.json +232 -0
- package/examples/v1_0_0/complex-project-schema.json +3197 -0
- package/examples/v1_0_0/error-schema.json +275 -0
- package/examples/v1_0_0/frank-and-fred-schema.json +21387 -0
- package/examples/v1_0_0/massive-schema.json +6930 -0
- package/examples/v1_0_0/post-schema.json +83 -0
- package/examples/v1_0_0/real-world-schema.json +797 -0
- package/examples/v1_0_0/recursive-repeater-schema.json +69 -0
- package/examples/v1_0_0/recursive-schema.json +79 -0
- package/examples/v1_0_0/schema-with-repeater-draftjs.json +292 -0
- package/examples/v1_0_0/shape-books.json +797 -0
- package/examples/v1_0_0/user-schema-no-required.json +84 -0
- package/examples/v1_0_0/user-schema-with-defaults.json +105 -0
- package/examples/v1_0_0/user-schema-with-obj-prop.json +92 -0
- package/examples/v1_0_0/user-schema.json +87 -0
- package/examples/v3_0_0/rick-and-morty-rest.json +62 -0
- package/examples/v3_0_0/shopify-lookbook.json +1172 -0
- package/examples/v3_0_0/shopify-store-with-widget.json +11323 -0
- package/examples/v3_2_0/blog-schema.json +378 -0
- package/examples/v3_2_0/brewery-schema.json +385 -0
- package/examples/v3_2_0/complex-project-schema.json +3748 -0
- package/examples/v3_2_0/frank-and-fred-schema.json +19217 -0
- package/examples/v3_2_0/massive-schema.json +6676 -0
- package/examples/v3_2_0/pet-oneof-array.json +323 -0
- package/examples/v3_2_0/post-schema.json +265 -0
- package/examples/v3_2_0/real-world-schema.json +970 -0
- package/examples/v3_2_0/recursive-repeater-schema.json +144 -0
- package/examples/v3_2_0/recursive-schema.json +151 -0
- package/examples/v3_2_0/rick-and-morty-rest.json +65 -0
- package/examples/v3_2_0/schema-with-repeater-draftjs.json +381 -0
- package/examples/v3_2_0/shape-books.json +1044 -0
- package/examples/v3_2_0/shopify-store-with-widget.json +11016 -0
- package/examples/v3_2_0/user-schema-no-required.json +174 -0
- package/examples/v3_2_0/user-schema-with-defaults.json +187 -0
- package/examples/v3_3_0/blog-schema.json +405 -0
- package/examples/v3_3_0/brewery-schema.json +406 -0
- package/examples/v3_3_0/complex-project-schema.json +4076 -0
- package/examples/v3_3_0/frank-and-fred-schema.json +20913 -0
- package/examples/v3_3_0/massive-schema.json +7309 -0
- package/examples/v3_3_0/pet-oneof-array.json +380 -0
- package/examples/v3_3_0/post-schema.json +248 -0
- package/examples/v3_3_0/real-world-schema.json +1046 -0
- package/examples/v3_3_0/recursive-repeater-schema.json +154 -0
- package/examples/v3_3_0/recursive-schema.json +161 -0
- package/examples/v3_3_0/rick-and-morty-rest.json +101 -0
- package/examples/v3_3_0/schema-with-repeater-draftjs.json +393 -0
- package/examples/v3_3_0/shape-books.json +1121 -0
- package/examples/v3_3_0/shopify-lookbook.json +1196 -0
- package/examples/v3_3_0/shopify-store-with-widget.json +11320 -0
- package/examples/v3_3_0/user-schema-no-required.json +185 -0
- package/examples/v3_3_0/user-schema-with-defaults.json +210 -0
- package/examples/v3_4_0/blog-schema.json +405 -0
- package/examples/v3_4_0/brewery-schema.json +406 -0
- package/examples/v3_4_0/complex-project-schema.json +4076 -0
- package/examples/v3_4_0/frank-and-fred-schema.json +20913 -0
- package/examples/v3_4_0/massive-schema.json +7309 -0
- package/examples/v3_4_0/pet-oneof-array.json +420 -0
- package/examples/v3_4_0/post-schema.json +248 -0
- package/examples/v3_4_0/real-world-schema.json +1046 -0
- package/examples/v3_4_0/recursive-repeater-schema.json +154 -0
- package/examples/v3_4_0/recursive-schema.json +161 -0
- package/examples/v3_4_0/rick-and-morty-rest.json +101 -0
- package/examples/v3_4_0/schema-with-repeater-draftjs.json +393 -0
- package/examples/v3_4_0/shape-books.json +1121 -0
- package/examples/v3_4_0/shopify-lookbook.json +1196 -0
- package/examples/v3_4_0/shopify-store-with-widget.json +11323 -0
- package/examples/v3_4_0/user-schema-no-required.json +185 -0
- package/examples/v3_4_0/user-schema-with-defaults.json +210 -0
- package/examples/v3_5_0/blog-schema.json +405 -0
- package/examples/v3_5_0/brewery-schema.json +406 -0
- package/examples/v3_5_0/complex-project-schema.json +4076 -0
- package/examples/v3_5_0/frank-and-fred-schema.json +20913 -0
- package/examples/v3_5_0/massive-schema.json +7309 -0
- package/examples/v3_5_0/pet-oneof-array.json +420 -0
- package/examples/v3_5_0/post-schema.json +248 -0
- package/examples/v3_5_0/real-world-schema.json +1046 -0
- package/examples/v3_5_0/recursive-repeater-schema.json +154 -0
- package/examples/v3_5_0/recursive-schema.json +161 -0
- package/examples/v3_5_0/rick-and-morty-rest.json +101 -0
- package/examples/v3_5_0/schema-with-repeater-draftjs.json +393 -0
- package/examples/v3_5_0/shape-books.json +1121 -0
- package/examples/v3_5_0/shopify-lookbook.json +1196 -0
- package/examples/v3_5_0/shopify-store-with-widget.json +12271 -0
- package/examples/v3_5_0/user-schema-no-required.json +185 -0
- package/examples/v3_5_0/user-schema-with-defaults.json +210 -0
- package/examples/v3_5_1/blog-schema.json +405 -0
- package/examples/v3_5_1/brewery-schema.json +406 -0
- package/examples/v3_5_1/complex-project-schema.json +4076 -0
- package/examples/v3_5_1/frank-and-fred-schema.json +20913 -0
- package/examples/v3_5_1/massive-schema.json +7309 -0
- package/examples/v3_5_1/pet-oneof-array.json +420 -0
- package/examples/v3_5_1/post-schema.json +248 -0
- package/examples/v3_5_1/real-world-schema.json +1046 -0
- package/examples/v3_5_1/recursive-repeater-schema.json +154 -0
- package/examples/v3_5_1/recursive-schema.json +161 -0
- package/examples/v3_5_1/rick-and-morty-rest.json +101 -0
- package/examples/v3_5_1/schema-with-repeater-draftjs.json +393 -0
- package/examples/v3_5_1/shape-books.json +1121 -0
- package/examples/v3_5_1/shopify-lookbook.json +1196 -0
- package/examples/v3_5_1/shopify-store-with-widget.json +12271 -0
- package/examples/v3_5_1/stripe-starter-resolved.json +21419 -0
- package/examples/v3_5_1/user-schema-no-required.json +185 -0
- package/examples/v3_5_1/user-schema-with-defaults.json +210 -0
- package/examples/v3_6_0/blog-schema.json +405 -0
- package/examples/v3_6_0/brewery-schema.json +406 -0
- package/examples/v3_6_0/complex-project-schema.json +4076 -0
- package/examples/v3_6_0/frank-and-fred-schema.json +20913 -0
- package/examples/v3_6_0/massive-schema.json +7309 -0
- package/examples/v3_6_0/pet-oneof-array.json +420 -0
- package/examples/v3_6_0/post-schema.json +248 -0
- package/examples/v3_6_0/real-world-schema.json +1046 -0
- package/examples/v3_6_0/recursive-repeater-schema.json +154 -0
- package/examples/v3_6_0/recursive-schema.json +161 -0
- package/examples/v3_6_0/rick-and-morty-rest.json +101 -0
- package/examples/v3_6_0/schema-with-repeater-draftjs.json +393 -0
- package/examples/v3_6_0/shape-books.json +1121 -0
- package/examples/v3_6_0/shopify-lookbook.json +1196 -0
- package/examples/v3_6_0/shopify-store-with-widget.json +12271 -0
- package/examples/v3_6_0/stripe-starter-resolved.json +21419 -0
- package/examples/v3_6_0/user-schema-no-required.json +185 -0
- package/examples/v3_6_0/user-schema-with-defaults.json +210 -0
- package/lib/api-version.d.ts +6 -0
- package/lib/api-version.d.ts.map +1 -0
- package/lib/api-version.js +36 -0
- package/lib/auth-schemas.d.ts +105 -0
- package/lib/auth-schemas.d.ts.map +1 -0
- package/lib/auth-schemas.js +1 -0
- package/lib/builtin-schema.d.ts +8 -0
- package/lib/builtin-schema.d.ts.map +1 -0
- package/lib/builtin-schema.js +606 -0
- package/lib/content-schema-transform.d.ts +41 -0
- package/lib/content-schema-transform.d.ts.map +1 -0
- package/lib/content-schema-transform.js +217 -0
- package/lib/entitlements.d.ts +1 -0
- package/lib/entitlements.d.ts.map +1 -0
- package/lib/entitlements.js +1 -0
- package/lib/enum.d.ts +3 -0
- package/lib/enum.d.ts.map +1 -0
- package/lib/enum.js +18 -0
- package/lib/get-is-leaf.d.ts +4 -0
- package/lib/get-is-leaf.d.ts.map +1 -0
- package/lib/get-is-leaf.js +68 -0
- package/lib/index.d.ts +27 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +359 -0
- package/lib/migration.d.ts +55 -0
- package/lib/migration.d.ts.map +1 -0
- package/lib/migration.js +463 -0
- package/lib/mocks.d.ts +13 -0
- package/lib/mocks.d.ts.map +1 -0
- package/lib/mocks.js +61 -0
- package/lib/patterns.d.ts +13 -0
- package/lib/patterns.d.ts.map +1 -0
- package/lib/patterns.js +1 -0
- package/lib/project-schema/index.d.ts +21 -0
- package/lib/project-schema/index.d.ts.map +1 -0
- package/lib/project-schema/index.js +122 -0
- package/lib/project-schema/v1.0.0.d.ts +293 -0
- package/lib/project-schema/v1.0.0.d.ts.map +1 -0
- package/lib/project-schema/v1.0.0.js +1 -0
- package/lib/project-schema/v3.0.0.d.ts +480 -0
- package/lib/project-schema/v3.0.0.d.ts.map +1 -0
- package/lib/project-schema/v3.0.0.js +1 -0
- package/lib/project-schema/v3.1.0.d.ts +623 -0
- package/lib/project-schema/v3.1.0.d.ts.map +1 -0
- package/lib/project-schema/v3.1.0.js +1 -0
- package/lib/project-schema/v3.2.0.d.ts +634 -0
- package/lib/project-schema/v3.2.0.d.ts.map +1 -0
- package/lib/project-schema/v3.2.0.js +1 -0
- package/lib/project-schema/v3.3.0.d.ts +634 -0
- package/lib/project-schema/v3.3.0.d.ts.map +1 -0
- package/lib/project-schema/v3.3.0.js +1 -0
- package/lib/project-schema/v3.4.0.d.ts +626 -0
- package/lib/project-schema/v3.4.0.d.ts.map +1 -0
- package/lib/project-schema/v3.4.0.js +1 -0
- package/lib/project-schema/v3.5.0.d.ts +651 -0
- package/lib/project-schema/v3.5.0.d.ts.map +1 -0
- package/lib/project-schema/v3.5.0.js +1 -0
- package/lib/project-schema/v3.5.1.d.ts +651 -0
- package/lib/project-schema/v3.5.1.d.ts.map +1 -0
- package/lib/project-schema/v3.5.1.js +1 -0
- package/lib/project-schema/v3.6.0.d.ts +660 -0
- package/lib/project-schema/v3.6.0.d.ts.map +1 -0
- package/lib/project-schema/v3.6.0.js +1 -0
- package/lib/refs.d.ts +122 -0
- package/lib/refs.d.ts.map +1 -0
- package/lib/refs.js +359 -0
- package/lib/resolvers.d.ts +4 -0
- package/lib/resolvers.d.ts.map +1 -0
- package/lib/resolvers.js +10 -0
- package/lib/scalars.d.ts +3 -0
- package/lib/scalars.d.ts.map +1 -0
- package/lib/scalars.js +13 -0
- package/lib/schema-util.d.ts +201 -0
- package/lib/schema-util.d.ts.map +1 -0
- package/lib/schema-util.js +1353 -0
- package/lib/schemas/auth-schemas.json +313 -0
- package/lib/schemas/project-schema/meta-schema-v1.0.0.json +209 -0
- package/lib/schemas/project-schema/meta-schema-v3.0.0.json +609 -0
- package/lib/schemas/project-schema/meta-schema-v3.1.0.json +609 -0
- package/lib/schemas/project-schema/meta-schema-v3.2.0.json +613 -0
- package/lib/schemas/project-schema/meta-schema-v3.3.0.json +613 -0
- package/lib/schemas/project-schema/meta-schema-v3.4.0.json +613 -0
- package/lib/schemas/project-schema/meta-schema-v3.5.0.json +627 -0
- package/lib/schemas/project-schema/meta-schema-v3.5.1.json +630 -0
- package/lib/schemas/project-schema/meta-schema-v3.6.0.json +633 -0
- package/lib/schemas/project-schema/v1.0.0.json +321 -0
- package/lib/schemas/project-schema/v3.0.0.json +411 -0
- package/lib/schemas/project-schema/v3.1.0.json +569 -0
- package/lib/schemas/project-schema/v3.2.0.json +577 -0
- package/lib/schemas/project-schema/v3.3.0.json +578 -0
- package/lib/schemas/project-schema/v3.4.0.json +568 -0
- package/lib/schemas/project-schema/v3.5.0.json +568 -0
- package/lib/schemas/project-schema/v3.5.1.json +568 -0
- package/lib/schemas/project-schema/v3.6.0.json +584 -0
- package/lib/schemas/project-schema.json +16 -0
- package/lib/schemas/user-schema.json +58 -0
- package/lib/services.d.ts +71 -0
- package/lib/services.d.ts.map +1 -0
- package/lib/services.js +413 -0
- package/lib/taxonomies.d.ts +16 -0
- package/lib/taxonomies.d.ts.map +1 -0
- package/lib/taxonomies.js +69 -0
- package/lib/template-shapes.d.ts +32 -0
- package/lib/template-shapes.d.ts.map +1 -0
- package/lib/template-shapes.js +100 -0
- package/lib/types.d.ts +187 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +289 -0
- package/lib/unions.d.ts +29 -0
- package/lib/unions.d.ts.map +1 -0
- package/lib/unions.js +167 -0
- package/lib/user-schema.d.ts +39 -0
- package/lib/user-schema.d.ts.map +1 -0
- package/lib/user-schema.js +1 -0
- package/lib/util/detect-cycles.d.ts +6 -0
- package/lib/util/detect-cycles.d.ts.map +1 -0
- package/lib/util/detect-cycles.js +61 -0
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +18 -0
- package/lib/validate.d.ts +49 -0
- package/lib/validate.d.ts.map +1 -0
- package/lib/validate.js +823 -0
- package/lib/versions.d.ts +5 -0
- package/lib/versions.d.ts.map +1 -0
- package/lib/versions.js +14 -0
- package/lib/workflows.d.ts +15 -0
- package/lib/workflows.d.ts.map +1 -0
- package/lib/workflows.js +92 -0
- package/package.json +65 -0
package/lib/migration.js
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getRelationshipSchema = getRelationshipSchema;
|
|
7
|
+
exports.migrateToContentSchemaV3 = migrateToContentSchemaV3;
|
|
8
|
+
exports.contentTypeToShape = contentTypeToShape;
|
|
9
|
+
exports.migrateToV3 = migrateToV3;
|
|
10
|
+
exports.migrateToV3_1 = migrateToV3_1;
|
|
11
|
+
exports.migrateToV3_2 = migrateToV3_2;
|
|
12
|
+
exports.migrateToV3_3 = migrateToV3_3;
|
|
13
|
+
exports.migrateToV3_4 = migrateToV3_4;
|
|
14
|
+
exports.migrateToV3_5 = migrateToV3_5;
|
|
15
|
+
exports.migrateToV3_5_1 = migrateToV3_5_1;
|
|
16
|
+
exports.migrateToV3_6 = migrateToV3_6;
|
|
17
|
+
exports.migrateToLatestProjectSchema = migrateToLatestProjectSchema;
|
|
18
|
+
exports.normalizeSchemaVersion = normalizeSchemaVersion;
|
|
19
|
+
exports.isV1Like = isV1Like;
|
|
20
|
+
exports.isV1 = isV1;
|
|
21
|
+
exports.isV3Like = isV3Like;
|
|
22
|
+
exports.isV3 = isV3;
|
|
23
|
+
exports.ensureLatest = ensureLatest;
|
|
24
|
+
exports.listTypePrefix = void 0;
|
|
25
|
+
|
|
26
|
+
var _pReduce = _interopRequireDefault(require("p-reduce"));
|
|
27
|
+
|
|
28
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
29
|
+
|
|
30
|
+
var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
31
|
+
|
|
32
|
+
var _util = require("@takeshape/util");
|
|
33
|
+
|
|
34
|
+
var _schemaUtil = require("./schema-util");
|
|
35
|
+
|
|
36
|
+
var _services = require("./services");
|
|
37
|
+
|
|
38
|
+
var _types = require("./types");
|
|
39
|
+
|
|
40
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
+
|
|
42
|
+
const listTypePrefix = 'PaginatedList';
|
|
43
|
+
exports.listTypePrefix = listTypePrefix;
|
|
44
|
+
const annotationMap = {
|
|
45
|
+
l10n: '@l10n',
|
|
46
|
+
sensitive: '@sensitive',
|
|
47
|
+
syncLocaleStructure: '@syncLocaleStructure'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function getRelationshipSchema(relationship) {
|
|
51
|
+
const itemSchema = {
|
|
52
|
+
$ref: '#/shapes/TSRelationship/schema'
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
if (relationship.type === 'multiple') {
|
|
56
|
+
return {
|
|
57
|
+
type: 'array',
|
|
58
|
+
items: itemSchema,
|
|
59
|
+
'@relationship': relationship
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { ...itemSchema,
|
|
64
|
+
'@relationship': relationship
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function isColor(schema) {
|
|
69
|
+
const {
|
|
70
|
+
type,
|
|
71
|
+
properties
|
|
72
|
+
} = schema;
|
|
73
|
+
return Boolean(type === 'object' && properties && properties.hsl && properties.hsv && properties.rgb && properties.hex);
|
|
74
|
+
} // eslint-disable-next-line complexity
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
function migrateToContentSchemaV3(params) {
|
|
78
|
+
const {
|
|
79
|
+
schema,
|
|
80
|
+
service,
|
|
81
|
+
name,
|
|
82
|
+
key,
|
|
83
|
+
setSource,
|
|
84
|
+
omitAllSources
|
|
85
|
+
} = params;
|
|
86
|
+
const {
|
|
87
|
+
type
|
|
88
|
+
} = schema;
|
|
89
|
+
const mapping = !omitAllSources && key && setSource !== false && name !== key ? `${service}.${key}` : undefined;
|
|
90
|
+
(0, _forEach.default)(schema, (value, key) => {
|
|
91
|
+
if (annotationMap[key]) {
|
|
92
|
+
const newAnnotation = annotationMap[key];
|
|
93
|
+
schema[newAnnotation] = value; // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
94
|
+
|
|
95
|
+
delete schema[key];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (type === 'string' || type === 'boolean' || type === 'number' || type === 'integer') {
|
|
100
|
+
return {
|
|
101
|
+
schema: { ...(0, _pick.default)(schema, _schemaUtil.scalarSchemaKeys),
|
|
102
|
+
'@mapping': mapping
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const {
|
|
108
|
+
relationship
|
|
109
|
+
} = schema;
|
|
110
|
+
|
|
111
|
+
if (relationship) {
|
|
112
|
+
const {
|
|
113
|
+
contentTypeIds,
|
|
114
|
+
type: relationshipType,
|
|
115
|
+
relatedName
|
|
116
|
+
} = relationship;
|
|
117
|
+
return {
|
|
118
|
+
schema: { ...(0, _pick.default)(schema, relationshipType === 'multiple' ? _schemaUtil.multipleRelationshipSchemaKeys : _schemaUtil.schemaMetadataKeys),
|
|
119
|
+
'@mapping': mapping,
|
|
120
|
+
...getRelationshipSchema({
|
|
121
|
+
shapeIds: contentTypeIds,
|
|
122
|
+
type: relationshipType !== null && relationshipType !== void 0 ? relationshipType : 'single',
|
|
123
|
+
// type is optional on assets
|
|
124
|
+
relatedName
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (type === 'object' && schema.draftjs) {
|
|
131
|
+
return {
|
|
132
|
+
schema: { ...(0, _pick.default)(schema, _schemaUtil.scalarSchemaKeys),
|
|
133
|
+
'@mapping': mapping,
|
|
134
|
+
'@tag': 'draftjs'
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (isColor(schema)) {
|
|
140
|
+
return {
|
|
141
|
+
schema: { ...(0, _pick.default)(schema, _schemaUtil.scalarSchemaKeys),
|
|
142
|
+
$ref: '#/shapes/TSColor/schema',
|
|
143
|
+
'@mapping': mapping
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (type === 'object' && schema.properties) {
|
|
149
|
+
var _schema$title;
|
|
150
|
+
|
|
151
|
+
const properties = {};
|
|
152
|
+
let shapes = {};
|
|
153
|
+
const shapeTitle = [params.shapeTitle, (0, _util.upperCamel)((_schema$title = schema.title) !== null && _schema$title !== void 0 ? _schema$title : params.name)].filter(Boolean).join(' ');
|
|
154
|
+
const shapeName = `${params.shapeName}${(0, _util.upperCamel)(params.name)}`;
|
|
155
|
+
const contentSourceId = `takeshape:local:${shapeName}`;
|
|
156
|
+
(0, _forEach.default)(schema.properties, (propSchema, name) => {
|
|
157
|
+
var _propSchema$key;
|
|
158
|
+
|
|
159
|
+
const {
|
|
160
|
+
schema: migratedPropSchema,
|
|
161
|
+
hoistedShapes
|
|
162
|
+
} = migrateToContentSchemaV3({ ...params,
|
|
163
|
+
shapeName,
|
|
164
|
+
shapeTitle,
|
|
165
|
+
depth: params.depth + 1,
|
|
166
|
+
schema: propSchema,
|
|
167
|
+
parentSchema: schema,
|
|
168
|
+
service: contentSourceId,
|
|
169
|
+
key: (_propSchema$key = propSchema.key) !== null && _propSchema$key !== void 0 ? _propSchema$key : name,
|
|
170
|
+
name,
|
|
171
|
+
setSource: true
|
|
172
|
+
});
|
|
173
|
+
properties[name] = migratedPropSchema;
|
|
174
|
+
Object.assign(shapes, hoistedShapes);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
if (params.depth > 0) {
|
|
178
|
+
const {
|
|
179
|
+
title,
|
|
180
|
+
description,
|
|
181
|
+
...rest
|
|
182
|
+
} = schema;
|
|
183
|
+
return {
|
|
184
|
+
schema: {
|
|
185
|
+
title,
|
|
186
|
+
description,
|
|
187
|
+
'@mapping': mapping,
|
|
188
|
+
$ref: `#/shapes/${shapeName}/schema`
|
|
189
|
+
},
|
|
190
|
+
hoistedShapes: { ...shapes,
|
|
191
|
+
[shapeName]: {
|
|
192
|
+
id: name === key ? shapeName : key,
|
|
193
|
+
name: shapeName,
|
|
194
|
+
title: shapeTitle,
|
|
195
|
+
schema: { ...(0, _pick.default)(rest, _schemaUtil.objectSchemaKeys),
|
|
196
|
+
type: 'object',
|
|
197
|
+
properties
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
schema: { ...(0, _pick.default)(schema, _schemaUtil.objectSchemaKeys),
|
|
206
|
+
properties,
|
|
207
|
+
'@mapping': mapping
|
|
208
|
+
},
|
|
209
|
+
hoistedShapes: shapes
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (schema.type === 'array' && schema.items) {
|
|
214
|
+
const {
|
|
215
|
+
schema: itemSchema,
|
|
216
|
+
hoistedShapes
|
|
217
|
+
} = migrateToContentSchemaV3({ ...params,
|
|
218
|
+
schema: schema.items,
|
|
219
|
+
parentSchema: schema,
|
|
220
|
+
service: 'parent',
|
|
221
|
+
setSource: false
|
|
222
|
+
});
|
|
223
|
+
return {
|
|
224
|
+
schema: { ...(0, _pick.default)(schema, _schemaUtil.arraySchemaKeys),
|
|
225
|
+
items: itemSchema,
|
|
226
|
+
'@mapping': mapping
|
|
227
|
+
},
|
|
228
|
+
hoistedShapes
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
throw new Error(`Unknown schema type "${type}"`);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function getModelType(contentType) {
|
|
236
|
+
if (contentType.single) {
|
|
237
|
+
return 'single';
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (contentType.taxonomy) {
|
|
241
|
+
return 'taxonomy';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return 'multiple';
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function contentTypeToShape(contentType, contentTypeId) {
|
|
248
|
+
var _contentType$title;
|
|
249
|
+
|
|
250
|
+
const title = (_contentType$title = contentType.title) !== null && _contentType$title !== void 0 ? _contentType$title : contentType.name;
|
|
251
|
+
const name = (0, _util.upperCamel)(contentType.name);
|
|
252
|
+
const contentSourceId = `takeshape:local:${name}`;
|
|
253
|
+
const {
|
|
254
|
+
schema,
|
|
255
|
+
hoistedShapes
|
|
256
|
+
} = migrateToContentSchemaV3({
|
|
257
|
+
shapeName: name,
|
|
258
|
+
shapeTitle: title,
|
|
259
|
+
schema: contentType.schema,
|
|
260
|
+
service: contentSourceId,
|
|
261
|
+
name: '',
|
|
262
|
+
key: '',
|
|
263
|
+
depth: 0
|
|
264
|
+
});
|
|
265
|
+
return {
|
|
266
|
+
[name]: {
|
|
267
|
+
id: contentTypeId,
|
|
268
|
+
name,
|
|
269
|
+
title,
|
|
270
|
+
model: {
|
|
271
|
+
type: getModelType(contentType)
|
|
272
|
+
},
|
|
273
|
+
workflow: contentType.workflow,
|
|
274
|
+
schema: schema
|
|
275
|
+
},
|
|
276
|
+
...hoistedShapes
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function formatDate(timestamp) {
|
|
281
|
+
return (timestamp ? new Date(timestamp) : new Date()).toISOString();
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function migrateToV3(projectSchema) {
|
|
285
|
+
const {
|
|
286
|
+
contentTypes,
|
|
287
|
+
created,
|
|
288
|
+
updated,
|
|
289
|
+
...rest
|
|
290
|
+
} = projectSchema;
|
|
291
|
+
const shapes = {};
|
|
292
|
+
const forms = {};
|
|
293
|
+
Object.keys(contentTypes).forEach(contentTypeId => {
|
|
294
|
+
const contentType = contentTypes[contentTypeId];
|
|
295
|
+
Object.assign(shapes, contentTypeToShape(contentType, contentTypeId));
|
|
296
|
+
forms[(0, _util.upperCamel)(contentType.name)] = contentType.forms;
|
|
297
|
+
}); // Use deepClone to drop undefined values, this improves compatibility with validation and testing
|
|
298
|
+
// Schemas are typically saved in Dynamo or JSON files which also remove undefined values
|
|
299
|
+
// Dropping them here is done for consistency's sake
|
|
300
|
+
|
|
301
|
+
return (0, _util.deepClone)({ ...rest,
|
|
302
|
+
...(0, _schemaUtil.getShapeQueriesAndMutations)(Object.values(shapes)),
|
|
303
|
+
schemaVersion: '3',
|
|
304
|
+
created: formatDate(created),
|
|
305
|
+
updated: formatDate(updated),
|
|
306
|
+
shapes,
|
|
307
|
+
forms
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async function migrateToV3_1(context, projectSchema) {
|
|
312
|
+
const {
|
|
313
|
+
encryptFn,
|
|
314
|
+
decryptFn
|
|
315
|
+
} = context;
|
|
316
|
+
let services;
|
|
317
|
+
/**
|
|
318
|
+
* Services can only be migrated if a dataKey is present, otherwise they will need to be discarded.
|
|
319
|
+
*/
|
|
320
|
+
|
|
321
|
+
if (projectSchema.services) {
|
|
322
|
+
services = await (0, _pReduce.default)(Object.entries(projectSchema.services), async (serviceMap, [serviceKey, serviceConfig]) => {
|
|
323
|
+
const auth = serviceConfig.auth && decryptFn(serviceConfig.auth);
|
|
324
|
+
const updatedServiceConfig = (0, _services.updateServiceConfigV3ToV3_1)({ ...serviceConfig,
|
|
325
|
+
auth
|
|
326
|
+
}, serviceKey);
|
|
327
|
+
const authentication = updatedServiceConfig === null || updatedServiceConfig === void 0 ? void 0 : updatedServiceConfig.authentication;
|
|
328
|
+
serviceMap[serviceKey] = { ...updatedServiceConfig,
|
|
329
|
+
authentication: (0, _types.isServiceAuthentication)(authentication) ? encryptFn(authentication) : authentication
|
|
330
|
+
};
|
|
331
|
+
return serviceMap;
|
|
332
|
+
}, {});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return (0, _util.deepClone)({ ...projectSchema,
|
|
336
|
+
services,
|
|
337
|
+
schemaVersion: '3.1.0'
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function migrateToV3_2(projectSchema) {
|
|
342
|
+
/**
|
|
343
|
+
* No migration needed all changes are backwards compatible.
|
|
344
|
+
*/
|
|
345
|
+
return { ...projectSchema,
|
|
346
|
+
schemaVersion: '3.2.0'
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
async function migrateToV3_3(context, projectSchema) {
|
|
351
|
+
const {
|
|
352
|
+
generateDataKeyFn
|
|
353
|
+
} = context;
|
|
354
|
+
const dataKey = projectSchema.dataKey ? projectSchema.dataKey : await generateDataKeyFn();
|
|
355
|
+
/**
|
|
356
|
+
* Generate a dataKey if none is present.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
return { ...projectSchema,
|
|
360
|
+
schemaVersion: '3.3.0',
|
|
361
|
+
dataKey
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function migrateToV3_4(projectSchema) {
|
|
366
|
+
/**
|
|
367
|
+
* No migration needed all changes are backwards compatible.
|
|
368
|
+
*/
|
|
369
|
+
return { ...projectSchema,
|
|
370
|
+
schemaVersion: '3.4.0'
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function migrateToV3_5(projectSchema) {
|
|
375
|
+
/**
|
|
376
|
+
* No migration needed all changes are backwards compatible.
|
|
377
|
+
*/
|
|
378
|
+
return { ...projectSchema,
|
|
379
|
+
schemaVersion: '3.5.0'
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function migrateToV3_5_1(projectSchema) {
|
|
384
|
+
/**
|
|
385
|
+
* No migration needed all changes are backwards compatible.
|
|
386
|
+
*/
|
|
387
|
+
return { ...projectSchema,
|
|
388
|
+
schemaVersion: '3.5.1'
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function migrateToV3_6(projectSchema) {
|
|
393
|
+
/**
|
|
394
|
+
* No migration needed all changes are backwards compatible.
|
|
395
|
+
*/
|
|
396
|
+
return { ...projectSchema,
|
|
397
|
+
schemaVersion: '3.6.0'
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
async function migrateToLatestProjectSchema(context, projectSchema) {
|
|
402
|
+
if ((0, _types.isProjectSchemaV1)(projectSchema)) {
|
|
403
|
+
projectSchema = migrateToV3(projectSchema);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if ((0, _types.isProjectSchemaV3)(projectSchema)) {
|
|
407
|
+
projectSchema = await migrateToV3_1(context, projectSchema);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if ((0, _types.isProjectSchemaV3_1)(projectSchema)) {
|
|
411
|
+
projectSchema = migrateToV3_2(projectSchema);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if ((0, _types.isProjectSchemaV3_2)(projectSchema)) {
|
|
415
|
+
projectSchema = await migrateToV3_3(context, projectSchema);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if ((0, _types.isProjectSchemaV3_3)(projectSchema)) {
|
|
419
|
+
projectSchema = migrateToV3_4(projectSchema);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if ((0, _types.isProjectSchemaV3_4)(projectSchema)) {
|
|
423
|
+
projectSchema = migrateToV3_5(projectSchema);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if ((0, _types.isProjectSchemaV3_5)(projectSchema)) {
|
|
427
|
+
projectSchema = migrateToV3_5_1(projectSchema);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
if ((0, _types.isProjectSchemaV3_5_1)(projectSchema)) {
|
|
431
|
+
projectSchema = migrateToV3_6(projectSchema);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
return projectSchema;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function normalizeSchemaVersion(version) {
|
|
438
|
+
return version === undefined ? '1' : version;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function isV1Like(schema) {
|
|
442
|
+
return Boolean(schema.schemaVersion === '1' || schema.schemaVersion === undefined);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function isV1(schema) {
|
|
446
|
+
return Boolean(isV1Like(schema));
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function isV3Like(schema) {
|
|
450
|
+
return schema.schemaVersion === '3';
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function isV3(schema) {
|
|
454
|
+
return isV3Like(schema);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
async function ensureLatest(context, schema) {
|
|
458
|
+
if (!schema || (0, _types.isLatestProjectSchema)(schema)) {
|
|
459
|
+
return schema;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return migrateToLatestProjectSchema(context, schema);
|
|
463
|
+
}
|
package/lib/mocks.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProjectSchema, ServiceConfig, StoredServiceConfig } from './project-schema';
|
|
2
|
+
import type { ServiceKey } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Like emptySchema, but setting a default `dataKey`. Only suitable for tests.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createMockSchema(projectId: string, schema?: Partial<ProjectSchema>): ProjectSchema;
|
|
7
|
+
/**
|
|
8
|
+
* Capturing a common pattern used in tests. Creates an empty schema, with a `dataKey` and defaults.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createMockSchemaWithDefaults(projectId: string, schema?: Partial<ProjectSchema>): ProjectSchema;
|
|
11
|
+
export declare function createMockServiceConfig(serviceKey: ServiceKey, serviceConfig?: Partial<ServiceConfig>): ServiceConfig;
|
|
12
|
+
export declare function createMockStoredServiceConfig(serviceKey: ServiceKey, serviceConfig?: Partial<StoredServiceConfig>): StoredServiceConfig;
|
|
13
|
+
//# sourceMappingURL=mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AACxF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAIxC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,aAAa,CAKtG;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,aAAa,CAKlH;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAgBrH;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,UAAU,EACtB,aAAa,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAC3C,mBAAmB,CAMrB"}
|
package/lib/mocks.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createMockSchema = createMockSchema;
|
|
7
|
+
exports.createMockSchemaWithDefaults = createMockSchemaWithDefaults;
|
|
8
|
+
exports.createMockServiceConfig = createMockServiceConfig;
|
|
9
|
+
exports.createMockStoredServiceConfig = createMockStoredServiceConfig;
|
|
10
|
+
|
|
11
|
+
var _schemaUtil = require("./schema-util");
|
|
12
|
+
|
|
13
|
+
var _util = require("@takeshape/util");
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Like emptySchema, but setting a default `dataKey`. Only suitable for tests.
|
|
17
|
+
*/
|
|
18
|
+
function createMockSchema(projectId, schema = {}) {
|
|
19
|
+
var _schema$dataKey;
|
|
20
|
+
|
|
21
|
+
return { ...(0, _schemaUtil.emptySchema)(projectId, (_schema$dataKey = schema.dataKey) !== null && _schema$dataKey !== void 0 ? _schema$dataKey : 'supersecret'),
|
|
22
|
+
...schema
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Capturing a common pattern used in tests. Creates an empty schema, with a `dataKey` and defaults.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
function createMockSchemaWithDefaults(projectId, schema = {}) {
|
|
31
|
+
var _schema$dataKey2;
|
|
32
|
+
|
|
33
|
+
return (0, _schemaUtil.applyDefaultsToSchema)({ ...(0, _schemaUtil.emptySchema)(projectId, (_schema$dataKey2 = schema.dataKey) !== null && _schema$dataKey2 !== void 0 ? _schema$dataKey2 : 'supersecret'),
|
|
34
|
+
...schema
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function createMockServiceConfig(serviceKey, serviceConfig) {
|
|
39
|
+
return {
|
|
40
|
+
id: serviceKey,
|
|
41
|
+
title: (0, _util.upperCamel)(serviceKey),
|
|
42
|
+
provider: 'generic',
|
|
43
|
+
serviceType: 'graphql',
|
|
44
|
+
namespace: (0, _util.upperCamel)(serviceKey),
|
|
45
|
+
authenticationType: 'bearer',
|
|
46
|
+
authentication: {
|
|
47
|
+
token: 'abc123'
|
|
48
|
+
},
|
|
49
|
+
options: {
|
|
50
|
+
endpoint: 'https://example.test/graphql'
|
|
51
|
+
},
|
|
52
|
+
...serviceConfig
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function createMockStoredServiceConfig(serviceKey, serviceConfig) {
|
|
57
|
+
return { ...createMockServiceConfig(serviceKey),
|
|
58
|
+
authentication: 'encrypted-abc123',
|
|
59
|
+
...serviceConfig
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PatternMetadata {
|
|
2
|
+
name?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
categories?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface Pattern {
|
|
9
|
+
id: string;
|
|
10
|
+
uri: string;
|
|
11
|
+
metadata: PatternMetadata;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/patterns.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,eAAe,CAAC;CAC3B"}
|
package/lib/patterns.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './v3.6.0';
|
|
2
|
+
export * from './v3.5.1';
|
|
3
|
+
export * from './v3.5.0';
|
|
4
|
+
export * from './v3.4.0';
|
|
5
|
+
export * from './v3.3.0';
|
|
6
|
+
export * from './v3.2.0';
|
|
7
|
+
export * from './v3.1.0';
|
|
8
|
+
export * from './v3.0.0';
|
|
9
|
+
export * from './v1.0.0';
|
|
10
|
+
import { ProjectSchema } from './v3.6.0';
|
|
11
|
+
import { ProjectSchemaV3_5_1 } from './v3.5.1';
|
|
12
|
+
import { ProjectSchemaV3_5_0 } from './v3.5.0';
|
|
13
|
+
import { ProjectSchemaV3_4_0 } from './v3.4.0';
|
|
14
|
+
import { ProjectSchemaV3_3_0 } from './v3.3.0';
|
|
15
|
+
import { ProjectSchemaV3_2_0 } from './v3.2.0';
|
|
16
|
+
import { ProjectSchemaV3_1_0 } from './v3.1.0';
|
|
17
|
+
import { ProjectSchemaV3_0_0 } from './v3.0.0';
|
|
18
|
+
import { ProjectSchemaV1_0_0 } from './v1.0.0';
|
|
19
|
+
export declare type ProjectSchemaV3_6_0 = ProjectSchema;
|
|
20
|
+
export declare type AnyProjectSchema = ProjectSchema | ProjectSchemaV3_5_1 | ProjectSchemaV3_5_0 | ProjectSchemaV3_4_0 | ProjectSchemaV3_3_0 | ProjectSchemaV3_2_0 | ProjectSchemaV3_1_0 | ProjectSchemaV3_0_0 | ProjectSchemaV1_0_0;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/project-schema/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,oBAAY,mBAAmB,GAAG,aAAa,CAAC;AAChD,oBAAY,gBAAgB,GAAG,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC"}
|