Comparing version 9.0.4 to 9.0.5
@@ -9,12 +9,12 @@ import { type ConfigParams } from './config_parser.js'; | ||
getDocsByViewKeys<D extends import("../types/nano.js").Document>(viewName: import("types/types.js").ViewName, keys: import("types/types.js").ViewKey[]): Promise<D[]>; | ||
docUrl: (docId: import("types/types.js").DocId) => string; | ||
docUrl: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"]) => string; | ||
info: () => Promise<import("../types/nano.js").InfoResponse>; | ||
get: <D>(docId: import("types/types.js").DocId, docRev?: import("types/types.js").DocRev) => Promise<import("../types/nano.js").DocumentGetResponse & D>; | ||
exists: (docId: import("types/types.js").DocId) => Promise<boolean>; | ||
get: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"], docRev?: D["_rev"]) => Promise<import("../types/nano.js").DocumentGetResponse & D>; | ||
exists: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"]) => Promise<boolean>; | ||
put: (doc: import("../types/nano.js").IdentifiedDocument | import("types/types.js").RecoveredDoc, params?: import("../types/nano.js").DocumentInsertParams) => Promise<import("../types/nano.js").DocumentInsertResponse>; | ||
post: <D extends import("types/types.js").NewDoc>(doc: D, params?: import("../types/nano.js").DocumentInsertParams) => Promise<import("../types/nano.js").DocumentInsertResponse>; | ||
update: (docId: import("types/types.js").DocId, fn: import("types/types.js").DocTranformer, options?: import("types/types.js").UpdateOptions) => Promise<import("../types/nano.js").DocumentInsertResponse>; | ||
delete: (docId: import("types/types.js").DocId, rev: import("types/types.js").DocRev) => Promise<import("../types/nano.js").DocumentDestroyResponse>; | ||
undelete: (docId: import("types/types.js").DocId) => Promise<import("../types/nano.js").DocumentInsertResponse>; | ||
bulk: (docs: import("../types/nano.js").Document[]) => Promise<import("../types/nano.js").DocumentBulkResponse[]>; | ||
update: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"], fn: import("types/types.js").DocTranformer<D>, options?: import("types/types.js").UpdateOptions) => Promise<import("../types/nano.js").DocumentInsertResponse>; | ||
delete: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"], rev: D["_rev"]) => Promise<import("../types/nano.js").DocumentDestroyResponse>; | ||
undelete: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"]) => Promise<import("../types/nano.js").DocumentInsertResponse>; | ||
bulk: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docs: D[]) => Promise<import("../types/nano.js").DocumentBulkResponse[]>; | ||
buildQueryString: (query?: import("../types/nano.js").DocumentViewQuery) => string; | ||
@@ -31,9 +31,9 @@ viewQuery: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document, K extends import("types/types.js").ViewKey = import("types/types.js").ViewKey, V = unknown>(path: string, query?: import("../types/nano.js").DocumentViewQuery) => Promise<import("../types/nano.js").DocumentViewResponse<D, K, V>>; | ||
}>; | ||
listRevs: (docId: import("types/types.js").DocId) => Promise<import("types/types.js").RevInfo[]>; | ||
revertLastChange: (docId: import("types/types.js").DocId) => Promise<any>; | ||
revertToLastVersionWhere: (docId: import("types/types.js").DocId, testFn: import("types/types.js").TestFunction) => Promise<any>; | ||
listRevs: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"]) => Promise<import("types/types.js").RevInfo[]>; | ||
revertLastChange: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"]) => Promise<any>; | ||
revertToLastVersionWhere: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"], testFn: import("types/types.js").TestFunction<D>) => Promise<any>; | ||
changes: (query?: import("../types/nano.js").DatabaseChangesParams) => Promise<import("../types/nano.js").DatabaseChangesResponse>; | ||
find: <D extends import("../types/nano.js").Document>(query?: import("types/types.js").FindQuery, options?: import("types/types.js").FindOptions) => Promise<import("../types/nano.js").MangoResponse<D>>; | ||
postIndex: (indexDoc: import("../types/nano.js").CreateIndexRequest) => Promise<import("../types/nano.js").CreateIndexResponse>; | ||
recover: (docId: import("types/types.js").DocId, candidatesRevsInfo: import("types/types.js").RevInfo[], currentRevInfo: import("types/types.js").RevInfo, testFn?: import("types/types.js").TestFunction) => any; | ||
recover: <D extends import("../types/nano.js").Document = import("../types/nano.js").Document>(docId: D["_id"], candidatesRevsInfo: import("types/types.js").RevInfo[], currentRevInfo: import("types/types.js").RevInfo, testFn?: import("types/types.js").TestFunction) => any; | ||
name: string; | ||
@@ -40,0 +40,0 @@ request: <ResponseBody>(method: any, path: any, body: any) => Promise<any>; |
import type { CreateIndexRequest, CreateIndexResponse, DatabaseChangesParams, DatabaseChangesResponse, Document, DocumentBulkResponse, DocumentDestroyResponse, DocumentGetResponse, DocumentInsertParams, DocumentInsertResponse, DocumentLookupFailure, DocumentViewQuery, DocumentViewResponse, IdentifiedDocument, InfoResponse, MangoResponse } from '../types/nano.js'; | ||
import type { DocId, DocRev, DocTranformer, FetchOptions, FindOptions, FindQuery, JsonRequest, NewDoc, TestFunction, RecoveredDoc, UpdateOptions, ViewKey, DocumentDeletedFailure, RevInfo, DocumentViewKeysQuery } from 'types/types.js'; | ||
import type { DocTranformer, FetchOptions, FindOptions, FindQuery, JsonRequest, NewDoc, TestFunction, RecoveredDoc, UpdateOptions, ViewKey, DocumentDeletedFailure, RevInfo, DocumentViewKeysQuery } from 'types/types.js'; | ||
export default function (jsonRequest: JsonRequest, dbName: string): { | ||
docUrl: (docId: DocId) => string; | ||
docUrl: <D extends Document = Document>(docId: D["_id"]) => string; | ||
info: () => Promise<InfoResponse>; | ||
get: <D>(docId: DocId, docRev?: DocRev) => Promise<DocumentGetResponse & D>; | ||
exists: (docId: DocId) => Promise<boolean>; | ||
get: <D extends Document = Document>(docId: D["_id"], docRev?: D["_rev"]) => Promise<DocumentGetResponse & D>; | ||
exists: <D extends Document = Document>(docId: D["_id"]) => Promise<boolean>; | ||
put: (doc: IdentifiedDocument | RecoveredDoc, params?: DocumentInsertParams) => Promise<DocumentInsertResponse>; | ||
post: <D extends NewDoc>(doc: D, params?: DocumentInsertParams) => Promise<DocumentInsertResponse>; | ||
update: (docId: DocId, fn: DocTranformer, options?: UpdateOptions) => Promise<DocumentInsertResponse>; | ||
delete: (docId: DocId, rev: DocRev) => Promise<DocumentDestroyResponse>; | ||
undelete: (docId: DocId) => Promise<DocumentInsertResponse>; | ||
bulk: (docs: Document[]) => Promise<DocumentBulkResponse[]>; | ||
update: <D extends Document = Document>(docId: D["_id"], fn: DocTranformer<D>, options?: UpdateOptions) => Promise<DocumentInsertResponse>; | ||
delete: <D extends Document = Document>(docId: D["_id"], rev: D["_rev"]) => Promise<DocumentDestroyResponse>; | ||
undelete: <D extends Document = Document>(docId: D["_id"]) => Promise<DocumentInsertResponse>; | ||
bulk: <D extends Document = Document>(docs: D[]) => Promise<DocumentBulkResponse[]>; | ||
buildQueryString: (query?: DocumentViewQuery) => string; | ||
@@ -25,9 +25,9 @@ viewQuery: <D extends Document = Document, K extends ViewKey = ViewKey, V = unknown>(path: string, query?: DocumentViewQuery) => Promise<DocumentViewResponse<D, K, V>>; | ||
}>; | ||
listRevs: (docId: DocId) => Promise<RevInfo[]>; | ||
revertLastChange: (docId: DocId) => Promise<any>; | ||
revertToLastVersionWhere: (docId: DocId, testFn: TestFunction) => Promise<any>; | ||
listRevs: <D extends Document = Document>(docId: D["_id"]) => Promise<RevInfo[]>; | ||
revertLastChange: <D extends Document = Document>(docId: D["_id"]) => Promise<any>; | ||
revertToLastVersionWhere: <D extends Document = Document>(docId: D["_id"], testFn: TestFunction<D>) => Promise<any>; | ||
changes: (query?: DatabaseChangesParams) => Promise<DatabaseChangesResponse>; | ||
find: <D extends Document>(query?: FindQuery, options?: FindOptions) => Promise<MangoResponse<D>>; | ||
postIndex: (indexDoc: CreateIndexRequest) => Promise<CreateIndexResponse>; | ||
recover: (docId: DocId, candidatesRevsInfo: RevInfo[], currentRevInfo: RevInfo, testFn?: TestFunction) => any; | ||
recover: <D extends Document = Document>(docId: D["_id"], candidatesRevsInfo: RevInfo[], currentRevInfo: RevInfo, testFn?: TestFunction) => any; | ||
}; |
@@ -14,3 +14,3 @@ import type { Document, DocumentInsertResponse, DocumentViewQuery } from './nano.js'; | ||
} | ||
export type DocTranformer = (doc: Document) => Document; | ||
export type DocTranformer<D extends Document = Document> = (doc: D) => D; | ||
export interface UpdateOptions { | ||
@@ -34,3 +34,3 @@ createIfMissing?: boolean; | ||
} | ||
export type TestFunction = (doc: Document) => boolean; | ||
export type TestFunction<D extends Document = Document> = (doc: D) => boolean; | ||
export interface API { | ||
@@ -37,0 +37,0 @@ [key: string]: any; |
@@ -19,3 +19,3 @@ { | ||
"git-pre-commit": "npm run lint && npm test", | ||
"prepublishOnly": "npm run lint && npm test", | ||
"prepublishOnly": "npm run build && npm run lint && npm test", | ||
"postpublish": "git push --tags", | ||
@@ -31,3 +31,3 @@ "update-toc": "./scripts/update_toc.sh", | ||
], | ||
"version": "9.0.4", | ||
"version": "9.0.5", | ||
"main": "dist/lib/cot.js", | ||
@@ -34,0 +34,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
262250
4068