@cranq/document-utils
Advanced tools
Comparing version 2.0.2 to 2.0.3
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function appendCollection<DS extends DocumentStore<any>, C extends keyof DS & string>(store: DS, collectionId: C, documents: DS[C]): DS; | ||
//# sourceMappingURL=appendCollection.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function appendCollectionMutable<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documents: DS[C]): void; | ||
//# sourceMappingURL=appendCollectionMutable.d.ts.map |
import { DocumentGenerator } from "../types/DocumentGenerator"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function appendDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documentId: string | number, document: Partial<DocumentGenerator<D>>): DS; | ||
//# sourceMappingURL=appendDocument.d.ts.map |
import { DocumentGenerator } from "../types/DocumentGenerator"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function appendDocumentMutable<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documentId: string, document: Partial<DocumentGenerator<D>>): void; | ||
//# sourceMappingURL=appendDocumentMutable.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function deleteDocumentMutable<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documentId: string): void; | ||
//# sourceMappingURL=deleteDocumentMutable.d.ts.map |
import { RestoreDocument } from "../restore/types/RestoreDocument"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function getDeepDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documentId: string): RestoreDocument<D, DS> | undefined; | ||
//# sourceMappingURL=getDeepDocument.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function getDocument<DS extends DocumentStore<any>, C extends keyof DS & string>(store: DS, collectionId: C, documentId: string): DS[C][string] | undefined; | ||
//# sourceMappingURL=getDocument.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function getField<DS extends DocumentStore<any>, C extends keyof DS & string, F extends keyof DS[C][string] & string>(store: DS, collectionId: C, documentId: string, fieldId: F): DS[C][string][F] | undefined; | ||
//# sourceMappingURL=getField.d.ts.map |
import { RestoreDocument } from "../restore/types/RestoreDocument"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function setDeepDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends RestoreDocument<DS[C][string], DS>>(store: DS, collectionId: C, documentId: string, document: D | undefined): DS; | ||
//# sourceMappingURL=setDeepDocument.d.ts.map |
import { RestoreDocument } from "../restore/types/RestoreDocument"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function setDeepDocumentMutable<DS extends DocumentStore<any>, C extends keyof DS & string, D extends RestoreDocument<DS[C][string], DS>>(store: DS, collectionId: C, documentId: string, document: D | undefined): void; | ||
//# sourceMappingURL=setDeepDocumentMutable.d.ts.map |
import { NodeGenerator } from "@cranq/tree-utils"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function setDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documentId: string, document: D | NodeGenerator<D> | undefined): DS; | ||
//# sourceMappingURL=setDocument.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function setDocumentMutable<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(store: DS, collectionId: C, documentId: string, document: D | undefined): void; | ||
//# sourceMappingURL=setDocumentMutable.d.ts.map |
import { NodeGenerator } from "@cranq/tree-utils"; | ||
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function setField<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string], F extends keyof D & string>(store: DS, collectionId: C, documentId: string | number, fieldId: F, value: D[F] | NodeGenerator<D[F]> | undefined): DS; | ||
//# sourceMappingURL=setField.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function setFieldMutable<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string], F extends keyof D & string>(store: DS, collectionId: C, documentId: string | number, fieldId: F, value: D[F] | undefined): void; | ||
//# sourceMappingURL=setFieldMutable.d.ts.map |
@@ -31,2 +31,1 @@ export * from "./access/appendCollection"; | ||
export * from "./types/Reference"; | ||
//# sourceMappingURL=index.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { RestoreField } from "./types/RestoreField"; | ||
export declare function restoreArrayField<DS extends DocumentStore<any>>(field: Array<any>, store: DS): RestoreField<typeof field, DS>; | ||
//# sourceMappingURL=restoreArrayField.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { RestoreField } from "./types/RestoreField"; | ||
export declare function restoreDictionaryField<DS extends DocumentStore<any>>(field: Record<string, any>, store: DS): RestoreField<typeof field, DS>; | ||
//# sourceMappingURL=restoreDictionaryField.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { RestoreDocument } from "./types/RestoreDocument"; | ||
export declare function restoreDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(truncatedDocument: D, store: DS): RestoreDocument<D, DS>; | ||
//# sourceMappingURL=restoreDocument.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { RestoreField } from "./types/RestoreField"; | ||
export declare function restoreField<T, DS extends DocumentStore<any>>(field: any, store: DS): RestoreField<typeof field, DS>; | ||
//# sourceMappingURL=restoreField.d.ts.map |
@@ -5,2 +5,1 @@ import { DocumentStore } from "../types/DocumentStore"; | ||
export declare function restoreReference<DS extends DocumentStore<any>, C extends keyof DS & string>(reference: Reference<C>, store: DS): RestoreField<typeof reference, DS> | undefined; | ||
//# sourceMappingURL=restoreReference.d.ts.map |
@@ -8,2 +8,1 @@ import { DocumentStore } from "../../types/DocumentStore"; | ||
}; | ||
//# sourceMappingURL=RestoreDocument.d.ts.map |
@@ -9,2 +9,1 @@ import { DocumentStore } from "../../types/DocumentStore"; | ||
} : F; | ||
//# sourceMappingURL=RestoreField.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { TraverseCallback } from "./types/TraverseCallback"; | ||
export declare function traverseDocumentReferences<DS extends DocumentStore<any>, C extends keyof DS & string, D extends DS[C][string]>(document: D, store: DS, callback: TraverseCallback<DS>): void; | ||
//# sourceMappingURL=traverseDocumentReferences.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { TraverseCallback } from "./types/TraverseCallback"; | ||
export declare function traverseFieldReferences<DS extends DocumentStore<any>>(field: any, store: DS, callback: TraverseCallback<DS>): void; | ||
//# sourceMappingURL=traverseFieldReferences.d.ts.map |
import { DocumentStore } from "../../types/DocumentStore"; | ||
export declare type TraverseCallback<DS extends DocumentStore<any>> = (collectionId: keyof DS & string, documentId: string, document: DS[keyof DS & string][string] | undefined) => void; | ||
//# sourceMappingURL=TraverseCallback.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { TruncateField } from "./types/TruncateField"; | ||
export declare function truncateArrayField(field: Array<any>, excess: DocumentStore<any>): TruncateField<typeof field>; | ||
//# sourceMappingURL=truncateArrayField.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { TruncateField } from "./types/TruncateField"; | ||
export declare function truncateDictionaryField(field: Record<string, any>, excess: DocumentStore<any>): TruncateField<typeof field>; | ||
//# sourceMappingURL=truncateDictionaryField.d.ts.map |
@@ -5,2 +5,1 @@ import { Document } from "../types/Document"; | ||
export declare function truncateDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends Document<C>>(document: D, excess: DS): TruncateDocument<D>; | ||
//# sourceMappingURL=truncateDocument.d.ts.map |
import { DocumentStore } from "../types/DocumentStore"; | ||
import { TruncateField } from "./types/TruncateField"; | ||
export declare function truncateField(field: any, excess: DocumentStore<any>): TruncateField<typeof field>; | ||
//# sourceMappingURL=truncateField.d.ts.map |
@@ -5,2 +5,1 @@ import { Document } from "../types/Document"; | ||
export declare function truncateSubDocument<DS extends DocumentStore<any>, C extends keyof DS & string, D extends Document<C>>(subDocument: D, excess: DS): Reference<C>; | ||
//# sourceMappingURL=truncateSubDocument.d.ts.map |
@@ -8,2 +8,1 @@ import { Document } from "../../types/Document"; | ||
}; | ||
//# sourceMappingURL=TruncateDocument.d.ts.map |
@@ -8,2 +8,1 @@ import { Document } from "../../types/Document"; | ||
} : F; | ||
//# sourceMappingURL=TruncateField.d.ts.map |
export declare type Document<C extends string> = { | ||
__collectionId: C; | ||
}; | ||
//# sourceMappingURL=Document.d.ts.map |
@@ -6,2 +6,1 @@ import { TruncateDocument } from "../truncate/types/TruncateDocument"; | ||
} | ||
//# sourceMappingURL=DocumentCollection.d.ts.map |
@@ -5,2 +5,1 @@ import { Document } from "./Document"; | ||
}; | ||
//# sourceMappingURL=DocumentGenerator.d.ts.map |
@@ -6,2 +6,1 @@ import { Document } from "./Document"; | ||
}; | ||
//# sourceMappingURL=DocumentStore.d.ts.map |
@@ -5,2 +5,1 @@ export declare type Reference<C extends string> = { | ||
}; | ||
//# sourceMappingURL=Reference.d.ts.map |
export declare const uuid: () => string; | ||
//# sourceMappingURL=uuid.d.ts.map |
{ | ||
"name": "@cranq/document-utils", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Document store manipulation utilities", | ||
@@ -8,3 +8,7 @@ "scripts": { | ||
"test": "tsc --noEmit && jest", | ||
"ci": "npm ci && npm run build && npm run test" | ||
"ci": "npm ci && npm run build && npm run test", | ||
"rebuild": "npm run clean && npm run build", | ||
"clean": "npx rimraf ./dist ./cranq-document-utils-*.tgz", | ||
"prepack": "npm run rebuild", | ||
"prepublishOnly": "npm run test" | ||
}, | ||
@@ -25,4 +29,4 @@ "author": "Dan Stocker", | ||
"dependencies": { | ||
"@cranq/object-utils": "1.0.1", | ||
"@cranq/tree-utils": "2.1.1", | ||
"@cranq/object-utils": "1.0.2", | ||
"@cranq/tree-utils": "2.1.4", | ||
"@types/uuid": "^8.0.0", | ||
@@ -29,0 +33,0 @@ "uuid": "^8.3.0" |
Sorry, the diff of this file is too big to display
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
283467
4141
0
99
+ Added@cranq/object-utils@1.0.2(transitive)
+ Added@cranq/tree-utils@2.1.4(transitive)
- Removed@cranq/object-utils@1.0.1(transitive)
- Removed@cranq/tree-utils@2.1.1(transitive)
Updated@cranq/object-utils@1.0.2
Updated@cranq/tree-utils@2.1.4