@dawntech/dwntbots-services 0.0.91 → 0.0.92
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/package.json +13 -10
- package/src/lib/blip/BlipBuilder/BlipBuilderTranspilation.js +4 -2
- package/src/lib/blip/BlipBuilder/BlipBuilderTranspilation.js.map +1 -1
- package/src/lib/blip/BlipBuilder/features/Feature.js.map +1 -1
- package/src/lib/blip/BlipBuilder/features/InactivityFeature.js +1 -1
- package/src/lib/blip/BlipBuilder/features/InactivityFeature.js.map +1 -1
- package/src/lib/blip/BlipBuilder/features/PositionFeature.js +2 -2
- package/src/lib/blip/BlipBuilder/features/PositionFeature.js.map +1 -1
- package/src/lib/blip/BlipBuilder/features/SDKFeature.js +12 -9
- package/src/lib/blip/BlipBuilder/features/SDKFeature.js.map +1 -1
- package/src/lib/blip/BlipBuilder/features/actions/fallback.d.ts +2 -2
- package/src/lib/blip/BlipBuilder/features/actions/fallback.js +12 -25
- package/src/lib/blip/BlipBuilder/features/actions/fallback.js.map +1 -1
- package/src/lib/blip/BlipBuilder/features/actions/global.d.ts +1 -1
- package/src/lib/blip/BlipBuilder/features/actions/global.js +6 -15
- package/src/lib/blip/BlipBuilder/features/actions/global.js.map +1 -1
- package/src/lib/blip/BlipBuilder/index.d.ts +3 -3
- package/src/lib/blip/BlipBuilder/index.js +2 -3
- package/src/lib/blip/BlipBuilder/index.js.map +1 -1
- package/src/lib/blip/BlipBuilder/models/_base.js +3 -3
- package/src/lib/blip/BlipBuilder/models/_base.js.map +1 -1
- package/src/lib/blip/BlipBuilder/models/base.js +3 -3
- package/src/lib/blip/BlipBuilder/models/base.js.map +1 -1
- package/src/lib/blip/BlipBuilder/models/navigation.js.map +1 -1
- package/src/lib/blip/BlipBuilder/models/tags.js +1 -1
- package/src/lib/blip/BlipBuilder/models/tags.js.map +1 -1
- package/src/lib/blip/BlipBuilder/utils.d.ts +1 -1
- package/src/lib/blip/BlipBuilder/utils.js.map +1 -1
- package/src/lib/blip/BlipService.d.ts +16 -0
- package/src/lib/blip/BlipService.js +121 -3
- package/src/lib/blip/BlipService.js.map +1 -1
- package/src/lib/blip/BlipTransport.js +2 -2
- package/src/lib/blip/BlipTransport.js.map +1 -1
- package/src/lib/blip/{BlipBuilder/BlipBotDiff.d.ts → BotDiff/BotDiff.d.ts} +24 -11
- package/src/lib/blip/{BlipBuilder/BlipBotDiff.js → BotDiff/BotDiff.js} +57 -23
- package/src/lib/blip/BotDiff/BotDiff.js.map +1 -0
- package/src/lib/blip/BotDiff/index.d.ts +2 -0
- package/src/lib/blip/BotDiff/index.js +8 -0
- package/src/lib/blip/BotDiff/index.js.map +1 -0
- package/src/lib/blip/{BlipBuilder → BuilderSanitize}/BlipBuilderSanitize.d.ts +1 -0
- package/src/lib/blip/{BlipBuilder → BuilderSanitize}/BlipBuilderSanitize.js +16 -10
- package/src/lib/blip/BuilderSanitize/BlipBuilderSanitize.js.map +1 -0
- package/src/lib/blip/BuilderSanitize/index.d.ts +1 -0
- package/src/lib/blip/BuilderSanitize/index.js +18 -0
- package/src/lib/blip/BuilderSanitize/index.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/BlipBuilder.d.ts +96 -0
- package/src/lib/blip/DwnGridCompiler/BlipBuilder.js +443 -0
- package/src/lib/blip/DwnGridCompiler/BlipBuilder.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/DwnGridCompiler.d.ts +61 -0
- package/src/lib/blip/DwnGridCompiler/DwnGridCompiler.js +255 -0
- package/src/lib/blip/DwnGridCompiler/DwnGridCompiler.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/ExecutionLogger.d.ts +24 -0
- package/src/lib/blip/DwnGridCompiler/ExecutionLogger.js +48 -0
- package/src/lib/blip/DwnGridCompiler/ExecutionLogger.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/CoreFeature.d.ts +65 -0
- package/src/lib/blip/DwnGridCompiler/features/CoreFeature.js +408 -0
- package/src/lib/blip/DwnGridCompiler/features/CoreFeature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/Feature.d.ts +149 -0
- package/src/lib/blip/DwnGridCompiler/features/Feature.js +160 -0
- package/src/lib/blip/DwnGridCompiler/features/Feature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/InactivityFeature.d.ts +13 -0
- package/src/lib/blip/DwnGridCompiler/features/InactivityFeature.js +56 -0
- package/src/lib/blip/DwnGridCompiler/features/InactivityFeature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/LinterFeature.d.ts +38 -0
- package/src/lib/blip/DwnGridCompiler/features/LinterFeature.js +77 -0
- package/src/lib/blip/DwnGridCompiler/features/LinterFeature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/ScriptsFeature.d.ts +14 -0
- package/src/lib/blip/DwnGridCompiler/features/ScriptsFeature.js +46 -0
- package/src/lib/blip/DwnGridCompiler/features/ScriptsFeature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/TagsFeature.d.ts +30 -0
- package/src/lib/blip/DwnGridCompiler/features/TagsFeature.js +221 -0
- package/src/lib/blip/DwnGridCompiler/features/TagsFeature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/TemplatesFeature.d.ts +14 -0
- package/src/lib/blip/DwnGridCompiler/features/TemplatesFeature.js +31 -0
- package/src/lib/blip/DwnGridCompiler/features/TemplatesFeature.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/conditions.d.ts +2 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/conditions.js +45 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/conditions.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/contact.d.ts +5 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/contact.js +112 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/contact.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/content.d.ts +7 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/content.js +183 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/content.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/events.d.ts +21 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/events.js +827 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/events.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/redirect.d.ts +3 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/redirect.js +77 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/redirect.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/scripts.d.ts +14 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/scripts.js +292 -0
- package/src/lib/blip/DwnGridCompiler/features/entities/scripts.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/index.d.ts +8 -0
- package/src/lib/blip/DwnGridCompiler/features/index.js +67 -0
- package/src/lib/blip/DwnGridCompiler/features/index.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/__definitions.d.ts +830 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/__definitions.js +364 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/__definitions.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/__scripts.template.d.ts +14 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/__scripts.template.js +292 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/__scripts.template.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_bindings.d.ts +24 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_bindings.js +25 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_bindings.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_build.d.ts +2 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_build.js +8 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_build.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_types.d.ts +14 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_types.js +3 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/_types.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_error_message.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_error_message.js +46 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_error_message.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_fallback_create.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_fallback_create.js +178 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_fallback_create.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_fallback_process.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_fallback_process.js +225 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_fallback_process.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_config_pt_br.d.ts +19 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_config_pt_br.js +165 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_config_pt_br.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_core.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_core.js +411 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_core.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_dwn.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_dwn.js +1195 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_gactions_dwn.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_onboarding_reset.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_onboarding_reset.js +109 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/grid_onboarding_reset.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_console.d.ts +29 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_console.js +61 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_console.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_datetime.d.ts +5 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_datetime.js +24 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_datetime.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_enforcesate.d.ts +2 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_enforcesate.js +28 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_enforcesate.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_http.d.ts +139 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_http.js +270 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_http.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_kebabcase.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_kebabcase.js +16 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_kebabcase.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_merge.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_merge.js +64 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_merge.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_script.d.ts +2 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_script.js +148 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/libs_script.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_intent.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_intent.js +148 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_intent.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_prepare.d.ts +33 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_prepare.js +165 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_prepare.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_script_basic.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_script_basic.js +31 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_script_basic.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_script_complete.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_script_complete.js +31 -0
- package/src/lib/blip/DwnGridCompiler/features/scripts/template_script_complete.js.map +1 -0
- package/src/lib/blip/DwnGridCompiler/index.d.ts +1 -0
- package/src/lib/blip/DwnGridCompiler/index.js +18 -0
- package/src/lib/blip/DwnGridCompiler/index.js.map +1 -0
- package/src/lib/blip/WhatsAppBlipService.js +0 -2
- package/src/lib/blip/WhatsAppBlipService.js.map +1 -1
- package/src/lib/new-relic/NewRelicIngest.d.ts +17 -4
- package/src/lib/storage/Driver.js +1 -1
- package/src/lib/storage/Driver.js.map +1 -1
- package/src/lib/storage/ScopedStorage.js.map +1 -1
- package/src/lib/whatsapp-flow/index.js.map +1 -1
- package/src/lib/blip/BlipBuilder/BlipBotDiff.js.map +0 -1
- package/src/lib/blip/BlipBuilder/BlipBuilderSanitize.js.map +0 -1
- package/src/lib/blip/BlipBuilder/BlipBuilderTranspile.d.ts +0 -49
- package/src/lib/blip/BlipBuilder/BlipBuilderTranspile.js +0 -317
- package/src/lib/blip/BlipBuilder/BlipBuilderTranspile.js.map +0 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.http = exports.HttpClient = exports.HttpError = void 0;
|
|
13
|
+
const __definitions_1 = require("./__definitions");
|
|
14
|
+
const _bindings_1 = require("./_bindings");
|
|
15
|
+
const _build_1 = require("./_build");
|
|
16
|
+
(0, _build_1._compiler)("IMPORTS-START");
|
|
17
|
+
class HttpError extends Error {
|
|
18
|
+
constructor(message, status, response) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = "HttpError";
|
|
21
|
+
this.status = status;
|
|
22
|
+
this.response = response;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.HttpError = HttpError;
|
|
26
|
+
class HttpClient {
|
|
27
|
+
constructor() {
|
|
28
|
+
this._logs = [];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Performs an HTTP request with comprehensive logging and error handling.
|
|
32
|
+
*
|
|
33
|
+
* Makes HTTP requests with automatic JSON handling, response validation, and detailed logging.
|
|
34
|
+
* All requests and responses are logged for debugging and monitoring purposes.
|
|
35
|
+
*
|
|
36
|
+
* @param {{url: string, method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH", params?: {[key: string]: string}, headers?: {[key: string]: string}, body?: Record<string, any> | Array<any> | string, valid?: ((status: number) => boolean) | number[] | number, reduce?: (response: FetchResponse) => string}} config HTTP request configuration:
|
|
37
|
+
* - `url`: The target URL for the HTTP request (required)
|
|
38
|
+
* - `method`: HTTP method to use (defaults to "GET")
|
|
39
|
+
* - `params`: Query parameters to append to the URL
|
|
40
|
+
* - `headers`: HTTP headers to include in the request
|
|
41
|
+
* - `body`: Request body (objects/arrays are automatically JSON stringified)
|
|
42
|
+
* - `valid`: Custom validation for HTTP status codes (function, array, or single number)
|
|
43
|
+
* - `reduce`: Custom function to process the response before logging
|
|
44
|
+
*
|
|
45
|
+
* @returns {Promise<{status: number, data: any, headers: {[key: string]: string}}>} Promise resolving to HTTP response:
|
|
46
|
+
* - `status`: HTTP status code
|
|
47
|
+
* - `data`: Parsed response body (JSON parsed if possible, otherwise raw string)
|
|
48
|
+
* - `headers`: Response headers as key-value object
|
|
49
|
+
*
|
|
50
|
+
* @throws {DwnError} Throws MISCONFIGURATION_ERROR if URL is missing or method is invalid
|
|
51
|
+
* @throws {HttpError} Throws HttpError if the request fails or returns invalid status code
|
|
52
|
+
*/
|
|
53
|
+
request(config) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
if (!config || !config.url) {
|
|
56
|
+
throw new __definitions_1.DwnError(__definitions_1.PREDEFINED_ERRORS.MISCONFIGURATION_ERROR, "HTTP request must have a URL.");
|
|
57
|
+
}
|
|
58
|
+
if (config.method &&
|
|
59
|
+
!["GET", "POST", "PUT", "DELETE", "PATCH"].includes(config.method)) {
|
|
60
|
+
throw new __definitions_1.DwnError(__definitions_1.PREDEFINED_ERRORS.MISCONFIGURATION_ERROR, `Invalid HTTP method: ${config.method}`);
|
|
61
|
+
}
|
|
62
|
+
const req = this.prepareRequest(config);
|
|
63
|
+
const response = yield _bindings_1.request.fetchAsync(req.url, req.options);
|
|
64
|
+
const resp = this.prepareResponse(config, response);
|
|
65
|
+
const log = {
|
|
66
|
+
request: req.log,
|
|
67
|
+
response: resp.log,
|
|
68
|
+
duration: resp.log.at.getTime() - req.log.at.getTime(),
|
|
69
|
+
};
|
|
70
|
+
this._logs.unshift(log);
|
|
71
|
+
if (!resp.success) {
|
|
72
|
+
throw new HttpError(`HTTP request failed with status ${resp.response.status}.`, resp.response.status, resp.response);
|
|
73
|
+
}
|
|
74
|
+
return resp.response;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Performs a GET HTTP request.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} url The target URL for the GET request
|
|
81
|
+
* @param {{params?: {[key: string]: string}, headers?: {[key: string]: string}, valid?: ((status: number) => boolean) | number[] | number}} [config] Optional request configuration:
|
|
82
|
+
* - `params`: Query parameters to append to the URL
|
|
83
|
+
* - `headers`: HTTP headers to include in the request
|
|
84
|
+
* - `valid`: Custom validation for HTTP status codes
|
|
85
|
+
*
|
|
86
|
+
* @returns {Promise<{status: number, data: any, headers: {[key: string]: string}}>} Promise resolving to HTTP response
|
|
87
|
+
*/
|
|
88
|
+
get(url, config) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
return this.request(Object.assign(Object.assign({}, config), { url, method: "GET" }));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Performs a POST HTTP request.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} url The target URL for the POST request
|
|
97
|
+
* @param {Record<string, any> | Array<any> | string} [body] Request body (objects/arrays are automatically JSON stringified)
|
|
98
|
+
* @param {{params?: {[key: string]: string}, headers?: {[key: string]: string}, valid?: ((status: number) => boolean) | number[] | number}} [config] Optional request configuration:
|
|
99
|
+
* - `params`: Query parameters to append to the URL
|
|
100
|
+
* - `headers`: HTTP headers to include in the request
|
|
101
|
+
* - `valid`: Custom validation for HTTP status codes
|
|
102
|
+
*
|
|
103
|
+
* @returns {Promise<{status: number, data: any, headers: {[key: string]: string}}>} Promise resolving to HTTP response
|
|
104
|
+
*/
|
|
105
|
+
post(url, body, config) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
return this.request(Object.assign(Object.assign({}, config), { url, method: "POST", body }));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Performs a PUT HTTP request.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} url The target URL for the PUT request
|
|
114
|
+
* @param {Record<string, any> | Array<any> | string} [body] Request body (objects/arrays are automatically JSON stringified)
|
|
115
|
+
* @param {{params?: {[key: string]: string}, headers?: {[key: string]: string}, valid?: ((status: number) => boolean) | number[] | number}} [config] Optional request configuration:
|
|
116
|
+
* - `params`: Query parameters to append to the URL
|
|
117
|
+
* - `headers`: HTTP headers to include in the request
|
|
118
|
+
* - `valid`: Custom validation for HTTP status codes
|
|
119
|
+
*
|
|
120
|
+
* @returns {Promise<{status: number, data: any, headers: {[key: string]: string}}>} Promise resolving to HTTP response
|
|
121
|
+
*/
|
|
122
|
+
put(url, body, config) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
return this.request(Object.assign(Object.assign({}, config), { url, method: "PUT", body }));
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Performs a DELETE HTTP request.
|
|
129
|
+
*
|
|
130
|
+
* @param {string} url The target URL for the DELETE request
|
|
131
|
+
* @param {{params?: {[key: string]: string}, headers?: {[key: string]: string}, valid?: ((status: number) => boolean) | number[] | number}} [config] Optional request configuration:
|
|
132
|
+
* - `params`: Query parameters to append to the URL
|
|
133
|
+
* - `headers`: HTTP headers to include in the request
|
|
134
|
+
* - `valid`: Custom validation for HTTP status codes
|
|
135
|
+
*
|
|
136
|
+
* @returns {Promise<{status: number, data: any, headers: {[key: string]: string}}>} Promise resolving to HTTP response
|
|
137
|
+
*/
|
|
138
|
+
delete(url, config) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
return this.request(Object.assign(Object.assign({}, config), { url, method: "DELETE" }));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Performs a PATCH HTTP request.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} url The target URL for the PATCH request
|
|
147
|
+
* @param {Record<string, any> | Array<any> | string} [body] Request body (objects/arrays are automatically JSON stringified)
|
|
148
|
+
* @param {{params?: {[key: string]: string}, headers?: {[key: string]: string}, valid?: ((status: number) => boolean) | number[] | number}} [config] Optional request configuration:
|
|
149
|
+
* - `params`: Query parameters to append to the URL
|
|
150
|
+
* - `headers`: HTTP headers to include in the request
|
|
151
|
+
* - `valid`: Custom validation for HTTP status codes
|
|
152
|
+
*
|
|
153
|
+
* @returns {Promise<{status: number, data: any, headers: {[key: string]: string}}>} Promise resolving to HTTP response
|
|
154
|
+
*/
|
|
155
|
+
patch(url, body, config) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return this.request(Object.assign(Object.assign({}, config), { url, method: "PATCH", body }));
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
prepareRequest(config) {
|
|
161
|
+
const createQueryString = (params = {}) => {
|
|
162
|
+
const pairs = [];
|
|
163
|
+
for (const [key, value] of Object.entries(params)) {
|
|
164
|
+
if (value !== undefined && value !== null) {
|
|
165
|
+
const encodedKey = encodeURIComponent(key);
|
|
166
|
+
const encodedValue = encodeURIComponent(String(value));
|
|
167
|
+
pairs.push(`${encodedKey}=${encodedValue}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return pairs.join("&");
|
|
171
|
+
};
|
|
172
|
+
const params = createQueryString(config.params || {});
|
|
173
|
+
const method = config.method || "GET";
|
|
174
|
+
const headers = config.headers || {};
|
|
175
|
+
let length = 0;
|
|
176
|
+
let body = config.body || null;
|
|
177
|
+
if (body && typeof body === "object") {
|
|
178
|
+
body = JSON.stringify(body);
|
|
179
|
+
headers["Content-Type"] = "application/json";
|
|
180
|
+
}
|
|
181
|
+
if (body && typeof body === "string") {
|
|
182
|
+
length = body.length;
|
|
183
|
+
}
|
|
184
|
+
let url = config.url;
|
|
185
|
+
if (params !== "")
|
|
186
|
+
url += `?${params}`;
|
|
187
|
+
const options = {
|
|
188
|
+
method,
|
|
189
|
+
headers,
|
|
190
|
+
body,
|
|
191
|
+
};
|
|
192
|
+
const log = {
|
|
193
|
+
at: new Date(),
|
|
194
|
+
url,
|
|
195
|
+
method: method || "GET",
|
|
196
|
+
headers: headers || {},
|
|
197
|
+
length,
|
|
198
|
+
};
|
|
199
|
+
return { url, options, log };
|
|
200
|
+
}
|
|
201
|
+
prepareResponse(config, resp) {
|
|
202
|
+
const { status } = resp;
|
|
203
|
+
const headers = {};
|
|
204
|
+
for (const header of resp.headers) {
|
|
205
|
+
const key = header.key;
|
|
206
|
+
const values = header.value;
|
|
207
|
+
if (values.length > 0) {
|
|
208
|
+
headers[key] = values[0];
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const length = headers["content-length"]
|
|
212
|
+
? parseInt(headers["content-length"], 10)
|
|
213
|
+
: resp.body
|
|
214
|
+
? resp.body.length
|
|
215
|
+
: 0;
|
|
216
|
+
let data = null;
|
|
217
|
+
try {
|
|
218
|
+
data = JSON.parse(resp.body);
|
|
219
|
+
}
|
|
220
|
+
catch (err) {
|
|
221
|
+
data = resp.body;
|
|
222
|
+
}
|
|
223
|
+
let valid = (status) => status >= 200 && status < 300;
|
|
224
|
+
if (config.valid) {
|
|
225
|
+
if (Array.isArray(config.valid)) {
|
|
226
|
+
const expectedSet = new Set(config.valid);
|
|
227
|
+
valid = (status) => expectedSet.has(status);
|
|
228
|
+
}
|
|
229
|
+
else if (typeof config.valid === "number") {
|
|
230
|
+
const expectedNumber = config.valid;
|
|
231
|
+
valid = (status) => status === expectedNumber;
|
|
232
|
+
}
|
|
233
|
+
else if (typeof config.valid === "function") {
|
|
234
|
+
valid = config.valid;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const success = valid(status);
|
|
238
|
+
const reduce = (raw) => {
|
|
239
|
+
let body = "";
|
|
240
|
+
try {
|
|
241
|
+
if (typeof raw !== "object") {
|
|
242
|
+
throw new Error("Not an object");
|
|
243
|
+
}
|
|
244
|
+
body = JSON.stringify(raw);
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
body = String(raw);
|
|
248
|
+
}
|
|
249
|
+
let reduced = false;
|
|
250
|
+
if (body.length > 1000) {
|
|
251
|
+
body = body.substring(0, 1000) + "...(truncated)";
|
|
252
|
+
reduced = true;
|
|
253
|
+
}
|
|
254
|
+
return { body, reduced };
|
|
255
|
+
};
|
|
256
|
+
const log = Object.assign({ at: new Date(), status,
|
|
257
|
+
length,
|
|
258
|
+
success }, reduce(resp.body));
|
|
259
|
+
const response = {
|
|
260
|
+
status,
|
|
261
|
+
data,
|
|
262
|
+
headers,
|
|
263
|
+
};
|
|
264
|
+
return { response, log, success };
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.HttpClient = HttpClient;
|
|
268
|
+
exports.http = new HttpClient();
|
|
269
|
+
(0, _build_1._compiler)("IMPORTS-END");
|
|
270
|
+
//# sourceMappingURL=libs_http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libs_http.js","sourceRoot":"","sources":["../../../../../../../../../libs/services/src/lib/blip/DwnGridCompiler/features/scripts/libs_http.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA8D;AAC9D,2CAAmE;AACnE,qCAAqC;AAqCrC,IAAA,kBAAS,EAAC,eAAe,CAAC,CAAC;AAE3B,MAAa,SAAU,SAAQ,KAAK;IAInC,YAAY,OAAe,EAAE,MAAc,EAAE,QAAsB;QAClE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAVD,8BAUC;AAED,MAAa,UAAU;IAAvB;QACQ,UAAK,GAAc,EAAE,CAAC;IAoS9B,CAAC;IAlSA;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,OAAO,CAAC,MAAmB;;YAChC,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;gBAC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,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;AAErC,IAAA,kBAAS,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function kebabCase(str: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.kebabCase = void 0;
|
|
4
|
+
const _build_1 = require("./_build");
|
|
5
|
+
(0, _build_1._compiler)("IMPORTS-START");
|
|
6
|
+
function kebabCase(str) {
|
|
7
|
+
if (!str)
|
|
8
|
+
return "";
|
|
9
|
+
const matches = str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);
|
|
10
|
+
if (!matches)
|
|
11
|
+
return "";
|
|
12
|
+
return matches.map((x) => x.toLowerCase()).join("-");
|
|
13
|
+
}
|
|
14
|
+
exports.kebabCase = kebabCase;
|
|
15
|
+
(0, _build_1._compiler)("IMPORTS-END");
|
|
16
|
+
//# sourceMappingURL=libs_kebabcase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libs_kebabcase.js","sourceRoot":"","sources":["../../../../../../../../../libs/services/src/lib/blip/DwnGridCompiler/features/scripts/libs_kebabcase.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AAErC,IAAA,kBAAS,EAAC,eAAe,CAAC,CAAC;AAC3B,SAAgB,SAAS,CAAC,GAAW;IACpC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IAEpB,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CACxB,oEAAoE,CACpE,CAAC;IAEF,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtD,CAAC;AAVD,8BAUC;AACD,IAAA,kBAAS,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function merge<T extends object>(...objects: (Partial<T> | undefined)[]): T;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.merge = void 0;
|
|
4
|
+
const _build_1 = require("./_build");
|
|
5
|
+
(0, _build_1._compiler)("IMPORTS-START");
|
|
6
|
+
function deepClone(source) {
|
|
7
|
+
if (source === null || typeof source !== "object") {
|
|
8
|
+
return source;
|
|
9
|
+
}
|
|
10
|
+
if (source instanceof Date) {
|
|
11
|
+
return new Date(source.getTime());
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(source)) {
|
|
14
|
+
const newArray = [];
|
|
15
|
+
for (let i = 0; i < source.length; i++) {
|
|
16
|
+
newArray[i] = deepClone(source[i]);
|
|
17
|
+
}
|
|
18
|
+
return newArray;
|
|
19
|
+
}
|
|
20
|
+
const newObject = {};
|
|
21
|
+
for (const key in source) {
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
+
newObject[key] = deepClone(source[key]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return newObject;
|
|
27
|
+
}
|
|
28
|
+
function internalMerge(...objects) {
|
|
29
|
+
const validObjects = objects.filter((obj) => obj && typeof obj === "object");
|
|
30
|
+
if (validObjects.length === 0)
|
|
31
|
+
return {};
|
|
32
|
+
// Start with a deep clone of the first object.
|
|
33
|
+
const result = deepClone(validObjects[0] || {});
|
|
34
|
+
// Loop through the rest of the objects and merge them into the result.
|
|
35
|
+
for (let i = 1; i < validObjects.length; i++) {
|
|
36
|
+
const source = validObjects[i];
|
|
37
|
+
for (const key in source) {
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
39
|
+
const sourceValue = source[key];
|
|
40
|
+
const resultValue = result[key];
|
|
41
|
+
const isPlainObject = (v) => v && typeof v === "object" && !Array.isArray(v);
|
|
42
|
+
if (isPlainObject(resultValue) && isPlainObject(sourceValue)) {
|
|
43
|
+
// If both are objects, recurse
|
|
44
|
+
result[key] = internalMerge(resultValue, sourceValue);
|
|
45
|
+
}
|
|
46
|
+
else if (Array.isArray(resultValue) && Array.isArray(sourceValue)) {
|
|
47
|
+
// If both are arrays, concatenate with latest elements first
|
|
48
|
+
result[key] = [...sourceValue, ...resultValue];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// Otherwise, overwrite (with a clone for safety)
|
|
52
|
+
result[key] = deepClone(sourceValue);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
function merge(...objects) {
|
|
60
|
+
return internalMerge(...objects);
|
|
61
|
+
}
|
|
62
|
+
exports.merge = merge;
|
|
63
|
+
(0, _build_1._compiler)("IMPORTS-END");
|
|
64
|
+
//# sourceMappingURL=libs_merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libs_merge.js","sourceRoot":"","sources":["../../../../../../../../../libs/services/src/lib/blip/DwnGridCompiler/features/scripts/libs_merge.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AAErC,IAAA,kBAAS,EAAC,eAAe,CAAC,CAAC;AAC3B,SAAS,SAAS,CAAI,MAAS;IAC9B,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAClD,OAAO,MAAM,CAAC;KACd;IAED,IAAI,MAAM,YAAY,IAAI,EAAE;QAC3B,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAQ,CAAC;KACzC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,QAAQ,GAAG,EAAW,CAAC;QAC7B,KAAK,IAAI,C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,CAAC;gBAEhC,MAAM,aAAa,GAAG,CAAC,CAAM,EAAE,EAAE,CAChC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAEjD,IAAI,aAAa,CAAC,WAAW,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,EAAE;oBAC7D,+BAA+B;oBAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;iBACtD;qBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;oBACpE,6DAA6D;oBAC7D,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC,CAAC;iBAC/C;qBAAM;oBACN,iDAAiD;oBACjD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;iBACrC;aACD;SACD;KACD;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAgB,KAAK,CACpB,GAAG,OAAmC;IAEtC,OAAO,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC;AAClC,CAAC;AAJD,sBAIC;AACD,IAAA,kBAAS,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.dwnProcess = void 0;
|
|
13
|
+
const __definitions_1 = require("./__definitions");
|
|
14
|
+
const _bindings_1 = require("./_bindings");
|
|
15
|
+
const _build_1 = require("./_build");
|
|
16
|
+
const libs_console_1 = require("./libs_console");
|
|
17
|
+
const libs_http_1 = require("./libs_http");
|
|
18
|
+
const libs_datetime_1 = require("./libs_datetime");
|
|
19
|
+
(0, _build_1._compiler)("IMPORTS-START");
|
|
20
|
+
function dwnProcess(id, type, fn, ...args) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
let result = undefined;
|
|
23
|
+
let error = null;
|
|
24
|
+
try {
|
|
25
|
+
result = yield fn(...args);
|
|
26
|
+
if (!id && (libs_console_1.console._logs.length > 0 || libs_http_1.http._logs.length > 0)) {
|
|
27
|
+
throw new __definitions_1.DwnError(__definitions_1.PREDEFINED_ERRORS.MISCONFIGURATION_ERROR, "Script must have an ID to capture logs.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (caught) {
|
|
31
|
+
let err = caught;
|
|
32
|
+
if (err instanceof libs_http_1.HttpError) {
|
|
33
|
+
const description = `[${id}] HTTP request failed with status ${err.status}.`;
|
|
34
|
+
const stack = err && err.stack ? String(err.stack) : "";
|
|
35
|
+
err = new __definitions_1.DwnError(__definitions_1.PREDEFINED_ERRORS.HTTP_ERROR, description, {
|
|
36
|
+
code: `S-${err.status}`,
|
|
37
|
+
stack,
|
|
38
|
+
goto: null,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else if (!(err instanceof __definitions_1.DwnError)) {
|
|
42
|
+
const description = `[${id}] Unexpected error ${String(err)}`;
|
|
43
|
+
const stack = err && err.stack ? String(err.stack) : "";
|
|
44
|
+
err = new __definitions_1.DwnError(__definitions_1.PREDEFINED_ERRORS.SCRIPT_ERROR, description, {
|
|
45
|
+
stack,
|
|
46
|
+
goto: null,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
error = err;
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
yield dwnFlush(id, type, error);
|
|
53
|
+
}
|
|
54
|
+
if (error) {
|
|
55
|
+
yield _bindings_1.context.setVariableAsync(__definitions_1.VARIABLES.ERROR, error.toString());
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
exports.dwnProcess = dwnProcess;
|
|
61
|
+
function dwnFlush(id, type, error = null) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
let config = {};
|
|
64
|
+
try {
|
|
65
|
+
const configStr = yield _bindings_1.context.getVariableAsync(__definitions_1.VARIABLES.CONFIG);
|
|
66
|
+
config = JSON.parse(configStr || "");
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
// Keep the default configuration when no valid value is stored.
|
|
70
|
+
}
|
|
71
|
+
yield dwnFlushGlobalLogs(config);
|
|
72
|
+
if (type === "complete") {
|
|
73
|
+
yield dwnFlushLocalLogs(config, id);
|
|
74
|
+
}
|
|
75
|
+
if (error) {
|
|
76
|
+
yield dwnFlushError(config, error);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function dwnFlushLocalLogs(config, id) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const { datetime } = (0, libs_datetime_1.formatDate)(new Date(), config);
|
|
83
|
+
const _logs = libs_console_1.console._logs.map((log) => {
|
|
84
|
+
const { level, message, date } = log;
|
|
85
|
+
const { time } = (0, libs_datetime_1.formatDate)(date, config);
|
|
86
|
+
return `[${time}](${level}) ${message}`;
|
|
87
|
+
});
|
|
88
|
+
const _http = libs_http_1.http._logs.map((log) => log);
|
|
89
|
+
const data = { datetime, logs: _logs, http: _http };
|
|
90
|
+
const name = `${__definitions_1.VARIABLES.SCRIPT}-${id}`;
|
|
91
|
+
yield _bindings_1.context.setVariableAsync(name, JSON.stringify(data));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function dwnFlushGlobalLogs(config) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
const size = config.stackSize ? config.stackSize.logs || 10 : 10;
|
|
97
|
+
if (libs_console_1.console._logs.length === 0)
|
|
98
|
+
return;
|
|
99
|
+
let logs = [];
|
|
100
|
+
try {
|
|
101
|
+
const logsStr = yield _bindings_1.context.getVariableAsync(__definitions_1.VARIABLES.LOGS);
|
|
102
|
+
logs = JSON.parse(logsStr || "[]");
|
|
103
|
+
if (!logs || !Array.isArray(logs)) {
|
|
104
|
+
throw new Error("Invalid logs format");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
logs = [];
|
|
109
|
+
}
|
|
110
|
+
const _logs = libs_console_1.console._logs.map((log) => {
|
|
111
|
+
const { level, message, date } = log;
|
|
112
|
+
const { datetime } = (0, libs_datetime_1.formatDate)(date, config);
|
|
113
|
+
return `[${datetime}](${level}) ${message}`;
|
|
114
|
+
});
|
|
115
|
+
logs = [..._logs, ...logs].slice(0, size);
|
|
116
|
+
yield _bindings_1.context.setVariableAsync(__definitions_1.VARIABLES.LOGS, JSON.stringify(logs));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function dwnFlushError(config, error) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const contract = config.connection ? config.connection.contract || "" : "";
|
|
122
|
+
const key = config.connection ? config.connection.key || "" : "";
|
|
123
|
+
if (!contract || !key)
|
|
124
|
+
return;
|
|
125
|
+
const category = "dwn-track-error";
|
|
126
|
+
const items = [error.type, error.code || "", error.description || ""];
|
|
127
|
+
const action = items.join("-|-").trim();
|
|
128
|
+
const url = `https://${contract}.http.msging.net/commands`;
|
|
129
|
+
const headers = {
|
|
130
|
+
"Content-Type": "application/json",
|
|
131
|
+
Authorization: key,
|
|
132
|
+
};
|
|
133
|
+
const body = {
|
|
134
|
+
id: Math.random().toString(36).substring(2, 15),
|
|
135
|
+
to: "postmaster@analytics.msging.net",
|
|
136
|
+
method: "set",
|
|
137
|
+
type: "application/vnd.iris.eventTrack+json",
|
|
138
|
+
uri: "/event-track",
|
|
139
|
+
resource: {
|
|
140
|
+
category,
|
|
141
|
+
action,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
_bindings_1.request.fetchAsync(url, { method: "POST", headers, body });
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
(0, _build_1._compiler)("IMPORTS-END");
|
|
148
|
+
//# sourceMappingURL=libs_script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libs_script.js","sourceRoot":"","sources":["../../../../../../../../../libs/services/src/lib/blip/DwnGridCompiler/features/scripts/libs_script.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mDAAyE;AACzE,2CAA+C;AAC/C,qCAAqC;AACrC,iDAAyC;AACzC,2CAA8C;AAC9C,mDAA6C;AAE7C,IAAA,kBAAS,EAAC,eAAe,CAAC,CAAC;AAI3B,SAAsB,UAAU,CAC/B,EAAU,EACV,IAAmB,EACnB,EAAoC,EACpC,GAAG,IAAW;;QAEd,IAAI,MAAM,GAAG,SAAS,CAAC;QACvB,IAAI,KAAK,GAAoB,IAAI,CAAC;QAClC,IAAI;YACH,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,EAAE,IAAI,CAAC,sBAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,gBAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;gBAC/D,MAAM,IAAI,wBAAQ,CACjB,iCAAiB,CAAC,sBAAsB,EACxC,yCAAyC,CACzC,CAAC;aACF;SACD;QAAC,OAAO,MAAsB,EAAE;YAChC,I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