rads-db 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -735,12 +735,12 @@ function getRestRoutes(db, prefix = "/") {
|
|
|
735
735
|
if (!entity.decorators?.entity)
|
|
736
736
|
continue;
|
|
737
737
|
routes[`${prefix}${entity.handle}`] = {
|
|
738
|
-
POST: (args) => db[entity.handle].get(args),
|
|
739
|
-
PUT: (args) => db[entity.handle].put(args?.data)
|
|
738
|
+
POST: (args, ctx) => db[entity.handle].get(args, ctx),
|
|
739
|
+
PUT: (args, ctx) => db[entity.handle].put(args?.data, ctx)
|
|
740
740
|
};
|
|
741
741
|
routes[`${prefix}${entity.handlePlural}`] = {
|
|
742
|
-
POST: (args) => db[entity.handle].getMany(args),
|
|
743
|
-
PUT: (args) => db[entity.handle].putMany(args?.data)
|
|
742
|
+
POST: (args, ctx) => db[entity.handle].getMany(args, ctx),
|
|
743
|
+
PUT: (args, ctx) => db[entity.handle].putMany(args?.data, ctx)
|
|
744
744
|
};
|
|
745
745
|
}
|
|
746
746
|
return routes;
|
package/dist/index.d.ts
CHANGED
|
@@ -114,7 +114,9 @@ interface AzureCosmosDriverOptions {
|
|
|
114
114
|
containerName?: string;
|
|
115
115
|
options?: Omit<CosmosClientOptions, 'key' | 'endpoint'>;
|
|
116
116
|
}
|
|
117
|
-
type DriverOptions = RestDriverOptions | MemoryDriverOptions | AzureCosmosDriverOptions
|
|
117
|
+
type DriverOptions = (RestDriverOptions | MemoryDriverOptions | AzureCosmosDriverOptions) & {
|
|
118
|
+
log?: RadsRequestContext['log'];
|
|
119
|
+
};
|
|
118
120
|
type GenerateClientOptions = Partial<GenerateClientNormalizedOptions>;
|
|
119
121
|
interface GenerateClientNormalizedOptions {
|
|
120
122
|
entitiesDir: string;
|
package/dist/index.mjs
CHANGED
|
@@ -728,12 +728,12 @@ function getRestRoutes(db, prefix = "/") {
|
|
|
728
728
|
if (!entity.decorators?.entity)
|
|
729
729
|
continue;
|
|
730
730
|
routes[`${prefix}${entity.handle}`] = {
|
|
731
|
-
POST: (args) => db[entity.handle].get(args),
|
|
732
|
-
PUT: (args) => db[entity.handle].put(args?.data)
|
|
731
|
+
POST: (args, ctx) => db[entity.handle].get(args, ctx),
|
|
732
|
+
PUT: (args, ctx) => db[entity.handle].put(args?.data, ctx)
|
|
733
733
|
};
|
|
734
734
|
routes[`${prefix}${entity.handlePlural}`] = {
|
|
735
|
-
POST: (args) => db[entity.handle].getMany(args),
|
|
736
|
-
PUT: (args) => db[entity.handle].putMany(args?.data)
|
|
735
|
+
POST: (args, ctx) => db[entity.handle].getMany(args, ctx),
|
|
736
|
+
PUT: (args, ctx) => db[entity.handle].putMany(args?.data, ctx)
|
|
737
737
|
};
|
|
738
738
|
}
|
|
739
739
|
return routes;
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"require": "./integrations/*.cjs"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"version": "0.1.
|
|
31
|
+
"version": "0.1.21",
|
|
32
32
|
"description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
|
|
33
33
|
"keywords": [],
|
|
34
34
|
"author": "",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"zod": "^3.21.4"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
|
-
"
|
|
73
|
+
"predev": "pnpm link-rads-db",
|
|
74
74
|
"test": "vitest --run && vitest typecheck --run",
|
|
75
75
|
"link-rads-db": "symlink-dir ./test/_rads-db ./node_modules/_rads-db",
|
|
76
76
|
"generate-test-schema": "rads-db",
|