oca_package 1.2.1 → 1.2.2
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/cjs/oca_extensions/extensions.js +14 -3
- package/dist/cjs/oca_extensions/state/overlays/sensitive.js +29 -0
- package/dist/esm/oca_extensions/extensions.js +14 -3
- package/dist/esm/oca_extensions/state/overlays/sensitive.js +27 -0
- package/dist/types/oca_extensions/extensions.d.ts.map +1 -1
- package/dist/types/oca_extensions/state/overlays/sensitive.d.ts +15 -0
- package/dist/types/oca_extensions/state/overlays/sensitive.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ const ordering_js_1 = __importDefault(require("./state/overlays/ordering.js"));
|
|
|
8
8
|
const unit_framing_js_1 = __importDefault(require("./state/overlays/framing/unit_framing.js"));
|
|
9
9
|
const example_js_1 = __importDefault(require("./state/overlays/example.js"));
|
|
10
10
|
const range_js_1 = __importDefault(require("./state/overlays/range.js"));
|
|
11
|
+
const sensitive_js_1 = __importDefault(require("./state/overlays/sensitive.js"));
|
|
11
12
|
const helpers_js_1 = require("../utils/helpers.js");
|
|
12
13
|
const saidify_1 = require("saidify");
|
|
13
14
|
const ADC_COMMUNITY = 'adc';
|
|
@@ -60,12 +61,22 @@ class Overlay {
|
|
|
60
61
|
const example_ov = example_js_1.default.GenerateOverlay(this._overlay.example_overlay);
|
|
61
62
|
overlay['example'] = JSON.parse(example_ov);
|
|
62
63
|
}
|
|
64
|
+
else if (ov_type === 'sensitive_overlay') {
|
|
65
|
+
const sensitive_instance = new sensitive_js_1.default(this._overlay.sensitive_overlay);
|
|
66
|
+
const sensitive_ov = sensitive_instance.GenerateOverlay();
|
|
67
|
+
overlay['sensitive'] = JSON.parse(sensitive_ov);
|
|
68
|
+
}
|
|
63
69
|
else {
|
|
64
|
-
|
|
65
|
-
throw new Error('Invalid overlay name');
|
|
70
|
+
throw new Error(`Unsupported overaly type ${ov_type}. Supported extension overlays at ADC are [ ordering_overlay, unit_framing_overlay, range_overlay, example_overlay, sensitive_overlay ]`);
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
|
-
|
|
73
|
+
const sortedOverlays = Object.keys(overlay)
|
|
74
|
+
.sort()
|
|
75
|
+
.reduce((acc, key) => {
|
|
76
|
+
acc[key] = overlay[key];
|
|
77
|
+
return acc;
|
|
78
|
+
}, {});
|
|
79
|
+
return sortedOverlays;
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
exports.Overlay = Overlay;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const saidify_1 = require("saidify");
|
|
4
|
+
class Sensitive {
|
|
5
|
+
constructor(dynOverlay) {
|
|
6
|
+
if (!dynOverlay) {
|
|
7
|
+
throw new Error('a dynamic extension overlay are required');
|
|
8
|
+
}
|
|
9
|
+
this.dynOverlay = dynOverlay;
|
|
10
|
+
}
|
|
11
|
+
GetSensitiveAttributes() {
|
|
12
|
+
return this.dynOverlay.sensitive_attributes;
|
|
13
|
+
}
|
|
14
|
+
toJSON() {
|
|
15
|
+
return {
|
|
16
|
+
d: '',
|
|
17
|
+
type: 'community/overlays/adc/sensitive/1.1',
|
|
18
|
+
sensitive_attributes: this.GetSensitiveAttributes(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
Saidifying() {
|
|
22
|
+
const [, sad] = (0, saidify_1.saidify)(this.toJSON());
|
|
23
|
+
return sad;
|
|
24
|
+
}
|
|
25
|
+
GenerateOverlay() {
|
|
26
|
+
return JSON.stringify(this.Saidifying());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = Sensitive;
|
|
@@ -2,6 +2,7 @@ import Ordering from './state/overlays/ordering.js';
|
|
|
2
2
|
import UnitFraming from './state/overlays/framing/unit_framing.js';
|
|
3
3
|
import ExampleOverlay from './state/overlays/example.js';
|
|
4
4
|
import Range from './state/overlays/range.js';
|
|
5
|
+
import Sensitive from './state/overlays/sensitive.js';
|
|
5
6
|
import { ocabundleDigest, getOcaBundleFromDeps, getDigest, isOcaBundleWithDeps } from '../utils/helpers.js';
|
|
6
7
|
import { saidify } from 'saidify';
|
|
7
8
|
const ADC_COMMUNITY = 'adc';
|
|
@@ -53,12 +54,22 @@ export class Overlay {
|
|
|
53
54
|
const example_ov = ExampleOverlay.GenerateOverlay(this._overlay.example_overlay);
|
|
54
55
|
overlay['example'] = JSON.parse(example_ov);
|
|
55
56
|
}
|
|
57
|
+
else if (ov_type === 'sensitive_overlay') {
|
|
58
|
+
const sensitive_instance = new Sensitive(this._overlay.sensitive_overlay);
|
|
59
|
+
const sensitive_ov = sensitive_instance.GenerateOverlay();
|
|
60
|
+
overlay['sensitive'] = JSON.parse(sensitive_ov);
|
|
61
|
+
}
|
|
56
62
|
else {
|
|
57
|
-
|
|
58
|
-
throw new Error('Invalid overlay name');
|
|
63
|
+
throw new Error(`Unsupported overaly type ${ov_type}. Supported extension overlays at ADC are [ ordering_overlay, unit_framing_overlay, range_overlay, example_overlay, sensitive_overlay ]`);
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
|
-
|
|
66
|
+
const sortedOverlays = Object.keys(overlay)
|
|
67
|
+
.sort()
|
|
68
|
+
.reduce((acc, key) => {
|
|
69
|
+
acc[key] = overlay[key];
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
return sortedOverlays;
|
|
62
73
|
}
|
|
63
74
|
}
|
|
64
75
|
class ADCOverlayStrategy {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { saidify } from 'saidify';
|
|
2
|
+
class Sensitive {
|
|
3
|
+
constructor(dynOverlay) {
|
|
4
|
+
if (!dynOverlay) {
|
|
5
|
+
throw new Error('a dynamic extension overlay are required');
|
|
6
|
+
}
|
|
7
|
+
this.dynOverlay = dynOverlay;
|
|
8
|
+
}
|
|
9
|
+
GetSensitiveAttributes() {
|
|
10
|
+
return this.dynOverlay.sensitive_attributes;
|
|
11
|
+
}
|
|
12
|
+
toJSON() {
|
|
13
|
+
return {
|
|
14
|
+
d: '',
|
|
15
|
+
type: 'community/overlays/adc/sensitive/1.1',
|
|
16
|
+
sensitive_attributes: this.GetSensitiveAttributes(),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
Saidifying() {
|
|
20
|
+
const [, sad] = saidify(this.toJSON());
|
|
21
|
+
return sad;
|
|
22
|
+
}
|
|
23
|
+
GenerateOverlay() {
|
|
24
|
+
return JSON.stringify(this.Saidifying());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default Sensitive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/oca_extensions/extensions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/oca_extensions/extensions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AASzC,MAAM,WAAW,kBAAkB;IACjC,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,CAAC,aAAa,EAAE,IAAI,GAAG,UAAU,EAAE,CAAC;KACrC,CAAC;CACH;AAGD,MAAM,WAAW,eAAe;IAC9B,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,CAAC,aAAa,EAAE,IAAI,GAAG,UAAU,CAAC;KACnC,CAAC;CACH;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,qBAAqB,CAAqB;IAC3C,eAAe,EAAE,eAAe,CAAC;gBAE5B,kBAAkB,EAAE,kBAAkB;IAKlD,OAAO,CAAC,mBAAmB;IAiB3B,IAAW,WAAW,IAAI,eAAe,CAExC;CACF;AAKD,MAAM,WAAW,UAAU;IACzB,CAAC,OAAO,EAAE,MAAM,GAAG;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,qBAAa,OAAQ,YAAW,UAAU;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;gBAEP,iBAAiB,EAAE,UAAU;IAIlC,eAAe,IAAI,QAAQ,CAAC,UAAU,CAAC;CAsC/C;AAiFD,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,IAAI,CAAC;IACR,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,SAAU,YAAW,UAAU;IAC1C,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAM;IACf,UAAU,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,QAAQ,KAAM;gBAEX,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM;IAU5D,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,UAAU;IAKX,iBAAiB,IAAI,GAAG;CAGhC;AAED,KAAK,gBAAgB,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,CAAC;AAE9F,cAAM,YAAY;IACT,eAAe,EAAE,gBAAgB,CAAC;IAClC,WAAW,EAAE,GAAG,CAAC;IACjB,eAAe,EAAE,cAAc,CAAC;gBAE3B,oBAAoB,EAAE,kBAAkB,EAAE,UAAU,EAAE,GAAG;IAMrE,IAAW,kBAAkB,IAAI,gBAAgB,CA4BhD;CACF;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DynOverlay } from '../../extensions.js';
|
|
2
|
+
export interface ISensitive {
|
|
3
|
+
dynOverlay: DynOverlay;
|
|
4
|
+
GenerateOverlay(): string;
|
|
5
|
+
}
|
|
6
|
+
declare class Sensitive implements ISensitive {
|
|
7
|
+
dynOverlay: DynOverlay;
|
|
8
|
+
constructor(dynOverlay: DynOverlay);
|
|
9
|
+
private GetSensitiveAttributes;
|
|
10
|
+
private toJSON;
|
|
11
|
+
private Saidifying;
|
|
12
|
+
GenerateOverlay(): string;
|
|
13
|
+
}
|
|
14
|
+
export default Sensitive;
|
|
15
|
+
//# sourceMappingURL=sensitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensitive.d.ts","sourceRoot":"","sources":["../../../../../src/oca_extensions/state/overlays/sensitive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,IAAI,MAAM,CAAC;CAC3B;AAED,cAAM,SAAU,YAAW,UAAU;IAC5B,UAAU,EAAE,UAAU,CAAC;gBAElB,UAAU,EAAE,UAAU;IAQlC,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,UAAU;IAKX,eAAe,IAAI,MAAM;CAGjC;AAED,eAAe,SAAS,CAAC"}
|