rads-db 3.0.39 → 3.0.40
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.d.ts +13 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -291,15 +291,17 @@ interface ComputedContext extends ComputedContextGlobal {
|
|
|
291
291
|
typeName: string;
|
|
292
292
|
handle: string;
|
|
293
293
|
}
|
|
294
|
+
interface RadsHookDoc {
|
|
295
|
+
/** Updated document that will be saved to the database */
|
|
296
|
+
doc: any;
|
|
297
|
+
/** Previous version of document - i.e. one that is currently in the database (before saving) */
|
|
298
|
+
oldDoc: any;
|
|
299
|
+
/** If current entity is event sourcing aggregate, you can access all events in the chronological order */
|
|
300
|
+
events?: any;
|
|
301
|
+
}
|
|
294
302
|
interface PutEffect {
|
|
295
|
-
beforePut?: (computedContext: ComputedContext, docs:
|
|
296
|
-
|
|
297
|
-
doc: any;
|
|
298
|
-
}[], ctx: RadsRequestContext) => MaybePromise<any>;
|
|
299
|
-
afterPut: (computedContext: ComputedContext, docs: {
|
|
300
|
-
oldDoc: any;
|
|
301
|
-
doc: any;
|
|
302
|
-
}[], beforePutResult: any, ctx: RadsRequestContext) => MaybePromise<any>;
|
|
303
|
+
beforePut?: (computedContext: ComputedContext, docs: RadsHookDoc[], ctx: RadsRequestContext) => MaybePromise<any>;
|
|
304
|
+
afterPut: (computedContext: ComputedContext, docs: RadsHookDoc[], beforePutResult: any, ctx: RadsRequestContext) => MaybePromise<any>;
|
|
303
305
|
}
|
|
304
306
|
interface RestFileUploadDriverOptions {
|
|
305
307
|
/** @default '/api' */
|
|
@@ -371,14 +373,8 @@ interface RadsFeature {
|
|
|
371
373
|
enhanceEntityMethods?: (context: ComputedContext, entityMethodsObj: EntityMethods<any, any, any>) => void;
|
|
372
374
|
beforeGet?: (args: GetArgsAny, ctx: RadsRequestContext, context: ComputedContext) => MaybePromise<any>;
|
|
373
375
|
afterGet?: (items: any[], args: GetArgsAny, ctx: RadsRequestContext, context: ComputedContext) => MaybePromise<void>;
|
|
374
|
-
beforePut?: (items:
|
|
375
|
-
|
|
376
|
-
doc: any;
|
|
377
|
-
}[], ctx: RadsRequestContext, computedContext: ComputedContext) => void;
|
|
378
|
-
afterPut?: (items: {
|
|
379
|
-
oldDoc: any;
|
|
380
|
-
doc: any;
|
|
381
|
-
}[], ctx: RadsRequestContext, computedContext: ComputedContext) => void;
|
|
376
|
+
beforePut?: (items: RadsHookDoc[], ctx: RadsRequestContext, computedContext: ComputedContext) => void;
|
|
377
|
+
afterPut?: (items: RadsHookDoc[], ctx: RadsRequestContext, computedContext: ComputedContext) => void;
|
|
382
378
|
beforeUploadFile?: (args: FileUploadArgs) => MaybePromise<any>;
|
|
383
379
|
afterUploadFile?: (result: FileUploadResult, args: FileUploadArgs) => MaybePromise<void>;
|
|
384
380
|
}
|
|
@@ -414,4 +410,4 @@ declare function createRadsDb(args?: CreateRadsDbArgs): RadsDb;
|
|
|
414
410
|
*/
|
|
415
411
|
declare function createRadsDbClient(args?: CreateRadsDbClientArgs): RadsDb;
|
|
416
412
|
|
|
417
|
-
export { Change, ComputedContext, ComputedContextGlobal, ComputedDecoratorArgs, CreateRadsArgsDrivers, CreateRadsDbArgs, CreateRadsDbArgsNormalized, CreateRadsDbClientArgs, DeepPartial, Driver, DriverConstructor, EntityDecoratorArgs, EntityMethods, EnumDefinition, FieldDecoratorArgs, FieldDefinition, FileSystemNode, FileUploadArgs, FileUploadDriver, FileUploadResult, GenerateClientNormalizedOptions, GenerateClientOptions, GetAggArgs, GetAggArgsAgg, GetAggArgsAny, GetAggResponse, GetArgs, GetArgsAny, GetArgsInclude, GetManyArgs, GetManyArgsAny, GetManyResponse, GetResponse, GetResponseInclude, GetResponseIncludeSelect, GetResponseNoInclude, GetRestRoutesArgs, GetRestRoutesOptions, GetRestRoutesResponse, MinimalDriver, PutArgs, PutEffect, RadsFeature, RadsRequestContext, RadsUiSlotDefinition, RadsUiSlotName, RadsVitePluginOptions, Relation, RequiredFields, RestDriverOptions, RestFileUploadDriverOptions, Schema, SchemaValidators, TypeDefinition, UiDecoratorArgs, UiFieldDecoratorArgs, ValidateEntityDecoratorArgs, ValidateFieldDecoratorArgs, ValidateStringDecoratorArgs, VerifyManyArgs, VerifyManyArgsAny, VerifyManyResponse, cleanUndefinedAndNull, computed, createRadsDb, createRadsDbClient, diff, entity, field, getDriverInstance, handlePrecomputed, keepHistory, merge, precomputed, ui, validate };
|
|
413
|
+
export { Change, ComputedContext, ComputedContextGlobal, ComputedDecoratorArgs, CreateRadsArgsDrivers, CreateRadsDbArgs, CreateRadsDbArgsNormalized, CreateRadsDbClientArgs, DeepPartial, Driver, DriverConstructor, EntityDecoratorArgs, EntityMethods, EnumDefinition, FieldDecoratorArgs, FieldDefinition, FileSystemNode, FileUploadArgs, FileUploadDriver, FileUploadResult, GenerateClientNormalizedOptions, GenerateClientOptions, GetAggArgs, GetAggArgsAgg, GetAggArgsAny, GetAggResponse, GetArgs, GetArgsAny, GetArgsInclude, GetManyArgs, GetManyArgsAny, GetManyResponse, GetResponse, GetResponseInclude, GetResponseIncludeSelect, GetResponseNoInclude, GetRestRoutesArgs, GetRestRoutesOptions, GetRestRoutesResponse, MinimalDriver, PutArgs, PutEffect, RadsFeature, RadsHookDoc, RadsRequestContext, RadsUiSlotDefinition, RadsUiSlotName, RadsVitePluginOptions, Relation, RequiredFields, RestDriverOptions, RestFileUploadDriverOptions, Schema, SchemaValidators, TypeDefinition, UiDecoratorArgs, UiFieldDecoratorArgs, ValidateEntityDecoratorArgs, ValidateFieldDecoratorArgs, ValidateStringDecoratorArgs, VerifyManyArgs, VerifyManyArgsAny, VerifyManyResponse, cleanUndefinedAndNull, computed, createRadsDb, createRadsDbClient, diff, entity, field, getDriverInstance, handlePrecomputed, keepHistory, merge, precomputed, ui, validate };
|