@dereekb/model 13.11.1 → 13.11.3
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/index.cjs.js +7 -0
- package/index.esm.js +7 -0
- package/package.json +2 -2
- package/src/lib/service/sync/sync.entity.d.ts +2 -0
- package/src/lib/service/sync/sync.entity.synchronizer.basic.d.ts +1 -0
- package/src/lib/transform/transform.d.ts +1 -0
- package/src/lib/transform/transform.function.d.ts +2 -0
- package/src/lib/transform/transform.result.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -1414,6 +1414,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1414
1414
|
* factory('abc123'); // { commonType: 'user', commonId: 'abc123' }
|
|
1415
1415
|
* factory({ commonType: 'user', commonId: 'abc123' }); // passed through as-is
|
|
1416
1416
|
* ```
|
|
1417
|
+
* @__NO_SIDE_EFFECTS__
|
|
1417
1418
|
*/ function syncEntityCommonTypeIdPairFactory(commonType) {
|
|
1418
1419
|
return function(input) {
|
|
1419
1420
|
var result;
|
|
@@ -1446,6 +1447,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1446
1447
|
* const entity = factory({ commonType: 'user', commonId: 'abc123' });
|
|
1447
1448
|
* // entity.id === 'abc123', entity.sourceInfo.id === 'api'
|
|
1448
1449
|
* ```
|
|
1450
|
+
* @__NO_SIDE_EFFECTS__
|
|
1449
1451
|
*/ function syncEntityFactory(config) {
|
|
1450
1452
|
var inputIdFactory = config.idFactory, sourceInfo = config.sourceInfo;
|
|
1451
1453
|
var idFactory = inputIdFactory !== null && inputIdFactory !== void 0 ? inputIdFactory : util.MAP_IDENTITY;
|
|
@@ -1887,6 +1889,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1887
1889
|
* @throws {NoPrimarySyncSourceError} when no primary source is found
|
|
1888
1890
|
* @throws {MultiplePrimarySyncSourceError} when more than one primary source is found
|
|
1889
1891
|
* @throws {SynchronizationFailedError} when primary or secondary sync returns failed/error
|
|
1892
|
+
* @__NO_SIDE_EFFECTS__
|
|
1890
1893
|
*/ function basicSyncEntityCommonTypeSynchronizerInstanceFactory(config) {
|
|
1891
1894
|
var _sourcesByContextType_get, _sourcesByContextType_get1;
|
|
1892
1895
|
var commonType = config.commonType, sources = config.sources, entitySourceContextLoader = config.entitySourceContextLoader, _config_dynamicSources = config.dynamicSources, dynamicSources = _config_dynamicSources === void 0 ? false : _config_dynamicSources;
|
|
@@ -2501,6 +2504,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2501
2504
|
*
|
|
2502
2505
|
* @param defaults - default error handler
|
|
2503
2506
|
* @returns a factory function that creates TransformAndValidateObjectFunction instances
|
|
2507
|
+
* @__NO_SIDE_EFFECTS__
|
|
2504
2508
|
*/ function transformAndValidateObjectFactory(defaults) {
|
|
2505
2509
|
var defaultHandleValidationError = defaults.handleValidationError;
|
|
2506
2510
|
return function(schema, fn, handleValidationError) {
|
|
@@ -2579,6 +2583,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2579
2583
|
*
|
|
2580
2584
|
* @param defaults - shared error handler defaults
|
|
2581
2585
|
* @returns a factory that produces functions returning {@link TransformAndValidateFunctionResult}
|
|
2586
|
+
* @__NO_SIDE_EFFECTS__
|
|
2582
2587
|
*/ function transformAndValidateFunctionResultFactory(defaults) {
|
|
2583
2588
|
return toTransformAndValidateFunctionResultFactory(transformAndValidateObjectFactory(defaults));
|
|
2584
2589
|
}
|
|
@@ -2588,6 +2593,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2588
2593
|
*
|
|
2589
2594
|
* @param transformAndValidateObjectFactory - the base factory to wrap
|
|
2590
2595
|
* @returns a factory that produces functions returning results with `params` attached
|
|
2596
|
+
* @__NO_SIDE_EFFECTS__
|
|
2591
2597
|
*/ function toTransformAndValidateFunctionResultFactory(transformAndValidateObjectFactory) {
|
|
2592
2598
|
return function(schema, fn, handleValidationError) {
|
|
2593
2599
|
var transformAndValidateObjectFn = transformAndValidateObjectFactory(schema, fn, handleValidationError);
|
|
@@ -2740,6 +2746,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2740
2746
|
*
|
|
2741
2747
|
* @param defaults - shared error handler defaults
|
|
2742
2748
|
* @returns a factory that produces functions returning only the handler's result
|
|
2749
|
+
* @__NO_SIDE_EFFECTS__
|
|
2743
2750
|
*/ function transformAndValidateResultFactory(defaults) {
|
|
2744
2751
|
var factory = transformAndValidateObjectFactory(defaults);
|
|
2745
2752
|
return function(schema, fn, handleValidationError) {
|
package/index.esm.js
CHANGED
|
@@ -1412,6 +1412,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1412
1412
|
* factory('abc123'); // { commonType: 'user', commonId: 'abc123' }
|
|
1413
1413
|
* factory({ commonType: 'user', commonId: 'abc123' }); // passed through as-is
|
|
1414
1414
|
* ```
|
|
1415
|
+
* @__NO_SIDE_EFFECTS__
|
|
1415
1416
|
*/ function syncEntityCommonTypeIdPairFactory(commonType) {
|
|
1416
1417
|
return function(input) {
|
|
1417
1418
|
var result;
|
|
@@ -1444,6 +1445,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1444
1445
|
* const entity = factory({ commonType: 'user', commonId: 'abc123' });
|
|
1445
1446
|
* // entity.id === 'abc123', entity.sourceInfo.id === 'api'
|
|
1446
1447
|
* ```
|
|
1448
|
+
* @__NO_SIDE_EFFECTS__
|
|
1447
1449
|
*/ function syncEntityFactory(config) {
|
|
1448
1450
|
var inputIdFactory = config.idFactory, sourceInfo = config.sourceInfo;
|
|
1449
1451
|
var idFactory = inputIdFactory !== null && inputIdFactory !== void 0 ? inputIdFactory : MAP_IDENTITY;
|
|
@@ -1885,6 +1887,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1885
1887
|
* @throws {NoPrimarySyncSourceError} when no primary source is found
|
|
1886
1888
|
* @throws {MultiplePrimarySyncSourceError} when more than one primary source is found
|
|
1887
1889
|
* @throws {SynchronizationFailedError} when primary or secondary sync returns failed/error
|
|
1890
|
+
* @__NO_SIDE_EFFECTS__
|
|
1888
1891
|
*/ function basicSyncEntityCommonTypeSynchronizerInstanceFactory(config) {
|
|
1889
1892
|
var _sourcesByContextType_get, _sourcesByContextType_get1;
|
|
1890
1893
|
var commonType = config.commonType, sources = config.sources, entitySourceContextLoader = config.entitySourceContextLoader, _config_dynamicSources = config.dynamicSources, dynamicSources = _config_dynamicSources === void 0 ? false : _config_dynamicSources;
|
|
@@ -2499,6 +2502,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2499
2502
|
*
|
|
2500
2503
|
* @param defaults - default error handler
|
|
2501
2504
|
* @returns a factory function that creates TransformAndValidateObjectFunction instances
|
|
2505
|
+
* @__NO_SIDE_EFFECTS__
|
|
2502
2506
|
*/ function transformAndValidateObjectFactory(defaults) {
|
|
2503
2507
|
var defaultHandleValidationError = defaults.handleValidationError;
|
|
2504
2508
|
return function(schema, fn, handleValidationError) {
|
|
@@ -2577,6 +2581,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2577
2581
|
*
|
|
2578
2582
|
* @param defaults - shared error handler defaults
|
|
2579
2583
|
* @returns a factory that produces functions returning {@link TransformAndValidateFunctionResult}
|
|
2584
|
+
* @__NO_SIDE_EFFECTS__
|
|
2580
2585
|
*/ function transformAndValidateFunctionResultFactory(defaults) {
|
|
2581
2586
|
return toTransformAndValidateFunctionResultFactory(transformAndValidateObjectFactory(defaults));
|
|
2582
2587
|
}
|
|
@@ -2586,6 +2591,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2586
2591
|
*
|
|
2587
2592
|
* @param transformAndValidateObjectFactory - the base factory to wrap
|
|
2588
2593
|
* @returns a factory that produces functions returning results with `params` attached
|
|
2594
|
+
* @__NO_SIDE_EFFECTS__
|
|
2589
2595
|
*/ function toTransformAndValidateFunctionResultFactory(transformAndValidateObjectFactory) {
|
|
2590
2596
|
return function(schema, fn, handleValidationError) {
|
|
2591
2597
|
var transformAndValidateObjectFn = transformAndValidateObjectFactory(schema, fn, handleValidationError);
|
|
@@ -2738,6 +2744,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2738
2744
|
*
|
|
2739
2745
|
* @param defaults - shared error handler defaults
|
|
2740
2746
|
* @returns a factory that produces functions returning only the handler's result
|
|
2747
|
+
* @__NO_SIDE_EFFECTS__
|
|
2741
2748
|
*/ function transformAndValidateResultFactory(defaults) {
|
|
2742
2749
|
var factory = transformAndValidateObjectFactory(defaults);
|
|
2743
2750
|
return function(schema, fn, handleValidationError) {
|
package/package.json
CHANGED
|
@@ -53,6 +53,7 @@ export type SyncEntityCommonTypeIdPairFactory = (input: SyncEntityCommonTypeIdPa
|
|
|
53
53
|
* factory('abc123'); // { commonType: 'user', commonId: 'abc123' }
|
|
54
54
|
* factory({ commonType: 'user', commonId: 'abc123' }); // passed through as-is
|
|
55
55
|
* ```
|
|
56
|
+
* @__NO_SIDE_EFFECTS__
|
|
56
57
|
*/
|
|
57
58
|
export declare function syncEntityCommonTypeIdPairFactory(commonType: SyncEntityCommonType): SyncEntityCommonTypeIdPairFactory;
|
|
58
59
|
/**
|
|
@@ -103,5 +104,6 @@ export type SyncEntityFactory = FactoryWithRequiredInput<SyncEntity, SyncEntityC
|
|
|
103
104
|
* const entity = factory({ commonType: 'user', commonId: 'abc123' });
|
|
104
105
|
* // entity.id === 'abc123', entity.sourceInfo.id === 'api'
|
|
105
106
|
* ```
|
|
107
|
+
* @__NO_SIDE_EFFECTS__
|
|
106
108
|
*/
|
|
107
109
|
export declare function syncEntityFactory(config: SyncEntityFactoryConfig): SyncEntityFactory;
|
|
@@ -128,5 +128,6 @@ export interface BasicSyncEntityCommonTypeSynchronizerConfig {
|
|
|
128
128
|
* @throws {NoPrimarySyncSourceError} when no primary source is found
|
|
129
129
|
* @throws {MultiplePrimarySyncSourceError} when more than one primary source is found
|
|
130
130
|
* @throws {SynchronizationFailedError} when primary or secondary sync returns failed/error
|
|
131
|
+
* @__NO_SIDE_EFFECTS__
|
|
131
132
|
*/
|
|
132
133
|
export declare function basicSyncEntityCommonTypeSynchronizerInstanceFactory(config: BasicSyncEntityCommonTypeSynchronizerConfig): BasicSyncEntityCommonTypeSynchronizer;
|
|
@@ -49,6 +49,7 @@ export type TransformAndValidateObjectFactory<C = unknown> = <T extends object,
|
|
|
49
49
|
*
|
|
50
50
|
* @param defaults - default error handler
|
|
51
51
|
* @returns a factory function that creates TransformAndValidateObjectFunction instances
|
|
52
|
+
* @__NO_SIDE_EFFECTS__
|
|
52
53
|
*/
|
|
53
54
|
export declare function transformAndValidateObjectFactory<C = unknown>(defaults: TransformAndValidateObjectFactoryDefaults<C>): TransformAndValidateObjectFactory<C>;
|
|
54
55
|
export type TransformAndValidateObjectResultFunction<T, O, I extends object = object, C = unknown> = (input: I, context?: C) => Promise<TransformAndValidateObjectResultOutput<T, O>>;
|
|
@@ -14,6 +14,7 @@ export type TransformAndValidateFunctionResultFactory<C = unknown> = <T extends
|
|
|
14
14
|
*
|
|
15
15
|
* @param defaults - shared error handler defaults
|
|
16
16
|
* @returns a factory that produces functions returning {@link TransformAndValidateFunctionResult}
|
|
17
|
+
* @__NO_SIDE_EFFECTS__
|
|
17
18
|
*/
|
|
18
19
|
export declare function transformAndValidateFunctionResultFactory<C = unknown>(defaults: TransformAndValidateObjectFactoryDefaults<C>): TransformAndValidateFunctionResultFactory<C>;
|
|
19
20
|
/**
|
|
@@ -22,6 +23,7 @@ export declare function transformAndValidateFunctionResultFactory<C = unknown>(d
|
|
|
22
23
|
*
|
|
23
24
|
* @param transformAndValidateObjectFactory - the base factory to wrap
|
|
24
25
|
* @returns a factory that produces functions returning results with `params` attached
|
|
26
|
+
* @__NO_SIDE_EFFECTS__
|
|
25
27
|
*/
|
|
26
28
|
export declare function toTransformAndValidateFunctionResultFactory<C = unknown>(transformAndValidateObjectFactory: TransformAndValidateObjectFactory<C>): TransformAndValidateFunctionResultFactory<C>;
|
|
27
29
|
/**
|
|
@@ -12,5 +12,6 @@ export type TransformAndValidateResultFactory<C = unknown> = <T extends object,
|
|
|
12
12
|
*
|
|
13
13
|
* @param defaults - shared error handler defaults
|
|
14
14
|
* @returns a factory that produces functions returning only the handler's result
|
|
15
|
+
* @__NO_SIDE_EFFECTS__
|
|
15
16
|
*/
|
|
16
17
|
export declare function transformAndValidateResultFactory<C = unknown>(defaults: TransformAndValidateObjectFactoryDefaults<C>): TransformAndValidateResultFactory<C>;
|