rads-db 3.2.16 → 3.2.18

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/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { g as RadsConfig, T as TypeDefinition } from './types-a4b98ad2.js';
1
+ import { g as RadsConfig, T as TypeDefinition } from './types-1457da55.js';
2
2
  import 'mssql';
3
3
  import '_rads-db';
4
4
 
package/dist/index.cjs CHANGED
@@ -1070,10 +1070,10 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
1070
1070
  }
1071
1071
  doc = validatedDoc;
1072
1072
  await radsDbRelations.fillDenormFieldsBeforePut(computedContext, docArgsToSave, ctx);
1073
- await driverInstance.put(doc, ctx);
1073
+ const putResponse = await driverInstance.put(doc, ctx);
1074
1074
  await handleEffectsAfterPut(computedContext, docArgsToSave, beforePutResults, ctx);
1075
1075
  await afterPut(docArgsToSave, ctx, computedContext);
1076
- return doc;
1076
+ return putResponse || doc;
1077
1077
  }
1078
1078
  };
1079
1079
  for (const f of options.features) {
@@ -1247,7 +1247,8 @@ function getDriverInstanceInner(schema, key, driverConstructor) {
1247
1247
  async put(data, ctx) {
1248
1248
  if (!data)
1249
1249
  throw new Error("Data is required");
1250
- await driverInstance.putMany([data], ctx);
1250
+ const response = await driverInstance.putMany([data], ctx);
1251
+ return response?.[0];
1251
1252
  },
1252
1253
  deleteMany(args, ctx) {
1253
1254
  throw new Error(`"deleteMany" not supported for driver "${driverInstance.driverName}"`);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as EntityDecoratorArgs, U as UiDecoratorArgs, a as UiFieldDecoratorArgs, V as ValidateEntityDecoratorArgs, b as ValidateFieldDecoratorArgs, F as FieldDecoratorArgs, C as ComputedDecoratorArgs, S as Schema, D as DriverConstructor, c as Driver, d as ComputedContext, R as RadsRequestContext, e as CreateRadsDbArgs, f as CreateRadsDbClientArgs } from './types-a4b98ad2.js';
2
- export { O as Change, x as ComputedContextGlobal, k as CreateRadsArgsDrivers, m as CreateRadsDbArgsNormalized, ak as DeepKeys, af as DeepPartial, ad as DeepPartialWithNulls, ae as DeepPartialWithNullsItem, al as EntityMethods, w as EnumDefinition, v as FieldDefinition, J as FileSystemNode, u as FileUploadArgs, q as FileUploadDriver, p as FileUploadResult, H as GenerateClientNormalizedOptions, B as GenerateClientOptions, a9 as Get, $ as GetAggArgs, a0 as GetAggArgsAgg, a3 as GetAggArgsAny, a6 as GetAggResponse, _ as GetArgs, a2 as GetArgsAny, a5 as GetArgsInclude, Q as GetManyArgs, a1 as GetManyArgsAny, a7 as GetManyResponse, a8 as GetResponse, aa as GetResponseInclude, ab as GetResponseIncludeSelect, ac as GetResponseNoInclude, s as GetRestRoutesArgs, G as GetRestRoutesOptions, t as GetRestRoutesResponse, ah as InverseRelation, aj as JsonPutOperations, M as MinimalDriver, ai as Put, P as PutEffect, g as RadsConfig, h as RadsConfigDataSource, r as RadsDbInstance, N as RadsFeature, y as RadsHookDoc, L as RadsUiSlotDefinition, K as RadsUiSlotName, I as RadsVitePluginOptions, ag as Relation, i as RequiredFields, l as RestDriverOptions, A as RestFileUploadDriverOptions, n as SchemaLoadResult, o as SchemaValidators, z as SqlDriverOptions, T as TypeDefinition, j as ValidateStringDecoratorArgs, X as VerifyManyArgs, a4 as VerifyManyArgsAny, Y as VerifyManyResponse, Z as Where, W as WhereJsonContains } from './types-a4b98ad2.js';
1
+ import { E as EntityDecoratorArgs, U as UiDecoratorArgs, a as UiFieldDecoratorArgs, V as ValidateEntityDecoratorArgs, b as ValidateFieldDecoratorArgs, F as FieldDecoratorArgs, C as ComputedDecoratorArgs, S as Schema, D as DriverConstructor, c as Driver, d as ComputedContext, R as RadsRequestContext, e as CreateRadsDbArgs, f as CreateRadsDbClientArgs } from './types-1457da55.js';
2
+ export { O as Change, x as ComputedContextGlobal, k as CreateRadsArgsDrivers, m as CreateRadsDbArgsNormalized, ak as DeepKeys, af as DeepPartial, ad as DeepPartialWithNulls, ae as DeepPartialWithNullsItem, al as EntityMethods, w as EnumDefinition, v as FieldDefinition, J as FileSystemNode, u as FileUploadArgs, q as FileUploadDriver, p as FileUploadResult, H as GenerateClientNormalizedOptions, B as GenerateClientOptions, a9 as Get, $ as GetAggArgs, a0 as GetAggArgsAgg, a3 as GetAggArgsAny, a6 as GetAggResponse, _ as GetArgs, a2 as GetArgsAny, a5 as GetArgsInclude, Q as GetManyArgs, a1 as GetManyArgsAny, a7 as GetManyResponse, a8 as GetResponse, aa as GetResponseInclude, ab as GetResponseIncludeSelect, ac as GetResponseNoInclude, s as GetRestRoutesArgs, G as GetRestRoutesOptions, t as GetRestRoutesResponse, ah as InverseRelation, aj as JsonPutOperations, M as MinimalDriver, ai as Put, P as PutEffect, g as RadsConfig, h as RadsConfigDataSource, r as RadsDbInstance, N as RadsFeature, y as RadsHookDoc, L as RadsUiSlotDefinition, K as RadsUiSlotName, I as RadsVitePluginOptions, ag as Relation, i as RequiredFields, l as RestDriverOptions, A as RestFileUploadDriverOptions, n as SchemaLoadResult, o as SchemaValidators, z as SqlDriverOptions, T as TypeDefinition, j as ValidateStringDecoratorArgs, X as VerifyManyArgs, a4 as VerifyManyArgsAny, Y as VerifyManyResponse, Z as Where, W as WhereJsonContains } from './types-1457da55.js';
3
3
  import { RadsDb } from '_rads-db';
4
4
  export { RadsDb } from '_rads-db';
5
5
  import 'mssql';
package/dist/index.mjs CHANGED
@@ -1063,10 +1063,10 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
1063
1063
  }
1064
1064
  doc = validatedDoc;
1065
1065
  await radsDbRelations.fillDenormFieldsBeforePut(computedContext, docArgsToSave, ctx);
1066
- await driverInstance.put(doc, ctx);
1066
+ const putResponse = await driverInstance.put(doc, ctx);
1067
1067
  await handleEffectsAfterPut(computedContext, docArgsToSave, beforePutResults, ctx);
1068
1068
  await afterPut(docArgsToSave, ctx, computedContext);
1069
- return doc;
1069
+ return putResponse || doc;
1070
1070
  }
1071
1071
  };
1072
1072
  for (const f of options.features) {
@@ -1240,7 +1240,8 @@ function getDriverInstanceInner(schema, key, driverConstructor) {
1240
1240
  async put(data, ctx) {
1241
1241
  if (!data)
1242
1242
  throw new Error("Data is required");
1243
- await driverInstance.putMany([data], ctx);
1243
+ const response = await driverInstance.putMany([data], ctx);
1244
+ return response?.[0];
1244
1245
  },
1245
1246
  deleteMany(args, ctx) {
1246
1247
  throw new Error(`"deleteMany" not supported for driver "${driverInstance.driverName}"`);
@@ -311,7 +311,7 @@ interface MinimalDriver {
311
311
  driverName: string;
312
312
  /** raw underlying data access service - e.g. sql client or azure storage client */
313
313
  client?: any;
314
- putMany: (items: Record<string, any>[], ctx?: RadsRequestContext) => MaybePromise<void>;
314
+ putMany: (items: Record<string, any>[], ctx?: RadsRequestContext) => MaybePromise<any>;
315
315
  getMany: (args?: GetManyArgsAny, ctx?: RadsRequestContext) => MaybePromise<{
316
316
  nodes: Record<string, any>[];
317
317
  cursor: string | undefined;
@@ -324,7 +324,7 @@ interface MinimalDriver {
324
324
  cursor: string | undefined;
325
325
  }>;
326
326
  deleteAll?: (args: GetManyArgsAny, ctx?: RadsRequestContext) => MaybePromise<Record<string, any>[]>;
327
- put?: (data: Record<string, any>, ctx?: RadsRequestContext) => MaybePromise<void>;
327
+ put?: (data: Record<string, any>, ctx?: RadsRequestContext) => MaybePromise<any>;
328
328
  verifyMany?: (args?: VerifyManyArgsAny, ctx?: RadsRequestContext) => MaybePromise<VerifyManyResponse>;
329
329
  generateMigrationScript?: () => MaybePromise<{
330
330
  createScript: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rads-db",
3
- "version": "3.2.16",
3
+ "version": "3.2.18",
4
4
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
5
5
  "author": "",
6
6
  "license": "ISC",