@unchainedshop/utils 4.3.3 → 4.4.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.
Files changed (130) hide show
  1. package/README.md +112 -2
  2. package/lib/build-obfuscated-fields-filter.d.ts +0 -1
  3. package/lib/build-obfuscated-fields-filter.js +2 -3
  4. package/lib/calculation.d.ts +0 -1
  5. package/lib/calculation.js +0 -1
  6. package/lib/ch/addressToString.d.ts +0 -1
  7. package/lib/ch/addressToString.js +0 -1
  8. package/lib/ch/index.d.ts +2 -3
  9. package/lib/ch/index.js +2 -4
  10. package/lib/ch/priceToString.d.ts +0 -1
  11. package/lib/ch/priceToString.js +0 -1
  12. package/lib/director/BaseAdapter.d.ts +1 -2
  13. package/lib/director/BaseAdapter.js +2 -3
  14. package/lib/director/BaseDirector.d.ts +1 -2
  15. package/lib/director/BaseDirector.js +0 -1
  16. package/lib/find-unused-slug.d.ts +0 -1
  17. package/lib/find-unused-slug.js +0 -1
  18. package/lib/generate-random-hash.d.ts +0 -1
  19. package/lib/generate-random-hash.js +0 -1
  20. package/lib/locale-helpers.d.ts +0 -1
  21. package/lib/locale-helpers.js +0 -1
  22. package/lib/object-invert.d.ts +0 -1
  23. package/lib/object-invert.js +0 -1
  24. package/lib/pipe-promises.d.ts +0 -1
  25. package/lib/pipe-promises.js +0 -1
  26. package/lib/sha1.d.ts +0 -1
  27. package/lib/sha1.js +0 -2
  28. package/lib/sha256.d.ts +0 -1
  29. package/lib/sha256.js +0 -2
  30. package/lib/slugify.d.ts +0 -1
  31. package/lib/slugify.js +5 -6
  32. package/lib/utils-index.d.ts +17 -17
  33. package/lib/utils-index.js +16 -18
  34. package/package.json +5 -5
  35. package/lib/build-obfuscated-fields-filter.d.ts.map +0 -1
  36. package/lib/build-obfuscated-fields-filter.js.map +0 -1
  37. package/lib/calculation.d.ts.map +0 -1
  38. package/lib/calculation.js.map +0 -1
  39. package/lib/ch/addressToString.d.ts.map +0 -1
  40. package/lib/ch/addressToString.js.map +0 -1
  41. package/lib/ch/index.d.ts.map +0 -1
  42. package/lib/ch/index.js.map +0 -1
  43. package/lib/ch/priceToString.d.ts.map +0 -1
  44. package/lib/ch/priceToString.js.map +0 -1
  45. package/lib/director/BaseAdapter.d.ts.map +0 -1
  46. package/lib/director/BaseAdapter.js.map +0 -1
  47. package/lib/director/BaseDirector.d.ts.map +0 -1
  48. package/lib/director/BaseDirector.js.map +0 -1
  49. package/lib/director/BaseDiscountAdapter.d.ts +0 -3
  50. package/lib/director/BaseDiscountAdapter.d.ts.map +0 -1
  51. package/lib/director/BaseDiscountAdapter.js +0 -48
  52. package/lib/director/BaseDiscountAdapter.js.map +0 -1
  53. package/lib/director/BaseDiscountDirector.d.ts +0 -3
  54. package/lib/director/BaseDiscountDirector.d.ts.map +0 -1
  55. package/lib/director/BaseDiscountDirector.js +0 -50
  56. package/lib/director/BaseDiscountDirector.js.map +0 -1
  57. package/lib/director/BasePricingAdapter.d.ts +0 -3
  58. package/lib/director/BasePricingAdapter.d.ts.map +0 -1
  59. package/lib/director/BasePricingAdapter.js +0 -25
  60. package/lib/director/BasePricingAdapter.js.map +0 -1
  61. package/lib/director/BasePricingDirector.d.ts +0 -3
  62. package/lib/director/BasePricingDirector.d.ts.map +0 -1
  63. package/lib/director/BasePricingDirector.js +0 -61
  64. package/lib/director/BasePricingDirector.js.map +0 -1
  65. package/lib/director/BasePricingSheet.d.ts +0 -3
  66. package/lib/director/BasePricingSheet.d.ts.map +0 -1
  67. package/lib/director/BasePricingSheet.js +0 -54
  68. package/lib/director/BasePricingSheet.js.map +0 -1
  69. package/lib/find-unused-slug.d.ts.map +0 -1
  70. package/lib/find-unused-slug.js.map +0 -1
  71. package/lib/generate-random-hash.d.ts.map +0 -1
  72. package/lib/generate-random-hash.js.map +0 -1
  73. package/lib/locale-helpers.d.ts.map +0 -1
  74. package/lib/locale-helpers.js.map +0 -1
  75. package/lib/object-invert.d.ts.map +0 -1
  76. package/lib/object-invert.js.map +0 -1
  77. package/lib/pipe-promises.d.ts.map +0 -1
  78. package/lib/pipe-promises.js.map +0 -1
  79. package/lib/random-value-hex.d.ts +0 -2
  80. package/lib/random-value-hex.d.ts.map +0 -1
  81. package/lib/random-value-hex.js +0 -8
  82. package/lib/random-value-hex.js.map +0 -1
  83. package/lib/schemas/AddressSchema.d.ts +0 -3
  84. package/lib/schemas/AddressSchema.d.ts.map +0 -1
  85. package/lib/schemas/AddressSchema.js +0 -13
  86. package/lib/schemas/AddressSchema.js.map +0 -1
  87. package/lib/schemas/ContactSchema.d.ts +0 -3
  88. package/lib/schemas/ContactSchema.d.ts.map +0 -1
  89. package/lib/schemas/ContactSchema.js +0 -6
  90. package/lib/schemas/ContactSchema.js.map +0 -1
  91. package/lib/schemas/UsersSchema.d.ts +0 -5
  92. package/lib/schemas/UsersSchema.d.ts.map +0 -1
  93. package/lib/schemas/UsersSchema.js +0 -52
  94. package/lib/schemas/UsersSchema.js.map +0 -1
  95. package/lib/schemas/commonSchemaFields.d.ts +0 -35
  96. package/lib/schemas/commonSchemaFields.d.ts.map +0 -1
  97. package/lib/schemas/commonSchemaFields.js +0 -28
  98. package/lib/schemas/commonSchemaFields.js.map +0 -1
  99. package/lib/schemas/index.d.ts +0 -43
  100. package/lib/schemas/index.d.ts.map +0 -1
  101. package/lib/schemas/index.js +0 -14
  102. package/lib/schemas/index.js.map +0 -1
  103. package/lib/sha1.d.ts.map +0 -1
  104. package/lib/sha1.js.map +0 -1
  105. package/lib/sha256.d.ts.map +0 -1
  106. package/lib/sha256.js.map +0 -1
  107. package/lib/slugify.d.ts.map +0 -1
  108. package/lib/slugify.js.map +0 -1
  109. package/lib/utils-index.d.ts.map +0 -1
  110. package/lib/utils-index.js.map +0 -1
  111. package/src/build-obfuscated-fields-filter.ts +0 -41
  112. package/src/calculation.test.ts +0 -171
  113. package/src/calculation.ts +0 -43
  114. package/src/ch/addressToString.ts +0 -25
  115. package/src/ch/index.ts +0 -3
  116. package/src/ch/priceToString.ts +0 -6
  117. package/src/director/BaseAdapter.ts +0 -25
  118. package/src/director/BaseDirector.ts +0 -40
  119. package/src/director/base-director.test.ts +0 -112
  120. package/src/find-unused-slug.ts +0 -39
  121. package/src/generate-random-hash.ts +0 -8
  122. package/src/locale-helpers.ts +0 -79
  123. package/src/object-invert.ts +0 -8
  124. package/src/pipe-promises.ts +0 -2
  125. package/src/sha1.ts +0 -6
  126. package/src/sha256.ts +0 -8
  127. package/src/slugify.ts +0 -10
  128. package/src/utils-index.test.ts +0 -58
  129. package/src/utils-index.ts +0 -45
  130. package/tsconfig.json +0 -10
package/README.md CHANGED
@@ -1,3 +1,113 @@
1
- # Utils (Unchained Engine)
1
+ [![npm version](https://img.shields.io/npm/v/@unchainedshop/utils.svg)](https://npmjs.com/package/@unchainedshop/utils)
2
+ [![License: EUPL-1.2](https://img.shields.io/badge/License-EUPL--1.2-blue.svg)](https://opensource.org/licenses/EUPL-1.2)
2
3
 
3
- This package acts as common helpers that can be used by core or extension modules of Unchained.
4
+ # @unchainedshop/utils
5
+
6
+ Common utility functions and base classes for the Unchained Engine.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @unchainedshop/utils
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```typescript
17
+ import { slugify, generateRandomHash, resolveBestSupported } from '@unchainedshop/utils';
18
+
19
+ // Generate URL-safe slugs
20
+ const slug = slugify('Hello World!'); // 'hello-world'
21
+
22
+ // Generate random hashes
23
+ const hash = generateRandomHash();
24
+
25
+ // Resolve best supported locale
26
+ const locale = resolveBestSupported('en-US,de-CH', 'CH', {
27
+ countries: [{ isoCode: 'CH' }],
28
+ languages: [{ isoCode: 'de' }, { isoCode: 'en' }],
29
+ });
30
+ ```
31
+
32
+ ## API Overview
33
+
34
+ ### String Utilities
35
+
36
+ | Export | Description |
37
+ |--------|-------------|
38
+ | `slugify` | Convert string to URL-safe slug |
39
+ | `findUnusedSlug` | Find an unused slug by appending numbers |
40
+ | `generateRandomHash` | Generate a random hash string |
41
+ | `sha256` | Compute SHA-256 hash of a string |
42
+ | `sha1` | Compute SHA-1 hash of a string |
43
+
44
+ ### Locale Helpers
45
+
46
+ | Export | Description |
47
+ |--------|-------------|
48
+ | `systemLocale` | Default system locale from environment |
49
+ | `resolveBestSupported` | Resolve best supported locale from Accept-Language |
50
+ | `resolveBestCurrency` | Resolve best currency from available options |
51
+ | `determineFallbackLocale` | Determine fallback locale from countries/languages |
52
+
53
+ ### Calculation Utilities
54
+
55
+ Available under the `calculation` namespace:
56
+
57
+ | Export | Description |
58
+ |--------|-------------|
59
+ | `roundToNext` | Round value up to next precision step |
60
+ | `calculateAmountToSplit` | Calculate amount to split based on rate/fixed |
61
+ | `applyRate` | Apply rate or fixed amount to a value |
62
+ | `getTaxAmount` | Calculate tax amount from total and rate |
63
+ | `resolveAmountAndTax` | Resolve share amount and tax from ratio |
64
+ | `applyDiscountToMultipleShares` | Apply discount across multiple shares |
65
+
66
+ ### Object Utilities
67
+
68
+ | Export | Description |
69
+ |--------|-------------|
70
+ | `objectInvert` | Invert object keys and values |
71
+ | `buildObfuscatedFieldsFilter` | Build filter for obfuscating sensitive fields |
72
+
73
+ ### Director/Adapter Base Classes
74
+
75
+ | Export | Description |
76
+ |--------|-------------|
77
+ | `BaseAdapter` | Base class for all adapters with logging support |
78
+ | `BaseDirector` | Factory for creating adapter directors |
79
+ | `IBaseAdapter` | Interface for adapter implementations |
80
+ | `IBaseDirector` | Interface for director implementations |
81
+
82
+ ### Swiss-specific Helpers
83
+
84
+ Available under the `ch` namespace:
85
+
86
+ | Export | Description |
87
+ |--------|-------------|
88
+ | `addressToString` | Format Swiss address as string |
89
+ | `priceToString` | Format price for Swiss locale |
90
+
91
+ ### Types
92
+
93
+ | Export | Description |
94
+ |--------|-------------|
95
+ | `SortDirection` | Enum-like object for ASC/DESC sorting |
96
+ | `SortOption` | Interface for sort options |
97
+ | `Price` | Interface for price with amount and currency |
98
+ | `PricingCalculation` | Interface for pricing calculations |
99
+ | `DateFilterInput` | Interface for date range filtering |
100
+ | `Tree<T>` | Type for tree data structures |
101
+ | `NodeOrTree<T>` | Type for tree nodes |
102
+
103
+ ## Environment Variables
104
+
105
+ | Variable | Default | Description |
106
+ |----------|---------|-------------|
107
+ | `UNCHAINED_LANG` | `de` | Default language code |
108
+ | `UNCHAINED_COUNTRY` | `CH` | Default country code |
109
+ | `UNCHAINED_CURRENCY` | `CHF` | Default currency code |
110
+
111
+ ## License
112
+
113
+ EUPL-1.2
@@ -1,3 +1,2 @@
1
1
  declare const buildObfuscatedFieldsFilter: (blacklistedVariables?: string[]) => (data: any) => any;
2
2
  export default buildObfuscatedFieldsFilter;
3
- //# sourceMappingURL=build-obfuscated-fields-filter.d.ts.map
@@ -26,11 +26,10 @@ const buildObfuscatedFieldsFilter = (blacklistedVariables = []) => {
26
26
  temp[key] = obfuscateSensitiveFields(temp[key]);
27
27
  }
28
28
  });
29
- return temp; // Return the modified copy
29
+ return temp;
30
30
  }
31
- return data; // Return unchanged data for non-objects
31
+ return data;
32
32
  };
33
33
  return obfuscateSensitiveFields;
34
34
  };
35
35
  export default buildObfuscatedFieldsFilter;
36
- //# sourceMappingURL=build-obfuscated-fields-filter.js.map
@@ -13,4 +13,3 @@ export declare const resolveAmountAndTax: ({ ratio, taxDivisor }: {
13
13
  taxDivisor?: number;
14
14
  }, amount: number) => number[];
15
15
  export declare const applyDiscountToMultipleShares: (shares: any, amount: any) => any;
16
- //# sourceMappingURL=calculation.d.ts.map
@@ -24,4 +24,3 @@ export const applyDiscountToMultipleShares = (shares, amount) => {
24
24
  return [currentDiscountAmount + shareAmount, currentTaxAmount + shareTaxAmount];
25
25
  }, [0, 0]);
26
26
  };
27
- //# sourceMappingURL=calculation.js.map
@@ -9,4 +9,3 @@ export declare const addressToString: (address?: {
9
9
  postalCode?: string;
10
10
  regionCode?: string;
11
11
  }) => string;
12
- //# sourceMappingURL=addressToString.d.ts.map
@@ -13,4 +13,3 @@ export const addressToString = (address) => {
13
13
  .filter(Boolean)
14
14
  .join('\n');
15
15
  };
16
- //# sourceMappingURL=addressToString.js.map
package/lib/ch/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './addressToString.js';
2
- export * from './priceToString.js';
3
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './addressToString.ts';
2
+ export * from './priceToString.ts';
package/lib/ch/index.js CHANGED
@@ -1,4 +1,2 @@
1
- // This file contains helpers specifically for Swiss projects. It is not intended to be used in other projects.
2
- export * from './addressToString.js';
3
- export * from './priceToString.js';
4
- //# sourceMappingURL=index.js.map
1
+ export * from "./addressToString.js";
2
+ export * from "./priceToString.js";
@@ -3,4 +3,3 @@ export declare const priceToString: ({ amount, currencyCode }: {
3
3
  currencyCode: string;
4
4
  }) => string;
5
5
  export default priceToString;
6
- //# sourceMappingURL=priceToString.d.ts.map
@@ -3,4 +3,3 @@ export const priceToString = ({ amount, currencyCode }) => {
3
3
  return `${currencyCode} ${fixedPrice}`;
4
4
  };
5
5
  export default priceToString;
6
- //# sourceMappingURL=priceToString.js.map
@@ -1,4 +1,4 @@
1
- import { LogLevel } from '@unchainedshop/logger';
1
+ import { type LogLevel } from '@unchainedshop/logger';
2
2
  export interface IBaseAdapter {
3
3
  key: string;
4
4
  label: string;
@@ -10,4 +10,3 @@ export interface IBaseAdapter {
10
10
  }) => void;
11
11
  }
12
12
  export declare const BaseAdapter: Omit<IBaseAdapter, 'key' | 'label' | 'version'>;
13
- //# sourceMappingURL=BaseAdapter.d.ts.map
@@ -1,10 +1,9 @@
1
- import { defaultLogger, LogLevel } from '@unchainedshop/logger';
1
+ import { defaultLogger, LogLevel as LogLevelEnum } from '@unchainedshop/logger';
2
2
  export const BaseAdapter = {
3
- log(message, { level = LogLevel.Debug, ...options } = {}) {
3
+ log(message, { level = LogLevelEnum.Debug, ...options } = {}) {
4
4
  defaultLogger[level](message, options);
5
5
  },
6
6
  asString() {
7
7
  return `${this.key}@${this.version}`;
8
8
  },
9
9
  };
10
- //# sourceMappingURL=BaseAdapter.js.map
@@ -1,4 +1,4 @@
1
- import { IBaseAdapter } from './BaseAdapter.js';
1
+ import type { IBaseAdapter } from './BaseAdapter.ts';
2
2
  export interface IBaseDirector<Adapter extends IBaseAdapter> {
3
3
  getAdapters: (options?: {
4
4
  adapterFilter?: (adapter: Adapter) => boolean;
@@ -11,4 +11,3 @@ export declare const BaseDirector: <AdapterType extends IBaseAdapter>(directorNa
11
11
  adapterSortKey?: string;
12
12
  adapterKeyField?: string;
13
13
  }) => IBaseDirector<AdapterType>;
14
- //# sourceMappingURL=BaseDirector.d.ts.map
@@ -19,4 +19,3 @@ export const BaseDirector = (directorName, options) => {
19
19
  },
20
20
  };
21
21
  };
22
- //# sourceMappingURL=BaseDirector.js.map
@@ -6,4 +6,3 @@ declare const _default: (checkSlugIsUniqueFn: (slug: string) => Promise<boolean>
6
6
  newSlug?: string;
7
7
  }) => Promise<string>);
8
8
  export default _default;
9
- //# sourceMappingURL=find-unused-slug.d.ts.map
@@ -23,4 +23,3 @@ export default (checkSlugIsUniqueFn, { slugify }) => {
23
23
  };
24
24
  return findUnusedSlug;
25
25
  };
26
- //# sourceMappingURL=find-unused-slug.js.map
@@ -1,3 +1,2 @@
1
1
  declare const _default: () => string;
2
2
  export default _default;
3
- //# sourceMappingURL=generate-random-hash.d.ts.map
@@ -4,4 +4,3 @@ export default () => {
4
4
  const randomNumber = Math.floor(Math.random() * (999999999 - 1)) + 1;
5
5
  return hashids.encode(randomNumber);
6
6
  };
7
- //# sourceMappingURL=generate-random-hash.js.map
@@ -15,4 +15,3 @@ export declare const resolveBestSupported: (acceptLanguage: string, acceptCountr
15
15
  export declare const resolveBestCurrency: (currencyCode: string | null, currencies: {
16
16
  isoCode: string;
17
17
  }[]) => string;
18
- //# sourceMappingURL=locale-helpers.d.ts.map
@@ -48,4 +48,3 @@ export const resolveBestCurrency = (currencyCode, currencies) => {
48
48
  return (currencies.find((currency) => currency.isoCode === UNCHAINED_CURRENCY)?.isoCode ||
49
49
  currencies[0]?.isoCode);
50
50
  };
51
- //# sourceMappingURL=locale-helpers.js.map
@@ -1,3 +1,2 @@
1
1
  declare const invertMapObject: (theMapObject: Record<string, string>) => Record<string, string>;
2
2
  export default invertMapObject;
3
- //# sourceMappingURL=object-invert.d.ts.map
@@ -4,4 +4,3 @@ const invertMapObject = (theMapObject) => Object.keys(theMapObject).reduce((inve
4
4
  return newObj;
5
5
  }, {});
6
6
  export default invertMapObject;
7
- //# sourceMappingURL=object-invert.js.map
@@ -1,3 +1,2 @@
1
1
  declare const _default: (fns: any) => (initialValue: any) => any;
2
2
  export default _default;
3
- //# sourceMappingURL=pipe-promises.d.ts.map
@@ -1,2 +1 @@
1
1
  export default (fns) => (initialValue) => fns.reduce((sum, fn) => Promise.resolve(sum).then(fn), initialValue);
2
- //# sourceMappingURL=pipe-promises.js.map
package/lib/sha1.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export default function sha1(message: any): Promise<Uint8Array<ArrayBuffer>>;
2
- //# sourceMappingURL=sha1.d.ts.map
package/lib/sha1.js CHANGED
@@ -1,7 +1,5 @@
1
1
  export default async function sha1(message) {
2
2
  const bytes = new TextEncoder().encode(message);
3
3
  const hashBuffer = await crypto.subtle.digest('SHA-1', bytes);
4
- // Return Uint8Array instead of Buffer
5
4
  return new Uint8Array(hashBuffer);
6
5
  }
7
- //# sourceMappingURL=sha1.js.map
package/lib/sha256.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export default function sha256(message: any): Promise<string>;
2
- //# sourceMappingURL=sha256.d.ts.map
package/lib/sha256.js CHANGED
@@ -1,9 +1,7 @@
1
1
  export default async function sha256(message) {
2
2
  const bytes = new TextEncoder().encode(message);
3
3
  const hashBuffer = await crypto.subtle.digest('SHA-256', bytes);
4
- // Convert ArrayBuffer to hex string without using Buffer
5
4
  return Array.from(new Uint8Array(hashBuffer))
6
5
  .map((b) => b.toString(16).padStart(2, '0'))
7
6
  .join('');
8
7
  }
9
- //# sourceMappingURL=sha256.js.map
package/lib/slugify.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export default function slugify(text: string): string;
2
- //# sourceMappingURL=slugify.d.ts.map
package/lib/slugify.js CHANGED
@@ -2,10 +2,9 @@ export default function slugify(text) {
2
2
  return text
3
3
  .toString()
4
4
  .toLowerCase()
5
- .replace(/\s+/g, '-') // Replace spaces with -
6
- .replace(/[^\w-]+/g, '') // Remove all non-word chars
7
- .replace(/--+/g, '-') // Replace multiple - with single -
8
- .replace(/^-+/, '') // Trim - from start of text
9
- .replace(/-+$/, ''); // Trim - from end of text
5
+ .replace(/\s+/g, '-')
6
+ .replace(/[^\w-]+/g, '')
7
+ .replace(/--+/g, '-')
8
+ .replace(/^-+/, '')
9
+ .replace(/-+$/, '');
10
10
  }
11
- //# sourceMappingURL=slugify.js.map
@@ -1,17 +1,18 @@
1
- export * as calculation from './calculation.js';
2
- export * as ch from './ch/index.js';
3
- export * from './locale-helpers.js';
4
- export { default as objectInvert } from './object-invert.js';
5
- export { default as findUnusedSlug } from './find-unused-slug.js';
6
- export { default as slugify } from './slugify.js';
7
- export { default as generateRandomHash } from './generate-random-hash.js';
8
- export { default as buildObfuscatedFieldsFilter } from './build-obfuscated-fields-filter.js';
9
- export { default as sha256 } from './sha256.js';
10
- export { default as sha1 } from './sha1.js';
11
- export declare enum SortDirection {
12
- ASC = "ASC",
13
- DESC = "DESC"
14
- }
1
+ export * as calculation from './calculation.ts';
2
+ export * as ch from './ch/index.ts';
3
+ export * from './locale-helpers.ts';
4
+ export { default as objectInvert } from './object-invert.ts';
5
+ export { default as findUnusedSlug } from './find-unused-slug.ts';
6
+ export { default as slugify } from './slugify.ts';
7
+ export { default as generateRandomHash } from './generate-random-hash.ts';
8
+ export { default as buildObfuscatedFieldsFilter } from './build-obfuscated-fields-filter.ts';
9
+ export { default as sha256 } from './sha256.ts';
10
+ export { default as sha1 } from './sha1.ts';
11
+ export declare const SortDirection: {
12
+ readonly ASC: "ASC";
13
+ readonly DESC: "DESC";
14
+ };
15
+ export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];
15
16
  export interface SortOption {
16
17
  key: string;
17
18
  value: SortDirection;
@@ -32,6 +33,5 @@ export interface DateFilterInput {
32
33
  start?: string;
33
34
  end?: string;
34
35
  }
35
- export * from './director/BaseAdapter.js';
36
- export * from './director/BaseDirector.js';
37
- //# sourceMappingURL=utils-index.d.ts.map
36
+ export * from './director/BaseAdapter.ts';
37
+ export * from './director/BaseDirector.ts';
@@ -1,18 +1,16 @@
1
- export * as calculation from './calculation.js';
2
- export * as ch from './ch/index.js';
3
- export * from './locale-helpers.js';
4
- export { default as objectInvert } from './object-invert.js';
5
- export { default as findUnusedSlug } from './find-unused-slug.js';
6
- export { default as slugify } from './slugify.js';
7
- export { default as generateRandomHash } from './generate-random-hash.js';
8
- export { default as buildObfuscatedFieldsFilter } from './build-obfuscated-fields-filter.js';
9
- export { default as sha256 } from './sha256.js';
10
- export { default as sha1 } from './sha1.js';
11
- export var SortDirection;
12
- (function (SortDirection) {
13
- SortDirection["ASC"] = "ASC";
14
- SortDirection["DESC"] = "DESC";
15
- })(SortDirection || (SortDirection = {}));
16
- export * from './director/BaseAdapter.js';
17
- export * from './director/BaseDirector.js';
18
- //# sourceMappingURL=utils-index.js.map
1
+ export * as calculation from "./calculation.js";
2
+ export * as ch from "./ch/index.js";
3
+ export * from "./locale-helpers.js";
4
+ export { default as objectInvert } from "./object-invert.js";
5
+ export { default as findUnusedSlug } from "./find-unused-slug.js";
6
+ export { default as slugify } from "./slugify.js";
7
+ export { default as generateRandomHash } from "./generate-random-hash.js";
8
+ export { default as buildObfuscatedFieldsFilter } from "./build-obfuscated-fields-filter.js";
9
+ export { default as sha256 } from "./sha256.js";
10
+ export { default as sha1 } from "./sha1.js";
11
+ export const SortDirection = {
12
+ ASC: 'ASC',
13
+ DESC: 'DESC',
14
+ };
15
+ export * from "./director/BaseAdapter.js";
16
+ export * from "./director/BaseDirector.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/utils",
3
- "version": "4.3.3",
3
+ "version": "4.4.0",
4
4
  "main": "lib/utils-index.js",
5
5
  "types": "lib/utils-index.d.ts",
6
6
  "type": "module",
@@ -9,8 +9,8 @@
9
9
  "build": "tsc -b",
10
10
  "prepublishOnly": "npm run clean && npm run build",
11
11
  "watch": "tsc -w",
12
- "test": "tsx --test",
13
- "test:watch": "tsx --test --watch"
12
+ "test": "node --test",
13
+ "test:watch": "node --test --watch"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -27,12 +27,12 @@
27
27
  },
28
28
  "homepage": "https://github.com/unchainedshop/unchained#readme",
29
29
  "dependencies": {
30
- "@unchainedshop/logger": "^4.3.0",
30
+ "@unchainedshop/logger": "^4.4.0",
31
31
  "hashids": "^2.3.0",
32
32
  "resolve-accept-language": "^3.1.11"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/node": "^24.0.13",
35
+ "@types/node": "^25.0.0",
36
36
  "typescript": "^5.8.3"
37
37
  }
38
38
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-obfuscated-fields-filter.d.ts","sourceRoot":"","sources":["../src/build-obfuscated-fields-filter.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,2BAA2B,GAAI,uBAAsB,MAAM,EAAO,uBA2BvE,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-obfuscated-fields-filter.js","sourceRoot":"","sources":["../src/build-obfuscated-fields-filter.ts"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,GAAG;IAC9B,UAAU;IACV,aAAa;IACb,aAAa;IACb,eAAe;IACf,QAAQ;IACR,WAAW;IACX,aAAa;IACb,OAAO;CACR,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,uBAAiC,EAAE,EAAE,EAAE;IAC1E,MAAM,eAAe,GAAG,oBAAoB,IAAI,uBAAuB,CAAC;IAExE,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,EAAE;QACx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names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,UAAU;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,KAAG,MAcH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"addressToString.js","sourceRoot":"","sources":["../../src/ch/addressToString.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAU/B,EAAU,EAAE;IACX,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,OAAO;QACL,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/D,OAAO,CAAC,OAAO;QACf,OAAO,CAAC,WAAW;QACnB,OAAO,CAAC,YAAY;QACpB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC5D,OAAO,CAAC,UAAU;QAClB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;KAC/C;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ch/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ch/index.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"priceToString.d.ts","sourceRoot":"","sources":["../../src/ch/priceToString.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,0BAA0B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,WAG/F,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"priceToString.js","sourceRoot":"","sources":["../../src/ch/priceToString.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAA4C,EAAE,EAAE;IAClG,MAAM,UAAU,GAAG,MAAM,GAAG,GAAG,CAAC;IAChC,OAAO,GAAG,YAAY,IAAI,UAAU,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseAdapter.d.ts","sourceRoot":"","sources":["../../src/director/BaseAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,GAAG,EAAE,CACH,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,QAAQ,CAAC;QACjB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;KAClB,KACE,IAAI,CAAC;CACX;AAED,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CAQvE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseAdapter.js","sourceRoot":"","sources":["../../src/director/BaseAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAgBhE,MAAM,CAAC,MAAM,WAAW,GAAoD;IAC1E,GAAG,CAAC,OAAe,EAAE,EAAE,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE;QAC9D,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;IACvC,CAAC;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseDirector.d.ts","sourceRoot":"","sources":["../../src/director/BaseDirector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,WAAW,aAAa,CAAC,OAAO,SAAS,YAAY;IACzD,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;KAAE,KAAK,OAAO,EAAE,CAAC;IACxF,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC7C;AAED,eAAO,MAAM,YAAY,GAAI,WAAW,SAAS,YAAY,EAC3D,cAAc,MAAM,EACpB,UAAU;IACR,cAAc,CAAC,EAAE,MAAM,CA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ainedshop/types/discount.js';
2
- export declare const BaseDiscountAdapter: Omit<IDiscountAdapter<unknown>, 'key' | 'label' | 'version'>;
3
- //# sourceMappingURL=BaseDiscountAdapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseDiscountAdapter.d.ts","sourceRoot":"","sources":["../../src/director/BaseDiscountAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,eAAO,MAAM,mBAAmB,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CAqD5F,CAAC"}
@@ -1,48 +0,0 @@
1
- import { log, LogLevel } from '@unchainedshop/logger';
2
- export const BaseDiscountAdapter = {
3
- orderIndex: 0,
4
- isManualAdditionAllowed: async () => {
5
- return false;
6
- },
7
- // return true if a discount is allowed to get removed manually by a user
8
- isManualRemovalAllowed: async () => {
9
- return false;
10
- },
11
- actions: async () => ({
12
- // return true if a discount is valid to be part of the order
13
- // without input of a user. that could be a time based global discount
14
- // like a 10% discount day
15
- // if you return false, this discount will
16
- // get removed from the order before any price calculation
17
- // takes place.
18
- // eslint-disable-next-line
19
- isValidForSystemTriggering: async () => {
20
- return false;
21
- },
22
- // return an arbitrary JSON serializable object with reservation data
23
- // this method is called when a discount is added through a manual code and let's
24
- // you manually deduct expendable discounts (coupon balances for ex.) before checkout
25
- reserve: async () => {
26
- return {};
27
- },
28
- // return void, allows you to free up any reservations in backend systems
29
- release: async () => {
30
- return null;
31
- },
32
- // return true if a discount is valid to be part of the order.
33
- // if you return false, this discount will
34
- // get removed from the order before any price calculation
35
- // takes place.
36
- isValidForCodeTriggering: async () => {
37
- return false;
38
- },
39
- // returns the appropriate discount context for a calculation adapter
40
- discountForPricingAdapterKey() {
41
- return null;
42
- },
43
- }),
44
- log(message, { level = LogLevel.Debug, ...options } = {}) {
45
- return log(message, { level, ...options });
46
- },
47
- };
48
- //# sourceMappingURL=BaseDiscountAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseDiscountAdapter.js","sourceRoot":"","sources":["../../src/director/BaseDiscountAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,MAAM,CAAC,MAAM,mBAAmB,GAAiE;IAC/F,UAAU,EAAE,CAAC;IAEb,uBAAuB,EAAE,KAAK,IAAI,EAAE;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yEAAyE;IACzE,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACpB,6DAA6D;QAC7D,sEAAsE;QACtE,0BAA0B;QAC1B,0CAA0C;QAC1C,0DAA0D;QAC1D,eAAe;QACf,2BAA2B;QAC3B,0BAA0B,EAAE,KAAK,IAAI,EAAE;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,qEAAqE;QACrE,iFAAiF;QACjF,qFAAqF;QACrF,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,yEAAyE;QACzE,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,8DAA8D;QAC9D,0CAA0C;QAC1C,0DAA0D;QAC1D,eAAe;QACf,wBAAwB,EAAE,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,qEAAqE;QACrE,4BAA4B;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;IAEF,GAAG,CAAC,OAAe,EAAE,EAAE,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE;QAC9D,OAAO,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import { IDiscountDirector } from '@unchainedshop/types/discount.js';
2
- export declare const BaseDiscountDirector: <DiscountConfigurationType>(directorName: string) => IDiscountDirector<DiscountConfigurationType>;
3
- //# sourceMappingURL=BaseDiscountDirector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseDiscountDirector.d.ts","sourceRoot":"","sources":["../../src/director/BaseDiscountDirector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIvF,eAAO,MAAM,oBAAoB,GAAI,yBAAyB,gBAC9C,MAAM,KACnB,iBAAiB,CAAC,yBAAyB,CAyD7C,CAAC"}