@cellaware/utils 5.4.6 → 5.4.7

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.
@@ -3,3 +3,11 @@ export declare function chatwmsGetClientId(customer: string, warehouse: string):
3
3
  export declare function chatwmsGetWarehouseFromClientId(clientId: string, customer: string): string;
4
4
  export declare function chatwmsGetOrganizationFromWarehouse(warehouse: string): string | undefined;
5
5
  export declare function chatwmsGetOrganizationFromClientId(clientId: string, customer: string): string | undefined;
6
+ export declare function chatwmsExtractWarehouseAndOrganizationFromWarehouse(warehouse: string): {
7
+ warehouse: string;
8
+ organization: string | undefined;
9
+ };
10
+ export declare function chatwmsExtractWarehouseAndOrganizationFromClientId(clientId: string, customer: string): {
11
+ warehouse: string;
12
+ organization: string | undefined;
13
+ };
@@ -22,3 +22,21 @@ export function chatwmsGetOrganizationFromWarehouse(warehouse) {
22
22
  export function chatwmsGetOrganizationFromClientId(clientId, customer) {
23
23
  return chatwmsGetOrganizationFromWarehouse(chatwmsGetWarehouseFromClientId(clientId, customer));
24
24
  }
25
+ export function chatwmsExtractWarehouseAndOrganizationFromWarehouse(warehouse) {
26
+ const organization = chatwmsGetOrganizationFromWarehouse(warehouse);
27
+ if (!!organization) {
28
+ return {
29
+ warehouse: warehouse.substring(warehouse.lastIndexOf('_') + 1),
30
+ organization
31
+ };
32
+ }
33
+ else {
34
+ return {
35
+ warehouse,
36
+ organization: undefined
37
+ };
38
+ }
39
+ }
40
+ export function chatwmsExtractWarehouseAndOrganizationFromClientId(clientId, customer) {
41
+ return chatwmsExtractWarehouseAndOrganizationFromWarehouse(chatwmsGetWarehouseFromClientId(clientId, customer));
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "5.4.6",
3
+ "version": "5.4.7",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",