Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blue-cot

Package Overview
Dependencies
Maintainers
0
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blue-cot - npm Package Compare versions

Comparing version 9.0.6 to 9.0.7

4

dist/lib/cot.d.ts

@@ -14,7 +14,7 @@ import { type ConfigParams } from './config_parser.js';

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/nano.js").MaybeDocument>(doc: D, 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: <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").MaybeDocument = import("../types/nano.js").MaybeDocument>(docs: D[]) => Promise<import("../types/nano.js").DocumentBulkResponse[]>;
bulk: <D extends import("types/types.js").NewDoc = import("types/types.js").NewDoc>(docs: D[]) => Promise<import("../types/nano.js").DocumentBulkResponse[]>;
buildQueryString: (query?: import("../types/nano.js").DocumentViewQuery) => string;

@@ -21,0 +21,0 @@ 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>>;

@@ -1,3 +0,3 @@

import type { CreateIndexRequest, CreateIndexResponse, DatabaseChangesParams, DatabaseChangesResponse, Document, DocumentBulkResponse, DocumentDestroyResponse, DocumentGetResponse, DocumentInsertParams, DocumentInsertResponse, DocumentLookupFailure, DocumentViewQuery, DocumentViewResponse, IdentifiedDocument, InfoResponse, MangoResponse, MaybeDocument } from '../types/nano.js';
import type { DocTranformer, FetchOptions, FindOptions, FindQuery, JsonRequest, TestFunction, RecoveredDoc, UpdateOptions, ViewKey, DocumentDeletedFailure, RevInfo, DocumentViewKeysQuery } from 'types/types.js';
import type { CreateIndexRequest, CreateIndexResponse, DatabaseChangesParams, DatabaseChangesResponse, Document, DocumentBulkResponse, DocumentDestroyResponse, DocumentGetResponse, DocumentInsertParams, DocumentInsertResponse, DocumentLookupFailure, DocumentViewQuery, DocumentViewResponse, IdentifiedDocument, InfoResponse, MangoResponse } from '../types/nano.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): {

@@ -9,7 +9,7 @@ docUrl: <D extends Document = Document>(docId: D["_id"]) => string;

put: (doc: IdentifiedDocument | RecoveredDoc, params?: DocumentInsertParams) => Promise<DocumentInsertResponse>;
post: <D extends MaybeDocument>(doc: D, params?: DocumentInsertParams) => Promise<DocumentInsertResponse>;
post: <D extends NewDoc>(doc: D, params?: DocumentInsertParams) => Promise<DocumentInsertResponse>;
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 MaybeDocument = MaybeDocument>(docs: D[]) => Promise<DocumentBulkResponse[]>;
bulk: <D extends NewDoc = NewDoc>(docs: D[]) => Promise<DocumentBulkResponse[]>;
buildQueryString: (query?: DocumentViewQuery) => string;

@@ -16,0 +16,0 @@ viewQuery: <D extends Document = Document, K extends ViewKey = ViewKey, V = unknown>(path: string, query?: DocumentViewQuery) => Promise<DocumentViewResponse<D, K, V>>;

@@ -55,2 +55,4 @@ import querystring from 'node:querystring';

},
// Do not replace NewDoc with MaybeDocument to not get type errors such as
// 'X' has no properties in common with type 'MaybeDocument'
post: async (doc, params) => {

@@ -133,2 +135,4 @@ validatePlainObject(doc, 'doc');

},
// Do not replace NewDoc with MaybeDocument to not get type errors such as
// 'X' has no properties in common with type 'MaybeDocument'
bulk: async (docs) => {

@@ -135,0 +139,0 @@ validateArray(docs, 'docs');

@@ -7,2 +7,5 @@ import type { Document, DocumentInsertResponse, DocumentViewQuery } from './nano.js';

export type ViewName = string;
export interface NewDoc {
_id?: DocId;
}
export interface RecoveredDoc {

@@ -9,0 +12,0 @@ _id: DocId;

@@ -5,4 +5,4 @@ import querystring from 'node:querystring'

import { isPlainObject, validateString, validateArray, validatePlainObject, isIdentifiedDocument } from './utils.js'
import type { CreateIndexRequest, CreateIndexResponse, DatabaseChangesParams, DatabaseChangesResponse, Document, DocumentBulkResponse, DocumentDestroyResponse, DocumentFetchResponse, DocumentGetResponse, DocumentInsertParams, DocumentInsertResponse, DocumentLookupFailure, DocumentViewQuery, DocumentViewResponse, IdentifiedDocument, InfoResponse, MangoResponse, MaybeDocument } from '../types/nano.js'
import type { DocTranformer, FetchOptions, FindOptions, FindQuery, JsonRequest, TestFunction, RecoveredDoc, UpdateOptions, ViewKey, DocumentDeletedFailure, RevInfo, DocumentRevertResponse, DocumentViewKeysQuery, ViewValue } from 'types/types.js'
import type { CreateIndexRequest, CreateIndexResponse, DatabaseChangesParams, DatabaseChangesResponse, Document, DocumentBulkResponse, DocumentDestroyResponse, DocumentFetchResponse, DocumentGetResponse, DocumentInsertParams, DocumentInsertResponse, DocumentLookupFailure, DocumentViewQuery, DocumentViewResponse, IdentifiedDocument, InfoResponse, MangoResponse } from '../types/nano.js'
import type { DocTranformer, FetchOptions, FindOptions, FindQuery, JsonRequest, NewDoc, TestFunction, RecoveredDoc, UpdateOptions, ViewKey, DocumentDeletedFailure, RevInfo, DocumentRevertResponse, DocumentViewKeysQuery, ViewValue } from 'types/types.js'

@@ -54,3 +54,5 @@ export default function (jsonRequest: JsonRequest, dbName: string) {

post: async <D extends MaybeDocument> (doc: D, params?: DocumentInsertParams) => {
// Do not replace NewDoc with MaybeDocument to not get type errors such as
// 'X' has no properties in common with type 'MaybeDocument'
post: async <D extends NewDoc> (doc: D, params?: DocumentInsertParams) => {
validatePlainObject(doc, 'doc')

@@ -122,3 +124,5 @@ const url = buildUrl(`/${dbName}`, params)

bulk: async <D extends MaybeDocument = MaybeDocument> (docs: D[]) => {
// Do not replace NewDoc with MaybeDocument to not get type errors such as
// 'X' has no properties in common with type 'MaybeDocument'
bulk: async <D extends NewDoc = NewDoc> (docs: D[]) => {
validateArray(docs, 'docs')

@@ -125,0 +129,0 @@ const url = `/${dbName}/_bulk_docs`

@@ -30,3 +30,3 @@ {

],
"version": "9.0.6",
"version": "9.0.7",
"main": "dist/lib/cot.js",

@@ -33,0 +33,0 @@ "dependencies": {

@@ -9,2 +9,7 @@ import type { Document, DocumentInsertResponse, DocumentViewQuery } from './nano.js'

export interface NewDoc {
_id?: DocId
// _rev: never // Setting it to never triggers "_rev is declared here." errors
}
export interface RecoveredDoc {

@@ -11,0 +16,0 @@ _id: DocId

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc