@restorecommerce/resource-base-interface 1.6.4 → 1.7.0
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/eslint.config.mjs +22 -0
- package/lib/core/GraphResourcesServiceBase.d.ts +9 -5
- package/lib/core/GraphResourcesServiceBase.d.ts.map +1 -0
- package/lib/core/GraphResourcesServiceBase.js +79 -110
- package/lib/core/GraphResourcesServiceBase.js.map +1 -1
- package/lib/core/ResourcesAPI.d.ts +26 -19
- package/lib/core/ResourcesAPI.d.ts.map +1 -0
- package/lib/core/ResourcesAPI.js +275 -398
- package/lib/core/ResourcesAPI.js.map +1 -1
- package/lib/core/ServiceBase.d.ts +29 -10
- package/lib/core/ServiceBase.d.ts.map +1 -0
- package/lib/core/ServiceBase.js +137 -242
- package/lib/core/ServiceBase.js.map +1 -1
- package/lib/core/index.d.ts +5 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +21 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/interfaces.d.ts +6 -72
- package/lib/core/interfaces.d.ts.map +1 -0
- package/lib/core/interfaces.js +18 -31
- package/lib/core/interfaces.js.map +1 -1
- package/lib/core/utils.d.ts +3 -1
- package/lib/core/utils.d.ts.map +1 -0
- package/lib/core/utils.js +28 -32
- package/lib/core/utils.js.map +1 -1
- package/lib/experimental/AccessControlledServiceBase.d.ts +30 -0
- package/lib/experimental/AccessControlledServiceBase.d.ts.map +1 -0
- package/lib/experimental/AccessControlledServiceBase.js +232 -0
- package/lib/experimental/AccessControlledServiceBase.js.map +1 -0
- package/lib/experimental/ClientRegister.d.ts +22 -0
- package/lib/experimental/ClientRegister.d.ts.map +1 -0
- package/lib/experimental/ClientRegister.js +33 -0
- package/lib/experimental/ClientRegister.js.map +1 -0
- package/lib/experimental/Pipe.d.ts +6 -0
- package/lib/experimental/Pipe.d.ts.map +1 -0
- package/lib/experimental/Pipe.js +14 -0
- package/lib/experimental/Pipe.js.map +1 -0
- package/lib/experimental/ResourceAggregator.d.ts +35 -0
- package/lib/experimental/ResourceAggregator.d.ts.map +1 -0
- package/lib/experimental/ResourceAggregator.js +94 -0
- package/lib/experimental/ResourceAggregator.js.map +1 -0
- package/lib/experimental/ResourceAwaitQueue.d.ts +12 -0
- package/lib/experimental/ResourceAwaitQueue.d.ts.map +1 -0
- package/lib/experimental/ResourceAwaitQueue.js +34 -0
- package/lib/experimental/ResourceAwaitQueue.js.map +1 -0
- package/lib/experimental/ResourceMap.d.ts +16 -0
- package/lib/experimental/ResourceMap.d.ts.map +1 -0
- package/lib/experimental/ResourceMap.js +51 -0
- package/lib/experimental/ResourceMap.js.map +1 -0
- package/lib/{core → experimental}/WorkerBase.d.ts +10 -14
- package/lib/experimental/WorkerBase.d.ts.map +1 -0
- package/lib/{core → experimental}/WorkerBase.js +44 -30
- package/lib/experimental/WorkerBase.js.map +1 -0
- package/lib/experimental/index.d.ts +7 -0
- package/lib/experimental/index.d.ts.map +1 -0
- package/lib/experimental/index.js +23 -0
- package/lib/experimental/index.js.map +1 -0
- package/lib/index.d.ts +5 -7
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +84 -144
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +23 -28
- package/tsconfig.json +11 -25
- package/lib/core/WorkerBase.js.map +0 -1
package/lib/core/interfaces.d.ts
CHANGED
|
@@ -1,76 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
gte = 4,
|
|
7
|
-
isEmpty = 5,
|
|
8
|
-
iLike = 6,
|
|
9
|
-
in = 7,
|
|
10
|
-
neq = 8
|
|
11
|
-
}
|
|
12
|
-
export declare enum FilterValueType {
|
|
13
|
-
STRING = 0,
|
|
14
|
-
NUMBER = 1,
|
|
15
|
-
BOOLEAN = 2,
|
|
16
|
-
DATE = 3,
|
|
17
|
-
ARRAY = 4
|
|
18
|
-
}
|
|
19
|
-
export declare enum OperatorType {
|
|
20
|
-
and = 0,
|
|
21
|
-
or = 1
|
|
22
|
-
}
|
|
23
|
-
export interface Filter {
|
|
24
|
-
field: string;
|
|
25
|
-
operation: FilterOperation;
|
|
26
|
-
value: string;
|
|
27
|
-
type?: FilterValueType;
|
|
28
|
-
filters?: FilterOp[];
|
|
29
|
-
}
|
|
30
|
-
export interface FilterOp {
|
|
31
|
-
filter?: Filter[];
|
|
32
|
-
operator?: OperatorType;
|
|
33
|
-
}
|
|
34
|
-
export interface BaseDocument {
|
|
35
|
-
id?: string;
|
|
36
|
-
meta?: DocumentMetadata;
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
}
|
|
39
|
-
export interface DocumentMetadata {
|
|
40
|
-
created?: any;
|
|
41
|
-
modified?: any;
|
|
42
|
-
modified_by?: string;
|
|
43
|
-
owners?: {
|
|
44
|
-
id?: string;
|
|
45
|
-
value?: string;
|
|
46
|
-
}[];
|
|
47
|
-
created_by?: string;
|
|
48
|
-
}
|
|
1
|
+
import { Resource } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/resource_base.js';
|
|
2
|
+
export { Resource, ResourceList, ReadRequest, Filter, FilterOp, Filter_ValueType as FilterValueType, Filter_Operation as FilterOperation, FilterOp_Operator as OperatorType, Sort_SortOrder as SortOrder, } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/resource_base.js';
|
|
3
|
+
export { Meta as DocumentMetadata } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/meta.js';
|
|
4
|
+
export { Options_Direction as Direction, Options as TraversalOptions, Filter as GraphFilter, Filters as GraphFilters, } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/graph.js';
|
|
5
|
+
export type BaseDocument = Resource & Record<string, any>;
|
|
49
6
|
export interface DateTimeConfig {
|
|
50
7
|
fields: string[];
|
|
51
8
|
entities: string[];
|
|
52
9
|
}
|
|
53
|
-
|
|
54
|
-
OUTBOUND = "OUTBOUND",
|
|
55
|
-
INBOUND = "INBOUND"
|
|
56
|
-
}
|
|
57
|
-
export interface TraversalOptions {
|
|
58
|
-
include_vertex?: string[];
|
|
59
|
-
exclude_vertex?: string[];
|
|
60
|
-
include_edge?: string[];
|
|
61
|
-
exclude_edge?: string[];
|
|
62
|
-
direction?: Direction;
|
|
63
|
-
}
|
|
64
|
-
export interface GraphFilter {
|
|
65
|
-
field: string;
|
|
66
|
-
operation: FilterOperation;
|
|
67
|
-
value: string;
|
|
68
|
-
type?: FilterValueType;
|
|
69
|
-
filters?: GraphFilters[];
|
|
70
|
-
}
|
|
71
|
-
export interface GraphFilters {
|
|
72
|
-
entity?: string;
|
|
73
|
-
edge?: string;
|
|
74
|
-
filter?: GraphFilter[];
|
|
75
|
-
operator?: OperatorType;
|
|
76
|
-
}
|
|
10
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/core/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACT,MAAM,4FAA4F,CAAC;AAEpG,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,MAAM,EACN,QAAQ,EACR,gBAAgB,IAAI,eAAe,EACnC,gBAAgB,IAAI,eAAe,EACnC,iBAAiB,IAAI,YAAY,EACjC,cAAc,IAAI,SAAS,GAC5B,MAAM,4FAA4F,CAAC;AAEpG,OAAO,EACL,IAAI,IAAI,gBAAgB,EACzB,MAAM,mFAAmF,CAAC;AAE3F,OAAO,EACL,iBAAiB,IAAI,SAAS,EAC9B,OAAO,IAAI,gBAAgB,EAC3B,MAAM,IAAI,WAAW,EACrB,OAAO,IAAI,YAAY,GACxB,MAAM,oFAAoF,CAAC;AAE5F,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
package/lib/core/interfaces.js
CHANGED
|
@@ -1,34 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Direction = exports.OperatorType = exports.FilterValueType = exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
(function (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
FilterValueType[FilterValueType["DATE"] = 3] = "DATE";
|
|
22
|
-
FilterValueType[FilterValueType["ARRAY"] = 4] = "ARRAY";
|
|
23
|
-
})(FilterValueType || (exports.FilterValueType = FilterValueType = {}));
|
|
24
|
-
var OperatorType;
|
|
25
|
-
(function (OperatorType) {
|
|
26
|
-
OperatorType[OperatorType["and"] = 0] = "and";
|
|
27
|
-
OperatorType[OperatorType["or"] = 1] = "or";
|
|
28
|
-
})(OperatorType || (exports.OperatorType = OperatorType = {}));
|
|
29
|
-
var Direction;
|
|
30
|
-
(function (Direction) {
|
|
31
|
-
Direction["OUTBOUND"] = "OUTBOUND";
|
|
32
|
-
Direction["INBOUND"] = "INBOUND";
|
|
33
|
-
})(Direction || (exports.Direction = Direction = {}));
|
|
3
|
+
exports.GraphFilters = exports.GraphFilter = exports.TraversalOptions = exports.Direction = exports.DocumentMetadata = exports.SortOrder = exports.OperatorType = exports.FilterOperation = exports.FilterValueType = exports.FilterOp = exports.Filter = exports.ReadRequest = exports.ResourceList = exports.Resource = void 0;
|
|
4
|
+
var resource_base_js_1 = require("@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/resource_base.js");
|
|
5
|
+
Object.defineProperty(exports, "Resource", { enumerable: true, get: function () { return resource_base_js_1.Resource; } });
|
|
6
|
+
Object.defineProperty(exports, "ResourceList", { enumerable: true, get: function () { return resource_base_js_1.ResourceList; } });
|
|
7
|
+
Object.defineProperty(exports, "ReadRequest", { enumerable: true, get: function () { return resource_base_js_1.ReadRequest; } });
|
|
8
|
+
Object.defineProperty(exports, "Filter", { enumerable: true, get: function () { return resource_base_js_1.Filter; } });
|
|
9
|
+
Object.defineProperty(exports, "FilterOp", { enumerable: true, get: function () { return resource_base_js_1.FilterOp; } });
|
|
10
|
+
Object.defineProperty(exports, "FilterValueType", { enumerable: true, get: function () { return resource_base_js_1.Filter_ValueType; } });
|
|
11
|
+
Object.defineProperty(exports, "FilterOperation", { enumerable: true, get: function () { return resource_base_js_1.Filter_Operation; } });
|
|
12
|
+
Object.defineProperty(exports, "OperatorType", { enumerable: true, get: function () { return resource_base_js_1.FilterOp_Operator; } });
|
|
13
|
+
Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return resource_base_js_1.Sort_SortOrder; } });
|
|
14
|
+
var meta_js_1 = require("@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/meta.js");
|
|
15
|
+
Object.defineProperty(exports, "DocumentMetadata", { enumerable: true, get: function () { return meta_js_1.Meta; } });
|
|
16
|
+
var graph_js_1 = require("@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/graph.js");
|
|
17
|
+
Object.defineProperty(exports, "Direction", { enumerable: true, get: function () { return graph_js_1.Options_Direction; } });
|
|
18
|
+
Object.defineProperty(exports, "TraversalOptions", { enumerable: true, get: function () { return graph_js_1.Options; } });
|
|
19
|
+
Object.defineProperty(exports, "GraphFilter", { enumerable: true, get: function () { return graph_js_1.Filter; } });
|
|
20
|
+
Object.defineProperty(exports, "GraphFilters", { enumerable: true, get: function () { return graph_js_1.Filters; } });
|
|
34
21
|
//# sourceMappingURL=interfaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/core/interfaces.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/core/interfaces.ts"],"names":[],"mappings":";;;AAIA,+HAUoG;AATlG,4GAAA,QAAQ,OAAA;AACR,gHAAA,YAAY,OAAA;AACZ,+GAAA,WAAW,OAAA;AACX,0GAAA,MAAM,OAAA;AACN,4GAAA,QAAQ,OAAA;AACR,mHAAA,gBAAgB,OAAmB;AACnC,mHAAA,gBAAgB,OAAmB;AACnC,gHAAA,iBAAiB,OAAgB;AACjC,6GAAA,cAAc,OAAa;AAG7B,6GAE2F;AADzF,2GAAA,IAAI,OAAoB;AAG1B,+GAK4F;AAJ1F,qGAAA,iBAAiB,OAAa;AAC9B,4GAAA,OAAO,OAAoB;AAC3B,uGAAA,MAAM,OAAe;AACrB,wGAAA,OAAO,OAAgB"}
|
package/lib/core/utils.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type FieldHandlerType = 'encode' | 'decode' | 'convertDateObjToMilisec' | 'convertMilisecToDateObj';
|
|
2
|
+
export declare const fieldHandler: (obj: any, fieldPath: string, fieldHandlerType: FieldHandlerType) => any;
|
|
3
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAuE3G,eAAO,MAAM,YAAY,QAAS,GAAG,aAAa,MAAM,oBAAoB,gBAAgB,KAAG,GAmB9F,CAAC"}
|
package/lib/core/utils.js
CHANGED
|
@@ -26,37 +26,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.fieldHandler = void 0;
|
|
27
27
|
const _ = __importStar(require("lodash"));
|
|
28
28
|
const marshallObj = (val) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
// throw error and it is handled and logged in ServiceBase functions
|
|
37
|
-
throw error;
|
|
38
|
-
}
|
|
29
|
+
return {
|
|
30
|
+
type_url: '',
|
|
31
|
+
value: Buffer.from(JSON.stringify(val))
|
|
32
|
+
};
|
|
39
33
|
};
|
|
40
34
|
const updateObject = (obj, path, value, fieldHandlerType) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
if (value !== undefined) {
|
|
36
|
+
switch (fieldHandlerType) {
|
|
37
|
+
case 'encode':
|
|
38
|
+
_.set(obj, path, marshallObj(value));
|
|
39
|
+
break;
|
|
40
|
+
case 'decode':
|
|
41
|
+
_.set(obj, path, JSON.parse(value.value.toString()));
|
|
42
|
+
break;
|
|
43
|
+
case 'convertDateObjToMilisec':
|
|
44
|
+
if (value instanceof Date) {
|
|
45
|
+
_.set(obj, path, value.getTime());
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
case 'convertMilisecToDateObj':
|
|
49
|
+
if (typeof (value) === 'number') {
|
|
50
|
+
_.set(obj, path, new Date(value));
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
break;
|
|
49
55
|
}
|
|
50
|
-
else if (value && fieldHandlerType == 'convertDateObjToMilisec' && value instanceof Date) {
|
|
51
|
-
_.set(obj, path, value.getTime());
|
|
52
|
-
}
|
|
53
|
-
else if (value && fieldHandlerType == 'convertMilisecToDateObj' && typeof (value) == 'number') {
|
|
54
|
-
_.set(obj, path, new Date(value));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
// rethrow the error, this is caught and logged in ResourceAPI
|
|
59
|
-
throw error;
|
|
60
56
|
}
|
|
61
57
|
};
|
|
62
58
|
const setNestedPath = (object, fieldPath, fieldHandlerType) => {
|
|
@@ -64,13 +60,13 @@ const setNestedPath = (object, fieldPath, fieldHandlerType) => {
|
|
|
64
60
|
const suffix = fieldPath?.substring(fieldPath.indexOf('].') + 2);
|
|
65
61
|
let setRecursive = false;
|
|
66
62
|
// recursive check if the sub suffix again contains an array index
|
|
67
|
-
if (suffix.
|
|
63
|
+
if (suffix.includes('.[')) {
|
|
68
64
|
setRecursive = true;
|
|
69
65
|
}
|
|
70
66
|
if (prefix && suffix) {
|
|
71
|
-
|
|
67
|
+
const array = _.get(object, prefix);
|
|
72
68
|
array?.forEach((obj) => {
|
|
73
|
-
|
|
69
|
+
const fieldExists = _.get(obj, suffix);
|
|
74
70
|
if (fieldExists) {
|
|
75
71
|
updateObject(obj, suffix, fieldExists, fieldHandlerType);
|
|
76
72
|
}
|
|
@@ -97,7 +93,7 @@ const fieldHandler = (obj, fieldPath, fieldHandlerType) => {
|
|
|
97
93
|
dotFieldPath = dotFieldPath.split('].').join('.');
|
|
98
94
|
dotFieldPath = dotFieldPath.split('.');
|
|
99
95
|
const array = fieldPath.includes('[');
|
|
100
|
-
|
|
96
|
+
const fieldExists = baseGet(obj, dotFieldPath);
|
|
101
97
|
// only if the configured field exist check recursively for all entries in object
|
|
102
98
|
if (array) {
|
|
103
99
|
// use setNestedPath
|
package/lib/core/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA4B;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA4B;AAI5B,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC/B,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAA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,gBAAkC,EAAO,EAAE;IACnG,uEAAuE;IACvE,2DAA2D;IAC3D,iEAAiE;IACjE,IAAI,YAAY,GAAQ,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxD,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC/C,iFAAiF;IACjF,IAAI,KAAK,EAAE,CAAC;QACV,oBAAoB;QACpB,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAClD,CAAC;SAAM,IAAI,WAAW,EAAE,CAAC;QACvB,4BAA4B;QAC5B,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAnBW,QAAA,YAAY,gBAmBvB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type CallContext } from 'nice-grpc-common';
|
|
2
|
+
import { type ServiceConfig } from '@restorecommerce/service-config';
|
|
3
|
+
import { type Logger } from '@restorecommerce/logger';
|
|
4
|
+
import { type DatabaseProvider } from '@restorecommerce/chassis-srv';
|
|
5
|
+
import { Topic } from '@restorecommerce/kafka-client';
|
|
6
|
+
import { ACSClientContext, ResourceFactory } from '@restorecommerce/acs-client';
|
|
7
|
+
import { DeepPartial, type DeleteRequest, DeleteResponse, ReadRequest, type ResourceList, type ResourceListResponse, ResourceResponse, ServiceImplementation } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/resource_base';
|
|
8
|
+
import { type Subject } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/auth';
|
|
9
|
+
import { type OperationStatus } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/status';
|
|
10
|
+
import { ServiceBase } from '../core/index';
|
|
11
|
+
export declare const ACSContextFactory: <O extends ResourceListResponse, I extends ResourceList>(self: AccessControlledServiceBase<O, I>, request: I & DeleteRequest, context: any) => Promise<ACSClientContext>;
|
|
12
|
+
export declare const DefaultResourceFactory: <T extends ResourceList>(...resourceNames: string[]) => ResourceFactory<T>;
|
|
13
|
+
export declare class AccessControlledServiceBase<O extends ResourceListResponse, I extends ResourceList> extends ServiceBase<O, I> implements ServiceImplementation {
|
|
14
|
+
protected readonly operation_status_codes: Record<string, OperationStatus>;
|
|
15
|
+
constructor(resourceName: string, topic: Topic, db: DatabaseProvider, cfg: ServiceConfig, logger?: Logger, enableEvents?: boolean, collectionName?: string);
|
|
16
|
+
protected catchStatusError<T extends ResourceResponse>(e?: any, item?: T): T;
|
|
17
|
+
protected catchOperationError<T extends ResourceListResponse>(e?: any, response?: T): T;
|
|
18
|
+
protected superRead(request: ReadRequest, context?: CallContext): Promise<DeepPartial<O>>;
|
|
19
|
+
protected superCreate(request: I, context?: CallContext): Promise<DeepPartial<O>>;
|
|
20
|
+
protected superUpdate(request: I, context?: CallContext): Promise<DeepPartial<O>>;
|
|
21
|
+
protected superUpsert(request: I, context?: CallContext): Promise<DeepPartial<O>>;
|
|
22
|
+
protected superDelete(request: DeleteRequest, context?: CallContext): Promise<DeleteResponse>;
|
|
23
|
+
get(ids: string[], subject?: Subject, context?: CallContext, bypassACS?: boolean): Promise<DeepPartial<O>>;
|
|
24
|
+
create(request: I, context?: CallContext): Promise<DeepPartial<O>>;
|
|
25
|
+
read(request: ReadRequest, context?: CallContext): Promise<DeepPartial<O>>;
|
|
26
|
+
update(request: I, context?: CallContext): Promise<DeepPartial<O>>;
|
|
27
|
+
upsert(request: I, context?: CallContext): Promise<DeepPartial<O>>;
|
|
28
|
+
delete(request: DeleteRequest, context?: CallContext): Promise<DeleteResponse>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=AccessControlledServiceBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessControlledServiceBase.d.ts","sourceRoot":"","sources":["../../src/experimental/AccessControlledServiceBase.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EACL,gBAAgB,EAIhB,eAAe,EAKhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,cAAc,EAGd,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,yFAAyF,CAAC;AACjG,OAAO,EACL,KAAK,OAAO,EACb,MAAM,gFAAgF,CAAC;AACxF,OAAO,EACL,KAAK,eAAe,EACrB,MAAM,kFAAkF,CAAC;AAC1F,OAAO,EAEL,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,iBAAiB,GAAU,CAAC,SAAS,oBAAoB,EAAE,CAAC,SAAS,YAAY,QAAQ,2BAA2B,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,aAAa,WAAW,GAAG,KAAG,OAAO,CAAC,gBAAgB,CAW3M,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,YAAY,oBAAoB,MAAM,EAAE,KAAG,eAAe,CAAC,CAAC,CAS5G,CAAC;AAEF,qBACa,2BA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E,MAAM,EAAE,EACb,OAAO,CAAC,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,WAAW,EACrB,SAAS,UAAQ,GAChB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IA4CJ,MAAM,CAC1B,OAAO,EAAE,CAAC,EACV,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAYJ,IAAI,CACxB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAcJ,MAAM,CAC1B,OAAO,EAAE,CAAC,EACV,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAcJ,MAAM,CAC1B,OAAO,EAAE,CAAC,EACV,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAaJ,MAAM,CAC1B,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,cAAc,CAAC;CAG3B"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AccessControlledServiceBase = exports.DefaultResourceFactory = exports.ACSContextFactory = void 0;
|
|
13
|
+
const kafka_client_1 = require("@restorecommerce/kafka-client");
|
|
14
|
+
const acs_client_1 = require("@restorecommerce/acs-client");
|
|
15
|
+
const resource_base_1 = require("@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/resource_base");
|
|
16
|
+
const index_1 = require("../core/index");
|
|
17
|
+
const ACSContextFactory = async (self, request, context) => {
|
|
18
|
+
const ids = request.ids ?? request.items?.map((item) => item.id);
|
|
19
|
+
const resources = await self.get(ids, request.subject, context);
|
|
20
|
+
return {
|
|
21
|
+
...context,
|
|
22
|
+
subject: request.subject,
|
|
23
|
+
resources: [
|
|
24
|
+
...resources.items ?? [],
|
|
25
|
+
...request.items ?? [],
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.ACSContextFactory = ACSContextFactory;
|
|
30
|
+
const DefaultResourceFactory = (...resourceNames) => async (self, request, context) => (resourceNames?.length ? resourceNames : [self.name])?.map(resourceName => ({
|
|
31
|
+
resource: resourceName,
|
|
32
|
+
id: request.items?.map((item) => item.id)
|
|
33
|
+
}));
|
|
34
|
+
exports.DefaultResourceFactory = DefaultResourceFactory;
|
|
35
|
+
let AccessControlledServiceBase = class AccessControlledServiceBase extends index_1.ServiceBase {
|
|
36
|
+
operation_status_codes = {
|
|
37
|
+
SUCCESS: {
|
|
38
|
+
code: 200,
|
|
39
|
+
message: 'SUCCESS',
|
|
40
|
+
},
|
|
41
|
+
PARTIAL: {
|
|
42
|
+
code: 400,
|
|
43
|
+
message: 'Patrial executed with errors!',
|
|
44
|
+
},
|
|
45
|
+
LIMIT_EXHAUSTED: {
|
|
46
|
+
code: 500,
|
|
47
|
+
message: 'Query limit 1000 exhausted!',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
constructor(resourceName, topic, db, cfg, logger, enableEvents, collectionName) {
|
|
51
|
+
collectionName ??= resourceName + 's';
|
|
52
|
+
const fieldHandlers = cfg.get('fieldHandlers');
|
|
53
|
+
fieldHandlers.bufferedFields = fieldHandlers.bufferedFields?.flatMap((item) => typeof (item) === 'string'
|
|
54
|
+
? item
|
|
55
|
+
: item.entities?.includes(collectionName)
|
|
56
|
+
? item.fields
|
|
57
|
+
: item.entities
|
|
58
|
+
? []
|
|
59
|
+
: item.fields);
|
|
60
|
+
fieldHandlers.timeStampFields = fieldHandlers.timeStampFields?.flatMap((item) => typeof (item) === 'string'
|
|
61
|
+
? item
|
|
62
|
+
: item.entities?.includes(collectionName)
|
|
63
|
+
? item.fields
|
|
64
|
+
: item.entities
|
|
65
|
+
? []
|
|
66
|
+
: item.fields);
|
|
67
|
+
const graph = cfg.get('graph');
|
|
68
|
+
super(resourceName, topic, logger, new index_1.ResourcesAPIBase(db, collectionName, fieldHandlers, graph?.vertices?.[collectionName], graph?.name, logger, resourceName), enableEvents);
|
|
69
|
+
this.operation_status_codes = {
|
|
70
|
+
...this.operation_status_codes,
|
|
71
|
+
...cfg.get('operationStatusCodes'),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catchStatusError(e, item) {
|
|
75
|
+
item ??= {};
|
|
76
|
+
item.status = {
|
|
77
|
+
id: item?.payload?.id,
|
|
78
|
+
code: Number.isInteger(e?.code) ? e.code : 500,
|
|
79
|
+
message: e?.message ?? e?.details ?? (e ? JSON.stringify(e) : 'Unknown Error!')
|
|
80
|
+
};
|
|
81
|
+
this.logger?.warn(e?.stack ?? item.status.message, item);
|
|
82
|
+
return item;
|
|
83
|
+
}
|
|
84
|
+
catchOperationError(e, response) {
|
|
85
|
+
response ??= {};
|
|
86
|
+
response.operation_status = {
|
|
87
|
+
code: Number.isInteger(e?.code) ? e.code : 500,
|
|
88
|
+
message: e?.message ?? e?.details ?? (e ? JSON.stringify(e) : 'Unknown Error!'),
|
|
89
|
+
};
|
|
90
|
+
this.logger?.error(e?.stack ?? response.operation_status.message, response);
|
|
91
|
+
return response;
|
|
92
|
+
}
|
|
93
|
+
async superRead(request, context) {
|
|
94
|
+
return await super.read(request, context);
|
|
95
|
+
}
|
|
96
|
+
async superCreate(request, context) {
|
|
97
|
+
return await super.create(request, context);
|
|
98
|
+
}
|
|
99
|
+
async superUpdate(request, context) {
|
|
100
|
+
return await super.update(request, context);
|
|
101
|
+
}
|
|
102
|
+
async superUpsert(request, context) {
|
|
103
|
+
return await super.upsert(request, context);
|
|
104
|
+
}
|
|
105
|
+
async superDelete(request, context) {
|
|
106
|
+
return await super.delete(request, context);
|
|
107
|
+
}
|
|
108
|
+
async get(ids, subject, context, bypassACS = false) {
|
|
109
|
+
ids = [...new Set(ids)].filter(id => id);
|
|
110
|
+
if (ids.length > 1000) {
|
|
111
|
+
throw this.operation_status_codes.LIMIT_EXHAUSTED;
|
|
112
|
+
}
|
|
113
|
+
if (ids.length === 0) {
|
|
114
|
+
const response = {
|
|
115
|
+
total_count: 0,
|
|
116
|
+
operation_status: this.operation_status_codes.SUCCESS,
|
|
117
|
+
};
|
|
118
|
+
return response;
|
|
119
|
+
}
|
|
120
|
+
const request = resource_base_1.ReadRequest.fromPartial({
|
|
121
|
+
filters: [{
|
|
122
|
+
filters: [{
|
|
123
|
+
field: '_key',
|
|
124
|
+
operation: resource_base_1.Filter_Operation.in,
|
|
125
|
+
value: JSON.stringify(ids),
|
|
126
|
+
type: resource_base_1.Filter_ValueType.ARRAY
|
|
127
|
+
}]
|
|
128
|
+
}],
|
|
129
|
+
limit: ids.length,
|
|
130
|
+
subject
|
|
131
|
+
});
|
|
132
|
+
if (bypassACS) {
|
|
133
|
+
return await this.superRead(request, context);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return await this.read(request, context);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async create(request, context) {
|
|
140
|
+
return await this.superCreate(request, context);
|
|
141
|
+
}
|
|
142
|
+
async read(request, context) {
|
|
143
|
+
return await this.superRead(request, context);
|
|
144
|
+
}
|
|
145
|
+
async update(request, context) {
|
|
146
|
+
return await this.superUpdate(request, context);
|
|
147
|
+
}
|
|
148
|
+
async upsert(request, context) {
|
|
149
|
+
return await this.superUpsert(request, context);
|
|
150
|
+
}
|
|
151
|
+
async delete(request, context) {
|
|
152
|
+
return this.superDelete(request, context);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
exports.AccessControlledServiceBase = AccessControlledServiceBase;
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, acs_client_1.resolves_subject)(),
|
|
158
|
+
(0, acs_client_1.injects_meta_data)(),
|
|
159
|
+
(0, acs_client_1.access_controlled_function)({
|
|
160
|
+
action: acs_client_1.AuthZAction.CREATE,
|
|
161
|
+
operation: acs_client_1.Operation.isAllowed,
|
|
162
|
+
context: (exports.ACSContextFactory),
|
|
163
|
+
resource: (0, exports.DefaultResourceFactory)(),
|
|
164
|
+
database: 'arangoDB',
|
|
165
|
+
useCache: true,
|
|
166
|
+
}),
|
|
167
|
+
__metadata("design:type", Function),
|
|
168
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
169
|
+
__metadata("design:returntype", Promise)
|
|
170
|
+
], AccessControlledServiceBase.prototype, "create", null);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, acs_client_1.access_controlled_function)({
|
|
173
|
+
action: acs_client_1.AuthZAction.READ,
|
|
174
|
+
operation: acs_client_1.Operation.whatIsAllowed,
|
|
175
|
+
context: acs_client_1.DefaultACSClientContextFactory,
|
|
176
|
+
resource: (0, exports.DefaultResourceFactory)(),
|
|
177
|
+
database: 'arangoDB',
|
|
178
|
+
useCache: true,
|
|
179
|
+
}),
|
|
180
|
+
__metadata("design:type", Function),
|
|
181
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
182
|
+
__metadata("design:returntype", Promise)
|
|
183
|
+
], AccessControlledServiceBase.prototype, "read", null);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, acs_client_1.resolves_subject)(),
|
|
186
|
+
(0, acs_client_1.injects_meta_data)(),
|
|
187
|
+
(0, acs_client_1.access_controlled_function)({
|
|
188
|
+
action: acs_client_1.AuthZAction.CREATE,
|
|
189
|
+
operation: acs_client_1.Operation.isAllowed,
|
|
190
|
+
context: (exports.ACSContextFactory),
|
|
191
|
+
resource: (0, exports.DefaultResourceFactory)(),
|
|
192
|
+
database: 'arangoDB',
|
|
193
|
+
useCache: true,
|
|
194
|
+
}),
|
|
195
|
+
__metadata("design:type", Function),
|
|
196
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
197
|
+
__metadata("design:returntype", Promise)
|
|
198
|
+
], AccessControlledServiceBase.prototype, "update", null);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, acs_client_1.resolves_subject)(),
|
|
201
|
+
(0, acs_client_1.injects_meta_data)(),
|
|
202
|
+
(0, acs_client_1.access_controlled_function)({
|
|
203
|
+
action: acs_client_1.AuthZAction.MODIFY,
|
|
204
|
+
operation: acs_client_1.Operation.isAllowed,
|
|
205
|
+
context: (exports.ACSContextFactory),
|
|
206
|
+
resource: (0, exports.DefaultResourceFactory)(),
|
|
207
|
+
database: 'arangoDB',
|
|
208
|
+
useCache: true,
|
|
209
|
+
}),
|
|
210
|
+
__metadata("design:type", Function),
|
|
211
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
212
|
+
__metadata("design:returntype", Promise)
|
|
213
|
+
], AccessControlledServiceBase.prototype, "upsert", null);
|
|
214
|
+
__decorate([
|
|
215
|
+
(0, acs_client_1.resolves_subject)(),
|
|
216
|
+
(0, acs_client_1.access_controlled_function)({
|
|
217
|
+
action: acs_client_1.AuthZAction.DELETE,
|
|
218
|
+
operation: acs_client_1.Operation.isAllowed,
|
|
219
|
+
context: (exports.ACSContextFactory),
|
|
220
|
+
resource: (0, exports.DefaultResourceFactory)(),
|
|
221
|
+
database: 'arangoDB',
|
|
222
|
+
useCache: true,
|
|
223
|
+
}),
|
|
224
|
+
__metadata("design:type", Function),
|
|
225
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
226
|
+
__metadata("design:returntype", Promise)
|
|
227
|
+
], AccessControlledServiceBase.prototype, "delete", null);
|
|
228
|
+
exports.AccessControlledServiceBase = AccessControlledServiceBase = __decorate([
|
|
229
|
+
acs_client_1.access_controlled_service,
|
|
230
|
+
__metadata("design:paramtypes", [String, kafka_client_1.Topic, Object, Function, Function, Boolean, String])
|
|
231
|
+
], AccessControlledServiceBase);
|
|
232
|
+
//# sourceMappingURL=AccessControlledServiceBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessControlledServiceBase.js","sourceRoot":"","sources":["../../src/experimental/AccessControlledServiceBase.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,gEAAsD;AACtD,4DAUqC;AACrC,2HAWiG;AAOjG,yCAGuB;AAEhB,MAAM,iBAAiB,GAAG,KAAK,EAA0D,IAAuC,EAAE,OAA0B,EAAE,OAAY,EAA6B,EAAE;IAC9M,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChE,OAAO;QACL,GAAG,OAAO;QACV,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,SAAS,EAAE;YACT,GAAG,SAAS,CAAC,KAAK,IAAI,EAAE;YACxB,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE;SACvB;KACF,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,iBAAiB,qBAW5B;AAEK,MAAM,sBAAsB,GAAG,CAAyB,GAAG,aAAuB,EAAsB,EAAE,CAAC,KAAK,EACrH,IAAS,EACT,OAAU,EACV,OAAoB,EACpB,EAAE,CAAC,C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AClC,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,IAAI;KACf,CAAC;;;;uDAMD;AAYqB;IAVrB,IAAA,6BAAgB,GAAE;IAClB,IAAA,8BAAiB,GAAE;IACnB,IAAA,uCAA0B,EAAC;QAC1B,MAAM,EAAE,wBAAW,CAAC,MAAM;QAC1B,SAAS,EAAE,sBAAS,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAA,yBAAuB,CAAA;QAChC,QAAQ,EAAE,IAAA,8BAAsB,GAAE;QAClC,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,IAAI;KACf,CAAC;;;;yDAMD;AAYqB;IAVrB,IAAA,6BAAgB,GAAE;IAClB,IAAA,8BAAiB,GAAE;IACnB,IAAA,uCAA0B,EAAC;QAC1B,MAAM,EAAE,wBAAW,CAAC,MAAM;QAC1B,SAAS,EAAE,sBAAS,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAA,yBAAuB,CAAA;QAChC,QAAQ,EAAE,IAAA,8BAAsB,GAAE;QAClC,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,IAAI;KACf,CAAC;;;;yDAMD;AAWqB;IATrB,IAAA,6BAAgB,GAAE;IAClB,IAAA,uCAA0B,EAAC;QAC1B,MAAM,EAAE,wBAAW,CAAC,MAAM;QAC1B,SAAS,EAAE,sBAAS,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAA,yBAAuB,CAAA;QAChC,QAAQ,EAAE,IAAA,8BAAsB,GAAE;QAClC,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,IAAI;KACf,CAAC;;;;yDAMD;sCAjQU,2BAA2B;IADvC,sCAAyB;6CAsBf,oBAAK;GArBH,2BAA2B,CAkQvC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ServiceConfig } from '@restorecommerce/service-config';
|
|
2
|
+
import { type Logger } from '@restorecommerce/logger';
|
|
3
|
+
import { Client } from '@restorecommerce/grpc-client';
|
|
4
|
+
import { CompatServiceDefinition } from 'nice-grpc';
|
|
5
|
+
export type CRUDServiceDefinition = CompatServiceDefinition & {
|
|
6
|
+
methods: {
|
|
7
|
+
create: any;
|
|
8
|
+
read: any;
|
|
9
|
+
update: any;
|
|
10
|
+
upsert: any;
|
|
11
|
+
delete: any;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare class ClientRegister {
|
|
15
|
+
protected readonly cfg: ServiceConfig;
|
|
16
|
+
protected readonly logger: Logger;
|
|
17
|
+
protected readonly register: Map<string, import("nice-grpc").RawClient<any, {}>>;
|
|
18
|
+
protected static readonly GLOBAL_REGISTER: Map<string, import("nice-grpc").RawClient<any, {}>>;
|
|
19
|
+
constructor(cfg: ServiceConfig, logger: Logger, register?: Map<string, import("nice-grpc").RawClient<any, {}>>);
|
|
20
|
+
get<T extends CRUDServiceDefinition>(definition: T): Client<T>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ClientRegister.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientRegister.d.ts","sourceRoot":"","sources":["../../src/experimental/ClientRegister.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,MAAM,EAIP,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAAG,uBAAuB,GAAG;IAC5D,OAAO,EAAE;QACP,MAAM,EAAE,GAAG,CAAC;QACZ,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,EAAE,GAAG,CAAC;QACZ,MAAM,EAAE,GAAG,CAAC;QACZ,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,CAAC;AAEF,qBAAa,cAAc;IAIvB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,aAAa;IACrC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ;IAL7B,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,sDAAkC;gBAGtD,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,sDAAiC;IAGvD,GAAG,CAAC,CAAC,SAAS,qBAAqB,EACxC,UAAU,EAAE,CAAC,GACZ,MAAM,CAAC,CAAC,CAAC;CAgCb"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientRegister = void 0;
|
|
4
|
+
const grpc_client_1 = require("@restorecommerce/grpc-client");
|
|
5
|
+
class ClientRegister {
|
|
6
|
+
cfg;
|
|
7
|
+
logger;
|
|
8
|
+
register;
|
|
9
|
+
static GLOBAL_REGISTER = new Map();
|
|
10
|
+
constructor(cfg, logger, register = ClientRegister.GLOBAL_REGISTER) {
|
|
11
|
+
this.cfg = cfg;
|
|
12
|
+
this.logger = logger;
|
|
13
|
+
this.register = register;
|
|
14
|
+
}
|
|
15
|
+
get(definition) {
|
|
16
|
+
if (this.register.has(definition.fullName.toString())) {
|
|
17
|
+
return this.register.get(definition.fullName.toString());
|
|
18
|
+
}
|
|
19
|
+
const config = this.cfg.get(`client:${definition.name}`) ?? Object.values(this.cfg.get(`client`) ?? [])?.find((client) => (client.fullName === definition.fullName
|
|
20
|
+
|| client.name === definition.name));
|
|
21
|
+
if (!config) {
|
|
22
|
+
throw new Error(`Config for ${definition.fullName.toString()} is missing!`);
|
|
23
|
+
}
|
|
24
|
+
const client = (0, grpc_client_1.createClient)({
|
|
25
|
+
...config,
|
|
26
|
+
logger: this.logger,
|
|
27
|
+
}, definition, (0, grpc_client_1.createChannel)(config.address));
|
|
28
|
+
this.register.set(definition.fullName.toString(), client);
|
|
29
|
+
return client;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ClientRegister = ClientRegister;
|
|
33
|
+
//# sourceMappingURL=ClientRegister.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientRegister.js","sourceRoot":"","sources":["../../src/experimental/ClientRegister.ts"],"names":[],"mappings":";;;AAEA,8DAKsC;AAatC,MAAa,cAAc;IAIJ;IACA;IACA;IALX,MAAM,CAAU,eAAe,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE3E,YACqB,GAAkB,EAClB,MAAc,EACd,WAAW,cAAc,CAAC,eAAe;QAFzC,QAAG,GAAH,GAAG,CAAe;QAClB,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAiC;IAC3D,CAAC;IAEG,GAAG,CACR,UAAa;QAEb,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CACzB,UAAU,UAAU,CAAC,IAAI,EAAE,CAC5B,IAAI,MAAM,CAAC,MAAM,CAChB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAC7B,EAAE,IAAI,CACL,CAAC,MAAW,EAAE,EAAE,CAAC,CACf,MAAM,CAAC,QAAQ,KAAK,UAAU,CAAC,QAAQ;eACpC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CACnC,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,cAAc,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,0B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