@peektravel/app-utilities 0.2.7 → 0.2.9
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1049,8 +1049,6 @@ interface AssignedResource {
|
|
|
1049
1049
|
category: string;
|
|
1050
1050
|
/** Allocated quantity. */
|
|
1051
1051
|
quantity: number;
|
|
1052
|
-
/** Allocation status (e.g. `"ACTIVE"`). */
|
|
1053
|
-
status: string;
|
|
1054
1052
|
/** Backing account user id, or null. */
|
|
1055
1053
|
accountUserId: string | null;
|
|
1056
1054
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1049,8 +1049,6 @@ interface AssignedResource {
|
|
|
1049
1049
|
category: string;
|
|
1050
1050
|
/** Allocated quantity. */
|
|
1051
1051
|
quantity: number;
|
|
1052
|
-
/** Allocation status (e.g. `"ACTIVE"`). */
|
|
1053
|
-
status: string;
|
|
1054
1052
|
/** Backing account user id, or null. */
|
|
1055
1053
|
accountUserId: string | null;
|
|
1056
1054
|
}
|
package/dist/index.js
CHANGED
|
@@ -2333,18 +2333,18 @@ function fromTimeslotNode(node, productId) {
|
|
|
2333
2333
|
assignedResources: mapAssignedResources(node.inheritedResourceAllocations)
|
|
2334
2334
|
};
|
|
2335
2335
|
}
|
|
2336
|
+
var ACTIVE_ALLOCATION_STATUS = "ACTIVE";
|
|
2336
2337
|
function mapAssignedResources(allocations) {
|
|
2337
2338
|
if (!Array.isArray(allocations) || allocations.length === 0) {
|
|
2338
2339
|
return [];
|
|
2339
2340
|
}
|
|
2340
|
-
return allocations.map((allocation) => {
|
|
2341
|
+
return allocations.filter((allocation) => allocation.status === ACTIVE_ALLOCATION_STATUS).map((allocation) => {
|
|
2341
2342
|
const pool = allocation.resourcePool;
|
|
2342
2343
|
return {
|
|
2343
2344
|
name: pool?.name || "",
|
|
2344
2345
|
capacity: pool?.capacity ?? 0,
|
|
2345
2346
|
category: pool?.category || "",
|
|
2346
2347
|
quantity: allocation.quantity ?? 0,
|
|
2347
|
-
status: allocation.status || "",
|
|
2348
2348
|
accountUserId: pool?.accountUser?.id ?? null
|
|
2349
2349
|
};
|
|
2350
2350
|
});
|