couchdb-web-node-plugin 1.0.748 → 1.0.749
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/helper.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/type.d.ts +16 -2
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.749",
|
|
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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChildProcess } from 'child_process';
|
|
2
2
|
import { AnyFunction, Mapping, PlainObject, Primitive, ProcessCloseReason, UTILITY_SCOPE } from 'clientnode';
|
|
3
|
-
import { Configuration as BaseConfiguration, PluginHandler as BasePluginHandler, ServicePromises as BaseServicePromises, Services as BaseServices, ServicePromisesState as BaseServicePromisesState, ServicesState as BaseServicesState } from 'web-node/type';
|
|
4
|
-
import { Server as HTTPServer } from 'http';
|
|
5
3
|
import { Express } from 'express-serve-static-core';
|
|
4
|
+
import { IncomingMessage as IncomingHTTPMessage, Server as HTTPServer, ServerResponse as HTTP1ServerResponse } from 'http';
|
|
5
|
+
import { Configuration as BaseConfiguration, PluginHandler as BasePluginHandler, ServicePromises as BaseServicePromises, Services as BaseServices, ServicePromisesState as BaseServicePromisesState, ServicesState as BaseServicesState } from 'web-node/type';
|
|
6
6
|
export type Attachment = PouchDB.Core.Attachment & {
|
|
7
7
|
content_type?: PouchDB.Core.Attachment['content_type'];
|
|
8
8
|
contentType?: PouchDB.Core.Attachment['content_type'];
|
|
@@ -33,6 +33,7 @@ export type DocumentGetMeta = PouchDB.Core.GetMeta;
|
|
|
33
33
|
export type DocumentIDMeta = PouchDB.Core.IdMeta;
|
|
34
34
|
export type DocumentRevisionIDMeta = PouchDB.Core.RevisionIdMeta;
|
|
35
35
|
export type FindRequest<Type extends object> = PouchDB.Find.FindRequest<Type>;
|
|
36
|
+
export type FindResponse<Type extends object> = PouchDB.Find.FindResponse<Type>;
|
|
36
37
|
export type DeleteIndexOptions = PouchDB.Find.DeleteIndexOptions;
|
|
37
38
|
export type GetOptions = PouchDB.Core.GetOptions;
|
|
38
39
|
export type PutOptions = PouchDB.Core.Options;
|
|
@@ -361,6 +362,19 @@ export interface PluginHandler extends BasePluginHandler {
|
|
|
361
362
|
* @returns Promise resolving to nothing.
|
|
362
363
|
*/
|
|
363
364
|
restartCouchdb?(state: State): Promise<void>;
|
|
365
|
+
/**
|
|
366
|
+
* Hook before registering pouchdb routes into the express server
|
|
367
|
+
* instance.
|
|
368
|
+
* @param state - Application state.
|
|
369
|
+
* @returns Promise resolving to find result.
|
|
370
|
+
*/
|
|
371
|
+
onPouchDBFind?(state: State<{
|
|
372
|
+
request: IncomingHTTPMessage & {
|
|
373
|
+
body: FindRequest<PlainObject>;
|
|
374
|
+
};
|
|
375
|
+
response: HTTP1ServerResponse;
|
|
376
|
+
result: FindResponse<object>;
|
|
377
|
+
}>): Promise<FindResponse<object> | undefined>;
|
|
364
378
|
/**
|
|
365
379
|
* Hook before registering pouchdb routes into the express server
|
|
366
380
|
* instance.
|