@cellaware/utils 5.4.7 → 5.4.8

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.
@@ -1,6 +1,7 @@
1
1
  export declare const CHATWMS_GENERIC_CLIENT_ID = "chatwms";
2
2
  export declare function chatwmsGetClientId(customer: string, warehouse: string): string;
3
3
  export declare function chatwmsGetWarehouseFromClientId(clientId: string, customer: string): string;
4
+ export declare function chatwmsGetWarehouse(warehouse: string, organization?: string): string;
4
5
  export declare function chatwmsGetOrganizationFromWarehouse(warehouse: string): string | undefined;
5
6
  export declare function chatwmsGetOrganizationFromClientId(clientId: string, customer: string): string | undefined;
6
7
  export declare function chatwmsExtractWarehouseAndOrganizationFromWarehouse(warehouse: string): {
@@ -6,6 +6,9 @@ export function chatwmsGetWarehouseFromClientId(clientId, customer) {
6
6
  const prefix = `${customer}_`;
7
7
  return clientId.substring(clientId.indexOf(prefix) + prefix.length);
8
8
  }
9
+ export function chatwmsGetWarehouse(warehouse, organization) {
10
+ return !!organization ? `${organization}_${warehouse}` : warehouse;
11
+ }
9
12
  export function chatwmsGetOrganizationFromWarehouse(warehouse) {
10
13
  const lastIdx = warehouse.lastIndexOf('_');
11
14
  if (lastIdx === -1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "5.4.7",
3
+ "version": "5.4.8",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",