@ja-platform/parser-schema 0.0.0-dev-20261021194038 → 0.0.0-stage
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +3 -35
- package/dist/@types/day/Day.d.ts +0 -48
- package/dist/@types/day/utils.d.ts +0 -4
- package/dist/@types/expressions/SchemaObjectDisplayExpression.d.ts +0 -17
- package/dist/@types/expressions/parseParameterValueProvider.d.ts +0 -5
- package/dist/@types/index.d.ts +0 -16
- package/dist/@types/schema/ModelIndex.d.ts +0 -19
- package/dist/@types/schema/Schema.d.ts +0 -35
- package/dist/@types/schema/TypeFactory.d.ts +0 -25
- package/dist/@types/schema/fieldMetadata.d.ts +0 -5
- package/dist/@types/types/EnumOption.d.ts +0 -13
- package/dist/@types/types/Field.d.ts +0 -24
- package/dist/@types/types/Param.d.ts +0 -19
- package/dist/@types/types/QueryType.d.ts +0 -19
- package/dist/@types/types/Relationship.d.ts +0 -20
- package/dist/@types/types/SchemaModelType.d.ts +0 -73
- package/dist/@types/types/primitives/Boolean.d.ts +0 -21
- package/dist/@types/types/primitives/ChoiceType.d.ts +0 -47
- package/dist/@types/types/primitives/Date.d.ts +0 -14
- package/dist/@types/types/primitives/Datetime.d.ts +0 -9
- package/dist/@types/types/primitives/GeoTrack.d.ts +0 -5
- package/dist/@types/types/primitives/Location.d.ts +0 -6
- package/dist/@types/types/primitives/MultipleChoice.d.ts +0 -5
- package/dist/@types/types/primitives/MultipleChoiceInteger.d.ts +0 -8
- package/dist/@types/types/primitives/SingleChoice.d.ts +0 -5
- package/dist/@types/types/primitives/SingleChoiceInteger.d.ts +0 -8
- package/dist/@types/types/primitives/Text.d.ts +0 -8
- package/dist/@types/types/primitives/attachments/Attachment.d.ts +0 -9
- package/dist/@types/types/primitives/attachments/Photo.d.ts +0 -6
- package/dist/@types/types/primitives/attachments/Signature.d.ts +0 -6
- package/dist/@types/types/primitives/index.d.ts +0 -67
- package/dist/day/Day.js +0 -104
- package/dist/day/Day.js.map +0 -1
- package/dist/day/utils.js +0 -43
- package/dist/day/utils.js.map +0 -1
- package/dist/expressions/SchemaObjectDisplayExpression.js +0 -40
- package/dist/expressions/SchemaObjectDisplayExpression.js.map +0 -1
- package/dist/expressions/parseParameterValueProvider.js +0 -13
- package/dist/expressions/parseParameterValueProvider.js.map +0 -1
- package/dist/index.js +0 -35
- package/dist/index.js.map +0 -1
- package/dist/schema/ModelIndex.js +0 -14
- package/dist/schema/ModelIndex.js.map +0 -1
- package/dist/schema/Schema.js +0 -70
- package/dist/schema/Schema.js.map +0 -1
- package/dist/schema/TypeFactory.js +0 -21
- package/dist/schema/TypeFactory.js.map +0 -1
- package/dist/schema/fieldMetadata.js +0 -35
- package/dist/schema/fieldMetadata.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/EnumOption.js +0 -22
- package/dist/types/EnumOption.js.map +0 -1
- package/dist/types/Field.js +0 -28
- package/dist/types/Field.js.map +0 -1
- package/dist/types/Param.js +0 -25
- package/dist/types/Param.js.map +0 -1
- package/dist/types/QueryType.js +0 -37
- package/dist/types/QueryType.js.map +0 -1
- package/dist/types/Relationship.js +0 -25
- package/dist/types/Relationship.js.map +0 -1
- package/dist/types/SchemaModelType.js +0 -123
- package/dist/types/SchemaModelType.js.map +0 -1
- package/dist/types/primitives/Boolean.js +0 -9
- package/dist/types/primitives/Boolean.js.map +0 -1
- package/dist/types/primitives/ChoiceType.js +0 -65
- package/dist/types/primitives/ChoiceType.js.map +0 -1
- package/dist/types/primitives/Date.js +0 -69
- package/dist/types/primitives/Date.js.map +0 -1
- package/dist/types/primitives/Datetime.js +0 -31
- package/dist/types/primitives/Datetime.js.map +0 -1
- package/dist/types/primitives/GeoTrack.js +0 -12
- package/dist/types/primitives/GeoTrack.js.map +0 -1
- package/dist/types/primitives/Location.js +0 -18
- package/dist/types/primitives/Location.js.map +0 -1
- package/dist/types/primitives/MultipleChoice.js +0 -12
- package/dist/types/primitives/MultipleChoice.js.map +0 -1
- package/dist/types/primitives/MultipleChoiceInteger.js +0 -34
- package/dist/types/primitives/MultipleChoiceInteger.js.map +0 -1
- package/dist/types/primitives/SingleChoice.js +0 -12
- package/dist/types/primitives/SingleChoice.js.map +0 -1
- package/dist/types/primitives/SingleChoiceInteger.js +0 -38
- package/dist/types/primitives/SingleChoiceInteger.js.map +0 -1
- package/dist/types/primitives/Text.js +0 -22
- package/dist/types/primitives/Text.js.map +0 -1
- package/dist/types/primitives/attachments/Attachment.js +0 -16
- package/dist/types/primitives/attachments/Attachment.js.map +0 -1
- package/dist/types/primitives/attachments/Photo.js +0 -16
- package/dist/types/primitives/attachments/Photo.js.map +0 -1
- package/dist/types/primitives/attachments/Signature.js +0 -16
- package/dist/types/primitives/attachments/Signature.js.map +0 -1
- package/dist/types/primitives/index.js +0 -85
- package/dist/types/primitives/index.js.map +0 -1
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ja-platform/parser-schema",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"version": "0.0.0-dev-20261021194038",
|
|
7
|
-
"description": "JourneyApps Platform resolved schema models and types",
|
|
8
|
-
"main": "./dist/index.js",
|
|
9
|
-
"typings": "./dist/@types/index.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@ja-platform/parser-expressions": "^0.0.0-dev-20261021194038",
|
|
15
|
-
"@ja-platform/parser-type-system": "^0.0.0-dev-20261021194038",
|
|
16
|
-
"moment": "^2.31.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"vitest": "^5.0.5",
|
|
20
|
-
"@vitest/browser": "^5.0.5",
|
|
21
|
-
"@vitest/browser-webdriverio": "^5.0.0",
|
|
22
|
-
"webdriverio": "^10.1.0"
|
|
23
|
-
},
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"registry": "https://registry.npmjs.org/",
|
|
26
|
-
"access": "public"
|
|
27
|
-
},
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "https://github.com/journeyapps-platform/parser.git",
|
|
31
|
-
"directory": "packages/schema"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"test": "pnpm test:node && pnpm test:browser",
|
|
35
|
-
"test:browser": "vitest --run --configLoader runner --config vitest.config.browser.ts",
|
|
36
|
-
"test:node": "vitest --run --configLoader runner --config vitest.config.unit.ts"
|
|
37
|
-
}
|
|
3
|
+
"version": "0.0.0-stage",
|
|
4
|
+
"stub": true,
|
|
5
|
+
"description": "Temporary package placeholder for staged publishing"
|
|
38
6
|
}
|
package/dist/@types/day/Day.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export declare class Day {
|
|
2
|
-
private _time;
|
|
3
|
-
/**
|
|
4
|
-
* Today in the local timezone.
|
|
5
|
-
*/
|
|
6
|
-
constructor();
|
|
7
|
-
/**
|
|
8
|
-
* Construct from a local Date, another Day, a date string, or a UTC midnight timestamp.
|
|
9
|
-
* Date strings use their leading YYYY-MM-DD portion without timezone conversion.
|
|
10
|
-
*/
|
|
11
|
-
constructor(date: Date | Day | string | number);
|
|
12
|
-
/**
|
|
13
|
-
* Construct from a year, zero-based month and day of month.
|
|
14
|
-
*/
|
|
15
|
-
constructor(year: number, month: number, day: number);
|
|
16
|
-
static today(): Day;
|
|
17
|
-
static fromUTCDate(date: Date): Day;
|
|
18
|
-
/**
|
|
19
|
-
* Recognize Day objects, including instances from other copies of the package.
|
|
20
|
-
*/
|
|
21
|
-
static isDay(obj: unknown): obj is Day;
|
|
22
|
-
/**
|
|
23
|
-
* Return a copy of the date at midnight UTC.
|
|
24
|
-
*/
|
|
25
|
-
toDate(): Date;
|
|
26
|
-
toString(): string;
|
|
27
|
-
toJSON(): string;
|
|
28
|
-
toISOString(): string;
|
|
29
|
-
valueOf(): number;
|
|
30
|
-
/**
|
|
31
|
-
* Start of the day in the local timezone.
|
|
32
|
-
*/
|
|
33
|
-
startOfDay(): Date;
|
|
34
|
-
/**
|
|
35
|
-
* End of the day in the local timezone.
|
|
36
|
-
*/
|
|
37
|
-
endOfDay(): Date;
|
|
38
|
-
getYear(): number;
|
|
39
|
-
/**
|
|
40
|
-
* Zero-based month, from 0 (January) to 11 (December).
|
|
41
|
-
*/
|
|
42
|
-
getMonth(): number;
|
|
43
|
-
getDay(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Day of the week, from 0 (Sunday) to 6 (Saturday).
|
|
46
|
-
*/
|
|
47
|
-
getDayOfWeek(): number;
|
|
48
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AbstractFormatExpression, AbstractFormatExpressionParser, ShorthandExpression } from '@ja-platform/parser-expressions';
|
|
2
|
-
import type { AbstractFormatExpressionOptions, ExpressionSource } from '@ja-platform/parser-expressions';
|
|
3
|
-
/**
|
|
4
|
-
* Schema object display text containing only references and formatted references.
|
|
5
|
-
*/
|
|
6
|
-
export declare class SchemaObjectDisplayExpression extends AbstractFormatExpression<SchemaObjectDisplayExpression, ShorthandExpression> {
|
|
7
|
-
static readonly TYPE = "schema-object-display";
|
|
8
|
-
static parse(source: ExpressionSource, start?: number): SchemaObjectDisplayExpression;
|
|
9
|
-
constructor(options: AbstractFormatExpressionOptions<ShorthandExpression>);
|
|
10
|
-
isValid(): boolean;
|
|
11
|
-
protected getParser(): SchemaObjectDisplayExpressionParser;
|
|
12
|
-
}
|
|
13
|
-
export declare class SchemaObjectDisplayExpressionParser extends AbstractFormatExpressionParser<SchemaObjectDisplayExpression, ShorthandExpression> {
|
|
14
|
-
private readonly placeholders;
|
|
15
|
-
protected parsePlaceholder(source: ExpressionSource, start: number): ShorthandExpression<import("@ja-platform/parser-expressions").ShorthandExpressionOptions>;
|
|
16
|
-
protected createExpression(options: AbstractFormatExpressionOptions<ShorthandExpression>): SchemaObjectDisplayExpression;
|
|
17
|
-
}
|
package/dist/@types/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './schema/Schema';
|
|
2
|
-
export * from './schema/TypeFactory';
|
|
3
|
-
export * from './types/EnumOption';
|
|
4
|
-
export * from './types/Field';
|
|
5
|
-
export * from './types/Param';
|
|
6
|
-
export * from './types/SchemaModelType';
|
|
7
|
-
export * from './types/Relationship';
|
|
8
|
-
export * from './types/primitives';
|
|
9
|
-
export { ArrayType } from '@ja-platform/parser-type-system';
|
|
10
|
-
export * from './types/QueryType';
|
|
11
|
-
export * from './expressions/SchemaObjectDisplayExpression';
|
|
12
|
-
export * from './day/Day';
|
|
13
|
-
export * from './day/utils';
|
|
14
|
-
export * from './schema/ModelIndex';
|
|
15
|
-
export * from './schema/fieldMetadata';
|
|
16
|
-
export * from './expressions/parseParameterValueProvider';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare enum IndexDirection {
|
|
2
|
-
ASCENDING = 1,
|
|
3
|
-
DESCENDING = -1
|
|
4
|
-
}
|
|
5
|
-
export declare enum IndexDatabase {
|
|
6
|
-
CLOUD = "cloud",
|
|
7
|
-
APP = "app"
|
|
8
|
-
}
|
|
9
|
-
export interface ModelIndexKey {
|
|
10
|
-
field: string;
|
|
11
|
-
dir: IndexDirection;
|
|
12
|
-
}
|
|
13
|
-
export interface ModelIndex {
|
|
14
|
-
name: string;
|
|
15
|
-
/** @deprecated Use `keys` instead. */
|
|
16
|
-
on: string[];
|
|
17
|
-
keys: ModelIndexKey[];
|
|
18
|
-
databases: IndexDatabase[];
|
|
19
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Param } from '../types/Param';
|
|
2
|
-
import { Field } from '../types/Field';
|
|
3
|
-
import { Relationship } from '../types/Relationship';
|
|
4
|
-
import { SchemaModelType } from '../types/SchemaModelType';
|
|
5
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
6
|
-
import { PrimitiveTypeMap, PrimitiveTypeName } from '../types/primitives';
|
|
7
|
-
import { TypeFactory } from './TypeFactory';
|
|
8
|
-
export type InferGetType<T extends string | PrimitiveTypeName, MAP extends {
|
|
9
|
-
[key in PrimitiveTypeName]: new (...args: any[]) => Type;
|
|
10
|
-
} = PrimitiveTypeMap, Model extends SchemaModelType = SchemaModelType> = T extends PrimitiveTypeName ? InstanceType<MAP[T]> : Model;
|
|
11
|
-
export declare class Schema {
|
|
12
|
-
typeFactories: {
|
|
13
|
-
[key: string]: TypeFactory;
|
|
14
|
-
};
|
|
15
|
-
objects: {
|
|
16
|
-
[index: string]: SchemaModelType;
|
|
17
|
-
};
|
|
18
|
-
apiVersion?: any;
|
|
19
|
-
mobileUserType?: any;
|
|
20
|
-
/**
|
|
21
|
-
* Create an empty resolved schema, independently of its input format.
|
|
22
|
-
*/
|
|
23
|
-
constructor();
|
|
24
|
-
registerTypeFactory(factory: TypeFactory): void;
|
|
25
|
-
getFactory(name: string): TypeFactory<string>;
|
|
26
|
-
/** Helper function to assist in creating variables */
|
|
27
|
-
field<T extends Type = Type>(name?: string, type?: string): Field<T>;
|
|
28
|
-
field<T extends Type = Type>(name?: string, type?: T): Field<T>;
|
|
29
|
-
param<T extends Type = Type>(name?: string, type?: string): Param<T>;
|
|
30
|
-
param<T extends Type = Type>(name?: string, type?: T): Param<T>;
|
|
31
|
-
newObjectType(name?: string): SchemaModelType;
|
|
32
|
-
newRelationship(): Relationship;
|
|
33
|
-
getType<T extends string | PrimitiveTypeName>(typeName: T): InferGetType<T>;
|
|
34
|
-
primitive<T extends string | PrimitiveTypeName>(name: T): InferGetType<T>;
|
|
35
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SchemaModelType } from '../types/SchemaModelType';
|
|
2
|
-
import { Param } from '../types/Param';
|
|
3
|
-
import { PrimitiveTypeInstance, PrimitiveTypeName } from '../types/primitives';
|
|
4
|
-
import { Relationship } from '../types/Relationship';
|
|
5
|
-
import { Field } from '../types/Field';
|
|
6
|
-
import { Schema } from './Schema';
|
|
7
|
-
export interface TypeFactory<NAME extends string = string> {
|
|
8
|
-
name: NAME;
|
|
9
|
-
generate: <T>(event?: any) => any;
|
|
10
|
-
}
|
|
11
|
-
export interface GenerateTypeEvent {
|
|
12
|
-
schema: Schema;
|
|
13
|
-
}
|
|
14
|
-
export type ObjectTypeInstance = Field<any> | Param | SchemaModelType | Relationship;
|
|
15
|
-
export type ObjectTypeName = typeof Param.TYPE | typeof Field.TYPE | typeof SchemaModelType.TYPE | typeof Relationship.TYPE;
|
|
16
|
-
export declare abstract class AbstractObjectTypeFactory<R extends ObjectTypeInstance = ObjectTypeInstance, E extends GenerateTypeEvent = GenerateTypeEvent> implements TypeFactory<ObjectTypeName> {
|
|
17
|
-
name: ObjectTypeName;
|
|
18
|
-
constructor(name: ObjectTypeName);
|
|
19
|
-
abstract generate<T>(event: E): R;
|
|
20
|
-
}
|
|
21
|
-
export declare class PrimitiveTypeFactory<T extends PrimitiveTypeInstance, E extends GenerateTypeEvent = GenerateTypeEvent> implements TypeFactory<PrimitiveTypeName> {
|
|
22
|
-
name: PrimitiveTypeName;
|
|
23
|
-
constructor(name: PrimitiveTypeName);
|
|
24
|
-
generate(event: E): T;
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare class EnumOption {
|
|
2
|
-
/** They key */
|
|
3
|
-
value: string | number | boolean;
|
|
4
|
-
label: string;
|
|
5
|
-
index: number;
|
|
6
|
-
static isInstanceOf(value: any): value is EnumOption;
|
|
7
|
-
constructor(key: string | number | boolean, label: string, index?: number);
|
|
8
|
-
toJSON(): {
|
|
9
|
-
value: string | number | boolean;
|
|
10
|
-
label: string;
|
|
11
|
-
index: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AbstractObjectTypeFactory, GenerateTypeEvent } from '../schema/TypeFactory';
|
|
2
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
3
|
-
/**
|
|
4
|
-
* A named, resolved field and its schema metadata.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Field<T extends Type = Type> {
|
|
7
|
-
static TYPE: string;
|
|
8
|
-
static isInstanceOf(obj: any): obj is Field;
|
|
9
|
-
name: string;
|
|
10
|
-
type: T | null;
|
|
11
|
-
label?: string;
|
|
12
|
-
relationship?: string;
|
|
13
|
-
isRelationshipId?: boolean;
|
|
14
|
-
isBelongsToId?: boolean;
|
|
15
|
-
constructor(name: string, type: T | null);
|
|
16
|
-
}
|
|
17
|
-
export interface GenerateFieldEvent<T extends Type> extends GenerateTypeEvent {
|
|
18
|
-
name: string;
|
|
19
|
-
type: T;
|
|
20
|
-
}
|
|
21
|
-
export declare class FieldFactory<T extends Type = Type> extends AbstractObjectTypeFactory<Field<T>, GenerateFieldEvent<T>> {
|
|
22
|
-
constructor();
|
|
23
|
-
generate<T extends Type = Type>(event: GenerateFieldEvent<T>): Field<T>;
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FunctionExpression } from '@ja-platform/parser-expressions';
|
|
2
|
-
import { AbstractObjectTypeFactory } from '../schema/TypeFactory';
|
|
3
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
4
|
-
import { GenerateFieldEvent, Field } from './Field';
|
|
5
|
-
export declare class Param<T extends Type = Type> extends Field<T> {
|
|
6
|
-
static TYPE: string;
|
|
7
|
-
static isInstanceOf(obj: any): obj is Param;
|
|
8
|
-
sourceTypeName?: string;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
provideValue?: FunctionExpression;
|
|
11
|
-
}
|
|
12
|
-
export interface GenerateParamEvent<T extends Type> extends GenerateFieldEvent<T> {
|
|
13
|
-
required?: boolean;
|
|
14
|
-
provideValue?: FunctionExpression;
|
|
15
|
-
}
|
|
16
|
-
export declare class ParamFactory<T extends Type = Type> extends AbstractObjectTypeFactory<Param<T>, GenerateParamEvent<T>> {
|
|
17
|
-
constructor();
|
|
18
|
-
generate<T extends Type = Type>(event: GenerateParamEvent<T>): Param<T>;
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
2
|
-
/**
|
|
3
|
-
* A query whose results share a value type.
|
|
4
|
-
*/
|
|
5
|
-
export declare class QueryType extends Type {
|
|
6
|
-
readonly itemType: Type;
|
|
7
|
-
readonly _typeName = "query";
|
|
8
|
-
readonly name = "query";
|
|
9
|
-
readonly isCollection = true;
|
|
10
|
-
constructor(itemType: Type);
|
|
11
|
-
static isInstanceOf(type: Type | null): type is QueryType;
|
|
12
|
-
is(value: any): boolean;
|
|
13
|
-
parse(value: unknown): unknown;
|
|
14
|
-
stringify(): string;
|
|
15
|
-
toJSON(): {
|
|
16
|
-
type: string;
|
|
17
|
-
object: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AbstractObjectTypeFactory } from '../schema/TypeFactory';
|
|
2
|
-
import { SchemaModelType } from './SchemaModelType';
|
|
3
|
-
export declare class Relationship {
|
|
4
|
-
static readonly TYPE = "relationship";
|
|
5
|
-
/** one-to-many, many-to-many, one-to-one */
|
|
6
|
-
type: string;
|
|
7
|
-
/** local object type (containing the belongs_to) */
|
|
8
|
-
objectType: SchemaModelType;
|
|
9
|
-
/** foreign object type (containing the has_many) */
|
|
10
|
-
foreignType: SchemaModelType;
|
|
11
|
-
/** The name used on the local object to identify the relationship (singular) */
|
|
12
|
-
name: string;
|
|
13
|
-
/** The name used on the foreign object to identify the relationship (plural) */
|
|
14
|
-
foreignName: string;
|
|
15
|
-
constructor();
|
|
16
|
-
}
|
|
17
|
-
export declare class RelationshipTypeFactory extends AbstractObjectTypeFactory<Relationship> {
|
|
18
|
-
constructor();
|
|
19
|
-
generate(): Relationship;
|
|
20
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { SchemaObjectDisplayExpression } from '../expressions/SchemaObjectDisplayExpression';
|
|
2
|
-
import { ObjectType, Type } from '@ja-platform/parser-type-system';
|
|
3
|
-
import { Field } from './Field';
|
|
4
|
-
import { Relationship } from './Relationship';
|
|
5
|
-
import { Schema } from '../schema/Schema';
|
|
6
|
-
import { ModelIndex } from '../schema/ModelIndex';
|
|
7
|
-
import { TextType } from './primitives';
|
|
8
|
-
import { AbstractObjectTypeFactory, GenerateTypeEvent } from '../schema/TypeFactory';
|
|
9
|
-
export interface NotificationConfig {
|
|
10
|
-
message: SchemaObjectDisplayExpression;
|
|
11
|
-
recipient: string;
|
|
12
|
-
received: string;
|
|
13
|
-
badgeCount: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class SchemaModelType extends ObjectType {
|
|
16
|
-
static readonly TYPE = "object";
|
|
17
|
-
readonly isPrimitiveType = false;
|
|
18
|
-
readonly isObject = true;
|
|
19
|
-
attributes: Record<string, Field>;
|
|
20
|
-
static isInstanceOf(type: any): type is SchemaModelType;
|
|
21
|
-
displayFormat: SchemaObjectDisplayExpression | null;
|
|
22
|
-
label: string;
|
|
23
|
-
belongsTo: {
|
|
24
|
-
[index: string]: Relationship;
|
|
25
|
-
};
|
|
26
|
-
hasMany: {
|
|
27
|
-
[index: string]: Relationship;
|
|
28
|
-
};
|
|
29
|
-
belongsToVars: {
|
|
30
|
-
[index: string]: Field;
|
|
31
|
-
};
|
|
32
|
-
belongsToIdVars: {
|
|
33
|
-
[index: string]: Field;
|
|
34
|
-
};
|
|
35
|
-
hasManyVars: {
|
|
36
|
-
[index: string]: Field;
|
|
37
|
-
};
|
|
38
|
-
idVar: Field<TextType>;
|
|
39
|
-
/**
|
|
40
|
-
* App and Cloud indexes.
|
|
41
|
-
*/
|
|
42
|
-
allIndexes: ModelIndex[];
|
|
43
|
-
/**
|
|
44
|
-
* App indexes.
|
|
45
|
-
*/
|
|
46
|
-
indexes: ModelIndex[];
|
|
47
|
-
webhooks: any[];
|
|
48
|
-
notifyUsers: NotificationConfig[];
|
|
49
|
-
constructor(name?: string);
|
|
50
|
-
addAttribute(attribute: Field): void;
|
|
51
|
-
setupVariables(schema: Schema): void;
|
|
52
|
-
/**
|
|
53
|
-
* Attribute or relationship variable.
|
|
54
|
-
*/
|
|
55
|
-
getAttribute(name: string): Field | null;
|
|
56
|
-
getField(name: string): Type | null;
|
|
57
|
-
getAttributes(): {
|
|
58
|
-
[index: string]: Field;
|
|
59
|
-
};
|
|
60
|
-
addBelongsTo(options: {
|
|
61
|
-
schema: Schema;
|
|
62
|
-
type?: string;
|
|
63
|
-
foreignName?: string;
|
|
64
|
-
name: string;
|
|
65
|
-
}): Relationship;
|
|
66
|
-
}
|
|
67
|
-
export interface GenerateSchemaModelTypeEvent extends GenerateTypeEvent {
|
|
68
|
-
name?: string;
|
|
69
|
-
}
|
|
70
|
-
export declare class SchemaModelTypeFactory extends AbstractObjectTypeFactory<SchemaModelType, GenerateSchemaModelTypeEvent> {
|
|
71
|
-
constructor();
|
|
72
|
-
generate(event: GenerateSchemaModelTypeEvent): SchemaModelType;
|
|
73
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BooleanType as ValueBooleanType } from '@ja-platform/parser-type-system';
|
|
2
|
-
declare const BooleanType_base: {
|
|
3
|
-
new (...args: any[]): {
|
|
4
|
-
parse(value: unknown): any;
|
|
5
|
-
stringify(): string;
|
|
6
|
-
valueOf(): string;
|
|
7
|
-
options: Record<string, import("../EnumOption").EnumOption>;
|
|
8
|
-
multipleOptions: boolean;
|
|
9
|
-
hasOptions: boolean;
|
|
10
|
-
format(value: any): string;
|
|
11
|
-
addOption(value: any, label: string, index: number): import("../EnumOption").EnumOption;
|
|
12
|
-
values(obj: any): any[];
|
|
13
|
-
toJSON(): any;
|
|
14
|
-
name: string;
|
|
15
|
-
readonly _typeName: string;
|
|
16
|
-
is(_value: unknown): boolean;
|
|
17
|
-
};
|
|
18
|
-
} & typeof ValueBooleanType;
|
|
19
|
-
export declare class BooleanType extends BooleanType_base {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { EnumOption } from '../EnumOption';
|
|
2
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
3
|
-
export interface ChoiceTypeConfig {
|
|
4
|
-
multiple: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Add schema option labels without replacing the underlying value type.
|
|
8
|
-
*/
|
|
9
|
-
export declare function withChoices<TBase extends new (...args: any[]) => Type>(Base: TBase): {
|
|
10
|
-
new (...args: any[]): {
|
|
11
|
-
parse(value: unknown): any;
|
|
12
|
-
stringify(): string;
|
|
13
|
-
valueOf(): string;
|
|
14
|
-
options: Record<string, EnumOption>;
|
|
15
|
-
multipleOptions: boolean;
|
|
16
|
-
hasOptions: boolean;
|
|
17
|
-
format(value: any): string;
|
|
18
|
-
addOption(value: any, label: string, index: number): EnumOption;
|
|
19
|
-
values(obj: any): any[];
|
|
20
|
-
toJSON(): any;
|
|
21
|
-
name: string;
|
|
22
|
-
readonly _typeName: string;
|
|
23
|
-
is(_value: unknown): boolean;
|
|
24
|
-
};
|
|
25
|
-
} & TBase;
|
|
26
|
-
declare const ChoiceType_base: {
|
|
27
|
-
new (...args: any[]): {
|
|
28
|
-
parse(value: unknown): any;
|
|
29
|
-
stringify(): string;
|
|
30
|
-
valueOf(): string;
|
|
31
|
-
options: Record<string, EnumOption>;
|
|
32
|
-
multipleOptions: boolean;
|
|
33
|
-
hasOptions: boolean;
|
|
34
|
-
format(value: any): string;
|
|
35
|
-
addOption(value: any, label: string, index: number): EnumOption;
|
|
36
|
-
values(obj: any): any[];
|
|
37
|
-
toJSON(): any;
|
|
38
|
-
name: string;
|
|
39
|
-
readonly _typeName: string;
|
|
40
|
-
is(_value: unknown): boolean;
|
|
41
|
-
};
|
|
42
|
-
} & typeof Type;
|
|
43
|
-
export declare abstract class ChoiceType extends ChoiceType_base {
|
|
44
|
-
static isInstanceOf(type: Type | null): type is ChoiceType;
|
|
45
|
-
constructor(name: string, config?: ChoiceTypeConfig);
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Day } from '../../day/Day';
|
|
2
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
3
|
-
export declare class DateType extends Type {
|
|
4
|
-
static DEFAULT_FORMAT: string;
|
|
5
|
-
readonly _typeName = "date";
|
|
6
|
-
static readonly TYPE = "date";
|
|
7
|
-
static isInstanceOf(type: Type | null): type is DateType;
|
|
8
|
-
isDay?: boolean;
|
|
9
|
-
constructor();
|
|
10
|
-
toJSON(): any;
|
|
11
|
-
format(value: any, format?: string): string;
|
|
12
|
-
is(value: any): boolean;
|
|
13
|
-
parse(value: any): Date | Day;
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
2
|
-
export declare class DatetimeType extends Type {
|
|
3
|
-
static DEFAULT_FORMAT: string;
|
|
4
|
-
static readonly TYPE = "datetime";
|
|
5
|
-
constructor();
|
|
6
|
-
format(value: any, format?: string): string;
|
|
7
|
-
is(value: any): boolean;
|
|
8
|
-
parse(value: any): any;
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ChoiceType } from './ChoiceType';
|
|
2
|
-
export declare class MultipleChoiceIntegerType extends ChoiceType {
|
|
3
|
-
static readonly TYPE = "multiple-choice-integer";
|
|
4
|
-
constructor();
|
|
5
|
-
setOptionLabels(labels: string[]): void;
|
|
6
|
-
is(value: any): boolean;
|
|
7
|
-
parse(value: any): any[];
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ChoiceType } from './ChoiceType';
|
|
2
|
-
export declare class SingleChoiceIntegerType extends ChoiceType {
|
|
3
|
-
static readonly TYPE = "single-choice-integer";
|
|
4
|
-
constructor();
|
|
5
|
-
setOptionLabels(labels: string[]): void;
|
|
6
|
-
is(value: any): boolean;
|
|
7
|
-
parse(value: any): number;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Type, TextType as ValueTextType } from '@ja-platform/parser-type-system';
|
|
2
|
-
export declare class TextType extends ValueTextType {
|
|
3
|
-
static readonly TYPE = "text";
|
|
4
|
-
static isInstanceOf(type: Type): type is TextType;
|
|
5
|
-
spec?: string;
|
|
6
|
-
subType?: string;
|
|
7
|
-
toJSON(): any;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Type } from '@ja-platform/parser-type-system';
|
|
2
|
-
export declare class AttachmentType extends Type {
|
|
3
|
-
readonly _typeName = "attachment";
|
|
4
|
-
static readonly TYPE = "attachment";
|
|
5
|
-
static isInstanceOf(type: Type): type is AttachmentType;
|
|
6
|
-
media?: string;
|
|
7
|
-
autoDownload?: boolean;
|
|
8
|
-
constructor();
|
|
9
|
-
}
|