node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

2
server/node_modules/@ucast/core/dist/es5m/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
server/node_modules/@ucast/core/dist/es6c/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class t{constructor(t,e){this.operator=t,this.value=e,Object.defineProperty(this,"t",{writable:!0})}get notes(){return this.t}addNote(t){this.t=this.t||[],this.t.push(t)}}class e extends t{}class r extends e{constructor(t,e){if(!Array.isArray(e))throw new Error(`"${t}" operator expects to receive an array of conditions`);super(t,e)}}class o extends t{constructor(t,e,r){super(t,r),this.field=e}}const s=new e("__null__",null),n=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);function i(t,e){return e instanceof r&&e.operator===t}function c(t,e){return 1===e.length?e[0]:new r(t,function t(e,r,o){const s=o||[];for(let o=0,n=r.length;o<n;o++){const n=r[o];i(e,n)?t(e,n.value,s):s.push(n)}return s}(t,e))}const u=t=>t,a=()=>Object.create(null),h=Object.defineProperty(a(),"__@type@__",{value:"ignore value"});function p(t,e,r=!1){if(!t||t&&t.constructor!==Object)return!1;for(const o in t){if(n(t,o)&&n(e,o)&&(!r||t[o]!==h))return!0}return!1}function f(t){const e=[];for(const r in t)n(t,r)&&t[r]!==h&&e.push(r);return e}function l(t,e){e!==s&&t.push(e)}const d=t=>c("and",t),x={compound(t,e,o){const s=(Array.isArray(e)?e:[e]).map(t=>o.parse(t));return new r(t.name,s)},field:(t,e,r)=>new o(t.name,r.field,e),document:(t,r)=>new e(t.name,r)};class b{constructor(t,e=a()){this.o=void 0,this.s=void 0,this.i=void 0,this.u=void 0,this.h=void 0,this.parse=this.parse.bind(this),this.u={operatorToConditionName:e.operatorToConditionName||u,defaultOperatorName:e.defaultOperatorName||"eq",mergeFinalConditions:e.mergeFinalConditions||d},this.o=Object.keys(t).reduce((e,r)=>(e[r]=Object.assign({name:this.u.operatorToConditionName(r)},t[r]),e),{}),this.s=Object.assign({},e.fieldContext,{field:"",query:{},parse:this.parse,hasOperators:t=>p(t,this.o,e.useIgnoreValue)}),this.i=Object.assign({},e.documentContext,{parse:this.parse,query:{}}),this.h=e.useIgnoreValue?f:Object.keys}setParse(t){this.parse=t,this.s.parse=t,this.i.parse=t}parseField(t,e,r,o){const s=this.o[e];if(!s)throw new Error(`Unsupported operator "${e}"`);if("field"!==s.type)throw new Error(`Unexpected ${s.type} operator "${e}" at field level`);return this.s.field=t,this.s.query=o,this.parseInstruction(s,r,this.s)}parseInstruction(t,e,r){"function"==typeof t.validate&&t.validate(t,e);return(t.parse||x[t.type])(t,e,r)}parseFieldOperators(t,e){const r=[],o=this.h(e);for(let s=0,n=o.length;s<n;s++){const n=o[s];if(!this.o[n])throw new Error(`Field query for "${t}" may contain only operators or a plain object as a value`);l(r,this.parseField(t,n,e[n],e))}return r}parse(t){const e=[],r=this.h(t);this.i.query=t;for(let o=0,s=r.length;o<s;o++){const s=r[o],n=t[s],i=this.o[s];if(i){if("document"!==i.type&&"compound"!==i.type)throw new Error(`Cannot use parsing instruction for operator "${s}" in "document" context as it is supposed to be used in "${i.type}" context`);l(e,this.parseInstruction(i,n,this.i))}else this.s.hasOperators(n)?e.push(...this.parseFieldOperators(s,n)):l(e,this.parseField(s,this.u.defaultOperatorName,n,t))}return this.u.mergeFinalConditions(e)}}function w(t,e){const r=t[e];if("function"!=typeof r)throw new Error(`Unable to interpret "${e}" condition. Did you forget to register interpreter for it?`);return r}function O(t){return t.operator}const _=b.prototype.parseInstruction;exports.CompoundCondition=r,exports.Condition=t,exports.DocumentCondition=e,exports.FieldCondition=o,exports.ITSELF="__itself__",exports.NULL_CONDITION=s,exports.ObjectQueryParser=b,exports.buildAnd=d,exports.buildOr=t=>c("or",t),exports.createInterpreter=function(t,e){const r=e,o=r&&r.getInterpreterName||O;let s;switch(r?r.numberOfArguments:0){case 1:s=e=>{const s=o(e,r);return w(t,s)(e,n)};break;case 3:s=(e,s,i)=>{const c=o(e,r);return w(t,c)(e,s,i,n)};break;default:s=(e,s)=>{const i=o(e,r);return w(t,i)(e,s,n)}}const n=Object.assign({},r,{interpret:s});return n.interpret},exports.createTranslatorFactory=function(t,e){return(r,...o)=>{const s=t(r,...o),n=e.bind(null,s);return n.ast=s,n}},exports.defaultInstructionParsers=x,exports.hasOperators=p,exports.identity=u,exports.ignoreValue=h,exports.isCompound=i,exports.object=a,exports.optimizedCompoundCondition=c,exports.parseInstruction=_;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

2
server/node_modules/@ucast/core/dist/es6m/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,2 @@
class t{constructor(t,e){this.operator=t,this.value=e,Object.defineProperty(this,"t",{writable:!0})}get notes(){return this.t}addNote(t){this.t=this.t||[],this.t.push(t)}}class e extends t{}class r extends e{constructor(t,e){if(!Array.isArray(e))throw new Error(`"${t}" operator expects to receive an array of conditions`);super(t,e)}}const n="__itself__";class o extends t{constructor(t,e,r){super(t,r),this.field=e}}const s=new e("__null__",null),i=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);function c(t,e){return e instanceof r&&e.operator===t}function u(t,e){return 1===e.length?e[0]:new r(t,function t(e,r,n){const o=n||[];for(let n=0,s=r.length;n<s;n++){const s=r[n];c(e,s)?t(e,s.value,o):o.push(s)}return o}(t,e))}const a=t=>t,h=()=>Object.create(null),f=Object.defineProperty(h(),"__@type@__",{value:"ignore value"});function l(t,e,r=!1){if(!t||t&&t.constructor!==Object)return!1;for(const n in t){if(i(t,n)&&i(e,n)&&(!r||t[n]!==f))return!0}return!1}function d(t){const e=[];for(const r in t)i(t,r)&&t[r]!==f&&e.push(r);return e}function p(t,e){e!==s&&t.push(e)}const w=t=>u("and",t),b=t=>u("or",t),O={compound(t,e,n){const o=(Array.isArray(e)?e:[e]).map(t=>n.parse(t));return new r(t.name,o)},field:(t,e,r)=>new o(t.name,r.field,e),document:(t,r)=>new e(t.name,r)};class j{constructor(t,e=h()){this.o=void 0,this.s=void 0,this.i=void 0,this.u=void 0,this.h=void 0,this.parse=this.parse.bind(this),this.u={operatorToConditionName:e.operatorToConditionName||a,defaultOperatorName:e.defaultOperatorName||"eq",mergeFinalConditions:e.mergeFinalConditions||w},this.o=Object.keys(t).reduce((e,r)=>(e[r]=Object.assign({name:this.u.operatorToConditionName(r)},t[r]),e),{}),this.s=Object.assign({},e.fieldContext,{field:"",query:{},parse:this.parse,hasOperators:t=>l(t,this.o,e.useIgnoreValue)}),this.i=Object.assign({},e.documentContext,{parse:this.parse,query:{}}),this.h=e.useIgnoreValue?d:Object.keys}setParse(t){this.parse=t,this.s.parse=t,this.i.parse=t}parseField(t,e,r,n){const o=this.o[e];if(!o)throw new Error(`Unsupported operator "${e}"`);if("field"!==o.type)throw new Error(`Unexpected ${o.type} operator "${e}" at field level`);return this.s.field=t,this.s.query=n,this.parseInstruction(o,r,this.s)}parseInstruction(t,e,r){"function"==typeof t.validate&&t.validate(t,e);return(t.parse||O[t.type])(t,e,r)}parseFieldOperators(t,e){const r=[],n=this.h(e);for(let o=0,s=n.length;o<s;o++){const s=n[o];if(!this.o[s])throw new Error(`Field query for "${t}" may contain only operators or a plain object as a value`);p(r,this.parseField(t,s,e[s],e))}return r}parse(t){const e=[],r=this.h(t);this.i.query=t;for(let n=0,o=r.length;n<o;n++){const o=r[n],s=t[o],i=this.o[o];if(i){if("document"!==i.type&&"compound"!==i.type)throw new Error(`Cannot use parsing instruction for operator "${o}" in "document" context as it is supposed to be used in "${i.type}" context`);p(e,this.parseInstruction(i,s,this.i))}else this.s.hasOperators(s)?e.push(...this.parseFieldOperators(o,s)):p(e,this.parseField(o,this.u.defaultOperatorName,s,t))}return this.u.mergeFinalConditions(e)}}function _(t,e){const r=t[e];if("function"!=typeof r)throw new Error(`Unable to interpret "${e}" condition. Did you forget to register interpreter for it?`);return r}function y(t){return t.operator}function m(t,e){const r=e,n=r&&r.getInterpreterName||y;let o;switch(r?r.numberOfArguments:0){case 1:o=e=>{const o=n(e,r);return _(t,o)(e,s)};break;case 3:o=(e,o,i)=>{const c=n(e,r);return _(t,c)(e,o,i,s)};break;default:o=(e,o)=>{const i=n(e,r);return _(t,i)(e,o,s)}}const s=Object.assign({},r,{interpret:o});return s.interpret}function v(t,e){return(r,...n)=>{const o=t(r,...n),s=e.bind(null,o);return s.ast=o,s}}const x=j.prototype.parseInstruction;export{r as CompoundCondition,t as Condition,e as DocumentCondition,o as FieldCondition,n as ITSELF,s as NULL_CONDITION,j as ObjectQueryParser,w as buildAnd,b as buildOr,m as createInterpreter,v as createTranslatorFactory,O as defaultInstructionParsers,l as hasOperators,a as identity,f as ignoreValue,c as isCompound,h as object,u as optimizedCompoundCondition,x as parseInstruction};
//# sourceMappingURL=index.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,25 @@
export interface Note<T> {
type: string;
message?: string;
originalValue?: T;
}
export declare abstract class Condition<T = unknown> {
readonly operator: string;
readonly value: T;
private _notes;
constructor(operator: string, value: T);
get notes(): ReadonlyArray<Note<T>> | undefined;
addNote(note: Note<T>): void;
}
export declare class DocumentCondition<T> extends Condition<T> {
}
export declare class CompoundCondition<T extends Condition = Condition> extends DocumentCondition<T[]> {
constructor(operator: string, conditions: T[]);
}
export declare const ITSELF = "__itself__";
export declare class FieldCondition<T = unknown> extends Condition<T> {
readonly field: string | typeof ITSELF;
constructor(operator: string, field: string | typeof ITSELF, value: T);
}
export declare const NULL_CONDITION: DocumentCondition<null>;
export declare type ConditionValue<T> = T extends Condition<infer V> ? V : unknown;

View File

@@ -0,0 +1,3 @@
import { Condition } from './Condition';
export declare const buildAnd: (conditions: Condition[]) => Condition<unknown> | import("./Condition").CompoundCondition<Condition<unknown>>;
export declare const buildOr: (conditions: Condition[]) => Condition<unknown> | import("./Condition").CompoundCondition<Condition<unknown>>;

14
server/node_modules/@ucast/core/dist/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
export * from './Condition';
export * from './types';
export * from './interpreter';
export * from './translator';
export * from './builder';
export { isCompound, hasOperators, identity, object, optimizedCompoundCondition, ignoreValue, } from './utils';
export type { IgnoreValue } from './utils';
export * from './parsers/ObjectQueryParser';
export * from './parsers/defaultInstructionParsers';
/**
* @deprecated use `ObjectQueryParser#parseInstruction` instead
* TODO(major): remove
*/
export declare const parseInstruction: any;

View File

@@ -0,0 +1,13 @@
import { Condition } from './Condition';
declare type ArgsExceptLast<F extends (...args: any[]) => any> = F extends (a: any, c: any) => any ? Parameters<(condition: Condition) => 0> : F extends (a: any, b: any, c: any) => any ? Parameters<(condition: Condition, value: Parameters<F>[1]) => 0> : Parameters<(condition: Condition, value: Parameters<F>[1], options: Parameters<F>[2], ...args: unknown[]) => 0>;
export declare type Interpreter<T extends Condition, R> = (condition: T, ...args: any[]) => R;
export declare type AnyInterpreter = Interpreter<any, any>;
export interface InterpretationContext<T extends AnyInterpreter> {
interpret(...args: ArgsExceptLast<T>): ReturnType<T>;
}
export interface InterpreterOptions {
numberOfArguments?: 1 | 2 | 3;
getInterpreterName?(condition: Condition, context: this): string;
}
export declare function createInterpreter<T extends AnyInterpreter, U extends {} = {}>(interpreters: Record<string, T>, rawOptions?: U): (...args: ArgsExceptLast<T>) => ReturnType<T>;
export {};

View File

@@ -0,0 +1,30 @@
import { Condition } from '../Condition';
import { NamedInstruction, ParsingInstruction, FieldParsingContext, ParsingContext } from '../types';
export declare type FieldQueryOperators<T extends {}> = {
[K in keyof T]: T[K] extends {} ? T[K] : never;
}[keyof T];
export interface QueryOptions {
operatorToConditionName?(name: string): string;
defaultOperatorName?: string;
fieldContext?: Record<string, unknown>;
documentContext?: Record<string, unknown>;
useIgnoreValue?: boolean;
mergeFinalConditions?(conditions: Condition[]): Condition;
}
export declare type ObjectQueryFieldParsingContext = ParsingContext<FieldParsingContext & {
query: {};
hasOperators<T>(value: unknown): value is T;
}>;
export declare class ObjectQueryParser<T extends Record<any, any>, U extends FieldQueryOperators<T> = FieldQueryOperators<T>> {
private readonly _instructions;
private _fieldInstructionContext;
private _documentInstructionContext;
private readonly _options;
private readonly _objectKeys;
constructor(instructions: Record<string, ParsingInstruction>, options?: QueryOptions);
setParse(parse: this['parse']): void;
protected parseField(field: string, operator: string, value: unknown, parentQuery: {}): Condition<unknown>;
protected parseInstruction(instruction: NamedInstruction, value: unknown, context: ParsingContext<{}>): Condition<unknown>;
protected parseFieldOperators(field: string, value: U): Condition<unknown>[];
parse<Q extends T>(query: Q): Condition;
}

View File

@@ -0,0 +1,8 @@
import { DocumentInstruction, CompoundInstruction, FieldInstruction } from '../types';
interface DefaultParsers {
compound: Exclude<CompoundInstruction['parse'], undefined>;
field: Exclude<FieldInstruction['parse'], undefined>;
document: Exclude<DocumentInstruction['parse'], undefined>;
}
export declare const defaultInstructionParsers: DefaultParsers;
export {};

View File

@@ -0,0 +1,9 @@
import { Condition } from './Condition';
import { Parse } from './types';
import { AnyInterpreter } from './interpreter';
declare type Bound<T> = T extends (first: Condition, ...args: infer A) => any ? {
(...args: A): ReturnType<T>;
ast: Condition;
} : never;
export declare function createTranslatorFactory<Lang, Interpreter extends AnyInterpreter>(parse: Parse<Lang>, interpret: Interpreter): (query: Lang, ...args: unknown[]) => Bound<Interpreter>;
export {};

27
server/node_modules/@ucast/core/dist/types/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import { Condition } from './Condition';
export declare type Named<T, Name extends string = string> = T & {
name: Name;
};
export declare type Parse<T = any> = (query: T, ...args: any[]) => Condition;
export declare type ParsingContext<T extends {}> = T & {
parse: Parse;
};
export interface ParsingInstruction<T = unknown, Context extends {} = {}> {
type: string;
validate?(instruction: Named<this>, value: T): void;
parse?(instruction: Named<this>, value: T, context: ParsingContext<Context>): Condition;
}
export interface CompoundInstruction<T = unknown, C extends {} = {}> extends ParsingInstruction<T, C> {
type: 'compound';
}
export interface DocumentInstruction<T = unknown, C extends {} = {}> extends ParsingInstruction<T, C> {
type: 'document';
}
export interface FieldParsingContext {
field: string;
}
export interface FieldInstruction<T = unknown, C extends FieldParsingContext = FieldParsingContext> extends ParsingInstruction<T, C> {
type: 'field';
}
export declare type NamedInstruction<T extends string = string> = Named<ParsingInstruction, T>;
export declare type Comparable = number | string | Date;

12
server/node_modules/@ucast/core/dist/types/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { Condition, CompoundCondition } from './Condition';
export declare function isCompound(operator: string, condition: Condition): condition is CompoundCondition;
export declare function optimizedCompoundCondition<T extends Condition>(operator: string, conditions: T[]): T | CompoundCondition<T>;
export declare const identity: <T>(x: T) => T;
export declare const object: () => any;
export declare const ignoreValue: IgnoreValue;
export interface IgnoreValue {
readonly ['__@type@__']: 'ignore value';
}
export declare function hasOperators<T>(value: any, instructions: Record<string, unknown>, skipIgnore?: boolean): value is T;
export declare function objectKeysSkipIgnore(anyObject: Record<string, unknown>): string[];
export declare function pushIfNonNullCondition(conditions: Condition[], condition: Condition): void;

2
server/node_modules/@ucast/core/dist/umd/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long