@bringg/dashboard-sdk 9.90.0-pre.0 → 9.91.0-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TaskManagedAttributes/task-managed-attributes-api.d.ts +13 -1
- package/dist/TaskManagedAttributes/task-managed-attributes-api.js +18 -0
- package/dist/TaskManagedAttributes/task-managed-attributes-api.js.map +1 -1
- package/dist/TaskManagedAttributes/task-managed-attributes-service.d.ts +2 -1
- package/dist/TaskManagedAttributes/task-managed-attributes-service.js +13 -0
- package/dist/TaskManagedAttributes/task-managed-attributes-service.js.map +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +201 -16
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +17 -6
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetAvailableManagedAttributeHTTPResponse } from '@bringg/common-utils';
|
|
1
|
+
import { GetAvailableManagedAttributeHTTPResponse, GetFamilyHTTPResponse } from '@bringg/common-utils';
|
|
2
2
|
import { DataOptions } from '../data-entity';
|
|
3
3
|
import Session from '../Services/Identity/Session';
|
|
4
4
|
import { TaskManagedAttributeUpdateRealTimeEvent } from './internal-types';
|
|
@@ -16,6 +16,18 @@ export default class TaskManagedAttributesApi {
|
|
|
16
16
|
getAll(): GetAvailableManagedAttributeHTTPResponse;
|
|
17
17
|
loadByIds(ids: number[], commonOptions?: DataOptions): Promise<ManagedAttribute[]>;
|
|
18
18
|
getAvailableAttributes(): Promise<GetAvailableManagedAttributeHTTPResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* The orders sharing this order's value for the merchant's family-key attribute, with the fields
|
|
21
|
+
* the order page renders for each of them. Not cached: statuses and time windows change.
|
|
22
|
+
*
|
|
23
|
+
* @param taskId - the order whose family is requested
|
|
24
|
+
* @returns `family: null` when the order belongs to no family
|
|
25
|
+
* @throws BringgException with `statusCode` 409 when the service cannot resolve the family
|
|
26
|
+
* @example
|
|
27
|
+
* const { family } = await sdk.v2.taskManagedAttributes.getFamily(9750945);
|
|
28
|
+
* const siblingIds = family?.members.map(member => member.task_id) ?? [];
|
|
29
|
+
*/
|
|
30
|
+
getFamily(taskId: number): Promise<GetFamilyHTTPResponse>;
|
|
19
31
|
onUpdate(callback: (event: TaskManagedAttributeUpdateRealTimeEvent) => unknown | Promise<unknown>): () => void;
|
|
20
32
|
fetchAvailableAttributes(ids: number[], commonOptions?: DataOptions): Promise<GetAvailableManagedAttributeHTTPResponse>;
|
|
21
33
|
resetAllListeners(): void;
|
|
@@ -127,6 +127,24 @@ var TaskManagedAttributesApi = /** @class */ (function () {
|
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* The orders sharing this order's value for the merchant's family-key attribute, with the fields
|
|
132
|
+
* the order page renders for each of them. Not cached: statuses and time windows change.
|
|
133
|
+
*
|
|
134
|
+
* @param taskId - the order whose family is requested
|
|
135
|
+
* @returns `family: null` when the order belongs to no family
|
|
136
|
+
* @throws BringgException with `statusCode` 409 when the service cannot resolve the family
|
|
137
|
+
* @example
|
|
138
|
+
* const { family } = await sdk.v2.taskManagedAttributes.getFamily(9750945);
|
|
139
|
+
* const siblingIds = family?.members.map(member => member.task_id) ?? [];
|
|
140
|
+
*/
|
|
141
|
+
TaskManagedAttributesApi.prototype.getFamily = function (taskId) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
+
return __generator(this, function (_a) {
|
|
144
|
+
return [2 /*return*/, this.service.getFamily(taskId)];
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
130
148
|
TaskManagedAttributesApi.prototype.onUpdate = function (callback) {
|
|
131
149
|
return this.realtimeSubscriptions.onUpdate(callback);
|
|
132
150
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-managed-attributes-api.js","sourceRoot":"","sources":["../../src/TaskManagedAttributes/task-managed-attributes-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"task-managed-attributes-api.js","sourceRoot":"","sources":["../../src/TaskManagedAttributes/task-managed-attributes-api.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetAvailableManagedAttributeHTTPResponse, TaskManagedAttributesHTTPGetTasksByIdsResponse } from '@bringg/common-utils';
|
|
1
|
+
import { GetAvailableManagedAttributeHTTPResponse, GetFamilyHTTPResponse, TaskManagedAttributesHTTPGetTasksByIdsResponse } from '@bringg/common-utils';
|
|
2
2
|
import { CommonOptions } from '../Core/RouteGenerator';
|
|
3
3
|
import Session from '../Services/Identity/Session';
|
|
4
4
|
export default class TaskManagedAttributesService {
|
|
@@ -6,4 +6,5 @@ export default class TaskManagedAttributesService {
|
|
|
6
6
|
constructor(session: Session);
|
|
7
7
|
loadByIds(ids: number[], commonOptions?: CommonOptions): Promise<TaskManagedAttributesHTTPGetTasksByIdsResponse>;
|
|
8
8
|
getAvailableAttributes(commonOptions?: CommonOptions): Promise<GetAvailableManagedAttributeHTTPResponse>;
|
|
9
|
+
getFamily(taskId: number, commonOptions?: CommonOptions): Promise<GetFamilyHTTPResponse>;
|
|
9
10
|
}
|
|
@@ -72,6 +72,19 @@ var TaskManagedAttributesService = /** @class */ (function () {
|
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
|
+
TaskManagedAttributesService.prototype.getFamily = function (taskId, commonOptions) {
|
|
76
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
80
|
+
.get("".concat(basePath, "/family"))
|
|
81
|
+
.withQueryString({ task_id: taskId })
|
|
82
|
+
.setException('failed to fetch the family of the task')
|
|
83
|
+
.withCommonOptions(commonOptions)
|
|
84
|
+
.invoke()];
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
75
88
|
return TaskManagedAttributesService;
|
|
76
89
|
}());
|
|
77
90
|
exports.default = TaskManagedAttributesService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-managed-attributes-service.js","sourceRoot":"","sources":["../../src/TaskManagedAttributes/task-managed-attributes-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"task-managed-attributes-service.js","sourceRoot":"","sources":["../../src/TaskManagedAttributes/task-managed-attributes-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,oEAA8C;AAK9C,IAAM,QAAQ,GAAG,kCAAkC,CAAC;AAEpD;IAGC,sCAAY,OAAgB;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAW,CAAC,OAAO,EAAE,oBAAoB,EAAE,cAAc,CAAC,CAAC;IAC/E,CAAC;IAEY,gDAAS,GAAtB,UACC,GAAa,EACb,aAAiC;QAAjC,8BAAA,EAAA,kBAAiC;;;gBAEjC,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,IAAI,CAAC,QAAQ,CAAC;yBACd,WAAW,CAAC;wBACZ,QAAQ,EAAE,GAAG;qBACwC,CAAC;yBACtD,YAAY,CAAC,wDAAwD,CAAC;yBACtE,iBAAiB,CAAC,aAAa,CAAC;yBAChC,MAAM,EAAkG,EAAC;;;KAC3G;IAEY,6DAAsB,GAAnC,UACC,aAAiC;QAAjC,8BAAA,EAAA,kBAAiC;;;gBAEjC,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,GAAG,CAAC,UAAG,QAAQ,eAAY,CAAC;yBAC5B,YAAY,CAAC,8CAA8C,CAAC;yBAC5D,iBAAiB,CAAC,aAAa,CAAC;yBAChC,MAAM,EAAsF,EAAC;;;KAC/F;IAEY,gDAAS,GAAtB,UAAuB,MAAc,EAAE,aAAiC;QAAjC,8BAAA,EAAA,kBAAiC;;;gBACvE,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,GAAG,CAAC,UAAG,QAAQ,YAAS,CAAC;yBACzB,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;yBACpC,YAAY,CAAC,wCAAwC,CAAC;yBACtD,iBAAiB,CAAC,aAAa,CAAC;yBAChC,MAAM,EAAgD,EAAC;;;KACzD;IACF,mCAAC;AAAD,CAAC,AAvCD,IAuCC"}
|
|
@@ -24784,7 +24784,7 @@ var BringgException_1 = __webpack_require__(43605);
|
|
|
24784
24784
|
var client_page_1 = __webpack_require__(16573);
|
|
24785
24785
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
24786
24786
|
var abort_1 = __webpack_require__(34179);
|
|
24787
|
-
var version = '9.
|
|
24787
|
+
var version = '9.91.0-pre.0';
|
|
24788
24788
|
function logErrorResponse(response) {
|
|
24789
24789
|
var data = response.data, status = response.status;
|
|
24790
24790
|
try {
|
|
@@ -29078,6 +29078,24 @@ var TaskManagedAttributesApi = /** @class */ (function () {
|
|
|
29078
29078
|
});
|
|
29079
29079
|
});
|
|
29080
29080
|
};
|
|
29081
|
+
/**
|
|
29082
|
+
* The orders sharing this order's value for the merchant's family-key attribute, with the fields
|
|
29083
|
+
* the order page renders for each of them. Not cached: statuses and time windows change.
|
|
29084
|
+
*
|
|
29085
|
+
* @param taskId - the order whose family is requested
|
|
29086
|
+
* @returns `family: null` when the order belongs to no family
|
|
29087
|
+
* @throws BringgException with `statusCode` 409 when the service cannot resolve the family
|
|
29088
|
+
* @example
|
|
29089
|
+
* const { family } = await sdk.v2.taskManagedAttributes.getFamily(9750945);
|
|
29090
|
+
* const siblingIds = family?.members.map(member => member.task_id) ?? [];
|
|
29091
|
+
*/
|
|
29092
|
+
TaskManagedAttributesApi.prototype.getFamily = function (taskId) {
|
|
29093
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
29094
|
+
return __generator(this, function (_a) {
|
|
29095
|
+
return [2 /*return*/, this.service.getFamily(taskId)];
|
|
29096
|
+
});
|
|
29097
|
+
});
|
|
29098
|
+
};
|
|
29081
29099
|
TaskManagedAttributesApi.prototype.onUpdate = function (callback) {
|
|
29082
29100
|
return this.realtimeSubscriptions.onUpdate(callback);
|
|
29083
29101
|
};
|
|
@@ -29306,6 +29324,19 @@ var TaskManagedAttributesService = /** @class */ (function () {
|
|
|
29306
29324
|
});
|
|
29307
29325
|
});
|
|
29308
29326
|
};
|
|
29327
|
+
TaskManagedAttributesService.prototype.getFamily = function (taskId, commonOptions) {
|
|
29328
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
29329
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
29330
|
+
return __generator(this, function (_a) {
|
|
29331
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
29332
|
+
.get("".concat(basePath, "/family"))
|
|
29333
|
+
.withQueryString({ task_id: taskId })
|
|
29334
|
+
.setException('failed to fetch the family of the task')
|
|
29335
|
+
.withCommonOptions(commonOptions)
|
|
29336
|
+
.invoke()];
|
|
29337
|
+
});
|
|
29338
|
+
});
|
|
29339
|
+
};
|
|
29309
29340
|
return TaskManagedAttributesService;
|
|
29310
29341
|
}());
|
|
29311
29342
|
exports["default"] = TaskManagedAttributesService;
|
|
@@ -37469,15 +37500,24 @@ var ToolName;
|
|
|
37469
37500
|
(function (ToolName) {
|
|
37470
37501
|
ToolName["CreateVisualization"] = "create_visualization";
|
|
37471
37502
|
ToolName["SuggestFollowupQuestions"] = "suggest_followup_questions";
|
|
37503
|
+
ToolName["ExplainCalculation"] = "explain_calculation";
|
|
37472
37504
|
})(ToolName || (exports.ToolName = ToolName = {}));
|
|
37473
37505
|
var ChartKind;
|
|
37474
37506
|
(function (ChartKind) {
|
|
37475
37507
|
ChartKind["Bar"] = "bar";
|
|
37508
|
+
/** `bar` turned on its side, for long category names or more categories than fit across the width. */
|
|
37509
|
+
ChartKind["HorizontalBar"] = "horizontal_bar";
|
|
37510
|
+
/** One bar per category split into its series, for parts of a whole — `bar` puts them side by side instead. */
|
|
37511
|
+
ChartKind["StackedBar"] = "stacked_bar";
|
|
37476
37512
|
ChartKind["Line"] = "line";
|
|
37477
|
-
|
|
37513
|
+
/** A line with the space under it filled, for when the size of the total matters and not only its direction. */
|
|
37478
37514
|
ChartKind["Area"] = "area";
|
|
37515
|
+
ChartKind["Pie"] = "pie";
|
|
37516
|
+
/** A pie with its center cut out, for when that center should carry the total. */
|
|
37517
|
+
ChartKind["Doughnut"] = "doughnut";
|
|
37479
37518
|
ChartKind["Scatter"] = "scatter";
|
|
37480
|
-
|
|
37519
|
+
/** A closed loop per series over the same measures, for comparing a few series across many measures at once. */
|
|
37520
|
+
ChartKind["Radar"] = "radar";
|
|
37481
37521
|
})(ChartKind || (exports.ChartKind = ChartKind = {}));
|
|
37482
37522
|
//# sourceMappingURL=tool_calls.js.map
|
|
37483
37523
|
|
|
@@ -38075,8 +38115,39 @@ var aggregation_types_1 = __webpack_require__(53551);
|
|
|
38075
38115
|
var task_inventories_load_aggregator_1 = __webpack_require__(69508);
|
|
38076
38116
|
function sortTasks(tasks, tieBreakById) {
|
|
38077
38117
|
// Tie-break on id only where cluster identity depends on task adjacency: callers fetch tasks
|
|
38078
|
-
// unordered, and every other path has to keep the caller's order for tied priorities
|
|
38079
|
-
|
|
38118
|
+
// unordered, and every other path has to keep the caller's order for tied priorities. A missing
|
|
38119
|
+
// priority defaults to 0 because subtracting undefined yields NaN and costs the total order
|
|
38120
|
+
return __spreadArray([], tasks, true).sort(function (a, b) { var _a, _b; return ((_a = a.priority) !== null && _a !== void 0 ? _a : 0) - ((_b = b.priority) !== null && _b !== void 0 ? _b : 0) || (tieBreakById ? a.id - b.id : 0); });
|
|
38121
|
+
}
|
|
38122
|
+
// An order added to a sequenced route arrives as a pickup task and a drop-off task, so two stops
|
|
38123
|
+
// is the most that can sit unsequenced at the tail before their own order starts deciding the walk
|
|
38124
|
+
var MAX_UNSEQUENCED_TAIL = 2;
|
|
38125
|
+
function hasAssignedSequence(task) {
|
|
38126
|
+
return !(0, isNil_1.default)(task.priority) && task.priority !== task.id;
|
|
38127
|
+
}
|
|
38128
|
+
// Hagmonia defaults a missing priority to the task id, so a non-null priority is not evidence of a
|
|
38129
|
+
// route order. Ids dwarf sequence ordinals, so a couple of defaults sort past every assigned one
|
|
38130
|
+
// and stay a known tail; anything else puts the walk back on creation order, which reports less
|
|
38131
|
+
// than the vehicle carries
|
|
38132
|
+
function hasRouteSequence(tasks) {
|
|
38133
|
+
var lastAssigned = -Infinity;
|
|
38134
|
+
var firstDefaulted = Infinity;
|
|
38135
|
+
var unsequenced = 0;
|
|
38136
|
+
for (var _i = 0, tasks_1 = tasks; _i < tasks_1.length; _i++) {
|
|
38137
|
+
var task = tasks_1[_i];
|
|
38138
|
+
if (hasAssignedSequence(task)) {
|
|
38139
|
+
lastAssigned = Math.max(lastAssigned, task.priority);
|
|
38140
|
+
}
|
|
38141
|
+
else if ((0, isNil_1.default)(task.priority)) {
|
|
38142
|
+
// A null priority has no place in the sort at all, so it cannot be trusted to sort last
|
|
38143
|
+
return false;
|
|
38144
|
+
}
|
|
38145
|
+
else {
|
|
38146
|
+
unsequenced += 1;
|
|
38147
|
+
firstDefaulted = Math.min(firstDefaulted, task.priority);
|
|
38148
|
+
}
|
|
38149
|
+
}
|
|
38150
|
+
return lastAssigned > -Infinity && unsequenced <= MAX_UNSEQUENCED_TAIL && firstDefaulted > lastAssigned;
|
|
38080
38151
|
}
|
|
38081
38152
|
function getTaskInventoriesFromTasks(tasks) {
|
|
38082
38153
|
return tasks.flatMap(function (task, taskIndex) {
|
|
@@ -38145,13 +38216,8 @@ function getTaskInventoriesOrderedByCustomers(taskInventories, splitClusters, un
|
|
|
38145
38216
|
}
|
|
38146
38217
|
return visitKey;
|
|
38147
38218
|
}
|
|
38148
|
-
//
|
|
38149
|
-
//
|
|
38150
|
-
if (!pending) {
|
|
38151
|
-
return visitKey;
|
|
38152
|
-
}
|
|
38153
|
-
// A stop elsewhere between two loads ends the cluster: the vehicle unloads in between,
|
|
38154
|
-
// so the second load must not stack onto the first one's
|
|
38219
|
+
// A row past the visit's last load opens a new visit: the vehicle may have left in between,
|
|
38220
|
+
// and walking the row with the earlier visit would load or unload it somewhere else
|
|
38155
38221
|
var nextVisitKey = "".concat(customerId, ":").concat(visit + 1);
|
|
38156
38222
|
customerVisit[customerId] = visit + 1;
|
|
38157
38223
|
clusterLastTaskIndex[nextVisitKey] = taskIndex;
|
|
@@ -38190,8 +38256,19 @@ function getTaskInventoriesOrderedByCustomers(taskInventories, splitClusters, un
|
|
|
38190
38256
|
}
|
|
38191
38257
|
function calculateLoadAggregations(aggregationTypes, _a) {
|
|
38192
38258
|
var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields, logger = _a.logger;
|
|
38193
|
-
var
|
|
38194
|
-
var
|
|
38259
|
+
var splitRequested = Boolean(isClusterMode && splitClustersBySequence);
|
|
38260
|
+
var splitClusters = splitRequested && hasRouteSequence(items);
|
|
38261
|
+
if (logger && splitRequested && !splitClusters) {
|
|
38262
|
+
var taskIds = items.filter(function (task) { return !hasAssignedSequence(task); }).map(function (task) { return task.id; });
|
|
38263
|
+
if (taskIds.length) {
|
|
38264
|
+
logger('Split by sequence declined because these tasks have no assigned sequence', {
|
|
38265
|
+
task_ids: taskIds
|
|
38266
|
+
});
|
|
38267
|
+
}
|
|
38268
|
+
}
|
|
38269
|
+
// The tie-break follows the request, not the guard: dropping it on the fallback would leave the
|
|
38270
|
+
// order to the caller's fetch and make the reported load differ between two identical requests
|
|
38271
|
+
var sortedTasks = sortTasks(items, splitRequested);
|
|
38195
38272
|
var plannedOrder = getTaskInventoriesFromTasks(sortedTasks);
|
|
38196
38273
|
var taskInventories = isClusterMode
|
|
38197
38274
|
? getTaskInventoriesOrderedByCustomers(plannedOrder, splitClusters, uniqueInventoryFields, logger)
|
|
@@ -38216,7 +38293,7 @@ function calculateLoadAggregations(aggregationTypes, _a) {
|
|
|
38216
38293
|
});
|
|
38217
38294
|
}
|
|
38218
38295
|
function calculateTasksMaxLoad(_a) {
|
|
38219
|
-
var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields;
|
|
38296
|
+
var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields, logger = _a.logger;
|
|
38220
38297
|
var aggregationType = aggregation_types_1.AggregationTypes.MAX_LOAD;
|
|
38221
38298
|
return calculateLoadAggregations([aggregationType], {
|
|
38222
38299
|
items: items,
|
|
@@ -38224,7 +38301,8 @@ function calculateTasksMaxLoad(_a) {
|
|
|
38224
38301
|
ignoreQuantity: ignoreQuantity,
|
|
38225
38302
|
isClusterMode: isClusterMode,
|
|
38226
38303
|
splitClustersBySequence: splitClustersBySequence,
|
|
38227
|
-
uniqueInventoryFields: uniqueInventoryFields
|
|
38304
|
+
uniqueInventoryFields: uniqueInventoryFields,
|
|
38305
|
+
logger: logger
|
|
38228
38306
|
})[aggregationType];
|
|
38229
38307
|
}
|
|
38230
38308
|
//# sourceMappingURL=tasks_load_aggregators.js.map
|
|
@@ -39280,6 +39358,7 @@ __exportStar(__webpack_require__(82642), exports);
|
|
|
39280
39358
|
__exportStar(__webpack_require__(44394), exports);
|
|
39281
39359
|
__exportStar(__webpack_require__(37787), exports);
|
|
39282
39360
|
__exportStar(__webpack_require__(31306), exports);
|
|
39361
|
+
__exportStar(__webpack_require__(92244), exports);
|
|
39283
39362
|
//# sourceMappingURL=index.js.map
|
|
39284
39363
|
|
|
39285
39364
|
/***/ }),
|
|
@@ -39362,6 +39441,112 @@ function getActionableWaypoint(wayPoints, taskTypeId) {
|
|
|
39362
39441
|
|
|
39363
39442
|
/***/ }),
|
|
39364
39443
|
|
|
39444
|
+
/***/ 92244:
|
|
39445
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
39446
|
+
|
|
39447
|
+
"use strict";
|
|
39448
|
+
|
|
39449
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
39450
|
+
exports.normalizeUrl = normalizeUrl;
|
|
39451
|
+
exports.isValidPublicUrl = isValidPublicUrl;
|
|
39452
|
+
// A DNS label: 1-63 chars, alphanumeric at both ends, hyphens only in between.
|
|
39453
|
+
// The optional group is what allows a 1-char label while still forbidding a
|
|
39454
|
+
// trailing hyphen, and {0,61} caps the label at 63 (1 + 61 + 1).
|
|
39455
|
+
var LABEL_REGEX = '[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?';
|
|
39456
|
+
// Same shape, but the TLD must begin with a letter. That also rejects every
|
|
39457
|
+
// IPv4 literal, since a dotted quad's final label is numeric.
|
|
39458
|
+
var TLD_REGEX = '[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?';
|
|
39459
|
+
// Two or more labels, 253 chars max overall. Safe against a lowercased,
|
|
39460
|
+
// punycoded hostname only -- run URL.parse first, never raw input.
|
|
39461
|
+
var HOSTNAME_REGEX = new RegExp("^(?=.{1,253}$)(?:".concat(LABEL_REGEX, "\\.)+").concat(TLD_REGEX, "$"));
|
|
39462
|
+
var IPV4 = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
|
|
39463
|
+
// IANA special-purpose IPv4 ranges: never valid as a public destination.
|
|
39464
|
+
// Ordered as in the registry; the CIDR sizes are the whole point, so the
|
|
39465
|
+
// /10, /12 and /15 entries are the ones worth having tests around.
|
|
39466
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
39467
|
+
var RESERVED_V4 = [
|
|
39468
|
+
['0.0.0.0', 8], // "this network"
|
|
39469
|
+
['10.0.0.0', 8], // private
|
|
39470
|
+
['100.64.0.0', 10], // carrier-grade NAT
|
|
39471
|
+
['127.0.0.0', 8], // loopback
|
|
39472
|
+
['169.254.0.0', 16], // link-local, incl. cloud metadata
|
|
39473
|
+
['172.16.0.0', 12], // private
|
|
39474
|
+
['192.0.0.0', 24], // IETF protocol assignments
|
|
39475
|
+
['192.0.2.0', 24], // TEST-NET-1
|
|
39476
|
+
['192.88.99.0', 24], // 6to4 relay anycast (deprecated)
|
|
39477
|
+
['192.168.0.0', 16], // private
|
|
39478
|
+
['198.18.0.0', 15], // benchmarking
|
|
39479
|
+
['198.51.100.0', 24], // TEST-NET-2
|
|
39480
|
+
['203.0.113.0', 24], // TEST-NET-3
|
|
39481
|
+
['224.0.0.0', 4], // multicast
|
|
39482
|
+
['240.0.0.0', 4] // reserved, incl. 255.255.255.255 broadcast
|
|
39483
|
+
];
|
|
39484
|
+
/* eslint-enable @typescript-eslint/no-magic-numbers */
|
|
39485
|
+
function normalizeUrl(value) {
|
|
39486
|
+
var _a, _b;
|
|
39487
|
+
return (_b = (_a = parseUrl(value)) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : value;
|
|
39488
|
+
}
|
|
39489
|
+
/**
|
|
39490
|
+
* NOTE: there is another `isUrl` validation missaligned with this one in bringg-frontend/libs/features/sendbird-chat/src/components/channel-conversation/components/message-content/utils.ts
|
|
39491
|
+
* Considering it's very different and will produce a lot of false-positves, I didn't align it here; still worth being recorded
|
|
39492
|
+
* Known gaps:
|
|
39493
|
+
* nonexistent TLD: 'http://example.invalid'
|
|
39494
|
+
* reserved TLD: 'http://foo.test'
|
|
39495
|
+
*/
|
|
39496
|
+
function isValidPublicUrl(value) {
|
|
39497
|
+
var url = parseUrl(value);
|
|
39498
|
+
if (!url) {
|
|
39499
|
+
return false;
|
|
39500
|
+
}
|
|
39501
|
+
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
|
|
39502
|
+
return false;
|
|
39503
|
+
}
|
|
39504
|
+
// credential-stuffing vector
|
|
39505
|
+
if (url.username || url.password) {
|
|
39506
|
+
return false;
|
|
39507
|
+
}
|
|
39508
|
+
if (IPV4.test(url.hostname)) {
|
|
39509
|
+
return isPublicIPv4(url.hostname);
|
|
39510
|
+
}
|
|
39511
|
+
return HOSTNAME_REGEX.test(url.hostname);
|
|
39512
|
+
}
|
|
39513
|
+
var IPV4_OCTET_MAX = 255;
|
|
39514
|
+
var IPV4_OCTET_RADIX = 256;
|
|
39515
|
+
var IPV4_BIT_WIDTH = 32;
|
|
39516
|
+
var IPV4_ALL_ONES = 0xffffffff;
|
|
39517
|
+
var RESERVED_V4_MASKED = RESERVED_V4.map(function (_a) {
|
|
39518
|
+
var base = _a[0], bits = _a[1];
|
|
39519
|
+
var mask = (IPV4_ALL_ONES << (IPV4_BIT_WIDTH - bits)) >>> 0;
|
|
39520
|
+
return [(toUint32(base) & mask) >>> 0, mask];
|
|
39521
|
+
});
|
|
39522
|
+
function parseUrl(value) {
|
|
39523
|
+
try {
|
|
39524
|
+
return new URL(value);
|
|
39525
|
+
}
|
|
39526
|
+
catch (_a) {
|
|
39527
|
+
return null;
|
|
39528
|
+
}
|
|
39529
|
+
}
|
|
39530
|
+
// Only ever called with a hostname URL.parse produced, so the dotted quad is
|
|
39531
|
+
// already canonical -- 0x7f.1, 2130706433 and 0177.0.0.1 all arrive as 127.0.0.1
|
|
39532
|
+
function isPublicIPv4(hostname) {
|
|
39533
|
+
var octets = hostname.split('.');
|
|
39534
|
+
if (octets.some(function (o) { return Number(o) > IPV4_OCTET_MAX; })) {
|
|
39535
|
+
return false;
|
|
39536
|
+
}
|
|
39537
|
+
var n = toUint32(hostname);
|
|
39538
|
+
return !RESERVED_V4_MASKED.some(function (_a) {
|
|
39539
|
+
var base = _a[0], mask = _a[1];
|
|
39540
|
+
return (n & mask) >>> 0 === base;
|
|
39541
|
+
});
|
|
39542
|
+
}
|
|
39543
|
+
function toUint32(quad) {
|
|
39544
|
+
return quad.split('.').reduce(function (acc, oct) { return acc * IPV4_OCTET_RADIX + Number(oct); }, 0);
|
|
39545
|
+
}
|
|
39546
|
+
//# sourceMappingURL=url_utils.js.map
|
|
39547
|
+
|
|
39548
|
+
/***/ }),
|
|
39549
|
+
|
|
39365
39550
|
/***/ 63127:
|
|
39366
39551
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
39367
39552
|
|