@prisma/orm-mongo 0.16.0-dev.36
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/LICENSE +201 -0
- package/README.md +54 -0
- package/dist/adapter.d.mts +1 -0
- package/dist/adapter.mjs +2 -0
- package/dist/adapter__codec-ids.d.mts +1 -0
- package/dist/adapter__codec-ids.mjs +2 -0
- package/dist/adapter__codec-types.d.mts +1 -0
- package/dist/adapter__codec-types.mjs +2 -0
- package/dist/adapter__codecs.d.mts +1 -0
- package/dist/adapter__codecs.mjs +2 -0
- package/dist/adapter__control.d.mts +3 -0
- package/dist/adapter__control.mjs +3 -0
- package/dist/adapter__runtime.d.mts +3 -0
- package/dist/adapter__runtime.mjs +3 -0
- package/dist/bin__prisma-next.mjs +3 -0
- package/dist/bson.d.mts +2 -0
- package/dist/bson.mjs +2 -0
- package/dist/components.d.mts +1 -0
- package/dist/components.mjs +2 -0
- package/dist/components__authoring.d.mts +1 -0
- package/dist/components__authoring.mjs +2 -0
- package/dist/components__codec.d.mts +1 -0
- package/dist/components__codec.mjs +2 -0
- package/dist/components__components.d.mts +1 -0
- package/dist/components__components.mjs +2 -0
- package/dist/components__control.d.mts +1 -0
- package/dist/components__control.mjs +2 -0
- package/dist/components__emission.d.mts +1 -0
- package/dist/components__emission.mjs +2 -0
- package/dist/components__execution.d.mts +1 -0
- package/dist/components__execution.mjs +2 -0
- package/dist/components__ir.d.mts +1 -0
- package/dist/components__ir.mjs +2 -0
- package/dist/components__psl-ast.d.mts +1 -0
- package/dist/components__psl-ast.mjs +2 -0
- package/dist/components__runtime.d.mts +1 -0
- package/dist/components__runtime.mjs +2 -0
- package/dist/components__utils.d.mts +1 -0
- package/dist/components__utils.mjs +2 -0
- package/dist/config.d.mts +19 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +40 -0
- package/dist/config.mjs.map +1 -0
- package/dist/contract-builder.d.mts +122 -0
- package/dist/contract-builder.d.mts.map +1 -0
- package/dist/contract-builder.mjs +22 -0
- package/dist/contract-builder.mjs.map +1 -0
- package/dist/contract.d.mts +1 -0
- package/dist/contract.mjs +2 -0
- package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -0
- package/dist/contract__apply-specifier-default-control-policy.mjs +2 -0
- package/dist/contract__contract-validation-error.d.mts +1 -0
- package/dist/contract__contract-validation-error.mjs +2 -0
- package/dist/contract__default-namespace.d.mts +1 -0
- package/dist/contract__default-namespace.mjs +2 -0
- package/dist/contract__enum-accessor.d.mts +1 -0
- package/dist/contract__enum-accessor.mjs +2 -0
- package/dist/contract__hashing-utils.d.mts +1 -0
- package/dist/contract__hashing-utils.mjs +2 -0
- package/dist/contract__hashing.d.mts +1 -0
- package/dist/contract__hashing.mjs +2 -0
- package/dist/contract__is-plain-record.d.mts +1 -0
- package/dist/contract__is-plain-record.mjs +2 -0
- package/dist/contract__resolve-domain-model.d.mts +1 -0
- package/dist/contract__resolve-domain-model.mjs +2 -0
- package/dist/contract__types.d.mts +1 -0
- package/dist/contract__types.mjs +2 -0
- package/dist/contract__validate-domain.d.mts +1 -0
- package/dist/contract__validate-domain.mjs +2 -0
- package/dist/control.d.mts +11 -0
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +21 -0
- package/dist/control.mjs.map +1 -0
- package/dist/driver.d.mts +1 -0
- package/dist/driver.mjs +2 -0
- package/dist/driver__control.d.mts +3 -0
- package/dist/driver__control.mjs +3 -0
- package/dist/family-contract.d.mts +1 -0
- package/dist/family-contract.mjs +2 -0
- package/dist/family-contract__canonicalization-hooks.d.mts +1 -0
- package/dist/family-contract__canonicalization-hooks.mjs +2 -0
- package/dist/family-contract__entity-kinds.d.mts +1 -0
- package/dist/family-contract__entity-kinds.mjs +2 -0
- package/dist/family-runtime.d.mts +1 -0
- package/dist/family-runtime.mjs +2 -0
- package/dist/family.d.mts +2 -0
- package/dist/family.mjs +2 -0
- package/dist/family__control-adapter.d.mts +1 -0
- package/dist/family__control-adapter.mjs +2 -0
- package/dist/family__control.d.mts +1 -0
- package/dist/family__control.mjs +2 -0
- package/dist/family__ir.d.mts +1 -0
- package/dist/family__ir.mjs +2 -0
- package/dist/family__migration.d.mts +1 -0
- package/dist/family__migration.mjs +2 -0
- package/dist/family__pack.d.mts +3 -0
- package/dist/family__pack.mjs +3 -0
- package/dist/family__runtime.d.mts +1 -0
- package/dist/family__runtime.mjs +2 -0
- package/dist/family__schema-verify.d.mts +1 -0
- package/dist/family__schema-verify.mjs +2 -0
- package/dist/migration-tools__aggregate.d.mts +1 -0
- package/dist/migration-tools__aggregate.mjs +2 -0
- package/dist/migration-tools__contract-snapshot-store.d.mts +1 -0
- package/dist/migration-tools__contract-snapshot-store.mjs +2 -0
- package/dist/migration-tools__hash.d.mts +1 -0
- package/dist/migration-tools__hash.mjs +2 -0
- package/dist/migration-tools__io.d.mts +1 -0
- package/dist/migration-tools__io.mjs +2 -0
- package/dist/migration-tools__spaces.d.mts +1 -0
- package/dist/migration-tools__spaces.mjs +2 -0
- package/dist/mongo-static-BdSGXYgQ-DSA-2DiK.d.mts +22 -0
- package/dist/mongo-static-BdSGXYgQ-DSA-2DiK.d.mts.map +1 -0
- package/dist/mongo-static-_wy-fC4P-mXlhePy0.mjs +38 -0
- package/dist/mongo-static-_wy-fC4P-mXlhePy0.mjs.map +1 -0
- package/dist/orm.d.mts +1 -0
- package/dist/orm.mjs +2 -0
- package/dist/query-ast.d.mts +1 -0
- package/dist/query-ast.mjs +2 -0
- package/dist/query-ast__control.d.mts +1 -0
- package/dist/query-ast__control.mjs +2 -0
- package/dist/query-ast__execution.d.mts +1 -0
- package/dist/query-ast__execution.mjs +2 -0
- package/dist/query-builder.d.mts +1 -0
- package/dist/query-builder.mjs +2 -0
- package/dist/query-builder__contract-free.d.mts +1 -0
- package/dist/query-builder__contract-free.mjs +2 -0
- package/dist/runtime.d.mts +105 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +173 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/static.d.mts +2 -0
- package/dist/static.mjs +2 -0
- package/dist/target.d.mts +2 -0
- package/dist/target.mjs +2 -0
- package/dist/target__codec-types.d.mts +1 -0
- package/dist/target__codec-types.mjs +2 -0
- package/dist/target__control.d.mts +1 -0
- package/dist/target__control.mjs +2 -0
- package/dist/target__migration.d.mts +1 -0
- package/dist/target__migration.mjs +2 -0
- package/dist/target__pack.d.mts +3 -0
- package/dist/target__pack.mjs +3 -0
- package/dist/target__runtime.d.mts +3 -0
- package/dist/target__runtime.mjs +3 -0
- package/dist/utils.d.mts +1 -0
- package/dist/utils.mjs +2 -0
- package/dist/utils__abortable.d.mts +1 -0
- package/dist/utils__abortable.mjs +2 -0
- package/dist/utils__array-equal.d.mts +1 -0
- package/dist/utils__array-equal.mjs +2 -0
- package/dist/utils__assertions.d.mts +1 -0
- package/dist/utils__assertions.mjs +2 -0
- package/dist/utils__canonical-stringify.d.mts +1 -0
- package/dist/utils__canonical-stringify.mjs +2 -0
- package/dist/utils__casts.d.mts +1 -0
- package/dist/utils__casts.mjs +2 -0
- package/dist/utils__defined.d.mts +1 -0
- package/dist/utils__defined.mjs +2 -0
- package/dist/utils__hash-content.d.mts +1 -0
- package/dist/utils__hash-content.mjs +2 -0
- package/dist/utils__internal-error.d.mts +1 -0
- package/dist/utils__internal-error.mjs +2 -0
- package/dist/utils__json.d.mts +1 -0
- package/dist/utils__json.mjs +2 -0
- package/dist/utils__promise.d.mts +1 -0
- package/dist/utils__promise.mjs +2 -0
- package/dist/utils__redact-db-url.d.mts +1 -0
- package/dist/utils__redact-db-url.mjs +2 -0
- package/dist/utils__result.d.mts +1 -0
- package/dist/utils__result.mjs +2 -0
- package/dist/utils__simplify-deep.d.mts +1 -0
- package/dist/utils__simplify-deep.mjs +2 -0
- package/dist/utils__structured-error.d.mts +1 -0
- package/dist/utils__structured-error.mjs +2 -0
- package/dist/utils__types.d.mts +1 -0
- package/dist/utils__types.mjs +2 -0
- package/dist/value.d.mts +1 -0
- package/dist/value.mjs +2 -0
- package/dist/value__mongodb-types.d.mts +1 -0
- package/dist/value__mongodb-types.mjs +2 -0
- package/dist/vite-plugin-contract-emit.d.mts +1 -0
- package/dist/vite-plugin-contract-emit.mjs +2 -0
- package/package.json +135 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-builder.mjs","names":[],"sources":["../../../../3-extensions/mongo/dist/contract-builder.mjs"],"sourcesContent":["import { bindEnumType, buildBoundContract, field, index, member, model, rel, valueObject } from \"@internal/mongo-contract-ts/contract-builder\";\nimport mongoFamilyPack from \"@internal/family-mongo/pack\";\nimport mongoTargetPack from \"@internal/target-mongo/pack\";\n//#region src/contract/define-contract.ts\nfunction defineContract(definition, factory) {\n\tif (factory !== void 0) return buildBoundContract(mongoFamilyPack, mongoTargetPack, definition, factory);\n\treturn buildBoundContract(mongoFamilyPack, mongoTargetPack, definition);\n}\n//#endregion\n//#region src/contract/enum-type.ts\n/**\n* The `enumType` authors call when building a Mongo contract (re-exported\n* from `@internal/mongo/contract-builder`).\n*\n* `bindEnumType` is the core, codec-agnostic `enumType` factory; calling it\n* with the Mongo target pack's codec typemap constrains member values to the\n* codec's input type so `mongo/string@1` requires string values and a\n* mismatch is a compile error.\n*/\nconst enumType = bindEnumType();\n//#endregion\nexport { defineContract, enumType, field, index, member, model, rel, valueObject };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;AAIA,SAAS,eAAe,YAAY,SAAS;CAC5C,IAAI,YAAY,KAAK,GAAG,OAAO,mBAAmB,iBAAiB,iBAAiB,YAAY,OAAO;CACvG,OAAO,mBAAmB,iBAAiB,iBAAiB,UAAU;AACvE;;;;;;;;;;AAYA,MAAM,WAAW,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/apply-specifier-default-control-policy";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/contract-validation-error";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/default-namespace";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/enum-accessor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/hashing-utils";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/hashing";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/is-plain-record";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/resolve-domain-model";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-framework/contract/validate-domain";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ControlClient, ControlClientOptions } from "@prisma/orm-toolchain/cli/control-api";
|
|
2
|
+
//#region ../../../3-extensions/mongo/dist/control.d.mts
|
|
3
|
+
//#region src/exports/control.d.ts
|
|
4
|
+
interface MongoControlClientOptions {
|
|
5
|
+
readonly connection?: string;
|
|
6
|
+
readonly extensions?: ControlClientOptions['extensions'];
|
|
7
|
+
}
|
|
8
|
+
declare function createMongoControlClient(options?: MongoControlClientOptions): ControlClient;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type ControlClient, MongoControlClientOptions, createMongoControlClient };
|
|
11
|
+
//# sourceMappingURL=control.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/control.d.mts"],"mappings":";;;UAEU;WACC;WACA,aAAa;;iBAEP,yBAAyB,UAAU,4BAA4B"}
|
package/dist/control.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import mongoAdapter from "@prisma/orm-target-mongo/adapter/control";
|
|
2
|
+
import mongoDriver from "@prisma/orm-target-mongo/driver/control";
|
|
3
|
+
import { mongoFamilyDescriptor } from "@prisma/orm-family-mongo/family/control";
|
|
4
|
+
import { mongoTargetDescriptor } from "@prisma/orm-target-mongo/target/control";
|
|
5
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
6
|
+
import { createControlClient } from "@prisma/orm-toolchain/cli/control-api";
|
|
7
|
+
//#region ../../../3-extensions/mongo/dist/control.mjs
|
|
8
|
+
function createMongoControlClient(options = {}) {
|
|
9
|
+
return createControlClient({
|
|
10
|
+
family: mongoFamilyDescriptor,
|
|
11
|
+
target: mongoTargetDescriptor,
|
|
12
|
+
adapter: mongoAdapter,
|
|
13
|
+
driver: mongoDriver,
|
|
14
|
+
...ifDefined("connection", options.connection),
|
|
15
|
+
...ifDefined("extensions", options.extensions)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { createMongoControlClient };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=control.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../../../../3-extensions/mongo/dist/control.mjs"],"sourcesContent":["import mongoAdapter from \"@internal/adapter-mongo/control\";\nimport mongoDriver from \"@internal/driver-mongo/control\";\nimport { mongoFamilyDescriptor } from \"@internal/family-mongo/control\";\nimport { mongoTargetDescriptor } from \"@internal/target-mongo/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { createControlClient } from \"@internal/cli/control-api\";\n//#region src/exports/control.ts\nfunction createMongoControlClient(options = {}) {\n\treturn createControlClient({\n\t\tfamily: mongoFamilyDescriptor,\n\t\ttarget: mongoTargetDescriptor,\n\t\tadapter: mongoAdapter,\n\t\tdriver: mongoDriver,\n\t\t...ifDefined(\"connection\", options.connection),\n\t\t...ifDefined(\"extensions\", options.extensions)\n\t});\n}\n//#endregion\nexport { createMongoControlClient };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,yBAAyB,UAAU,CAAC,GAAG;CAC/C,OAAO,oBAAoB;EAC1B,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,GAAG,UAAU,cAAc,QAAQ,UAAU;EAC7C,GAAG,UAAU,cAAc,QAAQ,UAAU;CAC9C,CAAC;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-target-mongo/driver";
|
package/dist/driver.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/contract";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/contract/canonicalization-hooks";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/contract/entity-kinds";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/runtime";
|
package/dist/family.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/family/control-adapter";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/family/control";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/family/ir";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/family/migration";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/family/runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/family/schema-verify";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-toolchain/migration-tools/aggregate";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-toolchain/migration-tools/contract-snapshot-store";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-toolchain/migration-tools/hash";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-toolchain/migration-tools/io";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-toolchain/migration-tools/spaces";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MongoRawClient } from "@prisma/orm-family-mongo/orm";
|
|
2
|
+
import { MongoExecutionContext } from "@prisma/orm-family-mongo/runtime";
|
|
3
|
+
import { NamespacedEnums } from "@prisma/orm-framework/contract/enum-accessor";
|
|
4
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
5
|
+
import { mongoQuery } from "@prisma/orm-family-mongo/query-builder";
|
|
6
|
+
import { AnyMongoTypeMaps, MongoContract, MongoContractWithTypeMaps } from "@prisma/orm-family-mongo/contract";
|
|
7
|
+
//#region ../../../3-extensions/mongo/dist/mongo-static-BdSGXYgQ.d.mts
|
|
8
|
+
//#region src/static/mongo-static.d.ts
|
|
9
|
+
type UnboundEnums<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> = NamespacedEnums<TContract>[typeof UNBOUND_NAMESPACE_ID];
|
|
10
|
+
interface MongoStaticContext<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> {
|
|
11
|
+
readonly context: MongoExecutionContext<TContract>;
|
|
12
|
+
readonly contract: TContract;
|
|
13
|
+
readonly enums: UnboundEnums<TContract>;
|
|
14
|
+
readonly query: ReturnType<typeof mongoQuery<TContract>>;
|
|
15
|
+
readonly raw: MongoRawClient<TContract>;
|
|
16
|
+
}
|
|
17
|
+
declare function mongoStatic<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>>(options: {
|
|
18
|
+
readonly contractJson: unknown;
|
|
19
|
+
}): MongoStaticContext<TContract>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { mongoStatic as n, MongoStaticContext as t };
|
|
22
|
+
//# sourceMappingURL=mongo-static-BdSGXYgQ-DSA-2DiK.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-static-BdSGXYgQ-DSA-2DiK.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/mongo-static-BdSGXYgQ.d.mts"],"mappings":";;;;;;;;KAOK,aAAa,kBAAkB,0BAA0B,eAAe,qBAAqB,gBAAgB,kBAAkB;UAC1H,mBAAmB,kBAAkB,0BAA0B,eAAe;WAC7E,SAAS,sBAAsB;WAC/B,UAAU;WACV,OAAO,aAAa;WACpB,OAAO,kBAAkB,WAAW;WACpC,KAAK,eAAe;;iBAEd,YAAY,kBAAkB,0BAA0B,eAAe,mBAAmB;WAChG;IACP,mBAAmB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MongoContractSerializer } from "@prisma/orm-family-mongo/family/ir";
|
|
2
|
+
import { mongoRaw } from "@prisma/orm-family-mongo/orm";
|
|
3
|
+
import { createMongoExecutionContext, createMongoExecutionStack } from "@prisma/orm-family-mongo/runtime";
|
|
4
|
+
import mongoRuntimeAdapter from "@prisma/orm-target-mongo/adapter/runtime";
|
|
5
|
+
import { buildNamespacedEnums } from "@prisma/orm-framework/contract/enum-accessor";
|
|
6
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
7
|
+
import { mongoQuery } from "@prisma/orm-family-mongo/query-builder";
|
|
8
|
+
import mongoRuntimeTarget from "@prisma/orm-target-mongo/target/runtime";
|
|
9
|
+
import { assertDefined } from "@prisma/orm-framework/utils/assertions";
|
|
10
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
11
|
+
//#region ../../../3-extensions/mongo/dist/mongo-static-_wy-fC4P.mjs
|
|
12
|
+
function extractUnboundEnums(contract) {
|
|
13
|
+
const enums = buildNamespacedEnums(contract.domain)[UNBOUND_NAMESPACE_ID];
|
|
14
|
+
assertDefined(enums, "the unbound namespace always exists on a mongo builder output");
|
|
15
|
+
return enums;
|
|
16
|
+
}
|
|
17
|
+
function buildMongoStaticContext(contract) {
|
|
18
|
+
return {
|
|
19
|
+
context: createMongoExecutionContext({
|
|
20
|
+
contract,
|
|
21
|
+
stack: createMongoExecutionStack({
|
|
22
|
+
target: mongoRuntimeTarget,
|
|
23
|
+
adapter: mongoRuntimeAdapter
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
contract,
|
|
27
|
+
enums: extractUnboundEnums(contract),
|
|
28
|
+
query: mongoQuery({ contractJson: contract }),
|
|
29
|
+
raw: mongoRaw({ contract })
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function mongoStatic(options) {
|
|
33
|
+
return buildMongoStaticContext(blindCast(new MongoContractSerializer().deserializeContract(options.contractJson)));
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { mongoStatic as n, buildMongoStaticContext as t };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=mongo-static-_wy-fC4P-mXlhePy0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-static-_wy-fC4P-mXlhePy0.mjs","names":[],"sources":["../../../../3-extensions/mongo/dist/mongo-static-_wy-fC4P.mjs"],"sourcesContent":["import { MongoContractSerializer } from \"@internal/family-mongo/ir\";\nimport { mongoRaw } from \"@internal/mongo-orm\";\nimport { createMongoExecutionContext, createMongoExecutionStack } from \"@internal/mongo-runtime\";\nimport mongoRuntimeAdapter from \"@internal/adapter-mongo/runtime\";\nimport { buildNamespacedEnums } from \"@internal/contract/enum-accessor\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { mongoQuery } from \"@internal/mongo-query-builder\";\nimport mongoRuntimeTarget from \"@internal/target-mongo/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/static/mongo-static.ts\nfunction extractUnboundEnums(contract) {\n\tconst enums = buildNamespacedEnums(contract.domain)[UNBOUND_NAMESPACE_ID];\n\tassertDefined(enums, \"the unbound namespace always exists on a mongo builder output\");\n\treturn enums;\n}\nfunction buildMongoStaticContext(contract) {\n\treturn {\n\t\tcontext: createMongoExecutionContext({\n\t\t\tcontract,\n\t\t\tstack: createMongoExecutionStack({\n\t\t\t\ttarget: mongoRuntimeTarget,\n\t\t\t\tadapter: mongoRuntimeAdapter\n\t\t\t})\n\t\t}),\n\t\tcontract,\n\t\tenums: extractUnboundEnums(contract),\n\t\tquery: mongoQuery({ contractJson: contract }),\n\t\traw: mongoRaw({ contract })\n\t};\n}\nfunction mongoStatic(options) {\n\treturn buildMongoStaticContext(blindCast(new MongoContractSerializer().deserializeContract(options.contractJson)));\n}\n//#endregion\nexport { mongoStatic as n, buildMongoStaticContext as t };\n\n//# sourceMappingURL=mongo-static-_wy-fC4P.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,oBAAoB,UAAU;CACtC,MAAM,QAAQ,qBAAqB,SAAS,MAAM,CAAC,CAAC;CACpD,cAAc,OAAO,+DAA+D;CACpF,OAAO;AACR;AACA,SAAS,wBAAwB,UAAU;CAC1C,OAAO;EACN,SAAS,4BAA4B;GACpC;GACA,OAAO,0BAA0B;IAChC,QAAQ;IACR,SAAS;GACV,CAAC;EACF,CAAC;EACD;EACA,OAAO,oBAAoB,QAAQ;EACnC,OAAO,WAAW,EAAE,cAAc,SAAS,CAAC;EAC5C,KAAK,SAAS,EAAE,SAAS,CAAC;CAC3B;AACD;AACA,SAAS,YAAY,SAAS;CAC7B,OAAO,wBAAwB,UAAU,IAAI,wBAAwB,CAAC,CAAC,oBAAoB,QAAQ,YAAY,CAAC,CAAC;AAClH"}
|
package/dist/orm.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/orm";
|
package/dist/orm.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/query-ast";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/query-ast/control";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/query-ast/execution";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/query-builder";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@prisma/orm-family-mongo/query-builder/contract-free";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { t as MongoStaticContext } from "./mongo-static-BdSGXYgQ-DSA-2DiK.mjs";
|
|
2
|
+
import { MongoClient as MongoClient$1 } from "mongodb";
|
|
3
|
+
import { MongoOrmClient, MongoQueryPlan, MongoRawClient } from "@prisma/orm-family-mongo/orm";
|
|
4
|
+
import { MongoExecutionContext, MongoMiddleware, MongoRuntime } from "@prisma/orm-family-mongo/runtime";
|
|
5
|
+
import { AsyncIterableResult } from "@prisma/orm-framework/components/runtime";
|
|
6
|
+
import { AnyMongoTypeMaps, MongoContract, MongoContractWithTypeMaps } from "@prisma/orm-family-mongo/contract";
|
|
7
|
+
//#region ../../../3-extensions/mongo/dist/runtime.d.mts
|
|
8
|
+
//#region src/runtime/binding.d.ts
|
|
9
|
+
type MongoBinding = {
|
|
10
|
+
readonly kind: 'url';
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly dbName: string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'mongoClient';
|
|
15
|
+
readonly client: MongoClient$1;
|
|
16
|
+
readonly dbName: string;
|
|
17
|
+
};
|
|
18
|
+
type MongoBindingInput = {
|
|
19
|
+
readonly binding: MongoBinding;
|
|
20
|
+
readonly url?: never;
|
|
21
|
+
readonly uri?: never;
|
|
22
|
+
readonly dbName?: never;
|
|
23
|
+
readonly mongoClient?: never;
|
|
24
|
+
} | {
|
|
25
|
+
readonly url: string;
|
|
26
|
+
readonly dbName?: string;
|
|
27
|
+
readonly binding?: never;
|
|
28
|
+
readonly uri?: never;
|
|
29
|
+
readonly mongoClient?: never;
|
|
30
|
+
} | {
|
|
31
|
+
readonly uri: string;
|
|
32
|
+
readonly dbName: string;
|
|
33
|
+
readonly binding?: never;
|
|
34
|
+
readonly url?: never;
|
|
35
|
+
readonly mongoClient?: never;
|
|
36
|
+
} | {
|
|
37
|
+
readonly mongoClient: MongoClient$1;
|
|
38
|
+
readonly dbName: string;
|
|
39
|
+
readonly binding?: never;
|
|
40
|
+
readonly url?: never;
|
|
41
|
+
readonly uri?: never;
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/runtime/mongo.d.ts
|
|
45
|
+
type MongoTargetId = 'mongo';
|
|
46
|
+
type UnboundEnums<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> = MongoStaticContext<TContract>['enums'];
|
|
47
|
+
interface MongoClient<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> {
|
|
48
|
+
readonly orm: MongoOrmClient<TContract>;
|
|
49
|
+
readonly query: MongoStaticContext<TContract>['query'];
|
|
50
|
+
readonly raw: MongoRawClient<TContract>;
|
|
51
|
+
readonly contract: TContract;
|
|
52
|
+
readonly enums: UnboundEnums<TContract>;
|
|
53
|
+
readonly context: MongoExecutionContext<TContract>;
|
|
54
|
+
execute<Row>(plan: MongoQueryPlan<Row>): AsyncIterableResult<Row>;
|
|
55
|
+
connect(bindingInput?: MongoBindingInput): Promise<MongoRuntime>;
|
|
56
|
+
runtime(): Promise<MongoRuntime>;
|
|
57
|
+
close(): Promise<void>;
|
|
58
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
interface MongoOptionsBase {
|
|
61
|
+
readonly mode?: 'strict' | 'permissive';
|
|
62
|
+
/**
|
|
63
|
+
* Optional middleware chain applied to every Mongo execution.
|
|
64
|
+
*/
|
|
65
|
+
readonly middleware?: readonly MongoMiddleware[];
|
|
66
|
+
}
|
|
67
|
+
interface MongoBindingOptions {
|
|
68
|
+
readonly binding?: MongoBinding;
|
|
69
|
+
readonly url?: string;
|
|
70
|
+
readonly uri?: string;
|
|
71
|
+
readonly dbName?: string;
|
|
72
|
+
readonly mongoClient?: import('mongodb').MongoClient;
|
|
73
|
+
}
|
|
74
|
+
type MongoOptionsWithContract<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> = MongoBindingOptions & MongoOptionsBase & {
|
|
75
|
+
readonly contract: TContract;
|
|
76
|
+
readonly contractJson?: never;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* `TContract` is a phantom parameter that drives explicit-type inference at the
|
|
80
|
+
* call site (e.g. `mongo<Contract>({ contractJson })`). It is not referenced in
|
|
81
|
+
* the type body — the contract value comes through `contractJson` at runtime.
|
|
82
|
+
*/
|
|
83
|
+
type MongoOptionsWithContractJson<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> = MongoBindingOptions & MongoOptionsBase & {
|
|
84
|
+
readonly contractJson: unknown;
|
|
85
|
+
readonly contract?: never;
|
|
86
|
+
/**
|
|
87
|
+
* @internal phantom field; never set at runtime, only references TContract
|
|
88
|
+
* so that strict tsc/biome don't flag the type parameter as unused.
|
|
89
|
+
*/
|
|
90
|
+
readonly __contractPhantom?: TContract;
|
|
91
|
+
};
|
|
92
|
+
type MongoOptions<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>> = MongoOptionsWithContract<TContract> | MongoOptionsWithContractJson<TContract>;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a lazy Mongo client from either `contractJson` or a TypeScript-authored `contract`.
|
|
95
|
+
* The `orm` and `query` surfaces are available immediately; the underlying driver is connected
|
|
96
|
+
* on the first query (or the first explicit `connect()` call), mirroring the Postgres facade.
|
|
97
|
+
*
|
|
98
|
+
* - No-emit: pass a TypeScript-authored contract. Example: `mongo({ contract, url })`
|
|
99
|
+
* - Emitted: pass `Contract` type explicitly. Example: `mongo<Contract>({ contractJson, url })`
|
|
100
|
+
*/
|
|
101
|
+
declare function mongo<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>>(options: MongoOptionsWithContract<TContract>): MongoClient<TContract>;
|
|
102
|
+
declare function mongo<TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>>(options: MongoOptionsWithContractJson<TContract>): MongoClient<TContract>;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { type MongoBinding, type MongoBindingInput, type MongoClient, type MongoOptions, type MongoOptionsWithContract, type MongoOptionsWithContractJson, type MongoTargetId, mongo as default };
|
|
105
|
+
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/runtime.d.mts"],"mappings":";;;;;;;;KAOK;WACM;WACA;WACA;;WAEA;WACA,QAAQ;WACR;;KAEN;WACM,SAAS;WACT;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;WAEA,aAAa;WACb;WACA;WACA;WACA;;;;KAIN;KACA,aAAa,kBAAkB,0BAA0B,eAAe,qBAAqB,mBAAmB;UAC3G,YAAY,kBAAkB,0BAA0B,eAAe;WACtE,KAAK,eAAe;WACpB,OAAO,mBAAmB;WAC1B,KAAK,eAAe;WACpB,UAAU;WACV,OAAO,aAAa;WACpB,SAAS,sBAAsB;EACxC,QAAQ,KAAK,MAAM,eAAe,OAAO,oBAAoB;EAC7D,QAAQ,eAAe,oBAAoB,QAAQ;EACnD,WAAW,QAAQ;EACnB,SAAS;GACR,OAAO,iBAAiB;;UAEjB;WACC;;;;WAIA,sBAAsB;;UAEvB;WACC,UAAU;WACV;WACA;WACA;WACA,gCAAgC;;KAEtC,yBAAyB,kBAAkB,0BAA0B,eAAe,qBAAqB,sBAAsB;WACzH,UAAU;WACV;;;;;;;KAON,6BAA6B,kBAAkB,0BAA0B,eAAe,qBAAqB,sBAAsB;WAC7H;WACA;;;;;WAKA,oBAAoB;;KAE1B,aAAa,kBAAkB,0BAA0B,eAAe,qBAAqB,yBAAyB,aAAa,6BAA6B;;;;;;;;;iBASpJ,MAAM,kBAAkB,0BAA0B,eAAe,mBAAmB,SAAS,yBAAyB,aAAa,YAAY;iBAC/I,MAAM,kBAAkB,0BAA0B,eAAe,mBAAmB,SAAS,6BAA6B,aAAa,YAAY"}
|