couchdb-web-node-plugin 1.0.601 → 1.0.603
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 +23 -23
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.603",
|
|
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
|
@@ -15,25 +15,25 @@ export type Attachments = PouchDB.Core.Attachments;
|
|
|
15
15
|
export type FullAttachment = PouchDB.Core.FullAttachment;
|
|
16
16
|
export type StubAttachment = PouchDB.Core.StubAttachment;
|
|
17
17
|
export type ChangesMeta = PouchDB.Core.ChangesMeta;
|
|
18
|
-
export type ChangesResponseChange<Type extends
|
|
19
|
-
export type ChangesStream<Type extends
|
|
18
|
+
export type ChangesResponseChange<Type extends object = Mapping<unknown>> = PouchDB.Core.ChangesResponseChange<Type>;
|
|
19
|
+
export type ChangesStream<Type extends object = Mapping<unknown>> = PouchDB.Core.Changes<Type>;
|
|
20
20
|
export type ChangesStreamOptions = PouchDB.Core.ChangesOptions;
|
|
21
|
-
export type Connection<Type extends
|
|
21
|
+
export type Connection<Type extends object = Mapping<unknown>> = PouchDB.Database<Type>;
|
|
22
22
|
export type Connector = PouchDB.Static;
|
|
23
23
|
export type DatabaseConnectorConfiguration = PouchDB.Configuration.RemoteDatabaseConfiguration;
|
|
24
24
|
export type DatabaseError = PouchDB.Core.Error;
|
|
25
25
|
export type DatabaseFetch = PouchDB.Core.Options['fetch'];
|
|
26
26
|
export type DatabaseResponse = PouchDB.Core.Response;
|
|
27
|
-
export type Document<Type extends
|
|
28
|
-
export type ExistingDocument<Type extends
|
|
27
|
+
export type Document<Type extends object = PlainObject> = PouchDB.Core.Document<Type>;
|
|
28
|
+
export type ExistingDocument<Type extends object = PlainObject> = PouchDB.Core.ExistingDocument<Type>;
|
|
29
29
|
export type DocumentGetMeta = PouchDB.Core.GetMeta;
|
|
30
30
|
export type DocumentIDMeta = PouchDB.Core.IdMeta;
|
|
31
31
|
export type DocumentRevisionIDMeta = PouchDB.Core.RevisionIdMeta;
|
|
32
|
-
export type FindRequest<Type extends
|
|
32
|
+
export type FindRequest<Type extends object> = PouchDB.Find.FindRequest<Type>;
|
|
33
33
|
export type DeleteIndexOptions = PouchDB.Find.DeleteIndexOptions;
|
|
34
34
|
export type GetOptions = PouchDB.Core.GetOptions;
|
|
35
35
|
export type PutOptions = PouchDB.Core.Options;
|
|
36
|
-
export type PutDocument<Type extends
|
|
36
|
+
export type PutDocument<Type extends object> = PouchDB.Core.PutDocument<Type>;
|
|
37
37
|
export type Index = PouchDB.Find.Index;
|
|
38
38
|
export type DatabasePlugin = AnyFunction;
|
|
39
39
|
export type AllowedRoles = (Array<string> | string | {
|
|
@@ -61,7 +61,7 @@ export interface SelectionMapping {
|
|
|
61
61
|
label: string;
|
|
62
62
|
value: unknown;
|
|
63
63
|
}
|
|
64
|
-
export interface PropertySpecification<Type = unknown, AdditionalSpecifications extends
|
|
64
|
+
export interface PropertySpecification<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> {
|
|
65
65
|
allowedRoles?: AllowedRoles | null;
|
|
66
66
|
computed?: boolean;
|
|
67
67
|
arrayConstraintExecution?: Constraint | null;
|
|
@@ -104,12 +104,12 @@ export interface PropertySpecification<Type = unknown, AdditionalSpecifications
|
|
|
104
104
|
value?: null | Type;
|
|
105
105
|
additionalSpecifications?: AdditionalSpecifications;
|
|
106
106
|
}
|
|
107
|
-
export interface FileSpecification<Type = Attachment, AdditionalSpecifications extends
|
|
107
|
+
export interface FileSpecification<Type = Attachment, AdditionalSpecifications extends object = Mapping<unknown>> extends PropertySpecification<Type, AdditionalSpecifications> {
|
|
108
108
|
fileName?: PropertySpecification<string, AdditionalSpecifications>;
|
|
109
109
|
}
|
|
110
|
-
export interface BaseModel {
|
|
110
|
+
export interface BaseModel<Type = Attachment, AdditionalSpecifications extends object = Mapping<unknown>> {
|
|
111
111
|
_allowedRoles?: AllowedRoles | null;
|
|
112
|
-
_attachments?: Mapping<FileSpecification
|
|
112
|
+
_attachments?: (Mapping<FileSpecification<Type, AdditionalSpecifications>> | null);
|
|
113
113
|
_constraintExecutions?: Array<Constraint> | Constraint | null;
|
|
114
114
|
_constraintExpressions?: Array<Constraint> | Constraint | null;
|
|
115
115
|
_createExecution?: null | string;
|
|
@@ -121,8 +121,8 @@ export interface BaseModel {
|
|
|
121
121
|
_onUpdateExecution?: null | string;
|
|
122
122
|
_onUpdateExpression?: null | string;
|
|
123
123
|
}
|
|
124
|
-
export type Model<Type = unknown, AdditionalSpecifications extends
|
|
125
|
-
export type Models<Type = unknown, AdditionalSpecifications extends
|
|
124
|
+
export type Model<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> = BaseModel & Mapping<PropertySpecification<Type, AdditionalSpecifications>>;
|
|
125
|
+
export type Models<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> = Mapping<Model<Type, AdditionalSpecifications>>;
|
|
126
126
|
export type UpdateStrategy = '' | 'fillUp' | 'incremental' | 'migrate';
|
|
127
127
|
export type DocumentContent = Array<DocumentContent> | PlainObject | Primitive;
|
|
128
128
|
export type DocumentStrategyMeta = {
|
|
@@ -132,8 +132,8 @@ export type DocumentTypeMeta = {
|
|
|
132
132
|
'-type': string;
|
|
133
133
|
};
|
|
134
134
|
export type BaseDocument = ChangesMeta & DocumentGetMeta & DocumentIDMeta & DocumentRevisionIDMeta & DocumentStrategyMeta & DocumentTypeMeta;
|
|
135
|
-
export type FullDocument<Type extends
|
|
136
|
-
export type PartialFullDocument<Type extends
|
|
135
|
+
export type FullDocument<Type extends object = Mapping<unknown>> = BaseDocument & Document<Type>;
|
|
136
|
+
export type PartialFullDocument<Type extends object = Mapping<unknown>> = Partial<BaseDocument> & Partial<Document<Type>>;
|
|
137
137
|
export interface SpecialPropertyNames {
|
|
138
138
|
additional: '_additional';
|
|
139
139
|
allowedRole: '_allowedRoles';
|
|
@@ -175,7 +175,7 @@ export interface PropertyNameConfiguration {
|
|
|
175
175
|
};
|
|
176
176
|
validatedDocumentsCache: string;
|
|
177
177
|
}
|
|
178
|
-
export interface BaseModelConfiguration<Type = unknown, AdditionalSpecifications extends
|
|
178
|
+
export interface BaseModelConfiguration<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> {
|
|
179
179
|
dateTimeFormat: 'iso' | 'iso8601' | 'number';
|
|
180
180
|
property: {
|
|
181
181
|
defaultSpecification: PropertySpecification<Type, AdditionalSpecifications>;
|
|
@@ -183,7 +183,7 @@ export interface BaseModelConfiguration<Type = unknown, AdditionalSpecifications
|
|
|
183
183
|
};
|
|
184
184
|
updateStrategy: UpdateStrategy;
|
|
185
185
|
}
|
|
186
|
-
export interface ModelConfiguration<Type = unknown, AdditionalSpecifications extends
|
|
186
|
+
export interface ModelConfiguration<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> extends BaseModelConfiguration<Type, AdditionalSpecifications> {
|
|
187
187
|
autoMigrationPath: string;
|
|
188
188
|
entities: Models<Type, AdditionalSpecifications>;
|
|
189
189
|
triggerInitialCompaction: boolean;
|
|
@@ -222,7 +222,7 @@ export type AdvancedFetchOptions = RequestInit & {
|
|
|
222
222
|
export type ConnectorConfiguration = DatabaseConnectorConfiguration & {
|
|
223
223
|
fetch?: AdvancedFetchOptions | null;
|
|
224
224
|
};
|
|
225
|
-
export interface CoreConfiguration<Type = unknown, AdditionalSpecifications extends
|
|
225
|
+
export interface CoreConfiguration<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> {
|
|
226
226
|
attachAutoRestarter: boolean;
|
|
227
227
|
backend: {
|
|
228
228
|
configuration: PlainObject;
|
|
@@ -258,7 +258,7 @@ export interface CoreConfiguration<Type = unknown, AdditionalSpecifications exte
|
|
|
258
258
|
export type Configuration<ConfigurationType = Mapping<unknown>> = BaseConfiguration<{
|
|
259
259
|
couchdb: CoreConfiguration;
|
|
260
260
|
}> & ConfigurationType;
|
|
261
|
-
export interface CouchDB<Type extends
|
|
261
|
+
export interface CouchDB<Type extends object = Mapping<unknown>> {
|
|
262
262
|
changesStream: ChangesStream;
|
|
263
263
|
connection: Connection<Type>;
|
|
264
264
|
connector: Connector;
|
|
@@ -311,7 +311,7 @@ export interface CompilationErrorData<S = Mapping<unknown>> extends EvaluationEr
|
|
|
311
311
|
export interface RuntimeErrorData<S = Mapping<unknown>> extends EvaluationErrorData<S> {
|
|
312
312
|
runtime: string;
|
|
313
313
|
}
|
|
314
|
-
export interface BasicScope<Type = unknown, AdditionalSpecifications extends
|
|
314
|
+
export interface BasicScope<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> {
|
|
315
315
|
attachmentWithPrefixExists: (namePrefix: string) => boolean;
|
|
316
316
|
checkDocument: (newDocument: PartialFullDocument, oldDocument: PartialFullDocument | null, parentNames: Array<string>) => CheckedDocumentResult;
|
|
317
317
|
getFileNameByPrefix: (prefix?: string, attachments?: Attachments) => null | string;
|
|
@@ -329,7 +329,7 @@ export interface BasicScope<Type = unknown, AdditionalSpecifications extends Map
|
|
|
329
329
|
securitySettings: Partial<SecuritySettings>;
|
|
330
330
|
userContext: Partial<UserContext>;
|
|
331
331
|
}
|
|
332
|
-
export interface CommonScope<Type, AdditionalSpecifications extends
|
|
332
|
+
export interface CommonScope<Type, AdditionalSpecifications extends object = Mapping<unknown>> {
|
|
333
333
|
checkPropertyContent: (newValue: unknown, name: string, propertySpecification: PropertySpecification<Type, AdditionalSpecifications>, oldValue: unknown) => CheckedPropertyResult;
|
|
334
334
|
model: Model<Type, AdditionalSpecifications>;
|
|
335
335
|
modelName: string;
|
|
@@ -339,7 +339,7 @@ export interface CommonScope<Type, AdditionalSpecifications extends Mapping<unkn
|
|
|
339
339
|
parentNames: Array<string>;
|
|
340
340
|
pathDescription: string;
|
|
341
341
|
}
|
|
342
|
-
export interface PropertyScope<Type = unknown, AdditionalSpecifications extends
|
|
342
|
+
export interface PropertyScope<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> extends CommonScope<Type, AdditionalSpecifications> {
|
|
343
343
|
name: string;
|
|
344
344
|
newValue: Type;
|
|
345
345
|
oldValue: Type;
|
|
@@ -360,7 +360,7 @@ export interface CheckedPropertyResult extends CheckedResult {
|
|
|
360
360
|
export interface CheckedDocumentResult extends CheckedResult {
|
|
361
361
|
newDocument: PartialFullDocument;
|
|
362
362
|
}
|
|
363
|
-
export type Migrator<Type = unknown, AdditionalSpecifications extends
|
|
363
|
+
export type Migrator<Type = unknown, AdditionalSpecifications extends object = Mapping<unknown>> = (document: Document, scope: {
|
|
364
364
|
configuration: Configuration;
|
|
365
365
|
databaseHelper: DatabaseHelper;
|
|
366
366
|
Tools: typeof Tools;
|