@unchainedshop/utils 1.1.7 → 1.1.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/lib/db/build-db-indexes.d.ts +0 -1
- package/lib/db/generate-db-filter-by-id.d.ts +0 -1
- package/lib/db/generate-db-mutations.d.ts +3 -5
- package/lib/director/BaseDirector.d.ts +0 -1
- package/lib/director/BaseDiscountDirector.d.ts +0 -1
- package/lib/director/BasePricingAdapter.d.ts +0 -1
- package/lib/director/BasePricingDirector.d.ts +0 -1
- package/lib/director/BasePricingSheet.d.ts +0 -1
- package/lib/find-preserving-ids.d.ts +0 -1
- package/lib/generate-random-hash.d.ts +1 -1
- package/lib/generate-random-hash.js +1 -1
- package/lib/generate-random-hash.js.map +1 -1
- package/lib/locale-helpers.d.ts +3 -3
- package/lib/locale-helpers.js +2 -1
- package/lib/locale-helpers.js.map +1 -1
- package/package.json +4 -4
- package/src/{generate-random-hash.js → generate-random-hash.ts} +1 -1
- package/src/locale-helpers.js +3 -1
- package/tsconfig.build.json +12 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const generateDbMutations: <T extends
|
|
3
|
-
_id?: _ID;
|
|
4
|
-
}>(collection: Collection<T>, schema: SimpleSchema, options?: {
|
|
1
|
+
import { ModuleMutations, ModuleCreateMutation } from '@unchainedshop/types/common';
|
|
2
|
+
export declare const generateDbMutations: <T extends unknown>(collection: Collection<T>, schema: SimpleSchema, options?: {
|
|
5
3
|
hasCreateOnly?: boolean;
|
|
6
4
|
permanentlyDeleteByDefault?: boolean;
|
|
7
|
-
}) =>
|
|
5
|
+
}) => any;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import { BasePricingAdapterContext, IPricingSheet, IPricingAdapter, PricingCalculation } from '@unchainedshop/types/pricing';
|
|
2
1
|
export declare const BasePricingAdapter: <Context extends BasePricingAdapterContext, Calculation extends PricingCalculation>() => IPricingAdapter<Context, Calculation, IPricingSheet<Calculation>>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import { BasePricingAdapterContext, BasePricingContext, IPricingDirector, IPricingAdapter, IPricingSheet, PricingCalculation } from '@unchainedshop/types/pricing';
|
|
2
1
|
export declare const BasePricingDirector: <DirectorContext extends BasePricingContext, AdapterContext extends BasePricingAdapterContext, Calculation extends PricingCalculation, PricingAdapter extends IPricingAdapter<AdapterContext, Calculation, IPricingSheet<Calculation>>>(directorName: string) => IPricingDirector<DirectorContext, Calculation, AdapterContext, IPricingSheet<Calculation>, PricingAdapter>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: () => string;
|
|
2
2
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-random-hash.js","sourceRoot":"","sources":["../src/generate-random-hash.
|
|
1
|
+
{"version":3,"file":"generate-random-hash.js","sourceRoot":"","sources":["../src/generate-random-hash.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,sCAAsC,CAAC,CAAC;AAEpF,eAAe,GAAG,EAAE;IAClB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrE,OAAO,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC"}
|
package/lib/locale-helpers.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const systemLocale: Locale;
|
|
2
|
-
export function resolveBestSupported(acceptLanguage: any, supportedLocales: any): Locale;
|
|
1
|
+
export const systemLocale: localePkg.Locale;
|
|
2
|
+
export function resolveBestSupported(acceptLanguage: any, supportedLocales: any): localePkg.Locale;
|
|
3
3
|
export function resolveBestCountry(localeCountry: any, shopCountry: any, countries: any): any;
|
|
4
4
|
export function resolveUserRemoteAddress(req: any): {
|
|
5
5
|
remoteAddress: any;
|
|
6
6
|
remotePort: any;
|
|
7
7
|
};
|
|
8
|
-
import
|
|
8
|
+
import localePkg from "locale";
|
package/lib/locale-helpers.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import localePkg from 'locale';
|
|
2
|
+
const { Locales, Locale } = localePkg;
|
|
2
3
|
const { UNCHAINED_LANG = 'de', UNCHAINED_COUNTRY = 'CH' } = process.env;
|
|
3
4
|
export const systemLocale = new Locale(`${UNCHAINED_LANG}-${UNCHAINED_COUNTRY}`);
|
|
4
5
|
export const resolveBestSupported = (acceptLanguage, supportedLocales) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale-helpers.js","sourceRoot":"","sources":["../src/locale-helpers.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"locale-helpers.js","sourceRoot":"","sources":["../src/locale-helpers.js"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,QAAQ,CAAC;AAE/B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;AAEtC,MAAM,EAAE,cAAc,GAAG,IAAI,EAAE,iBAAiB,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAExE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,GAAG,cAAc,IAAI,iBAAiB,EAAE,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,EAAE;IACvE,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACvD,IAAI,CAAC,UAAU;QAAE,OAAO,YAAY,C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
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@unchainedshop/logger": "^1.1.
|
|
28
|
+
"@unchainedshop/logger": "^1.1.9",
|
|
29
29
|
"abort-controller": "3.0.0",
|
|
30
30
|
"bson": "^4.6.4",
|
|
31
31
|
"hashids": "^2.2.10",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/mocha": "^9.1.1",
|
|
38
|
-
"@unchainedshop/types": "^1.1.
|
|
38
|
+
"@unchainedshop/types": "^1.1.9",
|
|
39
39
|
"chai": "^4.3.6",
|
|
40
40
|
"mocha": "^10.0.0",
|
|
41
41
|
"typescript": "^4.7.4"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "5395cd35169a1fd13bb83ff7d11cc8a162b27b09"
|
|
44
44
|
}
|
package/src/locale-helpers.js
CHANGED
package/tsconfig.build.json
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"esModuleInterop": true,
|
|
7
7
|
"experimentalDecorators": true,
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"lib": [
|
|
9
|
+
"lib": [
|
|
10
|
+
"esnext"
|
|
11
|
+
],
|
|
10
12
|
"module": "esnext",
|
|
11
13
|
"moduleResolution": "node",
|
|
12
14
|
"noImplicitReturns": true,
|
|
@@ -16,11 +18,17 @@
|
|
|
16
18
|
"skipLibCheck": true,
|
|
17
19
|
"sourceMap": true,
|
|
18
20
|
"target": "esnext",
|
|
19
|
-
"types": [
|
|
21
|
+
"types": [
|
|
22
|
+
"node"
|
|
23
|
+
],
|
|
20
24
|
"baseUrl": ".", // This must be specified if "paths" is.
|
|
21
25
|
"paths": {
|
|
22
|
-
"
|
|
26
|
+
"@unchainedshop/*": [
|
|
27
|
+
"node_modules/@unchainedshop/types/index.d.ts"
|
|
28
|
+
]
|
|
23
29
|
}
|
|
24
30
|
},
|
|
25
|
-
"include": [
|
|
31
|
+
"include": [
|
|
32
|
+
"src"
|
|
33
|
+
]
|
|
26
34
|
}
|