insite-db 1.2.0 → 1.2.1

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.
@@ -0,0 +1,9 @@
1
+ import type { Collection } from "mongodb";
2
+ import type { CollectionOptions, InSiteDB } from "./types";
3
+ export declare class Collections extends Map<string, Collection> {
4
+ constructor(db: InSiteDB);
5
+ db: InSiteDB;
6
+ [key: string]: Collection | unknown;
7
+ ensure(name: string, options?: CollectionOptions): Promise<Collection<import("bson").Document>>;
8
+ }
9
+ //# sourceMappingURL=Collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["../src/Collections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsC,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAqB3D,qBAAa,WAAY,SAAQ,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;gBAC3C,EAAE,EAAE,QAAQ;IAOxB,EAAE,EAAE,QAAQ,CAAC;IAEb,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IAE9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;CAwC1D"}
@@ -0,0 +1,9 @@
1
+ import { MongoClient } from "mongodb";
2
+ import { Collections } from "./Collections";
3
+ import type { InSiteDB } from "./types";
4
+ export declare function connect(url: string, name: string): Promise<{
5
+ client: MongoClient;
6
+ db: InSiteDB;
7
+ collections: Collections;
8
+ }>;
9
+ //# sourceMappingURL=connect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;GAgCtD"}
@@ -0,0 +1,11 @@
1
+ import { type CreateIndexesOptions, type IndexSpecification } from "mongodb";
2
+ type IndexTuple = [IndexSpecification, CreateIndexesOptions];
3
+ declare module "mongodb" {
4
+ interface Collection {
5
+ changeListeners?: Set<(listener: ChangeStreamDocument) => void>;
6
+ changeStream?: ChangeStream;
7
+ ensureIndexes(indexesToEnsure: IndexTuple[]): Promise<void>;
8
+ }
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=Collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../src/extensions/Collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG,CAAE,kBAAkB,EAAE,oBAAoB,CAAE,CAAC;AAE/D,OAAO,QAAQ,SAAS,CAAC;IACxB,UAAU,UAAU;QACnB,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC,CAAC;QAChE,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,aAAa,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5D;CACD"}
@@ -0,0 +1,2 @@
1
+ import "./Collection";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,53 +1,4 @@
1
- declare module "types" {
2
- import type { Db } from "mongodb";
3
- import type { Collections } from "Collections";
4
- export type InSiteDB = {
5
- insiteCollections: Collections;
6
- } & Db;
7
- export type CollectionOptions = {
8
- fullDocument?: boolean;
9
- jsonSchema?: Record<string, unknown>;
10
- blockCompressor?: "none" | "snappy" | "zlib" | "zstd";
11
- watch?: boolean;
12
- };
13
- }
14
- declare module "Collections" {
15
- import type { Collection } from "mongodb";
16
- import type { CollectionOptions, InSiteDB } from "types";
17
- export class Collections extends Map<string, Collection> {
18
- constructor(db: InSiteDB);
19
- db: InSiteDB;
20
- [key: string]: Collection | unknown;
21
- ensure(name: string, options?: CollectionOptions): Promise<Collection<import("bson").Document>>;
22
- }
23
- }
24
- declare module "connect" {
25
- import { MongoClient } from "mongodb";
26
- import { Collections } from "Collections";
27
- import type { InSiteDB } from "types";
28
- export function connect(url: string, name: string): Promise<{
29
- client: MongoClient;
30
- db: InSiteDB;
31
- collections: Collections;
32
- }>;
33
- }
34
- declare module "extensions/Collection" {
35
- import { type CreateIndexesOptions, type IndexSpecification } from "mongodb";
36
- type IndexTuple = [IndexSpecification, CreateIndexesOptions];
37
- module "mongodb" {
38
- interface Collection {
39
- changeListeners?: Set<(listener: ChangeStreamDocument) => void>;
40
- changeStream?: ChangeStream;
41
- ensureIndexes(indexesToEnsure: IndexTuple[]): Promise<void>;
42
- }
43
- }
44
- }
45
- declare module "extensions/index" {
46
- import "extensions/Collection";
47
- }
48
- declare module "index" {
49
- export { connect } from "connect";
50
- import "extensions/index";
51
- export { Binary, GridFSBucket, ObjectId } from "mongodb";
52
- }
1
+ export { connect } from "./connect";
2
+ import "./extensions";
3
+ export { Binary, GridFSBucket, ObjectId } from "mongodb";
53
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types.ts","../src/Collections.ts","../src/connect.ts","../src/extensions/Collection.ts","../src/extensions/index.ts","../src/index.ts"],"names":[],"mappings":";IAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;IAClC,OAAO,KAAK,EAAE,WAAW,EAAE,oB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ChE,YAAY,CAAC,EAAE,YAAY,CAAC;YAC5B,aAAa,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;SAC5D;KACD;;;IChBD,+BAAsB;;;ICAtB,OAAO,EAAE,OAAO,EAAE,gBAAkB;IACpC,0BAAsB;IAGtB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,cAAc,CAAC;AAGtB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Db } from "mongodb";
2
+ import type { Collections } from "./Collections";
3
+ export type InSiteDB = {
4
+ insiteCollections: Collections;
5
+ } & Db;
6
+ export type CollectionOptions = {
7
+ fullDocument?: boolean;
8
+ jsonSchema?: Record<string, unknown>;
9
+ blockCompressor?: "none" | "snappy" | "zlib" | "zstd";
10
+ watch?: boolean;
11
+ };
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,MAAM,MAAM,QAAQ,GAAG;IACtB,iBAAiB,EAAE,WAAW,CAAC;CAC/B,GAAG,EAAE,CAAC;AAEP,MAAM,MAAM,iBAAiB,GAAG;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insite-db",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "MongoDB for inSite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",