@uipath/api-workflow-tool 1.205.0-preview.277 → 1.206.0-preview.279
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/README.md +41 -0
- package/dist/THIRD-PARTY-NOTICES.md +64 -3
- package/dist/applicationinsights-web-8m26566f.js +17209 -0
- package/dist/executor-tool.js +7 -9
- package/dist/index-1wp4j95a.js +10 -0
- package/dist/index-3d09whjq.js +11 -0
- package/dist/{index-waq4trz1.js → index-njewr1c3.js} +5040 -2961
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/index.js +14 -15
- package/dist/index.umd.min-ttg1qc0x.js +7814 -0
- package/dist/{jmespath-e4a59c8w.js → jmespath-wwym30dp.js} +1 -1
- package/dist/js-yaml-0c4svjwq.js +36 -0
- package/dist/{node-0aex431z.js → node-zecqtv6e.js} +13 -90
- package/dist/{packager-tool-bgy9gdsp.js → packager-tool-2ckhrf4j.js} +128 -15
- package/dist/{packager-tool-kh3aq9n7.js → packager-tool-2wwd7kp4.js} +920 -903
- package/dist/{packager-tool-xak3m9vd.js → packager-tool-3hcrfsc1.js} +762 -384
- package/dist/{packager-tool-0aacqssr.js → packager-tool-5b6vjjp3.js} +371 -371
- package/dist/{packager-tool-d3w0wn6k.js → packager-tool-5gce5wfd.js} +16 -16
- package/dist/{packager-tool-f7zta1kg.js → packager-tool-61bdk9sn.js} +203 -156
- package/dist/{packager-tool-1yh8g550.js → packager-tool-6an893wm.js} +12 -3
- package/dist/{packager-tool-646qm7dh.js → packager-tool-km68yge6.js} +62 -586
- package/dist/{packager-tool-evd1kzq2.js → packager-tool-qhv22qaj.js} +809 -380
- package/dist/packager-tool-rqprykf5.js +15 -0
- package/dist/{packager-tool-h29ph2zm.js → packager-tool-w1asrkzg.js} +361 -205
- package/dist/packager-tool.js +6 -6
- package/dist/tool.js +13 -14
- package/package.json +2 -2
- package/dist/index-a8veczhw.js +0 -72
- package/dist/index.umd.min-fqefd9kn.js +0 -7814
- package/dist/js-yaml-69tsdrrf.js +0 -37
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
OutputFormatter,
|
|
2
|
+
getFileSystem,
|
|
4
3
|
RESULTS,
|
|
4
|
+
logger,
|
|
5
5
|
SuccessOutput,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./packager-tool-
|
|
6
|
+
FailureOutput,
|
|
7
|
+
OutputFormatter
|
|
8
|
+
} from "./packager-tool-3hcrfsc1.js";
|
|
9
9
|
import {
|
|
10
10
|
catchError
|
|
11
|
-
} from "./packager-tool-
|
|
11
|
+
} from "./packager-tool-qhv22qaj.js";
|
|
12
12
|
import {
|
|
13
13
|
require_cjs
|
|
14
|
-
} from "./packager-tool-
|
|
14
|
+
} from "./packager-tool-5b6vjjp3.js";
|
|
15
15
|
import {
|
|
16
|
+
__toESM,
|
|
16
17
|
__commonJS,
|
|
17
|
-
__require
|
|
18
|
-
|
|
19
|
-
} from "./packager-tool-1yh8g550.js";
|
|
18
|
+
__require
|
|
19
|
+
} from "./packager-tool-6an893wm.js";
|
|
20
20
|
|
|
21
21
|
// ../../node_modules/@uipath/api-workflow-executor/dist/contracts/expression-handler.js
|
|
22
22
|
var require_expression_handler = __commonJS(function(exports) {
|
|
@@ -1257,9 +1257,9 @@ var require_debug_command_events = __commonJS(function(exports) {
|
|
|
1257
1257
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1258
1258
|
exports.WorkflowCommandEvent = undefined;
|
|
1259
1259
|
var WorkflowCommandEvent;
|
|
1260
|
-
(function(
|
|
1261
|
-
|
|
1262
|
-
|
|
1260
|
+
(function(WorkflowCommandEvent) {
|
|
1261
|
+
WorkflowCommandEvent["Resume"] = "Resume";
|
|
1262
|
+
WorkflowCommandEvent["SetBreakpoints"] = "SetBreakpoints";
|
|
1263
1263
|
})(WorkflowCommandEvent || (exports.WorkflowCommandEvent = WorkflowCommandEvent = {}));
|
|
1264
1264
|
});
|
|
1265
1265
|
|
|
@@ -1299,22 +1299,22 @@ var require_workflow_events = __commonJS(function(exports) {
|
|
|
1299
1299
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1300
1300
|
exports.LogEvent = exports.TaskEvent = exports.WorkflowEvent = undefined;
|
|
1301
1301
|
var WorkflowEvent;
|
|
1302
|
-
(function(
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1302
|
+
(function(WorkflowEvent) {
|
|
1303
|
+
WorkflowEvent["WORKFLOW_STARTED"] = "workflow_started";
|
|
1304
|
+
WorkflowEvent["WORKFLOW_COMPLETED"] = "workflow_completed";
|
|
1305
|
+
WorkflowEvent["WORKFLOW_FAILED"] = "workflow_failed";
|
|
1306
|
+
WorkflowEvent["WORKFLOW_STOPPED"] = "workflow_stopped";
|
|
1307
1307
|
})(WorkflowEvent || (exports.WorkflowEvent = WorkflowEvent = {}));
|
|
1308
1308
|
var TaskEvent;
|
|
1309
|
-
(function(
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1309
|
+
(function(TaskEvent) {
|
|
1310
|
+
TaskEvent["TASK_STARTED"] = "task_started";
|
|
1311
|
+
TaskEvent["TASK_COMPLETED"] = "task_completed";
|
|
1312
|
+
TaskEvent["TASK_FAILED"] = "task_failed";
|
|
1313
|
+
TaskEvent["TASK_STOPPED"] = "task_stopped";
|
|
1314
1314
|
})(TaskEvent || (exports.TaskEvent = TaskEvent = {}));
|
|
1315
1315
|
var LogEvent;
|
|
1316
|
-
(function(
|
|
1317
|
-
|
|
1316
|
+
(function(LogEvent) {
|
|
1317
|
+
LogEvent["USER_LOG"] = "user_log";
|
|
1318
1318
|
})(LogEvent || (exports.LogEvent = LogEvent = {}));
|
|
1319
1319
|
});
|
|
1320
1320
|
|
|
@@ -1323,11 +1323,11 @@ var require_workflow_log_data = __commonJS(function(exports) {
|
|
|
1323
1323
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1324
1324
|
exports.LogLevel = undefined;
|
|
1325
1325
|
var LogLevel;
|
|
1326
|
-
(function(
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1326
|
+
(function(LogLevel) {
|
|
1327
|
+
LogLevel["VERBOSE"] = "Verbose";
|
|
1328
|
+
LogLevel["INFO"] = "Information";
|
|
1329
|
+
LogLevel["WARN"] = "Warning";
|
|
1330
|
+
LogLevel["ERROR"] = "Error";
|
|
1331
1331
|
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
1332
1332
|
});
|
|
1333
1333
|
|
|
@@ -1363,24 +1363,24 @@ var require_task_types = __commonJS(function(exports) {
|
|
|
1363
1363
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1364
1364
|
exports.TaskType = undefined;
|
|
1365
1365
|
var TaskType;
|
|
1366
|
-
(function(
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1366
|
+
(function(TaskType) {
|
|
1367
|
+
TaskType["DO"] = "do";
|
|
1368
|
+
TaskType["FOR"] = "for";
|
|
1369
|
+
TaskType["SWITCH"] = "switch";
|
|
1370
|
+
TaskType["TRY"] = "try";
|
|
1371
|
+
TaskType["WHILE"] = "while";
|
|
1372
|
+
TaskType["DO_WHILE"] = "doWhile";
|
|
1373
|
+
TaskType["BREAK"] = "break";
|
|
1374
|
+
TaskType["HTTP"] = "http";
|
|
1375
|
+
TaskType["SCRIPT"] = "script";
|
|
1376
|
+
TaskType["WAIT"] = "wait";
|
|
1377
|
+
TaskType["WORKFLOW_START"] = "workflowStart";
|
|
1378
|
+
TaskType["RESPONSE"] = "response";
|
|
1379
|
+
TaskType["SET"] = "set";
|
|
1380
|
+
TaskType["INTSVC"] = "intSvc";
|
|
1381
|
+
TaskType["INTSVC_EVENT"] = "intSvcEvent";
|
|
1382
|
+
TaskType["RAISE"] = "raise";
|
|
1383
|
+
TaskType["UNKNOWN"] = "unknown";
|
|
1384
1384
|
})(TaskType || (exports.TaskType = TaskType = {}));
|
|
1385
1385
|
});
|
|
1386
1386
|
|
|
@@ -1390,23 +1390,23 @@ var require_formatted_task_type = __commonJS(function(exports) {
|
|
|
1390
1390
|
exports.FormattedTaskTypeMap = exports.FormattedTaskType = undefined;
|
|
1391
1391
|
var task_types_1 = require_task_types();
|
|
1392
1392
|
var FormattedTaskType;
|
|
1393
|
-
(function(
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1393
|
+
(function(FormattedTaskType) {
|
|
1394
|
+
FormattedTaskType["Connector"] = "Connector";
|
|
1395
|
+
FormattedTaskType["ConnectorEvent"] = "ConnectorEvent";
|
|
1396
|
+
FormattedTaskType["HTTP"] = "HTTP";
|
|
1397
|
+
FormattedTaskType["Script"] = "Script";
|
|
1398
|
+
FormattedTaskType["If"] = "If";
|
|
1399
|
+
FormattedTaskType["ForEach"] = "ForEach";
|
|
1400
|
+
FormattedTaskType["TryCatch"] = "TryCatch";
|
|
1401
|
+
FormattedTaskType["Response"] = "Response";
|
|
1402
|
+
FormattedTaskType["DoWhile"] = "DoWhile";
|
|
1403
|
+
FormattedTaskType["While"] = "While";
|
|
1404
|
+
FormattedTaskType["Wait"] = "Wait";
|
|
1405
|
+
FormattedTaskType["Break"] = "Break";
|
|
1406
|
+
FormattedTaskType["WorkflowStart"] = "WorkflowStart";
|
|
1407
|
+
FormattedTaskType["Assign"] = "Assign";
|
|
1408
|
+
FormattedTaskType["Sequence"] = "Sequence";
|
|
1409
|
+
FormattedTaskType["Unknown"] = "Unknown";
|
|
1410
1410
|
})(FormattedTaskType || (exports.FormattedTaskType = FormattedTaskType = {}));
|
|
1411
1411
|
exports.FormattedTaskTypeMap = {
|
|
1412
1412
|
[task_types_1.TaskType.DO]: FormattedTaskType.Sequence,
|
|
@@ -1439,11 +1439,11 @@ var require_span_type = __commonJS(function(exports) {
|
|
|
1439
1439
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1440
1440
|
exports.SpanType = undefined;
|
|
1441
1441
|
var SpanType;
|
|
1442
|
-
(function(
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1442
|
+
(function(SpanType) {
|
|
1443
|
+
SpanType["ApiWorkflowRun"] = "apiWorkflowRun";
|
|
1444
|
+
SpanType["ApiWorkflowTaskRun"] = "apiWorkflowTaskRun";
|
|
1445
|
+
SpanType["ApiWorkflowUserLog"] = "apiWorkflowUserLog";
|
|
1446
|
+
SpanType["ApiWorkflowUnknown"] = "apiWorkflowUnknown";
|
|
1447
1447
|
})(SpanType || (exports.SpanType = SpanType = {}));
|
|
1448
1448
|
});
|
|
1449
1449
|
|
|
@@ -1457,30 +1457,30 @@ var require_trace_view_svc_enums = __commonJS(function(exports) {
|
|
|
1457
1457
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1458
1458
|
exports.VerbosityLevelEnum = exports.SourceEnum = exports.StatusEnum = undefined;
|
|
1459
1459
|
var StatusEnum;
|
|
1460
|
-
(function(
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1460
|
+
(function(StatusEnum) {
|
|
1461
|
+
StatusEnum[StatusEnum["Unset"] = 0] = "Unset";
|
|
1462
|
+
StatusEnum[StatusEnum["Ok"] = 1] = "Ok";
|
|
1463
|
+
StatusEnum[StatusEnum["Error"] = 2] = "Error";
|
|
1464
|
+
StatusEnum[StatusEnum["Running"] = 3] = "Running";
|
|
1465
|
+
StatusEnum[StatusEnum["Restricted"] = 4] = "Restricted";
|
|
1466
|
+
StatusEnum[StatusEnum["Cancelled"] = 5] = "Cancelled";
|
|
1467
1467
|
})(StatusEnum || (exports.StatusEnum = StatusEnum = {}));
|
|
1468
1468
|
var SourceEnum;
|
|
1469
|
-
(function(
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1469
|
+
(function(SourceEnum) {
|
|
1470
|
+
SourceEnum[SourceEnum["Agents"] = 1] = "Agents";
|
|
1471
|
+
SourceEnum[SourceEnum["ProcessOrchestration"] = 2] = "ProcessOrchestration";
|
|
1472
|
+
SourceEnum[SourceEnum["ApiWorkflows"] = 3] = "ApiWorkflows";
|
|
1473
|
+
SourceEnum[SourceEnum["Robots"] = 4] = "Robots";
|
|
1474
1474
|
})(SourceEnum || (exports.SourceEnum = SourceEnum = {}));
|
|
1475
1475
|
var VerbosityLevelEnum;
|
|
1476
|
-
(function(
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1476
|
+
(function(VerbosityLevelEnum) {
|
|
1477
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Verbose"] = 0] = "Verbose";
|
|
1478
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Trace"] = 1] = "Trace";
|
|
1479
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Information"] = 2] = "Information";
|
|
1480
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Warning"] = 3] = "Warning";
|
|
1481
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Error"] = 4] = "Error";
|
|
1482
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Critical"] = 5] = "Critical";
|
|
1483
|
+
VerbosityLevelEnum[VerbosityLevelEnum["Off"] = 6] = "Off";
|
|
1484
1484
|
})(VerbosityLevelEnum || (exports.VerbosityLevelEnum = VerbosityLevelEnum = {}));
|
|
1485
1485
|
});
|
|
1486
1486
|
|
|
@@ -1571,9 +1571,9 @@ var require_unified_http_intsvc_tasks = __commonJS(function(exports) {
|
|
|
1571
1571
|
exports.UNIFIED_HTTP_TASK_TYPE = "UiPath.Http";
|
|
1572
1572
|
exports.INTEGRATION_SERVICE_EVENT_TASK_TYPE = "UiPath.IntSvcEvent";
|
|
1573
1573
|
var HttpAuthMode;
|
|
1574
|
-
(function(
|
|
1575
|
-
|
|
1576
|
-
|
|
1574
|
+
(function(HttpAuthMode) {
|
|
1575
|
+
HttpAuthMode["CONNECTOR"] = "connector";
|
|
1576
|
+
HttpAuthMode["MANUAL"] = "manual";
|
|
1577
1577
|
})(HttpAuthMode || (exports.HttpAuthMode = HttpAuthMode = {}));
|
|
1578
1578
|
exports.IntSvcEventMode = {
|
|
1579
1579
|
POLLING: "polling",
|
|
@@ -1618,12 +1618,12 @@ var require_activity_type = __commonJS(function(exports) {
|
|
|
1618
1618
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1619
1619
|
exports.ActivityType = undefined;
|
|
1620
1620
|
var ActivityType;
|
|
1621
|
-
(function(
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1621
|
+
(function(ActivityType) {
|
|
1622
|
+
ActivityType["HttpRequest"] = "HttpRequest";
|
|
1623
|
+
ActivityType["IntSvcApiRequest"] = "IntSvcApiRequest";
|
|
1624
|
+
ActivityType["IntSvcEventRequest"] = "IntSvcEventRequest";
|
|
1625
|
+
ActivityType["ScriptExecution"] = "ScriptExecution";
|
|
1626
|
+
ActivityType["LogMessage"] = "LogMessage";
|
|
1627
1627
|
})(ActivityType || (exports.ActivityType = ActivityType = {}));
|
|
1628
1628
|
});
|
|
1629
1629
|
|
|
@@ -1742,8 +1742,8 @@ var require_activity_base = __commonJS(function(exports) {
|
|
|
1742
1742
|
exports.ActivityBase = undefined;
|
|
1743
1743
|
|
|
1744
1744
|
class ActivityBase {
|
|
1745
|
-
constructor(
|
|
1746
|
-
this.logger =
|
|
1745
|
+
constructor(logger) {
|
|
1746
|
+
this.logger = logger;
|
|
1747
1747
|
}
|
|
1748
1748
|
}
|
|
1749
1749
|
exports.ActivityBase = ActivityBase;
|
|
@@ -2009,8 +2009,8 @@ var require_modifiers = __commonJS(function(exports, module) {
|
|
|
2009
2009
|
for (let i = 0;i < instructions.length; i++) {
|
|
2010
2010
|
const { target, path, value } = instructions[i];
|
|
2011
2011
|
let current = target;
|
|
2012
|
-
for (let
|
|
2013
|
-
current = current[path[
|
|
2012
|
+
for (let i = path.length - 1;i > 0; i--) {
|
|
2013
|
+
current = current[path[i]];
|
|
2014
2014
|
}
|
|
2015
2015
|
current[path[0]] = value;
|
|
2016
2016
|
}
|
|
@@ -2171,8 +2171,8 @@ var require_modifiers = __commonJS(function(exports, module) {
|
|
|
2171
2171
|
parent.children.push(child);
|
|
2172
2172
|
return child;
|
|
2173
2173
|
}
|
|
2174
|
-
function restoreInstr(
|
|
2175
|
-
let current =
|
|
2174
|
+
function restoreInstr(node, value, target) {
|
|
2175
|
+
let current = node;
|
|
2176
2176
|
const path = [];
|
|
2177
2177
|
do {
|
|
2178
2178
|
path.push(current.key);
|
|
@@ -2427,13 +2427,13 @@ var require_redact_utils = __commonJS(function(exports) {
|
|
|
2427
2427
|
return val;
|
|
2428
2428
|
}
|
|
2429
2429
|
if (Array.isArray(val)) {
|
|
2430
|
-
let
|
|
2430
|
+
let changed = false;
|
|
2431
2431
|
const arr = val.map((item) => {
|
|
2432
2432
|
const redacted = walk(item, depth + 1);
|
|
2433
|
-
|
|
2433
|
+
changed = changed || !Object.is(redacted, item);
|
|
2434
2434
|
return redacted;
|
|
2435
2435
|
});
|
|
2436
|
-
return
|
|
2436
|
+
return changed ? arr : val;
|
|
2437
2437
|
}
|
|
2438
2438
|
if (Object.prototype.toString.call(val) !== "[object Object]") {
|
|
2439
2439
|
return val;
|
|
@@ -2462,18 +2462,18 @@ var require_http_method = __commonJS(function(exports) {
|
|
|
2462
2462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2463
2463
|
exports.HttpMethod = undefined;
|
|
2464
2464
|
var HttpMethod;
|
|
2465
|
-
(function(
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2465
|
+
(function(HttpMethod) {
|
|
2466
|
+
HttpMethod["GET"] = "GET";
|
|
2467
|
+
HttpMethod["GETBYID"] = "GET";
|
|
2468
|
+
HttpMethod["HEAD"] = "HEAD";
|
|
2469
|
+
HttpMethod["POST"] = "POST";
|
|
2470
|
+
HttpMethod["PUT"] = "PUT";
|
|
2471
|
+
HttpMethod["PATCH"] = "PATCH";
|
|
2472
|
+
HttpMethod["DELETE"] = "DELETE";
|
|
2473
|
+
HttpMethod["CONNECT"] = "CONNECT";
|
|
2474
|
+
HttpMethod["OPTIONS"] = "OPTIONS";
|
|
2475
|
+
HttpMethod["TRACE"] = "TRACE";
|
|
2476
|
+
HttpMethod["MERGE"] = "MERGE";
|
|
2477
2477
|
})(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
|
|
2478
2478
|
});
|
|
2479
2479
|
|
|
@@ -2482,9 +2482,9 @@ var require_proxy_version = __commonJS(function(exports) {
|
|
|
2482
2482
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2483
2483
|
exports.ProxyVersion = undefined;
|
|
2484
2484
|
var ProxyVersion;
|
|
2485
|
-
(function(
|
|
2486
|
-
|
|
2487
|
-
|
|
2485
|
+
(function(ProxyVersion) {
|
|
2486
|
+
ProxyVersion["V1"] = "v1";
|
|
2487
|
+
ProxyVersion["V2"] = "v2";
|
|
2488
2488
|
})(ProxyVersion || (exports.ProxyVersion = ProxyVersion = {}));
|
|
2489
2489
|
});
|
|
2490
2490
|
|
|
@@ -2624,10 +2624,10 @@ var require_http_utils = __commonJS(function(exports) {
|
|
|
2624
2624
|
return requestStreamSupport;
|
|
2625
2625
|
}
|
|
2626
2626
|
var MediaType;
|
|
2627
|
-
(function(
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2627
|
+
(function(MediaType) {
|
|
2628
|
+
MediaType["JSON"] = "application/json";
|
|
2629
|
+
MediaType["URL_ENCODED"] = "application/x-www-form-urlencoded";
|
|
2630
|
+
MediaType["UNSUPPORTED"] = "";
|
|
2631
2631
|
})(MediaType || (exports.MediaType = MediaType = {}));
|
|
2632
2632
|
var ELEMENTS_VENDOR_PROCESSING_TIME_HEADER = "elements-vendor-processing-time";
|
|
2633
2633
|
var makeHttpRequest = async (url, method, headers, params, body, proxySettings, multipartFormData, timeoutMs, verboseLoggingEnabled, isFileOperation, streamFileResponse, skipUrlBuilding) => {
|
|
@@ -2943,10 +2943,10 @@ var require_retry_config = __commonJS(function(exports) {
|
|
|
2943
2943
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2944
2944
|
exports.BackoffStrategy = undefined;
|
|
2945
2945
|
var BackoffStrategy;
|
|
2946
|
-
(function(
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2946
|
+
(function(BackoffStrategy) {
|
|
2947
|
+
BackoffStrategy["CONSTANT"] = "constant";
|
|
2948
|
+
BackoffStrategy["LINEAR"] = "linear";
|
|
2949
|
+
BackoffStrategy["EXPONENTIAL"] = "exponential";
|
|
2950
2950
|
})(BackoffStrategy || (exports.BackoffStrategy = BackoffStrategy = {}));
|
|
2951
2951
|
});
|
|
2952
2952
|
|
|
@@ -3082,15 +3082,15 @@ var require_http_retry_utils = __commonJS(function(exports) {
|
|
|
3082
3082
|
exports.makeHttpRequestWithRetry = undefined;
|
|
3083
3083
|
var http_utils_1 = require_http_utils();
|
|
3084
3084
|
var http_retry_policy_1 = require_http_retry_policy();
|
|
3085
|
-
var makeHttpRequestWithRetry = async (url, method, headers, params, body, proxySettings, multipartFormData, timeoutMs, retryConfig,
|
|
3085
|
+
var makeHttpRequestWithRetry = async (url, method, headers, params, body, proxySettings, multipartFormData, timeoutMs, retryConfig, logger, verboseLoggingEnabled, isFileOperation, streamFileResponse, skipUrlBuilding) => {
|
|
3086
3086
|
if (!retryConfig) {
|
|
3087
3087
|
return (0, http_utils_1.makeHttpRequest)(url, method, headers, params, body, proxySettings, multipartFormData, timeoutMs, verboseLoggingEnabled, isFileOperation, streamFileResponse, skipUrlBuilding);
|
|
3088
3088
|
}
|
|
3089
3089
|
if ((0, http_utils_1.isReadableStreamBody)(body)) {
|
|
3090
|
-
|
|
3090
|
+
logger?.debug("[Retry] Request body is a stream and cannot be replayed; sending without retry.");
|
|
3091
3091
|
return (0, http_utils_1.makeHttpRequest)(url, method, headers, params, body, proxySettings, multipartFormData, timeoutMs, verboseLoggingEnabled, isFileOperation, streamFileResponse, skipUrlBuilding);
|
|
3092
3092
|
}
|
|
3093
|
-
|
|
3093
|
+
logger?.debug(`[Retry] Method: ${method}, RetryConfig provided: ${JSON.stringify(retryConfig)}`);
|
|
3094
3094
|
const config = http_retry_policy_1.HttpRetryPolicy.normalizeRetryConfig(retryConfig);
|
|
3095
3095
|
let attemptNumber = 0;
|
|
3096
3096
|
let totalDelayMs = 0;
|
|
@@ -3123,7 +3123,7 @@ var require_http_retry_utils = __commonJS(function(exports) {
|
|
|
3123
3123
|
};
|
|
3124
3124
|
const decision = http_retry_policy_1.HttpRetryPolicy.shouldRetry(config, context);
|
|
3125
3125
|
if (!decision.shouldRetry) {
|
|
3126
|
-
|
|
3126
|
+
logger?.debug(`[Retry] Not retrying: ${decision.reason}`);
|
|
3127
3127
|
if (attemptNumber > 1 && result.data) {
|
|
3128
3128
|
const retryInfo = {
|
|
3129
3129
|
retryCount: attemptNumber - 1,
|
|
@@ -3142,9 +3142,9 @@ var require_http_retry_utils = __commonJS(function(exports) {
|
|
|
3142
3142
|
await new Promise((resolve) => setTimeout(resolve, decision.delayMs));
|
|
3143
3143
|
totalDelayMs += decision.delayMs;
|
|
3144
3144
|
}
|
|
3145
|
-
|
|
3145
|
+
logger?.debug(`[Retry] Retrying in ${decision.delayMs}ms: ${decision.reason}: attempt ${attemptNumber}`);
|
|
3146
3146
|
} catch (error) {
|
|
3147
|
-
|
|
3147
|
+
logger?.error(`Error while making HTTP request attempt ${attemptNumber}: ${error}`);
|
|
3148
3148
|
const context = {
|
|
3149
3149
|
attemptNumber,
|
|
3150
3150
|
error,
|
|
@@ -3152,7 +3152,7 @@ var require_http_retry_utils = __commonJS(function(exports) {
|
|
|
3152
3152
|
};
|
|
3153
3153
|
const decision = http_retry_policy_1.HttpRetryPolicy.shouldRetry(config, context);
|
|
3154
3154
|
if (!decision.shouldRetry) {
|
|
3155
|
-
|
|
3155
|
+
logger?.debug(`[Retry] Not retrying after exception: ${decision.reason}`);
|
|
3156
3156
|
return {
|
|
3157
3157
|
success: false,
|
|
3158
3158
|
error
|
|
@@ -3163,7 +3163,7 @@ var require_http_retry_utils = __commonJS(function(exports) {
|
|
|
3163
3163
|
await new Promise((resolve) => setTimeout(resolve, decision.delayMs));
|
|
3164
3164
|
totalDelayMs += decision.delayMs;
|
|
3165
3165
|
}
|
|
3166
|
-
|
|
3166
|
+
logger?.debug(`[Retry] Retrying in ${decision.delayMs}ms: ${decision.reason}: attempt ${attemptNumber}`);
|
|
3167
3167
|
}
|
|
3168
3168
|
}
|
|
3169
3169
|
};
|
|
@@ -3181,8 +3181,8 @@ var require_http_request_activity = __commonJS(function(exports) {
|
|
|
3181
3181
|
var http_utils_1 = require_http_utils();
|
|
3182
3182
|
|
|
3183
3183
|
class HttpRequestActivity extends activity_base_1.ActivityBase {
|
|
3184
|
-
constructor(requestDefinition,
|
|
3185
|
-
super(
|
|
3184
|
+
constructor(requestDefinition, logger, name) {
|
|
3185
|
+
super(logger);
|
|
3186
3186
|
this.type = models_1.ActivityType.HttpRequest;
|
|
3187
3187
|
this.name = models_1.ActivityType.HttpRequest;
|
|
3188
3188
|
this.properties = requestDefinition.properties;
|
|
@@ -3423,8 +3423,8 @@ var require_http_file_utils = __commonJS(function(exports) {
|
|
|
3423
3423
|
if (/\.[a-zA-Z0-9]{1,10}$/.test(trimmed)) {
|
|
3424
3424
|
return trimmed;
|
|
3425
3425
|
}
|
|
3426
|
-
const
|
|
3427
|
-
return
|
|
3426
|
+
const ext = getExtensionFromMimeType(mimeType);
|
|
3427
|
+
return ext ? `${trimmed}.${ext}` : trimmed;
|
|
3428
3428
|
}
|
|
3429
3429
|
const headerFileName = extractFileNameFromHeaders(headers);
|
|
3430
3430
|
if (headerFileName)
|
|
@@ -3858,7 +3858,7 @@ var require_is_utils = __commonJS(function(exports) {
|
|
|
3858
3858
|
return true;
|
|
3859
3859
|
};
|
|
3860
3860
|
exports.isPaginationCallRequired = isPaginationCallRequired;
|
|
3861
|
-
var fetchAllPaginatedData = async (requestUrl, initialPageData, maxRecords, queryParameters = {}, method = http_method_1.HttpMethod.GET, headers = {}, useProxyServer = false, proxySettings = undefined, timeoutMs = 30000, retryConfig = undefined,
|
|
3861
|
+
var fetchAllPaginatedData = async (requestUrl, initialPageData, maxRecords, queryParameters = {}, method = http_method_1.HttpMethod.GET, headers = {}, useProxyServer = false, proxySettings = undefined, timeoutMs = 30000, retryConfig = undefined, logger) => {
|
|
3862
3862
|
const pageDetails = (0, exports.extractPageDetailsIfPresent)(initialPageData);
|
|
3863
3863
|
let hasMorePages = pageDetails?.hasMorePages || false;
|
|
3864
3864
|
let nextPageToken = pageDetails?.nextPageToken;
|
|
@@ -3872,14 +3872,14 @@ var require_is_utils = __commonJS(function(exports) {
|
|
|
3872
3872
|
nextPageToken
|
|
3873
3873
|
}
|
|
3874
3874
|
};
|
|
3875
|
-
|
|
3875
|
+
logger.debug(`Starting paginated request with maxRecords: ${maxRecords}`);
|
|
3876
3876
|
while (hasMorePages && allRecords.length < maxRecords) {
|
|
3877
3877
|
pageCount++;
|
|
3878
|
-
|
|
3879
|
-
pageResult = await fetchPaginatedPage(requestUrl, nextPageToken, queryParameters, method, headers, useProxyServer, proxySettings, timeoutMs, retryConfig,
|
|
3878
|
+
logger.debug(`Fetching page ${pageCount}, current records: ${allRecords.length}, nextPageToken: ${nextPageToken ? "present" : "none"}`);
|
|
3879
|
+
pageResult = await fetchPaginatedPage(requestUrl, nextPageToken, queryParameters, method, headers, useProxyServer, proxySettings, timeoutMs, retryConfig, logger);
|
|
3880
3880
|
if (!pageResult.success || !pageResult.data) {
|
|
3881
|
-
|
|
3882
|
-
|
|
3881
|
+
logger.error(`Pagination request failed on page ${pageCount}: ${pageResult.error?.message || "Unknown error"}`);
|
|
3882
|
+
logger.warn(`Returning ${allRecords.length} already fetched records despite pagination error`);
|
|
3883
3883
|
return {
|
|
3884
3884
|
success: false,
|
|
3885
3885
|
data: initialPageData,
|
|
@@ -3889,19 +3889,19 @@ var require_is_utils = __commonJS(function(exports) {
|
|
|
3889
3889
|
const { responseData: pageData, hasMorePages: pageHasMore, nextPageToken: pageNextToken } = pageResult.data;
|
|
3890
3890
|
const pageContent = Array.isArray(pageData.content) ? pageData.content : [];
|
|
3891
3891
|
allRecords.push(...pageContent);
|
|
3892
|
-
|
|
3892
|
+
logger.info(`Page ${pageCount} returned ${pageContent.length} records, total so far: ${allRecords.length}, hasMorePages: ${pageHasMore}, nextPageToken: ${pageNextToken ? "present" : "none"}`);
|
|
3893
3893
|
hasMorePages = pageHasMore && !!pageNextToken;
|
|
3894
3894
|
nextPageToken = pageNextToken;
|
|
3895
3895
|
if (allRecords.length >= maxRecords) {
|
|
3896
|
-
|
|
3896
|
+
logger.debug(`Reached maxRecords limit (${maxRecords}), stopping pagination after ${pageCount} pages`);
|
|
3897
3897
|
break;
|
|
3898
3898
|
}
|
|
3899
3899
|
if (!hasMorePages) {
|
|
3900
|
-
|
|
3900
|
+
logger.debug(`No more pages available, stopping pagination after ${pageCount} pages`);
|
|
3901
3901
|
break;
|
|
3902
3902
|
}
|
|
3903
3903
|
}
|
|
3904
|
-
|
|
3904
|
+
logger.debug(`Pagination completed. Total pages: ${pageCount}, Total records: ${allRecords.length}`);
|
|
3905
3905
|
let finalResponse = pageResult.data?.responseData;
|
|
3906
3906
|
if (!finalResponse) {
|
|
3907
3907
|
return {
|
|
@@ -3934,12 +3934,12 @@ var require_is_utils = __commonJS(function(exports) {
|
|
|
3934
3934
|
return cleanedHeaders;
|
|
3935
3935
|
};
|
|
3936
3936
|
exports.cleanPaginationHeaders = cleanPaginationHeaders;
|
|
3937
|
-
var fetchPaginatedPage = async (requestUrl, nextPageToken, queryParameters = {}, method = http_method_1.HttpMethod.GET, headers = {}, useProxyServer = false, proxySettings = undefined, timeoutMs = 30000, retryConfig = undefined,
|
|
3937
|
+
var fetchPaginatedPage = async (requestUrl, nextPageToken, queryParameters = {}, method = http_method_1.HttpMethod.GET, headers = {}, useProxyServer = false, proxySettings = undefined, timeoutMs = 30000, retryConfig = undefined, logger) => {
|
|
3938
3938
|
const queryParams = {
|
|
3939
3939
|
...queryParameters,
|
|
3940
3940
|
...nextPageToken && { nextPage: nextPageToken }
|
|
3941
3941
|
};
|
|
3942
|
-
const response = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(requestUrl, method, headers, queryParams, undefined, useProxyServer ? proxySettings : undefined, undefined, timeoutMs, retryConfig,
|
|
3942
|
+
const response = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(requestUrl, method, headers, queryParams, undefined, useProxyServer ? proxySettings : undefined, undefined, timeoutMs, retryConfig, logger);
|
|
3943
3943
|
if (!response.success || !response.data) {
|
|
3944
3944
|
return {
|
|
3945
3945
|
success: false,
|
|
@@ -4142,10 +4142,10 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4142
4142
|
});
|
|
4143
4143
|
var __importStar = exports && exports.__importStar || function() {
|
|
4144
4144
|
var ownKeys = function(o) {
|
|
4145
|
-
ownKeys = Object.getOwnPropertyNames || function(
|
|
4145
|
+
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
4146
4146
|
var ar = [];
|
|
4147
|
-
for (var k in
|
|
4148
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
4147
|
+
for (var k in o)
|
|
4148
|
+
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
4149
4149
|
ar[ar.length] = k;
|
|
4150
4150
|
return ar;
|
|
4151
4151
|
};
|
|
@@ -4188,13 +4188,13 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4188
4188
|
}
|
|
4189
4189
|
return false;
|
|
4190
4190
|
}
|
|
4191
|
-
static async postProcessJobsEndpoint(properties, response, baseUrl,
|
|
4191
|
+
static async postProcessJobsEndpoint(properties, response, baseUrl, logger) {
|
|
4192
4192
|
if (!(0, generic_utils_1.hasProperty)(response?.data?.content, "OutputFile")) {
|
|
4193
4193
|
return response;
|
|
4194
4194
|
}
|
|
4195
4195
|
if (!(0, generic_utils_1.hasProperty)(response?.data?.content, "OrganizationUnitId")) {
|
|
4196
4196
|
const err = "No OrganizationUnitId found in the Orchestrator response";
|
|
4197
|
-
|
|
4197
|
+
logger.error(err);
|
|
4198
4198
|
return {
|
|
4199
4199
|
success: false,
|
|
4200
4200
|
error: new Error(err)
|
|
@@ -4202,7 +4202,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4202
4202
|
}
|
|
4203
4203
|
const organizationUnitId = response?.data?.content.OrganizationUnitId;
|
|
4204
4204
|
const outputFileName = response?.data?.content["OutputFile"];
|
|
4205
|
-
let extractedResponse = await OrchestratorUtils.extractOutputFileAndFetchContents(baseUrl, outputFileName, organizationUnitId, properties,
|
|
4205
|
+
let extractedResponse = await OrchestratorUtils.extractOutputFileAndFetchContents(baseUrl, outputFileName, organizationUnitId, properties, logger);
|
|
4206
4206
|
if (!extractedResponse.success) {
|
|
4207
4207
|
return {
|
|
4208
4208
|
success: false,
|
|
@@ -4265,15 +4265,15 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4265
4265
|
};
|
|
4266
4266
|
return { requestUrl, headers };
|
|
4267
4267
|
}
|
|
4268
|
-
static async extractOutputFileAndFetchContents(baseUrl, outputFileName, organizationUnitId, properties,
|
|
4268
|
+
static async extractOutputFileAndFetchContents(baseUrl, outputFileName, organizationUnitId, properties, logger) {
|
|
4269
4269
|
try {
|
|
4270
4270
|
const { requestUrl, headers } = OrchestratorUtils.getAttachmentRequestConfig(baseUrl, outputFileName, properties.accessToken, organizationUnitId);
|
|
4271
|
-
const orchestratorAttachmentResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(requestUrl, http_method_1.HttpMethod.GET, headers, undefined, undefined, undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4271
|
+
const orchestratorAttachmentResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(requestUrl, http_method_1.HttpMethod.GET, headers, undefined, undefined, undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4272
4272
|
try {
|
|
4273
4273
|
const uriValidationResult = OrchestratorUtils.validateAndExtractOutputFileUri(orchestratorAttachmentResponse);
|
|
4274
4274
|
if (!uriValidationResult.success) {
|
|
4275
4275
|
const err = `Error while validating and extracting URI from Orchestrator response: ${uriValidationResult.error}`;
|
|
4276
|
-
|
|
4276
|
+
logger.error(err);
|
|
4277
4277
|
return {
|
|
4278
4278
|
success: false,
|
|
4279
4279
|
error: new Error(err)
|
|
@@ -4282,7 +4282,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4282
4282
|
const uri = uriValidationResult.uri;
|
|
4283
4283
|
const rawOutputFileResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(uri, http_method_1.HttpMethod.GET, {
|
|
4284
4284
|
[constants_1.CONTENT_TYPE]: constants_1.APPLICATION_JSON
|
|
4285
|
-
}, undefined, undefined, undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4285
|
+
}, undefined, undefined, undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4286
4286
|
const contentValidationResponse = OrchestratorUtils.validateAndExtractContentFromOutputFileUriResponse(rawOutputFileResponse);
|
|
4287
4287
|
if (contentValidationResponse.success) {
|
|
4288
4288
|
const parsedContent = OrchestratorUtils.parseJsonOrReturnOriginalObject(contentValidationResponse.content);
|
|
@@ -4292,14 +4292,14 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4292
4292
|
};
|
|
4293
4293
|
}
|
|
4294
4294
|
const validationErr = `Error while extracting content from Orchestrator output file: ${contentValidationResponse.error}`;
|
|
4295
|
-
|
|
4295
|
+
logger.error(validationErr);
|
|
4296
4296
|
return {
|
|
4297
4297
|
success: false,
|
|
4298
4298
|
error: new Error(validationErr)
|
|
4299
4299
|
};
|
|
4300
4300
|
} catch (error) {
|
|
4301
4301
|
const err = `Error requesting Orchestrator output file URI : ${(0, utils_1.getErrorMessage)(error)}`;
|
|
4302
|
-
|
|
4302
|
+
logger.error(err);
|
|
4303
4303
|
return {
|
|
4304
4304
|
success: false,
|
|
4305
4305
|
error: new Error(err)
|
|
@@ -4307,7 +4307,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4307
4307
|
}
|
|
4308
4308
|
} catch (error) {
|
|
4309
4309
|
const err = `Error while extracting content from Orchestrator output file: ${(0, utils_1.getErrorMessage)(error)}`;
|
|
4310
|
-
|
|
4310
|
+
logger.error(err);
|
|
4311
4311
|
return {
|
|
4312
4312
|
success: false,
|
|
4313
4313
|
error: new Error(err)
|
|
@@ -4318,7 +4318,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4318
4318
|
error: new Error(`Error while extracting content from Orchestrator output file`)
|
|
4319
4319
|
};
|
|
4320
4320
|
}
|
|
4321
|
-
static async handleOversizedInputArguments(properties, baseUrl,
|
|
4321
|
+
static async handleOversizedInputArguments(properties, baseUrl, logger, activityName) {
|
|
4322
4322
|
if (!properties?.body) {
|
|
4323
4323
|
return;
|
|
4324
4324
|
}
|
|
@@ -4333,25 +4333,25 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4333
4333
|
}
|
|
4334
4334
|
const filename = (0, generic_utils_1.getNewGuid)();
|
|
4335
4335
|
try {
|
|
4336
|
-
const { attachmentId, blobStorageUrl, uploadHeaders } = await OrchestratorUtils.createOrchestratorAttachmentAndGetUploadMetadata(properties, baseUrl, filename,
|
|
4337
|
-
|
|
4336
|
+
const { attachmentId, blobStorageUrl, uploadHeaders } = await OrchestratorUtils.createOrchestratorAttachmentAndGetUploadMetadata(properties, baseUrl, filename, logger, activityName);
|
|
4337
|
+
logger.debug(`[${activityName}] Uploading content to Azure Blob Storage: ${blobStorageUrl}`);
|
|
4338
4338
|
const encoder = new TextEncoder;
|
|
4339
4339
|
const fileContent = encoder.encode(inputString);
|
|
4340
|
-
|
|
4341
|
-
const attachmentUploadResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(blobStorageUrl, http_method_1.HttpMethod.PUT, uploadHeaders, undefined, fileContent, undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4340
|
+
logger.debug(`[${activityName}] Prepared content bytes for upload (${fileContent.length} bytes)`);
|
|
4341
|
+
const attachmentUploadResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(blobStorageUrl, http_method_1.HttpMethod.PUT, uploadHeaders, undefined, fileContent, undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger, undefined, undefined, undefined, true);
|
|
4342
4342
|
if (!attachmentUploadResponse.success) {
|
|
4343
4343
|
const errorMsg = `Failed to upload content to Azure Blob Storage: ${attachmentUploadResponse.error?.message || "Unknown error"}`;
|
|
4344
|
-
|
|
4344
|
+
logger.error(`[${activityName}] ${errorMsg}`);
|
|
4345
4345
|
throw new Error(errorMsg);
|
|
4346
4346
|
}
|
|
4347
|
-
|
|
4347
|
+
logger.debug(`[${activityName}] Successfully uploaded content to Azure Blob Storage`);
|
|
4348
4348
|
properties.body = {
|
|
4349
4349
|
...body,
|
|
4350
4350
|
InputFile: attachmentId
|
|
4351
4351
|
};
|
|
4352
4352
|
delete properties.body.InputArguments;
|
|
4353
4353
|
} catch (error) {
|
|
4354
|
-
|
|
4354
|
+
logger.error(`[${activityName}] Error processing large InputArguments: ${error}`);
|
|
4355
4355
|
return;
|
|
4356
4356
|
}
|
|
4357
4357
|
}
|
|
@@ -4368,18 +4368,18 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4368
4368
|
].join("/");
|
|
4369
4369
|
return `${baseUrl}/${path}`;
|
|
4370
4370
|
}
|
|
4371
|
-
static async createOrchestratorAttachmentAndGetUploadMetadata(properties, baseUrl, filename,
|
|
4371
|
+
static async createOrchestratorAttachmentAndGetUploadMetadata(properties, baseUrl, filename, logger, activityName) {
|
|
4372
4372
|
try {
|
|
4373
4373
|
const url = baseUrl + OrchestratorUtils.ATTACHMENTS_ENDPOINT;
|
|
4374
4374
|
const attachmentCreationPayload = {
|
|
4375
4375
|
Name: filename
|
|
4376
4376
|
};
|
|
4377
|
-
|
|
4377
|
+
logger.debug(`[${activityName}] Creating attachment: ${filename}`);
|
|
4378
4378
|
const attachmentCreationRequestHeaders = {
|
|
4379
4379
|
...properties.headers
|
|
4380
4380
|
};
|
|
4381
|
-
let attachmentCreationResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(url, http_method_1.HttpMethod.POST, attachmentCreationRequestHeaders, undefined, attachmentCreationPayload, properties.useProxyServer ? properties.proxySettings : undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4382
|
-
const attachmentMetadata = OrchestratorUtils.validateAndExtractAttachmentMetadata(attachmentCreationResponse,
|
|
4381
|
+
let attachmentCreationResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(url, http_method_1.HttpMethod.POST, attachmentCreationRequestHeaders, undefined, attachmentCreationPayload, properties.useProxyServer ? properties.proxySettings : undefined, undefined, properties.timeoutMs || 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4382
|
+
const attachmentMetadata = OrchestratorUtils.validateAndExtractAttachmentMetadata(attachmentCreationResponse, logger, activityName);
|
|
4383
4383
|
if (!attachmentMetadata.success) {
|
|
4384
4384
|
throw attachmentMetadata.error;
|
|
4385
4385
|
}
|
|
@@ -4389,14 +4389,14 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4389
4389
|
uploadHeaders: attachmentMetadata.data.uploadHeaders
|
|
4390
4390
|
};
|
|
4391
4391
|
} catch (error) {
|
|
4392
|
-
|
|
4392
|
+
logger.error(`[${activityName}] Error in createOrchestratorAttachmentAndGetUploadMetadata: ${error}`);
|
|
4393
4393
|
throw error;
|
|
4394
4394
|
}
|
|
4395
4395
|
}
|
|
4396
|
-
static validateAndExtractAttachmentMetadata(attachmentCreationResponse,
|
|
4396
|
+
static validateAndExtractAttachmentMetadata(attachmentCreationResponse, logger, activityName) {
|
|
4397
4397
|
if (!attachmentCreationResponse.success || !attachmentCreationResponse.data) {
|
|
4398
4398
|
const errorMsg = `Failed to create attachment: ${attachmentCreationResponse.error?.message || "Unknown error"}`;
|
|
4399
|
-
|
|
4399
|
+
logger.error(`[${activityName}] ${errorMsg}`);
|
|
4400
4400
|
return {
|
|
4401
4401
|
success: false,
|
|
4402
4402
|
data: undefined,
|
|
@@ -4405,7 +4405,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4405
4405
|
}
|
|
4406
4406
|
if (!(0, generic_utils_1.hasProperty)(attachmentCreationResponse.data, "content")) {
|
|
4407
4407
|
const errorMsg = "Invalid attachment response: missing content";
|
|
4408
|
-
|
|
4408
|
+
logger.error(`[${activityName}] ${errorMsg}`);
|
|
4409
4409
|
return {
|
|
4410
4410
|
success: false,
|
|
4411
4411
|
data: undefined,
|
|
@@ -4415,7 +4415,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4415
4415
|
const content = attachmentCreationResponse.data.content;
|
|
4416
4416
|
if (!(0, generic_utils_1.hasProperty)(content, "Id") || !(0, generic_utils_1.hasProperty)(content, "BlobFileAccess") || !(0, generic_utils_1.hasProperty)(content.BlobFileAccess, "Uri")) {
|
|
4417
4417
|
const errorMsg = `Invalid attachment response: missing Id or BlobFileAccess or Uri`;
|
|
4418
|
-
|
|
4418
|
+
logger.error(`[${activityName}] ${errorMsg}`);
|
|
4419
4419
|
return {
|
|
4420
4420
|
success: false,
|
|
4421
4421
|
data: undefined,
|
|
@@ -4433,7 +4433,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4433
4433
|
uploadHeaders[headers.Keys[i]] = headers.Values[i];
|
|
4434
4434
|
}
|
|
4435
4435
|
}
|
|
4436
|
-
|
|
4436
|
+
logger.debug(`[${activityName}] Extracted upload headers from BlobFileAccess Keys/Values: ${JSON.stringify(Object.keys(uploadHeaders))}`);
|
|
4437
4437
|
}
|
|
4438
4438
|
}
|
|
4439
4439
|
return {
|
|
@@ -4446,7 +4446,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4446
4446
|
error: undefined
|
|
4447
4447
|
};
|
|
4448
4448
|
}
|
|
4449
|
-
static async uploadFileToBlob(baseUrl, accessToken, organizationId, tenantId, content, fileName, mimeType,
|
|
4449
|
+
static async uploadFileToBlob(baseUrl, accessToken, organizationId, tenantId, content, fileName, mimeType, logger, folderKey, options = {}) {
|
|
4450
4450
|
const { encoding = "byte-array" } = options;
|
|
4451
4451
|
const url = `${baseUrl}/${organizationId}/${tenantId}${OrchestratorUtils.ATTACHMENTS_ENDPOINT}`;
|
|
4452
4452
|
const headers = {
|
|
@@ -4456,8 +4456,8 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4456
4456
|
if (folderKey) {
|
|
4457
4457
|
headers[OrchestratorUtils.ORCHESTRATOR_FOLDER_KEY] = folderKey;
|
|
4458
4458
|
}
|
|
4459
|
-
const attachmentCreationResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(url, http_method_1.HttpMethod.POST, headers, undefined, { Name: fileName }, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4460
|
-
const metadata = OrchestratorUtils.validateAndExtractAttachmentMetadata(attachmentCreationResponse,
|
|
4459
|
+
const attachmentCreationResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(url, http_method_1.HttpMethod.POST, headers, undefined, { Name: fileName }, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4460
|
+
const metadata = OrchestratorUtils.validateAndExtractAttachmentMetadata(attachmentCreationResponse, logger, "uploadFileToBlob");
|
|
4461
4461
|
if (!metadata.success || !metadata.data) {
|
|
4462
4462
|
throw metadata.error || new Error("Failed to create attachment record");
|
|
4463
4463
|
}
|
|
@@ -4466,7 +4466,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4466
4466
|
if (!uploadResponse.success) {
|
|
4467
4467
|
throw new Error(`Failed to upload file to blob storage: ${uploadResponse.error?.message || "Unknown error"}`);
|
|
4468
4468
|
}
|
|
4469
|
-
|
|
4469
|
+
logger.debug(`File uploaded to blob storage: ${attachmentId} (${fileName})`);
|
|
4470
4470
|
return {
|
|
4471
4471
|
ID: attachmentId,
|
|
4472
4472
|
FullName: fileName,
|
|
@@ -4477,7 +4477,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4477
4477
|
}
|
|
4478
4478
|
};
|
|
4479
4479
|
}
|
|
4480
|
-
static async downloadFileFromBlob(baseUrl, accessToken, organizationId, tenantId, attachmentId,
|
|
4480
|
+
static async downloadFileFromBlob(baseUrl, accessToken, organizationId, tenantId, attachmentId, logger, folderKey) {
|
|
4481
4481
|
const attachmentUrl = `${baseUrl}/${organizationId}/${tenantId}${OrchestratorUtils.ATTACHMENTS_ENDPOINT}(${attachmentId})`;
|
|
4482
4482
|
const headers = {
|
|
4483
4483
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -4486,7 +4486,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4486
4486
|
if (folderKey) {
|
|
4487
4487
|
headers[OrchestratorUtils.ORCHESTRATOR_FOLDER_KEY] = folderKey;
|
|
4488
4488
|
}
|
|
4489
|
-
const attachmentResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(attachmentUrl, http_method_1.HttpMethod.GET, headers, undefined, undefined, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4489
|
+
const attachmentResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(attachmentUrl, http_method_1.HttpMethod.GET, headers, undefined, undefined, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4490
4490
|
const uriResult = OrchestratorUtils.validateAndExtractOutputFileUri(attachmentResponse);
|
|
4491
4491
|
if (!uriResult.success || !uriResult.uri) {
|
|
4492
4492
|
throw new Error(`Failed to get blob URI for attachment ${attachmentId}: ${uriResult.error}`);
|
|
@@ -4514,7 +4514,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4514
4514
|
}
|
|
4515
4515
|
}
|
|
4516
4516
|
const mimeType = contentTypeKey ? responseHeaders[contentTypeKey] : "application/octet-stream";
|
|
4517
|
-
|
|
4517
|
+
logger.debug(`File downloaded from blob storage: ${attachmentId} (${binaryContent.length} bytes)`);
|
|
4518
4518
|
return {
|
|
4519
4519
|
name: fileName,
|
|
4520
4520
|
mimeType,
|
|
@@ -4541,7 +4541,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4541
4541
|
}
|
|
4542
4542
|
return "orchestrator-put";
|
|
4543
4543
|
}
|
|
4544
|
-
static async openBlobDownloadStream(baseUrl, accessToken, organizationId, tenantId, attachmentId,
|
|
4544
|
+
static async openBlobDownloadStream(baseUrl, accessToken, organizationId, tenantId, attachmentId, logger, folderKey, options) {
|
|
4545
4545
|
const attachmentUrl = `${baseUrl}/${organizationId}/${tenantId}${OrchestratorUtils.ATTACHMENTS_ENDPOINT}(${attachmentId})`;
|
|
4546
4546
|
const headers = {
|
|
4547
4547
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -4550,18 +4550,18 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4550
4550
|
if (folderKey) {
|
|
4551
4551
|
headers[OrchestratorUtils.ORCHESTRATOR_FOLDER_KEY] = folderKey;
|
|
4552
4552
|
}
|
|
4553
|
-
const attachmentResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(attachmentUrl, http_method_1.HttpMethod.GET, headers, undefined, undefined, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4553
|
+
const attachmentResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(attachmentUrl, http_method_1.HttpMethod.GET, headers, undefined, undefined, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4554
4554
|
const uriResult = OrchestratorUtils.validateAndExtractOutputFileUri(attachmentResponse);
|
|
4555
4555
|
if (!uriResult.success || !uriResult.uri) {
|
|
4556
4556
|
throw new Error(`Failed to get blob URI for attachment ${attachmentId}: ${uriResult.error}`);
|
|
4557
4557
|
}
|
|
4558
|
-
const tail = options?.tailBytes !== undefined && options.tailBytes > 0 ? await OrchestratorUtils.peekBlobTail(uriResult.uri, options.tailBytes,
|
|
4558
|
+
const tail = options?.tailBytes !== undefined && options.tailBytes > 0 ? await OrchestratorUtils.peekBlobTail(uriResult.uri, options.tailBytes, logger) : undefined;
|
|
4559
4559
|
const response = await fetch(uriResult.uri, { method: http_method_1.HttpMethod.GET });
|
|
4560
4560
|
if (!response.ok || !response.body) {
|
|
4561
4561
|
await OrchestratorUtils.discardResponseBody(response);
|
|
4562
4562
|
throw new Error(`Failed to open download stream for attachment ${attachmentId}: HTTP ${response.status}`);
|
|
4563
4563
|
}
|
|
4564
|
-
|
|
4564
|
+
logger.debug(`Opened streaming download for attachment ${attachmentId}`);
|
|
4565
4565
|
const parsedSize = Number(response.headers.get("content-length") ?? NaN);
|
|
4566
4566
|
return {
|
|
4567
4567
|
stream: response.body,
|
|
@@ -4570,7 +4570,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4570
4570
|
tail
|
|
4571
4571
|
};
|
|
4572
4572
|
}
|
|
4573
|
-
static async peekBlobTail(blobUri, tailBytes,
|
|
4573
|
+
static async peekBlobTail(blobUri, tailBytes, logger) {
|
|
4574
4574
|
try {
|
|
4575
4575
|
const response = await fetch(blobUri, {
|
|
4576
4576
|
method: http_method_1.HttpMethod.GET,
|
|
@@ -4588,20 +4588,20 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4588
4588
|
}
|
|
4589
4589
|
return new Uint8Array(await response.arrayBuffer());
|
|
4590
4590
|
} catch (error) {
|
|
4591
|
-
|
|
4591
|
+
logger.debug(`Blob tail peek failed (best-effort, download proceeds): ${(0, utils_1.getErrorMessage)(error)}`);
|
|
4592
4592
|
return;
|
|
4593
4593
|
}
|
|
4594
4594
|
}
|
|
4595
|
-
static async uploadBlobStream(baseUrl, accessToken, organizationId, tenantId, source, fileName, mimeType,
|
|
4596
|
-
const { attachmentId, blobStorageUrl, uploadHeaders } = await OrchestratorUtils.createAttachmentForUpload(baseUrl, accessToken, organizationId, tenantId, fileName,
|
|
4595
|
+
static async uploadBlobStream(baseUrl, accessToken, organizationId, tenantId, source, fileName, mimeType, logger, encoding = "byte-array", folderKey, options = {}) {
|
|
4596
|
+
const { attachmentId, blobStorageUrl, uploadHeaders } = await OrchestratorUtils.createAttachmentForUpload(baseUrl, accessToken, organizationId, tenantId, fileName, logger, folderKey);
|
|
4597
4597
|
const target = OrchestratorUtils.detectBlobUploadTarget(blobStorageUrl, uploadHeaders);
|
|
4598
|
-
const totalBytes = target === "azure-block" ? await OrchestratorUtils.uploadViaAzureBlocks(blobStorageUrl, source, mimeType, uploadHeaders,
|
|
4598
|
+
const totalBytes = target === "azure-block" ? await OrchestratorUtils.uploadViaAzureBlocks(blobStorageUrl, source, mimeType, uploadHeaders, logger) : await OrchestratorUtils.uploadViaSinglePut(target, blobStorageUrl, source, mimeType, uploadHeaders, {
|
|
4599
4599
|
orchestratorBaseUrl: baseUrl,
|
|
4600
4600
|
accessToken,
|
|
4601
|
-
logger
|
|
4601
|
+
logger,
|
|
4602
4602
|
...options
|
|
4603
4603
|
});
|
|
4604
|
-
|
|
4604
|
+
logger.debug(`Streamed ${totalBytes} bytes to blob storage (${target}): ${attachmentId} (${fileName})`);
|
|
4605
4605
|
return {
|
|
4606
4606
|
ID: attachmentId,
|
|
4607
4607
|
FullName: fileName,
|
|
@@ -4612,7 +4612,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4612
4612
|
}
|
|
4613
4613
|
};
|
|
4614
4614
|
}
|
|
4615
|
-
static async uploadViaAzureBlocks(blobStorageUrl, source, mimeType, uploadHeaders,
|
|
4615
|
+
static async uploadViaAzureBlocks(blobStorageUrl, source, mimeType, uploadHeaders, logger) {
|
|
4616
4616
|
const storageHeaders = Object.fromEntries(Object.entries(uploadHeaders).filter(([key]) => key.toLowerCase() !== "x-ms-blob-type"));
|
|
4617
4617
|
const blockIds = [];
|
|
4618
4618
|
const totalBytes = await OrchestratorUtils.accumulateBlocks(source, async (block) => {
|
|
@@ -4621,7 +4621,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4621
4621
|
blockIds.push(blockId);
|
|
4622
4622
|
});
|
|
4623
4623
|
await OrchestratorUtils.putBlockList(blobStorageUrl, blockIds, mimeType, storageHeaders);
|
|
4624
|
-
|
|
4624
|
+
logger.debug(`Staged ${blockIds.length} block(s) via the Azure block-blob protocol`);
|
|
4625
4625
|
return totalBytes;
|
|
4626
4626
|
}
|
|
4627
4627
|
static async accumulateBlocks(source, onBlock, onChunk) {
|
|
@@ -4668,25 +4668,25 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4668
4668
|
const streamBody = target === "orchestrator-put" && (context.requestStreamBodySupported ?? (0, http_utils_1.supportsRequestStreamBody)());
|
|
4669
4669
|
if (streamBody) {
|
|
4670
4670
|
context.logger.debug(`Uploading via single streamed PUT (${target})`);
|
|
4671
|
-
let
|
|
4671
|
+
let totalBytes = 0;
|
|
4672
4672
|
let pulled = false;
|
|
4673
4673
|
const body = OrchestratorUtils.toRequestStream(source, (byteLength) => {
|
|
4674
|
-
|
|
4674
|
+
totalBytes += byteLength;
|
|
4675
4675
|
}, () => {
|
|
4676
4676
|
pulled = true;
|
|
4677
4677
|
});
|
|
4678
4678
|
try {
|
|
4679
|
-
const
|
|
4679
|
+
const response = await fetch(blobStorageUrl, {
|
|
4680
4680
|
method: http_method_1.HttpMethod.PUT,
|
|
4681
4681
|
headers,
|
|
4682
4682
|
body,
|
|
4683
4683
|
duplex: "half"
|
|
4684
4684
|
});
|
|
4685
|
-
if (!
|
|
4686
|
-
await OrchestratorUtils.discardResponseBody(
|
|
4687
|
-
throw new Error(`Failed to upload blob via single streamed PUT (${target}): HTTP ${
|
|
4685
|
+
if (!response.ok) {
|
|
4686
|
+
await OrchestratorUtils.discardResponseBody(response);
|
|
4687
|
+
throw new Error(`Failed to upload blob via single streamed PUT (${target}): HTTP ${response.status}`);
|
|
4688
4688
|
}
|
|
4689
|
-
return
|
|
4689
|
+
return totalBytes;
|
|
4690
4690
|
} catch (error) {
|
|
4691
4691
|
if (pulled) {
|
|
4692
4692
|
throw error;
|
|
@@ -4836,7 +4836,7 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4836
4836
|
return false;
|
|
4837
4837
|
}
|
|
4838
4838
|
}
|
|
4839
|
-
static async createAttachmentForUpload(baseUrl, accessToken, organizationId, tenantId, fileName,
|
|
4839
|
+
static async createAttachmentForUpload(baseUrl, accessToken, organizationId, tenantId, fileName, logger, folderKey) {
|
|
4840
4840
|
const url = `${baseUrl}/${organizationId}/${tenantId}${OrchestratorUtils.ATTACHMENTS_ENDPOINT}`;
|
|
4841
4841
|
const headers = {
|
|
4842
4842
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -4845,8 +4845,8 @@ var require_orchestrator_utils = __commonJS(function(exports) {
|
|
|
4845
4845
|
if (folderKey) {
|
|
4846
4846
|
headers[OrchestratorUtils.ORCHESTRATOR_FOLDER_KEY] = folderKey;
|
|
4847
4847
|
}
|
|
4848
|
-
const attachmentCreationResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(url, http_method_1.HttpMethod.POST, headers, undefined, { Name: fileName }, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG,
|
|
4849
|
-
const metadata = OrchestratorUtils.validateAndExtractAttachmentMetadata(attachmentCreationResponse,
|
|
4848
|
+
const attachmentCreationResponse = await (0, http_retry_utils_1.makeHttpRequestWithRetry)(url, http_method_1.HttpMethod.POST, headers, undefined, { Name: fileName }, undefined, undefined, 30000, OrchestratorUtils.DEFAULT_HTTP_RETRY_CONFIG, logger);
|
|
4849
|
+
const metadata = OrchestratorUtils.validateAndExtractAttachmentMetadata(attachmentCreationResponse, logger, "uploadBlobStream");
|
|
4850
4850
|
if (!metadata.success || !metadata.data) {
|
|
4851
4851
|
throw metadata.error || new Error("Failed to create attachment record");
|
|
4852
4852
|
}
|
|
@@ -4959,8 +4959,8 @@ var require_int_svc_api_request_activity = __commonJS(function(exports) {
|
|
|
4959
4959
|
var url_input_encoding_1 = require_url_input_encoding();
|
|
4960
4960
|
|
|
4961
4961
|
class IntSvcApiRequestActivity extends activity_base_1.ActivityBase {
|
|
4962
|
-
constructor(requestDefinition,
|
|
4963
|
-
super(
|
|
4962
|
+
constructor(requestDefinition, logger, name) {
|
|
4963
|
+
super(logger);
|
|
4964
4964
|
this.type = models_1.ActivityType.IntSvcApiRequest;
|
|
4965
4965
|
this.name = models_1.ActivityType.IntSvcApiRequest;
|
|
4966
4966
|
this.INTEGRATION_SERVICE_PATH_PREFIX = "elements_/v3/element/instances";
|
|
@@ -5098,7 +5098,7 @@ var require_int_svc_api_request_activity = __commonJS(function(exports) {
|
|
|
5098
5098
|
}
|
|
5099
5099
|
await new Promise((resolve) => setTimeout(resolve, interval));
|
|
5100
5100
|
} while (currentResponse.data.statusCode === 202);
|
|
5101
|
-
function logPollingTimeDetails(
|
|
5101
|
+
function logPollingTimeDetails(logger, success) {
|
|
5102
5102
|
const jobRequestToPollStartTime = timeMakingIsRequest - startTime;
|
|
5103
5103
|
const totalPollingTime = Date.now() - startTime;
|
|
5104
5104
|
const pollingRequestDurations = pollingRequestDurationsMs.map((duration, index) => {
|
|
@@ -5117,7 +5117,7 @@ var require_int_svc_api_request_activity = __commonJS(function(exports) {
|
|
|
5117
5117
|
pollingRequestDurations
|
|
5118
5118
|
};
|
|
5119
5119
|
const logMessage = `[IntSvcApiRequestActivity] Async process polling time details: ${JSON.stringify(asyncProcessPollingTimeDetails)}`;
|
|
5120
|
-
|
|
5120
|
+
logger.warn(logMessage);
|
|
5121
5121
|
console.warn(logMessage);
|
|
5122
5122
|
}
|
|
5123
5123
|
logPollingTimeDetails(this.logger, true);
|
|
@@ -5241,8 +5241,8 @@ var require_int_svc_event_api_request_activity = __commonJS(function(exports) {
|
|
|
5241
5241
|
};
|
|
5242
5242
|
|
|
5243
5243
|
class IntSvcEventApiRequestActivity extends activity_base_1.ActivityBase {
|
|
5244
|
-
constructor(requestDefinition,
|
|
5245
|
-
super(
|
|
5244
|
+
constructor(requestDefinition, logger, name) {
|
|
5245
|
+
super(logger);
|
|
5246
5246
|
this.type = models_1.ActivityType.IntSvcEventRequest;
|
|
5247
5247
|
this.name = models_1.ActivityType.IntSvcEventRequest;
|
|
5248
5248
|
this.INTEGRATION_SERVICE_PATH_PREFIX = "elements_/v3/element/instances";
|
|
@@ -5442,7 +5442,7 @@ ${finalScript}
|
|
|
5442
5442
|
})();`);
|
|
5443
5443
|
const executeScript = async () => {
|
|
5444
5444
|
const scriptTimeoutMs = timeoutMs || ScriptConfigConstants.DEFAULT_SANDBOX_CONFIG.timeoutMs;
|
|
5445
|
-
const
|
|
5445
|
+
const result = await Promise.race([
|
|
5446
5446
|
scriptFn(...paramValues, ...Object.values(sandbox)),
|
|
5447
5447
|
new Promise((_, reject) => {
|
|
5448
5448
|
const timer = setTimeout(() => reject(new Error(`Script execution timed out after ${scriptTimeoutMs}ms`)), scriptTimeoutMs);
|
|
@@ -5451,7 +5451,7 @@ ${finalScript}
|
|
|
5451
5451
|
}
|
|
5452
5452
|
})
|
|
5453
5453
|
]);
|
|
5454
|
-
return
|
|
5454
|
+
return result;
|
|
5455
5455
|
};
|
|
5456
5456
|
let result = await executeScript();
|
|
5457
5457
|
return result;
|
|
@@ -5471,8 +5471,8 @@ var require_execute_script_activity = __commonJS(function(exports) {
|
|
|
5471
5471
|
var local_script_executor_1 = require_local_script_executor();
|
|
5472
5472
|
|
|
5473
5473
|
class ExecuteScriptActivity extends activity_base_1.ActivityBase {
|
|
5474
|
-
constructor(definition,
|
|
5475
|
-
super(
|
|
5474
|
+
constructor(definition, logger, name) {
|
|
5475
|
+
super(logger);
|
|
5476
5476
|
this.type = models_1.ActivityType.ScriptExecution;
|
|
5477
5477
|
this.name = models_1.ActivityType.ScriptExecution;
|
|
5478
5478
|
this.properties = definition.properties;
|
|
@@ -5770,8 +5770,8 @@ var require_log_message_activity = __commonJS(function(exports) {
|
|
|
5770
5770
|
var activity_base_1 = require_activity_base();
|
|
5771
5771
|
|
|
5772
5772
|
class LogMessageActivity extends activity_base_1.ActivityBase {
|
|
5773
|
-
constructor(definition,
|
|
5774
|
-
super(
|
|
5773
|
+
constructor(definition, logger, name) {
|
|
5774
|
+
super(logger);
|
|
5775
5775
|
this.type = activities_1.ActivityType.LogMessage;
|
|
5776
5776
|
this.name = activities_1.ActivityType.LogMessage;
|
|
5777
5777
|
this.properties = definition.properties;
|
|
@@ -5797,14 +5797,14 @@ var require_activity_factory = __commonJS(function(exports) {
|
|
|
5797
5797
|
var log_message_activity_1 = require_log_message_activity();
|
|
5798
5798
|
var execute_script_activity_1 = require_execute_script_activity();
|
|
5799
5799
|
var models_1 = require_models();
|
|
5800
|
-
function ActivityFactory(activityDefinition,
|
|
5800
|
+
function ActivityFactory(activityDefinition, logger, name) {
|
|
5801
5801
|
switch (activityDefinition.type) {
|
|
5802
5802
|
case models_1.ActivityType.HttpRequest:
|
|
5803
|
-
return new http_request_activity_1.HttpRequestActivity(activityDefinition,
|
|
5803
|
+
return new http_request_activity_1.HttpRequestActivity(activityDefinition, logger, name);
|
|
5804
5804
|
case models_1.ActivityType.ScriptExecution:
|
|
5805
|
-
return new execute_script_activity_1.ExecuteScriptActivity(activityDefinition,
|
|
5805
|
+
return new execute_script_activity_1.ExecuteScriptActivity(activityDefinition, logger, name);
|
|
5806
5806
|
case models_1.ActivityType.LogMessage:
|
|
5807
|
-
return new log_message_activity_1.LogMessageActivity(activityDefinition,
|
|
5807
|
+
return new log_message_activity_1.LogMessageActivity(activityDefinition, logger, name);
|
|
5808
5808
|
default:
|
|
5809
5809
|
throw new Error(`Unsupported step type: ${activityDefinition.type}`);
|
|
5810
5810
|
}
|
|
@@ -5857,24 +5857,24 @@ var require_workflow_error = __commonJS(function(exports) {
|
|
|
5857
5857
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5858
5858
|
exports.WorkflowError = exports.WorkflowErrorStatus = exports.WorkflowErrorType = undefined;
|
|
5859
5859
|
var WorkflowErrorType;
|
|
5860
|
-
(function(
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5860
|
+
(function(WorkflowErrorType) {
|
|
5861
|
+
WorkflowErrorType["CONFIGURATION_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/configuration";
|
|
5862
|
+
WorkflowErrorType["VALIDATION_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/validation";
|
|
5863
|
+
WorkflowErrorType["EXPRESSION_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/expression";
|
|
5864
|
+
WorkflowErrorType["AUTHENTICATION_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/authentication";
|
|
5865
|
+
WorkflowErrorType["AUTHORIZATION_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/authorization";
|
|
5866
|
+
WorkflowErrorType["TIMEOUT_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/timeout";
|
|
5867
|
+
WorkflowErrorType["COMMUNICATION_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/communication";
|
|
5868
|
+
WorkflowErrorType["RUNTIME_ERROR"] = "https://serverlessworkflow.io/spec/1.0.0/errors/runtime";
|
|
5869
5869
|
})(WorkflowErrorType || (exports.WorkflowErrorType = WorkflowErrorType = {}));
|
|
5870
5870
|
var WorkflowErrorStatus;
|
|
5871
|
-
(function(
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5871
|
+
(function(WorkflowErrorStatus) {
|
|
5872
|
+
WorkflowErrorStatus[WorkflowErrorStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
5873
|
+
WorkflowErrorStatus[WorkflowErrorStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
5874
|
+
WorkflowErrorStatus[WorkflowErrorStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
5875
|
+
WorkflowErrorStatus[WorkflowErrorStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
5876
|
+
WorkflowErrorStatus[WorkflowErrorStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
5877
|
+
WorkflowErrorStatus[WorkflowErrorStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
5878
5878
|
})(WorkflowErrorStatus || (exports.WorkflowErrorStatus = WorkflowErrorStatus = {}));
|
|
5879
5879
|
|
|
5880
5880
|
class WorkflowError extends Error {
|
|
@@ -6021,8 +6021,8 @@ var require_moment = __commonJS(function(exports, module) {
|
|
|
6021
6021
|
}
|
|
6022
6022
|
return a;
|
|
6023
6023
|
}
|
|
6024
|
-
function createUTC(input,
|
|
6025
|
-
return createLocalOrUTC(input,
|
|
6024
|
+
function createUTC(input, format, locale, strict) {
|
|
6025
|
+
return createLocalOrUTC(input, format, locale, strict, true).utc();
|
|
6026
6026
|
}
|
|
6027
6027
|
function defaultParsingFlags() {
|
|
6028
6028
|
return {
|
|
@@ -6094,48 +6094,48 @@ var require_moment = __commonJS(function(exports, module) {
|
|
|
6094
6094
|
return m;
|
|
6095
6095
|
}
|
|
6096
6096
|
var momentProperties = hooks.momentProperties = [], updateInProgress = false;
|
|
6097
|
-
function copyConfig(
|
|
6097
|
+
function copyConfig(to, from) {
|
|
6098
6098
|
var i, prop, val, momentPropertiesLen = momentProperties.length;
|
|
6099
|
-
if (!isUndefined(
|
|
6100
|
-
|
|
6099
|
+
if (!isUndefined(from._isAMomentObject)) {
|
|
6100
|
+
to._isAMomentObject = from._isAMomentObject;
|
|
6101
6101
|
}
|
|
6102
|
-
if (!isUndefined(
|
|
6103
|
-
|
|
6102
|
+
if (!isUndefined(from._i)) {
|
|
6103
|
+
to._i = from._i;
|
|
6104
6104
|
}
|
|
6105
|
-
if (!isUndefined(
|
|
6106
|
-
|
|
6105
|
+
if (!isUndefined(from._f)) {
|
|
6106
|
+
to._f = from._f;
|
|
6107
6107
|
}
|
|
6108
|
-
if (!isUndefined(
|
|
6109
|
-
|
|
6108
|
+
if (!isUndefined(from._l)) {
|
|
6109
|
+
to._l = from._l;
|
|
6110
6110
|
}
|
|
6111
|
-
if (!isUndefined(
|
|
6112
|
-
|
|
6111
|
+
if (!isUndefined(from._strict)) {
|
|
6112
|
+
to._strict = from._strict;
|
|
6113
6113
|
}
|
|
6114
|
-
if (!isUndefined(
|
|
6115
|
-
|
|
6114
|
+
if (!isUndefined(from._tzm)) {
|
|
6115
|
+
to._tzm = from._tzm;
|
|
6116
6116
|
}
|
|
6117
|
-
if (!isUndefined(
|
|
6118
|
-
|
|
6117
|
+
if (!isUndefined(from._isUTC)) {
|
|
6118
|
+
to._isUTC = from._isUTC;
|
|
6119
6119
|
}
|
|
6120
|
-
if (!isUndefined(
|
|
6121
|
-
|
|
6120
|
+
if (!isUndefined(from._offset)) {
|
|
6121
|
+
to._offset = from._offset;
|
|
6122
6122
|
}
|
|
6123
|
-
if (!isUndefined(
|
|
6124
|
-
|
|
6123
|
+
if (!isUndefined(from._pf)) {
|
|
6124
|
+
to._pf = getParsingFlags(from);
|
|
6125
6125
|
}
|
|
6126
|
-
if (!isUndefined(
|
|
6127
|
-
|
|
6126
|
+
if (!isUndefined(from._locale)) {
|
|
6127
|
+
to._locale = from._locale;
|
|
6128
6128
|
}
|
|
6129
6129
|
if (momentPropertiesLen > 0) {
|
|
6130
6130
|
for (i = 0;i < momentPropertiesLen; i++) {
|
|
6131
6131
|
prop = momentProperties[i];
|
|
6132
|
-
val =
|
|
6132
|
+
val = from[prop];
|
|
6133
6133
|
if (!isUndefined(val)) {
|
|
6134
|
-
|
|
6134
|
+
to[prop] = val;
|
|
6135
6135
|
}
|
|
6136
6136
|
}
|
|
6137
6137
|
}
|
|
6138
|
-
return
|
|
6138
|
+
return to;
|
|
6139
6139
|
}
|
|
6140
6140
|
function Moment(config) {
|
|
6141
6141
|
copyConfig(this, config);
|
|
@@ -6301,28 +6301,28 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6301
6301
|
return units;
|
|
6302
6302
|
}
|
|
6303
6303
|
function zeroFill(number, targetLength, forceSign) {
|
|
6304
|
-
var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length,
|
|
6305
|
-
return (
|
|
6304
|
+
var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0;
|
|
6305
|
+
return (sign ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
|
|
6306
6306
|
}
|
|
6307
6307
|
var formattingTokens = /(\[[^\[]*\])|(\\e)|(\\)?(eHHmm|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
|
|
6308
|
-
function addFormatToken(
|
|
6308
|
+
function addFormatToken(token, padded, ordinal, callback) {
|
|
6309
6309
|
var func = callback;
|
|
6310
6310
|
if (typeof callback === "string") {
|
|
6311
6311
|
func = function() {
|
|
6312
6312
|
return this[callback]();
|
|
6313
6313
|
};
|
|
6314
6314
|
}
|
|
6315
|
-
if (
|
|
6316
|
-
formatTokenFunctions[
|
|
6315
|
+
if (token) {
|
|
6316
|
+
formatTokenFunctions[token] = func;
|
|
6317
6317
|
}
|
|
6318
6318
|
if (padded) {
|
|
6319
6319
|
formatTokenFunctions[padded[0]] = function() {
|
|
6320
6320
|
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
|
|
6321
6321
|
};
|
|
6322
6322
|
}
|
|
6323
|
-
if (
|
|
6324
|
-
formatTokenFunctions[
|
|
6325
|
-
return this.localeData().ordinal(func.apply(this, arguments),
|
|
6323
|
+
if (ordinal) {
|
|
6324
|
+
formatTokenFunctions[ordinal] = function() {
|
|
6325
|
+
return this.localeData().ordinal(func.apply(this, arguments), token);
|
|
6326
6326
|
};
|
|
6327
6327
|
}
|
|
6328
6328
|
}
|
|
@@ -6332,8 +6332,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6332
6332
|
}
|
|
6333
6333
|
return input.replace(/\\/g, "");
|
|
6334
6334
|
}
|
|
6335
|
-
function makeFormatFunction(
|
|
6336
|
-
var array =
|
|
6335
|
+
function makeFormatFunction(format) {
|
|
6336
|
+
var array = format.match(formattingTokens), i, length;
|
|
6337
6337
|
for (i = 0, length = array.length;i < length; i++) {
|
|
6338
6338
|
if (formatTokenFunctions[array[i]]) {
|
|
6339
6339
|
array[i] = formatTokenFunctions[array[i]];
|
|
@@ -6342,49 +6342,49 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6342
6342
|
}
|
|
6343
6343
|
}
|
|
6344
6344
|
return function(mom) {
|
|
6345
|
-
var output = "",
|
|
6346
|
-
for (
|
|
6347
|
-
output += isFunction(array[
|
|
6345
|
+
var output = "", i;
|
|
6346
|
+
for (i = 0;i < length; i++) {
|
|
6347
|
+
output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
|
|
6348
6348
|
}
|
|
6349
6349
|
return output;
|
|
6350
6350
|
};
|
|
6351
6351
|
}
|
|
6352
|
-
function formatMoment(m,
|
|
6352
|
+
function formatMoment(m, format) {
|
|
6353
6353
|
if (!m.isValid()) {
|
|
6354
6354
|
return m.localeData().invalidDate();
|
|
6355
6355
|
}
|
|
6356
|
-
|
|
6357
|
-
var cacheKey = "$" +
|
|
6356
|
+
format = expandFormat(format, m.localeData());
|
|
6357
|
+
var cacheKey = "$" + format;
|
|
6358
6358
|
if (!hasOwnProp(formatFunctions, cacheKey)) {
|
|
6359
|
-
formatFunctions[cacheKey] = makeFormatFunction(
|
|
6359
|
+
formatFunctions[cacheKey] = makeFormatFunction(format);
|
|
6360
6360
|
}
|
|
6361
6361
|
return formatFunctions[cacheKey](m);
|
|
6362
6362
|
}
|
|
6363
|
-
function expandFormat(
|
|
6363
|
+
function expandFormat(format, locale) {
|
|
6364
6364
|
var i = 5;
|
|
6365
6365
|
function replaceLongDateFormatTokens(input) {
|
|
6366
|
-
return
|
|
6366
|
+
return locale.longDateFormat(input) || input;
|
|
6367
6367
|
}
|
|
6368
6368
|
localFormattingTokens.lastIndex = 0;
|
|
6369
|
-
while (i >= 0 && localFormattingTokens.test(
|
|
6370
|
-
|
|
6369
|
+
while (i >= 0 && localFormattingTokens.test(format)) {
|
|
6370
|
+
format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
|
|
6371
6371
|
localFormattingTokens.lastIndex = 0;
|
|
6372
6372
|
i -= 1;
|
|
6373
6373
|
}
|
|
6374
|
-
return
|
|
6374
|
+
return format;
|
|
6375
6375
|
}
|
|
6376
6376
|
var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
|
|
6377
6377
|
regexes = {};
|
|
6378
|
-
function addRegexToken(
|
|
6379
|
-
regexes[
|
|
6378
|
+
function addRegexToken(token, regex, strictRegex) {
|
|
6379
|
+
regexes[token] = isFunction(regex) ? regex : function(isStrict, localeData) {
|
|
6380
6380
|
return isStrict && strictRegex ? strictRegex : regex;
|
|
6381
6381
|
};
|
|
6382
6382
|
}
|
|
6383
|
-
function getParseRegexForToken(
|
|
6384
|
-
if (!hasOwnProp(regexes,
|
|
6385
|
-
return new RegExp(unescapeFormat(
|
|
6383
|
+
function getParseRegexForToken(token, config) {
|
|
6384
|
+
if (!hasOwnProp(regexes, token)) {
|
|
6385
|
+
return new RegExp(unescapeFormat(token));
|
|
6386
6386
|
}
|
|
6387
|
-
return regexes[
|
|
6387
|
+
return regexes[token](config._strict, config._locale);
|
|
6388
6388
|
}
|
|
6389
6389
|
function unescapeFormat(s) {
|
|
6390
6390
|
return regexEscape(s.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) {
|
|
@@ -6409,30 +6409,30 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6409
6409
|
return value;
|
|
6410
6410
|
}
|
|
6411
6411
|
var tokens = {};
|
|
6412
|
-
function addParseToken(
|
|
6412
|
+
function addParseToken(token, callback) {
|
|
6413
6413
|
var i, func = callback, tokenLen;
|
|
6414
|
-
if (typeof
|
|
6415
|
-
|
|
6414
|
+
if (typeof token === "string") {
|
|
6415
|
+
token = [token];
|
|
6416
6416
|
}
|
|
6417
6417
|
if (isNumber(callback)) {
|
|
6418
6418
|
func = function(input, array) {
|
|
6419
6419
|
array[callback] = toInt(input);
|
|
6420
6420
|
};
|
|
6421
6421
|
}
|
|
6422
|
-
tokenLen =
|
|
6422
|
+
tokenLen = token.length;
|
|
6423
6423
|
for (i = 0;i < tokenLen; i++) {
|
|
6424
|
-
tokens[
|
|
6424
|
+
tokens[token[i]] = func;
|
|
6425
6425
|
}
|
|
6426
6426
|
}
|
|
6427
|
-
function addWeekParseToken(
|
|
6428
|
-
addParseToken(
|
|
6427
|
+
function addWeekParseToken(token, callback) {
|
|
6428
|
+
addParseToken(token, function(input, array, config, token) {
|
|
6429
6429
|
config._w = config._w || {};
|
|
6430
|
-
callback(input, config._w, config,
|
|
6430
|
+
callback(input, config._w, config, token);
|
|
6431
6431
|
});
|
|
6432
6432
|
}
|
|
6433
|
-
function addTimeToArrayFromToken(
|
|
6434
|
-
if (input != null && hasOwnProp(tokens,
|
|
6435
|
-
tokens[
|
|
6433
|
+
function addTimeToArrayFromToken(token, input, config) {
|
|
6434
|
+
if (input != null && hasOwnProp(tokens, token)) {
|
|
6435
|
+
tokens[token](input, config._a, config, token);
|
|
6436
6436
|
}
|
|
6437
6437
|
}
|
|
6438
6438
|
function isLeapYear(year) {
|
|
@@ -6590,25 +6590,25 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6590
6590
|
addFormatToken("M", ["MM", 2], "Mo", function() {
|
|
6591
6591
|
return this.month() + 1;
|
|
6592
6592
|
});
|
|
6593
|
-
addFormatToken("MMM", 0, 0, function(
|
|
6594
|
-
return this.localeData().monthsShort(this,
|
|
6593
|
+
addFormatToken("MMM", 0, 0, function(format) {
|
|
6594
|
+
return this.localeData().monthsShort(this, format);
|
|
6595
6595
|
});
|
|
6596
|
-
addFormatToken("MMMM", 0, 0, function(
|
|
6597
|
-
return this.localeData().months(this,
|
|
6596
|
+
addFormatToken("MMMM", 0, 0, function(format) {
|
|
6597
|
+
return this.localeData().months(this, format);
|
|
6598
6598
|
});
|
|
6599
6599
|
addRegexToken("M", match1to2, match1to2NoLeadingZero);
|
|
6600
6600
|
addRegexToken("MM", match1to2, match2);
|
|
6601
|
-
addRegexToken("MMM", function(isStrict,
|
|
6602
|
-
return
|
|
6601
|
+
addRegexToken("MMM", function(isStrict, locale) {
|
|
6602
|
+
return locale.monthsShortRegex(isStrict);
|
|
6603
6603
|
});
|
|
6604
|
-
addRegexToken("MMMM", function(isStrict,
|
|
6605
|
-
return
|
|
6604
|
+
addRegexToken("MMMM", function(isStrict, locale) {
|
|
6605
|
+
return locale.monthsRegex(isStrict);
|
|
6606
6606
|
});
|
|
6607
6607
|
addParseToken(["M", "MM"], function(input, array) {
|
|
6608
6608
|
array[MONTH] = toInt(input) - 1;
|
|
6609
6609
|
});
|
|
6610
|
-
addParseToken(["MMM", "MMMM"], function(input, array, config,
|
|
6611
|
-
var month = config._locale.monthsParse(input,
|
|
6610
|
+
addParseToken(["MMM", "MMMM"], function(input, array, config, token) {
|
|
6611
|
+
var month = config._locale.monthsParse(input, token, config._strict);
|
|
6612
6612
|
if (month != null) {
|
|
6613
6613
|
array[MONTH] = month;
|
|
6614
6614
|
} else {
|
|
@@ -6624,28 +6624,28 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6624
6624
|
"monthsStrictRegex",
|
|
6625
6625
|
"monthsShortStrictRegex"
|
|
6626
6626
|
];
|
|
6627
|
-
function clearMonthsParseCache(
|
|
6627
|
+
function clearMonthsParseCache(locale, config) {
|
|
6628
6628
|
var i, prop;
|
|
6629
6629
|
for (i = 0;i < monthsParseProperties.length; i++) {
|
|
6630
6630
|
prop = monthsParseProperties[i];
|
|
6631
6631
|
if (!hasOwnProp(config, prop)) {
|
|
6632
|
-
delete
|
|
6632
|
+
delete locale["_" + prop];
|
|
6633
6633
|
}
|
|
6634
6634
|
}
|
|
6635
6635
|
}
|
|
6636
|
-
function localeMonths(m,
|
|
6636
|
+
function localeMonths(m, format) {
|
|
6637
6637
|
if (!m) {
|
|
6638
6638
|
return isArray(this._months) ? this._months : this._months["standalone"];
|
|
6639
6639
|
}
|
|
6640
|
-
return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(
|
|
6640
|
+
return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? "format" : "standalone"][m.month()];
|
|
6641
6641
|
}
|
|
6642
|
-
function localeMonthsShort(m,
|
|
6642
|
+
function localeMonthsShort(m, format) {
|
|
6643
6643
|
if (!m) {
|
|
6644
6644
|
return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
|
|
6645
6645
|
}
|
|
6646
|
-
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(
|
|
6646
|
+
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? "format" : "standalone"][m.month()];
|
|
6647
6647
|
}
|
|
6648
|
-
function handleStrictParse$1(monthName,
|
|
6648
|
+
function handleStrictParse$1(monthName, format, strict) {
|
|
6649
6649
|
var i, ii, mom, llc = monthName.toLocaleLowerCase();
|
|
6650
6650
|
if (!this._monthsParse) {
|
|
6651
6651
|
this._monthsParse = [];
|
|
@@ -6658,7 +6658,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6658
6658
|
}
|
|
6659
6659
|
}
|
|
6660
6660
|
if (strict) {
|
|
6661
|
-
if (
|
|
6661
|
+
if (format === "MMM") {
|
|
6662
6662
|
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
6663
6663
|
return ii !== -1 ? ii : null;
|
|
6664
6664
|
} else {
|
|
@@ -6666,7 +6666,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6666
6666
|
return ii !== -1 ? ii : null;
|
|
6667
6667
|
}
|
|
6668
6668
|
} else {
|
|
6669
|
-
if (
|
|
6669
|
+
if (format === "MMM") {
|
|
6670
6670
|
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
6671
6671
|
if (ii !== -1) {
|
|
6672
6672
|
return ii;
|
|
@@ -6683,10 +6683,10 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6683
6683
|
}
|
|
6684
6684
|
}
|
|
6685
6685
|
}
|
|
6686
|
-
function localeMonthsParse(monthName,
|
|
6686
|
+
function localeMonthsParse(monthName, format, strict) {
|
|
6687
6687
|
var i, mom, regex;
|
|
6688
6688
|
if (this._monthsParseExact) {
|
|
6689
|
-
return handleStrictParse$1.call(this, monthName,
|
|
6689
|
+
return handleStrictParse$1.call(this, monthName, format, strict);
|
|
6690
6690
|
}
|
|
6691
6691
|
if (!this._monthsParse) {
|
|
6692
6692
|
this._monthsParse = [];
|
|
@@ -6703,9 +6703,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6703
6703
|
regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
|
|
6704
6704
|
this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i");
|
|
6705
6705
|
}
|
|
6706
|
-
if (strict &&
|
|
6706
|
+
if (strict && format === "MMMM" && this._longMonthsParse[i].test(monthName)) {
|
|
6707
6707
|
return i;
|
|
6708
|
-
} else if (strict &&
|
|
6708
|
+
} else if (strict && format === "MMM" && this._shortMonthsParse[i].test(monthName)) {
|
|
6709
6709
|
return i;
|
|
6710
6710
|
} else if (!strict && this._monthsParse[i].test(monthName)) {
|
|
6711
6711
|
return i;
|
|
@@ -6800,14 +6800,14 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6800
6800
|
this._monthsShortStrictRegex = new RegExp("^(" + shortPieces.join("|") + ")", "i");
|
|
6801
6801
|
}
|
|
6802
6802
|
addFormatToken("d", 0, "do", "day");
|
|
6803
|
-
addFormatToken("dd", 0, 0, function(
|
|
6804
|
-
return this.localeData().weekdaysMin(this,
|
|
6803
|
+
addFormatToken("dd", 0, 0, function(format) {
|
|
6804
|
+
return this.localeData().weekdaysMin(this, format);
|
|
6805
6805
|
});
|
|
6806
|
-
addFormatToken("ddd", 0, 0, function(
|
|
6807
|
-
return this.localeData().weekdaysShort(this,
|
|
6806
|
+
addFormatToken("ddd", 0, 0, function(format) {
|
|
6807
|
+
return this.localeData().weekdaysShort(this, format);
|
|
6808
6808
|
});
|
|
6809
|
-
addFormatToken("dddd", 0, 0, function(
|
|
6810
|
-
return this.localeData().weekdays(this,
|
|
6809
|
+
addFormatToken("dddd", 0, 0, function(format) {
|
|
6810
|
+
return this.localeData().weekdays(this, format);
|
|
6811
6811
|
});
|
|
6812
6812
|
addFormatToken("e", 0, 0, "weekday");
|
|
6813
6813
|
addFormatToken("E", 0, 0, "isoWeekday");
|
|
@@ -6818,25 +6818,25 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6818
6818
|
addRegexToken("e", match1to2);
|
|
6819
6819
|
addRegexToken("E", match1to2);
|
|
6820
6820
|
addRegexToken("eHHmm", match5to6);
|
|
6821
|
-
addRegexToken("dd", function(isStrict,
|
|
6822
|
-
return
|
|
6821
|
+
addRegexToken("dd", function(isStrict, locale) {
|
|
6822
|
+
return locale.weekdaysMinRegex(isStrict);
|
|
6823
6823
|
});
|
|
6824
|
-
addRegexToken("ddd", function(isStrict,
|
|
6825
|
-
return
|
|
6824
|
+
addRegexToken("ddd", function(isStrict, locale) {
|
|
6825
|
+
return locale.weekdaysShortRegex(isStrict);
|
|
6826
6826
|
});
|
|
6827
|
-
addRegexToken("dddd", function(isStrict,
|
|
6828
|
-
return
|
|
6827
|
+
addRegexToken("dddd", function(isStrict, locale) {
|
|
6828
|
+
return locale.weekdaysRegex(isStrict);
|
|
6829
6829
|
});
|
|
6830
|
-
addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config,
|
|
6831
|
-
var weekday = config._locale.weekdaysParse(input,
|
|
6830
|
+
addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token) {
|
|
6831
|
+
var weekday = config._locale.weekdaysParse(input, token, config._strict);
|
|
6832
6832
|
if (weekday != null) {
|
|
6833
6833
|
week.d = weekday;
|
|
6834
6834
|
} else {
|
|
6835
6835
|
getParsingFlags(config).invalidWeekday = input;
|
|
6836
6836
|
}
|
|
6837
6837
|
});
|
|
6838
|
-
addWeekParseToken(["d", "e", "E"], function(input, week, config,
|
|
6839
|
-
week[
|
|
6838
|
+
addWeekParseToken(["d", "e", "E"], function(input, week, config, token) {
|
|
6839
|
+
week[token] = toInt(input);
|
|
6840
6840
|
});
|
|
6841
6841
|
addWeekParseToken("eHHmm", function(input, week, config) {
|
|
6842
6842
|
var weekdayEnd = input.length - 4;
|
|
@@ -6844,22 +6844,22 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6844
6844
|
config._a[HOUR] = toInt(input.substr(weekdayEnd, 2));
|
|
6845
6845
|
config._a[MINUTE] = toInt(input.substr(weekdayEnd + 2));
|
|
6846
6846
|
});
|
|
6847
|
-
function parseWeekday(input,
|
|
6847
|
+
function parseWeekday(input, locale) {
|
|
6848
6848
|
if (typeof input !== "string") {
|
|
6849
6849
|
return input;
|
|
6850
6850
|
}
|
|
6851
6851
|
if (!isNaN(input)) {
|
|
6852
6852
|
return parseInt(input, 10);
|
|
6853
6853
|
}
|
|
6854
|
-
input =
|
|
6854
|
+
input = locale.weekdaysParse(input);
|
|
6855
6855
|
if (typeof input === "number") {
|
|
6856
6856
|
return input;
|
|
6857
6857
|
}
|
|
6858
6858
|
return null;
|
|
6859
6859
|
}
|
|
6860
|
-
function parseIsoWeekday(input,
|
|
6860
|
+
function parseIsoWeekday(input, locale) {
|
|
6861
6861
|
if (typeof input === "string") {
|
|
6862
|
-
return
|
|
6862
|
+
return locale.weekdaysParse(input) % 7 || 7;
|
|
6863
6863
|
}
|
|
6864
6864
|
return isNaN(input) ? null : input;
|
|
6865
6865
|
}
|
|
@@ -6878,17 +6878,17 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6878
6878
|
"weekdaysShortStrictRegex",
|
|
6879
6879
|
"weekdaysMinStrictRegex"
|
|
6880
6880
|
];
|
|
6881
|
-
function clearWeekdaysParseCache(
|
|
6881
|
+
function clearWeekdaysParseCache(locale, config) {
|
|
6882
6882
|
var i, prop;
|
|
6883
6883
|
for (i = 0;i < weekdaysParseProperties.length; i++) {
|
|
6884
6884
|
prop = weekdaysParseProperties[i];
|
|
6885
6885
|
if (!hasOwnProp(config, prop)) {
|
|
6886
|
-
delete
|
|
6886
|
+
delete locale["_" + prop];
|
|
6887
6887
|
}
|
|
6888
6888
|
}
|
|
6889
6889
|
}
|
|
6890
|
-
function localeWeekdays(m,
|
|
6891
|
-
var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(
|
|
6890
|
+
function localeWeekdays(m, format) {
|
|
6891
|
+
var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? "format" : "standalone"];
|
|
6892
6892
|
return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
|
|
6893
6893
|
}
|
|
6894
6894
|
function localeWeekdaysShort(m) {
|
|
@@ -6897,7 +6897,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6897
6897
|
function localeWeekdaysMin(m) {
|
|
6898
6898
|
return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
|
|
6899
6899
|
}
|
|
6900
|
-
function handleStrictParse(weekdayName,
|
|
6900
|
+
function handleStrictParse(weekdayName, format, strict) {
|
|
6901
6901
|
var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
|
|
6902
6902
|
if (!this._weekdaysParse) {
|
|
6903
6903
|
this._weekdaysParse = [];
|
|
@@ -6911,10 +6911,10 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6911
6911
|
}
|
|
6912
6912
|
}
|
|
6913
6913
|
if (strict) {
|
|
6914
|
-
if (
|
|
6914
|
+
if (format === "dddd") {
|
|
6915
6915
|
ii = indexOf.call(this._weekdaysParse, llc);
|
|
6916
6916
|
return ii !== -1 ? ii : null;
|
|
6917
|
-
} else if (
|
|
6917
|
+
} else if (format === "ddd") {
|
|
6918
6918
|
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
6919
6919
|
return ii !== -1 ? ii : null;
|
|
6920
6920
|
} else {
|
|
@@ -6922,7 +6922,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6922
6922
|
return ii !== -1 ? ii : null;
|
|
6923
6923
|
}
|
|
6924
6924
|
} else {
|
|
6925
|
-
if (
|
|
6925
|
+
if (format === "dddd") {
|
|
6926
6926
|
ii = indexOf.call(this._weekdaysParse, llc);
|
|
6927
6927
|
if (ii !== -1) {
|
|
6928
6928
|
return ii;
|
|
@@ -6933,7 +6933,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6933
6933
|
}
|
|
6934
6934
|
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
6935
6935
|
return ii !== -1 ? ii : null;
|
|
6936
|
-
} else if (
|
|
6936
|
+
} else if (format === "ddd") {
|
|
6937
6937
|
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
6938
6938
|
if (ii !== -1) {
|
|
6939
6939
|
return ii;
|
|
@@ -6958,10 +6958,10 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6958
6958
|
}
|
|
6959
6959
|
}
|
|
6960
6960
|
}
|
|
6961
|
-
function localeWeekdaysParse(weekdayName,
|
|
6961
|
+
function localeWeekdaysParse(weekdayName, format, strict) {
|
|
6962
6962
|
var i, mom, regex;
|
|
6963
6963
|
if (this._weekdaysParseExact) {
|
|
6964
|
-
return handleStrictParse.call(this, weekdayName,
|
|
6964
|
+
return handleStrictParse.call(this, weekdayName, format, strict);
|
|
6965
6965
|
}
|
|
6966
6966
|
if (!this._weekdaysParse) {
|
|
6967
6967
|
this._weekdaysParse = [];
|
|
@@ -6980,11 +6980,11 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
6980
6980
|
regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
|
|
6981
6981
|
this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i");
|
|
6982
6982
|
}
|
|
6983
|
-
if (strict &&
|
|
6983
|
+
if (strict && format === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) {
|
|
6984
6984
|
return i;
|
|
6985
|
-
} else if (strict &&
|
|
6985
|
+
} else if (strict && format === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) {
|
|
6986
6986
|
return i;
|
|
6987
|
-
} else if (strict &&
|
|
6987
|
+
} else if (strict && format === "dd" && this._minWeekdaysParse[i].test(weekdayName)) {
|
|
6988
6988
|
return i;
|
|
6989
6989
|
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
|
6990
6990
|
return i;
|
|
@@ -7166,9 +7166,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7166
7166
|
lastWeek: "[Last] dddd [at] LT",
|
|
7167
7167
|
sameElse: "L"
|
|
7168
7168
|
};
|
|
7169
|
-
function calendar$1(key, mom,
|
|
7169
|
+
function calendar$1(key, mom, now) {
|
|
7170
7170
|
var output = this._calendar[key] || this._calendar["sameElse"];
|
|
7171
|
-
return isFunction(output) ? output.call(mom,
|
|
7171
|
+
return isFunction(output) ? output.call(mom, now) : output;
|
|
7172
7172
|
}
|
|
7173
7173
|
var defaultLongDateFormat = {
|
|
7174
7174
|
LTS: "h:mm:ss A",
|
|
@@ -7179,14 +7179,14 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7179
7179
|
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
7180
7180
|
};
|
|
7181
7181
|
function longDateFormat(key) {
|
|
7182
|
-
var
|
|
7183
|
-
if (
|
|
7184
|
-
return
|
|
7182
|
+
var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()], formatCache = this._longDateFormatCache;
|
|
7183
|
+
if (format || !formatUpper) {
|
|
7184
|
+
return format;
|
|
7185
7185
|
}
|
|
7186
7186
|
if (formatCache && formatCache[key] && formatCache[key].formatUpper === formatUpper) {
|
|
7187
7187
|
return formatCache[key].format;
|
|
7188
7188
|
}
|
|
7189
|
-
|
|
7189
|
+
format = formatUpper.match(formattingTokens).map(function(tok) {
|
|
7190
7190
|
if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
|
|
7191
7191
|
return tok.slice(1);
|
|
7192
7192
|
}
|
|
@@ -7197,9 +7197,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7197
7197
|
}
|
|
7198
7198
|
formatCache[key] = {
|
|
7199
7199
|
formatUpper,
|
|
7200
|
-
format
|
|
7200
|
+
format
|
|
7201
7201
|
};
|
|
7202
|
-
return
|
|
7202
|
+
return format;
|
|
7203
7203
|
}
|
|
7204
7204
|
var defaultInvalidDate = "Invalid date";
|
|
7205
7205
|
function invalidDate() {
|
|
@@ -7234,12 +7234,12 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7234
7234
|
function relativeTime$1(number, withoutSuffix, string, isFuture) {
|
|
7235
7235
|
return this.postformat(relativeTimeWithoutPostformat.call(this, number, withoutSuffix, string, isFuture));
|
|
7236
7236
|
}
|
|
7237
|
-
function pastFutureWithoutPostformat(
|
|
7238
|
-
var
|
|
7239
|
-
return isFunction(
|
|
7237
|
+
function pastFutureWithoutPostformat(diff, output) {
|
|
7238
|
+
var format = this._relativeTime[diff > 0 ? "future" : "past"];
|
|
7239
|
+
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
|
7240
7240
|
}
|
|
7241
|
-
function pastFuture(
|
|
7242
|
-
return this.postformat(pastFutureWithoutPostformat.call(this,
|
|
7241
|
+
function pastFuture(diff, output) {
|
|
7242
|
+
return this.postformat(pastFutureWithoutPostformat.call(this, diff, output));
|
|
7243
7243
|
}
|
|
7244
7244
|
function createDate(y, m, d, h, M, s, ms) {
|
|
7245
7245
|
var date;
|
|
@@ -7322,8 +7322,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7322
7322
|
addRegexToken("ww", match1to2, match2);
|
|
7323
7323
|
addRegexToken("W", match1to2, match1to2NoLeadingZero);
|
|
7324
7324
|
addRegexToken("WW", match1to2, match2);
|
|
7325
|
-
addWeekParseToken(["w", "ww", "W", "WW"], function(input, week, config,
|
|
7326
|
-
week[
|
|
7325
|
+
addWeekParseToken(["w", "ww", "W", "WW"], function(input, week, config, token) {
|
|
7326
|
+
week[token.substr(0, 1)] = toInt(input);
|
|
7327
7327
|
});
|
|
7328
7328
|
function localeWeek(mom) {
|
|
7329
7329
|
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
|
@@ -7367,15 +7367,15 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7367
7367
|
addFormatToken("Hmmss", 0, 0, function() {
|
|
7368
7368
|
return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
|
7369
7369
|
});
|
|
7370
|
-
function meridiem(
|
|
7371
|
-
addFormatToken(
|
|
7370
|
+
function meridiem(token, lowercase) {
|
|
7371
|
+
addFormatToken(token, 0, 0, function() {
|
|
7372
7372
|
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
|
|
7373
7373
|
});
|
|
7374
7374
|
}
|
|
7375
7375
|
meridiem("a", true);
|
|
7376
7376
|
meridiem("A", false);
|
|
7377
|
-
function matchMeridiem(isStrict,
|
|
7378
|
-
return
|
|
7377
|
+
function matchMeridiem(isStrict, locale) {
|
|
7378
|
+
return locale._meridiemParse;
|
|
7379
7379
|
}
|
|
7380
7380
|
addRegexToken("a", matchMeridiem);
|
|
7381
7381
|
addRegexToken("A", matchMeridiem);
|
|
@@ -7430,8 +7430,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7430
7430
|
return (input + "").toLowerCase().charAt(0) === "p";
|
|
7431
7431
|
}
|
|
7432
7432
|
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
|
|
7433
|
-
function localeMeridiem(
|
|
7434
|
-
if (
|
|
7433
|
+
function localeMeridiem(hours, minutes, isLower) {
|
|
7434
|
+
if (hours > 11) {
|
|
7435
7435
|
return isLower ? "pm" : "PM";
|
|
7436
7436
|
} else {
|
|
7437
7437
|
return isLower ? "am" : "AM";
|
|
@@ -7466,16 +7466,16 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7466
7466
|
return key ? key.toLowerCase().replace("_", "-") : key;
|
|
7467
7467
|
}
|
|
7468
7468
|
function chooseLocale(names) {
|
|
7469
|
-
var i = 0, j, next,
|
|
7469
|
+
var i = 0, j, next, locale, split;
|
|
7470
7470
|
while (i < names.length) {
|
|
7471
7471
|
split = normalizeLocale(names[i]).split("-");
|
|
7472
7472
|
j = split.length;
|
|
7473
7473
|
next = normalizeLocale(names[i + 1]);
|
|
7474
7474
|
next = next ? next.split("-") : null;
|
|
7475
7475
|
while (j > 0) {
|
|
7476
|
-
|
|
7477
|
-
if (
|
|
7478
|
-
return
|
|
7476
|
+
locale = loadLocale(split.slice(0, j).join("-"));
|
|
7477
|
+
if (locale) {
|
|
7478
|
+
return locale;
|
|
7479
7479
|
}
|
|
7480
7480
|
if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
|
|
7481
7481
|
break;
|
|
@@ -7532,7 +7532,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7532
7532
|
}
|
|
7533
7533
|
function defineLocale(name, config) {
|
|
7534
7534
|
if (config !== null) {
|
|
7535
|
-
var
|
|
7535
|
+
var locale, parentConfig = baseConfig;
|
|
7536
7536
|
config.abbr = name;
|
|
7537
7537
|
if (locales[name] != null) {
|
|
7538
7538
|
deprecateSimple("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change " + "an existing locale. moment.defineLocale(localeName, " + "config) should only be used for creating a new locale " + "See http://momentjs.com/guides/#/warnings/define-locale/ for more info.");
|
|
@@ -7541,9 +7541,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7541
7541
|
if (locales[config.parentLocale] != null) {
|
|
7542
7542
|
parentConfig = locales[config.parentLocale]._config;
|
|
7543
7543
|
} else {
|
|
7544
|
-
|
|
7545
|
-
if (
|
|
7546
|
-
parentConfig =
|
|
7544
|
+
locale = loadLocale(config.parentLocale);
|
|
7545
|
+
if (locale != null) {
|
|
7546
|
+
parentConfig = locale._config;
|
|
7547
7547
|
} else {
|
|
7548
7548
|
if (!localeFamilies[config.parentLocale]) {
|
|
7549
7549
|
localeFamilies[config.parentLocale] = [];
|
|
@@ -7570,7 +7570,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7570
7570
|
}
|
|
7571
7571
|
}
|
|
7572
7572
|
function updateLocale(name, config) {
|
|
7573
|
-
var
|
|
7573
|
+
var locale, tmpLocale = loadLocale(name), parentConfig = baseConfig;
|
|
7574
7574
|
if (tmpLocale != null) {
|
|
7575
7575
|
name = tmpLocale._abbr;
|
|
7576
7576
|
}
|
|
@@ -7585,9 +7585,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7585
7585
|
if (tmpLocale == null) {
|
|
7586
7586
|
config.abbr = name;
|
|
7587
7587
|
}
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
locales[name] =
|
|
7588
|
+
locale = new Locale(config);
|
|
7589
|
+
locale.parentLocale = locales[name];
|
|
7590
|
+
locales[name] = locale;
|
|
7591
7591
|
}
|
|
7592
7592
|
getSetGlobalLocale(name);
|
|
7593
7593
|
} else {
|
|
@@ -7605,7 +7605,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7605
7605
|
return locales[name];
|
|
7606
7606
|
}
|
|
7607
7607
|
function getLocale(key) {
|
|
7608
|
-
var
|
|
7608
|
+
var locale;
|
|
7609
7609
|
if (key && key._locale && key._locale._abbr) {
|
|
7610
7610
|
key = key._locale._abbr;
|
|
7611
7611
|
}
|
|
@@ -7613,9 +7613,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7613
7613
|
return globalLocale;
|
|
7614
7614
|
}
|
|
7615
7615
|
if (!isArray(key)) {
|
|
7616
|
-
|
|
7617
|
-
if (
|
|
7618
|
-
return
|
|
7616
|
+
locale = loadLocale(key);
|
|
7617
|
+
if (locale) {
|
|
7618
|
+
return locale;
|
|
7619
7619
|
}
|
|
7620
7620
|
key = [key];
|
|
7621
7621
|
}
|
|
@@ -7820,11 +7820,11 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7820
7820
|
}
|
|
7821
7821
|
return c;
|
|
7822
7822
|
}
|
|
7823
|
-
function currentDateArray(config,
|
|
7823
|
+
function currentDateArray(config, now, forWeek) {
|
|
7824
7824
|
var hadWeekContext = Object.prototype.hasOwnProperty.call(config, "_isDefaultDatePartsForWeek"), weekContext = config._isDefaultDatePartsForWeek;
|
|
7825
7825
|
config._isDefaultDatePartsForWeek = !!forWeek;
|
|
7826
7826
|
try {
|
|
7827
|
-
return hooks._getDefaultDateParts(config,
|
|
7827
|
+
return hooks._getDefaultDateParts(config, now, forWeek);
|
|
7828
7828
|
} finally {
|
|
7829
7829
|
if (hadWeekContext) {
|
|
7830
7830
|
config._isDefaultDatePartsForWeek = weekContext;
|
|
@@ -7834,18 +7834,18 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7834
7834
|
}
|
|
7835
7835
|
}
|
|
7836
7836
|
function currentDateNow(config) {
|
|
7837
|
-
var
|
|
7838
|
-
if (!
|
|
7837
|
+
var now = config._defaultDatePartsNow;
|
|
7838
|
+
if (!now) {
|
|
7839
7839
|
return hooks.now();
|
|
7840
7840
|
}
|
|
7841
|
-
if (!
|
|
7842
|
-
|
|
7843
|
-
|
|
7841
|
+
if (!now.hasValue) {
|
|
7842
|
+
now.value = hooks.now();
|
|
7843
|
+
now.hasValue = true;
|
|
7844
7844
|
}
|
|
7845
|
-
return
|
|
7845
|
+
return now.value;
|
|
7846
7846
|
}
|
|
7847
|
-
function getDefaultDateParts(config,
|
|
7848
|
-
var useWeekDefaults = forWeek || config._isDefaultDatePartsForWeek, nowValue = useWeekDefaults ? createLocal(
|
|
7847
|
+
function getDefaultDateParts(config, now, forWeek) {
|
|
7848
|
+
var useWeekDefaults = forWeek || config._isDefaultDatePartsForWeek, nowValue = useWeekDefaults ? createLocal(now) : new Date(now);
|
|
7849
7849
|
if (useWeekDefaults) {
|
|
7850
7850
|
return [nowValue.year(), nowValue.month(), nowValue.date()];
|
|
7851
7851
|
}
|
|
@@ -7860,16 +7860,16 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7860
7860
|
}
|
|
7861
7861
|
hooks._getDefaultDateParts = getDefaultDateParts;
|
|
7862
7862
|
function configFromArray(config) {
|
|
7863
|
-
var i, date, input = [],
|
|
7863
|
+
var i, date, input = [], now, currentDate, expectedWeekday, yearToUse, dateIsDefaulted;
|
|
7864
7864
|
if (config._d) {
|
|
7865
7865
|
return;
|
|
7866
7866
|
}
|
|
7867
7867
|
if (config._a[YEAR] == null || config._a[MONTH] == null || config._a[DATE] == null) {
|
|
7868
|
-
|
|
7869
|
-
currentDate = currentDateArray(config,
|
|
7868
|
+
now = currentDateNow(config);
|
|
7869
|
+
currentDate = currentDateArray(config, now);
|
|
7870
7870
|
}
|
|
7871
7871
|
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
|
7872
|
-
dayOfYearFromWeekInfo(config, currentDateArray(config,
|
|
7872
|
+
dayOfYearFromWeekInfo(config, currentDateArray(config, now, true));
|
|
7873
7873
|
}
|
|
7874
7874
|
if (config._dayOfYear != null) {
|
|
7875
7875
|
yearToUse = config._a[YEAR] != null ? config._a[YEAR] : currentDate[YEAR];
|
|
@@ -7958,12 +7958,12 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7958
7958
|
}
|
|
7959
7959
|
config._a = [];
|
|
7960
7960
|
getParsingFlags(config).empty = true;
|
|
7961
|
-
var string = "" + config._i, i, parsedInput,
|
|
7962
|
-
|
|
7963
|
-
tokenLen =
|
|
7961
|
+
var string = "" + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
|
|
7962
|
+
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
|
7963
|
+
tokenLen = tokens.length;
|
|
7964
7964
|
for (i = 0;i < tokenLen; i++) {
|
|
7965
|
-
|
|
7966
|
-
parsedInput = (string.match(getParseRegexForToken(
|
|
7965
|
+
token = tokens[i];
|
|
7966
|
+
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
|
|
7967
7967
|
if (parsedInput) {
|
|
7968
7968
|
skipped = string.substr(0, string.indexOf(parsedInput));
|
|
7969
7969
|
if (skipped.length > 0) {
|
|
@@ -7972,15 +7972,15 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
7972
7972
|
string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
|
|
7973
7973
|
totalParsedInputLength += parsedInput.length;
|
|
7974
7974
|
}
|
|
7975
|
-
if (formatTokenFunctions[
|
|
7975
|
+
if (formatTokenFunctions[token]) {
|
|
7976
7976
|
if (parsedInput) {
|
|
7977
7977
|
getParsingFlags(config).empty = false;
|
|
7978
7978
|
} else {
|
|
7979
|
-
getParsingFlags(config).unusedTokens.push(
|
|
7979
|
+
getParsingFlags(config).unusedTokens.push(token);
|
|
7980
7980
|
}
|
|
7981
|
-
addTimeToArrayFromToken(
|
|
7981
|
+
addTimeToArrayFromToken(token, parsedInput, config);
|
|
7982
7982
|
} else if (config._strict && !parsedInput) {
|
|
7983
|
-
getParsingFlags(config).unusedTokens.push(
|
|
7983
|
+
getParsingFlags(config).unusedTokens.push(token);
|
|
7984
7984
|
}
|
|
7985
7985
|
}
|
|
7986
7986
|
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
|
|
@@ -8000,15 +8000,15 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8000
8000
|
configFromArray(config);
|
|
8001
8001
|
checkOverflow(config);
|
|
8002
8002
|
}
|
|
8003
|
-
function meridiemFixWrap(
|
|
8003
|
+
function meridiemFixWrap(locale, hour, meridiem) {
|
|
8004
8004
|
var isPm;
|
|
8005
|
-
if (
|
|
8005
|
+
if (meridiem == null) {
|
|
8006
8006
|
return hour;
|
|
8007
8007
|
}
|
|
8008
|
-
if (
|
|
8009
|
-
return
|
|
8010
|
-
} else if (
|
|
8011
|
-
isPm =
|
|
8008
|
+
if (locale.meridiemHour != null) {
|
|
8009
|
+
return locale.meridiemHour(hour, meridiem);
|
|
8010
|
+
} else if (locale.isPM != null) {
|
|
8011
|
+
isPm = locale.isPM(meridiem);
|
|
8012
8012
|
if (isPm && hour < 12) {
|
|
8013
8013
|
hour += 12;
|
|
8014
8014
|
}
|
|
@@ -8079,9 +8079,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8079
8079
|
return res;
|
|
8080
8080
|
}
|
|
8081
8081
|
function prepareConfig(config) {
|
|
8082
|
-
var { _i: input, _f:
|
|
8082
|
+
var { _i: input, _f: format } = config;
|
|
8083
8083
|
config._locale = config._locale || getLocale(config._l);
|
|
8084
|
-
if (input === null ||
|
|
8084
|
+
if (input === null || format === undefined && input === "") {
|
|
8085
8085
|
return createInvalid$1({ nullInput: true });
|
|
8086
8086
|
}
|
|
8087
8087
|
if (typeof input === "string") {
|
|
@@ -8091,9 +8091,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8091
8091
|
return new Moment(checkOverflow(input));
|
|
8092
8092
|
} else if (isDate(input)) {
|
|
8093
8093
|
config._d = input;
|
|
8094
|
-
} else if (isArray(
|
|
8094
|
+
} else if (isArray(format)) {
|
|
8095
8095
|
configFromStringAndArray(config);
|
|
8096
|
-
} else if (
|
|
8096
|
+
} else if (format) {
|
|
8097
8097
|
configFromStringAndFormat(config);
|
|
8098
8098
|
} else {
|
|
8099
8099
|
configFromInput(config);
|
|
@@ -8124,29 +8124,29 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8124
8124
|
hooks.createFromInputFallback(config);
|
|
8125
8125
|
}
|
|
8126
8126
|
}
|
|
8127
|
-
function createLocalOrUTC(input,
|
|
8127
|
+
function createLocalOrUTC(input, format, locale, strict, isUTC) {
|
|
8128
8128
|
var c = {};
|
|
8129
|
-
if (
|
|
8130
|
-
strict =
|
|
8131
|
-
|
|
8129
|
+
if (format === true || format === false) {
|
|
8130
|
+
strict = format;
|
|
8131
|
+
format = undefined;
|
|
8132
8132
|
}
|
|
8133
|
-
if (
|
|
8134
|
-
strict =
|
|
8135
|
-
|
|
8133
|
+
if (locale === true || locale === false) {
|
|
8134
|
+
strict = locale;
|
|
8135
|
+
locale = undefined;
|
|
8136
8136
|
}
|
|
8137
8137
|
if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
|
|
8138
8138
|
input = undefined;
|
|
8139
8139
|
}
|
|
8140
8140
|
c._isAMomentObject = true;
|
|
8141
8141
|
c._useUTC = c._isUTC = isUTC;
|
|
8142
|
-
c._l =
|
|
8142
|
+
c._l = locale;
|
|
8143
8143
|
c._i = input;
|
|
8144
|
-
c._f =
|
|
8144
|
+
c._f = format;
|
|
8145
8145
|
c._strict = strict;
|
|
8146
8146
|
return createFromConfig(c);
|
|
8147
8147
|
}
|
|
8148
|
-
function createLocal(input,
|
|
8149
|
-
return createLocalOrUTC(input,
|
|
8148
|
+
function createLocal(input, format, locale, strict) {
|
|
8149
|
+
return createLocalOrUTC(input, format, locale, strict, false);
|
|
8150
8150
|
}
|
|
8151
8151
|
var prototypeMin = deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function() {
|
|
8152
8152
|
var other = createLocal.apply(null, arguments);
|
|
@@ -8235,11 +8235,11 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8235
8235
|
return createDuration(NaN);
|
|
8236
8236
|
}
|
|
8237
8237
|
function Duration(duration) {
|
|
8238
|
-
var normalizedInput = normalizeObjectUnits(duration),
|
|
8238
|
+
var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || normalizedInput.isoWeek || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0;
|
|
8239
8239
|
this._isValid = isDurationValid(normalizedInput);
|
|
8240
|
-
this._milliseconds = +
|
|
8241
|
-
this._days = +
|
|
8242
|
-
this._months = +
|
|
8240
|
+
this._milliseconds = +milliseconds + seconds * 1000 + minutes * 60000 + hours * 1000 * 60 * 60;
|
|
8241
|
+
this._days = +days + weeks * 7;
|
|
8242
|
+
this._months = +months + quarters * 3 + years * 12;
|
|
8243
8243
|
this._data = {};
|
|
8244
8244
|
this._locale = getLocale();
|
|
8245
8245
|
this._bubble();
|
|
@@ -8263,14 +8263,14 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8263
8263
|
}
|
|
8264
8264
|
return diffs + lengthDiff;
|
|
8265
8265
|
}
|
|
8266
|
-
function offset(
|
|
8267
|
-
addFormatToken(
|
|
8268
|
-
var
|
|
8269
|
-
if (
|
|
8270
|
-
|
|
8271
|
-
|
|
8266
|
+
function offset(token, separator) {
|
|
8267
|
+
addFormatToken(token, 0, 0, function() {
|
|
8268
|
+
var offset = this.utcOffset(), sign = "+";
|
|
8269
|
+
if (offset < 0) {
|
|
8270
|
+
offset = -offset;
|
|
8271
|
+
sign = "-";
|
|
8272
8272
|
}
|
|
8273
|
-
return
|
|
8273
|
+
return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);
|
|
8274
8274
|
});
|
|
8275
8275
|
}
|
|
8276
8276
|
offset("Z", ":");
|
|
@@ -8278,33 +8278,33 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8278
8278
|
addRegexToken("Z", matchShortOffset);
|
|
8279
8279
|
addRegexToken("ZZ", matchShortOffset);
|
|
8280
8280
|
addParseToken(["Z", "ZZ"], function(input, array, config) {
|
|
8281
|
-
var
|
|
8281
|
+
var offset = offsetFromString(matchShortOffset, input);
|
|
8282
8282
|
config._useUTC = true;
|
|
8283
|
-
config._tzm =
|
|
8284
|
-
if (
|
|
8283
|
+
config._tzm = offset;
|
|
8284
|
+
if (offset === null) {
|
|
8285
8285
|
getParsingFlags(config).invalidOffset = input;
|
|
8286
8286
|
}
|
|
8287
8287
|
});
|
|
8288
8288
|
var chunkOffset = /([\+\-]|\d\d)/gi;
|
|
8289
8289
|
function offsetFromString(matcher, string) {
|
|
8290
|
-
var matches = (string || "").match(matcher), chunk, parts,
|
|
8290
|
+
var matches = (string || "").match(matcher), chunk, parts, minutes;
|
|
8291
8291
|
if (matches === null) {
|
|
8292
8292
|
return null;
|
|
8293
8293
|
}
|
|
8294
8294
|
chunk = matches[matches.length - 1] || [];
|
|
8295
8295
|
parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
|
|
8296
|
-
|
|
8297
|
-
if (toInt(parts[2]) > 59 || (parts[0] === "+" ?
|
|
8296
|
+
minutes = +(parts[1] * 60) + toInt(parts[2]);
|
|
8297
|
+
if (toInt(parts[2]) > 59 || (parts[0] === "+" ? minutes > 14 * 60 : minutes > 12 * 60)) {
|
|
8298
8298
|
return null;
|
|
8299
8299
|
}
|
|
8300
|
-
return
|
|
8300
|
+
return minutes === 0 ? 0 : parts[0] === "+" ? minutes : -minutes;
|
|
8301
8301
|
}
|
|
8302
8302
|
function cloneWithOffset(input, model) {
|
|
8303
|
-
var res,
|
|
8303
|
+
var res, diff;
|
|
8304
8304
|
if (model._isUTC) {
|
|
8305
8305
|
res = model.clone();
|
|
8306
|
-
|
|
8307
|
-
res._d.setTime(res._d.valueOf() +
|
|
8306
|
+
diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
|
|
8307
|
+
res._d.setTime(res._d.valueOf() + diff);
|
|
8308
8308
|
hooks.updateOffset(res, false);
|
|
8309
8309
|
return res;
|
|
8310
8310
|
} else {
|
|
@@ -8316,7 +8316,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8316
8316
|
}
|
|
8317
8317
|
hooks.updateOffset = function() {};
|
|
8318
8318
|
function getSetOffset(input, keepLocalTime, keepMinutes) {
|
|
8319
|
-
var
|
|
8319
|
+
var offset = this._offset || 0, localAdjust;
|
|
8320
8320
|
if (!this.isValid()) {
|
|
8321
8321
|
return input != null ? this : NaN;
|
|
8322
8322
|
}
|
|
@@ -8337,9 +8337,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8337
8337
|
if (localAdjust != null) {
|
|
8338
8338
|
this.add(localAdjust, "m");
|
|
8339
8339
|
}
|
|
8340
|
-
if (
|
|
8340
|
+
if (offset !== input) {
|
|
8341
8341
|
if (!keepLocalTime || this._changeInProgress) {
|
|
8342
|
-
addSubtract$1(this, createDuration(input -
|
|
8342
|
+
addSubtract$1(this, createDuration(input - offset, "m"), 1, false);
|
|
8343
8343
|
} else if (!this._changeInProgress) {
|
|
8344
8344
|
this._changeInProgress = true;
|
|
8345
8345
|
hooks.updateOffset(this, true);
|
|
@@ -8348,7 +8348,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8348
8348
|
}
|
|
8349
8349
|
return this;
|
|
8350
8350
|
} else {
|
|
8351
|
-
return this._isUTC ?
|
|
8351
|
+
return this._isUTC ? offset : getDateOffset(this);
|
|
8352
8352
|
}
|
|
8353
8353
|
}
|
|
8354
8354
|
function getSetZone(input, keepLocalTime) {
|
|
@@ -8424,7 +8424,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8424
8424
|
}
|
|
8425
8425
|
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
8426
8426
|
function createDuration(input, key) {
|
|
8427
|
-
var duration = input, match = null,
|
|
8427
|
+
var duration = input, match = null, sign, ret, diffRes;
|
|
8428
8428
|
if (isDuration(input)) {
|
|
8429
8429
|
duration = {
|
|
8430
8430
|
ms: input._milliseconds,
|
|
@@ -8439,25 +8439,25 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8439
8439
|
duration.milliseconds = +input;
|
|
8440
8440
|
}
|
|
8441
8441
|
} else if (match = aspNetRegex.exec(input)) {
|
|
8442
|
-
|
|
8442
|
+
sign = match[1] === "-" ? -1 : 1;
|
|
8443
8443
|
duration = {
|
|
8444
8444
|
y: 0,
|
|
8445
|
-
d: toInt(match[DATE]) *
|
|
8446
|
-
h: toInt(match[HOUR]) *
|
|
8447
|
-
m: toInt(match[MINUTE]) *
|
|
8448
|
-
s: toInt(match[SECOND]) *
|
|
8449
|
-
ms: toInt(absRound(match[MILLISECOND] * 1000)) *
|
|
8445
|
+
d: toInt(match[DATE]) * sign,
|
|
8446
|
+
h: toInt(match[HOUR]) * sign,
|
|
8447
|
+
m: toInt(match[MINUTE]) * sign,
|
|
8448
|
+
s: toInt(match[SECOND]) * sign,
|
|
8449
|
+
ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign
|
|
8450
8450
|
};
|
|
8451
8451
|
} else if (match = isoRegex.exec(input)) {
|
|
8452
|
-
|
|
8452
|
+
sign = match[1] === "-" ? -1 : 1;
|
|
8453
8453
|
duration = {
|
|
8454
|
-
y: parseIso(match[2],
|
|
8455
|
-
M: parseIso(match[3],
|
|
8456
|
-
w: parseIso(match[4],
|
|
8457
|
-
d: parseIso(match[5],
|
|
8458
|
-
h: parseIso(match[6],
|
|
8459
|
-
m: parseIso(match[7],
|
|
8460
|
-
s: parseIso(match[8],
|
|
8454
|
+
y: parseIso(match[2], sign),
|
|
8455
|
+
M: parseIso(match[3], sign),
|
|
8456
|
+
w: parseIso(match[4], sign),
|
|
8457
|
+
d: parseIso(match[5], sign),
|
|
8458
|
+
h: parseIso(match[6], sign),
|
|
8459
|
+
m: parseIso(match[7], sign),
|
|
8460
|
+
s: parseIso(match[8], sign)
|
|
8461
8461
|
};
|
|
8462
8462
|
} else if (duration == null) {
|
|
8463
8463
|
duration = {};
|
|
@@ -8478,9 +8478,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8478
8478
|
}
|
|
8479
8479
|
createDuration.fn = Duration.prototype;
|
|
8480
8480
|
createDuration.invalid = createInvalid;
|
|
8481
|
-
function parseIso(inp,
|
|
8481
|
+
function parseIso(inp, sign) {
|
|
8482
8482
|
var res = inp && parseFloat(inp.replace(",", "."));
|
|
8483
|
-
return (isNaN(res) ? 0 : res) *
|
|
8483
|
+
return (isNaN(res) ? 0 : res) * sign;
|
|
8484
8484
|
}
|
|
8485
8485
|
function positiveMomentsDifference(base, other) {
|
|
8486
8486
|
var res = {};
|
|
@@ -8521,22 +8521,22 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8521
8521
|
};
|
|
8522
8522
|
}
|
|
8523
8523
|
function addSubtract$1(mom, duration, isAdding, updateOffset) {
|
|
8524
|
-
var
|
|
8524
|
+
var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months);
|
|
8525
8525
|
if (!mom.isValid()) {
|
|
8526
8526
|
return;
|
|
8527
8527
|
}
|
|
8528
8528
|
updateOffset = updateOffset == null ? true : updateOffset;
|
|
8529
|
-
if (
|
|
8530
|
-
setMonth(mom, get$2(mom, "Month") +
|
|
8529
|
+
if (months) {
|
|
8530
|
+
setMonth(mom, get$2(mom, "Month") + months * isAdding);
|
|
8531
8531
|
}
|
|
8532
|
-
if (
|
|
8533
|
-
set$1(mom, "Date", get$2(mom, "Date") +
|
|
8532
|
+
if (days) {
|
|
8533
|
+
set$1(mom, "Date", get$2(mom, "Date") + days * isAdding);
|
|
8534
8534
|
}
|
|
8535
|
-
if (
|
|
8536
|
-
mom._d.setTime(mom._d.valueOf() +
|
|
8535
|
+
if (milliseconds) {
|
|
8536
|
+
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
|
|
8537
8537
|
}
|
|
8538
8538
|
if (updateOffset) {
|
|
8539
|
-
hooks.updateOffset(mom,
|
|
8539
|
+
hooks.updateOffset(mom, days || months);
|
|
8540
8540
|
}
|
|
8541
8541
|
}
|
|
8542
8542
|
var add$1 = createAdder(1, "add"), subtract$1 = createAdder(-1, "subtract");
|
|
@@ -8603,9 +8603,9 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8603
8603
|
}
|
|
8604
8604
|
return objectTest && propertyTest;
|
|
8605
8605
|
}
|
|
8606
|
-
function getCalendarFormat(myMoment,
|
|
8607
|
-
var
|
|
8608
|
-
return
|
|
8606
|
+
function getCalendarFormat(myMoment, now) {
|
|
8607
|
+
var diff = myMoment.diff(now, "days", true);
|
|
8608
|
+
return diff < -6 ? "sameElse" : diff < -1 ? "lastWeek" : diff < 0 ? "lastDay" : diff < 1 ? "sameDay" : diff < 2 ? "nextDay" : diff < 7 ? "nextWeek" : "sameElse";
|
|
8609
8609
|
}
|
|
8610
8610
|
function calendar(time, formats) {
|
|
8611
8611
|
if (arguments.length === 1) {
|
|
@@ -8620,8 +8620,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8620
8620
|
time = undefined;
|
|
8621
8621
|
}
|
|
8622
8622
|
}
|
|
8623
|
-
var
|
|
8624
|
-
return this.format(output || this.localeData().calendar(
|
|
8623
|
+
var now = time || createLocal(), sod = cloneWithOffset(now, this).startOf("day"), format = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
|
|
8624
|
+
return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
|
|
8625
8625
|
}
|
|
8626
8626
|
function clone$1() {
|
|
8627
8627
|
return new Moment(this);
|
|
@@ -8650,8 +8650,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8650
8650
|
return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
|
8651
8651
|
}
|
|
8652
8652
|
}
|
|
8653
|
-
function isBetween(
|
|
8654
|
-
var localFrom = isMoment(
|
|
8653
|
+
function isBetween(from, to, units, inclusivity) {
|
|
8654
|
+
var localFrom = isMoment(from) ? from : createLocal(from), localTo = isMoment(to) ? to : createLocal(to);
|
|
8655
8655
|
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
|
8656
8656
|
return false;
|
|
8657
8657
|
}
|
|
@@ -8992,8 +8992,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
8992
8992
|
addRegexToken("NNN", matchEraAbbr);
|
|
8993
8993
|
addRegexToken("NNNN", matchEraName);
|
|
8994
8994
|
addRegexToken("NNNNN", matchEraNarrow);
|
|
8995
|
-
addParseToken(["N", "NN", "NNN", "NNNN", "NNNNN"], function(input, array, config,
|
|
8996
|
-
var era = config._locale.erasParse(input,
|
|
8995
|
+
addParseToken(["N", "NN", "NNN", "NNNN", "NNNNN"], function(input, array, config, token) {
|
|
8996
|
+
var era = config._locale.erasParse(input, token, config._strict);
|
|
8997
8997
|
if (era) {
|
|
8998
8998
|
getParsingFlags(config).era = era;
|
|
8999
8999
|
} else {
|
|
@@ -9006,7 +9006,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9006
9006
|
addRegexToken("yyyy", matchUnsigned);
|
|
9007
9007
|
addRegexToken("yo", matchEraYearOrdinal);
|
|
9008
9008
|
addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
|
|
9009
|
-
addParseToken(["yo"], function(input, array, config,
|
|
9009
|
+
addParseToken(["yo"], function(input, array, config, token) {
|
|
9010
9010
|
var match;
|
|
9011
9011
|
if (config._locale._eraYearOrdinalRegex) {
|
|
9012
9012
|
match = input.match(config._locale._eraYearOrdinalRegex);
|
|
@@ -9017,7 +9017,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9017
9017
|
array[YEAR] = parseInt(input, 10);
|
|
9018
9018
|
}
|
|
9019
9019
|
});
|
|
9020
|
-
function localeEras(m,
|
|
9020
|
+
function localeEras(m, format) {
|
|
9021
9021
|
var i, l, date, eras = this._eras || getLocale("en")._eras;
|
|
9022
9022
|
for (i = 0, l = eras.length;i < l; ++i) {
|
|
9023
9023
|
switch (typeof eras[i].since) {
|
|
@@ -9038,7 +9038,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9038
9038
|
}
|
|
9039
9039
|
return eras;
|
|
9040
9040
|
}
|
|
9041
|
-
function localeErasParse(eraName,
|
|
9041
|
+
function localeErasParse(eraName, format, strict) {
|
|
9042
9042
|
var i, l, eras = this.eras(), name, abbr, narrow;
|
|
9043
9043
|
eraName = eraName.toUpperCase();
|
|
9044
9044
|
for (i = 0, l = eras.length;i < l; ++i) {
|
|
@@ -9046,7 +9046,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9046
9046
|
abbr = eras[i].abbr.toUpperCase();
|
|
9047
9047
|
narrow = eras[i].narrow.toUpperCase();
|
|
9048
9048
|
if (strict) {
|
|
9049
|
-
switch (
|
|
9049
|
+
switch (format) {
|
|
9050
9050
|
case "N":
|
|
9051
9051
|
case "NN":
|
|
9052
9052
|
case "NNN":
|
|
@@ -9146,17 +9146,17 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9146
9146
|
}
|
|
9147
9147
|
return isStrict ? this._erasNarrowRegex : this._erasRegex;
|
|
9148
9148
|
}
|
|
9149
|
-
function matchEraAbbr(isStrict,
|
|
9150
|
-
return
|
|
9149
|
+
function matchEraAbbr(isStrict, locale) {
|
|
9150
|
+
return locale.erasAbbrRegex(isStrict);
|
|
9151
9151
|
}
|
|
9152
|
-
function matchEraName(isStrict,
|
|
9153
|
-
return
|
|
9152
|
+
function matchEraName(isStrict, locale) {
|
|
9153
|
+
return locale.erasNameRegex(isStrict);
|
|
9154
9154
|
}
|
|
9155
|
-
function matchEraNarrow(isStrict,
|
|
9156
|
-
return
|
|
9155
|
+
function matchEraNarrow(isStrict, locale) {
|
|
9156
|
+
return locale.erasNarrowRegex(isStrict);
|
|
9157
9157
|
}
|
|
9158
|
-
function matchEraYearOrdinal(isStrict,
|
|
9159
|
-
return
|
|
9158
|
+
function matchEraYearOrdinal(isStrict, locale) {
|
|
9159
|
+
return locale._eraYearOrdinalRegex || matchUnsigned;
|
|
9160
9160
|
}
|
|
9161
9161
|
function computeErasParse() {
|
|
9162
9162
|
var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras();
|
|
@@ -9182,8 +9182,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9182
9182
|
addFormatToken(0, ["GG", 2], 0, function() {
|
|
9183
9183
|
return this.isoWeekYear() % 100;
|
|
9184
9184
|
});
|
|
9185
|
-
function addWeekYearFormatToken(
|
|
9186
|
-
addFormatToken(0, [
|
|
9185
|
+
function addWeekYearFormatToken(token, getter) {
|
|
9186
|
+
addFormatToken(0, [token, token.length], 0, getter);
|
|
9187
9187
|
}
|
|
9188
9188
|
addWeekYearFormatToken("gggg", "weekYear");
|
|
9189
9189
|
addWeekYearFormatToken("ggggg", "weekYear");
|
|
@@ -9197,11 +9197,11 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9197
9197
|
addRegexToken("gggg", match1to4, match4);
|
|
9198
9198
|
addRegexToken("GGGGG", match1to6, match6);
|
|
9199
9199
|
addRegexToken("ggggg", match1to6, match6);
|
|
9200
|
-
addWeekParseToken(["gggg", "ggggg", "GGGG", "GGGGG"], function(input, week, config,
|
|
9201
|
-
week[
|
|
9200
|
+
addWeekParseToken(["gggg", "ggggg", "GGGG", "GGGGG"], function(input, week, config, token) {
|
|
9201
|
+
week[token.substr(0, 2)] = toInt(input);
|
|
9202
9202
|
});
|
|
9203
|
-
addWeekParseToken(["gg", "GG"], function(input, week, config,
|
|
9204
|
-
week[
|
|
9203
|
+
addWeekParseToken(["gg", "GG"], function(input, week, config, token) {
|
|
9204
|
+
week[token] = hooks.parseTwoDigitYear(input);
|
|
9205
9205
|
});
|
|
9206
9206
|
function getSetWeekYear(input) {
|
|
9207
9207
|
return getSetWeekYearHelper.call(this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy);
|
|
@@ -9253,8 +9253,8 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9253
9253
|
addFormatToken("D", ["DD", 2], "Do", "date");
|
|
9254
9254
|
addRegexToken("D", match1to2, match1to2NoLeadingZero);
|
|
9255
9255
|
addRegexToken("DD", match1to2, match2);
|
|
9256
|
-
addRegexToken("Do", function(isStrict,
|
|
9257
|
-
return isStrict ?
|
|
9256
|
+
addRegexToken("Do", function(isStrict, locale) {
|
|
9257
|
+
return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;
|
|
9258
9258
|
});
|
|
9259
9259
|
addParseToken(["D", "DD"], DATE);
|
|
9260
9260
|
addParseToken("Do", function(input, array) {
|
|
@@ -9457,65 +9457,65 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9457
9457
|
proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
|
9458
9458
|
proto$1.isPM = localeIsPM;
|
|
9459
9459
|
proto$1.meridiem = localeMeridiem;
|
|
9460
|
-
function get$1(
|
|
9461
|
-
var
|
|
9462
|
-
return
|
|
9460
|
+
function get$1(format, index, field, setter) {
|
|
9461
|
+
var locale = getLocale(), utc = createUTC().set(setter, index);
|
|
9462
|
+
return locale[field](utc, format);
|
|
9463
9463
|
}
|
|
9464
|
-
function listMonthsImpl(
|
|
9465
|
-
if (isNumber(
|
|
9466
|
-
index =
|
|
9467
|
-
|
|
9464
|
+
function listMonthsImpl(format, index, field) {
|
|
9465
|
+
if (isNumber(format)) {
|
|
9466
|
+
index = format;
|
|
9467
|
+
format = undefined;
|
|
9468
9468
|
}
|
|
9469
|
-
|
|
9469
|
+
format = format || "";
|
|
9470
9470
|
if (index != null) {
|
|
9471
|
-
return get$1(
|
|
9471
|
+
return get$1(format, index, field, "month");
|
|
9472
9472
|
}
|
|
9473
9473
|
var i, out = [];
|
|
9474
9474
|
for (i = 0;i < 12; i++) {
|
|
9475
|
-
out[i] = get$1(
|
|
9475
|
+
out[i] = get$1(format, i, field, "month");
|
|
9476
9476
|
}
|
|
9477
9477
|
return out;
|
|
9478
9478
|
}
|
|
9479
|
-
function listWeekdaysImpl(localeSorted,
|
|
9479
|
+
function listWeekdaysImpl(localeSorted, format, index, field) {
|
|
9480
9480
|
if (typeof localeSorted === "boolean") {
|
|
9481
|
-
if (isNumber(
|
|
9482
|
-
index =
|
|
9483
|
-
|
|
9481
|
+
if (isNumber(format)) {
|
|
9482
|
+
index = format;
|
|
9483
|
+
format = undefined;
|
|
9484
9484
|
}
|
|
9485
|
-
|
|
9485
|
+
format = format || "";
|
|
9486
9486
|
} else {
|
|
9487
|
-
|
|
9488
|
-
index =
|
|
9487
|
+
format = localeSorted;
|
|
9488
|
+
index = format;
|
|
9489
9489
|
localeSorted = false;
|
|
9490
|
-
if (isNumber(
|
|
9491
|
-
index =
|
|
9492
|
-
|
|
9490
|
+
if (isNumber(format)) {
|
|
9491
|
+
index = format;
|
|
9492
|
+
format = undefined;
|
|
9493
9493
|
}
|
|
9494
|
-
|
|
9494
|
+
format = format || "";
|
|
9495
9495
|
}
|
|
9496
|
-
var
|
|
9496
|
+
var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0, i, out = [];
|
|
9497
9497
|
if (index != null) {
|
|
9498
|
-
return get$1(
|
|
9498
|
+
return get$1(format, (index + shift) % 7, field, "day");
|
|
9499
9499
|
}
|
|
9500
9500
|
for (i = 0;i < 7; i++) {
|
|
9501
|
-
out[i] = get$1(
|
|
9501
|
+
out[i] = get$1(format, (i + shift) % 7, field, "day");
|
|
9502
9502
|
}
|
|
9503
9503
|
return out;
|
|
9504
9504
|
}
|
|
9505
|
-
function listMonths(
|
|
9506
|
-
return listMonthsImpl(
|
|
9505
|
+
function listMonths(format, index) {
|
|
9506
|
+
return listMonthsImpl(format, index, "months");
|
|
9507
9507
|
}
|
|
9508
|
-
function listMonthsShort(
|
|
9509
|
-
return listMonthsImpl(
|
|
9508
|
+
function listMonthsShort(format, index) {
|
|
9509
|
+
return listMonthsImpl(format, index, "monthsShort");
|
|
9510
9510
|
}
|
|
9511
|
-
function listWeekdays(localeSorted,
|
|
9512
|
-
return listWeekdaysImpl(localeSorted,
|
|
9511
|
+
function listWeekdays(localeSorted, format, index) {
|
|
9512
|
+
return listWeekdaysImpl(localeSorted, format, index, "weekdays");
|
|
9513
9513
|
}
|
|
9514
|
-
function listWeekdaysShort(localeSorted,
|
|
9515
|
-
return listWeekdaysImpl(localeSorted,
|
|
9514
|
+
function listWeekdaysShort(localeSorted, format, index) {
|
|
9515
|
+
return listWeekdaysImpl(localeSorted, format, index, "weekdaysShort");
|
|
9516
9516
|
}
|
|
9517
|
-
function listWeekdaysMin(localeSorted,
|
|
9518
|
-
return listWeekdaysImpl(localeSorted,
|
|
9517
|
+
function listWeekdaysMin(localeSorted, format, index) {
|
|
9518
|
+
return listWeekdaysImpl(localeSorted, format, index, "weekdaysMin");
|
|
9519
9519
|
}
|
|
9520
9520
|
getSetGlobalLocale("en", {
|
|
9521
9521
|
eras: [
|
|
@@ -9579,68 +9579,68 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9579
9579
|
}
|
|
9580
9580
|
}
|
|
9581
9581
|
function bubble() {
|
|
9582
|
-
var
|
|
9583
|
-
if (!(
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
}
|
|
9588
|
-
data.milliseconds =
|
|
9589
|
-
|
|
9590
|
-
data.seconds =
|
|
9591
|
-
|
|
9592
|
-
data.minutes =
|
|
9593
|
-
|
|
9594
|
-
data.hours =
|
|
9595
|
-
|
|
9596
|
-
monthsFromDays = absFloor(daysToMonths(
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
data.days =
|
|
9602
|
-
data.months =
|
|
9603
|
-
data.years =
|
|
9582
|
+
var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays;
|
|
9583
|
+
if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {
|
|
9584
|
+
milliseconds += absCeil(monthsToDays(months) + days) * 86400000;
|
|
9585
|
+
days = 0;
|
|
9586
|
+
months = 0;
|
|
9587
|
+
}
|
|
9588
|
+
data.milliseconds = milliseconds % 1000;
|
|
9589
|
+
seconds = absFloor(milliseconds / 1000);
|
|
9590
|
+
data.seconds = seconds % 60;
|
|
9591
|
+
minutes = absFloor(seconds / 60);
|
|
9592
|
+
data.minutes = minutes % 60;
|
|
9593
|
+
hours = absFloor(minutes / 60);
|
|
9594
|
+
data.hours = hours % 24;
|
|
9595
|
+
days += absFloor(hours / 24);
|
|
9596
|
+
monthsFromDays = absFloor(daysToMonths(days));
|
|
9597
|
+
months += monthsFromDays;
|
|
9598
|
+
days -= absCeil(monthsToDays(monthsFromDays));
|
|
9599
|
+
years = absFloor(months / 12);
|
|
9600
|
+
months %= 12;
|
|
9601
|
+
data.days = days;
|
|
9602
|
+
data.months = months;
|
|
9603
|
+
data.years = years;
|
|
9604
9604
|
return this;
|
|
9605
9605
|
}
|
|
9606
|
-
function daysToMonths(
|
|
9607
|
-
return
|
|
9606
|
+
function daysToMonths(days) {
|
|
9607
|
+
return days * 4800 / 146097;
|
|
9608
9608
|
}
|
|
9609
|
-
function monthsToDays(
|
|
9610
|
-
return
|
|
9609
|
+
function monthsToDays(months) {
|
|
9610
|
+
return months * 146097 / 4800;
|
|
9611
9611
|
}
|
|
9612
9612
|
function as(units) {
|
|
9613
9613
|
if (!this.isValid()) {
|
|
9614
9614
|
return NaN;
|
|
9615
9615
|
}
|
|
9616
|
-
var
|
|
9616
|
+
var days, months, milliseconds = this._milliseconds;
|
|
9617
9617
|
units = normalizeUnits(units);
|
|
9618
9618
|
if (units === "month" || units === "quarter" || units === "year") {
|
|
9619
|
-
|
|
9620
|
-
|
|
9619
|
+
days = this._days + milliseconds / 86400000;
|
|
9620
|
+
months = this._months + daysToMonths(days);
|
|
9621
9621
|
switch (units) {
|
|
9622
9622
|
case "month":
|
|
9623
|
-
return
|
|
9623
|
+
return months;
|
|
9624
9624
|
case "quarter":
|
|
9625
|
-
return
|
|
9625
|
+
return months / 3;
|
|
9626
9626
|
case "year":
|
|
9627
|
-
return
|
|
9627
|
+
return months / 12;
|
|
9628
9628
|
}
|
|
9629
9629
|
} else {
|
|
9630
|
-
|
|
9630
|
+
days = this._days + Math.round(monthsToDays(this._months));
|
|
9631
9631
|
switch (units) {
|
|
9632
9632
|
case "week":
|
|
9633
|
-
return
|
|
9633
|
+
return days / 7 + milliseconds / 604800000;
|
|
9634
9634
|
case "day":
|
|
9635
|
-
return
|
|
9635
|
+
return days + milliseconds / 86400000;
|
|
9636
9636
|
case "hour":
|
|
9637
|
-
return
|
|
9637
|
+
return days * 24 + milliseconds / 3600000;
|
|
9638
9638
|
case "minute":
|
|
9639
|
-
return
|
|
9639
|
+
return days * 1440 + milliseconds / 60000;
|
|
9640
9640
|
case "second":
|
|
9641
|
-
return
|
|
9641
|
+
return days * 86400 + milliseconds / 1000;
|
|
9642
9642
|
case "millisecond":
|
|
9643
|
-
return Math.floor(
|
|
9643
|
+
return Math.floor(days * 86400000) + milliseconds;
|
|
9644
9644
|
default:
|
|
9645
9645
|
throw new Error("Unknown unit " + units);
|
|
9646
9646
|
}
|
|
@@ -9677,18 +9677,18 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9677
9677
|
w: null,
|
|
9678
9678
|
M: 11
|
|
9679
9679
|
};
|
|
9680
|
-
function substituteTimeAgo(string, number, withoutSuffix, isFuture,
|
|
9681
|
-
return relativeTimeWithoutPostformat.call(
|
|
9680
|
+
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
|
|
9681
|
+
return relativeTimeWithoutPostformat.call(locale, number || 1, !!withoutSuffix, string, isFuture);
|
|
9682
9682
|
}
|
|
9683
|
-
function relativeTime(posNegDuration, withoutSuffix,
|
|
9684
|
-
var duration = createDuration(posNegDuration).abs(),
|
|
9685
|
-
if (
|
|
9686
|
-
a = a ||
|
|
9683
|
+
function relativeTime(posNegDuration, withoutSuffix, thresholds, locale) {
|
|
9684
|
+
var duration = createDuration(posNegDuration).abs(), seconds = round(duration.as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), weeks = round(duration.as("w")), years = round(duration.as("y")), a = seconds <= thresholds.ss && ["s", seconds] || seconds < thresholds.s && ["ss", seconds] || minutes <= 1 && ["m"] || minutes < thresholds.m && ["mm", minutes] || hours <= 1 && ["h"] || hours < thresholds.h && ["hh", hours] || days <= 1 && ["d"] || days < thresholds.d && ["dd", days];
|
|
9685
|
+
if (thresholds.w != null) {
|
|
9686
|
+
a = a || weeks <= 1 && ["w"] || weeks < thresholds.w && ["ww", weeks];
|
|
9687
9687
|
}
|
|
9688
|
-
a = a ||
|
|
9688
|
+
a = a || months <= 1 && ["M"] || months < thresholds.M && ["MM", months] || years <= 1 && ["y"] || ["yy", years];
|
|
9689
9689
|
a[2] = withoutSuffix;
|
|
9690
9690
|
a[3] = +posNegDuration > 0;
|
|
9691
|
-
a[4] =
|
|
9691
|
+
a[4] = locale;
|
|
9692
9692
|
return substituteTimeAgo.apply(null, a);
|
|
9693
9693
|
}
|
|
9694
9694
|
function getSetRelativeTimeRounding(roundingFunction) {
|
|
@@ -9718,7 +9718,7 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9718
9718
|
if (!this.isValid()) {
|
|
9719
9719
|
return this.localeData().invalidDate();
|
|
9720
9720
|
}
|
|
9721
|
-
var withSuffix = false, th = thresholds,
|
|
9721
|
+
var withSuffix = false, th = thresholds, locale, output;
|
|
9722
9722
|
if (typeof argWithSuffix === "object") {
|
|
9723
9723
|
argThresholds = argWithSuffix;
|
|
9724
9724
|
argWithSuffix = false;
|
|
@@ -9732,12 +9732,12 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9732
9732
|
th.ss = argThresholds.s - 1;
|
|
9733
9733
|
}
|
|
9734
9734
|
}
|
|
9735
|
-
|
|
9736
|
-
output = relativeTime(this, !withSuffix, th,
|
|
9735
|
+
locale = this.localeData();
|
|
9736
|
+
output = relativeTime(this, !withSuffix, th, locale);
|
|
9737
9737
|
if (withSuffix) {
|
|
9738
|
-
output = pastFutureWithoutPostformat.call(
|
|
9738
|
+
output = pastFutureWithoutPostformat.call(locale, +this, output);
|
|
9739
9739
|
}
|
|
9740
|
-
return
|
|
9740
|
+
return locale.postformat(output);
|
|
9741
9741
|
}
|
|
9742
9742
|
var abs = Math.abs;
|
|
9743
9743
|
function sign(x) {
|
|
@@ -9747,22 +9747,22 @@ Arguments: ` + Array.prototype.slice.call(args).join("") + `
|
|
|
9747
9747
|
if (!this.isValid()) {
|
|
9748
9748
|
return this.localeData().invalidDate();
|
|
9749
9749
|
}
|
|
9750
|
-
var
|
|
9750
|
+
var seconds = abs(this._milliseconds) / 1000, days = abs(this._days), months = abs(this._months), minutes, hours, years, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
|
|
9751
9751
|
if (!total) {
|
|
9752
9752
|
return "P0D";
|
|
9753
9753
|
}
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
s =
|
|
9754
|
+
minutes = absFloor(seconds / 60);
|
|
9755
|
+
hours = absFloor(minutes / 60);
|
|
9756
|
+
seconds %= 60;
|
|
9757
|
+
minutes %= 60;
|
|
9758
|
+
years = absFloor(months / 12);
|
|
9759
|
+
months %= 12;
|
|
9760
|
+
s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, "") : "";
|
|
9761
9761
|
totalSign = total < 0 ? "-" : "";
|
|
9762
9762
|
ymSign = sign(this._months) !== sign(total) ? "-" : "";
|
|
9763
9763
|
daysSign = sign(this._days) !== sign(total) ? "-" : "";
|
|
9764
9764
|
hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
|
|
9765
|
-
return totalSign + "P" + (
|
|
9765
|
+
return totalSign + "P" + (years ? ymSign + years + "Y" : "") + (months ? ymSign + months + "M" : "") + (days ? daysSign + days + "D" : "") + (hours || minutes || seconds ? "T" : "") + (hours ? hmsSign + hours + "H" : "") + (minutes ? hmsSign + minutes + "M" : "") + (seconds ? hmsSign + s + "S" : "");
|
|
9766
9766
|
}
|
|
9767
9767
|
var proto = Duration.prototype;
|
|
9768
9768
|
proto.isValid = isValid$1;
|
|
@@ -9865,7 +9865,7 @@ var require_date_format_utils = __commonJS(function(exports) {
|
|
|
9865
9865
|
var constants_1 = require_constants2();
|
|
9866
9866
|
|
|
9867
9867
|
class DateFormatUtils {
|
|
9868
|
-
static extractOffsetFromDateExpression(expression,
|
|
9868
|
+
static extractOffsetFromDateExpression(expression, logger) {
|
|
9869
9869
|
if (!expression || typeof expression !== "string") {
|
|
9870
9870
|
return null;
|
|
9871
9871
|
}
|
|
@@ -9882,17 +9882,17 @@ var require_date_format_utils = __commonJS(function(exports) {
|
|
|
9882
9882
|
const offset = offsetMatch[0] === constants_1.UTC_TIMEZONE_INDICATOR ? constants_1.DEFAULT_TIMEZONE_OFFSET : offsetMatch[0];
|
|
9883
9883
|
return offset;
|
|
9884
9884
|
} catch (error) {
|
|
9885
|
-
|
|
9885
|
+
logger.error(`${this.LOG_PREFIX}Failed to extract offset from date expression "${expression}": ${error.message}.`);
|
|
9886
9886
|
return null;
|
|
9887
9887
|
}
|
|
9888
9888
|
}
|
|
9889
|
-
static formatDate(utcString, mask, offset,
|
|
9889
|
+
static formatDate(utcString, mask, offset, logger) {
|
|
9890
9890
|
if (!utcString || typeof utcString !== "string") {
|
|
9891
|
-
|
|
9891
|
+
logger.warn(`${this.LOG_PREFIX}UTC string must be a non-empty string. Cannot format date.`);
|
|
9892
9892
|
return utcString || "";
|
|
9893
9893
|
}
|
|
9894
9894
|
if (!mask || typeof mask !== "string") {
|
|
9895
|
-
|
|
9895
|
+
logger.warn(`${this.LOG_PREFIX}Mask must be a non-empty string. Returning original UTC string: ${utcString}`);
|
|
9896
9896
|
return utcString;
|
|
9897
9897
|
}
|
|
9898
9898
|
try {
|
|
@@ -9908,7 +9908,7 @@ var require_date_format_utils = __commonJS(function(exports) {
|
|
|
9908
9908
|
formatted = formatted.replace(/\[Z\]/g, "Z");
|
|
9909
9909
|
return formatted;
|
|
9910
9910
|
} catch (error) {
|
|
9911
|
-
|
|
9911
|
+
logger.error(`${this.LOG_PREFIX}Failed to format date "${utcString}" with mask "${mask}": ${error.message}. Returning original UTC string.`);
|
|
9912
9912
|
return utcString;
|
|
9913
9913
|
}
|
|
9914
9914
|
}
|
|
@@ -10033,14 +10033,14 @@ var require_generic_utils2 = __commonJS(function(exports) {
|
|
|
10033
10033
|
return val;
|
|
10034
10034
|
seen.add(val);
|
|
10035
10035
|
if (Array.isArray(val)) {
|
|
10036
|
-
let
|
|
10037
|
-
const
|
|
10036
|
+
let changed = false;
|
|
10037
|
+
const out = val.map((item) => {
|
|
10038
10038
|
const transformed = walk(item, depth + 1);
|
|
10039
10039
|
if (transformed !== item)
|
|
10040
|
-
|
|
10040
|
+
changed = true;
|
|
10041
10041
|
return transformed;
|
|
10042
10042
|
});
|
|
10043
|
-
return
|
|
10043
|
+
return changed ? out : val;
|
|
10044
10044
|
}
|
|
10045
10045
|
let changed = false;
|
|
10046
10046
|
const out = {};
|
|
@@ -10137,9 +10137,9 @@ var require_resource_override_resolver = __commonJS(function(exports) {
|
|
|
10137
10137
|
var constants_1 = require_constants2();
|
|
10138
10138
|
|
|
10139
10139
|
class ResourceOverrideResolver {
|
|
10140
|
-
static getOverriddenValue(workflowConfig,
|
|
10140
|
+
static getOverriddenValue(workflowConfig, logger, resourceType, propertyName, defaultResourceKey, solutionResourceKey) {
|
|
10141
10141
|
if (!workflowConfig.resourceOverwrites || Object.keys(workflowConfig.resourceOverwrites).length === 0) {
|
|
10142
|
-
|
|
10142
|
+
logger.info(`Resource overwrites is empty, returning defaultResourceKey: ${defaultResourceKey}`);
|
|
10143
10143
|
return defaultResourceKey;
|
|
10144
10144
|
}
|
|
10145
10145
|
const getResourceOverride = (identifier) => {
|
|
@@ -10158,10 +10158,10 @@ var require_resource_override_resolver = __commonJS(function(exports) {
|
|
|
10158
10158
|
if (resourceOverride) {
|
|
10159
10159
|
return resourceOverride;
|
|
10160
10160
|
}
|
|
10161
|
-
|
|
10161
|
+
logger.info(`No resource overrides found, returning defaultResourceKey: ${defaultResourceKey}`);
|
|
10162
10162
|
return defaultResourceKey;
|
|
10163
10163
|
}
|
|
10164
|
-
static getOrchestratorOverrides(workflowConfig,
|
|
10164
|
+
static getOrchestratorOverrides(workflowConfig, logger, endpoint, pathParameters, bodyParameters) {
|
|
10165
10165
|
const resourcePrefix = this.getResourcePrefix(endpoint);
|
|
10166
10166
|
if (!resourcePrefix) {
|
|
10167
10167
|
return;
|
|
@@ -10170,13 +10170,13 @@ var require_resource_override_resolver = __commonJS(function(exports) {
|
|
|
10170
10170
|
if (endpoint.includes(constants_1.ORCHESTRATOR_JOBS_ENDPOINT)) {
|
|
10171
10171
|
resourceParam = bodyParameters?.ReleaseName;
|
|
10172
10172
|
if (!resourceParam) {
|
|
10173
|
-
|
|
10173
|
+
logger.info("No ReleaseName found in body parameters for Jobs endpoint orchestrator context resolution");
|
|
10174
10174
|
return;
|
|
10175
10175
|
}
|
|
10176
10176
|
} else {
|
|
10177
10177
|
resourceParam = pathParameters.id;
|
|
10178
10178
|
if (!resourceParam) {
|
|
10179
|
-
|
|
10179
|
+
logger.info("No resource path parameter found for orchestrator context resolution");
|
|
10180
10180
|
return;
|
|
10181
10181
|
}
|
|
10182
10182
|
}
|
|
@@ -10193,23 +10193,23 @@ var require_resource_override_resolver = __commonJS(function(exports) {
|
|
|
10193
10193
|
orchestratorContext = {
|
|
10194
10194
|
folderKey: workflowConfig.processConfig?.folderKey
|
|
10195
10195
|
};
|
|
10196
|
-
|
|
10196
|
+
logger.info(`Fallback orchestrator context: ${JSON.stringify(orchestratorContext)}`);
|
|
10197
10197
|
}
|
|
10198
10198
|
if (endpoint.includes(constants_1.ORCHESTRATOR_JOBS_ENDPOINT)) {
|
|
10199
10199
|
orchestratorContext.source = constants_1.API_WORKFLOW_SOURCE;
|
|
10200
10200
|
}
|
|
10201
10201
|
return orchestratorContext;
|
|
10202
10202
|
}
|
|
10203
|
-
static getDataServiceOverrides(workflowConfig,
|
|
10203
|
+
static getDataServiceOverrides(workflowConfig, logger, queryParameters) {
|
|
10204
10204
|
const entityName = queryParameters?.[constants_1.DATASERVICE_ENTITY_NAME_QUERY_PARAM];
|
|
10205
10205
|
if (!entityName) {
|
|
10206
|
-
|
|
10206
|
+
logger.info(`No ${constants_1.DATASERVICE_ENTITY_NAME_QUERY_PARAM} query parameter found for DataService entity override resolution`);
|
|
10207
10207
|
return;
|
|
10208
10208
|
}
|
|
10209
10209
|
const resourceIdentifier = `${constants_1.DATASERVICE_ENTITY_RESOURCE_PREFIX}.${entityName}`;
|
|
10210
10210
|
const resourceOverrides = workflowConfig.resourceOverwrites?.[resourceIdentifier];
|
|
10211
10211
|
if (!resourceOverrides) {
|
|
10212
|
-
|
|
10212
|
+
logger.info(`No DataService entity overrides found for ${resourceIdentifier}`);
|
|
10213
10213
|
return;
|
|
10214
10214
|
}
|
|
10215
10215
|
return {
|
|
@@ -10217,9 +10217,9 @@ var require_resource_override_resolver = __commonJS(function(exports) {
|
|
|
10217
10217
|
folderKey: resourceOverrides.folderKey
|
|
10218
10218
|
};
|
|
10219
10219
|
}
|
|
10220
|
-
static getPropertyBindings(workflowConfig,
|
|
10220
|
+
static getPropertyBindings(workflowConfig, logger, eventType) {
|
|
10221
10221
|
if (!workflowConfig.resourceOverwrites || Object.keys(workflowConfig.resourceOverwrites).length === 0) {
|
|
10222
|
-
|
|
10222
|
+
logger.info(`Resource overwrites is empty, no property bindings for eventType: ${eventType}`);
|
|
10223
10223
|
return;
|
|
10224
10224
|
}
|
|
10225
10225
|
const propertyIdentifier = `Property.${eventType}`;
|
|
@@ -10227,7 +10227,7 @@ var require_resource_override_resolver = __commonJS(function(exports) {
|
|
|
10227
10227
|
if (propertyBindings && typeof propertyBindings === "object") {
|
|
10228
10228
|
return propertyBindings;
|
|
10229
10229
|
}
|
|
10230
|
-
|
|
10230
|
+
logger.info(`No property bindings found for eventType: ${eventType}`);
|
|
10231
10231
|
return;
|
|
10232
10232
|
}
|
|
10233
10233
|
static getResourcePrefix(endpoint) {
|
|
@@ -10370,9 +10370,9 @@ var require_workflow_response = __commonJS(function(exports) {
|
|
|
10370
10370
|
exports.WorkflowResponse = exports.WorkflowJobStatus = undefined;
|
|
10371
10371
|
var utils_1 = require_utils3();
|
|
10372
10372
|
var WorkflowJobStatus;
|
|
10373
|
-
(function(
|
|
10374
|
-
|
|
10375
|
-
|
|
10373
|
+
(function(WorkflowJobStatus) {
|
|
10374
|
+
WorkflowJobStatus["Successful"] = "Successful";
|
|
10375
|
+
WorkflowJobStatus["Faulted"] = "Faulted";
|
|
10376
10376
|
})(WorkflowJobStatus || (exports.WorkflowJobStatus = WorkflowJobStatus = {}));
|
|
10377
10377
|
|
|
10378
10378
|
class WorkflowResponse {
|
|
@@ -10467,8 +10467,8 @@ var require_abstract_expression_handler = __commonJS(function(exports) {
|
|
|
10467
10467
|
}
|
|
10468
10468
|
async evaluateConditionExpression(conditionExpression) {
|
|
10469
10469
|
const result = await this.withErrorHandling(async () => {
|
|
10470
|
-
const
|
|
10471
|
-
return Boolean(
|
|
10470
|
+
const result = await this.evaluateDataExpression(conditionExpression);
|
|
10471
|
+
return Boolean(result);
|
|
10472
10472
|
}, `Error evaluating condition expression: ${conditionExpression}`);
|
|
10473
10473
|
return Boolean(result);
|
|
10474
10474
|
}
|
|
@@ -11738,8 +11738,8 @@ var require_expression_handler_factory = __commonJS(function(exports) {
|
|
|
11738
11738
|
var utils_1 = require_utils3();
|
|
11739
11739
|
var js_expression_handler_1 = require_js_expression_handler();
|
|
11740
11740
|
var ExpressionLanguage;
|
|
11741
|
-
(function(
|
|
11742
|
-
|
|
11741
|
+
(function(ExpressionLanguage) {
|
|
11742
|
+
ExpressionLanguage["JavaScript"] = "javascript";
|
|
11743
11743
|
})(ExpressionLanguage || (exports.ExpressionLanguage = ExpressionLanguage = {}));
|
|
11744
11744
|
function getExpressionHandler(workflow, options) {
|
|
11745
11745
|
const expressionLanguage = workflow.evaluate?.language;
|
|
@@ -12259,10 +12259,10 @@ var require_abstract_task_handler = __commonJS(function(exports) {
|
|
|
12259
12259
|
var utils_1 = require_utils3();
|
|
12260
12260
|
|
|
12261
12261
|
class AbstractTaskHandler {
|
|
12262
|
-
constructor(taskHandlerArgs,
|
|
12262
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
12263
12263
|
this.workflowConfig = taskHandlerArgs.workflowConfig;
|
|
12264
12264
|
this.expressionHandler = expressionHandler;
|
|
12265
|
-
this.logger =
|
|
12265
|
+
this.logger = logger;
|
|
12266
12266
|
this.taskHandlerArgs = taskHandlerArgs;
|
|
12267
12267
|
}
|
|
12268
12268
|
async handleTask(taskName, task, runtimeExpressionArgs) {
|
|
@@ -12344,8 +12344,8 @@ var require_script_task_handler = __commonJS(function(exports) {
|
|
|
12344
12344
|
var SCRIPT_TIMEOUT_MS = 1e4;
|
|
12345
12345
|
|
|
12346
12346
|
class BaseScriptTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
12347
|
-
constructor(taskHandlerArgs,
|
|
12348
|
-
super(taskHandlerArgs,
|
|
12347
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
12348
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
12349
12349
|
}
|
|
12350
12350
|
async internalHandleTask(taskName, task, _input) {
|
|
12351
12351
|
const scriptInput = {};
|
|
@@ -12355,11 +12355,11 @@ var require_script_task_handler = __commonJS(function(exports) {
|
|
|
12355
12355
|
exports.BaseScriptTaskHandler = BaseScriptTaskHandler;
|
|
12356
12356
|
|
|
12357
12357
|
class DefaultScriptTaskHandler extends BaseScriptTaskHandler {
|
|
12358
|
-
constructor(taskHandlerArgs,
|
|
12359
|
-
super(taskHandlerArgs,
|
|
12358
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
12359
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
12360
12360
|
}
|
|
12361
|
-
static create(taskHandlerArgs,
|
|
12362
|
-
return new DefaultScriptTaskHandler(taskHandlerArgs,
|
|
12361
|
+
static create(taskHandlerArgs, logger, expressionHandler) {
|
|
12362
|
+
return new DefaultScriptTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
12363
12363
|
}
|
|
12364
12364
|
async executeScript(taskName, task, _input) {
|
|
12365
12365
|
const scriptConfig = task.run;
|
|
@@ -12528,10 +12528,10 @@ var require_streamed_http_send = __commonJS(function(exports) {
|
|
|
12528
12528
|
});
|
|
12529
12529
|
var __importStar = exports && exports.__importStar || function() {
|
|
12530
12530
|
var ownKeys = function(o) {
|
|
12531
|
-
ownKeys = Object.getOwnPropertyNames || function(
|
|
12531
|
+
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
12532
12532
|
var ar = [];
|
|
12533
|
-
for (var k in
|
|
12534
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
12533
|
+
for (var k in o)
|
|
12534
|
+
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
12535
12535
|
ar[ar.length] = k;
|
|
12536
12536
|
return ar;
|
|
12537
12537
|
};
|
|
@@ -12683,7 +12683,7 @@ var require_streamed_http_send = __commonJS(function(exports) {
|
|
|
12683
12683
|
throw new Error(`Error reading response content: [${mediaType}] - ${errorMessage}`);
|
|
12684
12684
|
}
|
|
12685
12685
|
}
|
|
12686
|
-
async function sendStreamedSpliceRequest(props,
|
|
12686
|
+
async function sendStreamedSpliceRequest(props, logger, traceContext) {
|
|
12687
12687
|
(0, api_workflow_commons_1.setDefaultContentTypeHeader)(props);
|
|
12688
12688
|
if (traceContext) {
|
|
12689
12689
|
(0, trace_header_util_1.applyOutboundTraceHeaders)(props.headers ?? (props.headers = {}), {
|
|
@@ -12693,7 +12693,7 @@ var require_streamed_http_send = __commonJS(function(exports) {
|
|
|
12693
12693
|
});
|
|
12694
12694
|
}
|
|
12695
12695
|
const url = props.url.trim();
|
|
12696
|
-
|
|
12696
|
+
logger.debug(`[StreamedHttpSend] Streaming HTTP request body to ${url} with method ${props.method}`);
|
|
12697
12697
|
try {
|
|
12698
12698
|
const startTime = Date.now();
|
|
12699
12699
|
const response = await fetch((0, api_workflow_commons_1.buildUrl)(url, props.queryParameters), {
|
|
@@ -12772,9 +12772,9 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
12772
12772
|
const displayName = fileRef.FullName ? `"${fileRef.FullName}"` : `(id=${fileRef.ID})`;
|
|
12773
12773
|
return new Error(`Failed to download file ${displayName} from Orchestrator. ` + "The file name may contain unsupported characters — rename the file to use " + "standard ASCII characters (letters, digits, spaces, dashes, underscores, periods) " + `and try again. Underlying error: ${baseMessage}`);
|
|
12774
12774
|
}
|
|
12775
|
-
async function downloadBlobFileWithFriendlyError(workflowConfig,
|
|
12775
|
+
async function downloadBlobFileWithFriendlyError(workflowConfig, logger, fileRef) {
|
|
12776
12776
|
try {
|
|
12777
|
-
return await api_workflow_commons_1.OrchestratorUtils.downloadFileFromBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, fileRef.ID,
|
|
12777
|
+
return await api_workflow_commons_1.OrchestratorUtils.downloadFileFromBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, fileRef.ID, logger, workflowConfig.processConfig?.folderKey);
|
|
12778
12778
|
} catch (error) {
|
|
12779
12779
|
throw azureSignatureFriendlyError(error, fileRef) ?? error;
|
|
12780
12780
|
}
|
|
@@ -12805,12 +12805,12 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
12805
12805
|
const inner = value[exports.FILE_READ_MARKER_KEY];
|
|
12806
12806
|
return !!inner && typeof inner === "object" && (0, api_workflow_commons_1.isBlobFileReference)(inner.ref);
|
|
12807
12807
|
}
|
|
12808
|
-
async function readRefContent(ref, workflowConfig,
|
|
12809
|
-
const file = await downloadBlobFileWithFriendlyError(workflowConfig,
|
|
12808
|
+
async function readRefContent(ref, workflowConfig, logger) {
|
|
12809
|
+
const file = await downloadBlobFileWithFriendlyError(workflowConfig, logger, ref);
|
|
12810
12810
|
return (0, api_workflow_commons_1.getAttachmentEncoding)(ref) === "base64" ? new TextDecoder().decode(file.content) : file.content;
|
|
12811
12811
|
}
|
|
12812
|
-
function resolveReadMarker(marker, workflowConfig,
|
|
12813
|
-
return readRefContent(marker[exports.FILE_READ_MARKER_KEY].ref, workflowConfig,
|
|
12812
|
+
function resolveReadMarker(marker, workflowConfig, logger) {
|
|
12813
|
+
return readRefContent(marker[exports.FILE_READ_MARKER_KEY].ref, workflowConfig, logger);
|
|
12814
12814
|
}
|
|
12815
12815
|
function rawBytesInJsonError(ref) {
|
|
12816
12816
|
return new Error(`A raw-bytes read of file (${ref.FullName || ref.ID}) was placed inside a JSON body field. ` + "Raw bytes cannot be embedded in JSON — convert the file with File to Base64 first for a nested " + "field, or send the file reference as the entire request body.");
|
|
@@ -12824,9 +12824,9 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
12824
12824
|
function isPlainObject(value) {
|
|
12825
12825
|
return Object.prototype.toString.call(value) === "[object Object]";
|
|
12826
12826
|
}
|
|
12827
|
-
async function resolveNestedReads(value, workflowConfig,
|
|
12827
|
+
async function resolveNestedReads(value, workflowConfig, logger, ancestors = new Set) {
|
|
12828
12828
|
if (isFileReadMarker(value)) {
|
|
12829
|
-
const resolved = await resolveReadMarker(value, workflowConfig,
|
|
12829
|
+
const resolved = await resolveReadMarker(value, workflowConfig, logger);
|
|
12830
12830
|
if (typeof resolved !== "string") {
|
|
12831
12831
|
throw rawBytesInJsonError(value[exports.FILE_READ_MARKER_KEY].ref);
|
|
12832
12832
|
}
|
|
@@ -12840,11 +12840,11 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
12840
12840
|
throw circularBodyError();
|
|
12841
12841
|
const nextAncestors = new Set(ancestors).add(value);
|
|
12842
12842
|
if (Array.isArray(value)) {
|
|
12843
|
-
const items = await Promise.all(value.map((item) => resolveNestedReads(item, workflowConfig,
|
|
12843
|
+
const items = await Promise.all(value.map((item) => resolveNestedReads(item, workflowConfig, logger, nextAncestors)));
|
|
12844
12844
|
return items.some((item, i) => item !== value[i]) ? items : value;
|
|
12845
12845
|
}
|
|
12846
12846
|
const entries = Object.entries(value);
|
|
12847
|
-
const resolved = await Promise.all(entries.map(async ([key, val]) => [key, await resolveNestedReads(val, workflowConfig,
|
|
12847
|
+
const resolved = await Promise.all(entries.map(async ([key, val]) => [key, await resolveNestedReads(val, workflowConfig, logger, nextAncestors)]));
|
|
12848
12848
|
return resolved.some(([, val], i) => val !== entries[i][1]) ? Object.fromEntries(resolved) : value;
|
|
12849
12849
|
}
|
|
12850
12850
|
return value;
|
|
@@ -12962,15 +12962,15 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
12962
12962
|
}
|
|
12963
12963
|
return total;
|
|
12964
12964
|
}
|
|
12965
|
-
async function openRefDownloadWithFriendlyError(ref, workflowConfig,
|
|
12965
|
+
async function openRefDownloadWithFriendlyError(ref, workflowConfig, logger) {
|
|
12966
12966
|
try {
|
|
12967
|
-
return await api_workflow_commons_1.OrchestratorUtils.openBlobDownloadStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, ref.ID,
|
|
12967
|
+
return await api_workflow_commons_1.OrchestratorUtils.openBlobDownloadStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, ref.ID, logger, workflowConfig.processConfig?.folderKey);
|
|
12968
12968
|
} catch (error) {
|
|
12969
12969
|
throw azureSignatureFriendlyError(error, ref) ?? error;
|
|
12970
12970
|
}
|
|
12971
12971
|
}
|
|
12972
|
-
async function openRefStreamWithFriendlyError(ref, workflowConfig,
|
|
12973
|
-
return (await openRefDownloadWithFriendlyError(ref, workflowConfig,
|
|
12972
|
+
async function openRefStreamWithFriendlyError(ref, workflowConfig, logger) {
|
|
12973
|
+
return (await openRefDownloadWithFriendlyError(ref, workflowConfig, logger)).stream;
|
|
12974
12974
|
}
|
|
12975
12975
|
function validByteLength(value) {
|
|
12976
12976
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
@@ -13019,13 +13019,13 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13019
13019
|
}
|
|
13020
13020
|
});
|
|
13021
13021
|
}
|
|
13022
|
-
async function* spliceChunks(layout, workflowConfig,
|
|
13022
|
+
async function* spliceChunks(layout, workflowConfig, logger) {
|
|
13023
13023
|
for (let i = 0;i < layout.siteTokens.length; i++) {
|
|
13024
13024
|
if (layout.segmentBytes[i].byteLength > 0)
|
|
13025
13025
|
yield layout.segmentBytes[i];
|
|
13026
13026
|
const ref = layout.refsByToken.get(layout.siteTokens[i]);
|
|
13027
13027
|
const declared = declaredRefSize(ref);
|
|
13028
|
-
const stream = await openRefStreamWithFriendlyError(ref, workflowConfig,
|
|
13028
|
+
const stream = await openRefStreamWithFriendlyError(ref, workflowConfig, logger);
|
|
13029
13029
|
let received = 0;
|
|
13030
13030
|
let refDone = false;
|
|
13031
13031
|
try {
|
|
@@ -13053,39 +13053,39 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13053
13053
|
if (lastSegment.byteLength > 0)
|
|
13054
13054
|
yield lastSegment;
|
|
13055
13055
|
}
|
|
13056
|
-
async function assembleSplicedBody(layout, workflowConfig,
|
|
13056
|
+
async function assembleSplicedBody(layout, workflowConfig, logger) {
|
|
13057
13057
|
const total = totalSpliceLength(layout);
|
|
13058
13058
|
if (total !== undefined && (0, streamed_http_send_1.commonsSupportsBlobStreaming)()) {
|
|
13059
|
-
const
|
|
13060
|
-
let
|
|
13059
|
+
const out = new Uint8Array(total);
|
|
13060
|
+
let offset = 0;
|
|
13061
13061
|
const firstRegion = new Map;
|
|
13062
13062
|
for (let i = 0;i < layout.siteTokens.length; i++) {
|
|
13063
13063
|
const segment = layout.segmentBytes[i];
|
|
13064
|
-
|
|
13065
|
-
|
|
13064
|
+
out.set(segment, offset);
|
|
13065
|
+
offset += segment.byteLength;
|
|
13066
13066
|
const token = layout.siteTokens[i];
|
|
13067
13067
|
const ref = layout.refsByToken.get(token);
|
|
13068
13068
|
const declared = declaredRefSize(ref);
|
|
13069
13069
|
const prior = firstRegion.get(token);
|
|
13070
13070
|
if (prior) {
|
|
13071
|
-
|
|
13072
|
-
|
|
13071
|
+
out.copyWithin(offset, prior.start, prior.start + prior.length);
|
|
13072
|
+
offset += prior.length;
|
|
13073
13073
|
continue;
|
|
13074
13074
|
}
|
|
13075
|
-
const start =
|
|
13076
|
-
const stream = await openRefStreamWithFriendlyError(ref, workflowConfig,
|
|
13075
|
+
const start = offset;
|
|
13076
|
+
const stream = await openRefStreamWithFriendlyError(ref, workflowConfig, logger);
|
|
13077
13077
|
let refDone = false;
|
|
13078
13078
|
try {
|
|
13079
13079
|
for await (const chunk of (0, convert_file_base64_utils_1.streamToAsyncIterable)(stream)) {
|
|
13080
13080
|
assertSpliceableBase64Chunk(chunk, ref);
|
|
13081
|
-
if (
|
|
13082
|
-
throw spliceSizeMismatchError(ref, declared,
|
|
13081
|
+
if (offset - start + chunk.byteLength > declared) {
|
|
13082
|
+
throw spliceSizeMismatchError(ref, declared, offset - start + chunk.byteLength);
|
|
13083
13083
|
}
|
|
13084
|
-
|
|
13085
|
-
|
|
13084
|
+
out.set(chunk, offset);
|
|
13085
|
+
offset += chunk.byteLength;
|
|
13086
13086
|
}
|
|
13087
|
-
if (
|
|
13088
|
-
throw spliceSizeMismatchError(ref, declared,
|
|
13087
|
+
if (offset - start !== declared)
|
|
13088
|
+
throw spliceSizeMismatchError(ref, declared, offset - start);
|
|
13089
13089
|
refDone = true;
|
|
13090
13090
|
} finally {
|
|
13091
13091
|
if (!refDone) {
|
|
@@ -13097,12 +13097,12 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13097
13097
|
firstRegion.set(token, { start, length: declared });
|
|
13098
13098
|
}
|
|
13099
13099
|
const lastSegment = layout.segmentBytes[layout.segmentBytes.length - 1];
|
|
13100
|
-
|
|
13101
|
-
return
|
|
13100
|
+
out.set(lastSegment, offset);
|
|
13101
|
+
return out;
|
|
13102
13102
|
}
|
|
13103
13103
|
const bytesByToken = new Map;
|
|
13104
13104
|
for (const [token, ref] of layout.refsByToken) {
|
|
13105
|
-
const file = await downloadBlobFileWithFriendlyError(workflowConfig,
|
|
13105
|
+
const file = await downloadBlobFileWithFriendlyError(workflowConfig, logger, ref);
|
|
13106
13106
|
assertSpliceableBase64Chunk(file.content, ref);
|
|
13107
13107
|
bytesByToken.set(token, file.content);
|
|
13108
13108
|
}
|
|
@@ -13123,8 +13123,8 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13123
13123
|
out.set(layout.segmentBytes[layout.segmentBytes.length - 1], offset);
|
|
13124
13124
|
return out;
|
|
13125
13125
|
}
|
|
13126
|
-
function createSplicedBodyStream(layout, workflowConfig,
|
|
13127
|
-
const iterator = spliceChunks(layout, workflowConfig,
|
|
13126
|
+
function createSplicedBodyStream(layout, workflowConfig, logger) {
|
|
13127
|
+
const iterator = spliceChunks(layout, workflowConfig, logger)[Symbol.asyncIterator]();
|
|
13128
13128
|
const stream = new ReadableStream({
|
|
13129
13129
|
async pull(controller) {
|
|
13130
13130
|
const next = await iterator.next();
|
|
@@ -13149,8 +13149,8 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13149
13149
|
const size = declaredRefSize(ref);
|
|
13150
13150
|
return size === undefined || size > threshold;
|
|
13151
13151
|
}
|
|
13152
|
-
async function streamWholeBodyRef(ref, loggableBody, headers, defaultContentType, workflowConfig,
|
|
13153
|
-
const download = await openRefDownloadWithFriendlyError(ref, workflowConfig,
|
|
13152
|
+
async function streamWholeBodyRef(ref, loggableBody, headers, defaultContentType, workflowConfig, logger) {
|
|
13153
|
+
const download = await openRefDownloadWithFriendlyError(ref, workflowConfig, logger);
|
|
13154
13154
|
const expectedLength = validByteLength(download.size) ?? declaredRefSize(ref);
|
|
13155
13155
|
if (!hasHeader(headers, "Content-Type")) {
|
|
13156
13156
|
headers["Content-Type"] = defaultContentType(download.mimeType);
|
|
@@ -13169,7 +13169,7 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13169
13169
|
const lower = name.toLowerCase();
|
|
13170
13170
|
return Object.keys(headers).some((k) => k.toLowerCase() === lower);
|
|
13171
13171
|
}
|
|
13172
|
-
async function spliceNestedBase64Body(body, headers, workflowConfig,
|
|
13172
|
+
async function spliceNestedBase64Body(body, headers, workflowConfig, logger, options) {
|
|
13173
13173
|
const plan = buildSplicePlan(body);
|
|
13174
13174
|
if (!plan)
|
|
13175
13175
|
return { body, headers };
|
|
@@ -13189,24 +13189,24 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13189
13189
|
const total = totalSpliceLength(layout);
|
|
13190
13190
|
const threshold = options.streamedSpliceThresholdBytes ?? convert_file_base64_utils_1.STREAM_THRESHOLD_BYTES;
|
|
13191
13191
|
if (options.streamedSplice === true && total !== undefined && total > threshold && (0, streamed_http_send_1.commonsSupportsBlobStreaming)()) {
|
|
13192
|
-
const { stream, contentLength } = createSplicedBodyStream(layout, workflowConfig,
|
|
13192
|
+
const { stream, contentLength } = createSplicedBodyStream(layout, workflowConfig, logger);
|
|
13193
13193
|
if (contentLength !== undefined && !hasHeader(headers, "Content-Length")) {
|
|
13194
13194
|
headers["Content-Length"] = String(contentLength);
|
|
13195
13195
|
}
|
|
13196
13196
|
return { body: stream, headers, loggableBody: plan.tokenizedBody, contentLength };
|
|
13197
13197
|
}
|
|
13198
|
-
const assembled = await assembleSplicedBody(layout, workflowConfig,
|
|
13198
|
+
const assembled = await assembleSplicedBody(layout, workflowConfig, logger);
|
|
13199
13199
|
return { body: assembled, headers, loggableBody: plan.tokenizedBody };
|
|
13200
13200
|
}
|
|
13201
|
-
async function materializeBlobRefBody(body, headers, workflowConfig,
|
|
13201
|
+
async function materializeBlobRefBody(body, headers, workflowConfig, logger, options) {
|
|
13202
13202
|
const resolvedHeaders = headers ? { ...headers } : {};
|
|
13203
13203
|
const hasContentType = Object.keys(resolvedHeaders).some((k) => k.toLowerCase() === "content-type");
|
|
13204
13204
|
if (isFileReadMarker(body)) {
|
|
13205
13205
|
const { ref } = body[exports.FILE_READ_MARKER_KEY];
|
|
13206
13206
|
if (shouldStreamWholeBodyRef(ref, options)) {
|
|
13207
|
-
return streamWholeBodyRef(ref, body, resolvedHeaders, (downloadMimeType) => (0, api_workflow_commons_1.getAttachmentEncoding)(ref) === "base64" ? "text/plain" : safeMimeType(ref.MimeType) ?? safeMimeType(downloadMimeType) ?? "application/octet-stream", workflowConfig,
|
|
13207
|
+
return streamWholeBodyRef(ref, body, resolvedHeaders, (downloadMimeType) => (0, api_workflow_commons_1.getAttachmentEncoding)(ref) === "base64" ? "text/plain" : safeMimeType(ref.MimeType) ?? safeMimeType(downloadMimeType) ?? "application/octet-stream", workflowConfig, logger);
|
|
13208
13208
|
}
|
|
13209
|
-
const resolved = await resolveReadMarker(body, workflowConfig,
|
|
13209
|
+
const resolved = await resolveReadMarker(body, workflowConfig, logger);
|
|
13210
13210
|
if (typeof resolved === "string") {
|
|
13211
13211
|
if (!hasContentType)
|
|
13212
13212
|
resolvedHeaders["Content-Type"] = "text/plain";
|
|
@@ -13217,9 +13217,9 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13217
13217
|
}
|
|
13218
13218
|
if ((0, api_workflow_commons_1.isBlobFileReference)(body)) {
|
|
13219
13219
|
if (shouldStreamWholeBodyRef(body, options)) {
|
|
13220
|
-
return streamWholeBodyRef(body, body, resolvedHeaders, (downloadMimeType) => safeMimeType(downloadMimeType) ?? "application/octet-stream", workflowConfig,
|
|
13220
|
+
return streamWholeBodyRef(body, body, resolvedHeaders, (downloadMimeType) => safeMimeType(downloadMimeType) ?? "application/octet-stream", workflowConfig, logger);
|
|
13221
13221
|
}
|
|
13222
|
-
const file = await downloadBlobFileWithFriendlyError(workflowConfig,
|
|
13222
|
+
const file = await downloadBlobFileWithFriendlyError(workflowConfig, logger, body);
|
|
13223
13223
|
if (!hasContentType) {
|
|
13224
13224
|
resolvedHeaders["Content-Type"] = safeMimeType(file.mimeType) ?? "application/octet-stream";
|
|
13225
13225
|
}
|
|
@@ -13227,27 +13227,27 @@ var require_blob_body_utils = __commonJS(function(exports) {
|
|
|
13227
13227
|
}
|
|
13228
13228
|
if (body && typeof body === "object") {
|
|
13229
13229
|
if (options?.spliceNestedBase64 && isJsonRequestMediaType(resolvedHeaders)) {
|
|
13230
|
-
return spliceNestedBase64Body(body, resolvedHeaders, workflowConfig,
|
|
13230
|
+
return spliceNestedBase64Body(body, resolvedHeaders, workflowConfig, logger, options);
|
|
13231
13231
|
}
|
|
13232
|
-
const resolvedBody = await resolveNestedReads(body, workflowConfig,
|
|
13232
|
+
const resolvedBody = await resolveNestedReads(body, workflowConfig, logger);
|
|
13233
13233
|
return { body: resolvedBody, headers: resolvedHeaders };
|
|
13234
13234
|
}
|
|
13235
13235
|
return { body, headers: resolvedHeaders };
|
|
13236
13236
|
}
|
|
13237
|
-
async function resolveFileReadMarkers(value, workflowConfig,
|
|
13237
|
+
async function resolveFileReadMarkers(value, workflowConfig, logger, ancestors = new Set) {
|
|
13238
13238
|
if (isFileReadMarker(value)) {
|
|
13239
|
-
return resolveReadMarker(value, workflowConfig,
|
|
13239
|
+
return resolveReadMarker(value, workflowConfig, logger);
|
|
13240
13240
|
}
|
|
13241
13241
|
if (Array.isArray(value) || isPlainObject(value)) {
|
|
13242
13242
|
if (ancestors.has(value))
|
|
13243
13243
|
throw circularBodyError();
|
|
13244
13244
|
const nextAncestors = new Set(ancestors).add(value);
|
|
13245
13245
|
if (Array.isArray(value)) {
|
|
13246
|
-
const items = await Promise.all(value.map((item) => resolveFileReadMarkers(item, workflowConfig,
|
|
13246
|
+
const items = await Promise.all(value.map((item) => resolveFileReadMarkers(item, workflowConfig, logger, nextAncestors)));
|
|
13247
13247
|
return items.some((item, i) => item !== value[i]) ? items : value;
|
|
13248
13248
|
}
|
|
13249
13249
|
const entries = Object.entries(value);
|
|
13250
|
-
const resolved = await Promise.all(entries.map(async ([key, val]) => [key, await resolveFileReadMarkers(val, workflowConfig,
|
|
13250
|
+
const resolved = await Promise.all(entries.map(async ([key, val]) => [key, await resolveFileReadMarkers(val, workflowConfig, logger, nextAncestors)]));
|
|
13251
13251
|
return resolved.some(([, val], i) => val !== entries[i][1]) ? Object.fromEntries(resolved) : value;
|
|
13252
13252
|
}
|
|
13253
13253
|
return value;
|
|
@@ -13293,9 +13293,9 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13293
13293
|
} catch {}
|
|
13294
13294
|
return;
|
|
13295
13295
|
}
|
|
13296
|
-
function logMemory(
|
|
13296
|
+
function logMemory(logger, fn, step, data) {
|
|
13297
13297
|
try {
|
|
13298
|
-
|
|
13298
|
+
logger.debug(`[${fn}] ${step}`, {
|
|
13299
13299
|
...data,
|
|
13300
13300
|
rssMb: rssMb()
|
|
13301
13301
|
});
|
|
@@ -13364,12 +13364,12 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13364
13364
|
} catch {}
|
|
13365
13365
|
if (byobReader) {
|
|
13366
13366
|
let buffer = new ArrayBuffer(BYOB_READ_BUFFER_BYTES);
|
|
13367
|
-
let
|
|
13367
|
+
let completed = false;
|
|
13368
13368
|
try {
|
|
13369
13369
|
for (;; ) {
|
|
13370
13370
|
const { done, value } = await byobReader.read(new Uint8Array(buffer));
|
|
13371
13371
|
if (done) {
|
|
13372
|
-
|
|
13372
|
+
completed = true;
|
|
13373
13373
|
break;
|
|
13374
13374
|
}
|
|
13375
13375
|
if (value.byteLength > 0) {
|
|
@@ -13378,7 +13378,7 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13378
13378
|
buffer = value.buffer;
|
|
13379
13379
|
}
|
|
13380
13380
|
} finally {
|
|
13381
|
-
if (!
|
|
13381
|
+
if (!completed) {
|
|
13382
13382
|
try {
|
|
13383
13383
|
await byobReader.cancel();
|
|
13384
13384
|
} catch {}
|
|
@@ -13594,9 +13594,9 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13594
13594
|
const maxMb = Math.floor(maxBytes / (1024 * 1024));
|
|
13595
13595
|
return new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.VALIDATION_ERROR).setStatus(models_1.WorkflowErrorStatus.BAD_REQUEST).setTitle((0, localization_1.t)(localization_1.ErrorKeys.CONVERT_FILE_TOO_LARGE, { maxMb })).build();
|
|
13596
13596
|
}
|
|
13597
|
-
async function resolveFileBytes(file, workflowConfig,
|
|
13597
|
+
async function resolveFileBytes(file, workflowConfig, logger, taskName) {
|
|
13598
13598
|
if ((0, api_workflow_commons_1.isBlobFileReference)(file)) {
|
|
13599
|
-
const downloaded = await (0, blob_body_utils_1.downloadBlobFileWithFriendlyError)(workflowConfig,
|
|
13599
|
+
const downloaded = await (0, blob_body_utils_1.downloadBlobFileWithFriendlyError)(workflowConfig, logger, file);
|
|
13600
13600
|
return downloaded.content;
|
|
13601
13601
|
}
|
|
13602
13602
|
if ((0, api_workflow_commons_1.isWorkflowFile)(file)) {
|
|
@@ -13607,19 +13607,19 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13607
13607
|
}
|
|
13608
13608
|
throw new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.VALIDATION_ERROR).setStatus(models_1.WorkflowErrorStatus.BAD_REQUEST).setTitle((0, localization_1.t)(localization_1.ErrorKeys.INVALID_CONVERT_FILE_INPUT, { taskName, received: describeReceivedInput(file) })).build();
|
|
13609
13609
|
}
|
|
13610
|
-
async function encodeFileToBase64Streaming(ref, workflowConfig,
|
|
13611
|
-
logMemory(
|
|
13612
|
-
const download = await api_workflow_commons_1.OrchestratorUtils.openBlobDownloadStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, ref.ID,
|
|
13613
|
-
logMemory(
|
|
13610
|
+
async function encodeFileToBase64Streaming(ref, workflowConfig, logger) {
|
|
13611
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "streaming: before open", { declaredSize: ref.Metadata?.Size });
|
|
13612
|
+
const download = await api_workflow_commons_1.OrchestratorUtils.openBlobDownloadStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, ref.ID, logger, workflowConfig.processConfig?.folderKey);
|
|
13613
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "streaming: stream opened", { size: download.size, mimeType: download.mimeType });
|
|
13614
13614
|
const baseName = ref.FullName.replace(/([^.])\.[a-zA-Z0-9]{1,10}$/, "$1") || `file-${(0, api_workflow_commons_1.getNewGuid)()}`;
|
|
13615
13615
|
const encoded = encodeBase64Stream(streamToAsyncIterable(download.stream));
|
|
13616
13616
|
const knownSize = download.size !== undefined ? base64EncodedLength(download.size) : undefined;
|
|
13617
13617
|
const uploadBlobStream = api_workflow_commons_1.OrchestratorUtils.uploadBlobStream;
|
|
13618
13618
|
let completed = false;
|
|
13619
13619
|
try {
|
|
13620
|
-
const uploaded = await uploadBlobStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, encoded, `${baseName}.base64`, "text/plain",
|
|
13620
|
+
const uploaded = await uploadBlobStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, encoded, `${baseName}.base64`, "text/plain", logger, "base64", workflowConfig.processConfig?.folderKey, { knownSize });
|
|
13621
13621
|
completed = true;
|
|
13622
|
-
logMemory(
|
|
13622
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "streaming: after upload", { uploadedBytes: uploaded.Metadata?.Size });
|
|
13623
13623
|
return uploaded;
|
|
13624
13624
|
} finally {
|
|
13625
13625
|
if (!completed)
|
|
@@ -13653,25 +13653,25 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13653
13653
|
function isSizedUploadMismatch(error) {
|
|
13654
13654
|
return error instanceof Error && /Sized upload source (ended early|exceeded knownSize)/.test(error.message);
|
|
13655
13655
|
}
|
|
13656
|
-
async function decodeFileToByteArrayStreaming(ref, workflowConfig,
|
|
13656
|
+
async function decodeFileToByteArrayStreaming(ref, workflowConfig, logger) {
|
|
13657
13657
|
try {
|
|
13658
|
-
return await runStreamingDecode(ref, workflowConfig,
|
|
13658
|
+
return await runStreamingDecode(ref, workflowConfig, logger, true);
|
|
13659
13659
|
} catch (error) {
|
|
13660
13660
|
if (!isSizedUploadMismatch(error)) {
|
|
13661
13661
|
throw error;
|
|
13662
13662
|
}
|
|
13663
|
-
logMemory(
|
|
13663
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "streaming: sized upload mismatched (wrapped/prefixed base64?); retrying unsized", {
|
|
13664
13664
|
error: error.message
|
|
13665
13665
|
});
|
|
13666
|
-
return await runStreamingDecode(ref, workflowConfig,
|
|
13666
|
+
return await runStreamingDecode(ref, workflowConfig, logger, false);
|
|
13667
13667
|
}
|
|
13668
13668
|
}
|
|
13669
|
-
async function runStreamingDecode(ref, workflowConfig,
|
|
13670
|
-
logMemory(
|
|
13669
|
+
async function runStreamingDecode(ref, workflowConfig, logger, withSizing) {
|
|
13670
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "streaming: before open", { declaredSize: ref.Metadata?.Size, withSizing });
|
|
13671
13671
|
const openBlobDownloadStream = api_workflow_commons_1.OrchestratorUtils.openBlobDownloadStream;
|
|
13672
|
-
const download = await openBlobDownloadStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, ref.ID,
|
|
13672
|
+
const download = await openBlobDownloadStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, ref.ID, logger, workflowConfig.processConfig?.folderKey, withSizing ? { tailBytes: 4 } : undefined);
|
|
13673
13673
|
const knownSize = withSizing ? sizedBase64DecodeLength(download.size, download.tail) : undefined;
|
|
13674
|
-
logMemory(
|
|
13674
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "streaming: stream opened", { size: download.size, mimeType: download.mimeType, knownSize });
|
|
13675
13675
|
const decoded = decodeBase64Stream(streamToAsyncIterable(download.stream));
|
|
13676
13676
|
const iterator = decoded[Symbol.asyncIterator]();
|
|
13677
13677
|
let completed = false;
|
|
@@ -13694,7 +13694,7 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13694
13694
|
const head = concatBytes(headChunks);
|
|
13695
13695
|
const sniffedMime = detectMimeTypeFromBytes(head);
|
|
13696
13696
|
const mimeType = sniffedMime ?? "application/octet-stream";
|
|
13697
|
-
logMemory(
|
|
13697
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "streaming: mime sniffed", { sniffedMime, headBytes: head.byteLength });
|
|
13698
13698
|
const ext = (0, api_workflow_commons_1.getExtensionFromMimeType)(sniffedMime);
|
|
13699
13699
|
const withoutSuffix = ref.FullName.replace(/\.base64$/i, "");
|
|
13700
13700
|
const fileName = ext ? `${withoutSuffix.replace(/([^.])\.[a-zA-Z0-9]{1,10}$/, "$1") || `file-${(0, api_workflow_commons_1.getNewGuid)()}`}.${ext}` : withoutSuffix || `file-${(0, api_workflow_commons_1.getNewGuid)()}.bin`;
|
|
@@ -13713,9 +13713,9 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13713
13713
|
}
|
|
13714
13714
|
}
|
|
13715
13715
|
const uploadBlobStream = api_workflow_commons_1.OrchestratorUtils.uploadBlobStream;
|
|
13716
|
-
const uploaded = await uploadBlobStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, body(), fileName, mimeType,
|
|
13716
|
+
const uploaded = await uploadBlobStream(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, body(), fileName, mimeType, logger, "byte-array", workflowConfig.processConfig?.folderKey, { knownSize });
|
|
13717
13717
|
completed = true;
|
|
13718
|
-
logMemory(
|
|
13718
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "streaming: after upload", { uploadedBytes: uploaded.Metadata?.Size });
|
|
13719
13719
|
return uploaded;
|
|
13720
13720
|
} catch (error) {
|
|
13721
13721
|
throw error instanceof SyntaxError ? invalidBase64Error(exports.BASE64_TO_FILE_FN) : error;
|
|
@@ -13724,7 +13724,7 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13724
13724
|
await cancelStreamingConversion(download.stream, iterator);
|
|
13725
13725
|
}
|
|
13726
13726
|
}
|
|
13727
|
-
async function encodeFileToBase64(ref, workflowConfig,
|
|
13727
|
+
async function encodeFileToBase64(ref, workflowConfig, logger, maxBytes = exports.MAX_CONVERT_FILE_BYTES) {
|
|
13728
13728
|
if (!(0, api_workflow_commons_1.isBlobFileReference)(ref)) {
|
|
13729
13729
|
throw new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.VALIDATION_ERROR).setStatus(models_1.WorkflowErrorStatus.BAD_REQUEST).setTitle((0, localization_1.t)(localization_1.ErrorKeys.INVALID_CONVERT_FILE_INPUT, { taskName: exports.FILE_TO_BASE64_FN, received: describeReceivedInput(ref) })).build();
|
|
13730
13730
|
}
|
|
@@ -13733,45 +13733,45 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13733
13733
|
}
|
|
13734
13734
|
try {
|
|
13735
13735
|
if (shouldStream(ref)) {
|
|
13736
|
-
return await encodeFileToBase64Streaming(ref, workflowConfig,
|
|
13736
|
+
return await encodeFileToBase64Streaming(ref, workflowConfig, logger);
|
|
13737
13737
|
}
|
|
13738
13738
|
const declaredSize = ref.Metadata?.Size;
|
|
13739
13739
|
if (typeof declaredSize === "number" && declaredSize > maxBytes) {
|
|
13740
13740
|
throw fileTooLargeError(maxBytes);
|
|
13741
13741
|
}
|
|
13742
|
-
logMemory(
|
|
13743
|
-
const bytes = await resolveFileBytes(ref, workflowConfig,
|
|
13742
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "before download", { declaredSize });
|
|
13743
|
+
const bytes = await resolveFileBytes(ref, workflowConfig, logger, exports.FILE_TO_BASE64_FN);
|
|
13744
13744
|
if (bytes.byteLength > maxBytes) {
|
|
13745
13745
|
throw fileTooLargeError(maxBytes);
|
|
13746
13746
|
}
|
|
13747
|
-
logMemory(
|
|
13747
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "after download", { fileBytes: bytes.byteLength });
|
|
13748
13748
|
const base64 = uint8ArrayToBase64(bytes);
|
|
13749
|
-
logMemory(
|
|
13749
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "after base64 encode", { base64Length: base64.length });
|
|
13750
13750
|
const base64Bytes = new TextEncoder().encode(base64);
|
|
13751
|
-
logMemory(
|
|
13751
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "after text encode");
|
|
13752
13752
|
const baseName = ref.FullName.replace(/([^.])\.[a-zA-Z0-9]{1,10}$/, "$1") || `file-${(0, api_workflow_commons_1.getNewGuid)()}`;
|
|
13753
|
-
const uploaded = await api_workflow_commons_1.OrchestratorUtils.uploadFileToBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, base64Bytes, `${baseName}.base64`, "text/plain",
|
|
13754
|
-
logMemory(
|
|
13753
|
+
const uploaded = await api_workflow_commons_1.OrchestratorUtils.uploadFileToBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, base64Bytes, `${baseName}.base64`, "text/plain", logger, workflowConfig.processConfig?.folderKey, { encoding: "base64" });
|
|
13754
|
+
logMemory(logger, exports.FILE_TO_BASE64_FN, "after upload");
|
|
13755
13755
|
return uploaded;
|
|
13756
13756
|
} catch (error) {
|
|
13757
13757
|
throw (0, utils_1.isWorkflowError)(error) ? error : new utils_1.WorkflowErrorBuilder().fromError(error).setType(models_1.WorkflowErrorType.RUNTIME_ERROR).setStatus(models_1.WorkflowErrorStatus.INTERNAL_SERVER_ERROR).setTitle((0, localization_1.t)(localization_1.ErrorKeys.FAILED_DOWNLOAD_DATA, { taskName: exports.FILE_TO_BASE64_FN })).build();
|
|
13758
13758
|
}
|
|
13759
13759
|
}
|
|
13760
|
-
async function decodeFileToByteArray(ref, workflowConfig,
|
|
13760
|
+
async function decodeFileToByteArray(ref, workflowConfig, logger, maxBytes = exports.MAX_CONVERT_FILE_BYTES) {
|
|
13761
13761
|
if ((0, api_workflow_commons_1.getAttachmentEncoding)(ref) !== "base64") {
|
|
13762
13762
|
return ref;
|
|
13763
13763
|
}
|
|
13764
13764
|
try {
|
|
13765
13765
|
if (shouldStream(ref)) {
|
|
13766
|
-
return await decodeFileToByteArrayStreaming(ref, workflowConfig,
|
|
13766
|
+
return await decodeFileToByteArrayStreaming(ref, workflowConfig, logger);
|
|
13767
13767
|
}
|
|
13768
13768
|
const declaredSize = ref.Metadata?.Size;
|
|
13769
13769
|
if (typeof declaredSize === "number" && Math.floor(declaredSize * 3 / 4) > maxBytes) {
|
|
13770
13770
|
throw fileTooLargeError(maxBytes);
|
|
13771
13771
|
}
|
|
13772
|
-
logMemory(
|
|
13773
|
-
const textBytes = await resolveFileBytes(ref, workflowConfig,
|
|
13774
|
-
logMemory(
|
|
13772
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "before download", { declaredSize });
|
|
13773
|
+
const textBytes = await resolveFileBytes(ref, workflowConfig, logger, exports.BASE64_TO_FILE_FN);
|
|
13774
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "after download", { textBytes: textBytes.byteLength });
|
|
13775
13775
|
const text = new TextDecoder().decode(textBytes);
|
|
13776
13776
|
if (!isValidBase64(text)) {
|
|
13777
13777
|
throw invalidBase64Error(exports.BASE64_TO_FILE_FN);
|
|
@@ -13780,23 +13780,23 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13780
13780
|
if (decoded.byteLength > maxBytes) {
|
|
13781
13781
|
throw fileTooLargeError(maxBytes);
|
|
13782
13782
|
}
|
|
13783
|
-
logMemory(
|
|
13783
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "after base64 decode", { decodedBytes: decoded.byteLength });
|
|
13784
13784
|
const sniffedMime = detectMimeTypeFromBytes(decoded);
|
|
13785
13785
|
const mimeType = sniffedMime ?? "application/octet-stream";
|
|
13786
13786
|
const ext = (0, api_workflow_commons_1.getExtensionFromMimeType)(sniffedMime);
|
|
13787
13787
|
const withoutSuffix = ref.FullName.replace(/\.base64$/i, "");
|
|
13788
13788
|
const fileName = ext ? `${withoutSuffix.replace(/([^.])\.[a-zA-Z0-9]{1,10}$/, "$1") || `file-${(0, api_workflow_commons_1.getNewGuid)()}`}.${ext}` : withoutSuffix || `file-${(0, api_workflow_commons_1.getNewGuid)()}.bin`;
|
|
13789
|
-
const uploaded = await api_workflow_commons_1.OrchestratorUtils.uploadFileToBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, decoded, fileName, mimeType,
|
|
13790
|
-
logMemory(
|
|
13789
|
+
const uploaded = await api_workflow_commons_1.OrchestratorUtils.uploadFileToBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, decoded, fileName, mimeType, logger, workflowConfig.processConfig?.folderKey);
|
|
13790
|
+
logMemory(logger, exports.BASE64_TO_FILE_FN, "after upload");
|
|
13791
13791
|
return uploaded;
|
|
13792
13792
|
} catch (error) {
|
|
13793
13793
|
throw (0, utils_1.isWorkflowError)(error) ? error : new utils_1.WorkflowErrorBuilder().fromError(error).setType(models_1.WorkflowErrorType.RUNTIME_ERROR).setStatus(models_1.WorkflowErrorStatus.INTERNAL_SERVER_ERROR).setTitle((0, localization_1.t)(localization_1.ErrorKeys.FAILED_DOWNLOAD_DATA, { taskName: exports.BASE64_TO_FILE_FN })).build();
|
|
13794
13794
|
}
|
|
13795
13795
|
}
|
|
13796
|
-
async function base64ToFile(args, workflowConfig,
|
|
13796
|
+
async function base64ToFile(args, workflowConfig, logger, maxBytes = exports.MAX_CONVERT_FILE_BYTES) {
|
|
13797
13797
|
const base64 = args?.base64;
|
|
13798
13798
|
if ((0, api_workflow_commons_1.isBlobFileReference)(base64)) {
|
|
13799
|
-
return decodeFileToByteArray(base64, workflowConfig,
|
|
13799
|
+
return decodeFileToByteArray(base64, workflowConfig, logger, maxBytes);
|
|
13800
13800
|
}
|
|
13801
13801
|
if (typeof base64 !== "string" || base64.trim().length === 0) {
|
|
13802
13802
|
throw new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.VALIDATION_ERROR).setStatus(models_1.WorkflowErrorStatus.BAD_REQUEST).setTitle((0, localization_1.t)(localization_1.ErrorKeys.MISSING_BASE64_STRING, { taskName: exports.BASE64_TO_FILE_FN })).build();
|
|
@@ -13814,7 +13814,7 @@ var require_convert_file_base64_utils = __commonJS(function(exports) {
|
|
|
13814
13814
|
const mimeType = providedMime ?? detectMimeTypeFromBytes(bytes) ?? "application/octet-stream";
|
|
13815
13815
|
const providedName = typeof args.fileName === "string" && args.fileName.trim().length > 0 ? args.fileName.trim() : undefined;
|
|
13816
13816
|
const fileName = ensureFileExtension(providedName ?? `file-${(0, api_workflow_commons_1.getNewGuid)()}`, mimeType);
|
|
13817
|
-
return await api_workflow_commons_1.OrchestratorUtils.uploadFileToBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, bytes, fileName, mimeType,
|
|
13817
|
+
return await api_workflow_commons_1.OrchestratorUtils.uploadFileToBlob(workflowConfig.baseUrl, workflowConfig.accessToken, workflowConfig.organizationId, workflowConfig.tenantId, bytes, fileName, mimeType, logger, workflowConfig.processConfig?.folderKey);
|
|
13818
13818
|
} catch (error) {
|
|
13819
13819
|
throw (0, utils_1.isWorkflowError)(error) ? error : new utils_1.WorkflowErrorBuilder().fromError(error).setType(models_1.WorkflowErrorType.RUNTIME_ERROR).setStatus(models_1.WorkflowErrorStatus.INTERNAL_SERVER_ERROR).setTitle((0, localization_1.t)(localization_1.ErrorKeys.FAILED_CONVERT_BASE64_TO_FILE, { taskName: exports.BASE64_TO_FILE_FN })).build();
|
|
13820
13820
|
}
|
|
@@ -14007,13 +14007,13 @@ var require_logging_helper = __commonJS(function(exports) {
|
|
|
14007
14007
|
var executor_utils_1 = require_executor_utils();
|
|
14008
14008
|
|
|
14009
14009
|
class LoggingHelper {
|
|
14010
|
-
static async logWorkflowData(
|
|
14010
|
+
static async logWorkflowData(logger, params) {
|
|
14011
14011
|
const logData = LoggingHelper.buildWorkflowLogData(params.event, params.runtimeExpressionArgs, params.input, params.output, params.details);
|
|
14012
|
-
await
|
|
14012
|
+
await logger.logWorkflowEvent(params.event, logData, params.error);
|
|
14013
14013
|
}
|
|
14014
|
-
static async logTaskData(
|
|
14014
|
+
static async logTaskData(logger, params, expressionHandler) {
|
|
14015
14015
|
const logData = await LoggingHelper.buildTaskLogData(params.taskId, params.taskType, params.event, params.runtimeExpressionArgs, expressionHandler, params.input, params.output, params.properties, params.variables, params.displayName, params.shouldPause, params.breakpointId, params.vendorExecutionTimeMs, params.HttpCallMode, params.isUiPathInternalServiceCall, params.taskSpanId);
|
|
14016
|
-
await
|
|
14016
|
+
await logger.logTaskEvent(params.event, logData, params.error);
|
|
14017
14017
|
}
|
|
14018
14018
|
static buildWorkflowLogData(event, runtimeExpressionArgs, input, output, details) {
|
|
14019
14019
|
let executionTimeMs = undefined;
|
|
@@ -14182,9 +14182,9 @@ var require_http_call_mode = __commonJS(function(exports) {
|
|
|
14182
14182
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14183
14183
|
exports.HttpCallMode = undefined;
|
|
14184
14184
|
var HttpCallMode;
|
|
14185
|
-
(function(
|
|
14186
|
-
|
|
14187
|
-
|
|
14185
|
+
(function(HttpCallMode) {
|
|
14186
|
+
HttpCallMode["DIRECT"] = "direct";
|
|
14187
|
+
HttpCallMode["INTEGRATION_SERVICE"] = "integrationService";
|
|
14188
14188
|
})(HttpCallMode || (exports.HttpCallMode = HttpCallMode = {}));
|
|
14189
14189
|
});
|
|
14190
14190
|
|
|
@@ -14195,8 +14195,8 @@ var require_break_task_handler = __commonJS(function(exports) {
|
|
|
14195
14195
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
14196
14196
|
|
|
14197
14197
|
class BreakTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
14198
|
-
constructor(taskHandlerArgs,
|
|
14199
|
-
super(taskHandlerArgs,
|
|
14198
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
14199
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
14200
14200
|
}
|
|
14201
14201
|
async internalHandleTask(taskName, task, input) {
|
|
14202
14202
|
this.logger.info(`Executing BreakTask: ${taskName}`);
|
|
@@ -14244,8 +14244,8 @@ var require_do_task_handler = __commonJS(function(exports) {
|
|
|
14244
14244
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
14245
14245
|
|
|
14246
14246
|
class DoTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
14247
|
-
constructor(taskHandlerArgs,
|
|
14248
|
-
super(taskHandlerArgs,
|
|
14247
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
14248
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
14249
14249
|
}
|
|
14250
14250
|
async internalHandleTask(_taskName, task, input) {
|
|
14251
14251
|
const result = await task_executor_helper_1.TaskExecutorHelper.executeTaskList(task.do, input, this.workflowConfig, this.getRuntimeExpressionArgs(), this.logger, this.expressionHandler, task.variables);
|
|
@@ -14267,8 +14267,8 @@ var require_do_while_task_handler = __commonJS(function(exports) {
|
|
|
14267
14267
|
var MAX_ITERATIONS = 1e4;
|
|
14268
14268
|
|
|
14269
14269
|
class DoWhileTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
14270
|
-
constructor(taskHandlerArgs,
|
|
14271
|
-
super(taskHandlerArgs,
|
|
14270
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
14271
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
14272
14272
|
}
|
|
14273
14273
|
async internalHandleTask(taskName, task, previousStepOutput) {
|
|
14274
14274
|
this.logger.info(`Executing DoWhileTask: ${taskName}`);
|
|
@@ -14325,8 +14325,8 @@ var require_for_task_handler = __commonJS(function(exports) {
|
|
|
14325
14325
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
14326
14326
|
|
|
14327
14327
|
class ForTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
14328
|
-
constructor(taskHandlerArgs,
|
|
14329
|
-
super(taskHandlerArgs,
|
|
14328
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
14329
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
14330
14330
|
}
|
|
14331
14331
|
async internalHandleTask(taskName, task, previousStepOutput) {
|
|
14332
14332
|
this.logger.info(`Executing ForTask: ${taskName}`);
|
|
@@ -14615,10 +14615,10 @@ var require_http_task_handler = __commonJS(function(exports) {
|
|
|
14615
14615
|
});
|
|
14616
14616
|
var __importStar = exports && exports.__importStar || function() {
|
|
14617
14617
|
var ownKeys = function(o) {
|
|
14618
|
-
ownKeys = Object.getOwnPropertyNames || function(
|
|
14618
|
+
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
14619
14619
|
var ar = [];
|
|
14620
|
-
for (var k in
|
|
14621
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
14620
|
+
for (var k in o)
|
|
14621
|
+
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
14622
14622
|
ar[ar.length] = k;
|
|
14623
14623
|
return ar;
|
|
14624
14624
|
};
|
|
@@ -14652,8 +14652,8 @@ var require_http_task_handler = __commonJS(function(exports) {
|
|
|
14652
14652
|
var streamedHttpSend = __importStar(require_streamed_http_send());
|
|
14653
14653
|
|
|
14654
14654
|
class HttpTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
14655
|
-
constructor(taskHandlerArgs,
|
|
14656
|
-
super(taskHandlerArgs,
|
|
14655
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
14656
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
14657
14657
|
}
|
|
14658
14658
|
async internalHandleTask(taskName, task, input) {
|
|
14659
14659
|
let endpoint = task.with?.endpoint;
|
|
@@ -14860,10 +14860,10 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14860
14860
|
}
|
|
14861
14861
|
return headers;
|
|
14862
14862
|
}
|
|
14863
|
-
static resolveConnectionId(task, workflowConfig,
|
|
14863
|
+
static resolveConnectionId(task, workflowConfig, logger, bindingKey) {
|
|
14864
14864
|
const originalConnectionId = typeof task.with?.connectionId === "string" ? task.with.connectionId : "";
|
|
14865
14865
|
const solutionResourceKey = typeof task.with?.connectionResourceId === "string" ? task.with.connectionResourceId : "";
|
|
14866
|
-
return resource_override_resolver_1.ResourceOverrideResolver.getOverriddenValue(workflowConfig,
|
|
14866
|
+
return resource_override_resolver_1.ResourceOverrideResolver.getOverriddenValue(workflowConfig, logger, bindingKey, "ConnectionId", originalConnectionId, solutionResourceKey);
|
|
14867
14867
|
}
|
|
14868
14868
|
static getBaseUrl(workflowConfig) {
|
|
14869
14869
|
if (workflowConfig.automationEdgeFqdn) {
|
|
@@ -14871,7 +14871,7 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14871
14871
|
}
|
|
14872
14872
|
return workflowConfig.baseUrl;
|
|
14873
14873
|
}
|
|
14874
|
-
static resolveDateFields(metadata,
|
|
14874
|
+
static resolveDateFields(metadata, logger) {
|
|
14875
14875
|
const dateFields = metadata?.inputMetadata?.dateFields;
|
|
14876
14876
|
if (Array.isArray(dateFields)) {
|
|
14877
14877
|
return dateFields;
|
|
@@ -14880,18 +14880,18 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14880
14880
|
if (!configuration) {
|
|
14881
14881
|
return [];
|
|
14882
14882
|
}
|
|
14883
|
-
return this.extractDateFieldsFromConfig(configuration,
|
|
14883
|
+
return this.extractDateFieldsFromConfig(configuration, logger);
|
|
14884
14884
|
}
|
|
14885
|
-
static extractDateFieldsFromConfig(configuration,
|
|
14885
|
+
static extractDateFieldsFromConfig(configuration, logger) {
|
|
14886
14886
|
if (!configuration || typeof configuration !== "string") {
|
|
14887
|
-
|
|
14887
|
+
logger.warn("Configuration is empty or invalid, no date fields to extract");
|
|
14888
14888
|
return [];
|
|
14889
14889
|
}
|
|
14890
14890
|
try {
|
|
14891
14891
|
const config = JSON.parse(configuration);
|
|
14892
14892
|
const inputFields = config?.optionalConfiguration?.fieldsContainer?.inputFields;
|
|
14893
14893
|
if (!Array.isArray(inputFields)) {
|
|
14894
|
-
|
|
14894
|
+
logger.warn("No input fields found in configuration");
|
|
14895
14895
|
return [];
|
|
14896
14896
|
}
|
|
14897
14897
|
const dateFields = inputFields.filter((field) => {
|
|
@@ -14905,15 +14905,15 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14905
14905
|
format: field.format
|
|
14906
14906
|
}));
|
|
14907
14907
|
if (dateFields.length > 0) {
|
|
14908
|
-
|
|
14908
|
+
logger.debug(`Extracted ${dateFields.length} date field(s) from configuration: ${dateFields.map((f) => f.name).join(", ")}`);
|
|
14909
14909
|
}
|
|
14910
14910
|
return dateFields;
|
|
14911
14911
|
} catch (error) {
|
|
14912
|
-
|
|
14912
|
+
logger.error(`Failed to parse configuration for date fields: ${error.message}`);
|
|
14913
14913
|
return [];
|
|
14914
14914
|
}
|
|
14915
14915
|
}
|
|
14916
|
-
static collectDateFieldOffsets(bodyParameters, queryParameters,
|
|
14916
|
+
static collectDateFieldOffsets(bodyParameters, queryParameters, logger) {
|
|
14917
14917
|
const dateFieldOffsets = new Map;
|
|
14918
14918
|
const datePattern = /new\s+Date\s*\(/;
|
|
14919
14919
|
try {
|
|
@@ -14925,7 +14925,7 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14925
14925
|
if (!datePattern.test(value)) {
|
|
14926
14926
|
continue;
|
|
14927
14927
|
}
|
|
14928
|
-
const offset = date_format_utils_1.DateFormatUtils.extractOffsetFromDateExpression(value,
|
|
14928
|
+
const offset = date_format_utils_1.DateFormatUtils.extractOffsetFromDateExpression(value, logger);
|
|
14929
14929
|
const finalOffset = offset || constants_1.DEFAULT_TIMEZONE_OFFSET;
|
|
14930
14930
|
dateFieldOffsets.set(fieldName, finalOffset);
|
|
14931
14931
|
}
|
|
@@ -14938,21 +14938,21 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14938
14938
|
if (!datePattern.test(value)) {
|
|
14939
14939
|
continue;
|
|
14940
14940
|
}
|
|
14941
|
-
const offset = date_format_utils_1.DateFormatUtils.extractOffsetFromDateExpression(value,
|
|
14941
|
+
const offset = date_format_utils_1.DateFormatUtils.extractOffsetFromDateExpression(value, logger);
|
|
14942
14942
|
const finalOffset = offset || constants_1.DEFAULT_TIMEZONE_OFFSET;
|
|
14943
14943
|
dateFieldOffsets.set(fieldName, finalOffset);
|
|
14944
14944
|
}
|
|
14945
14945
|
}
|
|
14946
14946
|
return dateFieldOffsets;
|
|
14947
14947
|
} catch (error) {
|
|
14948
|
-
|
|
14948
|
+
logger.error(`Failed to collect date field offsets: ${error.message}`);
|
|
14949
14949
|
return dateFieldOffsets;
|
|
14950
14950
|
}
|
|
14951
14951
|
}
|
|
14952
|
-
static formatDateFieldsInParameters(dateFields, dateFieldOffsets, queryParameters, bodyParameters,
|
|
14952
|
+
static formatDateFieldsInParameters(dateFields, dateFieldOffsets, queryParameters, bodyParameters, logger) {
|
|
14953
14953
|
try {
|
|
14954
14954
|
if (dateFields.length === 0) {
|
|
14955
|
-
|
|
14955
|
+
logger.warn("No date fields found, skipping date formatting");
|
|
14956
14956
|
return;
|
|
14957
14957
|
}
|
|
14958
14958
|
const configLookup = new Map;
|
|
@@ -14962,7 +14962,7 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14962
14962
|
for (const [fieldName, offset] of dateFieldOffsets) {
|
|
14963
14963
|
const mask = configLookup.get(fieldName);
|
|
14964
14964
|
if (!mask) {
|
|
14965
|
-
|
|
14965
|
+
logger.warn(`Field ${fieldName} not found in configuration, skipping`);
|
|
14966
14966
|
continue;
|
|
14967
14967
|
}
|
|
14968
14968
|
if (queryParameters && fieldName in queryParameters) {
|
|
@@ -14970,14 +14970,14 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14970
14970
|
if (fieldValue && typeof fieldValue.toISOString === "function") {
|
|
14971
14971
|
const dateValue = fieldValue;
|
|
14972
14972
|
if (isNaN(dateValue.getTime())) {
|
|
14973
|
-
|
|
14973
|
+
logger.warn(`Field ${fieldName} contains an invalid Date, skipping formatting.`);
|
|
14974
14974
|
continue;
|
|
14975
14975
|
}
|
|
14976
|
-
const formattedValue = date_format_utils_1.DateFormatUtils.formatDate(dateValue.toISOString(), mask, offset,
|
|
14976
|
+
const formattedValue = date_format_utils_1.DateFormatUtils.formatDate(dateValue.toISOString(), mask, offset, logger);
|
|
14977
14977
|
queryParameters[fieldName] = formattedValue;
|
|
14978
|
-
|
|
14978
|
+
logger.info(`Formatted query param ${fieldName}: ${dateValue.toISOString()} → ${formattedValue} (offset: ${offset}, mask: ${mask})`);
|
|
14979
14979
|
} else {
|
|
14980
|
-
|
|
14980
|
+
logger.warn(`Field ${fieldName} is not a Date object, skipping formatting. Value: ${fieldValue}`);
|
|
14981
14981
|
}
|
|
14982
14982
|
}
|
|
14983
14983
|
if (bodyParameters && fieldName in bodyParameters) {
|
|
@@ -14985,19 +14985,19 @@ var require_intsvc_task_handler_util = __commonJS(function(exports) {
|
|
|
14985
14985
|
if (fieldValue && typeof fieldValue.toISOString === "function") {
|
|
14986
14986
|
const dateValue = fieldValue;
|
|
14987
14987
|
if (isNaN(dateValue.getTime())) {
|
|
14988
|
-
|
|
14988
|
+
logger.warn(`Field ${fieldName} contains an invalid Date, skipping formatting.`);
|
|
14989
14989
|
continue;
|
|
14990
14990
|
}
|
|
14991
|
-
const formattedValue = date_format_utils_1.DateFormatUtils.formatDate(dateValue.toISOString(), mask, offset,
|
|
14991
|
+
const formattedValue = date_format_utils_1.DateFormatUtils.formatDate(dateValue.toISOString(), mask, offset, logger);
|
|
14992
14992
|
bodyParameters[fieldName] = formattedValue;
|
|
14993
|
-
|
|
14993
|
+
logger.info(`Formatted body param ${fieldName}: ${dateValue.toISOString()} → ${formattedValue} (offset: ${offset}, mask: ${mask})`);
|
|
14994
14994
|
} else {
|
|
14995
|
-
|
|
14995
|
+
logger.warn(`Field ${fieldName} is not a Date object, skipping formatting. Value: ${fieldValue}`);
|
|
14996
14996
|
}
|
|
14997
14997
|
}
|
|
14998
14998
|
}
|
|
14999
14999
|
} catch (error) {
|
|
15000
|
-
|
|
15000
|
+
logger.error(`Error during date formatting: ${error.message}. Skipping date formatting.`);
|
|
15001
15001
|
}
|
|
15002
15002
|
}
|
|
15003
15003
|
}
|
|
@@ -15020,8 +15020,8 @@ var require_intsvcs_event_task_handler = __commonJS(function(exports) {
|
|
|
15020
15020
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
15021
15021
|
|
|
15022
15022
|
class IntSvcsEventTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15023
|
-
constructor(taskHandlerArgs,
|
|
15024
|
-
super(taskHandlerArgs,
|
|
15023
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15024
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15025
15025
|
}
|
|
15026
15026
|
async internalHandleTask(taskName, task) {
|
|
15027
15027
|
let runtimeExpressionArgs = this.getRuntimeExpressionArgs();
|
|
@@ -15307,8 +15307,8 @@ var require_intsvcs_task_handler = __commonJS(function(exports) {
|
|
|
15307
15307
|
var blob_body_utils_1 = require_blob_body_utils();
|
|
15308
15308
|
|
|
15309
15309
|
class IntSvcsTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15310
|
-
constructor(taskHandlerArgs,
|
|
15311
|
-
super(taskHandlerArgs,
|
|
15310
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15311
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15312
15312
|
}
|
|
15313
15313
|
async internalHandleTask(taskName, task) {
|
|
15314
15314
|
let runtimeExpressionArgs = this.getRuntimeExpressionArgs();
|
|
@@ -15397,13 +15397,13 @@ var require_intsvcs_task_handler = __commonJS(function(exports) {
|
|
|
15397
15397
|
intsvcActivityProperties.endpoint = requestUrl;
|
|
15398
15398
|
}
|
|
15399
15399
|
if (resolvedProperties?.bodyParameters && Object.keys(resolvedProperties.bodyParameters).length > 0) {
|
|
15400
|
-
const
|
|
15400
|
+
const bodyParams = resolvedProperties.bodyParameters;
|
|
15401
15401
|
if (task.with?.proxyToVendorAPI) {
|
|
15402
|
-
const materialized = await (0, blob_body_utils_1.materializeBlobRefBody)(
|
|
15403
|
-
|
|
15404
|
-
|
|
15402
|
+
const materialized = await (0, blob_body_utils_1.materializeBlobRefBody)(bodyParams.body, bodyParams.headers, this.workflowConfig, this.logger);
|
|
15403
|
+
bodyParams.body = materialized.body;
|
|
15404
|
+
bodyParams.headers = materialized.headers;
|
|
15405
15405
|
}
|
|
15406
|
-
intsvcActivityProperties.body =
|
|
15406
|
+
intsvcActivityProperties.body = bodyParams;
|
|
15407
15407
|
}
|
|
15408
15408
|
if (task.with?.multipartParameters && Object.keys(task.with.multipartParameters).length > 0) {
|
|
15409
15409
|
const resolvedMultipartParams = [];
|
|
@@ -15564,8 +15564,8 @@ var require_raise_task_handler = __commonJS(function(exports) {
|
|
|
15564
15564
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
15565
15565
|
|
|
15566
15566
|
class RaiseTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15567
|
-
constructor(taskHandlerArgs,
|
|
15568
|
-
super(taskHandlerArgs,
|
|
15567
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15568
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15569
15569
|
}
|
|
15570
15570
|
async internalHandleTask(taskName, task) {
|
|
15571
15571
|
this.logger.debug(`Processing raise task for "${taskName}" with values:`, { error: task.raise?.error?.toString() });
|
|
@@ -15626,8 +15626,8 @@ var require_response_task_handler = __commonJS(function(exports) {
|
|
|
15626
15626
|
}
|
|
15627
15627
|
|
|
15628
15628
|
class ResponseTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15629
|
-
constructor(taskHandlerArgs,
|
|
15630
|
-
super(taskHandlerArgs,
|
|
15629
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15630
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15631
15631
|
}
|
|
15632
15632
|
async internalHandleTask(taskName, task) {
|
|
15633
15633
|
try {
|
|
@@ -15683,8 +15683,8 @@ var require_set_task_handler = __commonJS(function(exports) {
|
|
|
15683
15683
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
15684
15684
|
|
|
15685
15685
|
class SetTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15686
|
-
constructor(taskHandlerArgs,
|
|
15687
|
-
super(taskHandlerArgs,
|
|
15686
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15687
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15688
15688
|
}
|
|
15689
15689
|
async internalHandleTask(taskName, task) {
|
|
15690
15690
|
try {
|
|
@@ -15719,8 +15719,8 @@ var require_switch_task_handler = __commonJS(function(exports) {
|
|
|
15719
15719
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
15720
15720
|
|
|
15721
15721
|
class SwitchTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15722
|
-
constructor(taskHandlerArgs,
|
|
15723
|
-
super(taskHandlerArgs,
|
|
15722
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15723
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15724
15724
|
}
|
|
15725
15725
|
async internalHandleTask(taskName, task, input) {
|
|
15726
15726
|
try {
|
|
@@ -15769,7 +15769,7 @@ var require_switch_task_handler = __commonJS(function(exports) {
|
|
|
15769
15769
|
}
|
|
15770
15770
|
}
|
|
15771
15771
|
exports.SwitchTaskHandler = SwitchTaskHandler;
|
|
15772
|
-
async function evaluateSwitchCondition(task, previousStepOutput,
|
|
15772
|
+
async function evaluateSwitchCondition(task, previousStepOutput, logger, expressionHandler) {
|
|
15773
15773
|
if (!task.switch)
|
|
15774
15774
|
return;
|
|
15775
15775
|
const switchCases = task.switch;
|
|
@@ -15784,18 +15784,18 @@ var require_switch_task_handler = __commonJS(function(exports) {
|
|
|
15784
15784
|
throw new Error((0, localization_1.t)(localization_1.ErrorKeys.MISSING_WHEN_CONDITION, { caseName }));
|
|
15785
15785
|
}
|
|
15786
15786
|
if (await expressionHandler.evaluateConditionExpression(caseDetails.when)) {
|
|
15787
|
-
|
|
15787
|
+
logger.debug(`Switch case matched: '${caseName}' with expression: ${JSON.stringify(caseDetails.when)}`);
|
|
15788
15788
|
return switchCase;
|
|
15789
15789
|
}
|
|
15790
15790
|
if (previousStepOutput && previousStepOutput.content) {
|
|
15791
15791
|
const contentObject = previousStepOutput.content;
|
|
15792
15792
|
if (contentObject && await expressionHandler.evaluateConditionExpression(caseDetails.when)) {
|
|
15793
|
-
|
|
15793
|
+
logger.debug(`Switch case matched in 'content': '${caseName}' with expression: ${JSON.stringify(caseDetails.when)}`);
|
|
15794
15794
|
return switchCase;
|
|
15795
15795
|
}
|
|
15796
15796
|
}
|
|
15797
15797
|
}
|
|
15798
|
-
|
|
15798
|
+
logger.debug("No switch case matched, falling back to default case.");
|
|
15799
15799
|
return defaultCase;
|
|
15800
15800
|
}
|
|
15801
15801
|
function getMatchedCaseTask(matchedCase, stepName) {
|
|
@@ -15818,8 +15818,8 @@ var require_try_catch_task_handler = __commonJS(function(exports) {
|
|
|
15818
15818
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
15819
15819
|
|
|
15820
15820
|
class TryCatchTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15821
|
-
constructor(taskHandlerArgs,
|
|
15822
|
-
super(taskHandlerArgs,
|
|
15821
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15822
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15823
15823
|
}
|
|
15824
15824
|
async internalHandleTask(taskName, task, input) {
|
|
15825
15825
|
this.logger.info(`Executing Try: ${taskName}`);
|
|
@@ -15874,9 +15874,9 @@ var require_unified_http_task_handler = __commonJS(function(exports) {
|
|
|
15874
15874
|
var intsvcs_task_handler_1 = require_intsvcs_task_handler();
|
|
15875
15875
|
|
|
15876
15876
|
class UnifiedHttpTaskHandler {
|
|
15877
|
-
constructor(taskHandlerArgs,
|
|
15877
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15878
15878
|
this.taskHandlerArgs = taskHandlerArgs;
|
|
15879
|
-
this.logger =
|
|
15879
|
+
this.logger = logger;
|
|
15880
15880
|
this.expressionHandler = expressionHandler;
|
|
15881
15881
|
}
|
|
15882
15882
|
async handleTask(taskName, task, runtimeExpressionArgs) {
|
|
@@ -15952,8 +15952,8 @@ var require_wait_task_handler = __commonJS(function(exports) {
|
|
|
15952
15952
|
var abstract_task_handler_1 = require_abstract_task_handler();
|
|
15953
15953
|
|
|
15954
15954
|
class WaitTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
15955
|
-
constructor(taskHandlerArgs,
|
|
15956
|
-
super(taskHandlerArgs,
|
|
15955
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
15956
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
15957
15957
|
}
|
|
15958
15958
|
async internalHandleTask(taskName, task, _input) {
|
|
15959
15959
|
try {
|
|
@@ -16012,8 +16012,8 @@ var require_while_task_handler = __commonJS(function(exports) {
|
|
|
16012
16012
|
var MAX_ITERATIONS = 1e4;
|
|
16013
16013
|
|
|
16014
16014
|
class WhileTaskHandler extends abstract_task_handler_1.AbstractTaskHandler {
|
|
16015
|
-
constructor(taskHandlerArgs,
|
|
16016
|
-
super(taskHandlerArgs,
|
|
16015
|
+
constructor(taskHandlerArgs, logger, expressionHandler) {
|
|
16016
|
+
super(taskHandlerArgs, logger, expressionHandler);
|
|
16017
16017
|
}
|
|
16018
16018
|
async internalHandleTask(taskName, task, previousStepOutput) {
|
|
16019
16019
|
this.logger.info(`Executing WhileTask: ${taskName}`);
|
|
@@ -16107,8 +16107,8 @@ var require_task_invoker = __commonJS(function(exports) {
|
|
|
16107
16107
|
}
|
|
16108
16108
|
return taskResult;
|
|
16109
16109
|
}
|
|
16110
|
-
var invokeTask = async (task, taskName, taskHandlerArgs, runtimeExpressionArgs, stepInput,
|
|
16111
|
-
const handler = getTaskHandler(task, taskHandlerArgs,
|
|
16110
|
+
var invokeTask = async (task, taskName, taskHandlerArgs, runtimeExpressionArgs, stepInput, logger, expressionHandler, customHandlers) => {
|
|
16111
|
+
const handler = getTaskHandler(task, taskHandlerArgs, logger, expressionHandler, customHandlers);
|
|
16112
16112
|
const taskDescriptor = {
|
|
16113
16113
|
name: taskName,
|
|
16114
16114
|
input: stepInput,
|
|
@@ -16117,66 +16117,66 @@ var require_task_invoker = __commonJS(function(exports) {
|
|
|
16117
16117
|
await expressionHandler.setVariables({ $task: taskDescriptor });
|
|
16118
16118
|
return await handler.handleTask(taskName, task, runtimeExpressionArgs);
|
|
16119
16119
|
};
|
|
16120
|
-
var getTaskHandler = (task, taskHandlerArgs,
|
|
16120
|
+
var getTaskHandler = (task, taskHandlerArgs, logger, expressionHandler, customHandlers) => {
|
|
16121
16121
|
const taskWithBreak = task;
|
|
16122
16122
|
if (taskWithBreak.break && taskWithBreak.then === constants_1.EXIT) {
|
|
16123
|
-
return new break_task_handler_1.BreakTaskHandler(taskHandlerArgs,
|
|
16123
|
+
return new break_task_handler_1.BreakTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16124
16124
|
}
|
|
16125
16125
|
if (task.call) {
|
|
16126
16126
|
if ((0, task_utils_1.isUnifiedHttpTask)(task)) {
|
|
16127
|
-
return new unified_http_task_handler_1.UnifiedHttpTaskHandler(taskHandlerArgs,
|
|
16127
|
+
return new unified_http_task_handler_1.UnifiedHttpTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16128
16128
|
} else if ((0, task_utils_1.isIntSvcTask)(task)) {
|
|
16129
|
-
return new intsvcs_task_handler_1.IntSvcsTaskHandler(taskHandlerArgs,
|
|
16129
|
+
return new intsvcs_task_handler_1.IntSvcsTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16130
16130
|
} else if ((0, task_utils_1.isIntSvcEventTask)(task)) {
|
|
16131
|
-
return new intsvcs_event_task_handler_1.IntSvcsEventTaskHandler(taskHandlerArgs,
|
|
16131
|
+
return new intsvcs_event_task_handler_1.IntSvcsEventTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16132
16132
|
} else {
|
|
16133
|
-
return new http_task_handler_1.HttpTaskHandler(taskHandlerArgs,
|
|
16133
|
+
return new http_task_handler_1.HttpTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16134
16134
|
}
|
|
16135
16135
|
}
|
|
16136
16136
|
if (task.run) {
|
|
16137
16137
|
const customScriptHandler = customHandlers?.[models_1.TaskType.SCRIPT];
|
|
16138
16138
|
if (customScriptHandler) {
|
|
16139
|
-
return customScriptHandler(taskHandlerArgs,
|
|
16139
|
+
return customScriptHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16140
16140
|
}
|
|
16141
|
-
return script_task_handler_1.DefaultScriptTaskHandler.create(taskHandlerArgs,
|
|
16141
|
+
return script_task_handler_1.DefaultScriptTaskHandler.create(taskHandlerArgs, logger, expressionHandler);
|
|
16142
16142
|
}
|
|
16143
16143
|
if (task.set !== undefined && !(0, task_utils_1.isResponseTask)(task)) {
|
|
16144
|
-
return new set_task_handler_1.SetTaskHandler(taskHandlerArgs,
|
|
16144
|
+
return new set_task_handler_1.SetTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16145
16145
|
}
|
|
16146
16146
|
if (task.try) {
|
|
16147
|
-
return new try_catch_task_handler_1.TryCatchTaskHandler(taskHandlerArgs,
|
|
16147
|
+
return new try_catch_task_handler_1.TryCatchTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16148
16148
|
}
|
|
16149
16149
|
if (task.for && task.do) {
|
|
16150
16150
|
if (task.while) {
|
|
16151
16151
|
const forLoop = task.for;
|
|
16152
16152
|
if (forLoop.each) {
|
|
16153
|
-
return new for_task_handler_1.ForTaskHandler(taskHandlerArgs,
|
|
16153
|
+
return new for_task_handler_1.ForTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16154
16154
|
} else {
|
|
16155
|
-
return new while_task_handler_1.WhileTaskHandler(taskHandlerArgs,
|
|
16155
|
+
return new while_task_handler_1.WhileTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16156
16156
|
}
|
|
16157
16157
|
} else if (task.doWhile) {
|
|
16158
|
-
return new do_while_task_handler_1.DoWhileTaskHandler(taskHandlerArgs,
|
|
16158
|
+
return new do_while_task_handler_1.DoWhileTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16159
16159
|
} else {
|
|
16160
|
-
return new for_task_handler_1.ForTaskHandler(taskHandlerArgs,
|
|
16160
|
+
return new for_task_handler_1.ForTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16161
16161
|
}
|
|
16162
16162
|
}
|
|
16163
16163
|
if (task.do) {
|
|
16164
|
-
return new do_task_handler_1.DoTaskHandler(taskHandlerArgs,
|
|
16164
|
+
return new do_task_handler_1.DoTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16165
16165
|
}
|
|
16166
16166
|
if (task.raise) {
|
|
16167
|
-
return new raise_task_handler_1.RaiseTaskHandler(taskHandlerArgs,
|
|
16167
|
+
return new raise_task_handler_1.RaiseTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16168
16168
|
}
|
|
16169
16169
|
if (task.switch) {
|
|
16170
16170
|
if (!taskHandlerArgs.allCurrentLevelTasks || !taskHandlerArgs.taskIndexRef || !taskHandlerArgs.workflowResult) {
|
|
16171
|
-
|
|
16171
|
+
logger.error("Switch task handler missing required context: allCurrentLevelTasks, taskIndexRef, or workflowResult");
|
|
16172
16172
|
throw new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.RUNTIME_ERROR).setStatus(models_1.WorkflowErrorStatus.INTERNAL_SERVER_ERROR).setTitle((0, localization_1.t)(localization_1.ErrorKeys.FAILED_SWITCH_TASK, { taskName: "switch" })).build();
|
|
16173
16173
|
}
|
|
16174
|
-
return new switch_task_handler_1.SwitchTaskHandler(taskHandlerArgs,
|
|
16174
|
+
return new switch_task_handler_1.SwitchTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16175
16175
|
}
|
|
16176
16176
|
if (task.wait) {
|
|
16177
|
-
return new wait_task_handler_1.WaitTaskHandler(taskHandlerArgs,
|
|
16177
|
+
return new wait_task_handler_1.WaitTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16178
16178
|
} else if ((0, task_utils_1.isResponseTask)(task)) {
|
|
16179
|
-
return new response_task_handler_1.ResponseTaskHandler(taskHandlerArgs,
|
|
16179
|
+
return new response_task_handler_1.ResponseTaskHandler(taskHandlerArgs, logger, expressionHandler);
|
|
16180
16180
|
}
|
|
16181
16181
|
throw new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.VALIDATION_ERROR).setStatus(models_1.WorkflowErrorStatus.BAD_REQUEST).setTitle((0, localization_1.t)(localization_1.ErrorKeys.UNSUPPORTED_TASK_TYPE)).setDetail((0, localization_1.t)(localization_1.ErrorKeys.UNSUPPORTED_TASK_TYPE_DETAIL, { taskType: String(task.type || "unknown") })).build();
|
|
16182
16182
|
};
|
|
@@ -16201,7 +16201,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16201
16201
|
var task_utils_1 = require_task_utils();
|
|
16202
16202
|
|
|
16203
16203
|
class TaskExecutorHelper {
|
|
16204
|
-
static async executeTaskList(taskList, previousStepOutput, workflowConfig, runtimeExpressionArgs,
|
|
16204
|
+
static async executeTaskList(taskList, previousStepOutput, workflowConfig, runtimeExpressionArgs, logger, expressionHandler, workFlowTaskVariables) {
|
|
16205
16205
|
let result = { success: true, data: {} };
|
|
16206
16206
|
if (!taskList || taskList.length === 0) {
|
|
16207
16207
|
return result;
|
|
@@ -16216,7 +16216,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16216
16216
|
continue;
|
|
16217
16217
|
}
|
|
16218
16218
|
const workflowExecutionResults = serverless_workflow_executor_1.ServerlessWorkflowExecutor.getExecutor(runtimeExpressionArgs.$runtime.metadata.workflowRunId).workflowExecutionResults;
|
|
16219
|
-
result = await this.executeFlowTask(taskToRun, taskList, previousStepOutput, taskIndexRef, workflowConfig, runtimeExpressionArgs, workflowExecutionResults,
|
|
16219
|
+
result = await this.executeFlowTask(taskToRun, taskList, previousStepOutput, taskIndexRef, workflowConfig, runtimeExpressionArgs, workflowExecutionResults, logger, expressionHandler, workFlowTaskVariables);
|
|
16220
16220
|
const lastExecutedStep = TaskExecutorHelper.readAsExtendedTask(taskList[taskIndexRef.value]);
|
|
16221
16221
|
if (!result.success) {
|
|
16222
16222
|
if ((0, utils_1.isWorkflowError)(result.error)) {
|
|
@@ -16225,11 +16225,11 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16225
16225
|
throw new utils_1.WorkflowErrorBuilder().fromError(result.error).setTitle((0, localization_1.t)(localization_1.ErrorKeys.UNKNOWN_TASK_ERROR, { taskName: lastExecutedStep.name })).setData({ taskName: lastExecutedStep.name, result }).build();
|
|
16226
16226
|
}
|
|
16227
16227
|
if (runtimeExpressionArgs.$runtime.control?.signalWorkflowEnd) {
|
|
16228
|
-
|
|
16228
|
+
logger.debug(`TaskExecutorHelper.executeTaskList: signalWorkflowEnd detected after processing task '${lastExecutedStep.name}'. Halting current task list.`);
|
|
16229
16229
|
return result;
|
|
16230
16230
|
}
|
|
16231
16231
|
if (runtimeExpressionArgs.$runtime.control?.signalLoopExit === true) {
|
|
16232
|
-
|
|
16232
|
+
logger.debug(`TaskExecutorHelper.executeTaskList: signalLoopExit detected after processing task '${lastExecutedStep.name}'. Halting current task list execution.`);
|
|
16233
16233
|
return result;
|
|
16234
16234
|
}
|
|
16235
16235
|
if (result.success && result.data) {
|
|
@@ -16248,7 +16248,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16248
16248
|
const nextTaskIndex = taskList.findIndex((t) => TaskExecutorHelper.readAsExtendedTask(t).name === lastExecutedStep.then);
|
|
16249
16249
|
if (nextTaskIndex === -1) {
|
|
16250
16250
|
const errorMessage = `Invalid transition from task '${lastExecutedStep.name}': Next task '${lastExecutedStep.then}' not found`;
|
|
16251
|
-
|
|
16251
|
+
logger.error(errorMessage);
|
|
16252
16252
|
throw new utils_1.WorkflowErrorBuilder().setType(models_1.WorkflowErrorType.RUNTIME_ERROR).setStatus(models_1.WorkflowErrorStatus.INTERNAL_SERVER_ERROR).setTitle((0, localization_1.t)(localization_1.ErrorKeys.INTERNAL_ERROR)).setData({
|
|
16253
16253
|
taskName: lastExecutedStep.name,
|
|
16254
16254
|
nextTask: lastExecutedStep.then,
|
|
@@ -16289,7 +16289,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16289
16289
|
}
|
|
16290
16290
|
return;
|
|
16291
16291
|
}
|
|
16292
|
-
static async executeFlowTask(currentTask, allCurrentLevelTasks, previousStepOutput, taskIndexRef, workflowConfig, runtimeExpressionArgs, workflowResult,
|
|
16292
|
+
static async executeFlowTask(currentTask, allCurrentLevelTasks, previousStepOutput, taskIndexRef, workflowConfig, runtimeExpressionArgs, workflowResult, logger, expressionHandler, workFlowTaskVariables) {
|
|
16293
16293
|
const task = TaskExecutorHelper.readAsExtendedTask(currentTask, workFlowTaskVariables);
|
|
16294
16294
|
let result = { success: true, data: {} };
|
|
16295
16295
|
const taskSpanId = (0, otel_id_1.newOtelSpanId)();
|
|
@@ -16313,18 +16313,18 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16313
16313
|
console.debug(`Task has breakpoint: ${task.name} [id: ${breakpointId}], pausing execution...`);
|
|
16314
16314
|
taskLogParams.breakpointId = breakpointId;
|
|
16315
16315
|
taskLogParams.shouldPause = true;
|
|
16316
|
-
const
|
|
16317
|
-
const resumeCommand$ =
|
|
16316
|
+
const executor = serverless_workflow_executor_1.ServerlessWorkflowExecutor.getExecutor(runtimeExpressionArgs.$runtime.metadata.workflowRunId);
|
|
16317
|
+
const resumeCommand$ = executor?.commandStream$?.pipe((0, rxjs_1.filter)((command) => command.command === models_1.WorkflowCommandEvent.Resume));
|
|
16318
16318
|
const resumeCommandPromise = (0, rxjs_1.firstValueFrom)(resumeCommand$ ?? rxjs_1.EMPTY);
|
|
16319
16319
|
console.debug(`Paused on: ${task.name} [breakpoint: ${breakpointId}], waiting for command to continue...`);
|
|
16320
|
-
await logging_helper_1.LoggingHelper.logTaskData(
|
|
16320
|
+
await logging_helper_1.LoggingHelper.logTaskData(logger, taskLogParams, expressionHandler);
|
|
16321
16321
|
await resumeCommandPromise;
|
|
16322
16322
|
console.debug(`Resume command received on: ${task.name} [breakpoint:${breakpointId}], continuing...`);
|
|
16323
16323
|
} else {
|
|
16324
|
-
await logging_helper_1.LoggingHelper.logTaskData(
|
|
16324
|
+
await logging_helper_1.LoggingHelper.logTaskData(logger, taskLogParams, expressionHandler);
|
|
16325
16325
|
}
|
|
16326
16326
|
} else {
|
|
16327
|
-
await logging_helper_1.LoggingHelper.logTaskData(
|
|
16327
|
+
await logging_helper_1.LoggingHelper.logTaskData(logger, taskLogParams, expressionHandler);
|
|
16328
16328
|
}
|
|
16329
16329
|
workflowResult.addToWorkflowExecutions(task.name);
|
|
16330
16330
|
const taskHandlerArgs = this.setupTaskHandlerArgs(workflowConfig, allCurrentLevelTasks, taskIndexRef, workflowResult);
|
|
@@ -16335,7 +16335,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16335
16335
|
taskHandlerArgs,
|
|
16336
16336
|
runtimeExpressionArgs,
|
|
16337
16337
|
taskInput: previousStepOutput,
|
|
16338
|
-
logger
|
|
16338
|
+
logger,
|
|
16339
16339
|
expressionHandler,
|
|
16340
16340
|
customTaskHandlerFactories: executor?.customTaskHandlerFactories
|
|
16341
16341
|
}));
|
|
@@ -16345,7 +16345,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16345
16345
|
}
|
|
16346
16346
|
const taskData = task.raise ? result.error.toObject() : result.data;
|
|
16347
16347
|
const isUiPathInternalServiceCall = this.detectUiPathInternalServiceCall(task, result.resolvedProperties);
|
|
16348
|
-
await runInTaskSpan(() => logging_helper_1.LoggingHelper.logTaskData(
|
|
16348
|
+
await runInTaskSpan(() => logging_helper_1.LoggingHelper.logTaskData(logger, {
|
|
16349
16349
|
taskId: task.name,
|
|
16350
16350
|
taskType: (0, task_utils_1.getTaskType)(task),
|
|
16351
16351
|
displayName: task.metadata?.displayName,
|
|
@@ -16374,7 +16374,7 @@ var require_task_executor_helper = __commonJS(function(exports) {
|
|
|
16374
16374
|
const workflowError = builder.build();
|
|
16375
16375
|
const eventToLog = isErrorOriginatingTask ? models_1.TaskEvent.TASK_FAILED : models_1.TaskEvent.TASK_STOPPED;
|
|
16376
16376
|
const isUiPathInternalServiceCall = this.detectUiPathInternalServiceCall(task, result.resolvedProperties);
|
|
16377
|
-
await logging_helper_1.LoggingHelper.logTaskData(
|
|
16377
|
+
await logging_helper_1.LoggingHelper.logTaskData(logger, {
|
|
16378
16378
|
taskId: task.name,
|
|
16379
16379
|
taskType: (0, task_utils_1.getTaskType)(task),
|
|
16380
16380
|
displayName: task.metadata?.displayName,
|
|
@@ -16419,13 +16419,13 @@ var require_serverless_workflow_executor = __commonJS(function(exports) {
|
|
|
16419
16419
|
var task_executor_helper_1 = require_task_executor_helper();
|
|
16420
16420
|
|
|
16421
16421
|
class ServerlessWorkflowExecutor {
|
|
16422
|
-
constructor(workflow, workflowConfig,
|
|
16422
|
+
constructor(workflow, workflowConfig, logger, options, workflowRunId, input) {
|
|
16423
16423
|
this.workflowStartedAt = undefined;
|
|
16424
16424
|
this.customTaskHandlerFactories = {};
|
|
16425
16425
|
this.commandStream$ = undefined;
|
|
16426
16426
|
this.workflowStartedAt = new Date;
|
|
16427
16427
|
this.workflow = workflow;
|
|
16428
|
-
this.logger =
|
|
16428
|
+
this.logger = logger;
|
|
16429
16429
|
this.workflowConfig = workflowConfig;
|
|
16430
16430
|
this.workflowRunId = workflowRunId || (0, api_workflow_commons_1.getNewGuid)();
|
|
16431
16431
|
this.workflowExecutionResults = new models_1.WorkflowExecutionResults(this.workflowRunId, workflowConfig.debugConfig?.enableTaskTracking === true);
|
|
@@ -16440,17 +16440,17 @@ var require_serverless_workflow_executor = __commonJS(function(exports) {
|
|
|
16440
16440
|
return ServerlessWorkflowExecutor.workflowExecutorMap.get(workflowRunId);
|
|
16441
16441
|
}
|
|
16442
16442
|
static async execute(workflow, workflowConfig, input, options, workflowRunId) {
|
|
16443
|
-
const
|
|
16443
|
+
const logger = options?.logger ?? default_logger_1.defaultLogger;
|
|
16444
16444
|
await (0, localization_1.initLocalization)(workflowConfig.languageCode);
|
|
16445
16445
|
let executor = null;
|
|
16446
16446
|
let commandSubscription = null;
|
|
16447
16447
|
try {
|
|
16448
|
-
executor = new ServerlessWorkflowExecutor(workflow, workflowConfig,
|
|
16448
|
+
executor = new ServerlessWorkflowExecutor(workflow, workflowConfig, logger, options, workflowRunId, input);
|
|
16449
16449
|
ServerlessWorkflowExecutor.workflowExecutorMap.set(executor.workflowRunId, executor);
|
|
16450
16450
|
if (workflowConfig.debugConfig?.runInDebugMode) {
|
|
16451
16451
|
if (!options?.commandStream$) {
|
|
16452
16452
|
const errorMessage = "$commandStream is required in WorkflowExecutorOptions when debug mode is enabled";
|
|
16453
|
-
|
|
16453
|
+
logger.error(errorMessage);
|
|
16454
16454
|
throw new Error((0, localization_1.t)(localization_1.ErrorKeys.INTERNAL_ERROR));
|
|
16455
16455
|
}
|
|
16456
16456
|
executor.commandStream$ = options.commandStream$;
|
|
@@ -16468,11 +16468,11 @@ var require_serverless_workflow_executor = __commonJS(function(exports) {
|
|
|
16468
16468
|
const signalJobFailure = workflowResult.success === false || responseTaskSignal?.signalJobFailure === true;
|
|
16469
16469
|
const response = workflowResult.success === false ? workflowResult.error : isResponseStepExecuted ? workflowResult.data : undefined;
|
|
16470
16470
|
const workflowResponse = new models_1.WorkflowResponse(signalJobFailure, response);
|
|
16471
|
-
await
|
|
16471
|
+
await logger.shutdown();
|
|
16472
16472
|
return workflowResponse;
|
|
16473
16473
|
} catch (error) {
|
|
16474
|
-
|
|
16475
|
-
await
|
|
16474
|
+
logger?.error("Workflow execution failed", undefined, error instanceof Error ? error : new Error((0, api_workflow_commons_1.getErrorMessage)(error)));
|
|
16475
|
+
await logger.shutdown();
|
|
16476
16476
|
const workflowError = (0, utils_1.isWorkflowError)(error) ? error : new utils_1.WorkflowErrorBuilder().fromError(error).setTitle((0, localization_1.t)(localization_1.ErrorKeys.WORKFLOW_EXECUTION_FAILED)).build();
|
|
16477
16477
|
throw workflowError;
|
|
16478
16478
|
} finally {
|
|
@@ -16961,6 +16961,8 @@ var ENV_AUTH_VARS = {
|
|
|
16961
16961
|
};
|
|
16962
16962
|
|
|
16963
16963
|
class EnvAuthConfigError extends Error {
|
|
16964
|
+
errorCode = "configuration_error";
|
|
16965
|
+
retry = "RetryWillNotFix";
|
|
16964
16966
|
constructor(message) {
|
|
16965
16967
|
super(message);
|
|
16966
16968
|
this.name = "EnvAuthConfigError";
|
|
@@ -16999,11 +17001,11 @@ var readAuthFromEnv = () => {
|
|
|
16999
17001
|
if (!rawUrl) {
|
|
17000
17002
|
throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
|
|
17001
17003
|
}
|
|
17002
|
-
const
|
|
17004
|
+
const baseUrl = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
|
|
17003
17005
|
return {
|
|
17004
17006
|
loginStatus: "Logged in",
|
|
17005
17007
|
accessToken,
|
|
17006
|
-
baseUrl
|
|
17008
|
+
baseUrl,
|
|
17007
17009
|
organizationName,
|
|
17008
17010
|
organizationId,
|
|
17009
17011
|
tenantName,
|
|
@@ -17303,9 +17305,12 @@ var refreshAccessToken = async ({
|
|
|
17303
17305
|
body: tokenParams
|
|
17304
17306
|
});
|
|
17305
17307
|
const tokenData = await tokenResponse.json();
|
|
17306
|
-
if (
|
|
17308
|
+
if (tokenResponse.status === 400 || tokenResponse.status === 401) {
|
|
17307
17309
|
throw new TokenRefreshOAuthError;
|
|
17308
17310
|
}
|
|
17311
|
+
if (!tokenResponse.ok) {
|
|
17312
|
+
throw new Error(`Token refresh failed: HTTP ${tokenResponse.status}`);
|
|
17313
|
+
}
|
|
17309
17314
|
const newAccessToken = tokenData.access_token;
|
|
17310
17315
|
const newRefreshToken = tokenData.refresh_token;
|
|
17311
17316
|
if (typeof newAccessToken !== "string" || typeof newRefreshToken !== "string") {
|
|
@@ -17368,20 +17373,20 @@ var probeAsync = async (fs, candidate) => {
|
|
|
17368
17373
|
var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) => {
|
|
17369
17374
|
const fs = getFileSystem();
|
|
17370
17375
|
if (fs.path.isAbsolute(envFilePath)) {
|
|
17371
|
-
const
|
|
17372
|
-
return
|
|
17376
|
+
const probe = await probeAsync(fs, envFilePath);
|
|
17377
|
+
return probe.exists ? { exists: true, absolutePath: envFilePath, source: "absolute" } : {
|
|
17373
17378
|
exists: false,
|
|
17374
17379
|
absolutePath: envFilePath,
|
|
17375
17380
|
source: "absolute",
|
|
17376
|
-
...
|
|
17381
|
+
...probe.unusable ? { unusable: probe.unusable } : {}
|
|
17377
17382
|
};
|
|
17378
17383
|
}
|
|
17379
17384
|
const cwd = opts?.cwd ?? fs.env.cwd();
|
|
17380
17385
|
let searchDir = cwd;
|
|
17381
17386
|
while (true) {
|
|
17382
17387
|
const candidate = fs.path.join(searchDir, envFilePath);
|
|
17383
|
-
const
|
|
17384
|
-
if (
|
|
17388
|
+
const probe = await probeAsync(fs, candidate);
|
|
17389
|
+
if (probe.exists) {
|
|
17385
17390
|
return {
|
|
17386
17391
|
exists: true,
|
|
17387
17392
|
absolutePath: candidate,
|
|
@@ -18024,26 +18029,38 @@ function errorMessage(error) {
|
|
|
18024
18029
|
}
|
|
18025
18030
|
|
|
18026
18031
|
// ../auth/src/authContext.ts
|
|
18032
|
+
class AuthContextUnavailableError extends Error {
|
|
18033
|
+
instructionContext;
|
|
18034
|
+
sessionHint;
|
|
18035
|
+
errorCode = "authentication_required";
|
|
18036
|
+
retry = "RetryWillNotFix";
|
|
18037
|
+
constructor(message, instructionContext = "auth", sessionHint) {
|
|
18038
|
+
super(message);
|
|
18039
|
+
this.instructionContext = instructionContext;
|
|
18040
|
+
this.sessionHint = sessionHint;
|
|
18041
|
+
this.name = "AuthContextUnavailableError";
|
|
18042
|
+
}
|
|
18043
|
+
}
|
|
18027
18044
|
var getAuthContext = async (options = {}) => {
|
|
18028
18045
|
const status = await getLoginStatusAsync({
|
|
18029
18046
|
ensureTokenValidityMinutes: options.ensureTokenValidityMinutes,
|
|
18030
18047
|
envFilePath: options.envFilePath
|
|
18031
18048
|
});
|
|
18032
18049
|
if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
|
|
18033
|
-
throw new
|
|
18050
|
+
throw new AuthContextUnavailableError(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.", "auth", status.hint);
|
|
18034
18051
|
}
|
|
18035
|
-
const tenantName = options.tenant
|
|
18052
|
+
const tenantName = options.tenant || status.tenantName;
|
|
18036
18053
|
if (options.requireOrganizationId && !status.organizationId) {
|
|
18037
|
-
throw new
|
|
18054
|
+
throw new AuthContextUnavailableError("Organization ID not available. Ensure you are logged in with an organization context.", "identity");
|
|
18038
18055
|
}
|
|
18039
18056
|
if (options.requireOrganizationName && !status.organizationName) {
|
|
18040
|
-
throw new
|
|
18057
|
+
throw new AuthContextUnavailableError("Organization name not available. Ensure you are logged in with an organization context.", "identity");
|
|
18041
18058
|
}
|
|
18042
18059
|
if (options.requireTenantId && !status.tenantId) {
|
|
18043
|
-
throw new
|
|
18060
|
+
throw new AuthContextUnavailableError(`Tenant ID not available. Ensure UIPATH_TENANT_ID is set.${status.hint ? ` ${status.hint}` : ""}`, "identity", status.hint);
|
|
18044
18061
|
}
|
|
18045
|
-
if (options.requireTenantName && tenantName
|
|
18046
|
-
throw new
|
|
18062
|
+
if (options.requireTenantName && !tenantName) {
|
|
18063
|
+
throw new AuthContextUnavailableError("Tenant not provided and UIPATH_TENANT_NAME not set. Run 'uip login' to select a tenant, or use 'uip login tenant set <tenant>' to switch tenants.", "identity");
|
|
18047
18064
|
}
|
|
18048
18065
|
return {
|
|
18049
18066
|
baseUrl: status.baseUrl,
|
|
@@ -18507,9 +18524,9 @@ class WorkflowRunService {
|
|
|
18507
18524
|
const resolvedPath = fs.path.resolve(request.filePath);
|
|
18508
18525
|
const input = { ...request.input ?? {} };
|
|
18509
18526
|
const inputFiles = request.inputFiles ?? [];
|
|
18510
|
-
const failed = (
|
|
18527
|
+
const failed = (errorMessage, failedStage, instructions) => ({
|
|
18511
18528
|
success: false,
|
|
18512
|
-
errorMessage
|
|
18529
|
+
errorMessage,
|
|
18513
18530
|
failedStage,
|
|
18514
18531
|
workflowPath: resolvedPath,
|
|
18515
18532
|
...instructions ? { instructions } : {}
|
|
@@ -18526,9 +18543,9 @@ class WorkflowRunService {
|
|
|
18526
18543
|
return failed(`Failed to parse workflow file: ${parseError.message}`, "load");
|
|
18527
18544
|
}
|
|
18528
18545
|
const workflowLogger = createConsoleLogger();
|
|
18529
|
-
const bail = async (
|
|
18546
|
+
const bail = async (errorMessage, failedStage, instructions) => {
|
|
18530
18547
|
await workflowLogger.shutdown();
|
|
18531
|
-
return failed(
|
|
18548
|
+
return failed(errorMessage, failedStage, instructions);
|
|
18532
18549
|
};
|
|
18533
18550
|
const filesService = new WorkflowFilesService(this.fileSystem);
|
|
18534
18551
|
if (request.outputDir) {
|
|
@@ -18663,6 +18680,6 @@ Running workflow: ${fs.path.basename(resolvedPath)}`);
|
|
|
18663
18680
|
}
|
|
18664
18681
|
}
|
|
18665
18682
|
|
|
18666
|
-
export {
|
|
18683
|
+
export { getAuthContext, WorkflowRunService };
|
|
18667
18684
|
|
|
18668
|
-
//# debugId=
|
|
18685
|
+
//# debugId=BA5D047A26497B8D64756E2164756E21
|