@atscript/mongo 0.0.1 → 0.0.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/dist/index.cjs +2 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +2 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,8 @@ const mongodb = __toESM(require("mongodb"));
|
|
|
30
30
|
const primitives = { mongo: { extensions: {
|
|
31
31
|
objectId: {
|
|
32
32
|
type: "string",
|
|
33
|
-
documentation: "Represents a **MongoDB ObjectId**.\n\n- Stored as a **string** but can be converted to an ObjectId at runtime.\n- Useful for handling `_id` fields and queries that require ObjectId conversion.\n- Automatically converts string `_id` values into **MongoDB ObjectId** when needed.\n\n**Example:**\n```atscript\nuserId: mongo.objectId\n```\n"
|
|
33
|
+
documentation: "Represents a **MongoDB ObjectId**.\n\n- Stored as a **string** but can be converted to an ObjectId at runtime.\n- Useful for handling `_id` fields and queries that require ObjectId conversion.\n- Automatically converts string `_id` values into **MongoDB ObjectId** when needed.\n\n**Example:**\n```atscript\nuserId: mongo.objectId\n```\n",
|
|
34
|
+
expect: { pattern: /^[a-fA-F0-9]{24}$/ }
|
|
34
35
|
},
|
|
35
36
|
vector: {
|
|
36
37
|
type: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TAtscriptPlugin } from '@atscript/core';
|
|
2
|
-
import { TAtscriptAnnotatedType, TAtscriptTypeObject, TMetadataMap } from '@atscript/typescript';
|
|
2
|
+
import { TAtscriptAnnotatedTypeConstructor, TAtscriptAnnotatedType, TAtscriptTypeObject, TMetadataMap } from '@atscript/typescript';
|
|
3
3
|
import * as mongodb from 'mongodb';
|
|
4
4
|
import { MongoClient, Collection } from 'mongodb';
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ declare class AsMongo {
|
|
|
21
21
|
protected collectionsList?: Promise<Set<string>>;
|
|
22
22
|
protected getCollectionsList(): Promise<Set<string>>;
|
|
23
23
|
collectionExists(name: string): Promise<boolean>;
|
|
24
|
-
getCollection<T extends
|
|
24
|
+
getCollection<T extends TAtscriptAnnotatedTypeConstructor>(type: T, logger?: TGenericLogger): AsCollection<T>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
type TPlainIndex = {
|
|
@@ -34,7 +34,7 @@ type TSearchIndex = {
|
|
|
34
34
|
definition: TMongoSearchIndexDefinition;
|
|
35
35
|
};
|
|
36
36
|
type TIndex = TPlainIndex | TSearchIndex;
|
|
37
|
-
declare class AsCollection<T extends
|
|
37
|
+
declare class AsCollection<T extends TAtscriptAnnotatedTypeConstructor> {
|
|
38
38
|
protected readonly asMongo: AsMongo;
|
|
39
39
|
protected readonly _type: T;
|
|
40
40
|
protected readonly logger: TGenericLogger;
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,8 @@ import { MongoClient } from "mongodb";
|
|
|
6
6
|
const primitives = { mongo: { extensions: {
|
|
7
7
|
objectId: {
|
|
8
8
|
type: "string",
|
|
9
|
-
documentation: "Represents a **MongoDB ObjectId**.\n\n- Stored as a **string** but can be converted to an ObjectId at runtime.\n- Useful for handling `_id` fields and queries that require ObjectId conversion.\n- Automatically converts string `_id` values into **MongoDB ObjectId** when needed.\n\n**Example:**\n```atscript\nuserId: mongo.objectId\n```\n"
|
|
9
|
+
documentation: "Represents a **MongoDB ObjectId**.\n\n- Stored as a **string** but can be converted to an ObjectId at runtime.\n- Useful for handling `_id` fields and queries that require ObjectId conversion.\n- Automatically converts string `_id` values into **MongoDB ObjectId** when needed.\n\n**Example:**\n```atscript\nuserId: mongo.objectId\n```\n",
|
|
10
|
+
expect: { pattern: /^[a-fA-F0-9]{24}$/ }
|
|
10
11
|
},
|
|
11
12
|
vector: {
|
|
12
13
|
type: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/mongo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Mongodb plugin for atscript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"license": "ISC",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"mongodb": "^6.13.0",
|
|
38
|
-
"@atscript/core": "^0.0.
|
|
39
|
-
"@atscript/typescript": "^0.0.
|
|
38
|
+
"@atscript/core": "^0.0.16",
|
|
39
|
+
"@atscript/typescript": "^0.0.16"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"vitest": "^3.0.0"
|