@decaf-ts/for-couchdb 0.1.14 → 0.1.16

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/lib/types.d.ts CHANGED
@@ -187,219 +187,3 @@ export interface MangoQuery {
187
187
  * Optional, default: false. */
188
188
  execution_stats?: boolean;
189
189
  }
190
- /** Database authentication response.
191
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/server/authn.html#cookie-authentication} */
192
- export interface DatabaseAuthResponse {
193
- /** Operation status */
194
- ok: boolean;
195
- /** Username */
196
- name: string;
197
- /** List of user roles */
198
- roles: string[];
199
- }
200
- /** Database _session response.
201
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/server/authn.html#get--_session} */
202
- export interface DatabaseSessionResponse {
203
- /** Operation status */
204
- ok: boolean;
205
- /** User context for the current user */
206
- userCtx: any;
207
- /** Server authentication configuration */
208
- info: any;
209
- }
210
- export interface MaybeIdentifiedDocument {
211
- _id?: string;
212
- }
213
- export interface IdentifiedDocument {
214
- _id: string;
215
- }
216
- export interface MaybeRevisionedDocument {
217
- _rev?: string;
218
- }
219
- export interface RevisionedDocument {
220
- _rev: string;
221
- }
222
- export interface MaybeDocument extends MaybeIdentifiedDocument, MaybeRevisionedDocument {
223
- }
224
- export interface Document extends IdentifiedDocument, RevisionedDocument {
225
- }
226
- export type DocumentInfer<D> = (doc: D & Document) => void;
227
- export interface View<D> {
228
- map?: string | DocumentInfer<D>;
229
- reduce?: string | DocumentInfer<D>;
230
- }
231
- export interface ViewDocument<D> extends IdentifiedDocument {
232
- views: {
233
- [name: string]: View<D>;
234
- };
235
- }
236
- /** Document insert parameters.
237
- * @see POST docs: {@link http://docs.couchdb.org/en/latest/api/database/common.html#post--db}
238
- * @see PUT docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#put--db-docid} */
239
- export interface DocumentInsertParams {
240
- /** Document ID */
241
- docName?: string;
242
- /** Document’s revision if updating an existing document. Alternative to If-Match header or document key. */
243
- rev?: string;
244
- /** Stores document in batch mode. */
245
- batch?: "ok";
246
- /** Prevents insertion of a conflicting document.
247
- *
248
- * If false, a well-formed `_rev` must be included in the document. `new_edits=false` is used by the replicator to
249
- * insert documents into the target database even if that leads to the creation of conflicts.
250
- *
251
- * @default true */
252
- new_edits?: boolean;
253
- }
254
- /** Document get parameters.
255
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#get--db-docid} */
256
- export interface DocumentGetParams {
257
- /** Includes attachments bodies in response.
258
- *
259
- * @default false */
260
- attachments?: boolean;
261
- /** Includes encoding information in attachment stubs if the particular attachment is compressed.
262
- *
263
- * @default false */
264
- att_encoding_info?: boolean;
265
- /** Includes attachments only since specified revisions.
266
- *
267
- * Doesn’t includes attachments for specified revisions. */
268
- atts_since?: any[];
269
- /** Includes information about conflicts in document.
270
- *
271
- * @default false */
272
- conflicts?: boolean;
273
- /** Includes information about deleted conflicted revisions.
274
- *
275
- * @default false */
276
- deleted_conflicts?: boolean;
277
- /** Forces retrieving latest “leaf” revision, no matter what rev was requested.
278
- *
279
- * @default false */
280
- latest?: boolean;
281
- /** Includes last update sequence for the document.
282
- *
283
- * @default false */
284
- local_seq?: boolean;
285
- /** Acts same as specifying all conflicts, deleted_conflicts and revs_info query parameters.
286
- *
287
- * @default false */
288
- meta?: boolean;
289
- /** Retrieves documents of specified leaf revisions.
290
- *
291
- * Additionally, it accepts value as all to return all leaf revisions. */
292
- open_revs?: any[];
293
- /** Retrieves document of specified revision. */
294
- rev?: string;
295
- /** Includes list of all known document revisions. */
296
- revs?: boolean;
297
- /** Includes detailed information for all known document revisions.
298
- *
299
- * @default false */
300
- revs_info?: boolean;
301
- }
302
- /** Server scope */
303
- export interface ServerScope {
304
- /**
305
- * Returns a database object that allows you to perform operations against that database.
306
- * @see README: {@link https://www.npmjs.com/package/nano#nanousename}
307
- */
308
- use<D>(db: string): DocumentScope<D>;
309
- /**
310
- * Initiates new session for specified user credentials by providing Cookie value.
311
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/server/authn.html#cookie-authentication} */
312
- auth(username: string, userpass: string): Promise<DatabaseAuthResponse>;
313
- /**
314
- * Returns information about the authenticated user, including a User Context Object, the authentication method and database that were used, and a list of configured authentication handlers on the server.
315
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/server/authn.html#get--_session} */
316
- session(): Promise<DatabaseSessionResponse>;
317
- }
318
- /** Fetch with POST _all_docs parameters.
319
- * @see Docs: {@link https://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs} */
320
- export interface DocumentFetchParams {
321
- conflicts?: boolean;
322
- descending?: boolean;
323
- end_key?: string;
324
- end_key_doc_id?: string;
325
- include_docs?: boolean;
326
- inclusive_end?: boolean;
327
- key?: string;
328
- keys?: string | string[];
329
- limit?: number;
330
- skip?: number;
331
- stale?: string;
332
- start_key?: string;
333
- start_key_doc_id?: string;
334
- update_seq?: boolean;
335
- }
336
- /** Document fetch error */
337
- export interface DocumentLookupFailure {
338
- key: string;
339
- error: string;
340
- }
341
- /** Bulk API per-document response. */
342
- export interface DocumentResponseRowMeta {
343
- id: string;
344
- key: string;
345
- value: {
346
- rev: string;
347
- };
348
- error?: string;
349
- }
350
- /** Bulk API per-document response with document body. */
351
- export interface DocumentResponseRow<D> extends DocumentResponseRowMeta {
352
- doc?: D & Document;
353
- }
354
- /** Fetch with POST _all_docs response
355
- * @see Docs: {@link https://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs} */
356
- export interface DocumentFetchResponse<D> {
357
- offset: number;
358
- rows: Array<DocumentResponseRow<D> | DocumentLookupFailure>;
359
- total_rows: number;
360
- update_seq?: number | string;
361
- }
362
- /** Documents scope */
363
- export interface DocumentScope<D> {
364
- /** Initiates new session for specified user credentials by providing Cookie value.
365
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/server/authn.html#cookie-authentication} */
366
- auth(username: string, userpass: string): Promise<DatabaseAuthResponse>;
367
- /** Returns information about the authenticated user, including a User Context Object, the authentication method and database that were used, and a list of configured authentication handlers on the server.
368
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/server/authn.html#get--_session} */
369
- session(): Promise<DatabaseSessionResponse>;
370
- /** Insert a document into this database.
371
- * @see POST Docs: {@link http://docs.couchdb.org/en/latest/api/database/common.html#post--db}
372
- * @see PUT Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#put--db-docid} */
373
- insert(document: ViewDocument<D> | (D & MaybeDocument)): Promise<DocumentInsertResponse>;
374
- /**
375
- * Insert a document into this database with options.
376
- * @see POST Docs: {@link http://docs.couchdb.org/en/latest/api/database/common.html#post--db}
377
- * @see PUT Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#put--db-docid} */
378
- insert(document: ViewDocument<D> | (D & MaybeDocument), params: DocumentInsertParams | string | null): Promise<DocumentInsertResponse>;
379
- /** Fetch a document from this database.
380
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#get--db-docid} */
381
- get(docname: string): Promise<DocumentGetResponse & D>;
382
- /** Fetch a document from this database with options.
383
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#get--db-docid} */
384
- get(docname: string, params?: DocumentGetParams): Promise<DocumentGetResponse & D>;
385
- /** Delete a document from this database.
386
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid} */
387
- destroy(docname: string, rev: string): Promise<DocumentDestroyResponse>;
388
- /** Bulk insert/update/delete multiple documents in this database.
389
- * @see Docs: {@link https://docs.couchdb.org/en/stable/api/database/bulk-api.html#db-bulk-docs} */
390
- bulk(docs: BulkModifyDocsWrapper): Promise<DocumentBulkResponse[]>;
391
- /** Bulk insert/update/delete multiple documents in this database, with options.
392
- * @see Docs: {@link https://docs.couchdb.org/en/stable/api/database/bulk-api.html#db-bulk-docs} */
393
- bulk(docs: BulkModifyDocsWrapper, params: any): Promise<DocumentInsertResponse[]>;
394
- /** Create a Mango index.
395
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/database/find.html#db-index} */
396
- createIndex(indexDef: CreateIndexRequest): Promise<CreateIndexResponse>;
397
- /** Fetch a list of documents by _id with options.
398
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs} */
399
- fetch(docnames: BulkFetchDocsWrapper, params: DocumentFetchParams): Promise<DocumentFetchResponse<D>>;
400
- /** Run Mango query.
401
- * @see Docs: {@link http://docs.couchdb.org/en/latest/api/database/find.html#db-find} */
402
- find(query: MangoQuery): Promise<MangoResponse<D>>;
403
- /** Server scope */
404
- server: ServerScope;
405
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-couchdb",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "template for ts projects",
5
5
  "type": "module",
6
6
  "exports": {