@depup/angular-devkit__core 21.2.2-depup.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.
Files changed (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/changes.json +5 -0
  4. package/index.d.ts +8 -0
  5. package/index.js +25 -0
  6. package/index.js.map +1 -0
  7. package/node/cli-logger.d.ts +15 -0
  8. package/node/cli-logger.js +58 -0
  9. package/node/cli-logger.js.map +1 -0
  10. package/node/host.d.ts +43 -0
  11. package/node/host.js +211 -0
  12. package/node/host.js.map +1 -0
  13. package/node/index.d.ts +9 -0
  14. package/node/index.js +26 -0
  15. package/node/index.js.map +1 -0
  16. package/node/testing/index.d.ts +20 -0
  17. package/node/testing/index.js +90 -0
  18. package/node/testing/index.js.map +1 -0
  19. package/package.json +76 -0
  20. package/src/exception.d.ts +25 -0
  21. package/src/exception.js +48 -0
  22. package/src/exception.js.map +1 -0
  23. package/src/index.d.ts +15 -0
  24. package/src/index.js +57 -0
  25. package/src/index.js.map +1 -0
  26. package/src/json/index.d.ts +10 -0
  27. package/src/json/index.js +50 -0
  28. package/src/json/index.js.map +1 -0
  29. package/src/json/schema/index.d.ts +15 -0
  30. package/src/json/schema/index.js +55 -0
  31. package/src/json/schema/index.js.map +1 -0
  32. package/src/json/schema/interface.d.ts +84 -0
  33. package/src/json/schema/interface.js +10 -0
  34. package/src/json/schema/interface.js.map +1 -0
  35. package/src/json/schema/pointer.d.ts +11 -0
  36. package/src/json/schema/pointer.js +39 -0
  37. package/src/json/schema/pointer.js.map +1 -0
  38. package/src/json/schema/registry.d.ts +79 -0
  39. package/src/json/schema/registry.js +565 -0
  40. package/src/json/schema/registry.js.map +1 -0
  41. package/src/json/schema/schema.d.ts +22 -0
  42. package/src/json/schema/schema.js +52 -0
  43. package/src/json/schema/schema.js.map +1 -0
  44. package/src/json/schema/transforms.d.ts +12 -0
  45. package/src/json/schema/transforms.js +101 -0
  46. package/src/json/schema/transforms.js.map +1 -0
  47. package/src/json/schema/utility.d.ts +9 -0
  48. package/src/json/schema/utility.js +88 -0
  49. package/src/json/schema/utility.js.map +1 -0
  50. package/src/json/schema/visitor.d.ts +34 -0
  51. package/src/json/schema/visitor.js +147 -0
  52. package/src/json/schema/visitor.js.map +1 -0
  53. package/src/json/utils.d.ts +15 -0
  54. package/src/json/utils.js +18 -0
  55. package/src/json/utils.js.map +1 -0
  56. package/src/logger/indent.d.ts +11 -0
  57. package/src/logger/indent.js +41 -0
  58. package/src/logger/indent.js.map +1 -0
  59. package/src/logger/index.d.ts +12 -0
  60. package/src/logger/index.js +29 -0
  61. package/src/logger/index.js.map +1 -0
  62. package/src/logger/level.d.ts +28 -0
  63. package/src/logger/level.js +51 -0
  64. package/src/logger/level.js.map +1 -0
  65. package/src/logger/logger.d.ts +55 -0
  66. package/src/logger/logger.js +123 -0
  67. package/src/logger/logger.js.map +1 -0
  68. package/src/logger/null-logger.d.ts +12 -0
  69. package/src/logger/null-logger.js +31 -0
  70. package/src/logger/null-logger.js.map +1 -0
  71. package/src/logger/transform-logger.d.ts +12 -0
  72. package/src/logger/transform-logger.js +19 -0
  73. package/src/logger/transform-logger.js.map +1 -0
  74. package/src/utils/index.d.ts +15 -0
  75. package/src/utils/index.js +56 -0
  76. package/src/utils/index.js.map +1 -0
  77. package/src/utils/lang.d.ts +11 -0
  78. package/src/utils/lang.js +21 -0
  79. package/src/utils/lang.js.map +1 -0
  80. package/src/utils/literals.d.ts +15 -0
  81. package/src/utils/literals.js +59 -0
  82. package/src/utils/literals.js.map +1 -0
  83. package/src/utils/object.d.ts +8 -0
  84. package/src/utils/object.js +37 -0
  85. package/src/utils/object.js.map +1 -0
  86. package/src/utils/partially-ordered-set.d.ts +38 -0
  87. package/src/utils/partially-ordered-set.js +145 -0
  88. package/src/utils/partially-ordered-set.js.map +1 -0
  89. package/src/utils/priority-queue.d.ts +19 -0
  90. package/src/utils/priority-queue.js +50 -0
  91. package/src/utils/priority-queue.js.map +1 -0
  92. package/src/utils/strings.d.ts +112 -0
  93. package/src/utils/strings.js +179 -0
  94. package/src/utils/strings.js.map +1 -0
  95. package/src/utils/template.d.ts +89 -0
  96. package/src/utils/template.js +260 -0
  97. package/src/utils/template.js.map +1 -0
  98. package/src/virtual-fs/host/alias.d.ts +60 -0
  99. package/src/virtual-fs/host/alias.js +84 -0
  100. package/src/virtual-fs/host/alias.js.map +1 -0
  101. package/src/virtual-fs/host/buffer.d.ts +10 -0
  102. package/src/virtual-fs/host/buffer.js +22 -0
  103. package/src/virtual-fs/host/buffer.js.map +1 -0
  104. package/src/virtual-fs/host/create.d.ts +21 -0
  105. package/src/virtual-fs/host/create.js +55 -0
  106. package/src/virtual-fs/host/create.js.map +1 -0
  107. package/src/virtual-fs/host/empty.d.ts +19 -0
  108. package/src/virtual-fs/host/empty.js +38 -0
  109. package/src/virtual-fs/host/empty.js.map +1 -0
  110. package/src/virtual-fs/host/index.d.ts +21 -0
  111. package/src/virtual-fs/host/index.js +61 -0
  112. package/src/virtual-fs/host/index.js.map +1 -0
  113. package/src/virtual-fs/host/interface.d.ts +53 -0
  114. package/src/virtual-fs/host/interface.js +18 -0
  115. package/src/virtual-fs/host/interface.js.map +1 -0
  116. package/src/virtual-fs/host/memory.d.ts +49 -0
  117. package/src/virtual-fs/host/memory.js +332 -0
  118. package/src/virtual-fs/host/memory.js.map +1 -0
  119. package/src/virtual-fs/host/pattern.d.ts +17 -0
  120. package/src/virtual-fs/host/pattern.js +35 -0
  121. package/src/virtual-fs/host/pattern.js.map +1 -0
  122. package/src/virtual-fs/host/record.d.ts +92 -0
  123. package/src/virtual-fs/host/record.js +315 -0
  124. package/src/virtual-fs/host/record.js.map +1 -0
  125. package/src/virtual-fs/host/resolver.d.ts +30 -0
  126. package/src/virtual-fs/host/resolver.js +57 -0
  127. package/src/virtual-fs/host/resolver.js.map +1 -0
  128. package/src/virtual-fs/host/safe.d.ts +25 -0
  129. package/src/virtual-fs/host/safe.js +46 -0
  130. package/src/virtual-fs/host/safe.js.map +1 -0
  131. package/src/virtual-fs/host/scoped.d.ts +15 -0
  132. package/src/virtual-fs/host/scoped.js +24 -0
  133. package/src/virtual-fs/host/scoped.js.map +1 -0
  134. package/src/virtual-fs/host/sync.d.ts +34 -0
  135. package/src/virtual-fs/host/sync.js +93 -0
  136. package/src/virtual-fs/host/sync.js.map +1 -0
  137. package/src/virtual-fs/host/test.d.ts +48 -0
  138. package/src/virtual-fs/host/test.js +119 -0
  139. package/src/virtual-fs/host/test.js.map +1 -0
  140. package/src/virtual-fs/index.d.ts +10 -0
  141. package/src/virtual-fs/index.js +50 -0
  142. package/src/virtual-fs/index.js.map +1 -0
  143. package/src/virtual-fs/path.d.ts +111 -0
  144. package/src/virtual-fs/path.js +286 -0
  145. package/src/virtual-fs/path.js.map +1 -0
  146. package/src/workspace/core.d.ts +61 -0
  147. package/src/workspace/core.js +133 -0
  148. package/src/workspace/core.js.map +1 -0
  149. package/src/workspace/definitions.d.ts +63 -0
  150. package/src/workspace/definitions.js +169 -0
  151. package/src/workspace/definitions.js.map +1 -0
  152. package/src/workspace/host.d.ts +15 -0
  153. package/src/workspace/host.js +43 -0
  154. package/src/workspace/host.js.map +1 -0
  155. package/src/workspace/index.d.ts +10 -0
  156. package/src/workspace/index.js +32 -0
  157. package/src/workspace/index.js.map +1 -0
  158. package/src/workspace/json/metadata.d.ts +40 -0
  159. package/src/workspace/json/metadata.js +60 -0
  160. package/src/workspace/json/metadata.js.map +1 -0
  161. package/src/workspace/json/reader.d.ts +14 -0
  162. package/src/workspace/json/reader.js +231 -0
  163. package/src/workspace/json/reader.js.map +1 -0
  164. package/src/workspace/json/utilities.d.ts +14 -0
  165. package/src/workspace/json/utilities.js +113 -0
  166. package/src/workspace/json/utilities.js.map +1 -0
  167. package/src/workspace/json/writer.d.ts +12 -0
  168. package/src/workspace/json/writer.js +145 -0
  169. package/src/workspace/json/writer.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@depup/angular-devkit__core",
3
+ "version": "21.2.2-depup.0",
4
+ "description": "[DepUp] Angular DevKit - Core Utility Library",
5
+ "main": "src/index.js",
6
+ "typings": "src/index.d.ts",
7
+ "keywords": [
8
+ "depup",
9
+ "dependency-bumped",
10
+ "updated-deps",
11
+ "@angular-devkit/core",
12
+ "Angular CLI",
13
+ "Angular DevKit",
14
+ "angular",
15
+ "core",
16
+ "devkit",
17
+ "sdk"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./src/index.d.ts",
22
+ "default": "./src/index.js"
23
+ },
24
+ "./node": {
25
+ "types": "./node/index.d.ts",
26
+ "default": "./node/index.js"
27
+ },
28
+ "./node/testing": {
29
+ "types": "./node/testing/index.d.ts",
30
+ "default": "./node/testing/index.js"
31
+ },
32
+ "./package.json": "./package.json",
33
+ "./*": "./*.js",
34
+ "./*.js": "./*.js"
35
+ },
36
+ "dependencies": {
37
+ "ajv": "8.18.0",
38
+ "ajv-formats": "3.0.1",
39
+ "jsonc-parser": "3.3.1",
40
+ "picomatch": "4.0.3",
41
+ "rxjs": "7.8.2",
42
+ "source-map": "0.7.6"
43
+ },
44
+ "peerDependencies": {
45
+ "chokidar": "^5.0.0"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "chokidar": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/angular/angular-cli.git"
55
+ },
56
+ "packageManager": "pnpm@10.31.0",
57
+ "engines": {
58
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
59
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
60
+ "yarn": ">= 1.13.0"
61
+ },
62
+ "author": "Angular Authors",
63
+ "license": "MIT",
64
+ "bugs": {
65
+ "url": "https://github.com/angular/angular-cli/issues"
66
+ },
67
+ "homepage": "https://github.com/angular/angular-cli",
68
+ "depup": {
69
+ "changes": {},
70
+ "depsUpdated": 0,
71
+ "originalPackage": "@angular-devkit/core",
72
+ "originalVersion": "21.2.2",
73
+ "processedAt": "2026-03-17T16:29:43.933Z",
74
+ "smokeTest": "passed"
75
+ }
76
+ }
@@ -0,0 +1,25 @@
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.dev/license
7
+ */
8
+ export declare class BaseException extends Error {
9
+ constructor(message?: string);
10
+ }
11
+ export declare class UnknownException extends BaseException {
12
+ constructor(message: string);
13
+ }
14
+ export declare class FileDoesNotExistException extends BaseException {
15
+ constructor(path: string);
16
+ }
17
+ export declare class FileAlreadyExistException extends BaseException {
18
+ constructor(path: string);
19
+ }
20
+ export declare class PathIsDirectoryException extends BaseException {
21
+ constructor(path: string);
22
+ }
23
+ export declare class PathIsFileException extends BaseException {
24
+ constructor(path: string);
25
+ }
@@ -0,0 +1,48 @@
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.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.PathIsFileException = exports.PathIsDirectoryException = exports.FileAlreadyExistException = exports.FileDoesNotExistException = exports.UnknownException = exports.BaseException = void 0;
11
+ class BaseException extends Error {
12
+ constructor(message = '') {
13
+ super(message);
14
+ }
15
+ }
16
+ exports.BaseException = BaseException;
17
+ class UnknownException extends BaseException {
18
+ constructor(message) {
19
+ super(message);
20
+ }
21
+ }
22
+ exports.UnknownException = UnknownException;
23
+ // Exceptions
24
+ class FileDoesNotExistException extends BaseException {
25
+ constructor(path) {
26
+ super(`Path "${path}" does not exist.`);
27
+ }
28
+ }
29
+ exports.FileDoesNotExistException = FileDoesNotExistException;
30
+ class FileAlreadyExistException extends BaseException {
31
+ constructor(path) {
32
+ super(`Path "${path}" already exist.`);
33
+ }
34
+ }
35
+ exports.FileAlreadyExistException = FileAlreadyExistException;
36
+ class PathIsDirectoryException extends BaseException {
37
+ constructor(path) {
38
+ super(`Path "${path}" is a directory.`);
39
+ }
40
+ }
41
+ exports.PathIsDirectoryException = PathIsDirectoryException;
42
+ class PathIsFileException extends BaseException {
43
+ constructor(path) {
44
+ super(`Path "${path}" is a file.`);
45
+ }
46
+ }
47
+ exports.PathIsFileException = PathIsFileException;
48
+ //# sourceMappingURL=exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exception.js","sourceRoot":"","sources":["exception.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAO,GAAG,EAAE;QACtB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAJD,sCAIC;AAED,MAAa,gBAAiB,SAAQ,aAAa;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAJD,4CAIC;AAED,aAAa;AACb,MAAa,yBAA0B,SAAQ,aAAa;IAC1D,YAAY,IAAY;QACtB,KAAK,CAAC,SAAS,IAAI,mBAAmB,CAAC,CAAC;IAC1C,CAAC;CACF;AAJD,8DAIC;AACD,MAAa,yBAA0B,SAAQ,aAAa;IAC1D,YAAY,IAAY;QACtB,KAAK,CAAC,SAAS,IAAI,kBAAkB,CAAC,CAAC;IACzC,CAAC;CACF;AAJD,8DAIC;AACD,MAAa,wBAAyB,SAAQ,aAAa;IACzD,YAAY,IAAY;QACtB,KAAK,CAAC,SAAS,IAAI,mBAAmB,CAAC,CAAC;IAC1C,CAAC;CACF;AAJD,4DAIC;AACD,MAAa,mBAAoB,SAAQ,aAAa;IACpD,YAAY,IAAY;QACtB,KAAK,CAAC,SAAS,IAAI,cAAc,CAAC,CAAC;IACrC,CAAC;CACF;AAJD,kDAIC"}
package/src/index.d.ts ADDED
@@ -0,0 +1,15 @@
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.dev/license
7
+ */
8
+ import * as json from './json/index';
9
+ import * as logging from './logger/index';
10
+ import * as workspaces from './workspace';
11
+ export * from './exception';
12
+ export * from './json/index';
13
+ export * from './utils/index';
14
+ export * from './virtual-fs/index';
15
+ export { json, logging, workspaces };
package/src/index.js ADDED
@@ -0,0 +1,57 @@
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.dev/license
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
43
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.workspaces = exports.logging = exports.json = void 0;
47
+ const json = __importStar(require("./json/index"));
48
+ exports.json = json;
49
+ const logging = __importStar(require("./logger/index"));
50
+ exports.logging = logging;
51
+ const workspaces = __importStar(require("./workspace"));
52
+ exports.workspaces = workspaces;
53
+ __exportStar(require("./exception"), exports);
54
+ __exportStar(require("./json/index"), exports);
55
+ __exportStar(require("./utils/index"), exports);
56
+ __exportStar(require("./virtual-fs/index"), exports);
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAS5B,oBAAI;AARb,wDAA0C;AAQ3B,0BAAO;AAPtB,wDAA0C;AAOlB,gCAAU;AALlC,8CAA4B;AAC5B,+CAA6B;AAC7B,gDAA8B;AAC9B,qDAAmC"}
@@ -0,0 +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.dev/license
7
+ */
8
+ import * as schema from './schema/index';
9
+ export * from './utils';
10
+ export { schema };
@@ -0,0 +1,50 @@
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.dev/license
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
43
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.schema = void 0;
47
+ const schema = __importStar(require("./schema/index"));
48
+ exports.schema = schema;
49
+ __exportStar(require("./utils"), exports);
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uDAAyC;AAGhC,wBAAM;AADf,0CAAwB"}
@@ -0,0 +1,15 @@
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.dev/license
7
+ */
8
+ import * as transforms from './transforms';
9
+ export * from './interface';
10
+ export * from './pointer';
11
+ export * from './registry';
12
+ export * from './schema';
13
+ export * from './visitor';
14
+ export * from './utility';
15
+ export { transforms };
@@ -0,0 +1,55 @@
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.dev/license
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
43
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.transforms = void 0;
47
+ const transforms = __importStar(require("./transforms"));
48
+ exports.transforms = transforms;
49
+ __exportStar(require("./interface"), exports);
50
+ __exportStar(require("./pointer"), exports);
51
+ __exportStar(require("./registry"), exports);
52
+ __exportStar(require("./schema"), exports);
53
+ __exportStar(require("./visitor"), exports);
54
+ __exportStar(require("./utility"), exports);
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AASlC,gCAAU;AAPnB,8CAA4B;AAC5B,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B"}
@@ -0,0 +1,84 @@
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.dev/license
7
+ */
8
+ import { ErrorObject, Format } from 'ajv';
9
+ import { Observable, ObservableInput } from 'rxjs';
10
+ import { JsonArray, JsonObject, JsonValue } from '../utils';
11
+ export type JsonPointer = string & {
12
+ __PRIVATE_DEVKIT_JSON_POINTER: void;
13
+ };
14
+ export interface SchemaValidatorResult {
15
+ data: JsonValue;
16
+ success: boolean;
17
+ errors?: SchemaValidatorError[];
18
+ }
19
+ export type SchemaValidatorError = Partial<ErrorObject>;
20
+ export interface SchemaValidatorOptions {
21
+ applyPreTransforms?: boolean;
22
+ applyPostTransforms?: boolean;
23
+ withPrompts?: boolean;
24
+ }
25
+ export interface SchemaValidator {
26
+ (data: JsonValue, options?: SchemaValidatorOptions): Promise<SchemaValidatorResult>;
27
+ }
28
+ export type SchemaFormatter = Format;
29
+ export interface SchemaFormat {
30
+ name: string;
31
+ formatter: SchemaFormatter;
32
+ }
33
+ export interface SmartDefaultProvider<T> {
34
+ (schema: JsonObject): T | Observable<T>;
35
+ }
36
+ export interface SchemaKeywordValidator {
37
+ (data: JsonValue, schema: JsonValue, parent: JsonObject | JsonArray | undefined, parentProperty: string | number | undefined, pointer: JsonPointer, rootData: JsonValue): boolean | Observable<boolean>;
38
+ }
39
+ export interface PromptDefinition {
40
+ id: string;
41
+ type: string;
42
+ message: string;
43
+ default?: string | string[] | number | boolean | null;
44
+ validator?: (value: JsonValue) => boolean | string | Promise<boolean | string>;
45
+ items?: Array<string | {
46
+ value: JsonValue;
47
+ label: string;
48
+ }>;
49
+ raw?: string | JsonObject;
50
+ multiselect?: boolean;
51
+ propertyTypes: Set<string>;
52
+ }
53
+ export type PromptProvider = (definitions: Array<PromptDefinition>) => ObservableInput<{
54
+ [id: string]: JsonValue;
55
+ }>;
56
+ export interface SchemaRegistry {
57
+ compile(schema: Object): Promise<SchemaValidator>;
58
+ /** @private */
59
+ ɵflatten(schema: JsonObject | string): Promise<JsonObject>;
60
+ addFormat(format: SchemaFormat): void;
61
+ addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
62
+ usePromptProvider(provider: PromptProvider): void;
63
+ useXDeprecatedProvider(onUsage: (message: string) => void): void;
64
+ /**
65
+ * Add a transformation step before the validation of any Json.
66
+ * @param {JsonVisitor} visitor The visitor to transform every value.
67
+ * @param {JsonVisitor[]} deps A list of other visitors to run before.
68
+ */
69
+ addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
70
+ /**
71
+ * Add a transformation step after the validation of any Json. The JSON will not be validated
72
+ * after the POST, so if transformations are not compatible with the Schema it will not result
73
+ * in an error.
74
+ * @param {JsonVisitor} visitor The visitor to transform every value.
75
+ * @param {JsonVisitor[]} deps A list of other visitors to run before.
76
+ */
77
+ addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
78
+ }
79
+ export interface JsonSchemaVisitor {
80
+ (current: JsonObject | JsonArray, pointer: JsonPointer, parentSchema?: JsonObject | JsonArray, index?: string): void;
81
+ }
82
+ export interface JsonVisitor {
83
+ (value: JsonValue, pointer: JsonPointer, schema?: JsonObject, root?: JsonObject | JsonArray): Observable<JsonValue> | JsonValue;
84
+ }
@@ -0,0 +1,10 @@
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.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["interface.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
@@ -0,0 +1,11 @@
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.dev/license
7
+ */
8
+ import { JsonPointer } from './interface';
9
+ export declare function buildJsonPointer(fragments: string[]): JsonPointer;
10
+ export declare function joinJsonPointer(root: JsonPointer, ...others: string[]): JsonPointer;
11
+ export declare function parseJsonPointer(pointer: JsonPointer): string[];
@@ -0,0 +1,39 @@
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.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.buildJsonPointer = buildJsonPointer;
11
+ exports.joinJsonPointer = joinJsonPointer;
12
+ exports.parseJsonPointer = parseJsonPointer;
13
+ function buildJsonPointer(fragments) {
14
+ return ('/' +
15
+ fragments
16
+ .map((f) => {
17
+ return f.replace(/~/g, '~0').replace(/\//g, '~1');
18
+ })
19
+ .join('/'));
20
+ }
21
+ function joinJsonPointer(root, ...others) {
22
+ if (root == '/') {
23
+ return buildJsonPointer(others);
24
+ }
25
+ return (root + buildJsonPointer(others));
26
+ }
27
+ function parseJsonPointer(pointer) {
28
+ if (pointer === '') {
29
+ return [];
30
+ }
31
+ if (pointer.charAt(0) !== '/') {
32
+ throw new Error('Relative pointer: ' + pointer);
33
+ }
34
+ return pointer
35
+ .substring(1)
36
+ .split(/\//)
37
+ .map((str) => str.replace(/~1/g, '/').replace(/~0/g, '~'));
38
+ }
39
+ //# sourceMappingURL=pointer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointer.js","sourceRoot":"","sources":["pointer.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAIH,4CAOC;AACD,0CAMC;AACD,4CAYC;AA3BD,SAAgB,gBAAgB,CAAC,SAAmB;IAClD,OAAO,CAAC,GAAG;QACT,SAAS;aACN,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACT,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpD,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAgB,CAAC;AACjC,CAAC;AACD,SAAgB,eAAe,CAAC,IAAiB,EAAE,GAAG,MAAgB;IACpE,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;QAChB,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAgB,CAAC;AAC1D,CAAC;AACD,SAAgB,gBAAgB,CAAC,OAAoB;IACnD,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,OAAO;SACX,SAAS,CAAC,CAAC,CAAC;SACZ,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,79 @@
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.dev/license
7
+ */
8
+ import { ValidateFunction } from 'ajv';
9
+ import { Observable } from 'rxjs';
10
+ import { BaseException } from '../../exception';
11
+ import { JsonObject } from '../utils';
12
+ import { JsonVisitor, PromptProvider, SchemaFormat, SchemaRegistry, SchemaValidator, SchemaValidatorError, SmartDefaultProvider } from './interface';
13
+ import { JsonSchema } from './schema';
14
+ export type UriHandler = (uri: string) => Observable<JsonObject> | Promise<JsonObject> | null | undefined;
15
+ export declare class SchemaValidationException extends BaseException {
16
+ readonly errors: SchemaValidatorError[];
17
+ constructor(errors?: SchemaValidatorError[], baseMessage?: string);
18
+ static createMessages(errors?: SchemaValidatorError[]): string[];
19
+ }
20
+ export declare class CoreSchemaRegistry implements SchemaRegistry {
21
+ private _ajv;
22
+ private _uriCache;
23
+ private _uriHandlers;
24
+ private _pre;
25
+ private _post;
26
+ private _currentCompilationSchemaInfo?;
27
+ private _smartDefaultKeyword;
28
+ private _promptProvider?;
29
+ private _sourceMap;
30
+ constructor(formats?: SchemaFormat[]);
31
+ private _fetch;
32
+ /**
33
+ * Add a transformation step before the validation of any Json.
34
+ * @param {JsonVisitor} visitor The visitor to transform every value.
35
+ * @param {JsonVisitor[]} deps A list of other visitors to run before.
36
+ */
37
+ addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
38
+ /**
39
+ * Add a transformation step after the validation of any Json. The JSON will not be validated
40
+ * after the POST, so if transformations are not compatible with the Schema it will not result
41
+ * in an error.
42
+ * @param {JsonVisitor} visitor The visitor to transform every value.
43
+ * @param {JsonVisitor[]} deps A list of other visitors to run before.
44
+ */
45
+ addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
46
+ protected _resolver(ref: string, validate?: ValidateFunction): {
47
+ context?: ValidateFunction;
48
+ schema?: JsonObject;
49
+ };
50
+ /**
51
+ * Flatten the Schema, resolving and replacing all the refs. Makes it into a synchronous schema
52
+ * that is also easier to traverse. Does not cache the result.
53
+ *
54
+ * Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original.
55
+ * See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
56
+ *
57
+ * @param schema The schema or URI to flatten.
58
+ * @returns An Observable of the flattened schema object.
59
+ * @private since 11.2 without replacement.
60
+ */
61
+ ɵflatten(schema: JsonObject): Promise<JsonObject>;
62
+ /**
63
+ * Compile and return a validation function for the Schema.
64
+ *
65
+ * @param schema The schema to validate. If a string, will fetch the schema before compiling it
66
+ * (using schema as a URI).
67
+ */
68
+ compile(schema: JsonSchema): Promise<SchemaValidator>;
69
+ private _compile;
70
+ addFormat(format: SchemaFormat): void;
71
+ addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
72
+ registerUriHandler(handler: UriHandler): void;
73
+ usePromptProvider(provider: PromptProvider): void;
74
+ private _applyPrompts;
75
+ private static _set;
76
+ private _applySmartDefaults;
77
+ useXDeprecatedProvider(onUsage: (message: string) => void): void;
78
+ private normalizeDataPathArr;
79
+ }