@gaganref/confect-server 10.3.1-fork.4 → 10.3.1-fork.41
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/ActionCall.d.ts +30 -0
- package/dist/ActionCall.d.ts.map +1 -0
- package/dist/ActionCall.js +41 -0
- package/dist/ActionCall.js.map +1 -0
- package/dist/ActionCtx.d.ts +1 -1
- package/dist/ActionCtx.d.ts.map +1 -1
- package/dist/ActionCtx.js.map +1 -1
- package/dist/ActionRunner.js +2 -2
- package/dist/AiGatewayDecisionClient.d.ts +2 -2
- package/dist/AiGatewayDecisionClient.d.ts.map +1 -1
- package/dist/AiGatewayDecisionClient.js +1 -1
- package/dist/AiGatewayDecisionClient.js.map +1 -1
- package/dist/AiGatewayLanguageClient.d.ts +2 -2
- package/dist/AiGatewayLanguageClient.d.ts.map +1 -1
- package/dist/AiGatewayLanguageClient.js +1 -1
- package/dist/AiGatewayLanguageClient.js.map +1 -1
- package/dist/Auth.d.ts +14 -2
- package/dist/Auth.d.ts.map +1 -1
- package/dist/Auth.js +13 -3
- package/dist/Auth.js.map +1 -1
- package/dist/Callback.js +3 -3
- package/dist/ComponentCtx.d.ts +1 -1
- package/dist/ComponentCtx.d.ts.map +1 -1
- package/dist/ConvexConfigProvider.js +2 -2
- package/dist/ConvexFunctionDefinitions.d.ts +4 -4
- package/dist/ConvexFunctionDefinitions.d.ts.map +1 -1
- package/dist/ConvexFunctionDefinitions.js +4 -4
- package/dist/ConvexFunctionDefinitions.js.map +1 -1
- package/dist/ConvexLogger.js +1 -1
- package/dist/CronJobs.d.ts +1 -1
- package/dist/CronJobs.d.ts.map +1 -1
- package/dist/CronJobs.js +6 -6
- package/dist/CronJobs.js.map +1 -1
- package/dist/DataModel.d.ts +3 -3
- package/dist/DataModel.d.ts.map +1 -1
- package/dist/DataModel.js.map +1 -1
- package/dist/DatabaseReader.d.ts +4 -4
- package/dist/DatabaseReader.d.ts.map +1 -1
- package/dist/DatabaseReader.js.map +1 -1
- package/dist/DatabaseSchema.d.ts +1 -1
- package/dist/DatabaseSchema.d.ts.map +1 -1
- package/dist/DatabaseSchema.js +2 -2
- package/dist/DatabaseSchema.js.map +1 -1
- package/dist/DatabaseWriter.d.ts +41 -7
- package/dist/DatabaseWriter.d.ts.map +1 -1
- package/dist/DatabaseWriter.js +55 -8
- package/dist/DatabaseWriter.js.map +1 -1
- package/dist/Document.d.ts +4 -4
- package/dist/Document.d.ts.map +1 -1
- package/dist/Document.js.map +1 -1
- package/dist/ExecutionMetadata.js +1 -1
- package/dist/FunctionImpl.d.ts +2 -2
- package/dist/FunctionImpl.d.ts.map +1 -1
- package/dist/FunctionImpl.js +2 -2
- package/dist/FunctionImpl.js.map +1 -1
- package/dist/FunctionRegistryItem.d.ts +1 -1
- package/dist/FunctionRegistryItem.d.ts.map +1 -1
- package/dist/FunctionRegistryItem.js +1 -1
- package/dist/FunctionRegistryItem.js.map +1 -1
- package/dist/GroupImpl.d.ts +24 -5
- package/dist/GroupImpl.d.ts.map +1 -1
- package/dist/GroupImpl.js +21 -22
- package/dist/GroupImpl.js.map +1 -1
- package/dist/GroupRegistry.d.ts +3 -2
- package/dist/GroupRegistry.d.ts.map +1 -1
- package/dist/GroupRegistry.js +10 -3
- package/dist/GroupRegistry.js.map +1 -1
- package/dist/Handler.d.ts +31 -27
- package/dist/Handler.d.ts.map +1 -1
- package/dist/Handler.js.map +1 -1
- package/dist/HttpRouter.d.ts +15 -13
- package/dist/HttpRouter.d.ts.map +1 -1
- package/dist/HttpRouter.js +16 -7
- package/dist/HttpRouter.js.map +1 -1
- package/dist/MiddlewareImpl.d.ts +14 -14
- package/dist/MiddlewareImpl.d.ts.map +1 -1
- package/dist/MiddlewareImpl.js +1 -1
- package/dist/MiddlewareImpl.js.map +1 -1
- package/dist/MutationCtx.d.ts +1 -1
- package/dist/MutationCtx.d.ts.map +1 -1
- package/dist/MutationCtx.js.map +1 -1
- package/dist/MutationRunner.d.ts +1 -1
- package/dist/MutationRunner.d.ts.map +1 -1
- package/dist/MutationRunner.js +2 -2
- package/dist/MutationRunner.js.map +1 -1
- package/dist/MutationTransactionContext.d.ts +2 -2
- package/dist/MutationTransactionContext.d.ts.map +1 -1
- package/dist/MutationTransactionContext.js +2 -2
- package/dist/MutationTransactionContext.js.map +1 -1
- package/dist/OfficialComponent.d.ts +50 -0
- package/dist/OfficialComponent.d.ts.map +1 -0
- package/dist/OfficialComponent.js +70 -0
- package/dist/OfficialComponent.js.map +1 -0
- package/dist/OrderedQuery.d.ts +4 -4
- package/dist/OrderedQuery.d.ts.map +1 -1
- package/dist/OrderedQuery.js.map +1 -1
- package/dist/QueryCtx.d.ts +1 -1
- package/dist/QueryCtx.d.ts.map +1 -1
- package/dist/QueryCtx.js.map +1 -1
- package/dist/QueryInitializer.d.ts +10 -10
- package/dist/QueryInitializer.d.ts.map +1 -1
- package/dist/QueryInitializer.js +2 -2
- package/dist/QueryInitializer.js.map +1 -1
- package/dist/QueryRunner.d.ts +2 -2
- package/dist/QueryRunner.d.ts.map +1 -1
- package/dist/QueryRunner.js +2 -2
- package/dist/QueryRunner.js.map +1 -1
- package/dist/QueryStream.d.ts +131 -23
- package/dist/QueryStream.d.ts.map +1 -1
- package/dist/QueryStream.js +142 -40
- package/dist/QueryStream.js.map +1 -1
- package/dist/QueryStreamCursor.d.ts +2 -2
- package/dist/QueryStreamCursor.d.ts.map +1 -1
- package/dist/QueryStreamCursor.js +1 -1
- package/dist/QueryStreamCursor.js.map +1 -1
- package/dist/QueryStreamIndexPrefix.d.ts +2 -2
- package/dist/QueryStreamIndexPrefix.d.ts.map +1 -1
- package/dist/QueryStreamIndexPrefix.js +1 -1
- package/dist/QueryStreamIndexPrefix.js.map +1 -1
- package/dist/QueryStreamIndexRange.d.ts +4 -4
- package/dist/QueryStreamIndexRange.d.ts.map +1 -1
- package/dist/QueryStreamIndexRange.js +2 -2
- package/dist/QueryStreamIndexRange.js.map +1 -1
- package/dist/QueryStreamKey.d.ts +2 -2
- package/dist/QueryStreamKey.d.ts.map +1 -1
- package/dist/QueryStreamKey.js +1 -1
- package/dist/QueryStreamKey.js.map +1 -1
- package/dist/QueryStreamKeyBounds.d.ts +3 -3
- package/dist/QueryStreamKeyBounds.d.ts.map +1 -1
- package/dist/QueryStreamKeyBounds.js +2 -2
- package/dist/QueryStreamKeyBounds.js.map +1 -1
- package/dist/QueryStreamKeyLayout.d.ts +1 -1
- package/dist/QueryStreamKeyLayout.d.ts.map +1 -1
- package/dist/QueryStreamKeyLayout.js +2 -2
- package/dist/QueryStreamKeyLayout.js.map +1 -1
- package/dist/QueryStreamKeyValues.d.ts +1 -1
- package/dist/QueryStreamKeyValues.d.ts.map +1 -1
- package/dist/QueryStreamKeyValues.js +1 -1
- package/dist/QueryStreamKeyValues.js.map +1 -1
- package/dist/QueryStreamPagination.d.ts +1 -1
- package/dist/QueryStreamPagination.d.ts.map +1 -1
- package/dist/QueryStreamPagination.js +1 -1
- package/dist/QueryStreamPagination.js.map +1 -1
- package/dist/QueryStreamReadBudget.d.ts +3 -2
- package/dist/QueryStreamReadBudget.d.ts.map +1 -1
- package/dist/QueryStreamReadBudget.js +7 -4
- package/dist/QueryStreamReadBudget.js.map +1 -1
- package/dist/QueryTransactionContext.js +2 -2
- package/dist/RegisteredConvexFunction.d.ts +27 -24
- package/dist/RegisteredConvexFunction.d.ts.map +1 -1
- package/dist/RegisteredConvexFunction.js +39 -26
- package/dist/RegisteredConvexFunction.js.map +1 -1
- package/dist/RegisteredFunction.d.ts +51 -47
- package/dist/RegisteredFunction.d.ts.map +1 -1
- package/dist/RegisteredFunction.js +126 -37
- package/dist/RegisteredFunction.js.map +1 -1
- package/dist/RegisteredFunctions.d.ts +3 -3
- package/dist/RegisteredFunctions.d.ts.map +1 -1
- package/dist/RegisteredFunctions.js.map +1 -1
- package/dist/RegisteredNodeFunction.d.ts +7 -7
- package/dist/RegisteredNodeFunction.d.ts.map +1 -1
- package/dist/RegisteredNodeFunction.js +8 -6
- package/dist/RegisteredNodeFunction.js.map +1 -1
- package/dist/Registry.d.ts +1 -1
- package/dist/Registry.d.ts.map +1 -1
- package/dist/Registry.js.map +1 -1
- package/dist/RegistryItems.d.ts +7 -0
- package/dist/RegistryItems.d.ts.map +1 -1
- package/dist/RegistryItems.js +8 -3
- package/dist/RegistryItems.js.map +1 -1
- package/dist/RequestMetadata.js +1 -1
- package/dist/ResolvedMiddleware.d.ts +2 -2
- package/dist/ResolvedMiddleware.d.ts.map +1 -1
- package/dist/ResolvedMiddleware.js.map +1 -1
- package/dist/Scheduler.js +2 -2
- package/dist/Storage.d.ts +6 -6
- package/dist/Storage.d.ts.map +1 -1
- package/dist/Storage.js +1 -1
- package/dist/Storage.js.map +1 -1
- package/dist/StorageActionWriter.d.ts +1 -1
- package/dist/StorageActionWriter.d.ts.map +1 -1
- package/dist/StorageActionWriter.js +1 -1
- package/dist/StorageActionWriter.js.map +1 -1
- package/dist/StorageReader.d.ts +1 -1
- package/dist/StorageReader.d.ts.map +1 -1
- package/dist/StorageReader.js +1 -1
- package/dist/StorageReader.js.map +1 -1
- package/dist/StorageWriter.d.ts +1 -1
- package/dist/StorageWriter.d.ts.map +1 -1
- package/dist/StorageWriter.js +1 -1
- package/dist/StorageWriter.js.map +1 -1
- package/dist/TableInfo.d.ts +2 -2
- package/dist/TableInfo.d.ts.map +1 -1
- package/dist/TableInfo.js.map +1 -1
- package/dist/TransactionMetadata.js +1 -1
- package/dist/VectorSearch.d.ts +1 -1
- package/dist/VectorSearch.d.ts.map +1 -1
- package/dist/VectorSearch.js +1 -1
- package/dist/VectorSearch.js.map +1 -1
- package/dist/index.d.ts +62 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -18
- package/dist/internal/AiGatewayDecisionClient.d.ts +1 -1
- package/dist/internal/AiGatewayDecisionClient.d.ts.map +1 -1
- package/dist/internal/AiGatewayDecisionClient.js +1 -1
- package/dist/internal/AiGatewayDecisionClient.js.map +1 -1
- package/dist/internal/AiGatewayLanguageClient.d.ts +1 -1
- package/dist/internal/AiGatewayLanguageClient.d.ts.map +1 -1
- package/dist/internal/AiGatewayLanguageClient.js +1 -1
- package/dist/internal/AiGatewayLanguageClient.js.map +1 -1
- package/dist/internal/AiGatewayServiceToken.js +1 -1
- package/dist/internal/DocumentPatch.d.ts +16 -0
- package/dist/internal/DocumentPatch.d.ts.map +1 -0
- package/dist/internal/DocumentPatch.js +36 -0
- package/dist/internal/DocumentPatch.js.map +1 -0
- package/dist/internal/observability.d.ts +5 -0
- package/dist/internal/observability.d.ts.map +1 -0
- package/dist/internal/observability.js +21 -0
- package/dist/internal/observability.js.map +1 -0
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/ActionCall.ts +82 -0
- package/src/ActionCtx.ts +1 -1
- package/src/AiGatewayDecisionClient.ts +3 -3
- package/src/AiGatewayLanguageClient.ts +3 -3
- package/src/Auth.ts +24 -2
- package/src/ComponentCtx.ts +1 -1
- package/src/ConvexFunctionDefinitions.ts +10 -9
- package/src/CronJobs.ts +1 -1
- package/src/DataModel.ts +3 -3
- package/src/DatabaseReader.ts +4 -4
- package/src/DatabaseSchema.ts +1 -1
- package/src/DatabaseWriter.ts +189 -31
- package/src/Document.ts +4 -4
- package/src/FunctionImpl.ts +5 -5
- package/src/FunctionRegistryItem.ts +1 -1
- package/src/GroupImpl.ts +66 -13
- package/src/GroupRegistry.ts +11 -7
- package/src/Handler.ts +44 -28
- package/src/HttpRouter.ts +71 -21
- package/src/MiddlewareImpl.ts +17 -17
- package/src/MutationCtx.ts +1 -1
- package/src/MutationRunner.ts +1 -1
- package/src/MutationTransactionContext.ts +2 -2
- package/src/OfficialComponent.ts +151 -0
- package/src/OrderedQuery.ts +4 -4
- package/src/QueryCtx.ts +1 -1
- package/src/QueryInitializer.ts +9 -9
- package/src/QueryRunner.ts +2 -2
- package/src/QueryStream.ts +406 -76
- package/src/QueryStreamCursor.ts +3 -3
- package/src/QueryStreamIndexPrefix.ts +2 -2
- package/src/QueryStreamIndexRange.ts +4 -4
- package/src/QueryStreamKey.ts +2 -2
- package/src/QueryStreamKeyBounds.ts +3 -3
- package/src/QueryStreamKeyLayout.ts +1 -1
- package/src/QueryStreamKeyValues.ts +1 -1
- package/src/QueryStreamPagination.ts +2 -2
- package/src/QueryStreamReadBudget.ts +19 -6
- package/src/RegisteredConvexFunction.ts +38 -21
- package/src/RegisteredFunction.ts +209 -60
- package/src/RegisteredFunctions.ts +4 -4
- package/src/RegisteredNodeFunction.ts +15 -9
- package/src/Registry.ts +1 -1
- package/src/RegistryItems.ts +33 -2
- package/src/ResolvedMiddleware.ts +2 -2
- package/src/Storage.ts +3 -3
- package/src/StorageActionWriter.ts +1 -1
- package/src/StorageReader.ts +1 -1
- package/src/StorageWriter.ts +1 -1
- package/src/TableInfo.ts +2 -2
- package/src/VectorSearch.ts +1 -1
- package/src/index.ts +62 -60
- package/src/internal/AiGatewayDecisionClient.ts +2 -2
- package/src/internal/AiGatewayLanguageClient.ts +2 -2
- package/src/internal/DocumentPatch.ts +87 -0
- package/src/internal/observability.ts +27 -0
- package/src/node.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageWriter.d.ts","sourceRoot":"","sources":["../src/StorageWriter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StorageWriter.d.ts","sourceRoot":"","sources":["../src/StorageWriter.ts"],"names":[],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AAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CACF;IAEnD,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAI,KAAK,SAAS,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,iBACnD,mBAAmB,WACzB,KAAK,gDAKZ;CACL"}
|
package/dist/StorageWriter.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { BlobNotFoundError } from "./BlobNotFoundError.js";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
|
-
import * as Layer from "effect/Layer";
|
|
5
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
7
7
|
import { pipe } from "effect/Function";
|
|
8
8
|
//#region src/StorageWriter.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageWriter.js","names":[],"sources":["../src/StorageWriter.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type { StorageWriter as ConvexStorageWriter } from \"convex/server\";\nimport type { GenericId } from \"convex/values\";\nimport * as Context from \"effect/Context\";\nimport { pipe } from \"effect/Function\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\nimport { BlobNotFoundError } from \"./BlobNotFoundError\";\nimport type * as ScopedId from \"@confect/core/GenericId\";\n\nexport type Service<Scope extends IdScope.IdScope = IdScope.App> = {\n generateUploadUrl: ReturnType<typeof make>[\"generateUploadUrl\"];\n delete: (\n id: ScopedId.GenericId<\"_storage\", Scope>,\n ) => ReturnType<ReturnType<typeof make>[\"delete\"]>;\n};\nexport type ForScope<Scope extends IdScope.IdScope> = Scope extends IdScope.App\n ? StorageWriter\n : { readonly \"~ScopedStorageWriter\": Scope };\n\nconst make = (storageWriter: ConvexStorageWriter) => ({\n generateUploadUrl: Effect.promise(() =>\n storageWriter.generateUploadUrl(),\n ).pipe(\n Effect.andThen((url) =>\n pipe(\n url,\n Schema.decodeEffect(Schema.URLFromString),\n Effect.catchTag(\"SchemaError\", Effect.die),\n ),\n ),\n ),\n delete: (storageId: GenericId<\"_storage\">) =>\n Effect.tryPromise({\n try: () => storageWriter.delete(storageId),\n catch: () => new BlobNotFoundError({ id: storageId }),\n }),\n});\n\nexport class StorageWriter extends Context.Service<\n StorageWriter,\n ReturnType<typeof make>\n>()(\"@confect/server/StorageWriter\") {\n static readonly forScope = <\n Scope extends IdScope.IdScope = IdScope.App,\n >(): Context.Service<ForScope<Scope>, Service<Scope>> =>\n Context.Service(\"@confect/server/StorageWriter\");\n\n static readonly layer = <Scope extends IdScope.IdScope = IdScope.App>(\n storageWriter: ConvexStorageWriter,\n _scope?: Scope,\n ) =>\n Layer.succeed(\n this.forScope<Scope>(),\n make(storageWriter) as unknown as Service<Scope>,\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,MAAM,QAAQ,mBAAwC;CACpD,mBAAmB,OAAO,cACxB,cAAc,kBAAkB,CAClC,CAAC,CAAC,KACA,OAAO,SAAS,QACd,KACE,KACA,OAAO,aAAa,OAAO,aAAa,GACxC,OAAO,SAAS,eAAe,OAAO,GAAG,CAC3C,CACF,CACF;CACA,SAAS,cACP,OAAO,WAAW;EAChB,WAAW,cAAc,OAAO,SAAS;EACzC,aAAa,IAAI,kBAAkB,EAAE,IAAI,UAAU,CAAC;CACtD,CAAC;AACL;AAEA,IAAa,gBAAb,cAAmC,QAAQ,QAGzC,CAAC,CAAC,+BAA+B,CAAC,CAAC;CACnC,OAAgB,iBAGd,QAAQ,QAAQ,+BAA+B;CAEjD,OAAgB,SACd,eACA,WAEA,MAAM,QACJ,KAAK,SAAgB,GACrB,KAAK,aAAa,CACpB;AACJ"}
|
|
1
|
+
{"version":3,"file":"StorageWriter.js","names":[],"sources":["../src/StorageWriter.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type { StorageWriter as ConvexStorageWriter } from \"convex/server\";\nimport type { GenericId } from \"convex/values\";\nimport * as Context from \"effect/Context\";\nimport { pipe } from \"effect/Function\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\nimport { BlobNotFoundError } from \"./BlobNotFoundError.js\";\nimport type * as ScopedId from \"@confect/core/GenericId\";\n\nexport type Service<Scope extends IdScope.IdScope = IdScope.App> = {\n generateUploadUrl: ReturnType<typeof make>[\"generateUploadUrl\"];\n delete: (\n id: ScopedId.GenericId<\"_storage\", Scope>,\n ) => ReturnType<ReturnType<typeof make>[\"delete\"]>;\n};\nexport type ForScope<Scope extends IdScope.IdScope> = Scope extends IdScope.App\n ? StorageWriter\n : { readonly \"~ScopedStorageWriter\": Scope };\n\nconst make = (storageWriter: ConvexStorageWriter) => ({\n generateUploadUrl: Effect.promise(() =>\n storageWriter.generateUploadUrl(),\n ).pipe(\n Effect.andThen((url) =>\n pipe(\n url,\n Schema.decodeEffect(Schema.URLFromString),\n Effect.catchTag(\"SchemaError\", Effect.die),\n ),\n ),\n ),\n delete: (storageId: GenericId<\"_storage\">) =>\n Effect.tryPromise({\n try: () => storageWriter.delete(storageId),\n catch: () => new BlobNotFoundError({ id: storageId }),\n }),\n});\n\nexport class StorageWriter extends Context.Service<\n StorageWriter,\n ReturnType<typeof make>\n>()(\"@confect/server/StorageWriter\") {\n static readonly forScope = <\n Scope extends IdScope.IdScope = IdScope.App,\n >(): Context.Service<ForScope<Scope>, Service<Scope>> =>\n Context.Service(\"@confect/server/StorageWriter\");\n\n static readonly layer = <Scope extends IdScope.IdScope = IdScope.App>(\n storageWriter: ConvexStorageWriter,\n _scope?: Scope,\n ) =>\n Layer.succeed(\n this.forScope<Scope>(),\n make(storageWriter) as unknown as Service<Scope>,\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,MAAM,QAAQ,mBAAwC;CACpD,mBAAmB,OAAO,cACxB,cAAc,kBAAkB,CAClC,CAAC,CAAC,KACA,OAAO,SAAS,QACd,KACE,KACA,OAAO,aAAa,OAAO,aAAa,GACxC,OAAO,SAAS,eAAe,OAAO,GAAG,CAC3C,CACF,CACF;CACA,SAAS,cACP,OAAO,WAAW;EAChB,WAAW,cAAc,OAAO,SAAS;EACzC,aAAa,IAAI,kBAAkB,EAAE,IAAI,UAAU,CAAC;CACtD,CAAC;AACL;AAEA,IAAa,gBAAb,cAAmC,QAAQ,QAGzC,CAAC,CAAC,+BAA+B,CAAC,CAAC;CACnC,OAAgB,iBAGd,QAAQ,QAAQ,+BAA+B;CAEjD,OAAgB,SACd,eACA,WAEA,MAAM,QACJ,KAAK,SAAgB,GACrB,KAAK,aAAa,CACpB;AACJ"}
|
package/dist/TableInfo.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { GenericDocument, GenericFieldPaths, GenericTableIndexes, GenericTa
|
|
|
3
3
|
import type { GenericValidator } from "convex/values";
|
|
4
4
|
import type { Schema, Types } from "effect";
|
|
5
5
|
import type { WithSystemFields } from "@confect/core/SystemFields";
|
|
6
|
-
import type * as Document_ from "./Document";
|
|
7
|
-
import type * as Table from "./Table";
|
|
6
|
+
import type * as Document_ from "./Document.js";
|
|
7
|
+
import type * as Table from "./Table.js";
|
|
8
8
|
export declare const TypeId: "~@confect/server/TableInfo";
|
|
9
9
|
export type TypeId = typeof TypeId;
|
|
10
10
|
export type TableInfo<Table_ extends Table.AnyWithProps> = Table_ extends Table.Table<infer TableName, infer TableSchema_, infer TableValidator, infer Indexes, infer SearchIndexes, infer VectorIndexes, infer Scope> ? {
|
package/dist/TableInfo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableInfo.d.ts","sourceRoot":"","sources":["../src/TableInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,iB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AU,CAAC,gBAAgB,CAAC,CAAC;IACvC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,aAAa,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IAC3C,aAAa,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,UAAU,SAAS,YAAY,IAAI,MAAM,CAAC,KAAK,CACrE,UAAU,CAAC,UAAU,CAAC,EACtB,UAAU,CAAC,iBAAiB,CAAC,CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,UAAU,SAAS,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;AAK/E,KAAK,iBAAiB,CAAC,cAAc,SAAS,gBAAgB,IAC1D,cAAc,CAAC,YAAY,CAAC,GAC5B,MAAM,YAAY,CAAC;AAEvB,KAAK,qBAAqB,CACxB,SAAS,SAAS,MAAM,EACxB,cAAc,SAAS,gBAAgB,EACvC,KAAK,SAAS,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,IAE3C,gBAAgB,CACd,SAAS,EACT,cAAc,CAAC,MAAM,CAAC,EACtB,KAAK,CACN,SAAS,eAAe,GACrB,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAC1D,KAAK,CAAC"}
|
package/dist/TableInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableInfo.js","names":[],"sources":["../src/TableInfo.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type {\n GenericDocument,\n GenericFieldPaths,\n GenericTableIndexes,\n GenericTableSearchIndexes,\n GenericTableVectorIndexes,\n IdField,\n SystemFields,\n SystemIndexes,\n} from \"convex/server\";\nimport type { GenericValidator } from \"convex/values\";\nimport type { Schema, Types } from \"effect\";\nimport type { WithSystemFields } from \"@confect/core/SystemFields\";\nimport type * as Document_ from \"./Document\";\nimport type * as Table from \"./Table\";\n\nexport declare const TypeId: \"~@confect/server/TableInfo\";\nexport type TypeId = typeof TypeId;\n\nexport type TableInfo<Table_ extends Table.AnyWithProps> =\n Table_ extends Table.Table<\n infer TableName,\n infer TableSchema_,\n infer TableValidator,\n infer Indexes,\n infer SearchIndexes,\n infer VectorIndexes,\n infer Scope\n >\n ? {\n readonly [TypeId]: TypeId;\n readonly document: WithSystemFields<\n TableName,\n Schema.Schema.Type<TableSchema_>,\n Scope\n >;\n readonly encodedDocument: WithSystemFields<\n TableName,\n Schema.Codec.Encoded<TableSchema_>,\n Scope\n >;\n readonly convexDocument: ExtractConvexDocument<\n TableName,\n TableValidator,\n Scope\n >;\n readonly fieldPaths:\n | keyof IdField<TableName>\n | ExtractFieldPaths<TableValidator>;\n readonly indexes: Types.Simplify<Indexes & SystemIndexes>;\n readonly searchIndexes: SearchIndexes;\n readonly vectorIndexes: VectorIndexes;\n }\n : never;\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends Any {\n readonly document: Document_.Any;\n readonly encodedDocument: Document_.AnyEncoded;\n readonly convexDocument: GenericDocument;\n readonly fieldPaths: GenericFieldPaths;\n readonly indexes: GenericTableIndexes;\n readonly searchIndexes: GenericTableSearchIndexes;\n readonly vectorIndexes: GenericTableVectorIndexes;\n}\n\nexport type ConvexTableInfo<TableInfo_ extends AnyWithProps> = {\n document: TableInfo_[\"convexDocument\"];\n fieldPaths: TableInfo_[\"fieldPaths\"];\n indexes: TableInfo_[\"indexes\"];\n searchIndexes: TableInfo_[\"searchIndexes\"];\n vectorIndexes: TableInfo_[\"vectorIndexes\"];\n};\n\nexport type TableSchema<TableInfo_ extends AnyWithProps> = Schema.Codec<\n TableInfo_[\"document\"],\n TableInfo_[\"encodedDocument\"]\n>;\n\nexport type Document<TableInfo_ extends AnyWithProps> = TableInfo_[\"document\"];\n\n// Vendored types from convex-js, partially modified.\n// See https://github.com/get-convex/convex-js/pull/14\n\ntype ExtractFieldPaths<TableValidator extends GenericValidator> =\n | TableValidator[\"fieldPaths\"]\n | keyof SystemFields;\n\ntype ExtractConvexDocument<\n TableName extends string,\n TableValidator extends GenericValidator,\n Scope extends IdScope.IdScope = IdScope.App,\n> =\n WithSystemFields<\n TableName,\n TableValidator[\"type\"],\n Scope\n > extends GenericDocument\n ? WithSystemFields<TableName, TableValidator[\"type\"], Scope>\n : never;\n\n// End of vendored types from convex-js, partially modified.\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TableInfo.js","names":[],"sources":["../src/TableInfo.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type {\n GenericDocument,\n GenericFieldPaths,\n GenericTableIndexes,\n GenericTableSearchIndexes,\n GenericTableVectorIndexes,\n IdField,\n SystemFields,\n SystemIndexes,\n} from \"convex/server\";\nimport type { GenericValidator } from \"convex/values\";\nimport type { Schema, Types } from \"effect\";\nimport type { WithSystemFields } from \"@confect/core/SystemFields\";\nimport type * as Document_ from \"./Document.js\";\nimport type * as Table from \"./Table.js\";\n\nexport declare const TypeId: \"~@confect/server/TableInfo\";\nexport type TypeId = typeof TypeId;\n\nexport type TableInfo<Table_ extends Table.AnyWithProps> =\n Table_ extends Table.Table<\n infer TableName,\n infer TableSchema_,\n infer TableValidator,\n infer Indexes,\n infer SearchIndexes,\n infer VectorIndexes,\n infer Scope\n >\n ? {\n readonly [TypeId]: TypeId;\n readonly document: WithSystemFields<\n TableName,\n Schema.Schema.Type<TableSchema_>,\n Scope\n >;\n readonly encodedDocument: WithSystemFields<\n TableName,\n Schema.Codec.Encoded<TableSchema_>,\n Scope\n >;\n readonly convexDocument: ExtractConvexDocument<\n TableName,\n TableValidator,\n Scope\n >;\n readonly fieldPaths:\n | keyof IdField<TableName>\n | ExtractFieldPaths<TableValidator>;\n readonly indexes: Types.Simplify<Indexes & SystemIndexes>;\n readonly searchIndexes: SearchIndexes;\n readonly vectorIndexes: VectorIndexes;\n }\n : never;\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends Any {\n readonly document: Document_.Any;\n readonly encodedDocument: Document_.AnyEncoded;\n readonly convexDocument: GenericDocument;\n readonly fieldPaths: GenericFieldPaths;\n readonly indexes: GenericTableIndexes;\n readonly searchIndexes: GenericTableSearchIndexes;\n readonly vectorIndexes: GenericTableVectorIndexes;\n}\n\nexport type ConvexTableInfo<TableInfo_ extends AnyWithProps> = {\n document: TableInfo_[\"convexDocument\"];\n fieldPaths: TableInfo_[\"fieldPaths\"];\n indexes: TableInfo_[\"indexes\"];\n searchIndexes: TableInfo_[\"searchIndexes\"];\n vectorIndexes: TableInfo_[\"vectorIndexes\"];\n};\n\nexport type TableSchema<TableInfo_ extends AnyWithProps> = Schema.Codec<\n TableInfo_[\"document\"],\n TableInfo_[\"encodedDocument\"]\n>;\n\nexport type Document<TableInfo_ extends AnyWithProps> = TableInfo_[\"document\"];\n\n// Vendored types from convex-js, partially modified.\n// See https://github.com/get-convex/convex-js/pull/14\n\ntype ExtractFieldPaths<TableValidator extends GenericValidator> =\n | TableValidator[\"fieldPaths\"]\n | keyof SystemFields;\n\ntype ExtractConvexDocument<\n TableName extends string,\n TableValidator extends GenericValidator,\n Scope extends IdScope.IdScope = IdScope.App,\n> =\n WithSystemFields<\n TableName,\n TableValidator[\"type\"],\n Scope\n > extends GenericDocument\n ? WithSystemFields<TableName, TableValidator[\"type\"], Scope>\n : never;\n\n// End of vendored types from convex-js, partially modified.\n"],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
5
|
//#region src/TransactionMetadata.ts
|
|
6
6
|
var TransactionMetadata_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
TransactionMetadata: () => TransactionMetadata,
|
package/dist/VectorSearch.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Expand, GenericActionCtx, NamedTableInfo, VectorIndexNames, Vector
|
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
-
import type * as DataModel from "./DataModel";
|
|
5
|
+
import type * as DataModel from "./DataModel.js";
|
|
6
6
|
type ConvexVectorSearch<DataModel_ extends DataModel.AnyWithProps> = GenericActionCtx<DataModel.ToConvex<DataModel_>>["vectorSearch"];
|
|
7
7
|
/**
|
|
8
8
|
* The service shape backing the `VectorSearch` tag. Named so declaration emit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorSearch.d.ts","sourceRoot":"","sources":["../src/VectorSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"VectorSearch.d.ts","sourceRoot":"","sources":["../src/VectorSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAEjD,KAAK,kBAAkB,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AK,GAAI,UAAU,SAAS,SAAS,CAAC,YAAY,gBAC/C,kBAAkB,CAAC,UAAU,CAAC,+DACoB,CAAC"}
|
package/dist/VectorSearch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
5
|
//#region src/VectorSearch.ts
|
|
6
6
|
var VectorSearch_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
VectorSearch: () => VectorSearch,
|
package/dist/VectorSearch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorSearch.js","names":[],"sources":["../src/VectorSearch.ts"],"sourcesContent":["import type {\n Expand,\n GenericActionCtx,\n NamedTableInfo,\n VectorIndexNames,\n VectorSearchQuery,\n} from \"convex/server\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport type * as DataModel from \"./DataModel\";\n\ntype ConvexVectorSearch<DataModel_ extends DataModel.AnyWithProps> =\n GenericActionCtx<DataModel.ToConvex<DataModel_>>[\"vectorSearch\"];\n\n/**\n * The service shape backing the `VectorSearch` tag. Named so declaration emit\n * references it instead of expanding the call signature at every usage.\n */\nexport interface VectorSearchService<\n DataModel_ extends DataModel.AnyWithProps,\n> {\n <\n TableName extends DataModel.TableNames<DataModel_>,\n IndexName extends VectorIndexNames<\n NamedTableInfo<DataModel.ToConvex<DataModel_>, TableName>\n >,\n >(\n tableName: TableName,\n indexName: IndexName,\n query: Expand<\n VectorSearchQuery<\n NamedTableInfo<DataModel.ToConvex<DataModel_>, TableName>,\n IndexName\n >\n >,\n ): Effect.Effect<\n Array<{ _id: DataModel.Id<DataModel_, TableName>; _score: number }>\n >;\n}\n\nexport type VectorSearchTag<DataModel_ extends DataModel.AnyWithProps> =\n Context.Service<\n VectorSearchService<DataModel_>,\n VectorSearchService<DataModel_>\n >;\n\nexport const make =\n <DataModel_ extends DataModel.AnyWithProps>(\n vectorSearch: ConvexVectorSearch<DataModel_>,\n ): VectorSearchService<DataModel_> =>\n (tableName, indexName, query) =>\n Effect.promise(() => vectorSearch(tableName, indexName, query)).pipe(\n Effect.map(\n (rows) =>\n rows as unknown as Array<{\n _id: DataModel.Id<DataModel_, typeof tableName>;\n _score: number;\n }>,\n ),\n );\n\nexport const VectorSearch = <\n DataModel_ extends DataModel.AnyWithProps,\n>(): VectorSearchTag<DataModel_> =>\n Context.Service<VectorSearchService<DataModel_>>(\n \"@confect/server/VectorSearch\",\n );\n\nexport type VectorSearch<DataModel_ extends DataModel.AnyWithProps> =\n VectorSearchService<DataModel_>;\n\nexport const layer = <DataModel_ extends DataModel.AnyWithProps>(\n vectorSearch: ConvexVectorSearch<DataModel_>,\n) => Layer.succeed(VectorSearch<DataModel_>(), make(vectorSearch));\n"],"mappings":";;;;;;;;;;AA+CA,MAAa,QAET,kBAED,WAAW,WAAW,UACrB,OAAO,cAAc,aAAa,WAAW,WAAW,KAAK,CAAC,CAAC,CAAC,KAC9D,OAAO,KACJ,SACC,IAIJ,CACF;AAEJ,MAAa,qBAGX,QAAQ,QACN,8BACF;AAKF,MAAa,SACX,iBACG,MAAM,QAAQ,aAAyB,GAAG,KAAK,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"VectorSearch.js","names":[],"sources":["../src/VectorSearch.ts"],"sourcesContent":["import type {\n Expand,\n GenericActionCtx,\n NamedTableInfo,\n VectorIndexNames,\n VectorSearchQuery,\n} from \"convex/server\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport type * as DataModel from \"./DataModel.js\";\n\ntype ConvexVectorSearch<DataModel_ extends DataModel.AnyWithProps> =\n GenericActionCtx<DataModel.ToConvex<DataModel_>>[\"vectorSearch\"];\n\n/**\n * The service shape backing the `VectorSearch` tag. Named so declaration emit\n * references it instead of expanding the call signature at every usage.\n */\nexport interface VectorSearchService<\n DataModel_ extends DataModel.AnyWithProps,\n> {\n <\n TableName extends DataModel.TableNames<DataModel_>,\n IndexName extends VectorIndexNames<\n NamedTableInfo<DataModel.ToConvex<DataModel_>, TableName>\n >,\n >(\n tableName: TableName,\n indexName: IndexName,\n query: Expand<\n VectorSearchQuery<\n NamedTableInfo<DataModel.ToConvex<DataModel_>, TableName>,\n IndexName\n >\n >,\n ): Effect.Effect<\n Array<{ _id: DataModel.Id<DataModel_, TableName>; _score: number }>\n >;\n}\n\nexport type VectorSearchTag<DataModel_ extends DataModel.AnyWithProps> =\n Context.Service<\n VectorSearchService<DataModel_>,\n VectorSearchService<DataModel_>\n >;\n\nexport const make =\n <DataModel_ extends DataModel.AnyWithProps>(\n vectorSearch: ConvexVectorSearch<DataModel_>,\n ): VectorSearchService<DataModel_> =>\n (tableName, indexName, query) =>\n Effect.promise(() => vectorSearch(tableName, indexName, query)).pipe(\n Effect.map(\n (rows) =>\n rows as unknown as Array<{\n _id: DataModel.Id<DataModel_, typeof tableName>;\n _score: number;\n }>,\n ),\n );\n\nexport const VectorSearch = <\n DataModel_ extends DataModel.AnyWithProps,\n>(): VectorSearchTag<DataModel_> =>\n Context.Service<VectorSearchService<DataModel_>>(\n \"@confect/server/VectorSearch\",\n );\n\nexport type VectorSearch<DataModel_ extends DataModel.AnyWithProps> =\n VectorSearchService<DataModel_>;\n\nexport const layer = <DataModel_ extends DataModel.AnyWithProps>(\n vectorSearch: ConvexVectorSearch<DataModel_>,\n) => Layer.succeed(VectorSearch<DataModel_>(), make(vectorSearch));\n"],"mappings":";;;;;;;;;;AA+CA,MAAa,QAET,kBAED,WAAW,WAAW,UACrB,OAAO,cAAc,aAAa,WAAW,WAAW,KAAK,CAAC,CAAC,CAAC,KAC9D,OAAO,KACJ,SACC,IAIJ,CACF;AAEJ,MAAa,qBAGX,QAAQ,QACN,8BACF;AAKF,MAAa,SACX,iBACG,MAAM,QAAQ,aAAyB,GAAG,KAAK,YAAY,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,88 +1,90 @@
|
|
|
1
|
-
export * as
|
|
2
|
-
export * as
|
|
3
|
-
export * as
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
6
|
-
export * as
|
|
7
|
-
export * as
|
|
8
|
-
export * as
|
|
9
|
-
export * as
|
|
10
|
-
export * as
|
|
11
|
-
export * as
|
|
12
|
-
export * as
|
|
13
|
-
export * as
|
|
14
|
-
export * as
|
|
15
|
-
export * as
|
|
16
|
-
export * as
|
|
17
|
-
export * as
|
|
18
|
-
export * as
|
|
19
|
-
export * as
|
|
20
|
-
export * as
|
|
21
|
-
export * as
|
|
22
|
-
export * as
|
|
23
|
-
export * as
|
|
24
|
-
export * as
|
|
25
|
-
export * as
|
|
26
|
-
export * as
|
|
27
|
-
export * as
|
|
28
|
-
export * as
|
|
29
|
-
export * as
|
|
30
|
-
export * as
|
|
31
|
-
export * as
|
|
32
|
-
export * as
|
|
33
|
-
export * as
|
|
34
|
-
export * as
|
|
35
|
-
export * as
|
|
1
|
+
export * as ActionCall from "./ActionCall.js";
|
|
2
|
+
export * as AiGatewayDecisionClient from "./AiGatewayDecisionClient.js";
|
|
3
|
+
export * as AiGatewayDecisionModel from "./AiGatewayDecisionModel.js";
|
|
4
|
+
export * as AiGatewayLanguageClient from "./AiGatewayLanguageClient.js";
|
|
5
|
+
export * as AiGatewayLanguageModel from "./AiGatewayLanguageModel.js";
|
|
6
|
+
export * as ActionCtx from "./ActionCtx.js";
|
|
7
|
+
export * as ActionRunner from "./ActionRunner.js";
|
|
8
|
+
export * as Auth from "./Auth.js";
|
|
9
|
+
export * as BlobNotFoundError from "./BlobNotFoundError.js";
|
|
10
|
+
export * as Callback from "./Callback.js";
|
|
11
|
+
export * as ConvexConfigProvider from "./ConvexConfigProvider.js";
|
|
12
|
+
export * as ConvexFunctionDefinitions from "./ConvexFunctionDefinitions.js";
|
|
13
|
+
export * as ConvexLogger from "./ConvexLogger.js";
|
|
14
|
+
export * as CronJob from "./CronJob.js";
|
|
15
|
+
export * as CronJobs from "./CronJobs.js";
|
|
16
|
+
export * as DatabaseReader from "./DatabaseReader.js";
|
|
17
|
+
export * as DatabaseSchema from "./DatabaseSchema.js";
|
|
18
|
+
export * as DatabaseWriter from "./DatabaseWriter.js";
|
|
19
|
+
export * as DataModel from "./DataModel.js";
|
|
20
|
+
export * as Document from "./Document.js";
|
|
21
|
+
export * as ExecutionMetadata from "./ExecutionMetadata.js";
|
|
22
|
+
export * as FunctionImpl from "./FunctionImpl.js";
|
|
23
|
+
export * as FunctionRegistryItem from "./FunctionRegistryItem.js";
|
|
24
|
+
export * as GroupImpl from "./GroupImpl.js";
|
|
25
|
+
export * as Handler from "./Handler.js";
|
|
26
|
+
export * as HttpRouter from "./HttpRouter.js";
|
|
27
|
+
export * as MiddlewareImpl from "./MiddlewareImpl.js";
|
|
28
|
+
export * as MiddlewareRegistryItem from "./MiddlewareRegistryItem.js";
|
|
29
|
+
export * as MutationCtx from "./MutationCtx.js";
|
|
30
|
+
export * as MutationRunner from "./MutationRunner.js";
|
|
31
|
+
export * as MutationTransactionContext from "./MutationTransactionContext.js";
|
|
32
|
+
export * as OfficialComponent from "./OfficialComponent.js";
|
|
33
|
+
export * as OrderedQuery from "./OrderedQuery.js";
|
|
34
|
+
export * as QueryCtx from "./QueryCtx.js";
|
|
35
|
+
export * as QueryInitializer from "./QueryInitializer.js";
|
|
36
|
+
export * as QueryRunner from "./QueryRunner.js";
|
|
37
|
+
export * as QueryTransactionContext from "./QueryTransactionContext.js";
|
|
36
38
|
/**
|
|
37
39
|
* @experimental
|
|
38
40
|
*/
|
|
39
|
-
export * as QueryStream from "./QueryStream";
|
|
41
|
+
export * as QueryStream from "./QueryStream.js";
|
|
40
42
|
/**
|
|
41
43
|
* @experimental
|
|
42
44
|
*/
|
|
43
|
-
export * as QueryStreamCursor from "./QueryStreamCursor";
|
|
45
|
+
export * as QueryStreamCursor from "./QueryStreamCursor.js";
|
|
44
46
|
/**
|
|
45
47
|
* @experimental
|
|
46
48
|
*/
|
|
47
|
-
export * as QueryStreamKeyLabels from "./QueryStreamKeyLabels";
|
|
49
|
+
export * as QueryStreamKeyLabels from "./QueryStreamKeyLabels.js";
|
|
48
50
|
/**
|
|
49
51
|
* @experimental
|
|
50
52
|
*/
|
|
51
|
-
export * as QueryStreamKeyLayout from "./QueryStreamKeyLayout";
|
|
53
|
+
export * as QueryStreamKeyLayout from "./QueryStreamKeyLayout.js";
|
|
52
54
|
/**
|
|
53
55
|
* @experimental
|
|
54
56
|
*/
|
|
55
|
-
export * as QueryStreamOrderDirection from "./QueryStreamOrderDirection";
|
|
57
|
+
export * as QueryStreamOrderDirection from "./QueryStreamOrderDirection.js";
|
|
56
58
|
/**
|
|
57
59
|
* @experimental
|
|
58
60
|
*/
|
|
59
|
-
export * as QueryStreamKeyValues from "./QueryStreamKeyValues";
|
|
61
|
+
export * as QueryStreamKeyValues from "./QueryStreamKeyValues.js";
|
|
60
62
|
/**
|
|
61
63
|
* @experimental
|
|
62
64
|
*/
|
|
63
|
-
export * as QueryStreamKeyBounds from "./QueryStreamKeyBounds";
|
|
65
|
+
export * as QueryStreamKeyBounds from "./QueryStreamKeyBounds.js";
|
|
64
66
|
/**
|
|
65
67
|
* @experimental
|
|
66
68
|
*/
|
|
67
|
-
export * as QueryStreamIndexRange from "./QueryStreamIndexRange";
|
|
69
|
+
export * as QueryStreamIndexRange from "./QueryStreamIndexRange.js";
|
|
68
70
|
/**
|
|
69
71
|
* @experimental
|
|
70
72
|
*/
|
|
71
|
-
export * as QueryStreamReadBudget from "./QueryStreamReadBudget";
|
|
72
|
-
export * as RegisteredConvexFunction from "./RegisteredConvexFunction";
|
|
73
|
-
export * as RegisteredFunction from "./RegisteredFunction";
|
|
74
|
-
export * as RegisteredFunctions from "./RegisteredFunctions";
|
|
75
|
-
export * as Registry from "./Registry";
|
|
76
|
-
export * as RegistryItems from "./RegistryItems";
|
|
77
|
-
export * as ResolvedMiddleware from "./ResolvedMiddleware";
|
|
78
|
-
export * as RequestMetadata from "./RequestMetadata";
|
|
79
|
-
export * as Scheduler from "./Scheduler";
|
|
80
|
-
export * as Storage from "./Storage";
|
|
81
|
-
export * as StorageActionWriter from "./StorageActionWriter";
|
|
82
|
-
export * as StorageReader from "./StorageReader";
|
|
83
|
-
export * as StorageWriter from "./StorageWriter";
|
|
84
|
-
export * as Table from "./Table";
|
|
85
|
-
export * as TableInfo from "./TableInfo";
|
|
86
|
-
export * as TransactionMetadata from "./TransactionMetadata";
|
|
87
|
-
export * as VectorSearch from "./VectorSearch";
|
|
73
|
+
export * as QueryStreamReadBudget from "./QueryStreamReadBudget.js";
|
|
74
|
+
export * as RegisteredConvexFunction from "./RegisteredConvexFunction.js";
|
|
75
|
+
export * as RegisteredFunction from "./RegisteredFunction.js";
|
|
76
|
+
export * as RegisteredFunctions from "./RegisteredFunctions.js";
|
|
77
|
+
export * as Registry from "./Registry.js";
|
|
78
|
+
export * as RegistryItems from "./RegistryItems.js";
|
|
79
|
+
export * as ResolvedMiddleware from "./ResolvedMiddleware.js";
|
|
80
|
+
export * as RequestMetadata from "./RequestMetadata.js";
|
|
81
|
+
export * as Scheduler from "./Scheduler.js";
|
|
82
|
+
export * as Storage from "./Storage.js";
|
|
83
|
+
export * as StorageActionWriter from "./StorageActionWriter.js";
|
|
84
|
+
export * as StorageReader from "./StorageReader.js";
|
|
85
|
+
export * as StorageWriter from "./StorageWriter.js";
|
|
86
|
+
export * as Table from "./Table.js";
|
|
87
|
+
export * as TableInfo from "./TableInfo.js";
|
|
88
|
+
export * as TransactionMetadata from "./TransactionMetadata.js";
|
|
89
|
+
export * as VectorSearch from "./VectorSearch.js";
|
|
88
90
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot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KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ActionCtx_exports } from "./ActionCtx.js";
|
|
2
2
|
import { ActionRunner_exports } from "./ActionRunner.js";
|
|
3
|
+
import { Registry_exports } from "./Registry.js";
|
|
4
|
+
import { MiddlewareRegistryItem_exports } from "./MiddlewareRegistryItem.js";
|
|
5
|
+
import { MiddlewareImpl_exports } from "./MiddlewareImpl.js";
|
|
6
|
+
import { MutationTransactionContext_exports } from "./MutationTransactionContext.js";
|
|
7
|
+
import { MutationRunner_exports } from "./MutationRunner.js";
|
|
8
|
+
import { QueryTransactionContext_exports } from "./QueryTransactionContext.js";
|
|
9
|
+
import { QueryRunner_exports } from "./QueryRunner.js";
|
|
10
|
+
import { Scheduler_exports } from "./Scheduler.js";
|
|
11
|
+
import { ActionCall_exports } from "./ActionCall.js";
|
|
3
12
|
import { AiGatewayDecisionClient_exports } from "./AiGatewayDecisionClient.js";
|
|
4
13
|
import { AiGatewayDecisionModel_exports } from "./AiGatewayDecisionModel.js";
|
|
5
14
|
import { AiGatewayLanguageClient_exports } from "./AiGatewayLanguageClient.js";
|
|
@@ -8,8 +17,15 @@ import { Auth_exports } from "./Auth.js";
|
|
|
8
17
|
import { BlobNotFoundError_exports } from "./BlobNotFoundError.js";
|
|
9
18
|
import { Callback_exports } from "./Callback.js";
|
|
10
19
|
import { ConvexConfigProvider_exports } from "./ConvexConfigProvider.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
20
|
+
import { ConvexLogger_exports } from "./ConvexLogger.js";
|
|
21
|
+
import { ExecutionMetadata_exports } from "./ExecutionMetadata.js";
|
|
22
|
+
import { RequestMetadata_exports } from "./RequestMetadata.js";
|
|
23
|
+
import { StorageActionWriter_exports } from "./StorageActionWriter.js";
|
|
24
|
+
import { StorageReader_exports } from "./StorageReader.js";
|
|
25
|
+
import { StorageWriter_exports } from "./StorageWriter.js";
|
|
26
|
+
import { Storage_exports } from "./Storage.js";
|
|
27
|
+
import { VectorSearch_exports } from "./VectorSearch.js";
|
|
28
|
+
import { RegisteredFunction_exports } from "./RegisteredFunction.js";
|
|
13
29
|
import { FunctionRegistryItem_exports } from "./FunctionRegistryItem.js";
|
|
14
30
|
import { DatabaseSchema_exports } from "./DatabaseSchema.js";
|
|
15
31
|
import { Document_exports } from "./Document.js";
|
|
@@ -27,23 +43,9 @@ import { QueryInitializer_exports } from "./QueryInitializer.js";
|
|
|
27
43
|
import { Table_exports } from "./Table.js";
|
|
28
44
|
import { DatabaseReader_exports } from "./DatabaseReader.js";
|
|
29
45
|
import { DatabaseWriter_exports } from "./DatabaseWriter.js";
|
|
30
|
-
import { ExecutionMetadata_exports } from "./ExecutionMetadata.js";
|
|
31
|
-
import { RequestMetadata_exports } from "./RequestMetadata.js";
|
|
32
46
|
import { TransactionMetadata_exports } from "./TransactionMetadata.js";
|
|
33
47
|
import { MutationCtx_exports } from "./MutationCtx.js";
|
|
34
|
-
import { MutationTransactionContext_exports } from "./MutationTransactionContext.js";
|
|
35
|
-
import { MutationRunner_exports } from "./MutationRunner.js";
|
|
36
48
|
import { QueryCtx_exports } from "./QueryCtx.js";
|
|
37
|
-
import { QueryTransactionContext_exports } from "./QueryTransactionContext.js";
|
|
38
|
-
import { QueryRunner_exports } from "./QueryRunner.js";
|
|
39
|
-
import { ConvexLogger_exports } from "./ConvexLogger.js";
|
|
40
|
-
import { Scheduler_exports } from "./Scheduler.js";
|
|
41
|
-
import { StorageActionWriter_exports } from "./StorageActionWriter.js";
|
|
42
|
-
import { StorageReader_exports } from "./StorageReader.js";
|
|
43
|
-
import { StorageWriter_exports } from "./StorageWriter.js";
|
|
44
|
-
import { Storage_exports } from "./Storage.js";
|
|
45
|
-
import { VectorSearch_exports } from "./VectorSearch.js";
|
|
46
|
-
import { RegisteredFunction_exports } from "./RegisteredFunction.js";
|
|
47
49
|
import { RegisteredConvexFunction_exports } from "./RegisteredConvexFunction.js";
|
|
48
50
|
import { ResolvedMiddleware_exports } from "./ResolvedMiddleware.js";
|
|
49
51
|
import { ConvexFunctionDefinitions_exports } from "./ConvexFunctionDefinitions.js";
|
|
@@ -55,7 +57,7 @@ import { RegistryItems_exports } from "./RegistryItems.js";
|
|
|
55
57
|
import { GroupImpl_exports } from "./GroupImpl.js";
|
|
56
58
|
import { Handler_exports } from "./Handler.js";
|
|
57
59
|
import { HttpRouter_exports } from "./HttpRouter.js";
|
|
58
|
-
import {
|
|
60
|
+
import { OfficialComponent_exports } from "./OfficialComponent.js";
|
|
59
61
|
import { RegisteredFunctions_exports } from "./RegisteredFunctions.js";
|
|
60
62
|
import { TableInfo_exports } from "./TableInfo.js";
|
|
61
|
-
export { ActionCtx_exports as ActionCtx, ActionRunner_exports as ActionRunner, AiGatewayDecisionClient_exports as AiGatewayDecisionClient, AiGatewayDecisionModel_exports as AiGatewayDecisionModel, AiGatewayLanguageClient_exports as AiGatewayLanguageClient, AiGatewayLanguageModel_exports as AiGatewayLanguageModel, Auth_exports as Auth, BlobNotFoundError_exports as BlobNotFoundError, Callback_exports as Callback, ConvexConfigProvider_exports as ConvexConfigProvider, ConvexFunctionDefinitions_exports as ConvexFunctionDefinitions, ConvexLogger_exports as ConvexLogger, CronJob_exports as CronJob, CronJobs_exports as CronJobs, DataModel_exports as DataModel, DatabaseReader_exports as DatabaseReader, DatabaseSchema_exports as DatabaseSchema, DatabaseWriter_exports as DatabaseWriter, Document_exports as Document, ExecutionMetadata_exports as ExecutionMetadata, FunctionImpl_exports as FunctionImpl, FunctionRegistryItem_exports as FunctionRegistryItem, GroupImpl_exports as GroupImpl, Handler_exports as Handler, HttpRouter_exports as HttpRouter, MiddlewareImpl_exports as MiddlewareImpl, MiddlewareRegistryItem_exports as MiddlewareRegistryItem, MutationCtx_exports as MutationCtx, MutationRunner_exports as MutationRunner, MutationTransactionContext_exports as MutationTransactionContext, OrderedQuery_exports as OrderedQuery, QueryCtx_exports as QueryCtx, QueryInitializer_exports as QueryInitializer, QueryRunner_exports as QueryRunner, QueryStream_exports as QueryStream, QueryStreamCursor_exports as QueryStreamCursor, QueryStreamIndexRange_exports as QueryStreamIndexRange, QueryStreamKeyBounds_exports as QueryStreamKeyBounds, QueryStreamKeyLabels_exports as QueryStreamKeyLabels, QueryStreamKeyLayout_exports as QueryStreamKeyLayout, QueryStreamKeyValues_exports as QueryStreamKeyValues, QueryStreamOrderDirection_exports as QueryStreamOrderDirection, QueryStreamReadBudget_exports as QueryStreamReadBudget, QueryTransactionContext_exports as QueryTransactionContext, RegisteredConvexFunction_exports as RegisteredConvexFunction, RegisteredFunction_exports as RegisteredFunction, RegisteredFunctions_exports as RegisteredFunctions, Registry_exports as Registry, RegistryItems_exports as RegistryItems, RequestMetadata_exports as RequestMetadata, ResolvedMiddleware_exports as ResolvedMiddleware, Scheduler_exports as Scheduler, Storage_exports as Storage, StorageActionWriter_exports as StorageActionWriter, StorageReader_exports as StorageReader, StorageWriter_exports as StorageWriter, Table_exports as Table, TableInfo_exports as TableInfo, TransactionMetadata_exports as TransactionMetadata, VectorSearch_exports as VectorSearch };
|
|
63
|
+
export { ActionCall_exports as ActionCall, ActionCtx_exports as ActionCtx, ActionRunner_exports as ActionRunner, AiGatewayDecisionClient_exports as AiGatewayDecisionClient, AiGatewayDecisionModel_exports as AiGatewayDecisionModel, AiGatewayLanguageClient_exports as AiGatewayLanguageClient, AiGatewayLanguageModel_exports as AiGatewayLanguageModel, Auth_exports as Auth, BlobNotFoundError_exports as BlobNotFoundError, Callback_exports as Callback, ConvexConfigProvider_exports as ConvexConfigProvider, ConvexFunctionDefinitions_exports as ConvexFunctionDefinitions, ConvexLogger_exports as ConvexLogger, CronJob_exports as CronJob, CronJobs_exports as CronJobs, DataModel_exports as DataModel, DatabaseReader_exports as DatabaseReader, DatabaseSchema_exports as DatabaseSchema, DatabaseWriter_exports as DatabaseWriter, Document_exports as Document, ExecutionMetadata_exports as ExecutionMetadata, FunctionImpl_exports as FunctionImpl, FunctionRegistryItem_exports as FunctionRegistryItem, GroupImpl_exports as GroupImpl, Handler_exports as Handler, HttpRouter_exports as HttpRouter, MiddlewareImpl_exports as MiddlewareImpl, MiddlewareRegistryItem_exports as MiddlewareRegistryItem, MutationCtx_exports as MutationCtx, MutationRunner_exports as MutationRunner, MutationTransactionContext_exports as MutationTransactionContext, OfficialComponent_exports as OfficialComponent, OrderedQuery_exports as OrderedQuery, QueryCtx_exports as QueryCtx, QueryInitializer_exports as QueryInitializer, QueryRunner_exports as QueryRunner, QueryStream_exports as QueryStream, QueryStreamCursor_exports as QueryStreamCursor, QueryStreamIndexRange_exports as QueryStreamIndexRange, QueryStreamKeyBounds_exports as QueryStreamKeyBounds, QueryStreamKeyLabels_exports as QueryStreamKeyLabels, QueryStreamKeyLayout_exports as QueryStreamKeyLayout, QueryStreamKeyValues_exports as QueryStreamKeyValues, QueryStreamOrderDirection_exports as QueryStreamOrderDirection, QueryStreamReadBudget_exports as QueryStreamReadBudget, QueryTransactionContext_exports as QueryTransactionContext, RegisteredConvexFunction_exports as RegisteredConvexFunction, RegisteredFunction_exports as RegisteredFunction, RegisteredFunctions_exports as RegisteredFunctions, Registry_exports as Registry, RegistryItems_exports as RegistryItems, RequestMetadata_exports as RequestMetadata, ResolvedMiddleware_exports as ResolvedMiddleware, Scheduler_exports as Scheduler, Storage_exports as Storage, StorageActionWriter_exports as StorageActionWriter, StorageReader_exports as StorageReader, StorageWriter_exports as StorageWriter, Table_exports as Table, TableInfo_exports as TableInfo, TransactionMetadata_exports as TransactionMetadata, VectorSearch_exports as VectorSearch };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as OpenRouterClient from "@effect/ai-openrouter/OpenRouterClient";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as AiGatewayServiceToken from "./AiGatewayServiceToken";
|
|
4
|
+
import * as AiGatewayServiceToken from "./AiGatewayServiceToken.js";
|
|
5
5
|
export declare const make: Effect.Effect<OpenRouterClient.Service, AiGatewayServiceToken.AiGatewayDisabled | AiGatewayServiceToken.AiGatewayUnavailable, AiGatewayServiceToken.AiGatewayServiceToken | import("effect/http/HttpClient").HttpClient>;
|
|
6
6
|
export declare const layer: Layer.Layer<OpenRouterClient.OpenRouterClient, AiGatewayServiceToken.AiGatewayDisabled | AiGatewayServiceToken.AiGatewayUnavailable, AiGatewayServiceToken.AiGatewayServiceToken | import("effect/http/HttpClient").HttpClient>;
|
|
7
7
|
//# sourceMappingURL=AiGatewayDecisionClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiGatewayDecisionClient.d.ts","sourceRoot":"","sources":["../../src/internal/AiGatewayDecisionClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"AiGatewayDecisionClient.d.ts","sourceRoot":"","sources":["../../src/internal/AiGatewayDecisionClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC;AAGpE,eAAO,MAAM,IAAI,0NAOf,CAAC;AAEH,eAAO,MAAM,KAAK,iOAAwD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AiGatewayServiceToken, transformClientRequest } from "./AiGatewayServiceToken.js";
|
|
2
2
|
import { AI_GATEWAY_API_URL } from "./constants.js";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as OpenRouterClient from "@effect/ai-openrouter/OpenRouterClient";
|
|
6
6
|
//#region src/internal/AiGatewayDecisionClient.ts
|
|
7
7
|
const make = Effect.gen(function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiGatewayDecisionClient.js","names":["AiGatewayServiceToken.AiGatewayServiceToken","AiGatewayServiceToken.transformClientRequest"],"sources":["../../src/internal/AiGatewayDecisionClient.ts"],"sourcesContent":["import * as OpenRouterClient from \"@effect/ai-openrouter/OpenRouterClient\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as AiGatewayServiceToken from \"./AiGatewayServiceToken\";\nimport { AI_GATEWAY_API_URL } from \"./constants\";\n\nexport const make = Effect.gen(function* () {\n const serviceToken = yield* AiGatewayServiceToken.AiGatewayServiceToken;\n yield* serviceToken.get(\"ai-gateway\");\n return yield* OpenRouterClient.make({\n apiUrl: AI_GATEWAY_API_URL,\n transformClient: AiGatewayServiceToken.transformClientRequest(serviceToken),\n });\n});\n\nexport const layer = Layer.effect(OpenRouterClient.OpenRouterClient, make);\n"],"mappings":";;;;;;AAMA,MAAa,OAAO,OAAO,IAAI,aAAa;CAC1C,MAAM,eAAe,OAAOA;CAC5B,OAAO,aAAa,IAAI,YAAY;CACpC,OAAO,OAAO,iBAAiB,KAAK;EAClC,QAAQ;EACR,iBAAiBC,uBAA6C,YAAY;CAC5E,CAAC;AACH,CAAC;AAED,MAAa,QAAQ,MAAM,OAAO,iBAAiB,kBAAkB,IAAI"}
|
|
1
|
+
{"version":3,"file":"AiGatewayDecisionClient.js","names":["AiGatewayServiceToken.AiGatewayServiceToken","AiGatewayServiceToken.transformClientRequest"],"sources":["../../src/internal/AiGatewayDecisionClient.ts"],"sourcesContent":["import * as OpenRouterClient from \"@effect/ai-openrouter/OpenRouterClient\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as AiGatewayServiceToken from \"./AiGatewayServiceToken.js\";\nimport { AI_GATEWAY_API_URL } from \"./constants.js\";\n\nexport const make = Effect.gen(function* () {\n const serviceToken = yield* AiGatewayServiceToken.AiGatewayServiceToken;\n yield* serviceToken.get(\"ai-gateway\");\n return yield* OpenRouterClient.make({\n apiUrl: AI_GATEWAY_API_URL,\n transformClient: AiGatewayServiceToken.transformClientRequest(serviceToken),\n });\n});\n\nexport const layer = Layer.effect(OpenRouterClient.OpenRouterClient, make);\n"],"mappings":";;;;;;AAMA,MAAa,OAAO,OAAO,IAAI,aAAa;CAC1C,MAAM,eAAe,OAAOA;CAC5B,OAAO,aAAa,IAAI,YAAY;CACpC,OAAO,OAAO,iBAAiB,KAAK;EAClC,QAAQ;EACR,iBAAiBC,uBAA6C,YAAY;CAC5E,CAAC;AACH,CAAC;AAED,MAAa,QAAQ,MAAM,OAAO,iBAAiB,kBAAkB,IAAI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as OpenAiClient from "@effect/ai-openai-compat/OpenAiClient";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as AiGatewayServiceToken from "./AiGatewayServiceToken";
|
|
4
|
+
import * as AiGatewayServiceToken from "./AiGatewayServiceToken.js";
|
|
5
5
|
export declare const make: Effect.Effect<OpenAiClient.Service, AiGatewayServiceToken.AiGatewayDisabled | AiGatewayServiceToken.AiGatewayUnavailable, AiGatewayServiceToken.AiGatewayServiceToken | import("effect/http/HttpClient").HttpClient>;
|
|
6
6
|
export declare const layer: Layer.Layer<OpenAiClient.OpenAiClient, AiGatewayServiceToken.AiGatewayDisabled | AiGatewayServiceToken.AiGatewayUnavailable, AiGatewayServiceToken.AiGatewayServiceToken | import("effect/http/HttpClient").HttpClient>;
|
|
7
7
|
//# sourceMappingURL=AiGatewayLanguageClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiGatewayLanguageClient.d.ts","sourceRoot":"","sources":["../../src/internal/AiGatewayLanguageClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,uCAAuC,CAAC;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"AiGatewayLanguageClient.d.ts","sourceRoot":"","sources":["../../src/internal/AiGatewayLanguageClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,uCAAuC,CAAC;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC;AAGpE,eAAO,MAAM,IAAI,sNAOf,CAAC;AAEH,eAAO,MAAM,KAAK,yNAAgD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AiGatewayServiceToken, transformClientRequest } from "./AiGatewayServiceToken.js";
|
|
2
2
|
import { AI_GATEWAY_API_URL } from "./constants.js";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as OpenAiClient from "@effect/ai-openai-compat/OpenAiClient";
|
|
6
6
|
//#region src/internal/AiGatewayLanguageClient.ts
|
|
7
7
|
const make = Effect.gen(function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiGatewayLanguageClient.js","names":["AiGatewayServiceToken.AiGatewayServiceToken","AiGatewayServiceToken.transformClientRequest"],"sources":["../../src/internal/AiGatewayLanguageClient.ts"],"sourcesContent":["import * as OpenAiClient from \"@effect/ai-openai-compat/OpenAiClient\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as AiGatewayServiceToken from \"./AiGatewayServiceToken\";\nimport { AI_GATEWAY_API_URL } from \"./constants\";\n\nexport const make = Effect.gen(function* () {\n const serviceToken = yield* AiGatewayServiceToken.AiGatewayServiceToken;\n yield* serviceToken.get(\"ai-gateway\");\n return yield* OpenAiClient.make({\n apiUrl: AI_GATEWAY_API_URL,\n transformClient: AiGatewayServiceToken.transformClientRequest(serviceToken),\n });\n});\n\nexport const layer = Layer.effect(OpenAiClient.OpenAiClient, make);\n"],"mappings":";;;;;;AAMA,MAAa,OAAO,OAAO,IAAI,aAAa;CAC1C,MAAM,eAAe,OAAOA;CAC5B,OAAO,aAAa,IAAI,YAAY;CACpC,OAAO,OAAO,aAAa,KAAK;EAC9B,QAAQ;EACR,iBAAiBC,uBAA6C,YAAY;CAC5E,CAAC;AACH,CAAC;AAED,MAAa,QAAQ,MAAM,OAAO,aAAa,cAAc,IAAI"}
|
|
1
|
+
{"version":3,"file":"AiGatewayLanguageClient.js","names":["AiGatewayServiceToken.AiGatewayServiceToken","AiGatewayServiceToken.transformClientRequest"],"sources":["../../src/internal/AiGatewayLanguageClient.ts"],"sourcesContent":["import * as OpenAiClient from \"@effect/ai-openai-compat/OpenAiClient\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as AiGatewayServiceToken from \"./AiGatewayServiceToken.js\";\nimport { AI_GATEWAY_API_URL } from \"./constants.js\";\n\nexport const make = Effect.gen(function* () {\n const serviceToken = yield* AiGatewayServiceToken.AiGatewayServiceToken;\n yield* serviceToken.get(\"ai-gateway\");\n return yield* OpenAiClient.make({\n apiUrl: AI_GATEWAY_API_URL,\n transformClient: AiGatewayServiceToken.transformClientRequest(serviceToken),\n });\n});\n\nexport const layer = Layer.effect(OpenAiClient.OpenAiClient, make);\n"],"mappings":";;;;;;AAMA,MAAa,OAAO,OAAO,IAAI,aAAa;CAC1C,MAAM,eAAe,OAAOA;CAC5B,OAAO,aAAa,IAAI,YAAY;CACpC,OAAO,OAAO,aAAa,KAAK;EAC9B,QAAQ;EACR,iBAAiBC,uBAA6C,YAAY;CAC5E,CAAC;AACH,CAAC;AAED,MAAa,QAAQ,MAAM,OAAO,aAAa,cAAc,IAAI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Context from "effect/Context";
|
|
2
|
-
import * as Layer from "effect/Layer";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
4
|
import { getServiceToken } from "convex/server";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
import * as HttpClient from "effect/http/HttpClient";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReadonlyValue } from "@confect/core/SchemaToValidator";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Record from "effect/Record";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import type * as Table from "../Table.js";
|
|
6
|
+
export type EncodedPatch = Record.ReadonlyRecord<string, ReadonlyValue | undefined>;
|
|
7
|
+
export type PatchEncoder = (patch: Record.ReadonlyRecord<string, unknown>) => Effect.Effect<EncodedPatch, Schema.SchemaError>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the encoder for patches to the table's documents, or `undefined` when
|
|
10
|
+
* the table's codec does not encode each field independently. The encoder maps
|
|
11
|
+
* every patched field of the table to its encoded value, or to `undefined` when
|
|
12
|
+
* the patch unsets the field or the field's codec encodes the value as an
|
|
13
|
+
* absent key. Keys outside the table's fields are left out.
|
|
14
|
+
*/
|
|
15
|
+
export declare const encoder: (table: Table.AnyWithProps) => PatchEncoder | undefined;
|
|
16
|
+
//# sourceMappingURL=DocumentPatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentPatch.d.ts","sourceRoot":"","sources":["../../src/internal/DocumentPatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAC9C,MAAM,EACN,aAAa,GAAG,SAAS,CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1C,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;AAIrD;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,UACX,KAAK,CAAC,YAAY,KACxB,YAAY,GAAG,SAOjB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Record from "effect/Record";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { pipe } from "effect/Function";
|
|
5
|
+
import * as SchemaAST from "effect/SchemaAST";
|
|
6
|
+
//#region src/internal/DocumentPatch.ts
|
|
7
|
+
const patchEncoders = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
/**
|
|
9
|
+
* Returns the encoder for patches to the table's documents, or `undefined` when
|
|
10
|
+
* the table's codec does not encode each field independently. The encoder maps
|
|
11
|
+
* every patched field of the table to its encoded value, or to `undefined` when
|
|
12
|
+
* the patch unsets the field or the field's codec encodes the value as an
|
|
13
|
+
* absent key. Keys outside the table's fields are left out.
|
|
14
|
+
*/
|
|
15
|
+
const encoder = (table) => {
|
|
16
|
+
let cached = patchEncoders.get(table);
|
|
17
|
+
if (cached === void 0) {
|
|
18
|
+
cached = makePatchEncoder(table);
|
|
19
|
+
patchEncoders.set(table, cached);
|
|
20
|
+
}
|
|
21
|
+
return cached ?? void 0;
|
|
22
|
+
};
|
|
23
|
+
const makePatchEncoder = (table) => {
|
|
24
|
+
const ast = table.Fields.ast;
|
|
25
|
+
if (!SchemaAST.isObjects(ast) || ast.encoding !== void 0 || ast.checks !== void 0 || ast.indexSignatures.length > 0) return null;
|
|
26
|
+
const fieldEncoders = Object.fromEntries(ast.propertySignatures.map(({ name, type }) => {
|
|
27
|
+
const key = String(name);
|
|
28
|
+
const encode = Schema.encodeUnknownEffect(Schema.Struct({ [key]: Schema.optionalKey(Schema.make(type)) }));
|
|
29
|
+
return [key, (value) => Effect.map(encode({ [key]: value }), (encoded) => encoded[key])];
|
|
30
|
+
}));
|
|
31
|
+
return (patch) => pipe(fieldEncoders, Record.filter((_, name) => Object.hasOwn(patch, name)), Record.map((encode, name) => patch[name] === void 0 ? Effect.undefined : encode(patch[name])), Effect.all);
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { encoder };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=DocumentPatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentPatch.js","names":[],"sources":["../../src/internal/DocumentPatch.ts"],"sourcesContent":["import type { ReadonlyValue } from \"@confect/core/SchemaToValidator\";\nimport { pipe } from \"effect/Function\";\nimport * as Effect from \"effect/Effect\";\nimport * as Record from \"effect/Record\";\nimport * as Schema from \"effect/Schema\";\nimport * as SchemaAST from \"effect/SchemaAST\";\nimport type * as Table from \"../Table.js\";\n\nexport type EncodedPatch = Record.ReadonlyRecord<\n string,\n ReadonlyValue | undefined\n>;\n\nexport type PatchEncoder = (\n patch: Record.ReadonlyRecord<string, unknown>,\n) => Effect.Effect<EncodedPatch, Schema.SchemaError>;\n\nconst patchEncoders = new WeakMap<Table.AnyWithProps, PatchEncoder | null>();\n\n/**\n * Returns the encoder for patches to the table's documents, or `undefined` when\n * the table's codec does not encode each field independently. The encoder maps\n * every patched field of the table to its encoded value, or to `undefined` when\n * the patch unsets the field or the field's codec encodes the value as an\n * absent key. Keys outside the table's fields are left out.\n */\nexport const encoder = (\n table: Table.AnyWithProps,\n): PatchEncoder | undefined => {\n let cached = patchEncoders.get(table);\n if (cached === undefined) {\n cached = makePatchEncoder(table);\n patchEncoders.set(table, cached);\n }\n return cached ?? undefined;\n};\n\n// A struct with no encoding of its own encodes each field through that field's\n// codec alone, so a patch encodes field by field. A union or a transformation\n// over the whole struct can make one field's encoding depend on another field.\n// A struct-level check must see the decoded fields before they are encoded,\n// and keys under an index signature have no field codec of their own.\nconst makePatchEncoder = (table: Table.AnyWithProps): PatchEncoder | null => {\n const ast = table.Fields.ast;\n if (\n !SchemaAST.isObjects(ast) ||\n ast.encoding !== undefined ||\n ast.checks !== undefined ||\n ast.indexSignatures.length > 0\n ) {\n return null;\n }\n // A field's codec runs only when the patch gives the field a value, since a\n // codec can handle a missing key. Each comes from the table, whose codecs\n // need no services.\n const fieldEncoders: Record.ReadonlyRecord<\n string,\n (\n value: unknown,\n ) => Effect.Effect<ReadonlyValue | undefined, Schema.SchemaError>\n > = Object.fromEntries(\n ast.propertySignatures.map(({ name, type }) => {\n const key = String(name);\n const encode = Schema.encodeUnknownEffect(\n Schema.Struct({\n [key]: Schema.optionalKey(\n Schema.make<Schema.Codec<unknown, ReadonlyValue>>(type),\n ),\n }),\n );\n return [\n key,\n (value: unknown) =>\n Effect.map(encode({ [key]: value }), (encoded) => encoded[key]),\n ];\n }),\n );\n return (patch) =>\n pipe(\n fieldEncoders,\n Record.filter((_, name) => Object.hasOwn(patch, name)),\n Record.map((encode, name) =>\n patch[name] === undefined ? Effect.undefined : encode(patch[name]),\n ),\n Effect.all,\n );\n};\n"],"mappings":";;;;;;AAiBA,MAAM,gCAAgB,IAAI,QAAiD;;;;;;;;AAS3E,MAAa,WACX,UAC6B;CAC7B,IAAI,SAAS,cAAc,IAAI,KAAK;CACpC,IAAI,WAAW,KAAA,GAAW;EACxB,SAAS,iBAAiB,KAAK;EAC/B,cAAc,IAAI,OAAO,MAAM;CACjC;CACA,OAAO,UAAU,KAAA;AACnB;AAOA,MAAM,oBAAoB,UAAmD;CAC3E,MAAM,MAAM,MAAM,OAAO;CACzB,IACE,CAAC,UAAU,UAAU,GAAG,KACxB,IAAI,aAAa,KAAA,KACjB,IAAI,WAAW,KAAA,KACf,IAAI,gBAAgB,SAAS,GAE7B,OAAO;CAKT,MAAM,gBAKF,OAAO,YACT,IAAI,mBAAmB,KAAK,EAAE,MAAM,WAAW;EAC7C,MAAM,MAAM,OAAO,IAAI;EACvB,MAAM,SAAS,OAAO,oBACpB,OAAO,OAAO,GACX,MAAM,OAAO,YACZ,OAAO,KAA2C,IAAI,CACxD,EACF,CAAC,CACH;EACA,OAAO,CACL,MACC,UACC,OAAO,IAAI,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,YAAY,QAAQ,IAAI,CAClE;CACF,CAAC,CACH;CACA,QAAQ,UACN,KACE,eACA,OAAO,QAAQ,GAAG,SAAS,OAAO,OAAO,OAAO,IAAI,CAAC,GACrD,OAAO,KAAK,QAAQ,SAClB,MAAM,UAAU,KAAA,IAAY,OAAO,YAAY,OAAO,MAAM,KAAK,CACnE,GACA,OAAO,GACT;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/internal/observability.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,eAAO,MAAM,KAAK,iBAAqB,CAAC;AAGxC,eAAO,MAAM,QAAQ,UAAW,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAerE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { layer } from "../ConvexConfigProvider.js";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Duration from "effect/Duration";
|
|
5
|
+
import * as Exit from "effect/Exit";
|
|
6
|
+
import * as Scope from "effect/Scope";
|
|
7
|
+
//#region src/internal/observability.ts
|
|
8
|
+
const memoMap = Layer.makeMemoMapUnsafe();
|
|
9
|
+
const scope = Scope.makeUnsafe();
|
|
10
|
+
const layers = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
const memoized = (layer$1) => {
|
|
12
|
+
const cached = layers.get(layer$1);
|
|
13
|
+
if (cached !== void 0) return cached;
|
|
14
|
+
const built = Layer.buildWithMemoMap(layer$1, memoMap, scope).pipe(Effect.provide(layer), Effect.cachedWithTTL((exit) => Exit.isSuccess(exit) ? Duration.infinity : Duration.zero), Effect.runSync, Effect.uninterruptible, Layer.effectContext);
|
|
15
|
+
layers.set(layer$1, built);
|
|
16
|
+
return built;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { memoized, scope };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=observability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability.js","names":["layer","ConvexConfigProvider.layer"],"sources":["../../src/internal/observability.ts"],"sourcesContent":["import * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Scope from \"effect/Scope\";\nimport * as ConvexConfigProvider from \"../ConvexConfigProvider.js\";\n\nconst memoMap = Layer.makeMemoMapUnsafe();\nexport const scope = Scope.makeUnsafe();\nconst layers = new WeakMap<Layer.Layer<never>, Layer.Layer<never>>();\n\nexport const memoized = (layer: Layer.Layer<never>): Layer.Layer<never> => {\n const cached = layers.get(layer);\n if (cached !== undefined) return cached;\n const built = Layer.buildWithMemoMap(layer, memoMap, scope).pipe(\n Effect.provide(ConvexConfigProvider.layer),\n // A failed first build is retried on the next invocation instead of failing every later one.\n Effect.cachedWithTTL((exit) =>\n Exit.isSuccess(exit) ? Duration.infinity : Duration.zero,\n ),\n Effect.runSync,\n Effect.uninterruptible,\n Layer.effectContext,\n );\n layers.set(layer, built);\n return built;\n};\n"],"mappings":";;;;;;;AAOA,MAAM,UAAU,MAAM,kBAAkB;AACxC,MAAa,QAAQ,MAAM,WAAW;AACtC,MAAM,yBAAS,IAAI,QAAgD;AAEnE,MAAa,YAAY,YAAkD;CACzE,MAAM,SAAS,OAAO,IAAIA,OAAK;CAC/B,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,QAAQ,MAAM,iBAAiBA,SAAO,SAAS,KAAK,CAAC,CAAC,KAC1D,OAAO,QAAQC,KAA0B,GAEzC,OAAO,eAAe,SACpB,KAAK,UAAU,IAAI,IAAI,SAAS,WAAW,SAAS,IACtD,GACA,OAAO,SACP,OAAO,iBACP,MAAM,aACR;CACA,OAAO,IAAID,SAAO,KAAK;CACvB,OAAO;AACT"}
|
package/dist/node.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as RegisteredNodeFunction from "./RegisteredNodeFunction";
|
|
1
|
+
export * as RegisteredNodeFunction from "./RegisteredNodeFunction.js";
|
|
2
2
|
//# sourceMappingURL=node.d.ts.map
|