couchdb-web-node-plugin 1.0.594 → 1.0.595

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/type.d.ts +10 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "couchdb-web-node-plugin",
3
- "version": "1.0.594",
3
+ "version": "1.0.595",
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
@@ -122,7 +122,7 @@ export interface BaseModel {
122
122
  _onUpdateExpression?: null | string;
123
123
  }
124
124
  export type Model<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> = BaseModel & Mapping<PropertySpecification<Type, AdditionalSpecifications>>;
125
- export type Models = Mapping<Model>;
125
+ export type Models<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = 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 = {
@@ -183,9 +183,9 @@ export interface BaseModelConfiguration<Type = unknown, AdditionalSpecifications
183
183
  };
184
184
  updateStrategy: UpdateStrategy;
185
185
  }
186
- export interface ModelConfiguration<Type = unknown> extends BaseModelConfiguration<Type> {
186
+ export interface ModelConfiguration<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> extends BaseModelConfiguration<Type, AdditionalSpecifications> {
187
187
  autoMigrationPath: string;
188
- entities: Models;
188
+ entities: Models<Type, AdditionalSpecifications>;
189
189
  triggerInitialCompaction: boolean;
190
190
  updateConfiguration: boolean;
191
191
  updateValidation: boolean;
@@ -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> {
314
+ export interface BasicScope<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = 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;
@@ -322,8 +322,8 @@ export interface BasicScope<Type = unknown> {
322
322
  revisionName: string;
323
323
  specialNames: SpecialPropertyNames;
324
324
  typeName: string;
325
- modelConfiguration: BaseModelConfiguration<Type>;
326
- models: Models;
325
+ modelConfiguration: BaseModelConfiguration<Type, AdditionalSpecifications>;
326
+ models: Models<Type, AdditionalSpecifications>;
327
327
  now: Date;
328
328
  nowUTCTimestamp: number;
329
329
  securitySettings: Partial<SecuritySettings>;
@@ -331,7 +331,7 @@ export interface BasicScope<Type = unknown> {
331
331
  }
332
332
  export interface CommonScope<Type, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> {
333
333
  checkPropertyContent: (newValue: unknown, name: string, propertySpecification: PropertySpecification<Type, AdditionalSpecifications>, oldValue: unknown) => CheckedPropertyResult;
334
- model: Model<Type>;
334
+ model: Model<Type, AdditionalSpecifications>;
335
335
  modelName: string;
336
336
  type: Array<string> | string;
337
337
  newDocument: Attachments | PartialFullDocument;
@@ -360,15 +360,15 @@ export interface CheckedPropertyResult extends CheckedResult {
360
360
  export interface CheckedDocumentResult extends CheckedResult {
361
361
  newDocument: PartialFullDocument;
362
362
  }
363
- export type Migrator<Type = unknown> = (document: Document, scope: {
363
+ export type Migrator<Type = unknown, AdditionalSpecifications extends Mapping<unknown> = Mapping<unknown>> = (document: Document, scope: {
364
364
  configuration: Configuration;
365
365
  databaseHelper: DatabaseHelper;
366
366
  Tools: typeof Tools;
367
367
  idName: string;
368
368
  typeName: string;
369
369
  migrater: Mapping<Migrator<Type>>;
370
- models: Models;
371
- modelConfiguration: ModelConfiguration<Type>;
370
+ models: Models<Type, AdditionalSpecifications>;
371
+ modelConfiguration: ModelConfiguration<Type, AdditionalSpecifications>;
372
372
  selfFilePath: string;
373
373
  services: Services;
374
374
  }) => Document | null;