@takeshape/schema 8.35.1 → 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.
- package/es/index.js +3 -3
- package/es/migration/index.js +82 -0
- package/es/migration/to/v3.0.0.js +245 -0
- package/es/{migration-utils.js → migration/to/v3.1.0.js} +40 -8
- package/es/migration/to/v3.10.0.js +56 -0
- package/es/migration/to/v3.11.0.js +99 -0
- package/es/migration/to/v3.2.0.js +10 -0
- package/es/migration/to/v3.3.0.js +16 -0
- package/es/migration/to/v3.4.0.js +10 -0
- package/es/migration/to/v3.5.0.js +10 -0
- package/es/migration/to/v3.5.1.js +10 -0
- package/es/migration/to/v3.6.0.js +10 -0
- package/es/migration/to/v3.7.0.js +10 -0
- package/es/migration/to/v3.8.0.js +10 -0
- package/es/migration/to/v3.9.0.js +83 -0
- package/es/migration/types.js +1 -0
- package/es/migration/utils.js +23 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -36
- package/lib/migration/index.d.ts +7 -0
- package/lib/migration/index.d.ts.map +1 -0
- package/lib/migration/index.js +128 -0
- package/lib/migration/to/v3.0.0.d.ts +4 -0
- package/lib/migration/to/v3.0.0.d.ts.map +1 -0
- package/lib/migration/to/v3.0.0.js +260 -0
- package/lib/migration/to/v3.1.0.d.ts +5 -0
- package/lib/migration/to/v3.1.0.d.ts.map +1 -0
- package/lib/{migration-utils.js → migration/to/v3.1.0.js} +40 -10
- package/lib/migration/to/v3.10.0.d.ts +4 -0
- package/lib/migration/to/v3.10.0.d.ts.map +1 -0
- package/lib/migration/to/v3.10.0.js +66 -0
- package/lib/migration/to/v3.11.0.d.ts +5 -0
- package/lib/migration/to/v3.11.0.d.ts.map +1 -0
- package/lib/migration/to/v3.11.0.js +109 -0
- package/lib/migration/to/v3.2.0.d.ts +4 -0
- package/lib/migration/to/v3.2.0.d.ts.map +1 -0
- package/lib/migration/to/v3.2.0.js +18 -0
- package/lib/migration/to/v3.3.0.d.ts +5 -0
- package/lib/migration/to/v3.3.0.d.ts.map +1 -0
- package/lib/migration/to/v3.3.0.js +24 -0
- package/lib/migration/to/v3.4.0.d.ts +4 -0
- package/lib/migration/to/v3.4.0.d.ts.map +1 -0
- package/lib/migration/to/v3.4.0.js +18 -0
- package/lib/migration/to/v3.5.0.d.ts +4 -0
- package/lib/migration/to/v3.5.0.d.ts.map +1 -0
- package/lib/migration/to/v3.5.0.js +18 -0
- package/lib/migration/to/v3.5.1.d.ts +4 -0
- package/lib/migration/to/v3.5.1.d.ts.map +1 -0
- package/lib/migration/to/v3.5.1.js +18 -0
- package/lib/migration/to/v3.6.0.d.ts +4 -0
- package/lib/migration/to/v3.6.0.d.ts.map +1 -0
- package/lib/migration/to/v3.6.0.js +18 -0
- package/lib/migration/to/v3.7.0.d.ts +4 -0
- package/lib/migration/to/v3.7.0.d.ts.map +1 -0
- package/lib/migration/to/v3.7.0.js +18 -0
- package/lib/migration/to/v3.8.0.d.ts +4 -0
- package/lib/migration/to/v3.8.0.d.ts.map +1 -0
- package/lib/migration/to/v3.8.0.js +18 -0
- package/lib/migration/to/v3.9.0.d.ts +4 -0
- package/lib/migration/to/v3.9.0.d.ts.map +1 -0
- package/lib/migration/to/v3.9.0.js +91 -0
- package/lib/migration/types.d.ts +14 -0
- package/lib/migration/types.d.ts.map +1 -0
- package/lib/migration/types.js +5 -0
- package/lib/migration/utils.d.ts +5 -0
- package/lib/migration/utils.d.ts.map +1 -0
- package/lib/migration/utils.js +34 -0
- package/package.json +4 -4
- package/es/migration.js +0 -677
- package/lib/migration-utils.d.ts +0 -18
- package/lib/migration-utils.d.ts.map +0 -1
- package/lib/migration.d.ts +0 -59
- package/lib/migration.d.ts.map +0 -1
- package/lib/migration.js +0 -739
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatDate = formatDate;
|
|
7
|
+
exports.getRelationshipSchema = getRelationshipSchema;
|
|
8
|
+
exports.normalizeSchemaVersion = normalizeSchemaVersion;
|
|
9
|
+
|
|
10
|
+
function formatDate(timestamp) {
|
|
11
|
+
return (timestamp ? new Date(timestamp) : new Date()).toISOString();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getRelationshipSchema(relationship) {
|
|
15
|
+
const itemSchema = {
|
|
16
|
+
$ref: '#/shapes/TSRelationship/schema'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
if (relationship.type === 'multiple') {
|
|
20
|
+
return {
|
|
21
|
+
type: 'array',
|
|
22
|
+
items: itemSchema,
|
|
23
|
+
'@relationship': relationship
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return { ...itemSchema,
|
|
28
|
+
'@relationship': relationship
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function normalizeSchemaVersion(version) {
|
|
33
|
+
return version === undefined ? '1' : version;
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "8.35.
|
|
3
|
+
"version": "8.35.2",
|
|
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.35.
|
|
25
|
-
"@takeshape/json-schema": "8.35.
|
|
26
|
-
"@takeshape/util": "8.35.
|
|
24
|
+
"@takeshape/errors": "8.35.2",
|
|
25
|
+
"@takeshape/json-schema": "8.35.2",
|
|
26
|
+
"@takeshape/util": "8.35.2",
|
|
27
27
|
"ajv": "^7.0.4",
|
|
28
28
|
"ajv-formats": "^1.5.1",
|
|
29
29
|
"lodash": "^4.17.20",
|