@unchainedshop/utils 2.0.0-rc.3 → 2.0.0-rc.4
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 +1 -1
- package/lib/db/build-sort-option.d.ts +2 -2
- package/lib/db/generate-db-filter-by-id.d.ts +1 -1
- package/lib/db/generate-db-mutations.d.ts +2 -2
- package/lib/db/generate-db-mutations.js +3 -3
- package/lib/db/generate-db-mutations.js.map +1 -1
- package/lib/director/BaseAdapter.d.ts +1 -1
- package/lib/director/BaseDirector.d.ts +1 -1
- package/lib/director/BaseDirector.js +5 -1
- package/lib/director/BaseDirector.js.map +1 -1
- package/lib/director/BaseDiscountAdapter.d.ts +1 -1
- package/lib/director/BaseDiscountDirector.d.ts +1 -1
- package/lib/director/BaseDiscountDirector.js +1 -1
- package/lib/director/BaseDiscountDirector.js.map +1 -1
- package/lib/director/BasePricingAdapter.d.ts +1 -1
- package/lib/director/BasePricingDirector.d.ts +1 -1
- package/lib/director/BasePricingDirector.js +1 -1
- package/lib/director/BasePricingDirector.js.map +1 -1
- package/lib/director/BasePricingSheet.d.ts +1 -1
- package/lib/director/BasePricingSheet.js.map +1 -1
- package/lib/find-localized-text.d.ts +2 -2
- package/lib/find-localized-text.js +2 -2
- package/lib/find-localized-text.js.map +1 -1
- package/lib/find-preserving-ids.d.ts +1 -1
- package/lib/schemas/UsersSchema.js +2 -2
- package/lib/schemas/UsersSchema.js.map +1 -1
- package/lib/schemas/index.d.ts +42 -0
- package/lib/schemas/index.js +14 -0
- package/lib/schemas/index.js.map +1 -0
- package/lib/utils-index.d.ts +23 -62
- package/lib/utils-index.js +23 -35
- package/lib/utils-index.js.map +1 -1
- package/package.json +3 -3
- package/src/db/build-db-indexes.ts +1 -1
- package/src/db/build-sort-option.ts +2 -2
- package/src/db/generate-db-filter-by-id.ts +1 -1
- package/src/db/generate-db-mutations.ts +5 -5
- package/src/director/BaseAdapter.ts +1 -1
- package/src/director/BaseDirector.ts +7 -3
- package/src/director/BaseDiscountAdapter.ts +1 -1
- package/src/director/BaseDiscountDirector.ts +2 -2
- package/src/director/BasePricingAdapter.ts +1 -1
- package/src/director/BasePricingDirector.ts +3 -3
- package/src/director/BasePricingSheet.ts +5 -1
- package/src/find-localized-text.ts +3 -3
- package/src/find-preserving-ids.ts +1 -1
- package/src/schemas/UsersSchema.ts +2 -2
- package/src/schemas/index.ts +18 -0
- package/src/utils-index.ts +23 -37
- package/tests/utils-index.test.ts +2 -2
- package/tsconfig.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Collection, Indexes, Document } from '@unchainedshop/types/common';
|
|
1
|
+
import { Collection, Indexes, Document } from '@unchainedshop/types/common.js';
|
|
2
2
|
export declare const buildDbIndexes: <T extends Document>(collection: Collection<T>, indexes: Indexes<T>) => Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SortOption } from '@unchainedshop/types/api';
|
|
2
|
-
import { Sort } from '@unchainedshop/types/common';
|
|
1
|
+
import { SortOption } from '@unchainedshop/types/api.js';
|
|
2
|
+
import { Sort } from '@unchainedshop/types/common.js';
|
|
3
3
|
declare const buildSortOptions: (sort?: Array<SortOption>) => Sort;
|
|
4
4
|
export default buildSortOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
import { Collection, _ID, TimestampFields } from '@unchainedshop/types/common';
|
|
3
|
-
import { ModuleCreateMutation, ModuleMutations } from '@unchainedshop/types/core';
|
|
2
|
+
import { Collection, _ID, TimestampFields } from '@unchainedshop/types/common.js';
|
|
3
|
+
import { ModuleCreateMutation, ModuleMutations } from '@unchainedshop/types/core.js';
|
|
4
4
|
export declare const generateDbMutations: <T extends TimestampFields & {
|
|
5
5
|
_id?: _ID;
|
|
6
6
|
}>(collection: Collection<T>, schema: SimpleSchema, options?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { checkId } from './check-id';
|
|
2
|
-
import { generateDbObjectId } from './generate-db-object-id';
|
|
3
|
-
import { generateDbFilterById } from './generate-db-filter-by-id';
|
|
1
|
+
import { checkId } from './check-id.js';
|
|
2
|
+
import { generateDbObjectId } from './generate-db-object-id.js';
|
|
3
|
+
import { generateDbFilterById } from './generate-db-filter-by-id.js';
|
|
4
4
|
export const generateDbMutations = (collection, schema, options) => {
|
|
5
5
|
if (!collection)
|
|
6
6
|
throw new Error('Collection is missing');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-db-mutations.js","sourceRoot":"","sources":["../../src/db/generate-db-mutations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generate-db-mutations.js","sourceRoot":"","sources":["../../src/db/generate-db-mutations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,UAAyB,EACzB,MAAoB,EACpB,OAGC,EAC6C,EAAE;IAChD,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAElD,MAAM,EAAE,aAAa,EAAE,0BAA0B,EAAE,GAAG,OAAO,IAAI;QAC/D,aAAa,EAAE,KAAK;QACpB,0BAA0B,EAAE,KAAK;KAClC,CAAC;IAEF,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAAG,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,CAAC;QACb,MAAM,MAAM,GAAG,oBAAoB,CAAI,GAAG,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,M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QAAQ,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC9C,MAAM,MAAM,GAAG,oBAAoB,CAAI,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/D,MAAM,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;gBAE7C,OAAO,GAAG,CAAC;YACb,CAAC;QAEL,iBAAiB,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB;QAEhE,MAAM,EAAE,aAAa;YACnB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;gBACZ,IAAI,0BAA0B,EAAE;oBAC9B,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;iBAC/B;gBACD,OAAO,CAAC,GAAG,CAAC,CAAC;gBACb,MAAM,MAAM,GAAG,oBAAoB,CAAI,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/D,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;gBACnD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC5D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAE1D,OAAO,MAAM,CAAC,aAAa,CAAC;YAC9B,CAAC;KACN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IBaseAdapter } from '@unchainedshop/types/common';
|
|
1
|
+
import { IBaseAdapter } from '@unchainedshop/types/common.js';
|
|
2
2
|
export declare const BaseAdapter: Omit<IBaseAdapter, 'key' | 'label' | 'version'>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBaseAdapter, IBaseDirector } from '@unchainedshop/types/common';
|
|
1
|
+
import { IBaseAdapter, IBaseDirector } from '@unchainedshop/types/common.js';
|
|
2
2
|
export declare const BaseDirector: <AdapterType extends IBaseAdapter>(directorName: string, options?: {
|
|
3
3
|
adapterSortKey?: string;
|
|
4
4
|
adapterKeyField?: string;
|
|
@@ -13,9 +13,13 @@ export const BaseDirector = (directorName, options) => {
|
|
|
13
13
|
.filter(adapterFilter || (() => true));
|
|
14
14
|
},
|
|
15
15
|
registerAdapter: (Adapter) => {
|
|
16
|
-
log(`${directorName} -> Registered ${keyField !== 'key' ? `${Adapter[keyField]}
|
|
16
|
+
log(`${directorName} -> Registered ${keyField !== 'key' ? `${Adapter[keyField]}` : ''} ${Adapter.key} ${Adapter.version} (${Adapter.label})`);
|
|
17
17
|
Adapters.set(Adapter[keyField], Adapter);
|
|
18
18
|
},
|
|
19
|
+
unregisterAdapter: (key) => {
|
|
20
|
+
log(`${directorName} -> Unregistered ${key}`);
|
|
21
|
+
return Adapters.delete(key);
|
|
22
|
+
},
|
|
19
23
|
};
|
|
20
24
|
};
|
|
21
25
|
//# sourceMappingURL=BaseDirector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDirector.js","sourceRoot":"","sources":["../../src/director/BaseDirector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,YAAoB,EACpB,OAGC,EAC2B,EAAE;IAC9B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAChD,MAAM,QAAQ,GAAG,OAAO,EAAE,eAAe,IAAI,KAAK,CAAC;IAEnD,OAAO;QACL,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;YAClB,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAED,WAAW,EAAE,CAAC,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AC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;iBACrD,MAAM,CAAC,aAAa,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,eAAe,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3B,GAAG,CACD,GAAG,YAAY,kBAAkB,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAC/E,OAAO,CAAC,GACV,IAAI,OAAO,CAAC,OAAO,KAAK,OAAO,CAAC,KAAK,GAAG,CACzC,CAAC;YACF,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;QAC3C,CAAC;QAED,iBAAiB,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,GAAG,CAAC,GAAG,YAAY,oBAAoB,GAAG,EAAE,CAAC,CAAC;YAC9C,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IDiscountAdapter } from '@unchainedshop/types/discount';
|
|
1
|
+
import { IDiscountAdapter } from '@unchainedshop/types/discount.js';
|
|
2
2
|
export declare const BaseDiscountAdapter: Omit<IDiscountAdapter, 'key' | 'label' | 'version'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IDiscountDirector } from '@unchainedshop/types/discount';
|
|
1
|
+
import { IDiscountDirector } from '@unchainedshop/types/discount.js';
|
|
2
2
|
export declare const BaseDiscountDirector: (directorName: string) => IDiscountDirector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { log } from '@unchainedshop/logger';
|
|
2
|
-
import { BaseDirector } from './BaseDirector';
|
|
2
|
+
import { BaseDirector } from './BaseDirector.js';
|
|
3
3
|
export const BaseDiscountDirector = (directorName) => {
|
|
4
4
|
const baseDirector = BaseDirector(directorName, {
|
|
5
5
|
adapterSortKey: 'orderIndex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDiscountDirector.js","sourceRoot":"","sources":["../../src/director/BaseDiscountDirector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BaseDiscountDirector.js","sourceRoot":"","sources":["../../src/director/BaseDiscountDirector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,YAAoB,EAAqB,EAAE;IAC9E,MAAM,YAAY,GAAG,YAAY,CAAmB,YAAY,EAAE;QAChE,cAAc,EAAE,YAAY;KAC7B,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,YAAY;QAEf,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,EAAE;YAC/C,MAAM,OAAO,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,YAAY,EAAE,CAAC;YAExD,OAAO;gBACL,gCAAgC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;oBAClD,IAAI,CAAC,OAAO,CAAC,KAAK;wBAAE,OAAO,IAAI,CAAC;oBAEhC,GAAG,CAAC,0DAA0D,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;oBAE/E,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,YAAY;yBACT,WAAW,EAAE;yBACb,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;yBACnE,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAA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C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BasePricingAdapterContext, IPricingSheet, IPricingAdapter, PricingCalculation } from '@unchainedshop/types/pricing';
|
|
1
|
+
import { BasePricingAdapterContext, IPricingSheet, IPricingAdapter, PricingCalculation } from '@unchainedshop/types/pricing.js';
|
|
2
2
|
export declare const BasePricingAdapter: <Context extends BasePricingAdapterContext, Calculation extends PricingCalculation>() => IPricingAdapter<Context, Calculation, IPricingSheet<Calculation>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BasePricingAdapterContext, BasePricingContext, IPricingDirector, IPricingAdapter, IPricingSheet, PricingCalculation } from '@unchainedshop/types/pricing';
|
|
1
|
+
import { BasePricingAdapterContext, BasePricingContext, IPricingDirector, IPricingAdapter, IPricingSheet, PricingCalculation } from '@unchainedshop/types/pricing.js';
|
|
2
2
|
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,5 +1,5 @@
|
|
|
1
1
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
2
|
-
import { BaseDirector } from './BaseDirector';
|
|
2
|
+
import { BaseDirector } from './BaseDirector.js';
|
|
3
3
|
export const BasePricingDirector = (directorName) => {
|
|
4
4
|
const baseDirector = BaseDirector(directorName, {
|
|
5
5
|
adapterSortKey: 'orderIndex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePricingDirector.js","sourceRoot":"","sources":["../../src/director/BasePricingDirector.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BasePricing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ricingCalculation, IBasePricingSheet, PricingSheetParams } from '@unchainedshop/types/pricing.js';
|
|
2
2
|
export declare const BasePricingSheet: <Calculation extends PricingCalculation>(params: PricingSheetParams<Calculation>) => IBasePricingSheet<Calculation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePricingSheet.js","sourceRoot":"","sources":["../../src/director/BasePricingSheet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BasePricingSheet.js","sourceRoot":"","sources":["../../src/director/BasePricingSheet.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAAuC,EACP,EAAE;IAClC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC;IAE7C,MAAM,YAAY,GAAmC;QACnD,WAAW;QACX,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QAEzB,kBAAkB;YAChB,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,OAAO;YACL,OAAO,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;QAChC,CAAC;QAED,GAAG,CAAC,MAAM;YACR,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;iBACzB,MAAM,CAAC,OAAO,CAAC;iBACf,MAAM,CAAC,CAAC,GAAW,EAAE,cAA2B,EAAE,EAAE,CAAC,GAAG,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1F,CAAC;QAED,MAAM;YACJ,OAAO,CAAC,CAAC;QACX,CAAC;QAED,KAAK;YACH,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;QAED,GAAG;YACD,OAAO,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACtC,CAAC;QAED,KAAK,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE;YACtD,IAA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
|
|
1
|
-
import 'abort-controller/polyfill';
|
|
2
|
-
import { Collection, Filter, Locale, Document } from '@unchainedshop/types/common';
|
|
1
|
+
import 'abort-controller/polyfill.js';
|
|
2
|
+
import { Collection, Filter, Locale, Document } from '@unchainedshop/types/common.js';
|
|
3
3
|
declare const findLocalizedText: <T extends Document>(collection: Collection<T>, selector: Filter<T>, locale: Locale) => Promise<T>;
|
|
4
4
|
export default findLocalizedText;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import 'abort-controller/polyfill';
|
|
1
|
+
import 'abort-controller/polyfill.js';
|
|
2
2
|
import LRU from 'lru-cache';
|
|
3
|
-
import { systemLocale } from './locale-helpers';
|
|
3
|
+
import { systemLocale } from './locale-helpers.js';
|
|
4
4
|
const { NODE_ENV } = process.env;
|
|
5
5
|
const ttl = NODE_ENV === 'production' ? 1000 * 10 : 0; // 10 seconds or 0 seconds
|
|
6
6
|
const textCache = new LRU({ max: 50000, ttl });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-localized-text.js","sourceRoot":"","sources":["../src/find-localized-text.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"find-localized-text.js","sourceRoot":"","sources":["../src/find-localized-text.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AACtC,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEjC,MAAM,GAAG,GAAG,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B;AAEjF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAE/C,MAAM,wBAAwB,GAAG,CAAC,QAAQ,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AAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACnC,OAAO,SAAc,CAAC;AACxB,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Collection, FindOptions, Query } from '@unchainedshop/types/common';
|
|
1
|
+
import { Collection, FindOptions, Query } from '@unchainedshop/types/common.js';
|
|
2
2
|
export declare const findPreservingIds: <T>(collection: Collection<T>) => (selector: Query, ids: Array<string>, options?: FindOptions) => Promise<T[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
import { AddressSchema } from './AddressSchema';
|
|
3
|
-
import { timestampFields } from './commonSchemaFields';
|
|
2
|
+
import { AddressSchema } from './AddressSchema.js';
|
|
3
|
+
import { timestampFields } from './commonSchemaFields.js';
|
|
4
4
|
const ProfileSchema = new SimpleSchema({
|
|
5
5
|
displayName: String,
|
|
6
6
|
birthday: Date,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersSchema.js","sourceRoot":"","sources":["../../src/schemas/UsersSchema.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"UsersSchema.js","sourceRoot":"","sources":["../../src/schemas/UsersSchema.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,aAAa,GAAG,IAAI,YAAY,CACpC;IACE,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,aAAa;CACvB,EACD,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7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3
|
+
timestampFields: {
|
|
4
|
+
created: {
|
|
5
|
+
type: DateConstructor;
|
|
6
|
+
required: boolean;
|
|
7
|
+
};
|
|
8
|
+
updated: {
|
|
9
|
+
type: DateConstructor;
|
|
10
|
+
};
|
|
11
|
+
deleted: {
|
|
12
|
+
type: DateConstructor;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
contextFields: {
|
|
16
|
+
context: {
|
|
17
|
+
type: ObjectConstructor;
|
|
18
|
+
blackbox: boolean;
|
|
19
|
+
required: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
logFields: {
|
|
23
|
+
log: ArrayConstructor;
|
|
24
|
+
'log.$': {
|
|
25
|
+
type: ObjectConstructor;
|
|
26
|
+
};
|
|
27
|
+
'log.$.date': {
|
|
28
|
+
type: DateConstructor;
|
|
29
|
+
};
|
|
30
|
+
'log.$.status': {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
};
|
|
33
|
+
'log.$.info': {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
Address: SimpleSchema;
|
|
38
|
+
Contact: SimpleSchema;
|
|
39
|
+
User: SimpleSchema;
|
|
40
|
+
};
|
|
41
|
+
export { Schemas };
|
|
42
|
+
export type { SimpleSchema };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { timestampFields, contextFields, logFields } from './commonSchemaFields.js';
|
|
2
|
+
import { AddressSchema } from './AddressSchema.js';
|
|
3
|
+
import { ContactSchema } from './ContactSchema.js';
|
|
4
|
+
import { UserSchema } from './UsersSchema.js';
|
|
5
|
+
const Schemas = {
|
|
6
|
+
timestampFields,
|
|
7
|
+
contextFields,
|
|
8
|
+
logFields,
|
|
9
|
+
Address: AddressSchema,
|
|
10
|
+
Contact: ContactSchema,
|
|
11
|
+
User: UserSchema,
|
|
12
|
+
};
|
|
13
|
+
export { Schemas };
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,GAAG;IACd,eAAe;IACf,aAAa;IACb,SAAS;IACT,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/lib/utils-index.d.ts
CHANGED
|
@@ -1,62 +1,23 @@
|
|
|
1
|
-
export { default as findLocalizedText } from './find-localized-text';
|
|
2
|
-
export * from './locale-helpers';
|
|
3
|
-
export { default as objectInvert } from './object-invert';
|
|
4
|
-
export { default as findUnusedSlug } from './find-unused-slug';
|
|
5
|
-
export { default as slugify } from './slugify';
|
|
6
|
-
export { default as pipePromises } from './pipe-promises';
|
|
7
|
-
export { default as generateRandomHash } from './generate-random-hash';
|
|
8
|
-
export { default as randomValueHex } from './random-value-hex';
|
|
9
|
-
export { default as buildSortOptions } from './db/build-sort-option';
|
|
10
|
-
export { checkId } from './db/check-id';
|
|
11
|
-
export { generateDbObjectId } from './db/generate-db-object-id';
|
|
12
|
-
export { generateDbFilterById } from './db/generate-db-filter-by-id';
|
|
13
|
-
export { generateDbMutations } from './db/generate-db-mutations';
|
|
14
|
-
export { buildDbIndexes } from './db/build-db-indexes';
|
|
15
|
-
export { findPreservingIds } from './find-preserving-ids';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
deleted: {
|
|
26
|
-
type: DateConstructor;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
contextFields: {
|
|
30
|
-
context: {
|
|
31
|
-
type: ObjectConstructor;
|
|
32
|
-
blackbox: boolean;
|
|
33
|
-
required: boolean;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
logFields: {
|
|
37
|
-
log: ArrayConstructor;
|
|
38
|
-
'log.$': {
|
|
39
|
-
type: ObjectConstructor;
|
|
40
|
-
};
|
|
41
|
-
'log.$.date': {
|
|
42
|
-
type: DateConstructor;
|
|
43
|
-
};
|
|
44
|
-
'log.$.status': {
|
|
45
|
-
type: StringConstructor;
|
|
46
|
-
};
|
|
47
|
-
'log.$.info': {
|
|
48
|
-
type: StringConstructor;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
Address: import("simpl-schema/dist/esm/SimpleSchema").SimpleSchema;
|
|
52
|
-
Contact: import("simpl-schema/dist/esm/SimpleSchema").SimpleSchema;
|
|
53
|
-
User: import("simpl-schema/dist/esm/SimpleSchema").SimpleSchema;
|
|
54
|
-
};
|
|
55
|
-
export { Schemas };
|
|
56
|
-
export { BaseAdapter } from './director/BaseAdapter';
|
|
57
|
-
export { BaseDirector } from './director/BaseDirector';
|
|
58
|
-
export { BasePricingAdapter } from './director/BasePricingAdapter';
|
|
59
|
-
export { BasePricingDirector } from './director/BasePricingDirector';
|
|
60
|
-
export { BasePricingSheet } from './director/BasePricingSheet';
|
|
61
|
-
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter';
|
|
62
|
-
export { BaseDiscountDirector } from './director/BaseDiscountDirector';
|
|
1
|
+
export { default as findLocalizedText } from './find-localized-text.js';
|
|
2
|
+
export * from './locale-helpers.js';
|
|
3
|
+
export { default as objectInvert } from './object-invert.js';
|
|
4
|
+
export { default as findUnusedSlug } from './find-unused-slug.js';
|
|
5
|
+
export { default as slugify } from './slugify.js';
|
|
6
|
+
export { default as pipePromises } from './pipe-promises.js';
|
|
7
|
+
export { default as generateRandomHash } from './generate-random-hash.js';
|
|
8
|
+
export { default as randomValueHex } from './random-value-hex.js';
|
|
9
|
+
export { default as buildSortOptions } from './db/build-sort-option.js';
|
|
10
|
+
export { checkId } from './db/check-id.js';
|
|
11
|
+
export { generateDbObjectId } from './db/generate-db-object-id.js';
|
|
12
|
+
export { generateDbFilterById } from './db/generate-db-filter-by-id.js';
|
|
13
|
+
export { generateDbMutations } from './db/generate-db-mutations.js';
|
|
14
|
+
export { buildDbIndexes } from './db/build-db-indexes.js';
|
|
15
|
+
export { findPreservingIds } from './find-preserving-ids.js';
|
|
16
|
+
export { Schemas } from './schemas/index.js';
|
|
17
|
+
export { BaseAdapter } from './director/BaseAdapter.js';
|
|
18
|
+
export { BaseDirector } from './director/BaseDirector.js';
|
|
19
|
+
export { BasePricingAdapter } from './director/BasePricingAdapter.js';
|
|
20
|
+
export { BasePricingDirector } from './director/BasePricingDirector.js';
|
|
21
|
+
export { BasePricingSheet } from './director/BasePricingSheet.js';
|
|
22
|
+
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter.js';
|
|
23
|
+
export { BaseDiscountDirector } from './director/BaseDiscountDirector.js';
|
package/lib/utils-index.js
CHANGED
|
@@ -1,45 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { default as
|
|
6
|
-
export
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as pipePromises } from './pipe-promises';
|
|
11
|
-
export { default as generateRandomHash } from './generate-random-hash';
|
|
12
|
-
export { default as randomValueHex } from './random-value-hex';
|
|
13
|
-
export { default as buildSortOptions } from './db/build-sort-option';
|
|
1
|
+
export { default as findLocalizedText } from './find-localized-text.js';
|
|
2
|
+
export * from './locale-helpers.js';
|
|
3
|
+
export { default as objectInvert } from './object-invert.js';
|
|
4
|
+
export { default as findUnusedSlug } from './find-unused-slug.js';
|
|
5
|
+
export { default as slugify } from './slugify.js';
|
|
6
|
+
export { default as pipePromises } from './pipe-promises.js';
|
|
7
|
+
export { default as generateRandomHash } from './generate-random-hash.js';
|
|
8
|
+
export { default as randomValueHex } from './random-value-hex.js';
|
|
9
|
+
export { default as buildSortOptions } from './db/build-sort-option.js';
|
|
14
10
|
/*
|
|
15
11
|
* Db utils
|
|
16
12
|
*/
|
|
17
|
-
export { checkId } from './db/check-id';
|
|
18
|
-
export { generateDbObjectId } from './db/generate-db-object-id';
|
|
19
|
-
export { generateDbFilterById } from './db/generate-db-filter-by-id';
|
|
20
|
-
export { generateDbMutations } from './db/generate-db-mutations';
|
|
21
|
-
export { buildDbIndexes } from './db/build-db-indexes';
|
|
22
|
-
export { findPreservingIds } from './find-preserving-ids';
|
|
13
|
+
export { checkId } from './db/check-id.js';
|
|
14
|
+
export { generateDbObjectId } from './db/generate-db-object-id.js';
|
|
15
|
+
export { generateDbFilterById } from './db/generate-db-filter-by-id.js';
|
|
16
|
+
export { generateDbMutations } from './db/generate-db-mutations.js';
|
|
17
|
+
export { buildDbIndexes } from './db/build-db-indexes.js';
|
|
18
|
+
export { findPreservingIds } from './find-preserving-ids.js';
|
|
23
19
|
/*
|
|
24
20
|
* Schemas
|
|
25
21
|
*/
|
|
26
|
-
|
|
27
|
-
timestampFields,
|
|
28
|
-
contextFields,
|
|
29
|
-
logFields,
|
|
30
|
-
Address: AddressSchema,
|
|
31
|
-
Contact: ContactSchema,
|
|
32
|
-
User: UserSchema,
|
|
33
|
-
};
|
|
34
|
-
export { Schemas };
|
|
22
|
+
export { Schemas } from './schemas/index.js';
|
|
35
23
|
/*
|
|
36
24
|
* Director
|
|
37
25
|
*/
|
|
38
|
-
export { BaseAdapter } from './director/BaseAdapter';
|
|
39
|
-
export { BaseDirector } from './director/BaseDirector';
|
|
40
|
-
export { BasePricingAdapter } from './director/BasePricingAdapter';
|
|
41
|
-
export { BasePricingDirector } from './director/BasePricingDirector';
|
|
42
|
-
export { BasePricingSheet } from './director/BasePricingSheet';
|
|
43
|
-
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter';
|
|
44
|
-
export { BaseDiscountDirector } from './director/BaseDiscountDirector';
|
|
26
|
+
export { BaseAdapter } from './director/BaseAdapter.js';
|
|
27
|
+
export { BaseDirector } from './director/BaseDirector.js';
|
|
28
|
+
export { BasePricingAdapter } from './director/BasePricingAdapter.js';
|
|
29
|
+
export { BasePricingDirector } from './director/BasePricingDirector.js';
|
|
30
|
+
export { BasePricingSheet } from './director/BasePricingSheet.js';
|
|
31
|
+
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter.js';
|
|
32
|
+
export { BaseDiscountDirector } from './director/BaseDiscountDirector.js';
|
|
45
33
|
//# sourceMappingURL=utils-index.js.map
|
package/lib/utils-index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-index.js","sourceRoot":"","sources":["../src/utils-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils-index.js","sourceRoot":"","sources":["../src/utils-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxE,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAExE;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/utils",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.4",
|
|
4
4
|
"main": "lib/utils-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/utils-index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@unchainedshop/logger": "^2.0.0-rc.
|
|
33
|
+
"@unchainedshop/logger": "^2.0.0-rc.4",
|
|
34
34
|
"abort-controller": "3.0.0",
|
|
35
35
|
"bson": "^4.7.0",
|
|
36
36
|
"hashids": "^2.2.10",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^18.11.18",
|
|
44
|
-
"@unchainedshop/types": "^2.0.0-rc.
|
|
44
|
+
"@unchainedshop/types": "^2.0.0-rc.4",
|
|
45
45
|
"typescript": "^4.9.4"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
import { Collection, _ID, Update, TimestampFields } from '@unchainedshop/types/common';
|
|
3
|
-
import { ModuleCreateMutation, ModuleMutations } from '@unchainedshop/types/core';
|
|
2
|
+
import { Collection, _ID, Update, TimestampFields } from '@unchainedshop/types/common.js';
|
|
3
|
+
import { ModuleCreateMutation, ModuleMutations } from '@unchainedshop/types/core.js';
|
|
4
4
|
|
|
5
|
-
import { checkId } from './check-id';
|
|
6
|
-
import { generateDbObjectId } from './generate-db-object-id';
|
|
7
|
-
import { generateDbFilterById } from './generate-db-filter-by-id';
|
|
5
|
+
import { checkId } from './check-id.js';
|
|
6
|
+
import { generateDbObjectId } from './generate-db-object-id.js';
|
|
7
|
+
import { generateDbFilterById } from './generate-db-filter-by-id.js';
|
|
8
8
|
|
|
9
9
|
export const generateDbMutations = <T extends TimestampFields & { _id?: _ID }>(
|
|
10
10
|
collection: Collection<T>,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBaseAdapter, IBaseDirector } from '@unchainedshop/types/common';
|
|
1
|
+
import { IBaseAdapter, IBaseDirector } from '@unchainedshop/types/common.js';
|
|
2
2
|
import { log } from '@unchainedshop/logger';
|
|
3
3
|
|
|
4
4
|
export const BaseDirector = <AdapterType extends IBaseAdapter>(
|
|
@@ -25,12 +25,16 @@ export const BaseDirector = <AdapterType extends IBaseAdapter>(
|
|
|
25
25
|
|
|
26
26
|
registerAdapter: (Adapter) => {
|
|
27
27
|
log(
|
|
28
|
-
`${directorName} -> Registered ${keyField !== 'key' ? `${Adapter[keyField]}
|
|
28
|
+
`${directorName} -> Registered ${keyField !== 'key' ? `${Adapter[keyField]}` : ''} ${
|
|
29
29
|
Adapter.key
|
|
30
30
|
} ${Adapter.version} (${Adapter.label})`,
|
|
31
31
|
);
|
|
32
|
-
|
|
33
32
|
Adapters.set(Adapter[keyField], Adapter);
|
|
34
33
|
},
|
|
34
|
+
|
|
35
|
+
unregisterAdapter: (key) => {
|
|
36
|
+
log(`${directorName} -> Unregistered ${key}`);
|
|
37
|
+
return Adapters.delete(key);
|
|
38
|
+
},
|
|
35
39
|
};
|
|
36
40
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
2
2
|
|
|
3
|
-
import { IDiscountAdapter } from '@unchainedshop/types/discount';
|
|
3
|
+
import { IDiscountAdapter } from '@unchainedshop/types/discount.js';
|
|
4
4
|
|
|
5
5
|
export const BaseDiscountAdapter: Omit<IDiscountAdapter, 'key' | 'label' | 'version'> = {
|
|
6
6
|
orderIndex: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IDiscountAdapter, IDiscountDirector } from '@unchainedshop/types/discount';
|
|
1
|
+
import { IDiscountAdapter, IDiscountDirector } from '@unchainedshop/types/discount.js';
|
|
2
2
|
import { log } from '@unchainedshop/logger';
|
|
3
|
-
import { BaseDirector } from './BaseDirector';
|
|
3
|
+
import { BaseDirector } from './BaseDirector.js';
|
|
4
4
|
|
|
5
5
|
export const BaseDiscountDirector = (directorName: string): IDiscountDirector => {
|
|
6
6
|
const baseDirector = BaseDirector<IDiscountAdapter>(directorName, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Discount } from '@unchainedshop/types/discount';
|
|
1
|
+
import { Discount } from '@unchainedshop/types/discount.js';
|
|
2
2
|
import {
|
|
3
3
|
BasePricingAdapterContext,
|
|
4
4
|
BasePricingContext,
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
IPricingSheet,
|
|
8
8
|
PricingCalculation,
|
|
9
9
|
IPricingAdapterActions,
|
|
10
|
-
} from '@unchainedshop/types/pricing';
|
|
10
|
+
} from '@unchainedshop/types/pricing.js';
|
|
11
11
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
12
|
-
import { BaseDirector } from './BaseDirector';
|
|
12
|
+
import { BaseDirector } from './BaseDirector.js';
|
|
13
13
|
|
|
14
14
|
export const BasePricingDirector = <
|
|
15
15
|
DirectorContext extends BasePricingContext,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
PricingCalculation,
|
|
3
|
+
IBasePricingSheet,
|
|
4
|
+
PricingSheetParams,
|
|
5
|
+
} from '@unchainedshop/types/pricing.js';
|
|
2
6
|
|
|
3
7
|
export const BasePricingSheet = <Calculation extends PricingCalculation>(
|
|
4
8
|
params: PricingSheetParams<Calculation>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import 'abort-controller/polyfill';
|
|
1
|
+
import 'abort-controller/polyfill.js';
|
|
2
2
|
import LRU from 'lru-cache';
|
|
3
|
-
import { Collection, Filter, Locale, Document } from '@unchainedshop/types/common';
|
|
4
|
-
import { systemLocale } from './locale-helpers';
|
|
3
|
+
import { Collection, Filter, Locale, Document } from '@unchainedshop/types/common.js';
|
|
4
|
+
import { systemLocale } from './locale-helpers.js';
|
|
5
5
|
|
|
6
6
|
const { NODE_ENV } = process.env;
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
import { AddressSchema } from './AddressSchema';
|
|
3
|
-
import { timestampFields } from './commonSchemaFields';
|
|
2
|
+
import { AddressSchema } from './AddressSchema.js';
|
|
3
|
+
import { timestampFields } from './commonSchemaFields.js';
|
|
4
4
|
|
|
5
5
|
const ProfileSchema = new SimpleSchema(
|
|
6
6
|
{
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import SimpleSchema from 'simpl-schema';
|
|
2
|
+
import { timestampFields, contextFields, logFields } from './commonSchemaFields.js';
|
|
3
|
+
import { AddressSchema } from './AddressSchema.js';
|
|
4
|
+
import { ContactSchema } from './ContactSchema.js';
|
|
5
|
+
import { UserSchema } from './UsersSchema.js';
|
|
6
|
+
|
|
7
|
+
const Schemas = {
|
|
8
|
+
timestampFields,
|
|
9
|
+
contextFields,
|
|
10
|
+
logFields,
|
|
11
|
+
Address: AddressSchema,
|
|
12
|
+
Contact: ContactSchema,
|
|
13
|
+
User: UserSchema,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { Schemas };
|
|
17
|
+
|
|
18
|
+
export type { SimpleSchema };
|
package/src/utils-index.ts
CHANGED
|
@@ -1,52 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { default as
|
|
7
|
-
export
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as slugify } from './slugify';
|
|
11
|
-
export { default as pipePromises } from './pipe-promises';
|
|
12
|
-
export { default as generateRandomHash } from './generate-random-hash';
|
|
13
|
-
export { default as randomValueHex } from './random-value-hex';
|
|
14
|
-
export { default as buildSortOptions } from './db/build-sort-option';
|
|
1
|
+
export { default as findLocalizedText } from './find-localized-text.js';
|
|
2
|
+
export * from './locale-helpers.js';
|
|
3
|
+
export { default as objectInvert } from './object-invert.js';
|
|
4
|
+
export { default as findUnusedSlug } from './find-unused-slug.js';
|
|
5
|
+
export { default as slugify } from './slugify.js';
|
|
6
|
+
export { default as pipePromises } from './pipe-promises.js';
|
|
7
|
+
export { default as generateRandomHash } from './generate-random-hash.js';
|
|
8
|
+
export { default as randomValueHex } from './random-value-hex.js';
|
|
9
|
+
export { default as buildSortOptions } from './db/build-sort-option.js';
|
|
15
10
|
|
|
16
11
|
/*
|
|
17
12
|
* Db utils
|
|
18
13
|
*/
|
|
19
14
|
|
|
20
|
-
export { checkId } from './db/check-id';
|
|
21
|
-
export { generateDbObjectId } from './db/generate-db-object-id';
|
|
22
|
-
export { generateDbFilterById } from './db/generate-db-filter-by-id';
|
|
23
|
-
export { generateDbMutations } from './db/generate-db-mutations';
|
|
24
|
-
export { buildDbIndexes } from './db/build-db-indexes';
|
|
25
|
-
export { findPreservingIds } from './find-preserving-ids';
|
|
15
|
+
export { checkId } from './db/check-id.js';
|
|
16
|
+
export { generateDbObjectId } from './db/generate-db-object-id.js';
|
|
17
|
+
export { generateDbFilterById } from './db/generate-db-filter-by-id.js';
|
|
18
|
+
export { generateDbMutations } from './db/generate-db-mutations.js';
|
|
19
|
+
export { buildDbIndexes } from './db/build-db-indexes.js';
|
|
20
|
+
export { findPreservingIds } from './find-preserving-ids.js';
|
|
26
21
|
|
|
27
22
|
/*
|
|
28
23
|
* Schemas
|
|
29
24
|
*/
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
timestampFields,
|
|
33
|
-
contextFields,
|
|
34
|
-
logFields,
|
|
35
|
-
Address: AddressSchema,
|
|
36
|
-
Contact: ContactSchema,
|
|
37
|
-
User: UserSchema,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export { Schemas };
|
|
26
|
+
export { Schemas } from './schemas/index.js';
|
|
41
27
|
|
|
42
28
|
/*
|
|
43
29
|
* Director
|
|
44
30
|
*/
|
|
45
31
|
|
|
46
|
-
export { BaseAdapter } from './director/BaseAdapter';
|
|
47
|
-
export { BaseDirector } from './director/BaseDirector';
|
|
48
|
-
export { BasePricingAdapter } from './director/BasePricingAdapter';
|
|
49
|
-
export { BasePricingDirector } from './director/BasePricingDirector';
|
|
50
|
-
export { BasePricingSheet } from './director/BasePricingSheet';
|
|
51
|
-
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter';
|
|
52
|
-
export { BaseDiscountDirector } from './director/BaseDiscountDirector';
|
|
32
|
+
export { BaseAdapter } from './director/BaseAdapter.js';
|
|
33
|
+
export { BaseDirector } from './director/BaseDirector.js';
|
|
34
|
+
export { BasePricingAdapter } from './director/BasePricingAdapter.js';
|
|
35
|
+
export { BasePricingDirector } from './director/BasePricingDirector.js';
|
|
36
|
+
export { BasePricingSheet } from './director/BasePricingSheet.js';
|
|
37
|
+
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter.js';
|
|
38
|
+
export { BaseDiscountDirector } from './director/BaseDiscountDirector.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { SortDirection } from '@unchainedshop/types/api';
|
|
2
|
+
import { SortDirection } from '@unchainedshop/types/api.js';
|
|
3
3
|
import {
|
|
4
4
|
buildSortOptions,
|
|
5
5
|
checkId,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
slugify,
|
|
20
20
|
systemLocale,
|
|
21
21
|
} from '@unchainedshop/utils';
|
|
22
|
-
import generateHashId from '../
|
|
22
|
+
import generateHashId from '../lib/generate-random-hash.js'
|
|
23
23
|
|
|
24
24
|
describe('Utils', () => {
|
|
25
25
|
|
package/tsconfig.json
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"lib": [
|
|
10
10
|
"esnext"
|
|
11
11
|
],
|
|
12
|
-
"module": "
|
|
13
|
-
"moduleResolution": "
|
|
12
|
+
"module": "Node16",
|
|
13
|
+
"moduleResolution": "Node16",
|
|
14
14
|
"noImplicitReturns": true,
|
|
15
15
|
"noUnusedLocals": false,
|
|
16
16
|
"outDir": "lib",
|
|
17
17
|
"preserveWatchOutput": true,
|
|
18
18
|
"skipLibCheck": true,
|
|
19
19
|
"sourceMap": true,
|
|
20
|
-
"target": "
|
|
20
|
+
"target": "ES2022",
|
|
21
21
|
"types": [
|
|
22
22
|
"node",
|
|
23
23
|
"jest"
|