oak-domain 4.0.1 → 4.0.2
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/lib/actions/action.d.ts +16 -16
- package/lib/actions/action.js +17 -17
- package/lib/actions/relation.d.ts +5 -5
- package/lib/actions/relation.js +25 -25
- package/lib/base-app-domain/ActionAuth/Schema.d.ts +186 -186
- package/lib/base-app-domain/ActionAuth/Storage.js +39 -39
- package/lib/base-app-domain/ActionDefDict.d.ts +8 -8
- package/lib/base-app-domain/ActionDefDict.js +9 -9
- package/lib/base-app-domain/EntityDict.d.ts +28 -28
- package/lib/base-app-domain/I18n/Schema.d.ts +129 -129
- package/lib/base-app-domain/I18n/Schema.js +2 -2
- package/lib/base-app-domain/I18n/Storage.d.ts +3 -3
- package/lib/base-app-domain/I18n/Storage.js +59 -59
- package/lib/base-app-domain/Modi/Action.d.ts +10 -10
- package/lib/base-app-domain/Modi/Action.js +14 -14
- package/lib/base-app-domain/Modi/Schema.d.ts +136 -136
- package/lib/base-app-domain/Modi/Storage.js +63 -63
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +384 -384
- package/lib/base-app-domain/ModiEntity/Storage.js +30 -30
- package/lib/base-app-domain/Oper/Schema.d.ts +153 -153
- package/lib/base-app-domain/Oper/Storage.js +38 -38
- package/lib/base-app-domain/OperEntity/Schema.d.ts +373 -373
- package/lib/base-app-domain/OperEntity/Storage.js +30 -30
- package/lib/base-app-domain/Path/Schema.d.ts +149 -149
- package/lib/base-app-domain/Path/Schema.js +2 -2
- package/lib/base-app-domain/Path/Storage.d.ts +3 -3
- package/lib/base-app-domain/Path/Storage.js +54 -54
- package/lib/base-app-domain/Relation/Schema.d.ts +188 -188
- package/lib/base-app-domain/Relation/Storage.js +54 -54
- package/lib/base-app-domain/Relation.d.ts +2 -2
- package/lib/base-app-domain/Relation.js +4 -4
- package/lib/base-app-domain/RelationAuth/Schema.d.ts +214 -214
- package/lib/base-app-domain/RelationAuth/Storage.js +44 -44
- package/lib/base-app-domain/Storage.js +31 -31
- package/lib/base-app-domain/User/Action.d.ts +10 -10
- package/lib/base-app-domain/User/Action.js +12 -12
- package/lib/base-app-domain/User/Schema.d.ts +210 -210
- package/lib/base-app-domain/User/Storage.js +33 -33
- package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +264 -264
- package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -2
- package/lib/base-app-domain/UserEntityClaim/Storage.d.ts +3 -3
- package/lib/base-app-domain/UserEntityClaim/Storage.js +37 -37
- package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +131 -131
- package/lib/base-app-domain/UserEntityGrant/Storage.js +25 -25
- package/lib/base-app-domain/UserRelation/Schema.d.ts +208 -208
- package/lib/base-app-domain/UserRelation/Storage.js +56 -56
- package/lib/base-app-domain/_SubQuery.d.ts +142 -142
- package/lib/base-app-domain/index.d.ts +4 -4
- package/lib/base-app-domain/index.js +7 -7
- package/lib/checkers/index.d.ts +5 -5
- package/lib/checkers/index.js +13 -13
- package/lib/compiler/entities.d.ts +2 -2
- package/lib/compiler/entities.js +7 -7
- package/lib/compiler/env.d.ts +13 -13
- package/lib/compiler/env.js +45 -45
- package/lib/compiler/localeBuilder.d.ts +27 -27
- package/lib/compiler/localeBuilder.js +37 -8
- package/lib/compiler/routerBuilder.d.ts +1 -0
- package/lib/compiler/routerBuilder.js +257 -0
- package/lib/compiler/schemalBuilder.d.ts +27 -27
- package/lib/compiler/schemalBuilder.js +3565 -3565
- package/lib/entities/ActionAuth.d.ts +10 -10
- package/lib/entities/ActionAuth.js +31 -31
- package/lib/entities/I18n.d.ts +9 -9
- package/lib/entities/I18n.js +36 -36
- package/lib/entities/Modi.js +49 -49
- package/lib/entities/ModiEntity.js +18 -18
- package/lib/entities/Oper.js +21 -21
- package/lib/entities/OperEntity.js +18 -18
- package/lib/entities/Path.d.ts +8 -8
- package/lib/entities/Path.js +35 -35
- package/lib/entities/Relation.d.ts +8 -8
- package/lib/entities/Relation.js +35 -35
- package/lib/entities/RelationAuth.d.ts +8 -8
- package/lib/entities/RelationAuth.js +34 -34
- package/lib/entities/User.js +31 -31
- package/lib/entities/UserEntityClaim.d.ts +13 -13
- package/lib/entities/UserEntityClaim.js +17 -17
- package/lib/entities/UserEntityGrant.d.ts +9 -9
- package/lib/entities/UserEntityGrant.js +15 -15
- package/lib/entities/UserRelation.d.ts +10 -10
- package/lib/entities/UserRelation.js +38 -38
- package/lib/index.d.ts +23 -23
- package/lib/index.js +37 -37
- package/lib/store/AsyncRowStore.d.ts +65 -65
- package/lib/store/AsyncRowStore.js +176 -176
- package/lib/store/CascadeStore.d.ts +4 -1
- package/lib/store/CascadeStore.js +9 -1
- package/lib/store/RelationAuth.d.ts +96 -96
- package/lib/store/RelationAuth.js +1336 -1336
- package/lib/store/SyncRowStore.d.ts +29 -29
- package/lib/store/SyncRowStore.js +50 -50
- package/lib/store/TriggerExecutor.d.ts +41 -41
- package/lib/store/TriggerExecutor.js +1 -1
- package/lib/store/actionAuth.d.ts +4 -4
- package/lib/store/actionAuth.js +25 -25
- package/lib/store/actionDef.d.ts +10 -10
- package/lib/store/actionDef.js +4 -4
- package/lib/store/checker.d.ts +26 -26
- package/lib/store/checker.js +487 -487
- package/lib/store/filter.d.ts +85 -85
- package/lib/store/filter.js +1652 -1652
- package/lib/store/modi.d.ts +13 -13
- package/lib/store/modi.js +254 -254
- package/lib/store/relation.d.ts +12 -12
- package/lib/store/relation.js +67 -67
- package/lib/timers/oper.d.ts +18 -18
- package/lib/timers/oper.js +57 -57
- package/lib/timers/vaccum.d.ts +20 -20
- package/lib/timers/vaccum.js +111 -111
- package/lib/triggers/index.d.ts +5 -5
- package/lib/triggers/index.js +8 -8
- package/lib/types/Action.d.ts +20 -20
- package/lib/types/AppLoader.d.ts +17 -17
- package/lib/types/AppLoader.js +10 -10
- package/lib/types/Auth.d.ts +70 -70
- package/lib/types/Cluster.d.ts +5 -5
- package/lib/types/Cluster.js +2 -2
- package/lib/types/Connector.d.ts +38 -38
- package/lib/types/Connector.js +2 -2
- package/lib/types/DataType.d.ts +25 -25
- package/lib/types/DataType.js +6 -6
- package/lib/types/Demand.d.ts +89 -89
- package/lib/types/Demand.js +10 -10
- package/lib/types/Endpoint.d.ts +11 -11
- package/lib/types/Entity.d.ts +209 -209
- package/lib/types/Entity.js +15 -15
- package/lib/types/EntityDesc.d.ts +9 -9
- package/lib/types/EntityDesc.js +2 -2
- package/lib/types/Environment.d.ts +90 -90
- package/lib/types/Environment.js +2 -2
- package/lib/types/Exception.d.ts +147 -147
- package/lib/types/Exception.js +406 -406
- package/lib/types/Expression.d.ts +163 -163
- package/lib/types/Expression.js +397 -397
- package/lib/types/Geo.d.ts +18 -18
- package/lib/types/Locale.d.ts +25 -25
- package/lib/types/Logger.d.ts +6 -6
- package/lib/types/Polyfill.d.ts +24 -24
- package/lib/types/Port.d.ts +18 -18
- package/lib/types/RowStore.d.ts +19 -19
- package/lib/types/RowStore.js +33 -33
- package/lib/types/Storage.d.ts +58 -58
- package/lib/types/Style.d.ts +11 -11
- package/lib/types/Timer.d.ts +20 -20
- package/lib/types/Trigger.d.ts +118 -118
- package/lib/types/Trigger.js +35 -35
- package/lib/types/Watcher.d.ts +19 -19
- package/lib/types/index.d.ts +26 -26
- package/lib/types/index.js +29 -29
- package/lib/types/schema/DataTypes.d.ts +34 -34
- package/lib/utils/SimpleConnector.d.ts +64 -64
- package/lib/utils/SimpleConnector.js +1 -1
- package/lib/utils/assert.d.ts +1 -0
- package/lib/utils/assert.js +9 -9
- package/lib/utils/concurrent.d.ts +15 -15
- package/lib/utils/concurrent.js +63 -63
- package/lib/utils/date.js +18 -18
- package/lib/utils/domain.d.ts +1 -1
- package/lib/utils/domain.js +11 -11
- package/lib/utils/geo.js +24 -24
- package/lib/utils/lodash.d.ts +24 -24
- package/lib/utils/lodash.js +46 -46
- package/lib/utils/mask.js +34 -34
- package/lib/utils/money.d.ts +6 -6
- package/lib/utils/money.js +51 -51
- package/lib/utils/projection.d.ts +4 -4
- package/lib/utils/projection.js +15 -15
- package/lib/utils/random/random.js +19 -19
- package/lib/utils/random/random.mp.js +14 -14
- package/lib/utils/random/random.native.d.ts +1 -1
- package/lib/utils/random/random.native.js +14 -14
- package/lib/utils/random/random.web.js +11 -11
- package/lib/utils/string.d.ts +28 -28
- package/lib/utils/string.js +69 -69
- package/lib/utils/url/index.d.ts +7 -7
- package/lib/utils/url/index.js +8 -8
- package/lib/utils/url/index.mp.d.ts +3 -3
- package/lib/utils/url/index.mp.js +8 -8
- package/lib/utils/url/index.native.d.ts +12 -12
- package/lib/utils/url/index.native.js +7 -7
- package/lib/utils/url/index.web.d.ts +12 -12
- package/lib/utils/url/index.web.js +7 -7
- package/lib/utils/url/whatwg-url/index.d.ts +3 -3
- package/lib/utils/url/whatwg-url/index.js +16 -16
- package/lib/utils/url/whatwg-url/lib/URL-impl.d.ts +20 -20
- package/lib/utils/url/whatwg-url/lib/URL-impl.js +175 -175
- package/lib/utils/url/whatwg-url/lib/URL.d.ts +1 -1
- package/lib/utils/url/whatwg-url/lib/URL.js +298 -298
- package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.d.ts +19 -19
- package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.js +126 -126
- package/lib/utils/url/whatwg-url/lib/URLSearchParams.d.ts +1 -1
- package/lib/utils/url/whatwg-url/lib/URLSearchParams.js +426 -426
- package/lib/utils/url/whatwg-url/lib/infra.d.ts +12 -12
- package/lib/utils/url/whatwg-url/lib/infra.js +25 -25
- package/lib/utils/url/whatwg-url/lib/url-state-machine.d.ts +24 -24
- package/lib/utils/url/whatwg-url/lib/url-state-machine.js +1238 -1238
- package/lib/utils/url/whatwg-url/lib/urlencoded.d.ts +15 -15
- package/lib/utils/url/whatwg-url/lib/urlencoded.js +162 -162
- package/lib/utils/url/whatwg-url/lib/utils.d.ts +37 -37
- package/lib/utils/url/whatwg-url/lib/utils.js +101 -101
- package/lib/utils/uuid.d.ts +17 -17
- package/lib/utils/uuid.js +218 -218
- package/lib/utils/validator.d.ts +26 -26
- package/lib/utils/validator.js +131 -131
- package/lib/utils/version.js +21 -21
- package/package.json +2 -1
package/lib/types/Entity.d.ts
CHANGED
|
@@ -1,209 +1,209 @@
|
|
|
1
|
-
import { OneOf } from '.';
|
|
2
|
-
import { ReadOnlyAction } from '../actions/action';
|
|
3
|
-
import { PrimaryKey, Sequence } from './DataType';
|
|
4
|
-
type TriggerDataAttributeType = '$$triggerData$$';
|
|
5
|
-
type TriggerUuidAttributeType = '$$triggerUuid$$';
|
|
6
|
-
type PrimaryKeyAttributeType = 'id';
|
|
7
|
-
type CreateAtAttributeType = '$$createAt$$';
|
|
8
|
-
type UpdateAtAttributeType = '$$updateAt$$';
|
|
9
|
-
type DeleteAtAttributeType = '$$deleteAt$$';
|
|
10
|
-
type SeqAttributeType = '$$seq$$';
|
|
11
|
-
export declare const TriggerDataAttribute = "$$triggerData$$";
|
|
12
|
-
export declare const TriggerUuidAttribute = "$$triggerUuid$$";
|
|
13
|
-
export declare const PrimaryKeyAttribute = "id";
|
|
14
|
-
export declare const CreateAtAttribute = "$$createAt$$";
|
|
15
|
-
export declare const UpdateAtAttribute = "$$updateAt$$";
|
|
16
|
-
export declare const DeleteAtAttribute = "$$deleteAt$$";
|
|
17
|
-
export declare const SeqAttribute = "$$seq$$";
|
|
18
|
-
export type InstinctiveAttributes = PrimaryKeyAttributeType | CreateAtAttributeType | UpdateAtAttributeType | DeleteAtAttributeType | TriggerDataAttributeType | SeqAttributeType | TriggerUuidAttributeType;
|
|
19
|
-
export declare const initinctiveAttributes: string[];
|
|
20
|
-
type FilterPart<A extends string, F extends Object | undefined> = {
|
|
21
|
-
filter?: A extends 'create' ? undefined : F;
|
|
22
|
-
indexFrom?: A extends 'create' ? undefined : number;
|
|
23
|
-
count?: A extends 'create' ? undefined : number;
|
|
24
|
-
};
|
|
25
|
-
export type SelectOption = {
|
|
26
|
-
dontCollect?: boolean;
|
|
27
|
-
blockTrigger?: true;
|
|
28
|
-
obscure?: boolean;
|
|
29
|
-
forUpdate?: true;
|
|
30
|
-
includedDeleted?: true;
|
|
31
|
-
ignoreAttrMiss?: true;
|
|
32
|
-
dummy?: 1;
|
|
33
|
-
};
|
|
34
|
-
export type OperateOption = {
|
|
35
|
-
blockTrigger?: true;
|
|
36
|
-
dontCollect?: boolean;
|
|
37
|
-
dontCreateOper?: boolean;
|
|
38
|
-
dontCreateModi?: boolean;
|
|
39
|
-
includedDeleted?: true;
|
|
40
|
-
allowExists?: boolean;
|
|
41
|
-
modiParentId?: string;
|
|
42
|
-
modiParentEntity?: string;
|
|
43
|
-
deletePhysically?: boolean;
|
|
44
|
-
applyingModi?: boolean;
|
|
45
|
-
dummy?: 1;
|
|
46
|
-
};
|
|
47
|
-
export type FormUpdateData<SH extends GeneralEntityShape> = Partial<{
|
|
48
|
-
[K in keyof Omit<SH, "id" | "$$createAt$$" | "$$seq$$">]: SH[K] | null;
|
|
49
|
-
}>;
|
|
50
|
-
export type FormCreateData<SH extends GeneralEntityShape> = Partial<SH> & {
|
|
51
|
-
id: string;
|
|
52
|
-
};
|
|
53
|
-
export type Operation<A extends string, D extends Projection, F extends Filter | undefined = undefined, S extends Sorter | undefined = undefined> = {
|
|
54
|
-
id: string;
|
|
55
|
-
action: A;
|
|
56
|
-
data: D;
|
|
57
|
-
sorter?: S;
|
|
58
|
-
} & FilterPart<A, F>;
|
|
59
|
-
export type Selection<A extends ReadOnlyAction, D extends Projection, F extends Filter | undefined = undefined, S extends Sorter | undefined = undefined> = {
|
|
60
|
-
id?: string;
|
|
61
|
-
action?: A;
|
|
62
|
-
data: D;
|
|
63
|
-
sorter?: S;
|
|
64
|
-
} & FilterPart<A, F> & {
|
|
65
|
-
randomRange?: number;
|
|
66
|
-
total?: number;
|
|
67
|
-
distinct?: true;
|
|
68
|
-
};
|
|
69
|
-
export interface EntityShape {
|
|
70
|
-
id: PrimaryKey;
|
|
71
|
-
$$seq$$: Sequence;
|
|
72
|
-
$$createAt$$: number | Date;
|
|
73
|
-
$$updateAt$$: number | Date;
|
|
74
|
-
$$deleteAt$$?: number | Date | null;
|
|
75
|
-
}
|
|
76
|
-
export interface GeneralEntityShape extends EntityShape {
|
|
77
|
-
[K: string]: any;
|
|
78
|
-
}
|
|
79
|
-
export type MakeAction<A extends string> = A;
|
|
80
|
-
export interface EntityDef {
|
|
81
|
-
Schema: GeneralEntityShape;
|
|
82
|
-
OpSchema: GeneralEntityShape;
|
|
83
|
-
Action: string;
|
|
84
|
-
ParticularAction?: string;
|
|
85
|
-
Selection: Selection<'select', Projection, Filter, Sorter>;
|
|
86
|
-
Aggregation: DeduceAggregation<Projection, Filter, Sorter>;
|
|
87
|
-
Operation: CUDOperation;
|
|
88
|
-
Create: CreateOperation;
|
|
89
|
-
CreateSingle: CreateSingleOperation;
|
|
90
|
-
CreateMulti: CreateMultipleOperation;
|
|
91
|
-
Update: UpdateOperation;
|
|
92
|
-
Remove: RemoveOperation;
|
|
93
|
-
Relation?: string;
|
|
94
|
-
}
|
|
95
|
-
export interface EntityDict {
|
|
96
|
-
[E: string]: EntityDef;
|
|
97
|
-
}
|
|
98
|
-
export interface OtmSubProjection extends Omit<Operation<'select', any, any, any>, 'action'> {
|
|
99
|
-
$entity: string;
|
|
100
|
-
}
|
|
101
|
-
export type AggregationOp = `#max-${number}` | `#min-${number}` | `#avg-${number}` | `#count-${number}` | `#sum-${number}`;
|
|
102
|
-
export type DeduceAggregationData<P extends Projection> = {
|
|
103
|
-
[A in AggregationOp]?: P;
|
|
104
|
-
} & OneOf<{
|
|
105
|
-
distinct?: true;
|
|
106
|
-
'#aggr'?: P;
|
|
107
|
-
}>;
|
|
108
|
-
export type AggregationResult<SH extends GeneralEntityShape> = Array<{
|
|
109
|
-
[A in AggregationOp]?: number | string;
|
|
110
|
-
} & {
|
|
111
|
-
'#data'?: Partial<SH>;
|
|
112
|
-
}>;
|
|
113
|
-
export type AttrFilter<SH extends GeneralEntityShape> = {
|
|
114
|
-
[K in keyof SH]?: any;
|
|
115
|
-
};
|
|
116
|
-
type SortAttr = {
|
|
117
|
-
[K: string]: any;
|
|
118
|
-
};
|
|
119
|
-
type SorterItem = {
|
|
120
|
-
$attr: SortAttr;
|
|
121
|
-
$direction?: "asc" | "desc";
|
|
122
|
-
};
|
|
123
|
-
type Sorter = Array<SorterItem>;
|
|
124
|
-
type Filter = {
|
|
125
|
-
[K: string]: any;
|
|
126
|
-
};
|
|
127
|
-
type Projection = {
|
|
128
|
-
[K: string]: any;
|
|
129
|
-
};
|
|
130
|
-
export type DeduceAggregation<P extends Projection, F extends Filter, S extends Sorter> = Omit<Selection<'aggregate', DeduceAggregationData<P>, F, S>, 'action'>;
|
|
131
|
-
type CreateOperationData = {
|
|
132
|
-
id: string;
|
|
133
|
-
[K: string]: any;
|
|
134
|
-
};
|
|
135
|
-
type CreateSingleOperation = Operation<'create', CreateOperationData, undefined, undefined>;
|
|
136
|
-
type CreateMultipleOperation = Operation<'create', Array<CreateOperationData>, undefined, undefined>;
|
|
137
|
-
type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
138
|
-
type UpdateOperationData = {
|
|
139
|
-
id?: never;
|
|
140
|
-
[k: string]: any;
|
|
141
|
-
};
|
|
142
|
-
export type UpdateOperation = Operation<string, UpdateOperationData, Filter, Sorter>;
|
|
143
|
-
type RemoveOperationData = {
|
|
144
|
-
[k: string]: any;
|
|
145
|
-
};
|
|
146
|
-
export type RemoveOperation = Operation<'remove', RemoveOperationData, Filter, Sorter>;
|
|
147
|
-
export type CUDOperation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
148
|
-
export type CreateOpResult<ED extends EntityDict, T extends keyof ED> = {
|
|
149
|
-
id?: string;
|
|
150
|
-
a: 'c';
|
|
151
|
-
e: T;
|
|
152
|
-
d: ED[T]['OpSchema'] | ED[T]['OpSchema'][];
|
|
153
|
-
};
|
|
154
|
-
export type UpdateOpResult<ED extends EntityDict, T extends keyof ED> = {
|
|
155
|
-
id?: string;
|
|
156
|
-
a: 'u';
|
|
157
|
-
e: T;
|
|
158
|
-
d: UpdateOperationData;
|
|
159
|
-
f?: Filter;
|
|
160
|
-
};
|
|
161
|
-
export type RemoveOpResult<ED extends EntityDict, T extends keyof ED> = {
|
|
162
|
-
id?: string;
|
|
163
|
-
a: 'r';
|
|
164
|
-
e: T;
|
|
165
|
-
f?: Filter;
|
|
166
|
-
};
|
|
167
|
-
export type RelationHierarchy<R extends string> = {
|
|
168
|
-
[K in R]?: R[];
|
|
169
|
-
};
|
|
170
|
-
export type CascadeRelationItem = {
|
|
171
|
-
cascadePath: string;
|
|
172
|
-
relations?: string[];
|
|
173
|
-
};
|
|
174
|
-
export type CascadeRelationAuth<R extends string> = {
|
|
175
|
-
[K in R]?: CascadeRelationItem | (CascadeRelationItem | CascadeRelationItem[])[];
|
|
176
|
-
};
|
|
177
|
-
export type SelectOpResult<ED extends EntityDict> = {
|
|
178
|
-
a: 's';
|
|
179
|
-
d: {
|
|
180
|
-
[T in keyof ED]?: {
|
|
181
|
-
[ID: string]: Partial<ED[T]['OpSchema']>;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
export type OpRecord<ED extends EntityDict> = CreateOpResult<ED, keyof ED> | UpdateOpResult<ED, keyof ED> | RemoveOpResult<ED, keyof ED> | SelectOpResult<ED>;
|
|
186
|
-
export type OperationResult<ED extends EntityDict> = {
|
|
187
|
-
[K in keyof ED]?: {
|
|
188
|
-
[A in ED[K]['Action']]?: number;
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
export type ActionType = 'readOnly' | 'appendOnly' | 'excludeUpdate' | 'excludeRemove' | 'crud';
|
|
192
|
-
export type Configuration = {
|
|
193
|
-
actionType?: ActionType;
|
|
194
|
-
static?: boolean;
|
|
195
|
-
};
|
|
196
|
-
export type AuthDeduceRelationMap<ED extends EntityDict> = {
|
|
197
|
-
[T in keyof ED]?: keyof ED[T]['OpSchema'];
|
|
198
|
-
};
|
|
199
|
-
export type SelectFreeEntities<ED extends EntityDict> = (keyof ED)[];
|
|
200
|
-
export type UpdateFreeDict<ED extends EntityDict> = {
|
|
201
|
-
[A in keyof ED]?: string[];
|
|
202
|
-
};
|
|
203
|
-
export type OtmKey<K extends string> = K | `${K}$${number}`;
|
|
204
|
-
export interface SubDataDef<ED extends EntityDict, T extends keyof ED> {
|
|
205
|
-
id: string;
|
|
206
|
-
entity: T;
|
|
207
|
-
filter: ED[T]['Selection']['filter'];
|
|
208
|
-
}
|
|
209
|
-
export {};
|
|
1
|
+
import { OneOf } from '.';
|
|
2
|
+
import { ReadOnlyAction } from '../actions/action';
|
|
3
|
+
import { PrimaryKey, Sequence } from './DataType';
|
|
4
|
+
type TriggerDataAttributeType = '$$triggerData$$';
|
|
5
|
+
type TriggerUuidAttributeType = '$$triggerUuid$$';
|
|
6
|
+
type PrimaryKeyAttributeType = 'id';
|
|
7
|
+
type CreateAtAttributeType = '$$createAt$$';
|
|
8
|
+
type UpdateAtAttributeType = '$$updateAt$$';
|
|
9
|
+
type DeleteAtAttributeType = '$$deleteAt$$';
|
|
10
|
+
type SeqAttributeType = '$$seq$$';
|
|
11
|
+
export declare const TriggerDataAttribute = "$$triggerData$$";
|
|
12
|
+
export declare const TriggerUuidAttribute = "$$triggerUuid$$";
|
|
13
|
+
export declare const PrimaryKeyAttribute = "id";
|
|
14
|
+
export declare const CreateAtAttribute = "$$createAt$$";
|
|
15
|
+
export declare const UpdateAtAttribute = "$$updateAt$$";
|
|
16
|
+
export declare const DeleteAtAttribute = "$$deleteAt$$";
|
|
17
|
+
export declare const SeqAttribute = "$$seq$$";
|
|
18
|
+
export type InstinctiveAttributes = PrimaryKeyAttributeType | CreateAtAttributeType | UpdateAtAttributeType | DeleteAtAttributeType | TriggerDataAttributeType | SeqAttributeType | TriggerUuidAttributeType;
|
|
19
|
+
export declare const initinctiveAttributes: string[];
|
|
20
|
+
type FilterPart<A extends string, F extends Object | undefined> = {
|
|
21
|
+
filter?: A extends 'create' ? undefined : F;
|
|
22
|
+
indexFrom?: A extends 'create' ? undefined : number;
|
|
23
|
+
count?: A extends 'create' ? undefined : number;
|
|
24
|
+
};
|
|
25
|
+
export type SelectOption = {
|
|
26
|
+
dontCollect?: boolean;
|
|
27
|
+
blockTrigger?: true;
|
|
28
|
+
obscure?: boolean;
|
|
29
|
+
forUpdate?: true;
|
|
30
|
+
includedDeleted?: true;
|
|
31
|
+
ignoreAttrMiss?: true;
|
|
32
|
+
dummy?: 1;
|
|
33
|
+
};
|
|
34
|
+
export type OperateOption = {
|
|
35
|
+
blockTrigger?: true;
|
|
36
|
+
dontCollect?: boolean;
|
|
37
|
+
dontCreateOper?: boolean;
|
|
38
|
+
dontCreateModi?: boolean;
|
|
39
|
+
includedDeleted?: true;
|
|
40
|
+
allowExists?: boolean;
|
|
41
|
+
modiParentId?: string;
|
|
42
|
+
modiParentEntity?: string;
|
|
43
|
+
deletePhysically?: boolean;
|
|
44
|
+
applyingModi?: boolean;
|
|
45
|
+
dummy?: 1;
|
|
46
|
+
};
|
|
47
|
+
export type FormUpdateData<SH extends GeneralEntityShape> = Partial<{
|
|
48
|
+
[K in keyof Omit<SH, "id" | "$$createAt$$" | "$$seq$$">]: SH[K] | null;
|
|
49
|
+
}>;
|
|
50
|
+
export type FormCreateData<SH extends GeneralEntityShape> = Partial<SH> & {
|
|
51
|
+
id: string;
|
|
52
|
+
};
|
|
53
|
+
export type Operation<A extends string, D extends Projection, F extends Filter | undefined = undefined, S extends Sorter | undefined = undefined> = {
|
|
54
|
+
id: string;
|
|
55
|
+
action: A;
|
|
56
|
+
data: D;
|
|
57
|
+
sorter?: S;
|
|
58
|
+
} & FilterPart<A, F>;
|
|
59
|
+
export type Selection<A extends ReadOnlyAction, D extends Projection, F extends Filter | undefined = undefined, S extends Sorter | undefined = undefined> = {
|
|
60
|
+
id?: string;
|
|
61
|
+
action?: A;
|
|
62
|
+
data: D;
|
|
63
|
+
sorter?: S;
|
|
64
|
+
} & FilterPart<A, F> & {
|
|
65
|
+
randomRange?: number;
|
|
66
|
+
total?: number;
|
|
67
|
+
distinct?: true;
|
|
68
|
+
};
|
|
69
|
+
export interface EntityShape {
|
|
70
|
+
id: PrimaryKey;
|
|
71
|
+
$$seq$$: Sequence;
|
|
72
|
+
$$createAt$$: number | Date;
|
|
73
|
+
$$updateAt$$: number | Date;
|
|
74
|
+
$$deleteAt$$?: number | Date | null;
|
|
75
|
+
}
|
|
76
|
+
export interface GeneralEntityShape extends EntityShape {
|
|
77
|
+
[K: string]: any;
|
|
78
|
+
}
|
|
79
|
+
export type MakeAction<A extends string> = A;
|
|
80
|
+
export interface EntityDef {
|
|
81
|
+
Schema: GeneralEntityShape;
|
|
82
|
+
OpSchema: GeneralEntityShape;
|
|
83
|
+
Action: string;
|
|
84
|
+
ParticularAction?: string;
|
|
85
|
+
Selection: Selection<'select', Projection, Filter, Sorter>;
|
|
86
|
+
Aggregation: DeduceAggregation<Projection, Filter, Sorter>;
|
|
87
|
+
Operation: CUDOperation;
|
|
88
|
+
Create: CreateOperation;
|
|
89
|
+
CreateSingle: CreateSingleOperation;
|
|
90
|
+
CreateMulti: CreateMultipleOperation;
|
|
91
|
+
Update: UpdateOperation;
|
|
92
|
+
Remove: RemoveOperation;
|
|
93
|
+
Relation?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface EntityDict {
|
|
96
|
+
[E: string]: EntityDef;
|
|
97
|
+
}
|
|
98
|
+
export interface OtmSubProjection extends Omit<Operation<'select', any, any, any>, 'action'> {
|
|
99
|
+
$entity: string;
|
|
100
|
+
}
|
|
101
|
+
export type AggregationOp = `#max-${number}` | `#min-${number}` | `#avg-${number}` | `#count-${number}` | `#sum-${number}`;
|
|
102
|
+
export type DeduceAggregationData<P extends Projection> = {
|
|
103
|
+
[A in AggregationOp]?: P;
|
|
104
|
+
} & OneOf<{
|
|
105
|
+
distinct?: true;
|
|
106
|
+
'#aggr'?: P;
|
|
107
|
+
}>;
|
|
108
|
+
export type AggregationResult<SH extends GeneralEntityShape> = Array<{
|
|
109
|
+
[A in AggregationOp]?: number | string;
|
|
110
|
+
} & {
|
|
111
|
+
'#data'?: Partial<SH>;
|
|
112
|
+
}>;
|
|
113
|
+
export type AttrFilter<SH extends GeneralEntityShape> = {
|
|
114
|
+
[K in keyof SH]?: any;
|
|
115
|
+
};
|
|
116
|
+
type SortAttr = {
|
|
117
|
+
[K: string]: any;
|
|
118
|
+
};
|
|
119
|
+
type SorterItem = {
|
|
120
|
+
$attr: SortAttr;
|
|
121
|
+
$direction?: "asc" | "desc";
|
|
122
|
+
};
|
|
123
|
+
type Sorter = Array<SorterItem>;
|
|
124
|
+
type Filter = {
|
|
125
|
+
[K: string]: any;
|
|
126
|
+
};
|
|
127
|
+
type Projection = {
|
|
128
|
+
[K: string]: any;
|
|
129
|
+
};
|
|
130
|
+
export type DeduceAggregation<P extends Projection, F extends Filter, S extends Sorter> = Omit<Selection<'aggregate', DeduceAggregationData<P>, F, S>, 'action'>;
|
|
131
|
+
type CreateOperationData = {
|
|
132
|
+
id: string;
|
|
133
|
+
[K: string]: any;
|
|
134
|
+
};
|
|
135
|
+
type CreateSingleOperation = Operation<'create', CreateOperationData, undefined, undefined>;
|
|
136
|
+
type CreateMultipleOperation = Operation<'create', Array<CreateOperationData>, undefined, undefined>;
|
|
137
|
+
type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
138
|
+
type UpdateOperationData = {
|
|
139
|
+
id?: never;
|
|
140
|
+
[k: string]: any;
|
|
141
|
+
};
|
|
142
|
+
export type UpdateOperation = Operation<string, UpdateOperationData, Filter, Sorter>;
|
|
143
|
+
type RemoveOperationData = {
|
|
144
|
+
[k: string]: any;
|
|
145
|
+
};
|
|
146
|
+
export type RemoveOperation = Operation<'remove', RemoveOperationData, Filter, Sorter>;
|
|
147
|
+
export type CUDOperation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
148
|
+
export type CreateOpResult<ED extends EntityDict, T extends keyof ED> = {
|
|
149
|
+
id?: string;
|
|
150
|
+
a: 'c';
|
|
151
|
+
e: T;
|
|
152
|
+
d: ED[T]['OpSchema'] | ED[T]['OpSchema'][];
|
|
153
|
+
};
|
|
154
|
+
export type UpdateOpResult<ED extends EntityDict, T extends keyof ED> = {
|
|
155
|
+
id?: string;
|
|
156
|
+
a: 'u';
|
|
157
|
+
e: T;
|
|
158
|
+
d: UpdateOperationData;
|
|
159
|
+
f?: Filter;
|
|
160
|
+
};
|
|
161
|
+
export type RemoveOpResult<ED extends EntityDict, T extends keyof ED> = {
|
|
162
|
+
id?: string;
|
|
163
|
+
a: 'r';
|
|
164
|
+
e: T;
|
|
165
|
+
f?: Filter;
|
|
166
|
+
};
|
|
167
|
+
export type RelationHierarchy<R extends string> = {
|
|
168
|
+
[K in R]?: R[];
|
|
169
|
+
};
|
|
170
|
+
export type CascadeRelationItem = {
|
|
171
|
+
cascadePath: string;
|
|
172
|
+
relations?: string[];
|
|
173
|
+
};
|
|
174
|
+
export type CascadeRelationAuth<R extends string> = {
|
|
175
|
+
[K in R]?: CascadeRelationItem | (CascadeRelationItem | CascadeRelationItem[])[];
|
|
176
|
+
};
|
|
177
|
+
export type SelectOpResult<ED extends EntityDict> = {
|
|
178
|
+
a: 's';
|
|
179
|
+
d: {
|
|
180
|
+
[T in keyof ED]?: {
|
|
181
|
+
[ID: string]: Partial<ED[T]['OpSchema']>;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
export type OpRecord<ED extends EntityDict> = CreateOpResult<ED, keyof ED> | UpdateOpResult<ED, keyof ED> | RemoveOpResult<ED, keyof ED> | SelectOpResult<ED>;
|
|
186
|
+
export type OperationResult<ED extends EntityDict> = {
|
|
187
|
+
[K in keyof ED]?: {
|
|
188
|
+
[A in ED[K]['Action']]?: number;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
export type ActionType = 'readOnly' | 'appendOnly' | 'excludeUpdate' | 'excludeRemove' | 'crud';
|
|
192
|
+
export type Configuration = {
|
|
193
|
+
actionType?: ActionType;
|
|
194
|
+
static?: boolean;
|
|
195
|
+
};
|
|
196
|
+
export type AuthDeduceRelationMap<ED extends EntityDict> = {
|
|
197
|
+
[T in keyof ED]?: keyof ED[T]['OpSchema'];
|
|
198
|
+
};
|
|
199
|
+
export type SelectFreeEntities<ED extends EntityDict> = (keyof ED)[];
|
|
200
|
+
export type UpdateFreeDict<ED extends EntityDict> = {
|
|
201
|
+
[A in keyof ED]?: string[];
|
|
202
|
+
};
|
|
203
|
+
export type OtmKey<K extends string> = K | `${K}$${number}`;
|
|
204
|
+
export interface SubDataDef<ED extends EntityDict, T extends keyof ED> {
|
|
205
|
+
id: string;
|
|
206
|
+
entity: T;
|
|
207
|
+
filter: ED[T]['Selection']['filter'];
|
|
208
|
+
}
|
|
209
|
+
export {};
|
package/lib/types/Entity.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initinctiveAttributes = exports.SeqAttribute = exports.DeleteAtAttribute = exports.UpdateAtAttribute = exports.CreateAtAttribute = exports.PrimaryKeyAttribute = exports.TriggerUuidAttribute = exports.TriggerDataAttribute = void 0;
|
|
4
|
-
exports.TriggerDataAttribute = '$$triggerData$$';
|
|
5
|
-
exports.TriggerUuidAttribute = '$$triggerUuid$$';
|
|
6
|
-
exports.PrimaryKeyAttribute = 'id';
|
|
7
|
-
exports.CreateAtAttribute = '$$createAt$$';
|
|
8
|
-
exports.UpdateAtAttribute = '$$updateAt$$';
|
|
9
|
-
exports.DeleteAtAttribute = '$$deleteAt$$';
|
|
10
|
-
exports.SeqAttribute = '$$seq$$';
|
|
11
|
-
exports.initinctiveAttributes = [exports.PrimaryKeyAttribute, exports.TriggerDataAttribute, exports.TriggerUuidAttribute, exports.CreateAtAttribute, exports.UpdateAtAttribute, exports.DeleteAtAttribute, exports.SeqAttribute];
|
|
12
|
-
;
|
|
13
|
-
;
|
|
14
|
-
;
|
|
15
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initinctiveAttributes = exports.SeqAttribute = exports.DeleteAtAttribute = exports.UpdateAtAttribute = exports.CreateAtAttribute = exports.PrimaryKeyAttribute = exports.TriggerUuidAttribute = exports.TriggerDataAttribute = void 0;
|
|
4
|
+
exports.TriggerDataAttribute = '$$triggerData$$';
|
|
5
|
+
exports.TriggerUuidAttribute = '$$triggerUuid$$';
|
|
6
|
+
exports.PrimaryKeyAttribute = 'id';
|
|
7
|
+
exports.CreateAtAttribute = '$$createAt$$';
|
|
8
|
+
exports.UpdateAtAttribute = '$$updateAt$$';
|
|
9
|
+
exports.DeleteAtAttribute = '$$deleteAt$$';
|
|
10
|
+
exports.SeqAttribute = '$$seq$$';
|
|
11
|
+
exports.initinctiveAttributes = [exports.PrimaryKeyAttribute, exports.TriggerDataAttribute, exports.TriggerUuidAttribute, exports.CreateAtAttribute, exports.UpdateAtAttribute, exports.DeleteAtAttribute, exports.SeqAttribute];
|
|
12
|
+
;
|
|
13
|
+
;
|
|
14
|
+
;
|
|
15
|
+
;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LocaleDef } from './Locale';
|
|
2
|
-
import { Index } from './Storage';
|
|
3
|
-
import { EntityShape, Configuration } from './Entity';
|
|
4
|
-
export type EntityDesc<Schema extends EntityShape, Action extends string = '', Relation extends string = '', V extends Record<string, string> = {}> = {
|
|
5
|
-
locales: LocaleDef<Schema, Action, Relation, V>;
|
|
6
|
-
indexes?: Index<Schema>[];
|
|
7
|
-
configuration?: Configuration;
|
|
8
|
-
recursiveDepth?: number;
|
|
9
|
-
};
|
|
1
|
+
import { LocaleDef } from './Locale';
|
|
2
|
+
import { Index } from './Storage';
|
|
3
|
+
import { EntityShape, Configuration } from './Entity';
|
|
4
|
+
export type EntityDesc<Schema extends EntityShape, Action extends string = '', Relation extends string = '', V extends Record<string, string> = {}> = {
|
|
5
|
+
locales: LocaleDef<Schema, Action, Relation, V>;
|
|
6
|
+
indexes?: Index<Schema>[];
|
|
7
|
+
configuration?: Configuration;
|
|
8
|
+
recursiveDepth?: number;
|
|
9
|
+
};
|
package/lib/types/EntityDesc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
export type WechatMpEnv = {
|
|
2
|
-
type: 'wechatMp';
|
|
3
|
-
brand: string;
|
|
4
|
-
model: string;
|
|
5
|
-
pixelRatio: number;
|
|
6
|
-
screenWidth: number;
|
|
7
|
-
screenHeight: number;
|
|
8
|
-
windowWidth: number;
|
|
9
|
-
windowHeight: number;
|
|
10
|
-
statusBarHeight: number;
|
|
11
|
-
language: string;
|
|
12
|
-
version: string;
|
|
13
|
-
system: string;
|
|
14
|
-
platform: string;
|
|
15
|
-
fontSizeSetting: number;
|
|
16
|
-
SDKVersion: string;
|
|
17
|
-
benchmarkLevel: number;
|
|
18
|
-
albumAuthorized?: boolean;
|
|
19
|
-
cameraAuthorized: boolean;
|
|
20
|
-
locationAuthorized: boolean;
|
|
21
|
-
microphoneAuthorized: boolean;
|
|
22
|
-
notificationAuthorized: boolean;
|
|
23
|
-
notificationAlertAuthorized?: boolean;
|
|
24
|
-
notificationBadgeAuthorized?: boolean;
|
|
25
|
-
notificationSoundAuthorized?: boolean;
|
|
26
|
-
phoneCalendarAuthorized: boolean;
|
|
27
|
-
bluetoothEnabled: boolean;
|
|
28
|
-
locationEnabled: boolean;
|
|
29
|
-
wifiEnabled: boolean;
|
|
30
|
-
locationReducedAccuracy?: boolean;
|
|
31
|
-
theme?: 'light' | 'dark';
|
|
32
|
-
enableDebug: boolean;
|
|
33
|
-
deviceOrientation: 'portrait' | 'landscape';
|
|
34
|
-
localStorageEnabled: true;
|
|
35
|
-
};
|
|
36
|
-
export type WebEnv = {
|
|
37
|
-
type: 'web';
|
|
38
|
-
visitorId: string;
|
|
39
|
-
platform: {
|
|
40
|
-
value: string;
|
|
41
|
-
};
|
|
42
|
-
timezone: {
|
|
43
|
-
value: string;
|
|
44
|
-
};
|
|
45
|
-
vendor: {
|
|
46
|
-
value: string;
|
|
47
|
-
};
|
|
48
|
-
vendorFlavors: {
|
|
49
|
-
value: string[];
|
|
50
|
-
};
|
|
51
|
-
language: string;
|
|
52
|
-
localStorageEnabled: boolean;
|
|
53
|
-
};
|
|
54
|
-
export type ServerEnv = {
|
|
55
|
-
type: 'server';
|
|
56
|
-
};
|
|
57
|
-
export type NativeEnv = {
|
|
58
|
-
constants: {
|
|
59
|
-
isTesting: boolean;
|
|
60
|
-
reactNativeVersion: object;
|
|
61
|
-
Version?: number;
|
|
62
|
-
Release?: string;
|
|
63
|
-
Serial?: string;
|
|
64
|
-
Fingerprint?: string;
|
|
65
|
-
Model?: string;
|
|
66
|
-
Brand?: string;
|
|
67
|
-
Manufacture?: string;
|
|
68
|
-
ServerHost?: string;
|
|
69
|
-
uiMode?: 'car' | 'desk' | 'normal' | 'tv' | 'watch' | 'unknown';
|
|
70
|
-
forceTouchAvailable?: boolean;
|
|
71
|
-
interfaceIdiom?: string;
|
|
72
|
-
osVersion?: string;
|
|
73
|
-
systemName?: string;
|
|
74
|
-
};
|
|
75
|
-
isPad: boolean;
|
|
76
|
-
isTesting: boolean;
|
|
77
|
-
OS: 'android' | 'ios';
|
|
78
|
-
Version: number | string;
|
|
79
|
-
language: string;
|
|
80
|
-
visitorId: string;
|
|
81
|
-
type: 'native';
|
|
82
|
-
};
|
|
83
|
-
export type Environment = WechatMpEnv | WebEnv | ServerEnv | NativeEnv;
|
|
84
|
-
export type BriefEnv = {
|
|
85
|
-
system: string;
|
|
86
|
-
brand?: string;
|
|
87
|
-
model?: string;
|
|
88
|
-
wechat?: string;
|
|
89
|
-
explorer?: string;
|
|
90
|
-
};
|
|
1
|
+
export type WechatMpEnv = {
|
|
2
|
+
type: 'wechatMp';
|
|
3
|
+
brand: string;
|
|
4
|
+
model: string;
|
|
5
|
+
pixelRatio: number;
|
|
6
|
+
screenWidth: number;
|
|
7
|
+
screenHeight: number;
|
|
8
|
+
windowWidth: number;
|
|
9
|
+
windowHeight: number;
|
|
10
|
+
statusBarHeight: number;
|
|
11
|
+
language: string;
|
|
12
|
+
version: string;
|
|
13
|
+
system: string;
|
|
14
|
+
platform: string;
|
|
15
|
+
fontSizeSetting: number;
|
|
16
|
+
SDKVersion: string;
|
|
17
|
+
benchmarkLevel: number;
|
|
18
|
+
albumAuthorized?: boolean;
|
|
19
|
+
cameraAuthorized: boolean;
|
|
20
|
+
locationAuthorized: boolean;
|
|
21
|
+
microphoneAuthorized: boolean;
|
|
22
|
+
notificationAuthorized: boolean;
|
|
23
|
+
notificationAlertAuthorized?: boolean;
|
|
24
|
+
notificationBadgeAuthorized?: boolean;
|
|
25
|
+
notificationSoundAuthorized?: boolean;
|
|
26
|
+
phoneCalendarAuthorized: boolean;
|
|
27
|
+
bluetoothEnabled: boolean;
|
|
28
|
+
locationEnabled: boolean;
|
|
29
|
+
wifiEnabled: boolean;
|
|
30
|
+
locationReducedAccuracy?: boolean;
|
|
31
|
+
theme?: 'light' | 'dark';
|
|
32
|
+
enableDebug: boolean;
|
|
33
|
+
deviceOrientation: 'portrait' | 'landscape';
|
|
34
|
+
localStorageEnabled: true;
|
|
35
|
+
};
|
|
36
|
+
export type WebEnv = {
|
|
37
|
+
type: 'web';
|
|
38
|
+
visitorId: string;
|
|
39
|
+
platform: {
|
|
40
|
+
value: string;
|
|
41
|
+
};
|
|
42
|
+
timezone: {
|
|
43
|
+
value: string;
|
|
44
|
+
};
|
|
45
|
+
vendor: {
|
|
46
|
+
value: string;
|
|
47
|
+
};
|
|
48
|
+
vendorFlavors: {
|
|
49
|
+
value: string[];
|
|
50
|
+
};
|
|
51
|
+
language: string;
|
|
52
|
+
localStorageEnabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type ServerEnv = {
|
|
55
|
+
type: 'server';
|
|
56
|
+
};
|
|
57
|
+
export type NativeEnv = {
|
|
58
|
+
constants: {
|
|
59
|
+
isTesting: boolean;
|
|
60
|
+
reactNativeVersion: object;
|
|
61
|
+
Version?: number;
|
|
62
|
+
Release?: string;
|
|
63
|
+
Serial?: string;
|
|
64
|
+
Fingerprint?: string;
|
|
65
|
+
Model?: string;
|
|
66
|
+
Brand?: string;
|
|
67
|
+
Manufacture?: string;
|
|
68
|
+
ServerHost?: string;
|
|
69
|
+
uiMode?: 'car' | 'desk' | 'normal' | 'tv' | 'watch' | 'unknown';
|
|
70
|
+
forceTouchAvailable?: boolean;
|
|
71
|
+
interfaceIdiom?: string;
|
|
72
|
+
osVersion?: string;
|
|
73
|
+
systemName?: string;
|
|
74
|
+
};
|
|
75
|
+
isPad: boolean;
|
|
76
|
+
isTesting: boolean;
|
|
77
|
+
OS: 'android' | 'ios';
|
|
78
|
+
Version: number | string;
|
|
79
|
+
language: string;
|
|
80
|
+
visitorId: string;
|
|
81
|
+
type: 'native';
|
|
82
|
+
};
|
|
83
|
+
export type Environment = WechatMpEnv | WebEnv | ServerEnv | NativeEnv;
|
|
84
|
+
export type BriefEnv = {
|
|
85
|
+
system: string;
|
|
86
|
+
brand?: string;
|
|
87
|
+
model?: string;
|
|
88
|
+
wechat?: string;
|
|
89
|
+
explorer?: string;
|
|
90
|
+
};
|
package/lib/types/Environment.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|