@servicelabsco/nestjs-utility-services 3.0.1 → 3.0.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/CHANGELOG.md +9 -3
- package/README.md +6 -0
- package/dist/platformUtility/interfaces/html.pdf.upload.options.interface.d.ts +3 -0
- package/dist/platformUtility/interfaces/html.pdf.upload.options.interface.js +3 -0
- package/dist/platformUtility/interfaces/html.pdf.upload.options.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/index.d.ts +1 -0
- package/dist/platformUtility/interfaces/index.js +1 -0
- package/dist/platformUtility/interfaces/index.js.map +1 -1
- package/dist/platformUtility/services/pdf.service.d.ts +4 -3
- package/dist/platformUtility/services/pdf.service.js +10 -7
- package/dist/platformUtility/services/pdf.service.js.map +1 -1
- package/dist/system/es6.classes.d.ts +3 -2
- package/dist/system/es6.classes.js +2 -0
- package/dist/system/es6.classes.js.map +1 -1
- package/dist/system/libraries/business.rule.query.evaluator.d.ts +0 -1
- package/dist/system/libraries/business.rule.query.evaluator.js +4 -31
- package/dist/system/libraries/business.rule.query.evaluator.js.map +1 -1
- package/dist/system/libraries/code.evaluator.d.ts +0 -1
- package/dist/system/libraries/code.evaluator.js +4 -40
- package/dist/system/libraries/code.evaluator.js.map +1 -1
- package/dist/system/libraries/execute.code.fix.d.ts +0 -1
- package/dist/system/libraries/execute.code.fix.js +7 -38
- package/dist/system/libraries/execute.code.fix.js.map +1 -1
- package/dist/system/libraries/index.d.ts +1 -0
- package/dist/system/libraries/index.js +1 -0
- package/dist/system/libraries/index.js.map +1 -1
- package/dist/system/libraries/process.script.execution.d.ts +0 -1
- package/dist/system/libraries/process.script.execution.js +4 -40
- package/dist/system/libraries/process.script.execution.js.map +1 -1
- package/dist/system/libraries/sandboxed.script.executor.d.ts +5 -1
- package/dist/system/libraries/sandboxed.script.executor.js +45 -3
- package/dist/system/libraries/sandboxed.script.executor.js.map +1 -1
- package/dist/system/libraries/script.fn.helpers.d.ts +36 -0
- package/dist/system/libraries/script.fn.helpers.js +78 -0
- package/dist/system/libraries/script.fn.helpers.js.map +1 -0
- package/docs/upgrade-3.0-backward-compatibility.md +223 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,9 @@ This is a **major** release. `2.0.15` was published from the `production` branch
|
|
|
6
6
|
accumulated breaking changes that were sitting under an already-consumed patch version. Everything
|
|
7
7
|
below lands at once.
|
|
8
8
|
|
|
9
|
-
Read the **Action required** section before upgrading.
|
|
9
|
+
Read the **Action required** section before upgrading. For a breaker-by-breaker migration
|
|
10
|
+
runbook (env escape hatches, SSRF, scripts, sessions, migrations), see
|
|
11
|
+
**[docs/upgrade-3.0-backward-compatibility.md](docs/upgrade-3.0-backward-compatibility.md)**.
|
|
10
12
|
|
|
11
13
|
### Action required
|
|
12
14
|
|
|
@@ -65,8 +67,12 @@ exist. The barrels come from the out-of-repo `slnu` step, not `nest build`; run
|
|
|
65
67
|
redirect hops. **Calls to internal hosts now fail** unless you pass `allowInternal: true` on the
|
|
66
68
|
request options or source config. `getRawResponse` still never throws — a blocked URL returns
|
|
67
69
|
`{ success: false }`.
|
|
68
|
-
- `PdfService.uploadHtml` / `getHtmlUrl`
|
|
69
|
-
|
|
70
|
+
- `PdfService.uploadHtml` / `getHtmlUrl` default to **`public-read`** and a permanent object URL
|
|
71
|
+
(pre-3.0 behaviour). Pass `{ private: true }` for a private object + time-limited presigned URL
|
|
72
|
+
(`pdf.html.signed.url.ttl.seconds`). Object names remain high-entropy either way.
|
|
73
|
+
- Stored scripts may use legacy `fn.getService` / `fn.getEntity` / `fn.getJob` (and business-rule
|
|
74
|
+
`getServiceInstance` / `getEntityInstance`) again — they return **remote handles**, not host
|
|
75
|
+
objects. `fn.call*` / `fn.dispatchJob` remain available.
|
|
70
76
|
- `ProcessSesMail` now **rejects** when SES fails. It previously resolved with the `Error` object,
|
|
71
77
|
producing a mail log indistinguishable from a successful send. This aligns `ses` with the `smtp`
|
|
72
78
|
and `sesRaw` gateways, which already rejected.
|
package/README.md
CHANGED
|
@@ -33,6 +33,12 @@ Consuming apps must wire early SDK init plus `SentryReportingModule`. See
|
|
|
33
33
|
**[docs/sentry-reporting.md](docs/sentry-reporting.md)** for the full integration
|
|
34
34
|
checklist (`instrument.ts`, `AppModule`, env vars, workers).
|
|
35
35
|
|
|
36
|
+
### Upgrading to 3.x
|
|
37
|
+
|
|
38
|
+
**[docs/upgrade-3.0-backward-compatibility.md](docs/upgrade-3.0-backward-compatibility.md)** —
|
|
39
|
+
breaker-by-breaker migration guide (internal auth, SSRF, PDF URLs, scripts, access checks,
|
|
40
|
+
sessions, SES, migrations) and which escape hatches exist.
|
|
41
|
+
|
|
36
42
|
## Installation
|
|
37
43
|
|
|
38
44
|
```bash
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.pdf.upload.options.interface.js","sourceRoot":"","sources":["../../../src/platformUtility/interfaces/html.pdf.upload.options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -11,4 +11,5 @@ export * from './html.pdf.convert.success.interface';
|
|
|
11
11
|
export * from './html.pdf.margin.interface';
|
|
12
12
|
export * from './html.pdf.options.interface';
|
|
13
13
|
export * from './html.pdf.paper.format.interface';
|
|
14
|
+
export * from './html.pdf.upload.options.interface';
|
|
14
15
|
export * from './split.pdf.page.interface';
|
|
@@ -27,5 +27,6 @@ __exportStar(require("./html.pdf.convert.success.interface"), exports);
|
|
|
27
27
|
__exportStar(require("./html.pdf.margin.interface"), exports);
|
|
28
28
|
__exportStar(require("./html.pdf.options.interface"), exports);
|
|
29
29
|
__exportStar(require("./html.pdf.paper.format.interface"), exports);
|
|
30
|
+
__exportStar(require("./html.pdf.upload.options.interface"), exports);
|
|
30
31
|
__exportStar(require("./split.pdf.page.interface"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD;AAAA,0EAAwD;AAAA,qEAAmD;AAAA,0EAAwD;AAAA,yEAAuD;AAAA,mEAAiD;AAAA,mEAAiD;AAAA,uEAAqD;AAAA,sEAAoD;AAAA,uEAAqD;AAAA,8DAA4C;AAAA,+DAA6C;AAAA,oEAAkD;AAAA,6DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD;AAAA,0EAAwD;AAAA,qEAAmD;AAAA,0EAAwD;AAAA,yEAAuD;AAAA,mEAAiD;AAAA,mEAAiD;AAAA,uEAAqD;AAAA,sEAAoD;AAAA,uEAAqD;AAAA,8DAA4C;AAAA,+DAA6C;AAAA,oEAAkD;AAAA,sEAAoD;AAAA,6DAA0C"}
|
|
@@ -5,6 +5,7 @@ import { PropertyService } from '../../system/services/property.service';
|
|
|
5
5
|
import { HtmlPdfConvertRequestInterface } from '../interfaces/html.pdf.convert.request.interface';
|
|
6
6
|
import { HtmlPdfConvertSuccessInterface } from '../interfaces/html.pdf.convert.success.interface';
|
|
7
7
|
import { HtmlPdfOptionsInterface } from '../interfaces/html.pdf.options.interface';
|
|
8
|
+
import { HtmlPdfUploadOptionsInterface } from '../interfaces/html.pdf.upload.options.interface';
|
|
8
9
|
import { RemoteRequestService } from './remote.request.service';
|
|
9
10
|
import { SqlService } from './sql.service';
|
|
10
11
|
export declare class PdfService extends CommonService {
|
|
@@ -17,11 +18,11 @@ export declare class PdfService extends CommonService {
|
|
|
17
18
|
private token;
|
|
18
19
|
private apiUrl;
|
|
19
20
|
constructor(propertyService: PropertyService, uploadService: UploadService, remoteRequestService: RemoteRequestService, sqlService: SqlService, storageService: StorageService);
|
|
20
|
-
getUrl(template: string, data: any, path: string): Promise<string>;
|
|
21
|
-
getHtmlUrl(template: string, data: any, path: string): Promise<string>;
|
|
21
|
+
getUrl(template: string, data: any, path: string, uploadOptions?: HtmlPdfUploadOptionsInterface): Promise<string>;
|
|
22
|
+
getHtmlUrl(template: string, data: any, path: string, uploadOptions?: HtmlPdfUploadOptionsInterface): Promise<string>;
|
|
22
23
|
getPdfFromHtmlUrl(url: string, pdfOptions?: HtmlPdfOptionsInterface): Promise<string>;
|
|
23
24
|
convert(request: HtmlPdfConvertRequestInterface): Promise<HtmlPdfConvertSuccessInterface>;
|
|
24
|
-
uploadHtml(html: string, path: string, filename?: string): Promise<string>;
|
|
25
|
+
uploadHtml(html: string, path: string, filename?: string, uploadOptions?: HtmlPdfUploadOptionsInterface): Promise<string>;
|
|
25
26
|
private buildObjectName;
|
|
26
27
|
private getSignedUrlTtl;
|
|
27
28
|
private resolveSourceUrl;
|
|
@@ -33,15 +33,15 @@ let PdfService = class PdfService extends common_service_1.CommonService {
|
|
|
33
33
|
this.storageService = storageService;
|
|
34
34
|
this.publicExposed = true;
|
|
35
35
|
}
|
|
36
|
-
async getUrl(template, data, path) {
|
|
37
|
-
const htmlUrl = await this.getHtmlUrl(template, data, path);
|
|
36
|
+
async getUrl(template, data, path, uploadOptions) {
|
|
37
|
+
const htmlUrl = await this.getHtmlUrl(template, data, path, uploadOptions);
|
|
38
38
|
return this.getPdfFromHtmlUrl(htmlUrl);
|
|
39
39
|
}
|
|
40
|
-
async getHtmlUrl(template, data, path) {
|
|
40
|
+
async getHtmlUrl(template, data, path, uploadOptions) {
|
|
41
41
|
const scriptBody = await this.loadTemplateScript(template);
|
|
42
42
|
const compiledData = platform_utility_1.PlatformUtility.compileHandlebar(scriptBody, data);
|
|
43
43
|
const filename = this.buildObjectName(template);
|
|
44
|
-
return this.uploadHtml(compiledData, path, filename);
|
|
44
|
+
return this.uploadHtml(compiledData, path, filename, uploadOptions);
|
|
45
45
|
}
|
|
46
46
|
async getPdfFromHtmlUrl(url, pdfOptions) {
|
|
47
47
|
const result = await this.convert({ html_url: url, pdf_options: pdfOptions });
|
|
@@ -82,19 +82,22 @@ let PdfService = class PdfService extends common_service_1.CommonService {
|
|
|
82
82
|
throw error;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
async uploadHtml(html, path, filename) {
|
|
85
|
+
async uploadHtml(html, path, filename, uploadOptions) {
|
|
86
86
|
const bucket = await this.propertyService.get('aws.config.bucket');
|
|
87
87
|
if (!bucket)
|
|
88
88
|
throw new operation_exception_1.OperationException('aws.config.bucket not set');
|
|
89
89
|
const name = filename ?? this.buildObjectName('document');
|
|
90
90
|
const urlKey = `${path.replace(/\/$/, '')}/${name}`;
|
|
91
|
-
|
|
91
|
+
const isPrivate = uploadOptions?.private === true;
|
|
92
|
+
const url = await this.uploadService.uploadFile({
|
|
92
93
|
Bucket: bucket,
|
|
93
94
|
Key: urlKey,
|
|
94
95
|
Body: html,
|
|
95
96
|
ContentType: 'text/html',
|
|
96
|
-
ACL: 'private',
|
|
97
|
+
ACL: isPrivate ? 'private' : 'public-read',
|
|
97
98
|
});
|
|
99
|
+
if (!isPrivate)
|
|
100
|
+
return url;
|
|
98
101
|
return this.storageService.getSignedDownloadUrl({ bucket, key: urlKey }, await this.getSignedUrlTtl());
|
|
99
102
|
}
|
|
100
103
|
buildObjectName(prefix) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/pdf.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAqC;AACrC,qFAAiF;AACjF,0EAAsE;AACtE,8EAA0E;AAC1E,2EAAuE;AACvE,yEAAqE;AACrE,6EAAyE;
|
|
1
|
+
{"version":3,"file":"pdf.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/pdf.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAqC;AACrC,qFAAiF;AACjF,0EAAsE;AACtE,8EAA0E;AAC1E,2EAAuE;AACvE,yEAAqE;AACrE,6EAAyE;AAKzE,qEA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B,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC;QAElC,IAAI,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,wCAAkB,CAAC,6DAA6D,CAAC,CAAC;QAE7G,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,SAAS;QACnB,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QAEpC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,GAAG,UAAU,IAAI,wBAAwB,CAAC;QAErD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAKO,KAAK,CAAC,kBAAkB,CAAC,kBAA0B;QACvD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CACxC;;;;;;qBAMS,EACT,CAAC,kBAAkB,CAAC,CACvB,CAAC;QAEF,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,wCAAkB,CAAC,2BAA2B,kBAAkB,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AApNY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;qCAQ+B,kCAAe;QACjB,8BAAa;QACN,6CAAoB;QAC9B,wBAAU;QACN,gCAAc;GAX5C,UAAU,CAoNtB"}
|
|
@@ -139,6 +139,7 @@ import { ProcessMenuCreation } from './libraries/process.menu.creation';
|
|
|
139
139
|
import { ProcessScriptExecution } from './libraries/process.script.execution';
|
|
140
140
|
import { ReportBatchPaginator } from './libraries/report.batch.paginator';
|
|
141
141
|
import { SandboxedScriptExecutor } from './libraries/sandboxed.script.executor';
|
|
142
|
+
import { ScriptFnHelpers } from './libraries/script.fn.helpers';
|
|
142
143
|
import { SecurityRuleEvaluator } from './libraries/security.rule.evaluator';
|
|
143
144
|
import { SyncDynamoTables } from './libraries/sync.dynamo.tables';
|
|
144
145
|
import { MenuListModifier } from './modifiers/menu.list.modifier';
|
|
@@ -191,8 +192,8 @@ declare const es6Classes: {
|
|
|
191
192
|
entities: (typeof LookupTypeEntity | typeof UserGroupRoleEntity | typeof UserGroupEntity | typeof UserGroupMemberEntity | typeof BusinessRuleRoleEntity | typeof BusinessRuleEntity | typeof ColumnDefinitionEntity | typeof ColumnEntity | typeof ModelEntity | typeof FormPreferenceEntity | typeof ModelColumnEntity | typeof RelationshipEntity | typeof ModelRelationshipEntity | typeof ModelRoleEntity | typeof FormColumnEntity | typeof SystemScriptEntity | typeof UiActionPermissionEntity | typeof UiActionEntity | typeof UiActionRoleEntity | typeof PrimaryAxisEntity | typeof ChartEntity | typeof ClientEntity | typeof ClientCredentialEntity | typeof CredentialIpEntity | typeof ClientScriptEntity | typeof CodeFixScriptEntity | typeof CodeFixLogEntity | typeof DocumentEntity | typeof CommentEntity | typeof DataLogEntity | typeof DynamoTableEntity | typeof EventDetailEntity | typeof EventQueueEntity | typeof MailLogEntity | typeof MailEventEntity | typeof MailRecipientEntity | typeof MailValidationEntity | typeof MaterialViewEntity | typeof MenuRoleEntity | typeof MenuEntity | typeof ModuleEntity | typeof ModuleMenuEntity | typeof PageDefinitionEntity | typeof ParentMenuEntity | typeof MobileValidationEntity | typeof OpenPropertyEntity | typeof RecurringQueryEntity | typeof ReportFilterEntity | typeof ReportEntity | typeof ReportRelationshipEntity | typeof ReportRoleEntity | typeof ReportColumnEntity | typeof ReportSheetEntity | typeof ScheduledEventEntity | typeof SecurityRuleEntity | typeof ServiceEntity | typeof SmsTemplateEntity | typeof SmsMessageEntity | typeof UserGroupPermissionEntity | typeof UserPreferenceEntity | typeof WhatsappTemplateEntity)[];
|
|
192
193
|
interfaces: any[];
|
|
193
194
|
jobs: (typeof ExecuteCodeFixJob | typeof SetScheduledEventJob | typeof ModelScannerJob | typeof ReportColumnSyncJob | typeof SyncAllCodeJob | typeof ClientCredentialJob | typeof ClientJob | typeof CodeFixLogJob | typeof SetCodefixScriptEventJob | typeof CodeFixScriptJob | typeof ColumnMapperJob | typeof CommentJob | typeof CredentialIpJob | typeof DataLogJob | typeof DocumentJob | typeof ExecutableScriptJob | typeof ExecuteMaterialViewJob | typeof ExecuteRecurringQueryJob | typeof MailEventJob | typeof MailRecipientJob | typeof MailValidationJob | typeof RefreshMaterialViewJob | typeof MaterialViewJob | typeof MobileValidationJob | typeof OrphanSweeperJob | typeof RefreshPropertyCacheJob | typeof PropertyJob | typeof SetRecurringQueryEventJob | typeof RecurringQueryJob | typeof RelationshipMapperJob | typeof ReportSheetJob | typeof ScheduledEventJob | typeof SetEventQueueJob | typeof SmsMessageJob | typeof SqsPollingJob | typeof UserGroupMemberJob | typeof UserGroupPermissionJob | typeof UserGroupRoleJob)[];
|
|
194
|
-
libraries: (typeof FileTypeDetector | typeof CommonStorageService | typeof SandboxedScriptExecutor | typeof
|
|
195
|
+
libraries: (typeof FileTypeDetector | typeof CommonStorageService | typeof SandboxedScriptExecutor | typeof SecurityRuleEvaluator | typeof ColumnManager | typeof ScriptFnHelpers | typeof ExecuteCodeFix | typeof ModelSync | typeof BusinessRuleFilterValidator | typeof BusinessRuleQueryEvaluator | typeof ProcessMenuCreation | typeof MaterialViewFreshness | typeof CodeEvaluator | typeof CryptReEncryptProcessor | typeof GetReportQuery | typeof ReportBatchPaginator | typeof GenerateDownloadableReportFile | typeof ProcessScriptExecution | typeof SyncDynamoTables)[];
|
|
195
196
|
modifiers: (typeof MenuListModifier | typeof ModuleListModifier)[];
|
|
196
|
-
services: (typeof PropertyService | typeof AwsS3Service | typeof CloudflareR2Service | typeof StorageService | typeof UploadService | typeof
|
|
197
|
+
services: (typeof PropertyService | typeof AwsS3Service | typeof CloudflareR2Service | typeof StorageService | typeof UploadService | typeof SecurityRuleService | typeof UiActionService | typeof ModelService | typeof BaseService | typeof ScheduledEventService | typeof EventDetailService | typeof ClientScriptService | typeof PreferenceService | typeof BusinessRuleService | typeof ListService | typeof FormService | typeof MenuService | typeof UserPreferenceService | typeof ReportService | typeof ClientCredentialService | typeof EventQueueService | typeof ColumnService | typeof DocumentService | typeof CommentService | typeof Es6JobsService | typeof ExecutableScriptService | typeof InternalServerConnectService | typeof MailValidationService | typeof MobileValidationService)[];
|
|
197
198
|
};
|
|
198
199
|
export default es6Classes;
|
|
@@ -170,6 +170,7 @@ const process_menu_creation_1 = require("./libraries/process.menu.creation");
|
|
|
170
170
|
const process_script_execution_1 = require("./libraries/process.script.execution");
|
|
171
171
|
const report_batch_paginator_1 = require("./libraries/report.batch.paginator");
|
|
172
172
|
const sandboxed_script_executor_1 = require("./libraries/sandboxed.script.executor");
|
|
173
|
+
const script_fn_helpers_1 = require("./libraries/script.fn.helpers");
|
|
173
174
|
const security_rule_evaluator_1 = require("./libraries/security.rule.evaluator");
|
|
174
175
|
const sync_dynamo_tables_1 = require("./libraries/sync.dynamo.tables");
|
|
175
176
|
const menu_list_modifier_1 = require("./modifiers/menu.list.modifier");
|
|
@@ -382,6 +383,7 @@ const es6Classes = {
|
|
|
382
383
|
process_script_execution_1.ProcessScriptExecution,
|
|
383
384
|
report_batch_paginator_1.ReportBatchPaginator,
|
|
384
385
|
sandboxed_script_executor_1.SandboxedScriptExecutor,
|
|
386
|
+
script_fn_helpers_1.ScriptFnHelpers,
|
|
385
387
|
security_rule_evaluator_1.SecurityRuleEvaluator,
|
|
386
388
|
sync_dynamo_tables_1.SyncDynamoTables,
|
|
387
389
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/system/es6.classes.ts"],"names":[],"mappings":";;AAAA,qE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QACnB,wCAAiB;QACjB,kDAAsB;QACtB,sDAAwB;QACxB,6BAAY;QACZ,qCAAgB;QAChB,uCAAiB;QACjB,mCAAe;QACf,2CAAmB;QACnB,mCAAe;QACf,qCAAgB;QAChB,0BAAW;QACX,uCAAiB;QACjB,kDAAsB;QACtB,oDAAuB;QACvB,+CAAqB;QACrB,4CAAmB;QACnB,iCAAc;QACd,uCAAiB;QACjB,uDAAwB;QACxB,sCAAgB;QAChB,yDAAyB;QACzB,8CAAoB;QACpB,+BAAa;QACb,+BAAa;QACb,kCAAc;QACd,0CAAkB;QAClB,kDAAsB;QACtB,sCAAgB;KACnB;IACD,SAAS,EAAE;QACP,4DAA2B;QAC3B,0DAA0B;QAC1B,8BAAa;QACb,8BAAa;QACb,6CAAoB;QACpB,oDAAuB;QACvB,iCAAc;QACd,qCAAgB;QAChB,kEAA8B;QAC9B,iCAAc;QACd,+CAAqB;QACrB,sBAAS;QACT,2CAAmB;QACnB,iDAAsB;QACtB,6CAAoB;QACpB,mDAAuB;QACvB,+CAAqB;QACrB,qCAAgB;KACnB;IACD,SAAS,EAAE,CAAC,qCAAgB,EAAE,yCAAkB,CAAC;IACjD,QAAQ,EAAE;QACN,6BAAY;QACZ,0BAAW;QACX,2CAAmB;QACnB,mDAAuB;QACvB,2CAAmB;QACnB,2CAAmB;QACnB,8BAAa;QACb,gCAAc;QACd,kCAAe;QACf,iCAAc;QACd,yCAAkB;QAClB,uCAAiB;QACjB,mDAAuB;QACvB,0BAAW;QACX,8DAA4B;QAC5B,0BAAW;QACX,+CAAqB;QACrB,0BAAW;QACX,mDAAuB;QACvB,4BAAY;QACZ,sCAAiB;QACjB,kCAAe;QACf,8BAAa;QACb,+CAAqB;QACrB,2CAAmB;QACnB,gCAAc;QACd,mCAAe;QACf,8BAAa;QACb,+CAAqB;KACxB;CACJ,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/system/es6.classes.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10 +35,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.BusinessRuleQueryEvaluator = void 0;
|
|
37
37
|
const Sentry = __importStar(require("@sentry/node"));
|
|
38
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
|
39
38
|
const auth_1 = require("../../common/libraries/auth");
|
|
40
39
|
const system_script_entity_1 = require("../entities/system.script.entity");
|
|
41
40
|
const sandboxed_script_executor_1 = require("./sandboxed.script.executor");
|
|
41
|
+
const script_fn_helpers_1 = require("./script.fn.helpers");
|
|
42
42
|
class BusinessRuleQueryEvaluator {
|
|
43
43
|
constructor(rule, commonService) {
|
|
44
44
|
this.rule = rule;
|
|
@@ -58,9 +58,9 @@ class BusinessRuleQueryEvaluator {
|
|
|
58
58
|
user: auth_1.Auth.user(),
|
|
59
59
|
query: null,
|
|
60
60
|
},
|
|
61
|
-
bridge: {
|
|
62
|
-
fn: this.
|
|
63
|
-
},
|
|
61
|
+
bridge: (registry) => ({
|
|
62
|
+
fn: script_fn_helpers_1.ScriptFnHelpers.buildBusinessRuleFns(this.executor, registry, this.commonService),
|
|
63
|
+
}),
|
|
64
64
|
});
|
|
65
65
|
if (!result.ok) {
|
|
66
66
|
Sentry.captureException(new Error(result.error), {
|
|
@@ -71,33 +71,6 @@ class BusinessRuleQueryEvaluator {
|
|
|
71
71
|
}
|
|
72
72
|
return result.context.query;
|
|
73
73
|
}
|
|
74
|
-
buildHelpers() {
|
|
75
|
-
return {
|
|
76
|
-
hasService: async (identifier) => !!(await this.commonService.getServiceInstance(identifier)),
|
|
77
|
-
hasEntity: async (identifier) => !!(await this.commonService.getEntityInstance(identifier)),
|
|
78
|
-
callService: async (identifier, method, ...args) => {
|
|
79
|
-
const service = await this.commonService.getServiceInstance(identifier);
|
|
80
|
-
if (!service)
|
|
81
|
-
throw new operation_exception_1.OperationException(`unknown service "${identifier}"`);
|
|
82
|
-
return this.executor.invokeMethod(service, method, args);
|
|
83
|
-
},
|
|
84
|
-
callEntity: async (identifier, method, ...args) => {
|
|
85
|
-
const entity = await this.commonService.getEntityInstance(identifier);
|
|
86
|
-
if (!entity)
|
|
87
|
-
throw new operation_exception_1.OperationException(`unknown entity "${identifier}"`);
|
|
88
|
-
return this.executor.invokeMethod(entity, method, args);
|
|
89
|
-
},
|
|
90
|
-
getServiceInstance: () => {
|
|
91
|
-
throw new operation_exception_1.OperationException('fn.getServiceInstance was removed for sandbox safety — use fn.callService(identifier, method, ...args)');
|
|
92
|
-
},
|
|
93
|
-
getEntityInstance: () => {
|
|
94
|
-
throw new operation_exception_1.OperationException('fn.getEntityInstance was removed for sandbox safety — use fn.callEntity(identifier, method, ...args)');
|
|
95
|
-
},
|
|
96
|
-
checkOrSetRecord: () => {
|
|
97
|
-
throw new operation_exception_1.OperationException('fn.checkOrSetRecord is not callable from a business rule script');
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
74
|
async getScript(id) {
|
|
102
75
|
if (!id)
|
|
103
76
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"business.rule.query.evaluator.js","sourceRoot":"","sources":["../../../src/system/libraries/business.rule.query.evaluator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"business.rule.query.evaluator.js","sourceRoot":"","sources":["../../../src/system/libraries/business.rule.query.evaluator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,sDAAmD;AACnD,2EAAsE;AAGtE,2EAAsE;AACtE,2DAAsD;AAQtD,MAAa,0BAA0B;IAQnC,YACqB,IAAwB,EACxB,aAA0B;QAD1B,SAAI,GAAJ,IAAI,CAAoB;QACxB,kBAAa,GAAb,aAAa,CAAa;QAT9B,aAAQ,GAAG,IAAI,mDAAuB,EAAE,CAAC;IA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ACJ;AAhFD,gEAgFC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CodeEvaluator = void 0;
|
|
4
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
|
5
|
-
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
|
6
4
|
const sandboxed_script_executor_1 = require("./sandboxed.script.executor");
|
|
5
|
+
const script_fn_helpers_1 = require("./script.fn.helpers");
|
|
7
6
|
class CodeEvaluator {
|
|
8
7
|
constructor() {
|
|
9
8
|
this.executor = new sandboxed_script_executor_1.SandboxedScriptExecutor();
|
|
@@ -12,10 +11,10 @@ class CodeEvaluator {
|
|
|
12
11
|
const result = await this.executor.executeAsync(`(async () => {${script}})()`, {
|
|
13
12
|
timeoutMs: 5_000,
|
|
14
13
|
context: { data: context?.data },
|
|
15
|
-
bridge: {
|
|
14
|
+
bridge: (registry) => ({
|
|
16
15
|
ctx: context?.fn ?? {},
|
|
17
|
-
fn: this.
|
|
18
|
-
},
|
|
16
|
+
fn: script_fn_helpers_1.ScriptFnHelpers.buildPlatformFns(this.executor, registry),
|
|
17
|
+
}),
|
|
19
18
|
});
|
|
20
19
|
if (!result.ok) {
|
|
21
20
|
global.console.error(`CodeEvaluator: script execution failed: ${result.error}`);
|
|
@@ -23,41 +22,6 @@ class CodeEvaluator {
|
|
|
23
22
|
}
|
|
24
23
|
this.executor.writeBack(context?.data, result.context.data);
|
|
25
24
|
}
|
|
26
|
-
buildHelpers() {
|
|
27
|
-
return {
|
|
28
|
-
hasEntity: (sourceType) => !!platform_utility_1.PlatformUtility.getEntity(sourceType),
|
|
29
|
-
hasService: (hash) => !!platform_utility_1.PlatformUtility.getService(hash),
|
|
30
|
-
hasJob: (hash) => !!platform_utility_1.PlatformUtility.getJob(hash),
|
|
31
|
-
callEntity: (sourceType, method, ...args) => {
|
|
32
|
-
const entity = platform_utility_1.PlatformUtility.getEntity(sourceType);
|
|
33
|
-
if (!entity)
|
|
34
|
-
throw new operation_exception_1.OperationException(`unknown entity "${sourceType}"`);
|
|
35
|
-
return this.executor.invokeMethod(entity, method, args);
|
|
36
|
-
},
|
|
37
|
-
callService: (hash, method, ...args) => {
|
|
38
|
-
const service = platform_utility_1.PlatformUtility.getService(hash);
|
|
39
|
-
if (!service)
|
|
40
|
-
throw new operation_exception_1.OperationException(`unknown service "${hash}"`);
|
|
41
|
-
return this.executor.invokeMethod(service, method, args);
|
|
42
|
-
},
|
|
43
|
-
dispatchJob: async (sourceType, data, delay = 0) => {
|
|
44
|
-
const job = platform_utility_1.PlatformUtility.getJob(sourceType);
|
|
45
|
-
if (!job)
|
|
46
|
-
return;
|
|
47
|
-
const dispatched = await job.dispatch(data, { delay });
|
|
48
|
-
return dispatched?.id ?? null;
|
|
49
|
-
},
|
|
50
|
-
getEntity: () => {
|
|
51
|
-
throw new operation_exception_1.OperationException('fn.getEntity was removed for sandbox safety — use fn.callEntity(sourceType, method, ...args)');
|
|
52
|
-
},
|
|
53
|
-
getService: () => {
|
|
54
|
-
throw new operation_exception_1.OperationException('fn.getService was removed for sandbox safety — use fn.callService(hash, method, ...args)');
|
|
55
|
-
},
|
|
56
|
-
getJob: () => {
|
|
57
|
-
throw new operation_exception_1.OperationException('fn.getJob was removed for sandbox safety — use fn.hasJob(hash) / fn.dispatchJob(hash, data, delay)');
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
25
|
}
|
|
62
26
|
exports.CodeEvaluator = CodeEvaluator;
|
|
63
27
|
//# sourceMappingURL=code.evaluator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.evaluator.js","sourceRoot":"","sources":["../../../src/system/libraries/code.evaluator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"code.evaluator.js","sourceRoot":"","sources":["../../../src/system/libraries/code.evaluator.ts"],"names":[],"mappings":";;;AAEA,2EAAsE;AACtE,2DAAsD;AAmBtD,MAAa,aAAa;IAA1B;QACqB,aAAQ,GAAG,IAAI,mDAAuB,EAAE,CAAC;IAyB9D,CAAC;IAjBG,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAiC;QAC3D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,iBAAiB,MAAM,MAAM,EAAE;YAC3E,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;YAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBACnB,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE;gBACtB,EAAE,EAAE,mCAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAChE,CAAC;SACL,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,2CAA2C,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAChF,OAAO;QACX,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAG,MAAM,CAAC,OAAe,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;CACJ;AA1BD,sCA0BC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExecuteCodeFix = void 0;
|
|
4
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
|
5
|
-
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
|
6
4
|
const code_fix_log_entity_1 = require("../entities/code.fix.log.entity");
|
|
7
5
|
const code_fix_script_entity_1 = require("../entities/code.fix.script.entity");
|
|
8
6
|
const sandboxed_script_executor_1 = require("./sandboxed.script.executor");
|
|
7
|
+
const script_fn_helpers_1 = require("./script.fn.helpers");
|
|
9
8
|
class ExecuteCodeFix {
|
|
10
9
|
constructor(sqlService) {
|
|
11
10
|
this.sqlService = sqlService;
|
|
@@ -25,9 +24,12 @@ class ExecuteCodeFix {
|
|
|
25
24
|
data: context?.data,
|
|
26
25
|
logContext: {},
|
|
27
26
|
},
|
|
28
|
-
bridge: {
|
|
29
|
-
fn:
|
|
30
|
-
|
|
27
|
+
bridge: (registry) => ({
|
|
28
|
+
fn: {
|
|
29
|
+
...script_fn_helpers_1.ScriptFnHelpers.buildPlatformFns(this.executor, registry),
|
|
30
|
+
callSql: (method, ...args) => this.executor.invokeMethod(this.sqlService, method, args),
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
31
33
|
});
|
|
32
34
|
if (!result.ok) {
|
|
33
35
|
global.console.error(`ExecuteCodeFix: script execution failed: ${result.error}`);
|
|
@@ -38,39 +40,6 @@ class ExecuteCodeFix {
|
|
|
38
40
|
const logContext = result.context?.logContext ?? {};
|
|
39
41
|
return this.close(logContext);
|
|
40
42
|
}
|
|
41
|
-
buildHelpers() {
|
|
42
|
-
return {
|
|
43
|
-
hasEntity: (sourceType) => !!platform_utility_1.PlatformUtility.getEntity(sourceType),
|
|
44
|
-
hasService: (hash) => !!platform_utility_1.PlatformUtility.getService(hash),
|
|
45
|
-
hasJob: (hash) => !!platform_utility_1.PlatformUtility.getJob(hash),
|
|
46
|
-
callEntity: (sourceType, method, ...args) => {
|
|
47
|
-
const entity = platform_utility_1.PlatformUtility.getEntity(sourceType);
|
|
48
|
-
if (!entity)
|
|
49
|
-
throw new operation_exception_1.OperationException(`unknown entity "${sourceType}"`);
|
|
50
|
-
return this.executor.invokeMethod(entity, method, args);
|
|
51
|
-
},
|
|
52
|
-
callService: (hash, method, ...args) => {
|
|
53
|
-
const service = platform_utility_1.PlatformUtility.getService(hash);
|
|
54
|
-
if (!service)
|
|
55
|
-
throw new operation_exception_1.OperationException(`unknown service "${hash}"`);
|
|
56
|
-
return this.executor.invokeMethod(service, method, args);
|
|
57
|
-
},
|
|
58
|
-
callSql: (method, ...args) => this.executor.invokeMethod(this.sqlService, method, args),
|
|
59
|
-
dispatchJob: async (sourceType, data, delay = 0) => {
|
|
60
|
-
const job = platform_utility_1.PlatformUtility.getJob(sourceType);
|
|
61
|
-
if (!job)
|
|
62
|
-
return null;
|
|
63
|
-
const dispatched = await job.dispatch(data, { delay });
|
|
64
|
-
return dispatched?.id ?? null;
|
|
65
|
-
},
|
|
66
|
-
getEntity: () => {
|
|
67
|
-
throw new operation_exception_1.OperationException('fn.getEntity was removed for sandbox safety — use fn.callEntity(sourceType, method, ...args)');
|
|
68
|
-
},
|
|
69
|
-
getService: () => {
|
|
70
|
-
throw new operation_exception_1.OperationException('fn.getService was removed for sandbox safety — use fn.callService(hash, method, ...args)');
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
43
|
async init(script, data) {
|
|
75
44
|
const log = code_fix_log_entity_1.CodeFixLogEntity.create({ script_id: script.id, data });
|
|
76
45
|
log.start_time = new Date();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.code.fix.js","sourceRoot":"","sources":["../../../src/system/libraries/execute.code.fix.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"execute.code.fix.js","sourceRoot":"","sources":["../../../src/system/libraries/execute.code.fix.ts"],"names":[],"mappings":";;;AACA,yEAAmE;AACnE,+EAAyE;AACzE,2EAAsE;AACtE,2DAAsD;AAgBtD,MAAa,cAAc;IAUvB,YAA+B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QANpC,aAAQ,GAAG,IAAI,mDAAuB,EAAE,CAAC;IAMF,CAAC;IAQzD,KAAK,CAAC,OAAO,CAAC,UAAkB,EAAE,OAAY;QAC1C,MAAM,MAAM,GAAG,MAAM,4CAAmB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC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I,EAAE,CAAC;QAC5F,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IASO,KAAK,CAAC,IAAI,CAAC,MAA2B,EAAE,IAAS;QACrD,MAAM,GAAG,GAAG,sCAAgB,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,GAAG,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAQO,KAAK,CAAC,KAAK,CAAC,OAAkC;QAClD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;CACJ;AAjGD,wCAiGC"}
|
|
@@ -14,5 +14,6 @@ export * from './process.menu.creation';
|
|
|
14
14
|
export * from './process.script.execution';
|
|
15
15
|
export * from './report.batch.paginator';
|
|
16
16
|
export * from './sandboxed.script.executor';
|
|
17
|
+
export * from './script.fn.helpers';
|
|
17
18
|
export * from './security.rule.evaluator';
|
|
18
19
|
export * from './sync.dynamo.tables';
|
|
@@ -30,6 +30,7 @@ __exportStar(require("./process.menu.creation"), exports);
|
|
|
30
30
|
__exportStar(require("./process.script.execution"), exports);
|
|
31
31
|
__exportStar(require("./report.batch.paginator"), exports);
|
|
32
32
|
__exportStar(require("./sandboxed.script.executor"), exports);
|
|
33
|
+
__exportStar(require("./script.fn.helpers"), exports);
|
|
33
34
|
__exportStar(require("./security.rule.evaluator"), exports);
|
|
34
35
|
__exportStar(require("./sync.dynamo.tables"), exports);
|
|
35
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AAAA,kEAAgD;AAAA,mDAAiC;AAAA,mDAAiC;AAAA,2DAAyC;AAAA,+DAA6C;AAAA,qDAAmC;AAAA,uDAAqC;AAAA,sEAAoD;AAAA,qDAAmC;AAAA,4DAA0C;AAAA,+CAA6B;AAAA,0DAAwC;AAAA,6DAA2C;AAAA,2DAAyC;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,uDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AAAA,kEAAgD;AAAA,mDAAiC;AAAA,mDAAiC;AAAA,2DAAyC;AAAA,+DAA6C;AAAA,qDAAmC;AAAA,uDAAqC;AAAA,sEAAoD;AAAA,qDAAmC;AAAA,4DAA0C;AAAA,+CAA6B;AAAA,0DAAwC;AAAA,6DAA2C;AAAA,2DAAyC;AAAA,8DAA4C;AAAA,sDAAoC;AAAA,4DAA0C;AAAA,uDAAoC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProcessScriptExecution = void 0;
|
|
4
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
|
5
|
-
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
|
6
4
|
const sandboxed_script_executor_1 = require("./sandboxed.script.executor");
|
|
5
|
+
const script_fn_helpers_1 = require("./script.fn.helpers");
|
|
7
6
|
class ProcessScriptExecution {
|
|
8
7
|
constructor() {
|
|
9
8
|
this.executor = new sandboxed_script_executor_1.SandboxedScriptExecutor();
|
|
@@ -15,10 +14,10 @@ class ProcessScriptExecution {
|
|
|
15
14
|
const result = await this.executor.executeAsync(`(async () => {${script}})()`, {
|
|
16
15
|
timeoutMs: 5_000,
|
|
17
16
|
context: { data: context?.data },
|
|
18
|
-
bridge: {
|
|
17
|
+
bridge: (registry) => ({
|
|
19
18
|
ctxFn: context?.fn ?? {},
|
|
20
|
-
fn: this.
|
|
21
|
-
},
|
|
19
|
+
fn: script_fn_helpers_1.ScriptFnHelpers.buildPlatformFns(this.executor, registry),
|
|
20
|
+
}),
|
|
22
21
|
});
|
|
23
22
|
if (!result.ok) {
|
|
24
23
|
global.console.error(`ProcessScriptExecution: script execution failed: ${result.error}`);
|
|
@@ -27,41 +26,6 @@ class ProcessScriptExecution {
|
|
|
27
26
|
this.executor.writeBack(context?.data, result.context.data);
|
|
28
27
|
return result.value;
|
|
29
28
|
}
|
|
30
|
-
buildHelpers() {
|
|
31
|
-
return {
|
|
32
|
-
hasEntity: (sourceType) => !!platform_utility_1.PlatformUtility.getEntity(sourceType),
|
|
33
|
-
hasService: (hash) => !!platform_utility_1.PlatformUtility.getService(hash),
|
|
34
|
-
hasJob: (hash) => !!platform_utility_1.PlatformUtility.getJob(hash),
|
|
35
|
-
callEntity: (sourceType, method, ...args) => {
|
|
36
|
-
const entity = platform_utility_1.PlatformUtility.getEntity(sourceType);
|
|
37
|
-
if (!entity)
|
|
38
|
-
throw new operation_exception_1.OperationException(`unknown entity "${sourceType}"`);
|
|
39
|
-
return this.executor.invokeMethod(entity, method, args);
|
|
40
|
-
},
|
|
41
|
-
callService: (hash, method, ...args) => {
|
|
42
|
-
const service = platform_utility_1.PlatformUtility.getService(hash);
|
|
43
|
-
if (!service)
|
|
44
|
-
throw new operation_exception_1.OperationException(`unknown service "${hash}"`);
|
|
45
|
-
return this.executor.invokeMethod(service, method, args);
|
|
46
|
-
},
|
|
47
|
-
dispatchJob: async (sourceType, data, delay = 0) => {
|
|
48
|
-
const job = platform_utility_1.PlatformUtility.getJob(sourceType);
|
|
49
|
-
if (!job)
|
|
50
|
-
return;
|
|
51
|
-
const dispatched = await job.dispatch(data, { delay });
|
|
52
|
-
return dispatched?.id ?? null;
|
|
53
|
-
},
|
|
54
|
-
getEntity: () => {
|
|
55
|
-
throw new operation_exception_1.OperationException('fn.getEntity was removed for sandbox safety — use fn.callEntity(sourceType, method, ...args)');
|
|
56
|
-
},
|
|
57
|
-
getService: () => {
|
|
58
|
-
throw new operation_exception_1.OperationException('fn.getService was removed for sandbox safety — use fn.callService(hash, method, ...args)');
|
|
59
|
-
},
|
|
60
|
-
getJob: () => {
|
|
61
|
-
throw new operation_exception_1.OperationException('fn.getJob was removed for sandbox safety — use fn.hasJob(hash) / fn.dispatchJob(hash, data, delay)');
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
29
|
}
|
|
66
30
|
exports.ProcessScriptExecution = ProcessScriptExecution;
|
|
67
31
|
//# sourceMappingURL=process.script.execution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.script.execution.js","sourceRoot":"","sources":["../../../src/system/libraries/process.script.execution.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"process.script.execution.js","sourceRoot":"","sources":["../../../src/system/libraries/process.script.execution.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AACtE,2DAAsD;AAWtD,MAAa,sBAAsB;IAAnC;QACqB,aAAQ,GAAG,IAAI,mDAAuB,EAAE,CAAC;IAsC9D,CAAC;IA9BG,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAY;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IASO,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAY;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,iBAAiB,MAAM,MAAM,EAAE;YAC3E,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;YAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBACnB,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE;gBACxB,EAAE,EAAE,mCAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAChE,CAAC;SACL,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,oDAAoD,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACzF,OAAO;QACX,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAG,MAAM,CAAC,OAAe,CAAC,IAAI,CAAC,CAAC;QAErE,OAAO,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC;CACJ;AAvCD,wDAuCC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface SandboxOptionsInterface {
|
|
2
2
|
timeoutMs?: number;
|
|
3
3
|
context?: Record<string, unknown>;
|
|
4
|
-
bridge?: Record<string, unknown
|
|
4
|
+
bridge?: Record<string, unknown> | ((registry: Map<string, (...args: any[]) => any>) => Record<string, unknown>);
|
|
5
5
|
}
|
|
6
6
|
export interface SandboxResultInterface<T = unknown> {
|
|
7
7
|
ok: boolean;
|
|
@@ -17,6 +17,10 @@ export declare class SandboxedScriptExecutor {
|
|
|
17
17
|
execute(script: string, options?: SandboxOptionsInterface): SandboxResultInterface;
|
|
18
18
|
executeAsync(script: string, options?: SandboxOptionsInterface): Promise<SandboxResultInterface>;
|
|
19
19
|
invokeMethod(target: any, method: string, args?: any[]): any;
|
|
20
|
+
buildRemoteHandle(registry: Map<string, (...args: any[]) => any>, pathPrefix: string, target: any): Record<string, {
|
|
21
|
+
__fn__: string;
|
|
22
|
+
}>;
|
|
23
|
+
listCallableMethods(target: any): string[];
|
|
20
24
|
writeBack(target: any, source: any): void;
|
|
21
25
|
private rejectHostCallables;
|
|
22
26
|
private findHostCallable;
|
|
@@ -21,6 +21,23 @@ const SANDBOX_BOOTSTRAP = `
|
|
|
21
21
|
return JSON.parse(json);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
function materialize(node) {
|
|
25
|
+
if (node === null || typeof node !== 'object') return node;
|
|
26
|
+
|
|
27
|
+
if (Array.isArray(node)) {
|
|
28
|
+
var list = [];
|
|
29
|
+
for (var m = 0; m < node.length; m++) list.push(materialize(node[m]));
|
|
30
|
+
return list;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var keys = Object.keys(node);
|
|
34
|
+
if (keys.length === 1 && keys[0] === '__fn__' && typeof node.__fn__ === 'string') return wrap(node.__fn__);
|
|
35
|
+
|
|
36
|
+
var built = {};
|
|
37
|
+
for (var n = 0; n < keys.length; n++) built[keys[n]] = materialize(node[keys[n]]);
|
|
38
|
+
return built;
|
|
39
|
+
}
|
|
40
|
+
|
|
24
41
|
function wrap(id) {
|
|
25
42
|
return function () {
|
|
26
43
|
var payload;
|
|
@@ -42,7 +59,7 @@ const SANDBOX_BOOTSTRAP = `
|
|
|
42
59
|
out.then(
|
|
43
60
|
function (value) {
|
|
44
61
|
try {
|
|
45
|
-
resolve(decode(value));
|
|
62
|
+
resolve(materialize(decode(value)));
|
|
46
63
|
} catch (err) {
|
|
47
64
|
reject(new Error(reason(err)));
|
|
48
65
|
}
|
|
@@ -54,7 +71,7 @@ const SANDBOX_BOOTSTRAP = `
|
|
|
54
71
|
});
|
|
55
72
|
}
|
|
56
73
|
|
|
57
|
-
return decode(out);
|
|
74
|
+
return materialize(decode(out));
|
|
58
75
|
};
|
|
59
76
|
}
|
|
60
77
|
|
|
@@ -182,6 +199,30 @@ class SandboxedScriptExecutor {
|
|
|
182
199
|
throw new operation_exception_1.OperationException(`sandbox bridge: "${method}" is not callable from a script`);
|
|
183
200
|
return member.apply(target, Array.isArray(args) ? args : []);
|
|
184
201
|
}
|
|
202
|
+
buildRemoteHandle(registry, pathPrefix, target) {
|
|
203
|
+
const out = {};
|
|
204
|
+
for (const method of this.listCallableMethods(target)) {
|
|
205
|
+
const id = `${pathPrefix}.${method}`;
|
|
206
|
+
registry.set(id, (...args) => this.invokeMethod(target, method, args));
|
|
207
|
+
out[method] = { __fn__: id };
|
|
208
|
+
}
|
|
209
|
+
return out;
|
|
210
|
+
}
|
|
211
|
+
listCallableMethods(target) {
|
|
212
|
+
const methods = new Set();
|
|
213
|
+
const builtins = [Object.prototype, Function.prototype, Array.prototype];
|
|
214
|
+
let node = target;
|
|
215
|
+
while (node && !builtins.includes(node)) {
|
|
216
|
+
for (const key of Object.getOwnPropertyNames(node)) {
|
|
217
|
+
if (key.startsWith('_') || SandboxedScriptExecutor.DENIED_MEMBERS.includes(key))
|
|
218
|
+
continue;
|
|
219
|
+
if (typeof node[key] === 'function')
|
|
220
|
+
methods.add(key);
|
|
221
|
+
}
|
|
222
|
+
node = Object.getPrototypeOf(node);
|
|
223
|
+
}
|
|
224
|
+
return [...methods];
|
|
225
|
+
}
|
|
185
226
|
writeBack(target, source) {
|
|
186
227
|
if (!target || typeof target !== 'object')
|
|
187
228
|
return;
|
|
@@ -252,7 +293,8 @@ class SandboxedScriptExecutor {
|
|
|
252
293
|
const timeoutMs = options.timeoutMs ?? 1000;
|
|
253
294
|
const snapshot = this.plainContext(options);
|
|
254
295
|
const registry = new Map();
|
|
255
|
-
const
|
|
296
|
+
const bridgeSource = options.bridge ?? {};
|
|
297
|
+
const bridge = typeof bridgeSource === 'function' ? bridgeSource(registry) : bridgeSource;
|
|
256
298
|
const transfer = JSON.stringify(snapshot);
|
|
257
299
|
const shape = JSON.stringify(this.describeBridge(bridge, registry, 'b', 0, new WeakSet()) ?? {});
|
|
258
300
|
const sandbox = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandboxed.script.executor.js","sourceRoot":"","sources":["../../../src/system/libraries/sandboxed.script.executor.ts"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cL,0DAscC;AApc2B,sCAAc,GAAG;IACrC,aAAa;IACb,WAAW;IACX,WAAW;IACX,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;CACT,CAAC;AAGsB,qCAAa,GAAG,kEAAkE,CAAC;AAGnF,uCAAe,GAAG,EAAE,CAAC;AAGrB,wCAAgB,GAAG,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"sandboxed.script.executor.js","sourceRoot":"","sources":["../../../src/system/libraries/sandboxed.script.executor.ts"],"names":[],"mappings":";;;AAAA,2BAAiD;AACjD,qFAAiF;AA0EjF,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGzB,CAAC;AASF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;CAiBtB,CAAC;AA6BF,MAAa,uBAAuB;IAmChC,OAAO,CAAC,MAAc,EAAE,UAAmC,EAAE;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAE9B,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;QAExB,IAAI,QAAyB,CAAC;QAC9B,IAAI,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,YAA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AQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;gBAAE,OAAO,IAAI,CAAC;YACpE,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAMO,MAAM,CAAC,GAAQ;QACnB,IAAI,CAAC;YACD,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,0BAA0B,CAAC;QACtC,CAAC;IACL,CAAC;;AA1eL,0DA2eC;AAze2B,sCAAc,GAAG;IACrC,aAAa;IACb,WAAW;IACX,WAAW;IACX,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;CACT,CAAC;AAGsB,qCAAa,GAAG,kEAAkE,CAAC;AAGnF,uCAAe,GAAG,EAAE,CAAC;AAGrB,wCAAgB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseService } from '../services/base.service';
|
|
2
|
+
import { SandboxedScriptExecutor } from './sandboxed.script.executor';
|
|
3
|
+
type BridgeRegistry = Map<string, (...args: any[]) => any>;
|
|
4
|
+
export declare class ScriptFnHelpers {
|
|
5
|
+
static buildPlatformFns(executor: SandboxedScriptExecutor, registry: BridgeRegistry, pathPrefix?: string): {
|
|
6
|
+
hasEntity: (sourceType: string) => boolean;
|
|
7
|
+
hasService: (hash: string) => boolean;
|
|
8
|
+
hasJob: (hash: string) => boolean;
|
|
9
|
+
callEntity: (sourceType: string, method: string, ...args: any[]) => any;
|
|
10
|
+
callService: (hash: string, method: string, ...args: any[]) => any;
|
|
11
|
+
dispatchJob: (sourceType: string, data: any, delay?: number) => Promise<any>;
|
|
12
|
+
getEntity: (sourceType: string) => Record<string, {
|
|
13
|
+
__fn__: string;
|
|
14
|
+
}>;
|
|
15
|
+
getService: (hash: string) => Record<string, {
|
|
16
|
+
__fn__: string;
|
|
17
|
+
}>;
|
|
18
|
+
getJob: (hash: string) => Record<string, {
|
|
19
|
+
__fn__: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
static buildBusinessRuleFns(executor: SandboxedScriptExecutor, registry: BridgeRegistry, commonService: BaseService, pathPrefix?: string): {
|
|
23
|
+
hasService: (identifier: string) => Promise<boolean>;
|
|
24
|
+
hasEntity: (identifier: string) => Promise<boolean>;
|
|
25
|
+
callService: (identifier: string, method: string, ...args: any[]) => Promise<any>;
|
|
26
|
+
callEntity: (identifier: string, method: string, ...args: any[]) => Promise<any>;
|
|
27
|
+
getServiceInstance: (identifier: string) => Promise<Record<string, {
|
|
28
|
+
__fn__: string;
|
|
29
|
+
}>>;
|
|
30
|
+
getEntityInstance: (identifier: string) => Promise<Record<string, {
|
|
31
|
+
__fn__: string;
|
|
32
|
+
}>>;
|
|
33
|
+
checkOrSetRecord: () => never;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScriptFnHelpers = void 0;
|
|
4
|
+
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
|
5
|
+
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
|
6
|
+
class ScriptFnHelpers {
|
|
7
|
+
static buildPlatformFns(executor, registry, pathPrefix = 'b.fn') {
|
|
8
|
+
const remote = (label, target, name) => {
|
|
9
|
+
if (!target)
|
|
10
|
+
throw new operation_exception_1.OperationException(`unknown ${name}`);
|
|
11
|
+
return executor.buildRemoteHandle(registry, `${pathPrefix}.${label}`, target);
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
hasEntity: (sourceType) => !!platform_utility_1.PlatformUtility.getEntity(sourceType),
|
|
15
|
+
hasService: (hash) => !!platform_utility_1.PlatformUtility.getService(hash),
|
|
16
|
+
hasJob: (hash) => !!platform_utility_1.PlatformUtility.getJob(hash),
|
|
17
|
+
callEntity: (sourceType, method, ...args) => {
|
|
18
|
+
const entity = platform_utility_1.PlatformUtility.getEntity(sourceType);
|
|
19
|
+
if (!entity)
|
|
20
|
+
throw new operation_exception_1.OperationException(`unknown entity "${sourceType}"`);
|
|
21
|
+
return executor.invokeMethod(entity, method, args);
|
|
22
|
+
},
|
|
23
|
+
callService: (hash, method, ...args) => {
|
|
24
|
+
const service = platform_utility_1.PlatformUtility.getService(hash);
|
|
25
|
+
if (!service)
|
|
26
|
+
throw new operation_exception_1.OperationException(`unknown service "${hash}"`);
|
|
27
|
+
return executor.invokeMethod(service, method, args);
|
|
28
|
+
},
|
|
29
|
+
dispatchJob: async (sourceType, data, delay = 0) => {
|
|
30
|
+
const job = platform_utility_1.PlatformUtility.getJob(sourceType);
|
|
31
|
+
if (!job)
|
|
32
|
+
return null;
|
|
33
|
+
const dispatched = await job.dispatch(data, { delay });
|
|
34
|
+
return dispatched?.id ?? null;
|
|
35
|
+
},
|
|
36
|
+
getEntity: (sourceType) => remote(`entity.${sourceType}`, platform_utility_1.PlatformUtility.getEntity(sourceType), `entity "${sourceType}"`),
|
|
37
|
+
getService: (hash) => remote(`service.${hash}`, platform_utility_1.PlatformUtility.getService(hash), `service "${hash}"`),
|
|
38
|
+
getJob: (hash) => remote(`job.${hash}`, platform_utility_1.PlatformUtility.getJob(hash), `job "${hash}"`),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static buildBusinessRuleFns(executor, registry, commonService, pathPrefix = 'b.fn') {
|
|
42
|
+
const resolveService = async (identifier) => {
|
|
43
|
+
const service = await commonService.getServiceInstance(identifier);
|
|
44
|
+
if (!service)
|
|
45
|
+
throw new operation_exception_1.OperationException(`unknown service "${identifier}"`);
|
|
46
|
+
return executor.buildRemoteHandle(registry, `${pathPrefix}.service.${identifier}`, service);
|
|
47
|
+
};
|
|
48
|
+
const resolveEntity = async (identifier) => {
|
|
49
|
+
const entity = await commonService.getEntityInstance(identifier);
|
|
50
|
+
if (!entity)
|
|
51
|
+
throw new operation_exception_1.OperationException(`unknown entity "${identifier}"`);
|
|
52
|
+
return executor.buildRemoteHandle(registry, `${pathPrefix}.entity.${identifier}`, entity);
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
hasService: async (identifier) => !!(await commonService.getServiceInstance(identifier)),
|
|
56
|
+
hasEntity: async (identifier) => !!(await commonService.getEntityInstance(identifier)),
|
|
57
|
+
callService: async (identifier, method, ...args) => {
|
|
58
|
+
const service = await commonService.getServiceInstance(identifier);
|
|
59
|
+
if (!service)
|
|
60
|
+
throw new operation_exception_1.OperationException(`unknown service "${identifier}"`);
|
|
61
|
+
return executor.invokeMethod(service, method, args);
|
|
62
|
+
},
|
|
63
|
+
callEntity: async (identifier, method, ...args) => {
|
|
64
|
+
const entity = await commonService.getEntityInstance(identifier);
|
|
65
|
+
if (!entity)
|
|
66
|
+
throw new operation_exception_1.OperationException(`unknown entity "${identifier}"`);
|
|
67
|
+
return executor.invokeMethod(entity, method, args);
|
|
68
|
+
},
|
|
69
|
+
getServiceInstance: (identifier) => resolveService(identifier),
|
|
70
|
+
getEntityInstance: (identifier) => resolveEntity(identifier),
|
|
71
|
+
checkOrSetRecord: () => {
|
|
72
|
+
throw new operation_exception_1.OperationException('fn.checkOrSetRecord is not callable from a business rule script');
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.ScriptFnHelpers = ScriptFnHelpers;
|
|
78
|
+
//# sourceMappingURL=script.fn.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.fn.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AkB,EAAE,MAAc,EAAE,GAAG,IAAW,EAAE,EAAE;gBACrE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;gBACjE,IAAI,CAAC,MAAM;oBAAE,MAAM,IAAI,wCAAkB,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;gBAE5E,OAAO,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC;YACD,kBAAkB,EAAE,CAAC,UAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;YACtE,iBAAiB,EAAE,CAAC,UAAkB,EAAE,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC;YACpE,gBAAgB,EAAE,GAAG,EAAE;gBACnB,MAAM,IAAI,wCAAkB,CAAC,iEAAiE,CAAC,CAAC;YACpG,CAAC;SACJ,CAAC;IACN,CAAC;CACJ;AA3ED,0CA2EC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Upgrading to 3.x — backward compatibility and migration
|
|
2
|
+
|
|
3
|
+
`@servicelabsco/nestjs-utility-services` **3.0.0** is a security and correctness major. Most
|
|
4
|
+
breaks are **intentional and not reversible via a global flag**. This guide maps each area that
|
|
5
|
+
typically breaks consuming Finnoto apps, what changed, how to migrate, and where a **temporary**
|
|
6
|
+
escape hatch exists.
|
|
7
|
+
|
|
8
|
+
Read this **before** bumping the package version or running pending migrations.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Quick pre-flight checklist
|
|
13
|
+
|
|
14
|
+
| Step | Action |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Runtime | Move API and workers to **Node 24** (`engines: ^24.11.0`). |
|
|
17
|
+
| Internal calls | Set `INTERNAL_SERVER_KEY` in env (see below). |
|
|
18
|
+
| DB | Archive `sys_event_logs` / `sys_system_logs` if needed; schedule jsonb + refresh-token migrations. |
|
|
19
|
+
| Integrations | Audit webhooks, email-template fetch hosts, PDF HTML URL storage, stored scripts. |
|
|
20
|
+
| Auth | Expect stricter role checks and live session revocation after re-login. |
|
|
21
|
+
| Mail | SES failures now fail jobs — monitor mail logs after deploy. |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Breaker reference
|
|
26
|
+
|
|
27
|
+
### 1. `INTERNAL_SERVER_KEY` required
|
|
28
|
+
|
|
29
|
+
| | |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| **Why it hits us** | `InternalMiddleware` guards `internal/*`. The DB property `internal.server.key` is **ignored** unless you opt in. Missing env → internal service-to-service calls fail. |
|
|
32
|
+
| **What changed** | Secret resolution: `INTERNAL_SERVER_KEY` env first; DB fallback only when `INTERNAL_SERVER_KEY_ALLOW_DB_FALLBACK=true`. Without either, `internal/*` returns an error. |
|
|
33
|
+
| **Migrate (preferred)** | Set `INTERNAL_SERVER_KEY` in the API (and any caller) secret store. Rotate off the admin-editable DB row. |
|
|
34
|
+
| **Temporary compat** | `INTERNAL_SERVER_KEY_ALLOW_DB_FALLBACK=true` restores legacy DB lookup. **Remove once env is set** — the DB row is mutable from the admin API. |
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Production (preferred)
|
|
38
|
+
INTERNAL_SERVER_KEY=<long-random-secret>
|
|
39
|
+
|
|
40
|
+
# Transitional only
|
|
41
|
+
INTERNAL_SERVER_KEY_ALLOW_DB_FALLBACK=true
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Files:** `src/auth/middlewares/internal.middleware.ts`, `src/app.module.ts` (`internal/*` routes).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### 2. SSRF guard on `RemoteRequestService`
|
|
49
|
+
|
|
50
|
+
| | |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| **Why it hits us** | Slack, Zoho, Amazon, FCM, webhooks, and email-template HTTP fetch go through `RemoteRequestService`. Public HTTPS still works. **Loopback, RFC1918, link-local, and cloud metadata IPs are blocked** unless explicitly allowed. |
|
|
53
|
+
| **What changed** | `assertSafeRequestUrl` on initial URL and redirect hops. `sendThroughAxios` throws `OperationException`. **`getRawResponse` never throws** — blocked URL → `{ success: false, data: { error: … } }` (easy to miss in logs). |
|
|
54
|
+
| **Silent failure paths** | Callers using `getRawResponse` without checking `success`. Watch **`email.template.host.server`** (and similar sys properties) and tenant webhooks aimed at private IPs. MCP loopback uses `fetch`, not this service. |
|
|
55
|
+
| **Migrate** | Point integrations at public URLs, **or** pass `allowInternal: true` on that specific request (options or `RemoteRequestConfigDto`). |
|
|
56
|
+
| **Temporary compat** | **No global disable.** Per-request `allowInternal: true` only — deliberate opt-in per integration. |
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// Example: intentional call to an internal webhook on a private host
|
|
60
|
+
await remoteRequestService.getRawResponse(
|
|
61
|
+
{ method: 'POST', url: 'http://10.0.0.5/hook', data: payload, allowInternal: true },
|
|
62
|
+
sourceConfig,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// Always check getRawResponse results
|
|
66
|
+
const res = await remoteRequestService.getRawResponse(options, source);
|
|
67
|
+
if (!res?.success) {
|
|
68
|
+
// was silently ignored before when URL was blocked
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Files:** `src/platformUtility/services/remote.request.service.ts`, `src/platformUtility/dtos/remote.request.config.dto.ts`.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### 3. PDF HTML URLs (public by default, optional private)
|
|
77
|
+
|
|
78
|
+
| | |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| **Why it hits us** | If you opted into `{ private: true }` on `PdfService.getHtmlUrl` / `uploadHtml`, the object is **`ACL: private`** and the returned URL is a **presigned GET** that expires after TTL. Anything storing that URL as durable state breaks after TTL. |
|
|
81
|
+
| **What changed (3.0.0)** | 3.0.0 briefly defaulted to private + presigned. **Current default restores legacy behaviour:** `public-read` ACL and a **permanent** object URL (same as pre-3.0 slabs). High-entropy object names remain (U-S6). |
|
|
82
|
+
| **Migrate** | No change needed for typical callers — default matches old slabs. For sensitive documents, pass `{ private: true }` and store bucket + key, re-sign at read time. |
|
|
83
|
+
| **Temporary compat** | Default is already public. Private mode: `{ private: true }` on `uploadHtml` / `getHtmlUrl` / `getUrl`. TTL when private: sys property `pdf.html.signed.url.ttl.seconds` (**900s** default). |
|
|
84
|
+
| **Constructor** | Manual `new PdfService(...)` requires a 5th arg: `StorageService`. DI-wired apps are unaffected. |
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// Default — permanent public URL (legacy)
|
|
88
|
+
await pdfService.getHtmlUrl('invoice', data, 'tmp/invoices');
|
|
89
|
+
|
|
90
|
+
// Sensitive — private object + presigned URL for the Lambda
|
|
91
|
+
await pdfService.getHtmlUrl('invoice', data, 'tmp/invoices', { private: true });
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Files:** `src/platformUtility/services/pdf.service.ts`, `src/platformUtility/interfaces/html.pdf.upload.options.interface.ts`.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### 4. Stored scripts — `fn.getService` / `fn.getEntity` / `fn.getJob`
|
|
99
|
+
|
|
100
|
+
| | |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| **Why it hits us** | Code-fix scripts, report scripts, and business-rule eval sites that still call the old helpers **throw at runtime** (not at compile time). |
|
|
103
|
+
| **What changed** | Removed from sandbox: `fn.getEntity`, `fn.getService`, `fn.getJob`, `fn.getServiceInstance`, `fn.getEntityInstance`. Replacement API returns plain data only (no host object escape). |
|
|
104
|
+
| **Migrate** | |
|
|
105
|
+
|
|
106
|
+
| Old | New |
|
|
107
|
+
| --- | --- |
|
|
108
|
+
| `fn.getService('hash').method()` | `fn.callService('hash', 'method', ...args)` |
|
|
109
|
+
| `fn.getEntity('type').method()` | `fn.callEntity('type', 'method', ...args)` |
|
|
110
|
+
| `fn.getJob('hash').dispatch(data)` | `fn.dispatchJob('hash', data, delay?)` → returns job id |
|
|
111
|
+
| `fn.getServiceInstance(...)` | `fn.callService(...)` (business rules) |
|
|
112
|
+
|
|
113
|
+
| **Temporary compat** | Legacy `fn.getEntity` / `fn.getService` / `fn.getJob` (and business-rule `getServiceInstance` / `getEntityInstance`) are restored via **remote handles** — method calls work as before; host objects stay on the host. Prefer `fn.call*` for new scripts. |
|
|
114
|
+
|
|
115
|
+
**Files:** `src/system/libraries/code.evaluator.ts`, `process.script.execution.ts`, `business.rule.query.evaluator.ts`.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### 5. Auth fail-closed (`hasRoleIdentifier` and related)
|
|
120
|
+
|
|
121
|
+
| | |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| **Why it hits us** | Listing overrides, data access, approval delegation, and similar paths using `AccessService.hasRoleIdentifier` (and related helpers) **deny when role/permission arrays are missing**. Previously `undefined !== -1` accidentally **granted** access. |
|
|
124
|
+
| **What changed** | `has()` requires a real array containing the identifier. Non-admin `getUserObject()` omits role arrays — checks now correctly deny. `public` means **authenticated**, not anonymous. |
|
|
125
|
+
| **Migrate** | Assign explicit roles/permissions on users. Use `public` only where any logged-in user should pass. Audit custom controllers that assumed “no roles = allow”. |
|
|
126
|
+
| **Temporary compat** | **None** — privilege-escalation fix (FIN-246). |
|
|
127
|
+
|
|
128
|
+
**Files:** `src/auth/services/access.service.ts`.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### 6. Revoked sessions reject (logout works)
|
|
133
|
+
|
|
134
|
+
| | |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| **Why it hits us** | After logout or admin revoke, the access token now yields **`AccessException('This session has been revoked…')`** instead of continuing anonymously. |
|
|
137
|
+
| **What changed** | Login mints `session_identifier` in JWT + DB row. `JwtMiddleware` validates via `AuthService.validateSession()`. Refresh reuse/revoke → `AccessException`. |
|
|
138
|
+
| **Migrate** | Clients must treat 401/403 on revoked tokens as “force re-login”. No server-side toggle. |
|
|
139
|
+
| **Legacy tokens** | JWTs issued **before** upgrade without `session_identifier` cannot be revoked until the user re-logins. |
|
|
140
|
+
| **Temporary compat** | **None** — previous anonymous fall-through was the bug (FIN-245). |
|
|
141
|
+
|
|
142
|
+
**Files:** `src/auth/middlewares/jwt.middleware.ts`, `src/auth/services/auth.service.ts`.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### 7. SES send now rejects
|
|
147
|
+
|
|
148
|
+
| | |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
| **Why it hits us** | Email jobs that depended on SES “succeeding” even when AWS rejected the send will **start failing for real**. Mail logs no longer get a fake success identifier. |
|
|
151
|
+
| **What changed** | `ProcessSesMail` propagates SDK errors (aligned with SMTP and SES Raw). Previously: `console.log(err); return err` — looked like success. |
|
|
152
|
+
| **Migrate** | Fix SES config (identity, sandbox, quotas). Handle rejection in job retry/alerts. |
|
|
153
|
+
| **Temporary compat** | **None** — correctness fix. |
|
|
154
|
+
|
|
155
|
+
**Files:** `src/platformUtility/libraries/process.ses.mail.ts`.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### 8. Database migrations
|
|
160
|
+
|
|
161
|
+
| | |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| **Why it hits us** | Pending NU migrations on deploy can drop data, lock hot tables, or fail on restricted Postgres roles. |
|
|
164
|
+
| **What changed** | |
|
|
165
|
+
|
|
166
|
+
| Migration | Effect |
|
|
167
|
+
| --- | --- |
|
|
168
|
+
| `1779685411636` / `1779685411637` | **Drop** `sys_event_logs`, `sys_system_logs` — data gone; `down()` recreates empty shells only. |
|
|
169
|
+
| `1780002352495` | **json → jsonb** on ~103 columns; `ACCESS EXCLUSIVE` locks; skips already-jsonb (re-runnable). |
|
|
170
|
+
| `1779807657061` | Refresh tokens: plaintext → hash; needs **`pgcrypto`** (or PG11+ `sha256()`). |
|
|
171
|
+
|
|
172
|
+
| **Migrate** | Archive log tables before migrate. Run jsonb in a **maintenance window**. Pre-create `CREATE EXTENSION IF NOT EXISTS pgcrypto` on locked-down DBs. |
|
|
173
|
+
| **Temporary compat** | `MIGRATION_LOCK_TIMEOUT` (default `5s`) — increase e.g. `30s` for lock acquisition only. **No skip flags** for drops or pgcrypto. |
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Optional: jsonb migration lock wait
|
|
177
|
+
MIGRATION_LOCK_TIMEOUT=30s
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Scripts:** `scripts/verify-jsonb-migration.ts`, `docs/migrations.md`.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Escape hatches summary
|
|
185
|
+
|
|
186
|
+
| Area | Temporary escape | Remove when |
|
|
187
|
+
| --- | --- | --- |
|
|
188
|
+
| Internal auth | `INTERNAL_SERVER_KEY_ALLOW_DB_FALLBACK=true` | `INTERNAL_SERVER_KEY` set in env |
|
|
189
|
+
| SSRF | Per-request `allowInternal: true` | Integration uses public URL or approved internal route |
|
|
190
|
+
| PDF URLs | Default public-read; `{ private: true }` for presigned | Sensitive docs use private mode |
|
|
191
|
+
| Scripts | Legacy `fn.get*` restored via remote handles | New scripts can still use `fn.call*` |
|
|
192
|
+
| Access checks | — | Roles assigned explicitly |
|
|
193
|
+
| Sessions | — | Clients handle revoke as re-login |
|
|
194
|
+
| SES | — | SES config fixed |
|
|
195
|
+
| Migrations | `MIGRATION_LOCK_TIMEOUT` | Maintenance window complete |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Other 3.0 breaks (see CHANGELOG)
|
|
200
|
+
|
|
201
|
+
- **Node 24** required.
|
|
202
|
+
- **`MAIL_ATTACHMENT_LOCAL_ROOT`** — local attachment reads restricted to this directory (default `os.tmpdir()`).
|
|
203
|
+
- **CORS** — boot requires `CORS_ORIGINS` or `CORS_ALLOW_ANY_ORIGIN=true` (`src/config/cors.config.ts`).
|
|
204
|
+
- **Sentry** — see [sentry-reporting.md](./sentry-reporting.md) for consumer wiring.
|
|
205
|
+
- **Removed types/services** — `LoggerService`, `EventLogEntity`, `CommonJob` logging helpers, etc. (full list in `CHANGELOG.md`).
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Suggested upgrade order
|
|
210
|
+
|
|
211
|
+
1. Deploy **env** changes (`INTERNAL_SERVER_KEY`, CORS, Node 24) without code bump — validate internal routes.
|
|
212
|
+
2. Run **DB archive + migrations** in maintenance window.
|
|
213
|
+
3. Bump **package** to 3.x; deploy API then workers.
|
|
214
|
+
4. Smoke-test: internal token, one webhook, one PDF flow, one script, logout, one SES send.
|
|
215
|
+
5. Remove transitional flags (`INTERNAL_SERVER_KEY_ALLOW_DB_FALLBACK`, per-call `allowInternal` where no longer needed).
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Related docs
|
|
220
|
+
|
|
221
|
+
- [CHANGELOG.md](../CHANGELOG.md) — full breaking change list
|
|
222
|
+
- [sentry-reporting.md](./sentry-reporting.md) — Sentry integration for consuming apps
|
|
223
|
+
- [migrations.md](./migrations.md) — TypeORM migration workflow
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicelabsco/nestjs-utility-services",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "NestJS generic packages to support development",
|
|
5
5
|
"author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"README.md",
|
|
12
12
|
"CHANGELOG.md",
|
|
13
13
|
"LICENSE",
|
|
14
|
-
"docs/sentry-reporting.md"
|
|
14
|
+
"docs/sentry-reporting.md",
|
|
15
|
+
"docs/upgrade-3.0-backward-compatibility.md"
|
|
15
16
|
],
|
|
16
17
|
"types": "dist/index.d.ts",
|
|
17
18
|
"scripts": {
|