This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -97,13 +97,13 @@ import {
provideNetlifyLoader,
registerLocaleData,
setRootDomAdapter
} from "./chunk-ASHOWUOS.js";
} from "./chunk-OSQUZMO7.js";
import {
IMAGE_CONFIG
} from "./chunk-BODXJ6DH.js";
} from "./chunk-QOTEZZCO.js";
import {
DOCUMENT
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
export {
APP_BASE_HREF,
AsyncPipe,
@@ -422,7 +422,7 @@ import {
ɵɵvalidateAttribute,
ɵɵviewQuery,
ɵɵviewQuerySignal
} from "./chunk-BODXJ6DH.js";
} from "./chunk-QOTEZZCO.js";
import {
CONTAINER_HEADER_OFFSET,
ChangeDetectionScheduler,
@@ -504,7 +504,7 @@ import {
ɵɵnamespaceSVG,
ɵɵresetView,
ɵɵrestoreView
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
export {
ANIMATION_MODULE_TYPE,
APP_BOOTSTRAP_LISTENER,
@@ -18,7 +18,7 @@ import {
signal,
takeUntil,
untracked
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
// node_modules/@angular/core/fesm2022/rxjs-interop.mjs
function takeUntilDestroyed(destroyRef) {
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -34,12 +34,12 @@ import {
withI18nSupport,
withIncrementalHydration,
withNoHttpTransferCache
} from "./chunk-4PFH2A2L.js";
} from "./chunk-CQTYMEF7.js";
import {
getDOM
} from "./chunk-ASHOWUOS.js";
import "./chunk-BODXJ6DH.js";
import "./chunk-D7FUV64K.js";
} from "./chunk-OSQUZMO7.js";
import "./chunk-QOTEZZCO.js";
import "./chunk-E5HF4UWX.js";
export {
BrowserModule,
By,
@@ -1,6 +1,6 @@
import {
Title
} from "./chunk-4PFH2A2L.js";
} from "./chunk-CQTYMEF7.js";
import {
HashLocationStrategy,
LOCATION_INITIALIZED,
@@ -12,7 +12,7 @@ import {
PlatformLocation,
PlatformNavigation,
ViewportScroller
} from "./chunk-ASHOWUOS.js";
} from "./chunk-OSQUZMO7.js";
import {
APP_BOOTSTRAP_LISTENER,
ApplicationRef,
@@ -61,7 +61,7 @@ import {
ɵɵloadQuery,
ɵɵqueryRefresh,
ɵɵsanitizeUrlOrResourceUrl
} from "./chunk-BODXJ6DH.js";
} from "./chunk-QOTEZZCO.js";
import {
BehaviorSubject,
DOCUMENT,
@@ -120,7 +120,7 @@ import {
ɵɵdefineInjectable,
ɵɵdefineInjector,
ɵɵinject
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
// node_modules/@angular/router/fesm2022/_router-chunk.mjs
var PRIMARY_OUTLET = "primary";
@@ -1901,7 +1901,7 @@ var OutletInjector = class {
this.parent = parent;
this.outletData = outletData;
}
get(token, notfoundValue) {
get(token, notFoundValue) {
if (token === ActivatedRoute) {
return this.route;
}
@@ -1911,7 +1911,7 @@ var OutletInjector = class {
if (token === ROUTER_OUTLET_DATA) {
return this.outletData;
}
return this.parent.get(token, notfoundValue);
return this.parent.get(token, notFoundValue);
}
};
var INPUT_BINDER = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "Router Input Binder" : "");
File diff suppressed because one or more lines are too long
+23 -17
View File
@@ -1,52 +1,58 @@
{
"hash": "b7f5cb4f",
"configHash": "a53809ec",
"lockfileHash": "1ab722c3",
"browserHash": "161d14eb",
"hash": "9fd8f555",
"configHash": "5b7769bc",
"lockfileHash": "5eefefa6",
"browserHash": "f3a0cf9e",
"optimized": {
"@angular/common": {
"src": "../../../../../../node_modules/@angular/common/fesm2022/common.mjs",
"file": "@angular_common.js",
"fileHash": "142edf3d",
"fileHash": "92419653",
"needsInterop": false
},
"@angular/core": {
"src": "../../../../../../node_modules/@angular/core/fesm2022/core.mjs",
"file": "@angular_core.js",
"fileHash": "df170a94",
"fileHash": "67fb826c",
"needsInterop": false
},
"@angular/core/rxjs-interop": {
"src": "../../../../../../node_modules/@angular/core/fesm2022/rxjs-interop.mjs",
"file": "@angular_core_rxjs-interop.js",
"fileHash": "869475bd",
"fileHash": "64f4b50a",
"needsInterop": false
},
"@angular/forms": {
"src": "../../../../../../node_modules/@angular/forms/fesm2022/forms.mjs",
"file": "@angular_forms.js",
"fileHash": "b5a612b1",
"needsInterop": false
},
"@angular/platform-browser": {
"src": "../../../../../../node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs",
"file": "@angular_platform-browser.js",
"fileHash": "6e8ad9e1",
"fileHash": "de234f03",
"needsInterop": false
},
"@angular/router": {
"src": "../../../../../../node_modules/@angular/router/fesm2022/router.mjs",
"file": "@angular_router.js",
"fileHash": "eab0ece7",
"fileHash": "55ea1108",
"needsInterop": false
}
},
"chunks": {
"chunk-4PFH2A2L": {
"file": "chunk-4PFH2A2L.js"
"chunk-CQTYMEF7": {
"file": "chunk-CQTYMEF7.js"
},
"chunk-ASHOWUOS": {
"file": "chunk-ASHOWUOS.js"
"chunk-OSQUZMO7": {
"file": "chunk-OSQUZMO7.js"
},
"chunk-BODXJ6DH": {
"file": "chunk-BODXJ6DH.js"
"chunk-QOTEZZCO": {
"file": "chunk-QOTEZZCO.js"
},
"chunk-D7FUV64K": {
"file": "chunk-D7FUV64K.js"
"chunk-E5HF4UWX": {
"file": "chunk-E5HF4UWX.js"
}
}
}
@@ -7,7 +7,7 @@ import {
getDOM,
parseCookieValue,
setRootDomAdapter
} from "./chunk-ASHOWUOS.js";
} from "./chunk-OSQUZMO7.js";
import {
APP_BOOTSTRAP_LISTENER,
APP_ID,
@@ -54,7 +54,7 @@ import {
withI18nSupport,
withIncrementalHydration,
ɵɵdefineNgModule
} from "./chunk-BODXJ6DH.js";
} from "./chunk-QOTEZZCO.js";
import {
DOCUMENT,
DestroyRef,
@@ -95,7 +95,7 @@ import {
ɵɵdefineInjectable,
ɵɵdefineInjector,
ɵɵinject
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
// node_modules/@angular/platform-browser/fesm2022/_dom_renderer-chunk.mjs
var EventManagerPlugin = class {
@@ -1842,7 +1842,7 @@ var HttpStatusCode;
HttpStatusCode2[HttpStatusCode2["Unauthorized"] = 401] = "Unauthorized";
HttpStatusCode2[HttpStatusCode2["PaymentRequired"] = 402] = "PaymentRequired";
HttpStatusCode2[HttpStatusCode2["Forbidden"] = 403] = "Forbidden";
HttpStatusCode2[HttpStatusCode2["notfound"] = 404] = "notfound";
HttpStatusCode2[HttpStatusCode2["NotFound"] = 404] = "NotFound";
HttpStatusCode2[HttpStatusCode2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
HttpStatusCode2[HttpStatusCode2["NotAcceptable"] = 406] = "NotAcceptable";
HttpStatusCode2[HttpStatusCode2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
@@ -4122,4 +4122,4 @@ export {
provideClientHydration,
VERSION
};
//# sourceMappingURL=chunk-4PFH2A2L.js.map
//# sourceMappingURL=chunk-CQTYMEF7.js.map
File diff suppressed because one or more lines are too long
@@ -1422,73 +1422,6 @@ var ReplaySubject = (function(_super) {
return ReplaySubject2;
})(Subject);
// node_modules/rxjs/dist/esm5/internal/util/lift.js
function hasLift(source) {
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
}
function operate(init) {
return function(source) {
if (hasLift(source)) {
return source.lift(function(liftedSource) {
try {
return init(liftedSource, this);
} catch (err) {
this.error(err);
}
});
}
throw new TypeError("Unable to lift unknown Observable type");
};
}
// node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
}
var OperatorSubscriber = (function(_super) {
__extends(OperatorSubscriber2, _super);
function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
var _this = _super.call(this, destination) || this;
_this.onFinalize = onFinalize;
_this.shouldUnsubscribe = shouldUnsubscribe;
_this._next = onNext ? function(value) {
try {
onNext(value);
} catch (err) {
destination.error(err);
}
} : _super.prototype._next;
_this._error = onError ? function(err) {
try {
onError(err);
} catch (err2) {
destination.error(err2);
} finally {
this.unsubscribe();
}
} : _super.prototype._error;
_this._complete = onComplete ? function() {
try {
onComplete();
} catch (err) {
destination.error(err);
} finally {
this.unsubscribe();
}
} : _super.prototype._complete;
return _this;
}
OperatorSubscriber2.prototype.unsubscribe = function() {
var _a;
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
var closed_1 = this.closed;
_super.prototype.unsubscribe.call(this);
!closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
}
};
return OperatorSubscriber2;
})(Subscriber);
// node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js
var isArrayLike = (function(x) {
return x && typeof x.length === "number" && typeof x !== "function";
@@ -1711,6 +1644,355 @@ function process(asyncIterable, subscriber) {
});
}
// node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js
function executeSchedule(parentSubscription, scheduler, work, delay2, repeat2) {
if (delay2 === void 0) {
delay2 = 0;
}
if (repeat2 === void 0) {
repeat2 = false;
}
var scheduleSubscription = scheduler.schedule(function() {
work();
if (repeat2) {
parentSubscription.add(this.schedule(null, delay2));
} else {
this.unsubscribe();
}
}, delay2);
parentSubscription.add(scheduleSubscription);
if (!repeat2) {
return scheduleSubscription;
}
}
// node_modules/rxjs/dist/esm5/internal/util/lift.js
function hasLift(source) {
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
}
function operate(init) {
return function(source) {
if (hasLift(source)) {
return source.lift(function(liftedSource) {
try {
return init(liftedSource, this);
} catch (err) {
this.error(err);
}
});
}
throw new TypeError("Unable to lift unknown Observable type");
};
}
// node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
}
var OperatorSubscriber = (function(_super) {
__extends(OperatorSubscriber2, _super);
function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
var _this = _super.call(this, destination) || this;
_this.onFinalize = onFinalize;
_this.shouldUnsubscribe = shouldUnsubscribe;
_this._next = onNext ? function(value) {
try {
onNext(value);
} catch (err) {
destination.error(err);
}
} : _super.prototype._next;
_this._error = onError ? function(err) {
try {
onError(err);
} catch (err2) {
destination.error(err2);
} finally {
this.unsubscribe();
}
} : _super.prototype._error;
_this._complete = onComplete ? function() {
try {
onComplete();
} catch (err) {
destination.error(err);
} finally {
this.unsubscribe();
}
} : _super.prototype._complete;
return _this;
}
OperatorSubscriber2.prototype.unsubscribe = function() {
var _a;
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
var closed_1 = this.closed;
_super.prototype.unsubscribe.call(this);
!closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
}
};
return OperatorSubscriber2;
})(Subscriber);
// node_modules/rxjs/dist/esm5/internal/operators/observeOn.js
function observeOn(scheduler, delay2) {
if (delay2 === void 0) {
delay2 = 0;
}
return operate(function(source, subscriber) {
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
return executeSchedule(subscriber, scheduler, function() {
return subscriber.next(value);
}, delay2);
}, function() {
return executeSchedule(subscriber, scheduler, function() {
return subscriber.complete();
}, delay2);
}, function(err) {
return executeSchedule(subscriber, scheduler, function() {
return subscriber.error(err);
}, delay2);
}));
});
}
// node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js
function subscribeOn(scheduler, delay2) {
if (delay2 === void 0) {
delay2 = 0;
}
return operate(function(source, subscriber) {
subscriber.add(scheduler.schedule(function() {
return source.subscribe(subscriber);
}, delay2));
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js
function scheduleObservable(input, scheduler) {
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
}
// node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js
function schedulePromise(input, scheduler) {
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js
function scheduleArray(input, scheduler) {
return new Observable(function(subscriber) {
var i = 0;
return scheduler.schedule(function() {
if (i === input.length) {
subscriber.complete();
} else {
subscriber.next(input[i++]);
if (!subscriber.closed) {
this.schedule();
}
}
});
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js
function scheduleIterable(input, scheduler) {
return new Observable(function(subscriber) {
var iterator2;
executeSchedule(subscriber, scheduler, function() {
iterator2 = input[iterator]();
executeSchedule(subscriber, scheduler, function() {
var _a;
var value;
var done;
try {
_a = iterator2.next(), value = _a.value, done = _a.done;
} catch (err) {
subscriber.error(err);
return;
}
if (done) {
subscriber.complete();
} else {
subscriber.next(value);
}
}, 0, true);
});
return function() {
return isFunction(iterator2 === null || iterator2 === void 0 ? void 0 : iterator2.return) && iterator2.return();
};
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js
function scheduleAsyncIterable(input, scheduler) {
if (!input) {
throw new Error("Iterable cannot be null");
}
return new Observable(function(subscriber) {
executeSchedule(subscriber, scheduler, function() {
var iterator2 = input[Symbol.asyncIterator]();
executeSchedule(subscriber, scheduler, function() {
iterator2.next().then(function(result) {
if (result.done) {
subscriber.complete();
} else {
subscriber.next(result.value);
}
});
}, 0, true);
});
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js
function scheduleReadableStreamLike(input, scheduler) {
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js
function scheduled(input, scheduler) {
if (input != null) {
if (isInteropObservable(input)) {
return scheduleObservable(input, scheduler);
}
if (isArrayLike(input)) {
return scheduleArray(input, scheduler);
}
if (isPromise(input)) {
return schedulePromise(input, scheduler);
}
if (isAsyncIterable(input)) {
return scheduleAsyncIterable(input, scheduler);
}
if (isIterable(input)) {
return scheduleIterable(input, scheduler);
}
if (isReadableStreamLike(input)) {
return scheduleReadableStreamLike(input, scheduler);
}
}
throw createInvalidObservableTypeError(input);
}
// node_modules/rxjs/dist/esm5/internal/observable/from.js
function from(input, scheduler) {
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
}
// node_modules/rxjs/dist/esm5/internal/operators/map.js
function map(project, thisArg) {
return operate(function(source, subscriber) {
var index = 0;
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
subscriber.next(project.call(thisArg, value, index++));
}));
});
}
// node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js
var isArray = Array.isArray;
var getPrototypeOf = Object.getPrototypeOf;
var objectProto = Object.prototype;
var getKeys = Object.keys;
function argsArgArrayOrObject(args) {
if (args.length === 1) {
var first_1 = args[0];
if (isArray(first_1)) {
return { args: first_1, keys: null };
}
if (isPOJO(first_1)) {
var keys = getKeys(first_1);
return {
args: keys.map(function(key) {
return first_1[key];
}),
keys
};
}
}
return { args, keys: null };
}
function isPOJO(obj) {
return obj && typeof obj === "object" && getPrototypeOf(obj) === objectProto;
}
// node_modules/rxjs/dist/esm5/internal/util/isScheduler.js
function isScheduler(value) {
return value && isFunction(value.schedule);
}
// node_modules/rxjs/dist/esm5/internal/util/args.js
function last(arr) {
return arr[arr.length - 1];
}
function popResultSelector(args) {
return isFunction(last(args)) ? args.pop() : void 0;
}
function popScheduler(args) {
return isScheduler(last(args)) ? args.pop() : void 0;
}
// node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js
var isArray2 = Array.isArray;
function callOrApply(fn, args) {
return isArray2(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);
}
function mapOneOrManyArgs(fn) {
return map(function(args) {
return callOrApply(fn, args);
});
}
// node_modules/rxjs/dist/esm5/internal/util/createObject.js
function createObject(keys, values) {
return keys.reduce(function(result, key, i) {
return result[key] = values[i], result;
}, {});
}
// node_modules/rxjs/dist/esm5/internal/observable/forkJoin.js
function forkJoin() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var resultSelector = popResultSelector(args);
var _a = argsArgArrayOrObject(args), sources = _a.args, keys = _a.keys;
var result = new Observable(function(subscriber) {
var length = sources.length;
if (!length) {
subscriber.complete();
return;
}
var values = new Array(length);
var remainingCompletions = length;
var remainingEmissions = length;
var _loop_1 = function(sourceIndex2) {
var hasValue = false;
innerFrom(sources[sourceIndex2]).subscribe(createOperatorSubscriber(subscriber, function(value) {
if (!hasValue) {
hasValue = true;
remainingEmissions--;
}
values[sourceIndex2] = value;
}, function() {
return remainingCompletions--;
}, void 0, function() {
if (!remainingCompletions || !hasValue) {
if (!remainingEmissions) {
subscriber.next(keys ? createObject(keys, values) : values);
}
subscriber.complete();
}
}));
};
for (var sourceIndex = 0; sourceIndex < length; sourceIndex++) {
_loop_1(sourceIndex);
}
});
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
}
// node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js
function takeUntil(notifier) {
return operate(function(source, subscriber) {
@@ -2488,190 +2770,6 @@ var EMPTY = new Observable(function(subscriber) {
return subscriber.complete();
});
// node_modules/rxjs/dist/esm5/internal/util/isScheduler.js
function isScheduler(value) {
return value && isFunction(value.schedule);
}
// node_modules/rxjs/dist/esm5/internal/util/args.js
function last(arr) {
return arr[arr.length - 1];
}
function popResultSelector(args) {
return isFunction(last(args)) ? args.pop() : void 0;
}
function popScheduler(args) {
return isScheduler(last(args)) ? args.pop() : void 0;
}
// node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js
function executeSchedule(parentSubscription, scheduler, work, delay2, repeat2) {
if (delay2 === void 0) {
delay2 = 0;
}
if (repeat2 === void 0) {
repeat2 = false;
}
var scheduleSubscription = scheduler.schedule(function() {
work();
if (repeat2) {
parentSubscription.add(this.schedule(null, delay2));
} else {
this.unsubscribe();
}
}, delay2);
parentSubscription.add(scheduleSubscription);
if (!repeat2) {
return scheduleSubscription;
}
}
// node_modules/rxjs/dist/esm5/internal/operators/observeOn.js
function observeOn(scheduler, delay2) {
if (delay2 === void 0) {
delay2 = 0;
}
return operate(function(source, subscriber) {
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
return executeSchedule(subscriber, scheduler, function() {
return subscriber.next(value);
}, delay2);
}, function() {
return executeSchedule(subscriber, scheduler, function() {
return subscriber.complete();
}, delay2);
}, function(err) {
return executeSchedule(subscriber, scheduler, function() {
return subscriber.error(err);
}, delay2);
}));
});
}
// node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js
function subscribeOn(scheduler, delay2) {
if (delay2 === void 0) {
delay2 = 0;
}
return operate(function(source, subscriber) {
subscriber.add(scheduler.schedule(function() {
return source.subscribe(subscriber);
}, delay2));
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js
function scheduleObservable(input, scheduler) {
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
}
// node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js
function schedulePromise(input, scheduler) {
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js
function scheduleArray(input, scheduler) {
return new Observable(function(subscriber) {
var i = 0;
return scheduler.schedule(function() {
if (i === input.length) {
subscriber.complete();
} else {
subscriber.next(input[i++]);
if (!subscriber.closed) {
this.schedule();
}
}
});
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js
function scheduleIterable(input, scheduler) {
return new Observable(function(subscriber) {
var iterator2;
executeSchedule(subscriber, scheduler, function() {
iterator2 = input[iterator]();
executeSchedule(subscriber, scheduler, function() {
var _a;
var value;
var done;
try {
_a = iterator2.next(), value = _a.value, done = _a.done;
} catch (err) {
subscriber.error(err);
return;
}
if (done) {
subscriber.complete();
} else {
subscriber.next(value);
}
}, 0, true);
});
return function() {
return isFunction(iterator2 === null || iterator2 === void 0 ? void 0 : iterator2.return) && iterator2.return();
};
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js
function scheduleAsyncIterable(input, scheduler) {
if (!input) {
throw new Error("Iterable cannot be null");
}
return new Observable(function(subscriber) {
executeSchedule(subscriber, scheduler, function() {
var iterator2 = input[Symbol.asyncIterator]();
executeSchedule(subscriber, scheduler, function() {
iterator2.next().then(function(result) {
if (result.done) {
subscriber.complete();
} else {
subscriber.next(result.value);
}
});
}, 0, true);
});
});
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js
function scheduleReadableStreamLike(input, scheduler) {
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
}
// node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js
function scheduled(input, scheduler) {
if (input != null) {
if (isInteropObservable(input)) {
return scheduleObservable(input, scheduler);
}
if (isArrayLike(input)) {
return scheduleArray(input, scheduler);
}
if (isPromise(input)) {
return schedulePromise(input, scheduler);
}
if (isAsyncIterable(input)) {
return scheduleAsyncIterable(input, scheduler);
}
if (isIterable(input)) {
return scheduleIterable(input, scheduler);
}
if (isReadableStreamLike(input)) {
return scheduleReadableStreamLike(input, scheduler);
}
}
throw createInvalidObservableTypeError(input);
}
// node_modules/rxjs/dist/esm5/internal/observable/from.js
function from(input, scheduler) {
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
}
// node_modules/rxjs/dist/esm5/internal/observable/of.js
function of() {
var args = [];
@@ -2774,11 +2872,11 @@ var ArgumentOutOfRangeError = createErrorClass(function(_super) {
};
});
// node_modules/rxjs/dist/esm5/internal/util/notfoundError.js
var notfoundError = createErrorClass(function(_super) {
return function notfoundErrorImpl(message) {
// node_modules/rxjs/dist/esm5/internal/util/NotFoundError.js
var NotFoundError = createErrorClass(function(_super) {
return function NotFoundErrorImpl(message) {
_super(this);
this.name = "notfoundError";
this.name = "NotFoundError";
this.message = message;
};
});
@@ -2805,61 +2903,6 @@ var TimeoutError = createErrorClass(function(_super) {
};
});
// node_modules/rxjs/dist/esm5/internal/operators/map.js
function map(project, thisArg) {
return operate(function(source, subscriber) {
var index = 0;
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
subscriber.next(project.call(thisArg, value, index++));
}));
});
}
// node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js
var isArray = Array.isArray;
function callOrApply(fn, args) {
return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);
}
function mapOneOrManyArgs(fn) {
return map(function(args) {
return callOrApply(fn, args);
});
}
// node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js
var isArray2 = Array.isArray;
var getPrototypeOf = Object.getPrototypeOf;
var objectProto = Object.prototype;
var getKeys = Object.keys;
function argsArgArrayOrObject(args) {
if (args.length === 1) {
var first_1 = args[0];
if (isArray2(first_1)) {
return { args: first_1, keys: null };
}
if (isPOJO(first_1)) {
var keys = getKeys(first_1);
return {
args: keys.map(function(key) {
return first_1[key];
}),
keys
};
}
}
return { args, keys: null };
}
function isPOJO(obj) {
return obj && typeof obj === "object" && getPrototypeOf(obj) === objectProto;
}
// node_modules/rxjs/dist/esm5/internal/util/createObject.js
function createObject(keys, values) {
return keys.reduce(function(result, key, i) {
return result[key] = values[i], result;
}, {});
}
// node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js
function combineLatest() {
var args = [];
@@ -3257,9 +3300,9 @@ function setCurrentInjector(injector) {
_currentInjector = injector;
return former;
}
var NOT_FOUND = /* @__PURE__ */ Symbol("notfound");
function isnotfound(e) {
return e === NOT_FOUND || e?.name === "ɵnotfound";
var NOT_FOUND = /* @__PURE__ */ Symbol("NotFound");
function isNotFound(e) {
return e === NOT_FOUND || e?.name === "ɵNotFound";
}
// node_modules/@angular/core/fesm2022/_untracked-chunk.mjs
@@ -4020,7 +4063,7 @@ function throwInvalidProviderError(ngModuleType, providers, provider) {
throw new Error("Invalid provider");
}
}
function throwProvidernotfoundError(token, injectorName) {
function throwProviderNotFoundError(token, injectorName) {
const errorMessage = ngDevMode && `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ""}`;
throw new RuntimeError(-201, errorMessage);
}
@@ -4074,14 +4117,14 @@ function setInjectImplementation(impl) {
_injectImplementation = impl;
return previous;
}
function injectRootLimpMode(token, notfoundValue, flags) {
function injectRootLimpMode(token, notFoundValue, flags) {
const injectableDef = getInjectableDef(token);
if (injectableDef && injectableDef.providedIn == "root") {
return injectableDef.value === void 0 ? injectableDef.value = injectableDef.factory() : injectableDef.value;
}
if (flags & 8) return null;
if (notfoundValue !== void 0) return notfoundValue;
throwProvidernotfoundError(token, typeof ngDevMode !== "undefined" && ngDevMode ? "Injector" : "");
if (notFoundValue !== void 0) return notFoundValue;
throwProviderNotFoundError(token, typeof ngDevMode !== "undefined" && ngDevMode ? "Injector" : "");
}
function assertInjectImplementationNotEqual(fn) {
ngDevMode && assertNotEqual(_injectImplementation, fn, "Calling ɵɵinject would cause infinite recursion");
@@ -4099,7 +4142,7 @@ var RetrievingInjector = class {
try {
return this.injector.get(token, flags & 8 ? null : THROW_IF_NOT_FOUND, flags);
} catch (e) {
if (isnotfound(e)) {
if (isNotFound(e)) {
return e;
}
throw e;
@@ -4116,7 +4159,7 @@ function injectInjectorOnly(token, flags = 0) {
const options = convertToInjectOptions(flags);
const value = currentInjector.retrieve(token, options);
ngDevMode && emitInjectEvent(token, value, flags);
if (isnotfound(value)) {
if (isNotFound(value)) {
if (options.optional) {
return null;
}
@@ -4189,9 +4232,9 @@ function attachInjectFlag(decorator, flag) {
function getInjectFlag(token) {
return token[DI_DECORATOR_FLAG];
}
function getFactoryDef(type, thrownotfound) {
function getFactoryDef(type, throwNotFound) {
const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);
if (!hasFactoryDef && thrownotfound === true && ngDevMode) {
if (!hasFactoryDef && throwNotFound === true && ngDevMode) {
throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);
}
return hasFactoryDef ? type[NG_FACTORY_DEF] : null;
@@ -4315,14 +4358,14 @@ var ENVIRONMENT_INITIALIZER = new InjectionToken(typeof ngDevMode !== "undefined
var INJECTOR$1 = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "INJECTOR" : "", -1);
var INJECTOR_DEF_TYPES = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "INJECTOR_DEF_TYPES" : "");
var NullInjector = class {
get(token, notfoundValue = THROW_IF_NOT_FOUND) {
if (notfoundValue === THROW_IF_NOT_FOUND) {
get(token, notFoundValue = THROW_IF_NOT_FOUND) {
if (notFoundValue === THROW_IF_NOT_FOUND) {
const message = ngDevMode ? `No provider found for \`${stringify(token)}\`.` : "";
const error = createRuntimeError(message, -201);
error.name = "ɵnotfound";
error.name = "ɵNotFound";
throw error;
}
return notfoundValue;
return notFoundValue;
}
};
function makeEnvironmentProviders(providers) {
@@ -4553,7 +4596,7 @@ var R3Injector = class extends EnvironmentInjector {
try {
return this.get(token, THROW_IF_NOT_FOUND, flags);
} catch (e) {
if (isnotfound(e)) {
if (isNotFound(e)) {
return e;
}
throw e;
@@ -4603,7 +4646,7 @@ var R3Injector = class extends EnvironmentInjector {
ngDevMode && setInjectorProfilerContext(prevInjectContext);
}
}
get(token, notfoundValue = THROW_IF_NOT_FOUND, options) {
get(token, notFoundValue = THROW_IF_NOT_FOUND, options) {
assertNotDestroyed(this);
if (token.hasOwnProperty(NG_ENV_ID)) {
return token[NG_ENV_ID](this);
@@ -4640,8 +4683,8 @@ var R3Injector = class extends EnvironmentInjector {
}
}
const nextInjector = !(flags & 2) ? this.parent : getNullInjector();
notfoundValue = flags & 8 && notfoundValue === THROW_IF_NOT_FOUND ? null : notfoundValue;
return nextInjector.get(token, notfoundValue);
notFoundValue = flags & 8 && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;
return nextInjector.get(token, notFoundValue);
} catch (error) {
const errorCode = getRuntimeErrorCode(error);
if (errorCode === -200 || errorCode === -201) {
@@ -6799,6 +6842,7 @@ export {
mergeAll,
concat,
defer,
forkJoin,
filter,
catchError,
concatMap,
@@ -6883,7 +6927,7 @@ export {
debugStringifyTypeForError,
cyclicDependencyError,
cyclicDependencyErrorWithDetails,
throwProvidernotfoundError,
throwProviderNotFoundError,
setInjectImplementation,
injectRootLimpMode,
assertInjectImplementationNotEqual,
@@ -7108,4 +7152,4 @@ export {
encapsulateResourceError,
ResourceValueError
};
//# sourceMappingURL=chunk-D7FUV64K.js.map
//# sourceMappingURL=chunk-E5HF4UWX.js.map
File diff suppressed because one or more lines are too long
@@ -44,7 +44,7 @@ import {
ɵɵgetInheritedFactory,
ɵɵinjectAttribute,
ɵɵstyleProp
} from "./chunk-BODXJ6DH.js";
} from "./chunk-QOTEZZCO.js";
import {
DOCUMENT,
DestroyRef,
@@ -64,7 +64,7 @@ import {
ɵɵdefineInjectable,
ɵɵdefineInjector,
ɵɵinject
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
// node_modules/@angular/common/fesm2022/_platform_location-chunk.mjs
var _DOM = null;
@@ -2374,7 +2374,7 @@ var NgSwitchCase = class _NgSwitchCase {
constructor(viewContainer, templateRef, ngSwitch) {
this.ngSwitch = ngSwitch;
if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
throwNgSwitchProvidernotfoundError("ngSwitchCase", "NgSwitchCase");
throwNgSwitchProviderNotFoundError("ngSwitchCase", "NgSwitchCase");
}
ngSwitch._addCase();
this._view = new SwitchView(viewContainer, templateRef);
@@ -2419,7 +2419,7 @@ var NgSwitchCase = class _NgSwitchCase {
var NgSwitchDefault = class _NgSwitchDefault {
constructor(viewContainer, templateRef, ngSwitch) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
throwNgSwitchProvidernotfoundError("ngSwitchDefault", "NgSwitchDefault");
throwNgSwitchProviderNotFoundError("ngSwitchDefault", "NgSwitchDefault");
}
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
}
@@ -2450,7 +2450,7 @@ var NgSwitchDefault = class _NgSwitchDefault {
}]
}], null);
})();
function throwNgSwitchProvidernotfoundError(attrName, directiveName) {
function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
throw new RuntimeError(2e3, `An element with the "${attrName}" attribute (matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute (matching "NgSwitch" directive)`);
}
var NgPlural = class _NgPlural {
@@ -4796,4 +4796,4 @@ export {
PRECONNECT_CHECK_BLOCKLIST,
NgOptimizedImage
};
//# sourceMappingURL=chunk-ASHOWUOS.js.map
//# sourceMappingURL=chunk-OSQUZMO7.js.map
@@ -274,7 +274,7 @@ import {
stringify,
stringifyForError,
throwError2 as throwError,
throwProvidernotfoundError,
throwProviderNotFoundError,
unwrapLView,
unwrapRNode,
updateAncestorTraversalFlagsOnAttach,
@@ -294,7 +294,7 @@ import {
ɵɵnamespaceSVG,
ɵɵresetView,
ɵɵrestoreView
} from "./chunk-D7FUV64K.js";
} from "./chunk-E5HF4UWX.js";
// node_modules/@angular/core/fesm2022/_attribute-chunk.mjs
var Attribute = {
@@ -1154,33 +1154,33 @@ function injectAttributeImpl(tNode, attrNameToInject) {
}
return null;
}
function notfoundValueOrThrow(notfoundValue, token, flags) {
if (flags & 8 || notfoundValue !== void 0) {
return notfoundValue;
function notFoundValueOrThrow(notFoundValue, token, flags) {
if (flags & 8 || notFoundValue !== void 0) {
return notFoundValue;
} else {
throwProvidernotfoundError(token, "NodeInjector");
throwProviderNotFoundError(token, "NodeInjector");
}
}
function lookupTokenUsingModuleInjector(lView, token, flags, notfoundValue) {
if (flags & 8 && notfoundValue === void 0) {
notfoundValue = null;
function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {
if (flags & 8 && notFoundValue === void 0) {
notFoundValue = null;
}
if ((flags & (2 | 1)) === 0) {
const moduleInjector = lView[INJECTOR];
const previousInjectImplementation = setInjectImplementation(void 0);
try {
if (moduleInjector) {
return moduleInjector.get(token, notfoundValue, flags & 8);
return moduleInjector.get(token, notFoundValue, flags & 8);
} else {
return injectRootLimpMode(token, notfoundValue, flags & 8);
return injectRootLimpMode(token, notFoundValue, flags & 8);
}
} finally {
setInjectImplementation(previousInjectImplementation);
}
}
return notfoundValueOrThrow(notfoundValue, token, flags);
return notFoundValueOrThrow(notFoundValue, token, flags);
}
function getOrCreateInjectable(tNode, lView, token, flags = 0, notfoundValue) {
function getOrCreateInjectable(tNode, lView, token, flags = 0, notFoundValue) {
if (tNode !== null) {
if (lView[FLAGS] & 2048 && !(flags & 2)) {
const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);
@@ -1193,13 +1193,13 @@ function getOrCreateInjectable(tNode, lView, token, flags = 0, notfoundValue) {
return value;
}
}
return lookupTokenUsingModuleInjector(lView, token, flags, notfoundValue);
return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
}
function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notfoundValue) {
function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {
const bloomHash = bloomHashBitOrFactory(token);
if (typeof bloomHash === "function") {
if (!enterDI(lView, tNode, flags)) {
return flags & 1 ? notfoundValueOrThrow(notfoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notfoundValue);
return flags & 1 ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
}
try {
let value;
@@ -1213,7 +1213,7 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notfoundValue)
value = bloomHash(flags);
}
if (value == null && !(flags & 8)) {
throwProvidernotfoundError(token);
throwProviderNotFoundError(token);
} else {
return value;
}
@@ -1255,7 +1255,7 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notfoundValue)
}
}
}
return notfoundValue;
return notFoundValue;
}
function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
const currentTView = lView[TVIEW];
@@ -1379,8 +1379,8 @@ var NodeInjector = class {
this._tNode = _tNode;
this._lView = _lView;
}
get(token, notfoundValue, flags) {
return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notfoundValue);
get(token, notFoundValue, flags) {
return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);
}
};
function createNodeInjector() {
@@ -1411,7 +1411,7 @@ function getFactoryOf(type) {
}
return getFactoryDef(type);
}
function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notfoundValue) {
function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {
let currentTNode = tNode;
let currentLView = lView;
while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 && !isRootView(currentLView)) {
@@ -1434,7 +1434,7 @@ function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notfoundVa
}
currentTNode = parentTNode;
}
return notfoundValue;
return notFoundValue;
}
function getTNodeFromLView(lView) {
const tView = lView[TVIEW];
@@ -6537,7 +6537,7 @@ function validateNodeExists(node, lView = null, tNode = null) {
${footer}`);
}
}
function nodenotfoundError(lView, tNode) {
function nodeNotFoundError(lView, tNode) {
const header = "During serialization, Angular was unable to find an element in the DOM:\n\n";
const expected = `${describeExpectedDom(lView, tNode, false)}
@@ -6545,7 +6545,7 @@ function nodenotfoundError(lView, tNode) {
const footer = getHydrationErrorFooter();
throw new RuntimeError(-502, header + expected + footer);
}
function nodenotfoundAtPathError(host, path) {
function nodeNotFoundAtPathError(host, path) {
const header = `During hydration Angular was unable to locate a node using the "${path}" path, starting from the ${describeRNode(host)} node.
`;
@@ -7097,7 +7097,7 @@ function navigateToNode(from, instructions) {
const repeat = instructions[i + 1];
for (let r = 0; r < repeat; r++) {
if (ngDevMode && !node) {
throw nodenotfoundAtPathError(from, stringifyNavigationInstructions(instructions));
throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));
}
switch (step) {
case NODE_NAVIGATION_STEP_FIRST_CHILD:
@@ -7110,7 +7110,7 @@ function navigateToNode(from, instructions) {
}
}
if (ngDevMode && !node) {
throw nodenotfoundAtPathError(from, stringifyNavigationInstructions(instructions));
throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));
}
return node;
}
@@ -7182,7 +7182,7 @@ function calcPathForNode(tNode, lView, excludedParentNodes) {
const body = parentRNode.ownerDocument.body;
path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);
if (path === null) {
throw nodenotfoundError(lView, tNode);
throw nodeNotFoundError(lView, tNode);
}
}
return path;
@@ -7978,12 +7978,12 @@ var ChainedInjector = class {
this.injector = injector;
this.parentInjector = parentInjector;
}
get(token, notfoundValue, options) {
get(token, notFoundValue, options) {
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, options);
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notfoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
return value;
}
return this.parentInjector.get(token, notfoundValue, options);
return this.parentInjector.get(token, notFoundValue, options);
}
};
function computeStaticStyling(tNode, attrs, writeToHost) {
@@ -16911,7 +16911,7 @@ function getPipeDef2(name, registry) {
}
}
if (ngDevMode) {
throw new RuntimeError(-302, getPipenotfoundErrorMessage(name));
throw new RuntimeError(-302, getPipeNotFoundErrorMessage(name));
}
return;
}
@@ -16925,7 +16925,7 @@ function getMultipleMatchingPipesMessage(name) {
const errorMessage = `Multiple pipes match the name \`${name}\`${componentInfoMessage}. ${verifyMessage}`;
return errorMessage;
}
function getPipenotfoundErrorMessage(name) {
function getPipeNotFoundErrorMessage(name) {
const lView = getLView();
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
const context = declarationLView[CONTEXT];
@@ -22684,4 +22684,4 @@ export {
RESPONSE_INIT,
REQUEST_CONTEXT
};
//# sourceMappingURL=chunk-BODXJ6DH.js.map
//# sourceMappingURL=chunk-QOTEZZCO.js.map
+7
View File
@@ -0,0 +1,7 @@
node_modules
dist
.angular
.git
.vscode
coverage
*.log
+22
View File
@@ -0,0 +1,22 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY --from=build /app/server.js ./server.js
COPY --from=build /app/server ./server
COPY --from=build /app/dist ./dist
EXPOSE 3000
CMD ["node", "server.js"]
Submodule
+1
Submodule Metacase added at 187db190f1
+16
View File
@@ -0,0 +1,16 @@
server {
listen 80;
server_name _;
client_max_body_size 30m;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
+26
View File
@@ -327,3 +327,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
--------------------------------------------------------------------------------
Package: @angular/forms
License: "MIT"
The MIT License
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
--------------------------------------------------------------------------------
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
services:
form_metacase:
build:
context: .
dockerfile: Dockerfile
ports:
- "${APP_PORT:-3000}:3000"
environment:
PORT: 3000
AUTH_TOKEN_SECRET: ${AUTH_TOKEN_SECRET:-change-this-secret-before-production}
BOT_SIBS_API_URL: ${BOT_SIBS_API_URL:-http://host.docker.internal:8000}
BOT_SIBS_TIMEOUT_MS: ${BOT_SIBS_TIMEOUT_MS:-240000}
extra_hosts:
- "host.docker.internal:host-gateway"
+369 -338
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,167 @@
# Core
> Shared utilities for Angular DevKit.
# Exception
# Json
## Schema
### SchemaValidatorResult
```
export interface SchemaValidatorResult {
success: boolean;
errors?: string[];
}
```
### SchemaValidator
```
export interface SchemaValidator {
(data: any): Observable<SchemaValidatorResult>;
}
```
### SchemaFormatter
```
export interface SchemaFormatter {
readonly async: boolean;
validate(data: any): boolean | Observable<boolean>;
}
```
### SchemaRegistry
```
export interface SchemaRegistry {
compile(schema: Object): Observable<SchemaValidator>;
addFormat(name: string, formatter: SchemaFormatter): void;
}
```
### CoreSchemaRegistry
`SchemaRegistry` implementation using https://github.com/epoberezkin/ajv.
Constructor accepts object containing `SchemaFormatter` that will be added automatically.
```
export class CoreSchemaRegistry implements SchemaRegistry {
constructor(formats: { [name: string]: SchemaFormatter} = {}) {}
}
```
# Logger
# Utils
# Virtual FS
# Workspaces
The `workspaces` namespace provides an API for interacting with the workspace file formats.
It provides an abstraction of the underlying storage format of the workspace and provides
support for both reading and writing. Currently, the only supported format is the JSON-based
format used by the Angular CLI. For this format, the API provides internal change tracking of values which
enables fine-grained updates to the underlying storage of the workspace. This allows for the
retention of existing formatting and comments.
A workspace is defined via the following object model. Definition collection objects are specialized
Javascript `Map` objects with an additional `add` method to simplify addition and provide more localized
error checking of the newly added values.
```ts
export interface WorkspaceDefinition {
readonly extensions: Record<string, JsonValue | undefined>;
readonly projects: ProjectDefinitionCollection;
}
export interface ProjectDefinition {
readonly extensions: Record<string, JsonValue | undefined>;
readonly targets: TargetDefinitionCollection;
root: string;
prefix?: string;
sourceRoot?: string;
}
export interface TargetDefinition {
options?: Record<string, JsonValue | undefined>;
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
builder: string;
}
```
The API is asynchronous and has two main functions to facilitate reading, creation, and modifying
a workspace: `readWorkspace` and `writeWorkspace`.
```ts
export enum WorkspaceFormat {
JSON,
}
```
```ts
export function readWorkspace(
path: string,
host: WorkspaceHost,
format?: WorkspaceFormat,
): Promise<{ workspace: WorkspaceDefinition }>;
```
```ts
export function writeWorkspace(
workspace: WorkspaceDefinition,
host: WorkspaceHost,
path?: string,
format?: WorkspaceFormat,
): Promise<void>;
```
A `WorkspaceHost` abstracts the underlying data access methods from the functions. It provides
methods to read, write, and analyze paths. A utility function is provided to create
an instance of a `WorkspaceHost` from the Angular DevKit's virtual filesystem host abstraction.
```ts
export interface WorkspaceHost {
readFile(path: string): Promise<string>;
writeFile(path: string, data: string): Promise<void>;
isDirectory(path: string): Promise<boolean>;
isFile(path: string): Promise<boolean>;
}
export function createWorkspaceHost(host: virtualFs.Host): WorkspaceHost;
```
## Usage Example
To demonstrate the usage of the API, the following code will show how to add a option property
to a build target for an application.
```ts
import { NodeJsSyncHost } from '@angular-devkit/core/node';
import { workspaces } from '@angular-devkit/core';
async function demonstrate() {
const host = workspaces.createWorkspaceHost(new NodeJsSyncHost());
const { workspace } = await workspaces.readWorkspace('path/to/workspace/directory/', host);
const project = workspace.projects.get('my-app');
if (!project) {
throw new Error('my-app does not exist');
}
const buildTarget = project.targets.get('build');
if (!buildTarget) {
throw new Error('build target does not exist');
}
buildTarget.options.optimization = true;
await workspaces.writeWorkspace(workspace, host);
}
demonstrate();
```
@@ -0,0 +1,8 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
export * from './src/index';
@@ -0,0 +1,25 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./src/index"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;AAEH,8CAA4B"}
@@ -0,0 +1,15 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { logging } from '../src';
export interface ProcessOutput {
write(buffer: string | Buffer): boolean;
}
/**
* A Logger that sends information to STDOUT and STDERR.
*/
export declare function createConsoleLogger(verbose?: boolean, stdout?: ProcessOutput, stderr?: ProcessOutput, colors?: Partial<Record<logging.LogLevel, (s: string) => string>>): logging.Logger;
@@ -0,0 +1,58 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.createConsoleLogger = createConsoleLogger;
const rxjs_1 = require("rxjs");
const src_1 = require("../src");
/**
* A Logger that sends information to STDOUT and STDERR.
*/
function createConsoleLogger(verbose = false, stdout = process.stdout, stderr = process.stderr, colors) {
const logger = new src_1.logging.IndentLogger('cling');
logger.pipe((0, rxjs_1.filter)((entry) => entry.level !== 'debug' || verbose)).subscribe((entry) => {
const color = colors && colors[entry.level];
let output = stdout;
switch (entry.level) {
case 'warn':
case 'fatal':
case 'error':
output = stderr;
break;
}
// If we do console.log(message) or process.stdout.write(message + '\n'), the process might
// stop before the whole message is written and the stream is flushed. This happens when
// streams are asynchronous.
//
// NodeJS IO streams are different depending on platform and usage. In POSIX environment,
// for example, they're asynchronous when writing to a pipe, but synchronous when writing
// to a TTY. In windows, it's the other way around. You can verify which is which with
// stream.isTTY and platform, but this is not good enough.
// In the async case, one should wait for the callback before sending more data or
// continuing the process. In our case it would be rather hard to do (but not impossible).
//
// Instead we take the easy way out and simply chunk the message and call the write
// function while the buffer drain itself asynchronously. With a smaller chunk size than
// the buffer, we are mostly certain that it works. In this case, the chunk has been picked
// as half a page size (4096/2 = 2048), minus some bytes for the color formatting.
// On POSIX it seems the buffer is 2 pages (8192), but just to be sure (could be different
// by platform).
//
// For more details, see https://nodejs.org/api/process.html#process_a_note_on_process_i_o
const chunkSize = 2000; // Small chunk.
let message = entry.message;
while (message) {
const chunk = message.slice(0, chunkSize);
message = message.slice(chunkSize);
output.write(color ? color(chunk) : chunk);
}
output.write('\n');
});
return logger;
}
//# sourceMappingURL=cli-logger.js.map
@@ -0,0 +1 @@
{"version":3,"file":"cli-logger.js","sourceRoot":"","sources":["cli-logger.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAYH,kDAkDC;AA5DD,+BAA8B;AAC9B,gCAAiC;AAMjC;;GAEG;AACH,SAAgB,mBAAmB,CACjC,OAAO,GAAG,KAAK,EACf,SAAwB,OAAO,CAAC,MAAM,EACtC,SAAwB,OAAO,CAAC,MAAM,EACtC,MAAiE;IAEjE,MAAM,MAAM,GAAG,IAAI,aAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAEjD,MAAM,CAAC,IAAI,CAAC,IAAA,aAAM,EAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QACrF,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,MAAM,GAAG,MAAM,CAAC;QAEpB,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;YACpB,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO,CAAC;YACb,KAAK,OAAO;gBACV,MAAM,GAAG,MAAM,CAAC;gBAChB,MAAM;QACV,CAAC;QAED,2FAA2F;QAC3F,wFAAwF;QACxF,4BAA4B;QAC5B,EAAE;QACF,yFAAyF;QACzF,yFAAyF;QACzF,sFAAsF;QACtF,0DAA0D;QAC1D,kFAAkF;QAClF,0FAA0F;QAC1F,EAAE;QACF,mFAAmF;QACnF,wFAAwF;QACxF,2FAA2F;QAC3F,kFAAkF;QAClF,0FAA0F;QAC1F,gBAAgB;QAChB,EAAE;QACF,0FAA0F;QAC1F,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,eAAe;QACvC,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC5B,OAAO,OAAO,EAAE,CAAC;YACf,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;YAC1C,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,43 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { Stats } from 'node:fs';
import { Observable } from 'rxjs';
import { Path, PathFragment, virtualFs } from '../src';
/**
* An implementation of the Virtual FS using Node as the background. There are two versions; one
* synchronous and one asynchronous.
*/
export declare class NodeJsAsyncHost implements virtualFs.Host<Stats> {
get capabilities(): virtualFs.HostCapabilities;
write(path: Path, content: virtualFs.FileBuffer): Observable<void>;
read(path: Path): Observable<virtualFs.FileBuffer>;
delete(path: Path): Observable<void>;
rename(from: Path, to: Path): Observable<void>;
list(path: Path): Observable<PathFragment[]>;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
stat(path: Path): Observable<virtualFs.Stats<Stats>>;
watch(path: Path, _options?: virtualFs.HostWatchOptions): Observable<virtualFs.HostWatchEvent> | null;
}
/**
* An implementation of the Virtual FS using Node as the backend, synchronously.
*/
export declare class NodeJsSyncHost implements virtualFs.Host<Stats> {
get capabilities(): virtualFs.HostCapabilities;
write(path: Path, content: virtualFs.FileBuffer): Observable<void>;
read(path: Path): Observable<virtualFs.FileBuffer>;
delete(path: Path): Observable<void>;
rename(from: Path, to: Path): Observable<void>;
list(path: Path): Observable<PathFragment[]>;
exists(path: Path): Observable<boolean>;
isDirectory(path: Path): Observable<boolean>;
isFile(path: Path): Observable<boolean>;
stat(path: Path): Observable<virtualFs.Stats<Stats>>;
watch(path: Path, _options?: virtualFs.HostWatchOptions): Observable<virtualFs.HostWatchEvent> | null;
}
@@ -0,0 +1,211 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeJsSyncHost = exports.NodeJsAsyncHost = void 0;
const node_fs_1 = require("node:fs");
const node_path_1 = require("node:path");
const rxjs_1 = require("rxjs");
const src_1 = require("../src");
async function exists(path) {
try {
await node_fs_1.promises.access(path, node_fs_1.constants.F_OK);
return true;
}
catch {
return false;
}
}
// This will only be initialized if the watch() method is called.
// Otherwise chokidar appears only in type positions, and shouldn't be referenced
// in the JavaScript output.
let FSWatcher;
function loadFSWatcher() {
if (!FSWatcher) {
try {
FSWatcher = require('chokidar').FSWatcher;
}
catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
throw new Error('As of angular-devkit version 8.0, the "chokidar" package ' +
'must be installed in order to use watch() features.');
}
throw e;
}
}
}
/**
* An implementation of the Virtual FS using Node as the background. There are two versions; one
* synchronous and one asynchronous.
*/
class NodeJsAsyncHost {
get capabilities() {
return { synchronous: false };
}
write(path, content) {
return (0, rxjs_1.from)(node_fs_1.promises.mkdir((0, src_1.getSystemPath)((0, src_1.dirname)(path)), { recursive: true })).pipe((0, rxjs_1.mergeMap)(() => node_fs_1.promises.writeFile((0, src_1.getSystemPath)(path), new Uint8Array(content))));
}
read(path) {
return (0, rxjs_1.from)(node_fs_1.promises.readFile((0, src_1.getSystemPath)(path))).pipe((0, rxjs_1.map)((buffer) => new Uint8Array(buffer).buffer));
}
delete(path) {
return (0, rxjs_1.from)(node_fs_1.promises.rm((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 }));
}
rename(from, to) {
return (0, rxjs_1.from)(node_fs_1.promises.rename((0, src_1.getSystemPath)(from), (0, src_1.getSystemPath)(to)));
}
list(path) {
return (0, rxjs_1.from)(node_fs_1.promises.readdir((0, src_1.getSystemPath)(path))).pipe((0, rxjs_1.map)((names) => names.map((name) => (0, src_1.fragment)(name))));
}
exists(path) {
return (0, rxjs_1.from)(exists((0, src_1.getSystemPath)(path)));
}
isDirectory(path) {
return this.stat(path).pipe((0, rxjs_1.map)((stat) => stat.isDirectory()));
}
isFile(path) {
return this.stat(path).pipe((0, rxjs_1.map)((stat) => stat.isFile()));
}
// Some hosts may not support stat.
stat(path) {
return (0, rxjs_1.from)(node_fs_1.promises.stat((0, src_1.getSystemPath)(path)));
}
// Some hosts may not support watching.
watch(path, _options) {
return new rxjs_1.Observable((obs) => {
loadFSWatcher();
const watcher = new FSWatcher({ persistent: true });
watcher.add((0, src_1.getSystemPath)(path));
watcher
.on('change', (path) => {
obs.next({
path: (0, src_1.normalize)(path),
time: new Date(),
type: src_1.virtualFs.HostWatchEventType.Changed,
});
})
.on('add', (path) => {
obs.next({
path: (0, src_1.normalize)(path),
time: new Date(),
type: src_1.virtualFs.HostWatchEventType.Created,
});
})
.on('unlink', (path) => {
obs.next({
path: (0, src_1.normalize)(path),
time: new Date(),
type: src_1.virtualFs.HostWatchEventType.Deleted,
});
});
return () => {
void watcher.close();
};
}).pipe((0, rxjs_1.publish)(), (0, rxjs_1.refCount)());
}
}
exports.NodeJsAsyncHost = NodeJsAsyncHost;
/**
* An implementation of the Virtual FS using Node as the backend, synchronously.
*/
class NodeJsSyncHost {
get capabilities() {
return { synchronous: true };
}
write(path, content) {
return new rxjs_1.Observable((obs) => {
(0, node_fs_1.mkdirSync)((0, src_1.getSystemPath)((0, src_1.dirname)(path)), { recursive: true });
(0, node_fs_1.writeFileSync)((0, src_1.getSystemPath)(path), new Uint8Array(content));
obs.next();
obs.complete();
});
}
read(path) {
return new rxjs_1.Observable((obs) => {
const buffer = (0, node_fs_1.readFileSync)((0, src_1.getSystemPath)(path));
obs.next(new Uint8Array(buffer).buffer);
obs.complete();
});
}
delete(path) {
return new rxjs_1.Observable((obs) => {
(0, node_fs_1.rmSync)((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 });
obs.complete();
});
}
rename(from, to) {
return new rxjs_1.Observable((obs) => {
const toSystemPath = (0, src_1.getSystemPath)(to);
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(toSystemPath), { recursive: true });
(0, node_fs_1.renameSync)((0, src_1.getSystemPath)(from), toSystemPath);
obs.next();
obs.complete();
});
}
list(path) {
return new rxjs_1.Observable((obs) => {
const names = (0, node_fs_1.readdirSync)((0, src_1.getSystemPath)(path));
obs.next(names.map((name) => (0, src_1.fragment)(name)));
obs.complete();
});
}
exists(path) {
return new rxjs_1.Observable((obs) => {
obs.next((0, node_fs_1.existsSync)((0, src_1.getSystemPath)(path)));
obs.complete();
});
}
isDirectory(path) {
return this.stat(path).pipe((0, rxjs_1.map)((stat) => stat.isDirectory()));
}
isFile(path) {
return this.stat(path).pipe((0, rxjs_1.map)((stat) => stat.isFile()));
}
// Some hosts may not support stat.
stat(path) {
return new rxjs_1.Observable((obs) => {
obs.next((0, node_fs_1.statSync)((0, src_1.getSystemPath)(path)));
obs.complete();
});
}
// Some hosts may not support watching.
watch(path, _options) {
return new rxjs_1.Observable((obs) => {
loadFSWatcher();
const watcher = new FSWatcher({ persistent: false });
watcher.add((0, src_1.getSystemPath)(path));
watcher
.on('change', (path) => {
obs.next({
path: (0, src_1.normalize)(path),
time: new Date(),
type: src_1.virtualFs.HostWatchEventType.Changed,
});
})
.on('add', (path) => {
obs.next({
path: (0, src_1.normalize)(path),
time: new Date(),
type: src_1.virtualFs.HostWatchEventType.Created,
});
})
.on('unlink', (path) => {
obs.next({
path: (0, src_1.normalize)(path),
time: new Date(),
type: src_1.virtualFs.HostWatchEventType.Deleted,
});
});
return () => {
void watcher.close();
};
}).pipe((0, rxjs_1.publish)(), (0, rxjs_1.refCount)());
}
}
exports.NodeJsSyncHost = NodeJsSyncHost;
//# sourceMappingURL=host.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
export * from './cli-logger';
export * from './host';
@@ -0,0 +1,26 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./cli-logger"), exports);
__exportStar(require("./host"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,yCAAuB"}
@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import * as fs from 'node:fs';
import { Path, virtualFs } from '../../src';
/**
* A Sync Scoped Host that creates a temporary directory and scope to it.
*/
export declare class TempScopedNodeJsSyncHost extends virtualFs.ScopedHost<fs.Stats> {
protected _sync?: virtualFs.SyncDelegateHost<fs.Stats>;
protected _root: Path;
constructor();
get files(): Path[];
get root(): Path;
get sync(): virtualFs.SyncDelegateHost<fs.Stats>;
}
@@ -0,0 +1,90 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TempScopedNodeJsSyncHost = void 0;
const crypto = __importStar(require("node:crypto"));
const fs = __importStar(require("node:fs"));
const os = __importStar(require("node:os"));
const path = __importStar(require("node:path"));
const src_1 = require("../../src");
const host_1 = require("../host");
/**
* A Sync Scoped Host that creates a temporary directory and scope to it.
*/
class TempScopedNodeJsSyncHost extends src_1.virtualFs.ScopedHost {
_sync;
_root;
constructor() {
const root = (0, src_1.normalize)(path.join(os.tmpdir(), `devkit-host-${crypto.randomUUID()}-${process.pid}`));
fs.mkdirSync((0, src_1.getSystemPath)(root));
super(new host_1.NodeJsSyncHost(), root);
this._root = root;
}
get files() {
const sync = this.sync;
function _visit(p) {
return sync
.list(p)
.map((fragment) => (0, src_1.join)(p, fragment))
.reduce((files, path) => {
if (sync.isDirectory(path)) {
return files.concat(_visit(path));
}
else {
return files.concat(path);
}
}, []);
}
return _visit((0, src_1.normalize)('/'));
}
get root() {
return this._root;
}
get sync() {
if (!this._sync) {
this._sync = new src_1.virtualFs.SyncDelegateHost(this);
}
return this._sync;
}
}
exports.TempScopedNodeJsSyncHost = TempScopedNodeJsSyncHost;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAAsC;AACtC,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAClC,mCAA4E;AAC5E,kCAAyC;AAEzC;;GAEG;AACH,MAAa,wBAAyB,SAAQ,eAAS,CAAC,UAAoB;IAChE,KAAK,CAAwC;IACpC,KAAK,CAAO;IAE/B;QACE,MAAM,IAAI,GAAG,IAAA,eAAS,EACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,eAAe,MAAM,CAAC,UAAU,EAAE,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAC5E,CAAC;QACF,EAAE,CAAC,SAAS,CAAC,IAAA,mBAAa,EAAC,IAAI,CAAC,CAAC,CAAC;QAElC,KAAK,CAAC,IAAI,qBAAc,EAAE,EAAE,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,KAAK;QACP,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,SAAS,MAAM,CAAC,CAAO;YACrB,OAAO,IAAI;iBACR,IAAI,CAAC,CAAC,CAAC;iBACP,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAA,UAAI,EAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;iBACpC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;gBACtB,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;gBACpC,CAAC;qBAAM,CAAC;oBACN,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC,EAAE,EAAY,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,MAAM,CAAC,IAAA,eAAS,EAAC,GAAG,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,IAAI,IAAI;QACN,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,IAAI,eAAS,CAAC,gBAAgB,CAAW,IAAI,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AA1CD,4DA0CC"}
@@ -0,0 +1,64 @@
{
"name": "@angular-devkit/core",
"version": "21.2.16",
"description": "Angular DevKit - Core Utility Library",
"main": "src/index.js",
"typings": "src/index.d.ts",
"keywords": [
"Angular CLI",
"Angular DevKit",
"angular",
"core",
"devkit",
"sdk"
],
"exports": {
".": {
"types": "./src/index.d.ts",
"default": "./src/index.js"
},
"./node": {
"types": "./node/index.d.ts",
"default": "./node/index.js"
},
"./node/testing": {
"types": "./node/testing/index.d.ts",
"default": "./node/testing/index.js"
},
"./package.json": "./package.json",
"./*": "./*.js",
"./*.js": "./*.js"
},
"dependencies": {
"ajv": "8.18.0",
"ajv-formats": "3.0.1",
"jsonc-parser": "3.3.1",
"picomatch": "4.0.4",
"rxjs": "7.8.2",
"source-map": "0.7.6"
},
"peerDependencies": {
"chokidar": "^5.0.0"
},
"peerDependenciesMeta": {
"chokidar": {
"optional": true
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/angular/angular-cli.git"
},
"packageManager": "pnpm@10.33.2",
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
"yarn": ">= 1.13.0"
},
"author": "Angular Authors",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular-cli/issues"
},
"homepage": "https://github.com/angular/angular-cli"
}
@@ -0,0 +1,25 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
export declare class BaseException extends Error {
constructor(message?: string);
}
export declare class UnknownException extends BaseException {
constructor(message: string);
}
export declare class FileDoesNotExistException extends BaseException {
constructor(path: string);
}
export declare class FileAlreadyExistException extends BaseException {
constructor(path: string);
}
export declare class PathIsDirectoryException extends BaseException {
constructor(path: string);
}
export declare class PathIsFileException extends BaseException {
constructor(path: string);
}
@@ -0,0 +1,48 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.PathIsFileException = exports.PathIsDirectoryException = exports.FileAlreadyExistException = exports.FileDoesNotExistException = exports.UnknownException = exports.BaseException = void 0;
class BaseException extends Error {
constructor(message = '') {
super(message);
}
}
exports.BaseException = BaseException;
class UnknownException extends BaseException {
constructor(message) {
super(message);
}
}
exports.UnknownException = UnknownException;
// Exceptions
class FileDoesNotExistException extends BaseException {
constructor(path) {
super(`Path "${path}" does not exist.`);
}
}
exports.FileDoesNotExistException = FileDoesNotExistException;
class FileAlreadyExistException extends BaseException {
constructor(path) {
super(`Path "${path}" already exist.`);
}
}
exports.FileAlreadyExistException = FileAlreadyExistException;
class PathIsDirectoryException extends BaseException {
constructor(path) {
super(`Path "${path}" is a directory.`);
}
}
exports.PathIsDirectoryException = PathIsDirectoryException;
class PathIsFileException extends BaseException {
constructor(path) {
super(`Path "${path}" is a file.`);
}
}
exports.PathIsFileException = PathIsFileException;
//# sourceMappingURL=exception.js.map
@@ -0,0 +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"}
@@ -0,0 +1,15 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import * as json from './json/index';
import * as logging from './logger/index';
import * as workspaces from './workspace';
export * from './exception';
export * from './json/index';
export * from './utils/index';
export * from './virtual-fs/index';
export { json, logging, workspaces };
@@ -0,0 +1,57 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.workspaces = exports.logging = exports.json = void 0;
const json = __importStar(require("./json/index"));
exports.json = json;
const logging = __importStar(require("./logger/index"));
exports.logging = logging;
const workspaces = __importStar(require("./workspace"));
exports.workspaces = workspaces;
__exportStar(require("./exception"), exports);
__exportStar(require("./json/index"), exports);
__exportStar(require("./utils/index"), exports);
__exportStar(require("./virtual-fs/index"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +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 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import * as schema from './schema/index';
export * from './utils';
export { schema };
@@ -0,0 +1,50 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.schema = void 0;
const schema = __importStar(require("./schema/index"));
exports.schema = schema;
__exportStar(require("./utils"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uDAAyC;AAGhC,wBAAM;AADf,0CAAwB"}
@@ -0,0 +1,15 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import * as transforms from './transforms';
export * from './interface';
export * from './pointer';
export * from './registry';
export * from './schema';
export * from './visitor';
export * from './utility';
export { transforms };
@@ -0,0 +1,55 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.transforms = void 0;
const transforms = __importStar(require("./transforms"));
exports.transforms = transforms;
__exportStar(require("./interface"), exports);
__exportStar(require("./pointer"), exports);
__exportStar(require("./registry"), exports);
__exportStar(require("./schema"), exports);
__exportStar(require("./visitor"), exports);
__exportStar(require("./utility"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +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 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { ErrorObject, Format } from 'ajv';
import { Observable, ObservableInput } from 'rxjs';
import { JsonArray, JsonObject, JsonValue } from '../utils';
export type JsonPointer = string & {
__PRIVATE_DEVKIT_JSON_POINTER: void;
};
export interface SchemaValidatorResult {
data: JsonValue;
success: boolean;
errors?: SchemaValidatorError[];
}
export type SchemaValidatorError = Partial<ErrorObject>;
export interface SchemaValidatorOptions {
applyPreTransforms?: boolean;
applyPostTransforms?: boolean;
withPrompts?: boolean;
}
export interface SchemaValidator {
(data: JsonValue, options?: SchemaValidatorOptions): Promise<SchemaValidatorResult>;
}
export type SchemaFormatter = Format;
export interface SchemaFormat {
name: string;
formatter: SchemaFormatter;
}
export interface SmartDefaultProvider<T> {
(schema: JsonObject): T | Observable<T>;
}
export interface SchemaKeywordValidator {
(data: JsonValue, schema: JsonValue, parent: JsonObject | JsonArray | undefined, parentProperty: string | number | undefined, pointer: JsonPointer, rootData: JsonValue): boolean | Observable<boolean>;
}
export interface PromptDefinition {
id: string;
type: string;
message: string;
default?: string | string[] | number | boolean | null;
validator?: (value: JsonValue) => boolean | string | Promise<boolean | string>;
items?: Array<string | {
value: JsonValue;
label: string;
}>;
raw?: string | JsonObject;
multiselect?: boolean;
propertyTypes: Set<string>;
}
export type PromptProvider = (definitions: Array<PromptDefinition>) => ObservableInput<{
[id: string]: JsonValue;
}>;
export interface SchemaRegistry {
compile(schema: Object): Promise<SchemaValidator>;
/** @private */
ɵflatten(schema: JsonObject | string): Promise<JsonObject>;
addFormat(format: SchemaFormat): void;
addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
usePromptProvider(provider: PromptProvider): void;
useXDeprecatedProvider(onUsage: (message: string) => void): void;
/**
* Add a transformation step before the validation of any Json.
* @param {JsonVisitor} visitor The visitor to transform every value.
* @param {JsonVisitor[]} deps A list of other visitors to run before.
*/
addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
/**
* Add a transformation step after the validation of any Json. The JSON will not be validated
* after the POST, so if transformations are not compatible with the Schema it will not result
* in an error.
* @param {JsonVisitor} visitor The visitor to transform every value.
* @param {JsonVisitor[]} deps A list of other visitors to run before.
*/
addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
}
export interface JsonSchemaVisitor {
(current: JsonObject | JsonArray, pointer: JsonPointer, parentSchema?: JsonObject | JsonArray, index?: string): void;
}
export interface JsonVisitor {
(value: JsonValue, pointer: JsonPointer, schema?: JsonObject, root?: JsonObject | JsonArray): Observable<JsonValue> | JsonValue;
}
@@ -0,0 +1,10 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["interface.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
@@ -0,0 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { JsonPointer } from './interface';
export declare function buildJsonPointer(fragments: string[]): JsonPointer;
export declare function joinJsonPointer(root: JsonPointer, ...others: string[]): JsonPointer;
export declare function parseJsonPointer(pointer: JsonPointer): string[];
@@ -0,0 +1,39 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildJsonPointer = buildJsonPointer;
exports.joinJsonPointer = joinJsonPointer;
exports.parseJsonPointer = parseJsonPointer;
function buildJsonPointer(fragments) {
return ('/' +
fragments
.map((f) => {
return f.replace(/~/g, '~0').replace(/\//g, '~1');
})
.join('/'));
}
function joinJsonPointer(root, ...others) {
if (root == '/') {
return buildJsonPointer(others);
}
return (root + buildJsonPointer(others));
}
function parseJsonPointer(pointer) {
if (pointer === '') {
return [];
}
if (pointer.charAt(0) !== '/') {
throw new Error('Relative pointer: ' + pointer);
}
return pointer
.substring(1)
.split(/\//)
.map((str) => str.replace(/~1/g, '/').replace(/~0/g, '~'));
}
//# sourceMappingURL=pointer.js.map
@@ -0,0 +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 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { ValidateFunction } from 'ajv';
import { Observable } from 'rxjs';
import { BaseException } from '../../exception';
import { JsonObject } from '../utils';
import { JsonVisitor, PromptProvider, SchemaFormat, SchemaRegistry, SchemaValidator, SchemaValidatorError, SmartDefaultProvider } from './interface';
import { JsonSchema } from './schema';
export type UriHandler = (uri: string) => Observable<JsonObject> | Promise<JsonObject> | null | undefined;
export declare class SchemaValidationException extends BaseException {
readonly errors: SchemaValidatorError[];
constructor(errors?: SchemaValidatorError[], baseMessage?: string);
static createMessages(errors?: SchemaValidatorError[]): string[];
}
export declare class CoreSchemaRegistry implements SchemaRegistry {
private _ajv;
private _uriCache;
private _uriHandlers;
private _pre;
private _post;
private _currentCompilationSchemaInfo?;
private _smartDefaultKeyword;
private _promptProvider?;
private _sourceMap;
constructor(formats?: SchemaFormat[]);
private _fetch;
/**
* Add a transformation step before the validation of any Json.
* @param {JsonVisitor} visitor The visitor to transform every value.
* @param {JsonVisitor[]} deps A list of other visitors to run before.
*/
addPreTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
/**
* Add a transformation step after the validation of any Json. The JSON will not be validated
* after the POST, so if transformations are not compatible with the Schema it will not result
* in an error.
* @param {JsonVisitor} visitor The visitor to transform every value.
* @param {JsonVisitor[]} deps A list of other visitors to run before.
*/
addPostTransform(visitor: JsonVisitor, deps?: JsonVisitor[]): void;
protected _resolver(ref: string, validate?: ValidateFunction): {
context?: ValidateFunction;
schema?: JsonObject;
};
/**
* Flatten the Schema, resolving and replacing all the refs. Makes it into a synchronous schema
* that is also easier to traverse. Does not cache the result.
*
* Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original.
* See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
*
* @param schema The schema or URI to flatten.
* @return A Promise that resolves to the flattened schema object.
* @private since 11.2 without replacement.
*/
ɵflatten(schema: JsonObject): Promise<JsonObject>;
/**
* Compile and return a validation function for the Schema.
*
* @param schema The schema to validate. If a string, will fetch the schema before compiling it
* (using schema as a URI).
*/
compile(schema: JsonSchema): Promise<SchemaValidator>;
private _compile;
addFormat(format: SchemaFormat): void;
addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;
registerUriHandler(handler: UriHandler): void;
usePromptProvider(provider: PromptProvider): void;
private _applyPrompts;
private static _set;
private _applySmartDefaults;
useXDeprecatedProvider(onUsage: (message: string) => void): void;
private normalizeDataPathArr;
}
@@ -0,0 +1,565 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreSchemaRegistry = exports.SchemaValidationException = void 0;
const ajv_1 = __importDefault(require("ajv"));
const ajv_formats_1 = __importDefault(require("ajv-formats"));
const http = __importStar(require("node:http"));
const https = __importStar(require("node:https"));
const Url = __importStar(require("node:url"));
const rxjs_1 = require("rxjs");
const exception_1 = require("../../exception");
const utils_1 = require("../../utils");
const utils_2 = require("../utils");
const utility_1 = require("./utility");
const visitor_1 = require("./visitor");
class SchemaValidationException extends exception_1.BaseException {
errors;
constructor(errors, baseMessage = 'Schema validation failed with the following errors:') {
if (!errors || errors.length === 0) {
super('Schema validation failed.');
this.errors = [];
return;
}
const messages = SchemaValidationException.createMessages(errors);
super(`${baseMessage}\n ${messages.join('\n ')}`);
this.errors = errors;
}
static createMessages(errors) {
if (!errors || errors.length === 0) {
return [];
}
const messages = errors.map((err) => {
let message = `Data path ${JSON.stringify(err.instancePath)} ${err.message}`;
if (err.params) {
switch (err.keyword) {
case 'additionalProperties':
message += `(${err.params.additionalProperty})`;
break;
case 'enum':
message += `. Allowed values are: ${err.params.allowedValues
?.map((v) => `"${v}"`)
.join(', ')}`;
break;
}
}
return message + '.';
});
return messages;
}
}
exports.SchemaValidationException = SchemaValidationException;
class CoreSchemaRegistry {
_ajv;
_uriCache = new Map();
_uriHandlers = new Set();
_pre = new utils_1.PartiallyOrderedSet();
_post = new utils_1.PartiallyOrderedSet();
_currentCompilationSchemaInfo;
_smartDefaultKeyword = false;
_promptProvider;
_sourceMap = new Map();
constructor(formats = []) {
this._ajv = new ajv_1.default({
strict: false,
loadSchema: (uri) => this._fetch(uri),
passContext: true,
});
(0, ajv_formats_1.default)(this._ajv);
for (const format of formats) {
this.addFormat(format);
}
}
async _fetch(uri) {
const maybeSchema = this._uriCache.get(uri);
if (maybeSchema) {
return maybeSchema;
}
// Try all handlers, one after the other.
for (const handler of this._uriHandlers) {
let handlerResult = handler(uri);
if (handlerResult === null || handlerResult === undefined) {
continue;
}
if ((0, rxjs_1.isObservable)(handlerResult)) {
handlerResult = (0, rxjs_1.lastValueFrom)(handlerResult);
}
const value = await handlerResult;
this._uriCache.set(uri, value);
return value;
}
// If none are found, handle using http client.
return new Promise((resolve, reject) => {
const url = new Url.URL(uri);
const client = url.protocol === 'https:' ? https : http;
client.get(url, (res) => {
if (!res.statusCode || res.statusCode >= 300) {
// Consume the rest of the data to free memory.
res.resume();
reject(new Error(`Request failed. Status Code: ${res.statusCode}`));
}
else {
res.setEncoding('utf8');
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
try {
const json = JSON.parse(data);
this._uriCache.set(uri, json);
resolve(json);
}
catch (err) {
reject(err);
}
});
}
});
});
}
/**
* Add a transformation step before the validation of any Json.
* @param {JsonVisitor} visitor The visitor to transform every value.
* @param {JsonVisitor[]} deps A list of other visitors to run before.
*/
addPreTransform(visitor, deps) {
this._pre.add(visitor, deps);
}
/**
* Add a transformation step after the validation of any Json. The JSON will not be validated
* after the POST, so if transformations are not compatible with the Schema it will not result
* in an error.
* @param {JsonVisitor} visitor The visitor to transform every value.
* @param {JsonVisitor[]} deps A list of other visitors to run before.
*/
addPostTransform(visitor, deps) {
this._post.add(visitor, deps);
}
_resolver(ref, validate) {
if (!validate || !ref) {
return {};
}
const schema = validate.schemaEnv.root.schema;
const id = typeof schema === 'object' ? schema.$id : null;
let fullReference = ref;
if (typeof id === 'string') {
fullReference = Url.resolve(id, ref);
if (ref.startsWith('#')) {
fullReference = id + fullReference;
}
}
const resolvedSchema = this._ajv.getSchema(fullReference);
return {
context: resolvedSchema?.schemaEnv.validate,
schema: resolvedSchema?.schema,
};
}
/**
* Flatten the Schema, resolving and replacing all the refs. Makes it into a synchronous schema
* that is also easier to traverse. Does not cache the result.
*
* Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original.
* See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
*
* @param schema The schema or URI to flatten.
* @return A Promise that resolves to the flattened schema object.
* @private since 11.2 without replacement.
*/
async ɵflatten(schema) {
this._ajv.removeSchema(schema);
this._currentCompilationSchemaInfo = undefined;
const validate = await this._ajv.compileAsync(schema);
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
function visitor(current, pointer, parentSchema, index) {
if (current &&
parentSchema &&
index &&
(0, utils_2.isJsonObject)(current) &&
Object.prototype.hasOwnProperty.call(current, '$ref') &&
typeof current['$ref'] == 'string') {
const resolved = self._resolver(current['$ref'], validate);
if (resolved.schema) {
parentSchema[index] = resolved.schema;
}
}
}
const schemaCopy = (0, utils_1.deepCopy)(validate.schema);
(0, visitor_1.visitJsonSchema)(schemaCopy, visitor);
return schemaCopy;
}
/**
* Compile and return a validation function for the Schema.
*
* @param schema The schema to validate. If a string, will fetch the schema before compiling it
* (using schema as a URI).
*/
async compile(schema) {
const validate = await this._compile(schema);
return (value, options) => validate(value, options);
}
async _compile(schema) {
if (typeof schema === 'boolean') {
return async (data) => ({ success: schema, data });
}
const schemaInfo = {
smartDefaultRecord: new Map(),
promptDefinitions: [],
};
this._ajv.removeSchema(schema);
let validator;
try {
this._currentCompilationSchemaInfo = schemaInfo;
validator = this._ajv.compile(schema);
}
catch (e) {
// This should eventually be refactored so that we we handle race condition where the same schema is validated at the same time.
if (!(e instanceof ajv_1.default.MissingRefError)) {
throw e;
}
validator = await this._ajv.compileAsync(schema);
}
finally {
this._currentCompilationSchemaInfo = undefined;
}
return async (data, options) => {
const validationOptions = {
withPrompts: true,
applyPostTransforms: true,
applyPreTransforms: true,
...options,
};
const validationContext = {
promptFieldsWithValue: new Set(),
};
// Apply pre-validation transforms
if (validationOptions.applyPreTransforms) {
for (const visitor of this._pre.values()) {
data = await (0, rxjs_1.lastValueFrom)((0, visitor_1.visitJson)(data, visitor, schema, this._resolver.bind(this), validator));
}
}
// Apply smart defaults
await this._applySmartDefaults(data, schemaInfo.smartDefaultRecord);
// Apply prompts
if (validationOptions.withPrompts) {
const visitor = (value, pointer) => {
if (value !== undefined) {
validationContext.promptFieldsWithValue.add(pointer);
}
return value;
};
if (typeof schema === 'object') {
await (0, rxjs_1.lastValueFrom)((0, visitor_1.visitJson)(data, visitor, schema, this._resolver.bind(this), validator));
}
const definitions = schemaInfo.promptDefinitions.filter((def) => !validationContext.promptFieldsWithValue.has(def.id));
if (definitions.length > 0) {
await this._applyPrompts(data, definitions);
}
}
// Validate using ajv
try {
// eslint-disable-next-line @typescript-eslint/await-thenable
const success = await validator.call(validationContext, data);
if (!success) {
return { data, success, errors: validator.errors ?? [] };
}
}
catch (error) {
if (error instanceof ajv_1.default.ValidationError) {
return { data, success: false, errors: error.errors };
}
throw error;
}
// Apply post-validation transforms
if (validationOptions.applyPostTransforms) {
for (const visitor of this._post.values()) {
data = await (0, rxjs_1.lastValueFrom)((0, visitor_1.visitJson)(data, visitor, schema, this._resolver.bind(this), validator));
}
}
return { data, success: true };
};
}
addFormat(format) {
this._ajv.addFormat(format.name, format.formatter);
}
addSmartDefaultProvider(source, provider) {
if (this._sourceMap.has(source)) {
throw new Error(source);
}
this._sourceMap.set(source, provider);
if (!this._smartDefaultKeyword) {
this._smartDefaultKeyword = true;
this._ajv.addKeyword({
keyword: '$default',
errors: false,
valid: true,
compile: (schema, _parentSchema, it) => {
const compilationSchemInfo = this._currentCompilationSchemaInfo;
if (compilationSchemInfo === undefined) {
return () => true;
}
// We cheat, heavily.
const pathArray = this.normalizeDataPathArr(it);
compilationSchemInfo.smartDefaultRecord.set(JSON.stringify(pathArray), schema);
return () => true;
},
metaSchema: {
type: 'object',
properties: {
'$source': { type: 'string' },
},
additionalProperties: true,
required: ['$source'],
},
});
}
}
registerUriHandler(handler) {
this._uriHandlers.add(handler);
}
usePromptProvider(provider) {
const isSetup = !!this._promptProvider;
this._promptProvider = provider;
if (isSetup) {
return;
}
this._ajv.addKeyword({
keyword: 'x-prompt',
errors: false,
valid: true,
compile: (schema, parentSchema, it) => {
const compilationSchemInfo = this._currentCompilationSchemaInfo;
if (!compilationSchemInfo) {
return () => true;
}
const path = '/' + this.normalizeDataPathArr(it).join('/');
let type;
let items;
let message;
if (typeof schema == 'string') {
message = schema;
}
else {
message = schema.message;
type = schema.type;
items = schema.items;
}
const propertyTypes = (0, utility_1.getTypesOfSchema)(parentSchema);
if (!type) {
if (propertyTypes.size === 1 && propertyTypes.has('boolean')) {
type = 'confirmation';
}
else if (Array.isArray(parentSchema.enum)) {
type = 'list';
}
else if (propertyTypes.size === 1 &&
propertyTypes.has('array') &&
parentSchema.items &&
Array.isArray(parentSchema.items.enum)) {
type = 'list';
}
else {
type = 'input';
}
}
let multiselect;
if (type === 'list') {
multiselect =
schema.multiselect === undefined
? propertyTypes.size === 1 && propertyTypes.has('array')
: schema.multiselect;
const enumValues = multiselect
? parentSchema.items &&
parentSchema.items.enum
: parentSchema.enum;
if (!items && Array.isArray(enumValues)) {
items = [];
for (const value of enumValues) {
if (typeof value == 'string') {
items.push(value);
}
else if (typeof value == 'object') {
// Invalid
}
else {
items.push({ label: value.toString(), value });
}
}
}
}
const definition = {
id: path,
type,
message,
raw: schema,
items,
multiselect,
propertyTypes,
default: typeof parentSchema.default == 'object' &&
parentSchema.default !== null &&
!Array.isArray(parentSchema.default)
? undefined
: parentSchema.default,
async validator(data) {
try {
const result = await it.self.validate(parentSchema, data);
// If the schema is sync then false will be returned on validation failure
if (result) {
return result;
}
else if (it.self.errors?.length) {
// Validation errors will be present on the Ajv instance when sync
return it.self.errors[0].message;
}
}
catch (e) {
const validationError = e;
// If the schema is async then an error will be thrown on validation failure
if (Array.isArray(validationError.errors) && validationError.errors.length) {
return validationError.errors[0].message;
}
}
return false;
},
};
compilationSchemInfo.promptDefinitions.push(definition);
return function () {
// If 'this' is undefined in the call, then it defaults to the global
// 'this'.
if (this && this.promptFieldsWithValue) {
this.promptFieldsWithValue.add(path);
}
return true;
};
},
metaSchema: {
oneOf: [
{ type: 'string' },
{
type: 'object',
properties: {
'type': { type: 'string' },
'message': { type: 'string' },
},
additionalProperties: true,
required: ['message'],
},
],
},
});
}
async _applyPrompts(data, prompts) {
const provider = this._promptProvider;
if (!provider) {
return;
}
const answers = await (0, rxjs_1.lastValueFrom)((0, rxjs_1.from)(provider(prompts)));
for (const path in answers) {
const pathFragments = path.split('/').slice(1);
CoreSchemaRegistry._set(data, pathFragments, answers[path], null, undefined, true);
}
}
static _set(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data, fragments, value,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parent = null, parentProperty, force) {
for (let index = 0; index < fragments.length; index++) {
const fragment = fragments[index];
if (/^i\d+$/.test(fragment)) {
if (!Array.isArray(data)) {
return;
}
for (let dataIndex = 0; dataIndex < data.length; dataIndex++) {
CoreSchemaRegistry._set(data[dataIndex], fragments.slice(index + 1), value, data, `${dataIndex}`);
}
return;
}
if (!data && parent !== null && parentProperty) {
data = parent[parentProperty] = {};
}
parent = data;
parentProperty = fragment;
data = data[fragment];
}
if (parent && parentProperty && (force || parent[parentProperty] === undefined)) {
parent[parentProperty] = value;
}
}
async _applySmartDefaults(data, smartDefaults) {
for (const [pointer, schema] of smartDefaults.entries()) {
const fragments = JSON.parse(pointer);
const source = this._sourceMap.get(schema.$source);
if (!source) {
continue;
}
let value = source(schema);
if ((0, rxjs_1.isObservable)(value)) {
value = (await (0, rxjs_1.lastValueFrom)(value));
}
CoreSchemaRegistry._set(data, fragments, value);
}
}
useXDeprecatedProvider(onUsage) {
this._ajv.addKeyword({
keyword: 'x-deprecated',
validate: (schema, _data, _parentSchema, dataCxt) => {
if (schema) {
onUsage(`Option "${dataCxt?.parentDataProperty}" is deprecated${typeof schema == 'string' ? ': ' + schema : '.'}`);
}
return true;
},
errors: false,
});
}
normalizeDataPathArr(it) {
return it.dataPathArr
.slice(1, it.dataLevel + 1)
.map((p) => (typeof p === 'number' ? p : p.str.replace(/"/g, '')));
}
}
exports.CoreSchemaRegistry = CoreSchemaRegistry;
//# sourceMappingURL=registry.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { JsonObject } from '../utils';
/**
* A specialized interface for JsonSchema (to come). JsonSchemas are also JsonObject.
*
* @public
*/
export type JsonSchema = JsonObject | boolean;
export declare function isJsonSchema(value: unknown): value is JsonSchema;
/**
* Return a schema that is the merge of all subschemas, ie. it should validate all the schemas
* that were passed in. It is possible to make an invalid schema this way, e.g. by using
* `mergeSchemas({ type: 'number' }, { type: 'string' })`, which will never validate.
* @param schemas All schemas to be merged.
*/
export declare function mergeSchemas(...schemas: (JsonSchema | undefined)[]): JsonSchema;
@@ -0,0 +1,52 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isJsonSchema = isJsonSchema;
exports.mergeSchemas = mergeSchemas;
const utils_1 = require("../utils");
function isJsonSchema(value) {
return (0, utils_1.isJsonObject)(value) || value === false || value === true;
}
/**
* Return a schema that is the merge of all subschemas, ie. it should validate all the schemas
* that were passed in. It is possible to make an invalid schema this way, e.g. by using
* `mergeSchemas({ type: 'number' }, { type: 'string' })`, which will never validate.
* @param schemas All schemas to be merged.
*/
function mergeSchemas(...schemas) {
return schemas.reduce((prev, curr) => {
if (curr === undefined) {
return prev;
}
if (prev === false || curr === false) {
return false;
}
else if (prev === true) {
return curr;
}
else if (curr === true) {
return prev;
}
else if (Array.isArray(prev.allOf)) {
if (Array.isArray(curr.allOf)) {
return { ...prev, allOf: [...prev.allOf, ...curr.allOf] };
}
else {
return { ...prev, allOf: [...prev.allOf, curr] };
}
}
else if (Array.isArray(curr.allOf)) {
return { ...prev, allOf: [prev, ...curr.allOf] };
}
else {
return { ...prev, allOf: [prev, curr] };
}
}, true);
}
//# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAWH,oCAEC;AAQD,oCAwBC;AA3CD,oCAA+D;AAS/D,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,IAAA,oBAAY,EAAC,KAAkB,CAAC,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/E,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,GAAG,OAAmC;IACjE,OAAO,OAAO,CAAC,MAAM,CAAa,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9B,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5D,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YACnD,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QAC1C,CAAC;IACH,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,12 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { JsonValue } from '../utils';
import { JsonPointer } from './interface';
import { JsonSchema } from './schema';
export declare function addUndefinedObjectDefaults(value: JsonValue, _pointer: JsonPointer, schema?: JsonSchema): JsonValue;
export declare function addUndefinedDefaults(value: JsonValue, _pointer: JsonPointer, schema?: JsonSchema): JsonValue;
@@ -0,0 +1,101 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.addUndefinedObjectDefaults = addUndefinedObjectDefaults;
exports.addUndefinedDefaults = addUndefinedDefaults;
const utils_1 = require("../utils");
const utility_1 = require("./utility");
function addUndefinedObjectDefaults(value, _pointer, schema) {
return transformUndefined(value, _pointer, schema, true);
}
function addUndefinedDefaults(value, _pointer, schema) {
return transformUndefined(value, _pointer, schema, false);
}
function transformUndefined(value, _pointer, schema, onlyObjects) {
if (typeof schema === 'boolean' || schema === undefined) {
return value;
}
value ??= schema.default;
const types = (0, utility_1.getTypesOfSchema)(schema);
if (types.size === 0) {
return value;
}
let type;
if (types.size === 1) {
// only one potential type
type = Array.from(types)[0];
}
else if (types.size === 2 && types.has('array') && types.has('object')) {
// need to create one of them and array is simpler
type = 'array';
}
else if (schema.properties && types.has('object')) {
// assume object
type = 'object';
}
else if (schema.items && types.has('array')) {
// assume array
type = 'array';
}
else {
// anything else needs to be checked by the consumer anyway
return value;
}
if (!onlyObjects && type === 'array') {
return value == undefined ? [] : value;
}
if (type === 'object') {
let newValue;
if (value == undefined) {
newValue = {};
}
else if ((0, utils_1.isJsonObject)(value)) {
newValue = value;
}
else {
return value;
}
if (!(0, utils_1.isJsonObject)(schema.properties)) {
return newValue;
}
for (const [propName, schemaObject] of Object.entries(schema.properties)) {
if (propName === '$schema' || !(0, utils_1.isJsonObject)(schemaObject)) {
continue;
}
const value = newValue[propName];
if (value === undefined) {
newValue[propName] = schemaObject.default;
}
else if ((0, utils_1.isJsonObject)(value)) {
// Basic support for oneOf and anyOf.
const propertySchemas = schemaObject.oneOf || schemaObject.anyOf;
const allProperties = Object.keys(value);
// Locate a schema which declares all the properties that the object contains.
const adjustedSchema = (0, utils_1.isJsonArray)(propertySchemas) &&
propertySchemas.find((s) => {
if (!(0, utils_1.isJsonObject)(s)) {
return false;
}
const schemaType = (0, utility_1.getTypesOfSchema)(s);
if (schemaType.size === 1 && schemaType.has('object') && (0, utils_1.isJsonObject)(s.properties)) {
const properties = Object.keys(s.properties);
return allProperties.every((key) => properties.includes(key));
}
return false;
});
if (adjustedSchema && (0, utils_1.isJsonObject)(adjustedSchema)) {
newValue[propName] = transformUndefined(value, _pointer, adjustedSchema, onlyObjects);
}
}
}
return newValue;
}
return value;
}
//# sourceMappingURL=transforms.js.map
@@ -0,0 +1 @@
{"version":3,"file":"transforms.js","sourceRoot":"","sources":["transforms.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { JsonSchema } from './schema';
export declare function getTypesOfSchema(schema: JsonSchema): Set<string>;
@@ -0,0 +1,88 @@
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTypesOfSchema = getTypesOfSchema;
const utils_1 = require("../utils");
const allTypes = ['string', 'integer', 'number', 'object', 'array', 'boolean', 'null'];
function getTypesOfSchema(schema) {
if (!schema) {
return new Set();
}
if (schema === true) {
return new Set(allTypes);
}
let potentials;
if (typeof schema.type === 'string') {
potentials = new Set([schema.type]);
}
else if (Array.isArray(schema.type)) {
potentials = new Set(schema.type);
}
else if ((0, utils_1.isJsonArray)(schema.enum)) {
potentials = new Set();
// Gather the type of each enum values, and use that as a starter for potential types.
for (const v of schema.enum) {
switch (typeof v) {
case 'string':
case 'number':
case 'boolean':
potentials.add(typeof v);
break;
case 'object':
if (Array.isArray(v)) {
potentials.add('array');
}
else if (v === null) {
potentials.add('null');
}
else {
potentials.add('object');
}
break;
}
}
}
else {
potentials = new Set(allTypes);
}
if ((0, utils_1.isJsonObject)(schema.not)) {
const notTypes = getTypesOfSchema(schema.not);
potentials = new Set([...potentials].filter((p) => !notTypes.has(p)));
}
if (Array.isArray(schema.allOf)) {
for (const sub of schema.allOf) {
const types = getTypesOfSchema(sub);
potentials = new Set([...types].filter((t) => potentials.has(t)));
}
}
if (Array.isArray(schema.oneOf)) {
let options = new Set();
for (const sub of schema.oneOf) {
const types = getTypesOfSchema(sub);
options = new Set([...options, ...types]);
}
potentials = new Set([...options].filter((o) => potentials.has(o)));
}
if (Array.isArray(schema.anyOf)) {
let options = new Set();
for (const sub of schema.anyOf) {
const types = getTypesOfSchema(sub);
options = new Set([...options, ...types]);
}
potentials = new Set([...options].filter((o) => potentials.has(o)));
}
if (schema.properties) {
potentials.add('object');
}
else if (schema.items) {
potentials.add('array');
}
return potentials;
}
//# sourceMappingURL=utility.js.map
@@ -0,0 +1 @@
{"version":3,"file":"utility.js","sourceRoot":"","sources":["utility.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,34 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { Observable } from 'rxjs';
import { JsonObject, JsonValue } from '../utils';
import { JsonSchemaVisitor, JsonVisitor } from './interface';
import { JsonSchema } from './schema';
export interface ReferenceResolver<ContextT> {
(ref: string, context?: ContextT): {
context?: ContextT;
schema?: JsonObject;
};
}
/**
* Visit all the properties in a JSON object, allowing to transform them. It supports calling
* properties synchronously or asynchronously (through Observables).
* The original object can be mutated or replaced entirely. In case where it's replaced, the new
* value is returned. When it's mutated though the original object will be changed.
*
* Please note it is possible to have an infinite loop here (which will result in a stack overflow)
* if you return 2 objects that references each others (or the same object all the time).
*
* @param {JsonValue} json The Json value to visit.
* @param {JsonVisitor} visitor A function that will be called on every items.
* @param {JsonObject} schema A JSON schema to pass through to the visitor (where possible).
* @param refResolver a function to resolve references in the schema.
* @returns {Observable< | undefined>} The observable of the new root, if the root changed.
*/
export declare function visitJson<ContextT>(json: JsonValue, visitor: JsonVisitor, schema?: JsonSchema, refResolver?: ReferenceResolver<ContextT>, context?: ContextT): Observable<JsonValue>;
export declare function visitJsonSchema(schema: JsonSchema, visitor: JsonSchemaVisitor): void;

Some files were not shown because too many files have changed in this diff Show More