couchdb-web-node-plugin 1.0.545 → 1.0.547
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 +3 -3
- package/type.d.ts +48 -48
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.547",
|
|
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",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
|
-
"node": ">=
|
|
103
|
-
"npm": ">=
|
|
102
|
+
"node": ">=19",
|
|
103
|
+
"npm": ">=8"
|
|
104
104
|
},
|
|
105
105
|
"resolutions": {
|
|
106
106
|
"@types/webpack": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz",
|
package/type.d.ts
CHANGED
|
@@ -16,28 +16,28 @@ import Tools from 'clientnode';
|
|
|
16
16
|
import { AnyFunction, Mapping, PlainObject, Primitive, ProcessCloseReason } from 'clientnode/type';
|
|
17
17
|
import { Configuration as BaseConfiguration, PluginHandler as BasePluginHandler, ServicePromises as BaseServicePromises, Services as BaseServices, ServicePromisesState as BaseServicePromisesState, ServicesState as BaseServicesState } from 'web-node/type';
|
|
18
18
|
import DatabaseHelper from './databaseHelper';
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
19
|
+
export type Attachments = PouchDB.Core.Attachments;
|
|
20
|
+
export type FullAttachment = PouchDB.Core.FullAttachment;
|
|
21
|
+
export type StubAttachment = PouchDB.Core.StubAttachment;
|
|
22
|
+
export type ChangesMeta = PouchDB.Core.ChangesMeta;
|
|
23
|
+
export type ChangesResponseChange<Type extends Mapping<unknown> = Mapping<unknown>> = PouchDB.Core.ChangesResponseChange<Type>;
|
|
24
|
+
export type ChangesStream<Type extends Mapping<unknown> = Mapping<unknown>> = PouchDB.Core.Changes<Type>;
|
|
25
|
+
export type ChangesStreamOptions = PouchDB.Core.ChangesOptions;
|
|
26
|
+
export type Connection = PouchDB.Database;
|
|
27
|
+
export type Connector = PouchDB.Static;
|
|
28
|
+
export type DatabaseConnectorConfiguration = PouchDB.Configuration.RemoteDatabaseConfiguration;
|
|
29
|
+
export type DatabaseError = PouchDB.Core.Error;
|
|
30
|
+
export type DatabaseFetch = PouchDB.Core.Options['fetch'];
|
|
31
|
+
export type DatabaseResponse = PouchDB.Core.Response;
|
|
32
|
+
export type DeleteIndexOptions = PouchDB.Find.DeleteIndexOptions;
|
|
33
|
+
export type Document<Type extends Mapping<unknown> = PlainObject> = PouchDB.Core.Document<Type>;
|
|
34
|
+
export type ExistingDocument<Type extends Mapping<unknown> = PlainObject> = PouchDB.Core.ExistingDocument<Type>;
|
|
35
|
+
export type DocumentGetMeta = PouchDB.Core.GetMeta;
|
|
36
|
+
export type DocumentIDMeta = PouchDB.Core.IdMeta;
|
|
37
|
+
export type DocumentRevisionIDMeta = PouchDB.Core.RevisionIdMeta;
|
|
38
|
+
export type Index = PouchDB.Find.Index;
|
|
39
|
+
export type DatabasePlugin = AnyFunction;
|
|
40
|
+
export type AllowedRoles = (Array<string> | string | {
|
|
41
41
|
read?: Array<string> | string;
|
|
42
42
|
write?: Array<string> | string;
|
|
43
43
|
});
|
|
@@ -48,14 +48,14 @@ export interface NormalizedAllowedRoles {
|
|
|
48
48
|
export interface NormalizedAllowedModelRoles extends NormalizedAllowedRoles {
|
|
49
49
|
properties: Mapping<NormalizedAllowedRoles>;
|
|
50
50
|
}
|
|
51
|
-
export
|
|
51
|
+
export type AllowedModelRolesMapping = Mapping<NormalizedAllowedModelRoles>;
|
|
52
52
|
export interface Constraint {
|
|
53
53
|
description?: null | string;
|
|
54
54
|
evaluation: string;
|
|
55
55
|
}
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
56
|
+
export type Type = string | 'any' | 'boolean' | 'integer' | 'number' | 'string' | 'DateTime';
|
|
57
|
+
export type TypeSpecification = Array<Type> | Type;
|
|
58
|
+
export type ConstraintKey = 'arrayConstraintExecution' | 'arrayConstraintExpression' | 'conflictingConstraintExecution' | 'conflictingConstraintExpression' | 'constraintExecution' | 'constraintExpression';
|
|
59
59
|
export interface SelectionMapping {
|
|
60
60
|
label: string;
|
|
61
61
|
value: unknown;
|
|
@@ -115,20 +115,20 @@ export interface BaseModel {
|
|
|
115
115
|
_onUpdateExecution?: null | string;
|
|
116
116
|
_onUpdateExpression?: null | string;
|
|
117
117
|
}
|
|
118
|
-
export
|
|
119
|
-
export
|
|
118
|
+
export type Model = BaseModel & Mapping<PropertySpecification>;
|
|
119
|
+
export type Models = Mapping<Model>;
|
|
120
120
|
export declare const PrimitiveTypes: readonly ["boolean", "DateTime", "integer", "number", "string"];
|
|
121
|
-
export
|
|
122
|
-
export
|
|
123
|
-
export
|
|
121
|
+
export type UpdateStrategy = '' | 'fillUp' | 'incremental' | 'migrate';
|
|
122
|
+
export type DocumentContent = Array<DocumentContent> | PlainObject<Primitive> | Primitive;
|
|
123
|
+
export type DocumentStrategyMeta = {
|
|
124
124
|
_updateStrategy?: UpdateStrategy;
|
|
125
125
|
};
|
|
126
|
-
export
|
|
126
|
+
export type DocumentTypeMeta = {
|
|
127
127
|
'-type': string;
|
|
128
128
|
};
|
|
129
|
-
export
|
|
130
|
-
export
|
|
131
|
-
export
|
|
129
|
+
export type BaseDocument = ChangesMeta & DocumentGetMeta & DocumentIDMeta & DocumentRevisionIDMeta & DocumentStrategyMeta & DocumentTypeMeta;
|
|
130
|
+
export type FullDocument = BaseDocument & PlainObject;
|
|
131
|
+
export type PartialFullDocument = Partial<BaseDocument> & PlainObject;
|
|
132
132
|
export interface SpecialPropertyNames {
|
|
133
133
|
additional: '_additional';
|
|
134
134
|
allowedRole: '_allowedRoles';
|
|
@@ -211,12 +211,12 @@ export interface SecuritySettings {
|
|
|
211
211
|
members: DatabaseUserConfiguration;
|
|
212
212
|
_validatedDocuments?: Set<string>;
|
|
213
213
|
}
|
|
214
|
-
export
|
|
214
|
+
export type ConnectorConfiguration = DatabaseConnectorConfiguration & {
|
|
215
215
|
fetch?: (RequestInit & {
|
|
216
216
|
timeout: number;
|
|
217
217
|
}) | null;
|
|
218
218
|
};
|
|
219
|
-
export
|
|
219
|
+
export type Configuration<ConfigurationType = Mapping<unknown>> = BaseConfiguration<{
|
|
220
220
|
couchdb: {
|
|
221
221
|
attachAutoRestarter: boolean;
|
|
222
222
|
backend: {
|
|
@@ -265,14 +265,14 @@ export interface CouchDB {
|
|
|
265
265
|
stop: (services: Services, configuration: Configuration) => Promise<void>;
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
export
|
|
268
|
+
export type ServicePromises<Type = Mapping<unknown>> = BaseServicePromises<{
|
|
269
269
|
couchdb: Promise<ProcessCloseReason>;
|
|
270
270
|
}> & Type;
|
|
271
|
-
export
|
|
271
|
+
export type Services<Type = Mapping<unknown>> = BaseServices<{
|
|
272
272
|
couchdb: CouchDB;
|
|
273
273
|
}> & Type;
|
|
274
|
-
export
|
|
275
|
-
export
|
|
274
|
+
export type ServicesState<Type = undefined> = BaseServicesState<Type, Configuration, Services>;
|
|
275
|
+
export type State<Type = undefined> = BaseServicePromisesState<Type, Configuration, Services, ServicePromises>;
|
|
276
276
|
export interface PluginHandler extends BasePluginHandler {
|
|
277
277
|
/**
|
|
278
278
|
* Hook after each data change.
|
|
@@ -292,7 +292,7 @@ export interface PluginHandler extends BasePluginHandler {
|
|
|
292
292
|
export interface EmptyEvaluationExceptionData {
|
|
293
293
|
empty: string;
|
|
294
294
|
}
|
|
295
|
-
export
|
|
295
|
+
export type EmptyEvaluationException = Exception<EmptyEvaluationExceptionData>;
|
|
296
296
|
export interface EvaluationExceptionData<S = Mapping<unknown>> {
|
|
297
297
|
code: string;
|
|
298
298
|
error: Error;
|
|
@@ -304,7 +304,7 @@ export interface CompilationExceptionData<S = Mapping<unknown>> extends Evaluati
|
|
|
304
304
|
export interface RuntimeExceptionData<S = Mapping<unknown>> extends EvaluationExceptionData<S> {
|
|
305
305
|
runtime: string;
|
|
306
306
|
}
|
|
307
|
-
export
|
|
307
|
+
export type EvaluationException<S = Mapping<unknown>> = Exception<EvaluationExceptionData<S>>;
|
|
308
308
|
export interface BasicScope {
|
|
309
309
|
attachmentWithPrefixExists: (namePrefix: string) => boolean;
|
|
310
310
|
checkDocument: (newDocument: PartialFullDocument, oldDocument: PartialFullDocument | null, parentNames: Array<string>) => CheckedDocumentResult;
|
|
@@ -344,7 +344,7 @@ export interface EvaluationResult<T = unknown, S = BasicScope & CommonScope> {
|
|
|
344
344
|
result: T;
|
|
345
345
|
scope: S;
|
|
346
346
|
}
|
|
347
|
-
export
|
|
347
|
+
export type Evaluate<R = unknown, P = unknown> = (...parameters: Array<P>) => R;
|
|
348
348
|
export interface CheckedResult {
|
|
349
349
|
changedPath: Array<string>;
|
|
350
350
|
}
|
|
@@ -354,11 +354,11 @@ export interface CheckedPropertyResult extends CheckedResult {
|
|
|
354
354
|
export interface CheckedDocumentResult extends CheckedResult {
|
|
355
355
|
newDocument: PartialFullDocument;
|
|
356
356
|
}
|
|
357
|
-
export
|
|
357
|
+
export type Exception<DataType = Mapping<unknown>> = {
|
|
358
358
|
message: string;
|
|
359
359
|
name: string;
|
|
360
360
|
} & DataType;
|
|
361
|
-
export
|
|
361
|
+
export type Migrator = (document: Document, scope: {
|
|
362
362
|
configuration: Configuration;
|
|
363
363
|
databaseHelper: DatabaseHelper;
|
|
364
364
|
tools: typeof Tools;
|
|
@@ -370,8 +370,8 @@ export declare type Migrator = (document: Document, scope: {
|
|
|
370
370
|
selfFilePath: string;
|
|
371
371
|
services: Services;
|
|
372
372
|
}) => Document | null;
|
|
373
|
-
export
|
|
374
|
-
export
|
|
373
|
+
export type DateRepresentationType = Date | null | number | string;
|
|
374
|
+
export type User = BaseDocument & {
|
|
375
375
|
password: string;
|
|
376
376
|
roles: Array<string>;
|
|
377
377
|
};
|