couchdb-web-node-plugin 1.0.592 → 1.0.594
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/package.json +1 -1
- package/type.d.ts +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "couchdb-web-node-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.594",
|
|
4
4
|
"description": "A couchdb server, model instance conflict handler, rest api, authentication, session management, schema validator and model relation guarantee for webNode.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
package/type.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface SelectionMapping {
|
|
|
61
61
|
label: string;
|
|
62
62
|
value: unknown;
|
|
63
63
|
}
|
|
64
|
-
export interface PropertySpecification<Type = unknown> {
|
|
64
|
+
export interface PropertySpecification<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> {
|
|
65
65
|
allowedRoles?: AllowedRoles | null;
|
|
66
66
|
computed?: boolean;
|
|
67
67
|
arrayConstraintExecution?: Constraint | null;
|
|
@@ -102,9 +102,10 @@ export interface PropertySpecification<Type = unknown> {
|
|
|
102
102
|
index?: boolean | null;
|
|
103
103
|
oldName?: Array<string> | null | string;
|
|
104
104
|
value?: null | Type;
|
|
105
|
+
additionalSpecifications?: AdditionalSpecifications;
|
|
105
106
|
}
|
|
106
|
-
export interface FileSpecification<Type = Attachment> extends PropertySpecification<Type> {
|
|
107
|
-
fileName?: PropertySpecification<string>;
|
|
107
|
+
export interface FileSpecification<Type = Attachment, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> extends PropertySpecification<Type, AdditionalSpecifications> {
|
|
108
|
+
fileName?: PropertySpecification<string, AdditionalSpecifications>;
|
|
108
109
|
}
|
|
109
110
|
export interface BaseModel {
|
|
110
111
|
_allowedRoles?: AllowedRoles | null;
|
|
@@ -120,7 +121,7 @@ export interface BaseModel {
|
|
|
120
121
|
_onUpdateExecution?: null | string;
|
|
121
122
|
_onUpdateExpression?: null | string;
|
|
122
123
|
}
|
|
123
|
-
export type Model<Type = unknown> = BaseModel & Mapping<PropertySpecification<Type>>;
|
|
124
|
+
export type Model<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> = BaseModel & Mapping<PropertySpecification<Type, AdditionalSpecifications>>;
|
|
124
125
|
export type Models = Mapping<Model>;
|
|
125
126
|
export type UpdateStrategy = '' | 'fillUp' | 'incremental' | 'migrate';
|
|
126
127
|
export type DocumentContent = Array<DocumentContent> | PlainObject | Primitive;
|
|
@@ -174,10 +175,10 @@ export interface PropertyNameConfiguration {
|
|
|
174
175
|
};
|
|
175
176
|
validatedDocumentsCache: string;
|
|
176
177
|
}
|
|
177
|
-
export interface BaseModelConfiguration<Type = unknown> {
|
|
178
|
+
export interface BaseModelConfiguration<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> {
|
|
178
179
|
dateTimeFormat: 'iso' | 'iso8601' | 'number';
|
|
179
180
|
property: {
|
|
180
|
-
defaultSpecification: PropertySpecification<Type>;
|
|
181
|
+
defaultSpecification: PropertySpecification<Type, AdditionalSpecifications>;
|
|
181
182
|
name: PropertyNameConfiguration;
|
|
182
183
|
};
|
|
183
184
|
updateStrategy: UpdateStrategy;
|
|
@@ -328,8 +329,8 @@ export interface BasicScope<Type = unknown> {
|
|
|
328
329
|
securitySettings: Partial<SecuritySettings>;
|
|
329
330
|
userContext: Partial<UserContext>;
|
|
330
331
|
}
|
|
331
|
-
export interface CommonScope<Type> {
|
|
332
|
-
checkPropertyContent: (newValue: unknown, name: string, propertySpecification: PropertySpecification<Type>, oldValue: unknown) => CheckedPropertyResult;
|
|
332
|
+
export interface CommonScope<Type, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> {
|
|
333
|
+
checkPropertyContent: (newValue: unknown, name: string, propertySpecification: PropertySpecification<Type, AdditionalSpecifications>, oldValue: unknown) => CheckedPropertyResult;
|
|
333
334
|
model: Model<Type>;
|
|
334
335
|
modelName: string;
|
|
335
336
|
type: Array<string> | string;
|
|
@@ -338,11 +339,11 @@ export interface CommonScope<Type> {
|
|
|
338
339
|
parentNames: Array<string>;
|
|
339
340
|
pathDescription: string;
|
|
340
341
|
}
|
|
341
|
-
export interface PropertyScope<Type = unknown> extends CommonScope<Type> {
|
|
342
|
+
export interface PropertyScope<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> extends CommonScope<Type, AdditionalSpecifications> {
|
|
342
343
|
name: string;
|
|
343
344
|
newValue: Type;
|
|
344
345
|
oldValue: Type;
|
|
345
|
-
propertySpecification: PropertySpecification<Type>;
|
|
346
|
+
propertySpecification: PropertySpecification<Type, AdditionalSpecifications>;
|
|
346
347
|
}
|
|
347
348
|
export interface EvaluationResult<T = unknown, S = BasicScope<T> & CommonScope<T>> {
|
|
348
349
|
code: string;
|