@angular-devkit/core 12.0.0-rc.0 → 12.0.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 +36 -34
- package/node/_golden-api.d.ts +1 -1
- package/node/_golden-api.js +1 -1
- package/node/cli-logger.d.ts +7 -0
- package/node/cli-logger.js +4 -6
- package/node/experimental/index.d.ts +2 -2
- package/node/experimental/index.js +3 -3
- package/node/experimental/jobs/index.d.ts +1 -1
- package/node/experimental/jobs/index.js +7 -7
- package/node/experimental/jobs/job-registry.d.ts +1 -1
- package/node/experimental/jobs/job-registry.js +4 -4
- package/node/fs.d.ts +7 -0
- package/node/fs.js +3 -3
- package/node/host.d.ts +2 -2
- package/node/host.js +31 -33
- package/node/index.d.ts +2 -2
- package/node/index.js +1 -1
- package/node/testing/index.d.ts +2 -2
- package/node/testing/index.js +8 -5
- package/package.json +3 -3
- package/src/_golden-api.d.ts +1 -1
- package/src/_golden-api.js +1 -1
- package/src/analytics/api.d.ts +1 -1
- package/src/analytics/api.js +7 -0
- package/src/analytics/forwarder.d.ts +1 -1
- package/src/analytics/forwarder.js +7 -0
- package/src/analytics/index.d.ts +1 -1
- package/src/analytics/index.js +7 -7
- package/src/analytics/logging.d.ts +1 -1
- package/src/analytics/logging.js +7 -0
- package/src/analytics/multi.d.ts +1 -1
- package/src/analytics/multi.js +6 -6
- package/src/analytics/noop.d.ts +1 -1
- package/src/analytics/noop.js +10 -1
- package/src/exception/exception.d.ts +1 -1
- package/src/exception/exception.js +25 -9
- package/src/exception/index.d.ts +1 -1
- package/src/exception/index.js +1 -1
- package/src/experimental/jobs/README.md +133 -112
- package/src/experimental/jobs/api.d.ts +1 -1
- package/src/experimental/jobs/api.js +8 -3
- package/src/experimental/jobs/architecture.md +43 -38
- package/src/experimental/jobs/create-job-handler.d.ts +1 -2
- package/src/experimental/jobs/create-job-handler.js +17 -14
- package/src/experimental/jobs/dispatcher.d.ts +1 -2
- package/src/experimental/jobs/dispatcher.js +7 -0
- package/src/experimental/jobs/exception.d.ts +1 -1
- package/src/experimental/jobs/exception.js +3 -3
- package/src/experimental/jobs/fallback-registry.d.ts +1 -1
- package/src/experimental/jobs/fallback-registry.js +4 -4
- package/src/experimental/jobs/index.d.ts +1 -1
- package/src/experimental/jobs/index.js +7 -7
- package/src/experimental/jobs/simple-registry.d.ts +1 -1
- package/src/experimental/jobs/simple-registry.js +6 -4
- package/src/experimental/jobs/simple-scheduler.d.ts +1 -1
- package/src/experimental/jobs/simple-scheduler.js +38 -29
- package/src/experimental/jobs/strategy.d.ts +7 -0
- package/src/experimental/jobs/strategy.js +10 -9
- package/src/experimental.d.ts +2 -2
- package/src/experimental.js +3 -3
- package/src/index.d.ts +2 -2
- package/src/index.js +7 -7
- package/src/json/index.d.ts +2 -2
- package/src/json/index.js +9 -9
- package/src/json/interface.d.ts +1 -1
- package/src/json/interface.js +7 -0
- package/src/json/parser.d.ts +1 -1
- package/src/json/parser.js +39 -22
- package/src/json/schema/index.d.ts +2 -2
- package/src/json/schema/index.js +9 -9
- package/src/json/schema/interface.d.ts +1 -1
- package/src/json/schema/interface.js +7 -0
- package/src/json/schema/pointer.d.ts +1 -1
- package/src/json/schema/pointer.js +17 -5
- package/src/json/schema/registry.d.ts +1 -1
- package/src/json/schema/registry.js +28 -47
- package/src/json/schema/schema.d.ts +1 -1
- package/src/json/schema/schema.js +3 -3
- package/src/json/schema/transforms.d.ts +1 -1
- package/src/json/schema/transforms.js +14 -13
- package/src/json/schema/utility.d.ts +7 -0
- package/src/json/schema/utility.js +7 -7
- package/src/json/schema/visitor.d.ts +1 -1
- package/src/json/schema/visitor.js +8 -7
- package/src/logger/indent.d.ts +7 -0
- package/src/logger/indent.js +5 -5
- package/src/logger/index.d.ts +1 -1
- package/src/logger/index.js +7 -7
- package/src/logger/level.d.ts +1 -1
- package/src/logger/level.js +7 -0
- package/src/logger/logger.d.ts +1 -1
- package/src/logger/logger.js +13 -6
- package/src/logger/null-logger.d.ts +7 -0
- package/src/logger/null-logger.js +3 -3
- package/src/logger/transform-logger.d.ts +1 -1
- package/src/logger/transform-logger.js +7 -0
- package/src/utils/array.d.ts +1 -1
- package/src/utils/array.js +2 -2
- package/src/utils/index.d.ts +1 -1
- package/src/utils/index.js +7 -7
- package/src/utils/lang.d.ts +1 -1
- package/src/utils/lang.js +3 -3
- package/src/utils/literals.d.ts +1 -1
- package/src/utils/literals.js +15 -8
- package/src/utils/object.d.ts +1 -1
- package/src/utils/object.js +3 -3
- package/src/utils/partially-ordered-set.d.ts +2 -2
- package/src/utils/partially-ordered-set.js +12 -8
- package/src/utils/priority-queue.d.ts +1 -1
- package/src/utils/priority-queue.js +2 -2
- package/src/utils/strings.d.ts +7 -0
- package/src/utils/strings.js +12 -9
- package/src/utils/template.d.ts +1 -1
- package/src/utils/template.js +24 -30
- package/src/virtual-fs/host/alias.d.ts +1 -1
- package/src/virtual-fs/host/alias.js +7 -5
- package/src/virtual-fs/host/buffer.d.ts +1 -1
- package/src/virtual-fs/host/buffer.js +7 -0
- package/src/virtual-fs/host/create.d.ts +7 -0
- package/src/virtual-fs/host/create.js +3 -3
- package/src/virtual-fs/host/empty.d.ts +1 -1
- package/src/virtual-fs/host/empty.js +3 -3
- package/src/virtual-fs/host/index.d.ts +1 -1
- package/src/virtual-fs/host/index.js +1 -1
- package/src/virtual-fs/host/interface.d.ts +1 -1
- package/src/virtual-fs/host/interface.js +7 -0
- package/src/virtual-fs/host/memory.d.ts +1 -1
- package/src/virtual-fs/host/memory.js +32 -20
- package/src/virtual-fs/host/pattern.d.ts +1 -1
- package/src/virtual-fs/host/pattern.js +17 -8
- package/src/virtual-fs/host/record.d.ts +1 -1
- package/src/virtual-fs/host/record.js +45 -28
- package/src/virtual-fs/host/resolver.d.ts +1 -1
- package/src/virtual-fs/host/resolver.js +10 -1
- package/src/virtual-fs/host/safe.d.ts +1 -1
- package/src/virtual-fs/host/safe.js +3 -3
- package/src/virtual-fs/host/scoped.d.ts +1 -1
- package/src/virtual-fs/host/scoped.js +3 -3
- package/src/virtual-fs/host/sync.d.ts +1 -1
- package/src/virtual-fs/host/sync.js +12 -3
- package/src/virtual-fs/host/test.d.ts +1 -1
- package/src/virtual-fs/host/test.js +11 -2
- package/src/virtual-fs/index.d.ts +2 -2
- package/src/virtual-fs/index.js +8 -8
- package/src/virtual-fs/path.d.ts +1 -1
- package/src/virtual-fs/path.js +17 -8
- package/src/workspace/core.d.ts +7 -0
- package/src/workspace/core.js +3 -3
- package/src/workspace/definitions.d.ts +1 -1
- package/src/workspace/definitions.js +7 -0
- package/src/workspace/host.d.ts +1 -1
- package/src/workspace/host.js +3 -3
- package/src/workspace/index.d.ts +1 -1
- package/src/workspace/index.js +7 -7
- package/src/workspace/json/metadata.d.ts +1 -1
- package/src/workspace/json/metadata.js +8 -1
- package/src/workspace/json/reader.d.ts +7 -0
- package/src/workspace/json/reader.js +4 -4
- package/src/workspace/json/utilities.d.ts +1 -1
- package/src/workspace/json/utilities.js +12 -5
- package/src/workspace/json/writer.d.ts +7 -0
- package/src/workspace/json/writer.js +4 -4
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.parseJsonPointer = exports.joinJsonPointer = exports.buildJsonPointer = void 0;
|
|
4
11
|
function buildJsonPointer(fragments) {
|
|
5
|
-
return ('/' +
|
|
6
|
-
|
|
7
|
-
.
|
|
8
|
-
|
|
12
|
+
return ('/' +
|
|
13
|
+
fragments
|
|
14
|
+
.map((f) => {
|
|
15
|
+
return f.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
16
|
+
})
|
|
17
|
+
.join('/'));
|
|
9
18
|
}
|
|
10
19
|
exports.buildJsonPointer = buildJsonPointer;
|
|
11
20
|
function joinJsonPointer(root, ...others) {
|
|
@@ -22,6 +31,9 @@ function parseJsonPointer(pointer) {
|
|
|
22
31
|
if (pointer.charAt(0) !== '/') {
|
|
23
32
|
throw new Error('Relative pointer: ' + pointer);
|
|
24
33
|
}
|
|
25
|
-
return pointer
|
|
34
|
+
return pointer
|
|
35
|
+
.substring(1)
|
|
36
|
+
.split(/\//)
|
|
37
|
+
.map((str) => str.replace(/~1/g, '/').replace(/~0/g, '~'));
|
|
26
38
|
}
|
|
27
39
|
exports.parseJsonPointer = parseJsonPointer;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoreSchemaRegistry = exports.SchemaValidationException = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CoreSchemaRegistry = exports.SchemaValidationException = void 0;
|
|
11
11
|
const ajv_1 = require("ajv");
|
|
12
12
|
const ajv_formats_1 = require("ajv-formats");
|
|
13
13
|
const http = require("http");
|
|
@@ -86,7 +86,7 @@ class CoreSchemaRegistry {
|
|
|
86
86
|
return new Promise((resolve, reject) => {
|
|
87
87
|
const url = new Url.URL(uri);
|
|
88
88
|
const client = url.protocol === 'https:' ? https : http;
|
|
89
|
-
client.get(url, res => {
|
|
89
|
+
client.get(url, (res) => {
|
|
90
90
|
if (!res.statusCode || res.statusCode >= 300) {
|
|
91
91
|
// Consume the rest of the data to free memory.
|
|
92
92
|
res.resume();
|
|
@@ -95,7 +95,7 @@ class CoreSchemaRegistry {
|
|
|
95
95
|
else {
|
|
96
96
|
res.setEncoding('utf8');
|
|
97
97
|
let data = '';
|
|
98
|
-
res.on('data', chunk => {
|
|
98
|
+
res.on('data', (chunk) => {
|
|
99
99
|
data += chunk;
|
|
100
100
|
});
|
|
101
101
|
res.on('end', () => {
|
|
@@ -170,14 +170,15 @@ class CoreSchemaRegistry {
|
|
|
170
170
|
this._ajv.removeSchema(schema);
|
|
171
171
|
this._currentCompilationSchemaInfo = undefined;
|
|
172
172
|
const validate = await this._ajv.compileAsync(schema);
|
|
173
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
173
174
|
const self = this;
|
|
174
175
|
function visitor(current, pointer, parentSchema, index) {
|
|
175
|
-
if (current
|
|
176
|
-
&&
|
|
177
|
-
&&
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
if (current &&
|
|
177
|
+
parentSchema &&
|
|
178
|
+
index &&
|
|
179
|
+
interface_1.isJsonObject(current) &&
|
|
180
|
+
Object.prototype.hasOwnProperty.call(current, '$ref') &&
|
|
181
|
+
typeof current['$ref'] == 'string') {
|
|
181
182
|
const resolved = self._resolver(current['$ref'], validate);
|
|
182
183
|
if (resolved.schema) {
|
|
183
184
|
parentSchema[index] = resolved.schema;
|
|
@@ -196,7 +197,7 @@ class CoreSchemaRegistry {
|
|
|
196
197
|
* @returns An Observable of the Validation function.
|
|
197
198
|
*/
|
|
198
199
|
compile(schema) {
|
|
199
|
-
return rxjs_1.from(this._compile(schema)).pipe(operators_1.map(validate => (value, options) => rxjs_1.from(validate(value, options))));
|
|
200
|
+
return rxjs_1.from(this._compile(schema)).pipe(operators_1.map((validate) => (value, options) => rxjs_1.from(validate(value, options))));
|
|
200
201
|
}
|
|
201
202
|
async _compile(schema) {
|
|
202
203
|
if (typeof schema === 'boolean') {
|
|
@@ -246,8 +247,7 @@ class CoreSchemaRegistry {
|
|
|
246
247
|
if (typeof schema === 'object') {
|
|
247
248
|
await visitor_1.visitJson(data, visitor, schema, this._resolver.bind(this), validator).toPromise();
|
|
248
249
|
}
|
|
249
|
-
const definitions = schemaInfo.promptDefinitions
|
|
250
|
-
.filter(def => !validationContext.promptFieldsWithValue.has(def.id));
|
|
250
|
+
const definitions = schemaInfo.promptDefinitions.filter((def) => !validationContext.promptFieldsWithValue.has(def.id));
|
|
251
251
|
if (definitions.length > 0) {
|
|
252
252
|
await this._applyPrompts(data, definitions);
|
|
253
253
|
}
|
|
@@ -288,7 +288,7 @@ class CoreSchemaRegistry {
|
|
|
288
288
|
// We cheat, heavily.
|
|
289
289
|
const pathArray = it.dataPathArr
|
|
290
290
|
.slice(1, it.dataLevel + 1)
|
|
291
|
-
.map(p => typeof p === 'number' ? p : p.str.slice(1, -1));
|
|
291
|
+
.map((p) => (typeof p === 'number' ? p : p.str.slice(1, -1)));
|
|
292
292
|
compilationSchemInfo.smartDefaultRecord.set(JSON.stringify(pathArray), schema);
|
|
293
293
|
return () => true;
|
|
294
294
|
},
|
|
@@ -321,9 +321,11 @@ class CoreSchemaRegistry {
|
|
|
321
321
|
if (!compilationSchemInfo) {
|
|
322
322
|
return () => true;
|
|
323
323
|
}
|
|
324
|
-
const path = '/' +
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
const path = '/' +
|
|
325
|
+
it.dataPathArr
|
|
326
|
+
.slice(1, it.dataLevel + 1)
|
|
327
|
+
.map((p) => (typeof p === 'number' ? p : p.str.slice(1, -1)))
|
|
328
|
+
.join('/');
|
|
327
329
|
let type;
|
|
328
330
|
let items;
|
|
329
331
|
let message;
|
|
@@ -360,7 +362,8 @@ class CoreSchemaRegistry {
|
|
|
360
362
|
? propertyTypes.size === 1 && propertyTypes.has('array')
|
|
361
363
|
: schema.multiselect;
|
|
362
364
|
const enumValues = multiselect
|
|
363
|
-
? parentSchema.items &&
|
|
365
|
+
? parentSchema.items &&
|
|
366
|
+
parentSchema.items.enum
|
|
364
367
|
: parentSchema.enum;
|
|
365
368
|
if (!items && Array.isArray(enumValues)) {
|
|
366
369
|
items = [];
|
|
@@ -450,37 +453,15 @@ class CoreSchemaRegistry {
|
|
|
450
453
|
}
|
|
451
454
|
}
|
|
452
455
|
static _set(
|
|
453
|
-
//
|
|
454
|
-
data, fragments, value,
|
|
455
|
-
|
|
456
|
-
parent = null, parentProperty, force) {
|
|
457
|
-
for (let i = 0; i < fragments.length; i++) {
|
|
458
|
-
const f = fragments[i];
|
|
459
|
-
if (f[0] == 'i') {
|
|
460
|
-
if (!Array.isArray(data)) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
for (let j = 0; j < data.length; j++) {
|
|
464
|
-
CoreSchemaRegistry._set(data[j], fragments.slice(i + 1), value, data, '' + j);
|
|
465
|
-
}
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
if (f.startsWith('key')) {
|
|
469
|
-
if (typeof data !== 'object') {
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
for (const property in data) {
|
|
473
|
-
CoreSchemaRegistry._set(data[property], fragments.slice(i + 1), value, data, property);
|
|
474
|
-
}
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
// We know we need an object because the fragment is a property key.
|
|
456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
457
|
+
data, fragments, value, parent = null, parentProperty, force) {
|
|
458
|
+
for (const fragment of fragments) {
|
|
478
459
|
if (!data && parent !== null && parentProperty) {
|
|
479
460
|
data = parent[parentProperty] = {};
|
|
480
461
|
}
|
|
481
462
|
parent = data;
|
|
482
|
-
parentProperty =
|
|
483
|
-
data = data[
|
|
463
|
+
parentProperty = fragment;
|
|
464
|
+
data = data[fragment];
|
|
484
465
|
}
|
|
485
466
|
if (parent && parentProperty && (force || parent[parentProperty] === undefined)) {
|
|
486
467
|
parent[parentProperty] = value;
|
|
@@ -520,7 +501,7 @@ class CoreSchemaRegistry {
|
|
|
520
501
|
if (typeof schema.id === 'string') {
|
|
521
502
|
schema.$id = schema.id;
|
|
522
503
|
delete schema.id;
|
|
523
|
-
//
|
|
504
|
+
// eslint-disable-next-line no-console
|
|
524
505
|
console.warn(`"${schema.$id}" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.`);
|
|
525
506
|
}
|
|
526
507
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeSchemas = exports.isJsonSchema = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.mergeSchemas = exports.isJsonSchema = void 0;
|
|
11
11
|
const interface_1 = require("../interface");
|
|
12
12
|
function isJsonSchema(value) {
|
|
13
13
|
return interface_1.isJsonObject(value) || value === false || value === true;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addUndefinedDefaults = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.addUndefinedDefaults = void 0;
|
|
11
11
|
const interface_1 = require("../interface");
|
|
12
12
|
const utility_1 = require("./utility");
|
|
13
13
|
function addUndefinedDefaults(value, _pointer, schema) {
|
|
@@ -69,17 +69,18 @@ function addUndefinedDefaults(value, _pointer, schema) {
|
|
|
69
69
|
const propertySchemas = schemaObject.oneOf || schemaObject.anyOf;
|
|
70
70
|
const allProperties = Object.keys(value);
|
|
71
71
|
// Locate a schema which declares all the properties that the object contains.
|
|
72
|
-
const adjustedSchema = interface_1.isJsonArray(propertySchemas) &&
|
|
73
|
-
|
|
72
|
+
const adjustedSchema = interface_1.isJsonArray(propertySchemas) &&
|
|
73
|
+
propertySchemas.find((s) => {
|
|
74
|
+
if (!interface_1.isJsonObject(s)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const schemaType = utility_1.getTypesOfSchema(s);
|
|
78
|
+
if (schemaType.size === 1 && schemaType.has('object') && interface_1.isJsonObject(s.properties)) {
|
|
79
|
+
const properties = Object.keys(s.properties);
|
|
80
|
+
return allProperties.every((key) => properties.includes(key));
|
|
81
|
+
}
|
|
74
82
|
return false;
|
|
75
|
-
}
|
|
76
|
-
const schemaType = utility_1.getTypesOfSchema(s);
|
|
77
|
-
if (schemaType.size === 1 && schemaType.has('object') && interface_1.isJsonObject(s.properties)) {
|
|
78
|
-
const properties = Object.keys(s.properties);
|
|
79
|
-
return allProperties.every(key => properties.includes(key));
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
});
|
|
83
|
+
});
|
|
83
84
|
if (adjustedSchema && interface_1.isJsonObject(adjustedSchema)) {
|
|
84
85
|
newValue[propName] = addUndefinedDefaults(value, _pointer, adjustedSchema);
|
|
85
86
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
1
8
|
import { JsonSchema } from './schema';
|
|
2
9
|
export declare function getTypesOfSchema(schema: JsonSchema): Set<string>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTypesOfSchema = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getTypesOfSchema = void 0;
|
|
11
11
|
const interface_1 = require("../interface");
|
|
12
12
|
const allTypes = ['string', 'integer', 'number', 'object', 'array', 'boolean', 'null'];
|
|
13
13
|
function getTypesOfSchema(schema) {
|
|
@@ -53,12 +53,12 @@ function getTypesOfSchema(schema) {
|
|
|
53
53
|
}
|
|
54
54
|
if (interface_1.isJsonObject(schema.not)) {
|
|
55
55
|
const notTypes = getTypesOfSchema(schema.not);
|
|
56
|
-
potentials = new Set([...potentials].filter(p => !notTypes.has(p)));
|
|
56
|
+
potentials = new Set([...potentials].filter((p) => !notTypes.has(p)));
|
|
57
57
|
}
|
|
58
58
|
if (Array.isArray(schema.allOf)) {
|
|
59
59
|
for (const sub of schema.allOf) {
|
|
60
60
|
const types = getTypesOfSchema(sub);
|
|
61
|
-
potentials = new Set([...types].filter(t => potentials.has(t)));
|
|
61
|
+
potentials = new Set([...types].filter((t) => potentials.has(t)));
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
if (Array.isArray(schema.oneOf)) {
|
|
@@ -67,7 +67,7 @@ function getTypesOfSchema(schema) {
|
|
|
67
67
|
const types = getTypesOfSchema(sub);
|
|
68
68
|
options = new Set([...options, ...types]);
|
|
69
69
|
}
|
|
70
|
-
potentials = new Set([...options].filter(o => potentials.has(o)));
|
|
70
|
+
potentials = new Set([...options].filter((o) => potentials.has(o)));
|
|
71
71
|
}
|
|
72
72
|
if (Array.isArray(schema.anyOf)) {
|
|
73
73
|
let options = new Set();
|
|
@@ -75,7 +75,7 @@ function getTypesOfSchema(schema) {
|
|
|
75
75
|
const types = getTypesOfSchema(sub);
|
|
76
76
|
options = new Set([...options, ...types]);
|
|
77
77
|
}
|
|
78
|
-
potentials = new Set([...options].filter(o => potentials.has(o)));
|
|
78
|
+
potentials = new Set([...options].filter((o) => potentials.has(o)));
|
|
79
79
|
}
|
|
80
80
|
if (schema.properties) {
|
|
81
81
|
potentials.add('object');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.visitJsonSchema = exports.visitJson = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.visitJsonSchema = exports.visitJson = void 0;
|
|
11
11
|
const rxjs_1 = require("rxjs");
|
|
12
12
|
const operators_1 = require("rxjs/operators");
|
|
13
13
|
const pointer_1 = require("./pointer");
|
|
@@ -37,6 +37,7 @@ function _visitJsonRecursive(json, visitor, ptr, schema, refResolver, context, r
|
|
|
37
37
|
// There's no schema definition, so just visit the JSON recursively.
|
|
38
38
|
schema = undefined;
|
|
39
39
|
}
|
|
40
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
40
41
|
if (schema && schema.hasOwnProperty('$ref') && typeof schema['$ref'] == 'string') {
|
|
41
42
|
if (refResolver) {
|
|
42
43
|
const resolved = refResolver(schema['$ref'], context);
|
|
@@ -45,15 +46,15 @@ function _visitJsonRecursive(json, visitor, ptr, schema, refResolver, context, r
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
const value = visitor(json, ptr, schema, root);
|
|
48
|
-
return (rxjs_1.isObservable(value) ? value : rxjs_1.of(value)).pipe(operators_1.concatMap(value => {
|
|
49
|
+
return (rxjs_1.isObservable(value) ? value : rxjs_1.of(value)).pipe(operators_1.concatMap((value) => {
|
|
49
50
|
if (Array.isArray(value)) {
|
|
50
51
|
return rxjs_1.concat(rxjs_1.from(value).pipe(operators_1.mergeMap((item, i) => {
|
|
51
|
-
return _visitJsonRecursive(item, visitor, pointer_1.joinJsonPointer(ptr, '' + i), _getObjectSubSchema(schema, '' + i), refResolver, context, root || value).pipe(operators_1.tap(x => (value[i] = x)));
|
|
52
|
+
return _visitJsonRecursive(item, visitor, pointer_1.joinJsonPointer(ptr, '' + i), _getObjectSubSchema(schema, '' + i), refResolver, context, root || value).pipe(operators_1.tap((x) => (value[i] = x)));
|
|
52
53
|
}), operators_1.ignoreElements()), rxjs_1.of(value));
|
|
53
54
|
}
|
|
54
55
|
else if (typeof value == 'object' && value !== null) {
|
|
55
|
-
return rxjs_1.concat(rxjs_1.from(Object.getOwnPropertyNames(value)).pipe(operators_1.mergeMap(key => {
|
|
56
|
-
return _visitJsonRecursive(value[key], visitor, pointer_1.joinJsonPointer(ptr, key), _getObjectSubSchema(schema, key), refResolver, context, root || value).pipe(operators_1.tap(x => {
|
|
56
|
+
return rxjs_1.concat(rxjs_1.from(Object.getOwnPropertyNames(value)).pipe(operators_1.mergeMap((key) => {
|
|
57
|
+
return _visitJsonRecursive(value[key], visitor, pointer_1.joinJsonPointer(ptr, key), _getObjectSubSchema(schema, key), refResolver, context, root || value).pipe(operators_1.tap((x) => {
|
|
57
58
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
58
59
|
if (descriptor && descriptor.writable && value[key] !== x) {
|
|
59
60
|
value[key] = x;
|
package/src/logger/indent.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
1
8
|
import { Logger } from './logger';
|
|
2
9
|
export declare class IndentLogger extends Logger {
|
|
3
10
|
constructor(name: string, parent?: Logger | null, indentation?: string);
|
package/src/logger/indent.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndentLogger = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.IndentLogger = void 0;
|
|
11
11
|
const operators_1 = require("rxjs/operators");
|
|
12
12
|
const logger_1 = require("./logger");
|
|
13
13
|
/**
|
|
@@ -23,8 +23,8 @@ class IndentLogger extends logger_1.Logger {
|
|
|
23
23
|
super(name, parent);
|
|
24
24
|
indentationMap[indentation] = indentationMap[indentation] || [''];
|
|
25
25
|
const indentMap = indentationMap[indentation];
|
|
26
|
-
this._observable = this._observable.pipe(operators_1.map(entry => {
|
|
27
|
-
const l = entry.path.filter(x => !!x).length;
|
|
26
|
+
this._observable = this._observable.pipe(operators_1.map((entry) => {
|
|
27
|
+
const l = entry.path.filter((x) => !!x).length;
|
|
28
28
|
if (l >= indentMap.length) {
|
|
29
29
|
let current = indentMap[indentMap.length - 1];
|
|
30
30
|
while (l >= indentMap.length) {
|
package/src/logger/index.d.ts
CHANGED
package/src/logger/index.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
10
|
if (k2 === undefined) k2 = k;
|
|
4
11
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -10,13 +17,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
18
|
};
|
|
12
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
16
|
-
*
|
|
17
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
18
|
-
* found in the LICENSE file at https://angular.io/license
|
|
19
|
-
*/
|
|
20
20
|
__exportStar(require("./indent"), exports);
|
|
21
21
|
__exportStar(require("./level"), exports);
|
|
22
22
|
__exportStar(require("./logger"), exports);
|
package/src/logger/level.d.ts
CHANGED
package/src/logger/level.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.LevelCapLogger = exports.LevelTransformLogger = void 0;
|
|
4
11
|
const logger_1 = require("./logger");
|
package/src/logger/logger.d.ts
CHANGED
package/src/logger/logger.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Logger = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Logger = void 0;
|
|
11
11
|
const rxjs_1 = require("rxjs");
|
|
12
12
|
class Logger extends rxjs_1.Observable {
|
|
13
13
|
constructor(name, parent = null) {
|
|
@@ -30,7 +30,9 @@ class Logger extends rxjs_1.Observable {
|
|
|
30
30
|
this.parent._subject.subscribe(undefined, undefined, () => this.complete());
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
get _observable() {
|
|
33
|
+
get _observable() {
|
|
34
|
+
return this._obs;
|
|
35
|
+
}
|
|
34
36
|
set _observable(v) {
|
|
35
37
|
if (this._subscription) {
|
|
36
38
|
this._subscription.unsubscribe();
|
|
@@ -74,7 +76,9 @@ class Logger extends rxjs_1.Observable {
|
|
|
74
76
|
}
|
|
75
77
|
log(level, message, metadata = {}) {
|
|
76
78
|
const entry = Object.assign({}, metadata, this._metadata, {
|
|
77
|
-
level,
|
|
79
|
+
level,
|
|
80
|
+
message,
|
|
81
|
+
timestamp: +Date.now(),
|
|
78
82
|
});
|
|
79
83
|
this._subject.next(entry);
|
|
80
84
|
}
|
|
@@ -103,7 +107,10 @@ class Logger extends rxjs_1.Observable {
|
|
|
103
107
|
return this._observable.lift(operator);
|
|
104
108
|
}
|
|
105
109
|
subscribe(_observerOrNext, _error, _complete) {
|
|
106
|
-
|
|
110
|
+
// eslint-disable-next-line prefer-spread
|
|
111
|
+
return this._observable.subscribe.apply(this._observable,
|
|
112
|
+
// eslint-disable-next-line prefer-rest-params
|
|
113
|
+
arguments);
|
|
107
114
|
}
|
|
108
115
|
forEach(next, PromiseCtor) {
|
|
109
116
|
return this._observable.forEach(next, PromiseCtor);
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
1
8
|
import { Logger, LoggerApi } from './logger';
|
|
2
9
|
export declare class NullLogger extends Logger {
|
|
3
10
|
constructor(parent?: Logger | null);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NullLogger = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.NullLogger = void 0;
|
|
11
11
|
const rxjs_1 = require("rxjs");
|
|
12
12
|
const logger_1 = require("./logger");
|
|
13
13
|
class NullLogger extends logger_1.Logger {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.TransformLogger = void 0;
|
|
4
11
|
const logger_1 = require("./logger");
|
package/src/utils/array.d.ts
CHANGED
package/src/utils/array.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -10,6 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.clean = void 0;
|
|
11
11
|
/** @deprecated Since v12.0, unused by the Angular tooling */
|
|
12
12
|
function clean(array) {
|
|
13
|
-
return array.filter(x => x !== undefined);
|
|
13
|
+
return array.filter((x) => x !== undefined);
|
|
14
14
|
}
|
|
15
15
|
exports.clean = clean;
|
package/src/utils/index.d.ts
CHANGED