@unchainedshop/core 4.8.4 → 5.0.0-alpha.1
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/bulk-exporter/createBulkExporter.d.ts +2 -2
- package/lib/bulk-exporter/createBulkExporter.js +2 -2
- package/lib/bulk-exporter/handlers/exportAssortmentsHandler.d.ts +19 -19
- package/lib/bulk-exporter/handlers/exportAssortmentsHandler.js +9 -9
- package/lib/bulk-exporter/handlers/exportFiltersHandler.d.ts +11 -11
- package/lib/bulk-exporter/handlers/exportFiltersHandler.js +5 -5
- package/lib/bulk-exporter/handlers/exportProductsHandler.d.ts +19 -19
- package/lib/bulk-exporter/handlers/exportProductsHandler.js +9 -9
- package/lib/bulk-exporter/handlers/exportUsersHandler.d.ts +17 -17
- package/lib/bulk-exporter/handlers/exportUsersHandler.js +8 -8
- package/lib/bulk-importer/createBulkImporter.js +6 -6
- package/lib/bulk-importer/handlers/product/create.d.ts +3 -3
- package/lib/bulk-importer/handlers/product/create.js +2 -2
- package/lib/bulk-importer/handlers/product/update.d.ts +3 -3
- package/lib/bulk-importer/handlers/product/update.js +1 -1
- package/lib/core-index.d.ts +3 -0
- package/lib/core-index.js +6 -2
- package/lib/directors/BaseDiscountDirector.js +6 -6
- package/lib/directors/BasePricingDirector.js +1 -1
- package/lib/directors/DeliveryAdapter.js +1 -0
- package/lib/directors/DeliveryDirector.js +11 -2
- package/lib/directors/DeliveryPricingAdapter.d.ts +2 -1
- package/lib/directors/DeliveryPricingAdapter.js +2 -1
- package/lib/directors/DeliveryPricingDirector.d.ts +1 -1
- package/lib/directors/DeliveryPricingDirector.js +12 -2
- package/lib/directors/DeliveryPricingSheet.d.ts +1 -1
- package/lib/directors/DeliveryPricingSheet.js +1 -1
- package/lib/directors/EnrollmentAdapter.js +1 -0
- package/lib/directors/EnrollmentDirector.js +11 -1
- package/lib/directors/FilterAdapter.js +1 -0
- package/lib/directors/FilterDirector.js +11 -1
- package/lib/directors/OrderDiscountAdapter.d.ts +3 -2
- package/lib/directors/OrderDiscountAdapter.js +5 -2
- package/lib/directors/OrderDiscountDirector.d.ts +15 -1
- package/lib/directors/OrderDiscountDirector.js +14 -1
- package/lib/directors/OrderPricingAdapter.d.ts +2 -1
- package/lib/directors/OrderPricingAdapter.js +3 -1
- package/lib/directors/OrderPricingDirector.d.ts +4 -1
- package/lib/directors/OrderPricingDirector.js +12 -1
- package/lib/directors/OrderPricingSheet.d.ts +1 -1
- package/lib/directors/OrderPricingSheet.js +1 -1
- package/lib/directors/PaymentAdapter.js +1 -0
- package/lib/directors/PaymentDirector.js +11 -2
- package/lib/directors/PaymentPricingAdapter.d.ts +2 -1
- package/lib/directors/PaymentPricingAdapter.js +2 -1
- package/lib/directors/PaymentPricingDirector.d.ts +2 -1
- package/lib/directors/PaymentPricingDirector.js +11 -1
- package/lib/directors/PaymentPricingSheet.d.ts +2 -1
- package/lib/directors/PaymentPricingSheet.js +2 -1
- package/lib/directors/ProductDiscountAdapter.d.ts +3 -2
- package/lib/directors/ProductDiscountAdapter.js +5 -2
- package/lib/directors/ProductDiscountDirector.d.ts +16 -2
- package/lib/directors/ProductDiscountDirector.js +15 -2
- package/lib/directors/ProductPricingAdapter.d.ts +2 -1
- package/lib/directors/ProductPricingAdapter.js +3 -1
- package/lib/directors/ProductPricingDirector.d.ts +3 -1
- package/lib/directors/ProductPricingDirector.js +12 -1
- package/lib/directors/ProductPricingSheet.d.ts +1 -1
- package/lib/directors/ProductPricingSheet.js +1 -1
- package/lib/directors/QuotationAdapter.js +1 -0
- package/lib/directors/QuotationDirector.js +11 -2
- package/lib/directors/WarehousingAdapter.js +1 -0
- package/lib/directors/WarehousingDirector.d.ts +1 -1
- package/lib/directors/WarehousingDirector.js +12 -2
- package/lib/directors/WorkerAdapter.js +1 -0
- package/lib/directors/WorkerDirector.d.ts +1 -1
- package/lib/directors/WorkerDirector.js +10 -17
- package/lib/directors/index.d.ts +2 -0
- package/lib/directors/index.js +2 -0
- package/lib/factory/registerAssortmentSearchFilter.d.ts +2 -1
- package/lib/factory/registerAssortmentSearchFilter.js +12 -3
- package/lib/factory/registerInvoicePayment.d.ts +2 -2
- package/lib/factory/registerInvoicePayment.js +12 -3
- package/lib/factory/registerPhysicalWarehousing.d.ts +2 -2
- package/lib/factory/registerPhysicalWarehousing.js +12 -3
- package/lib/factory/registerPickUpDelivery.d.ts +2 -2
- package/lib/factory/registerPickUpDelivery.js +12 -3
- package/lib/factory/registerProductDiscoverabilityFilter.d.ts +2 -1
- package/lib/factory/registerProductDiscoverabilityFilter.js +12 -3
- package/lib/factory/registerProductSearchFilter.d.ts +2 -1
- package/lib/factory/registerProductSearchFilter.js +12 -3
- package/lib/factory/registerShippingDelivery.d.ts +2 -2
- package/lib/factory/registerShippingDelivery.js +12 -3
- package/lib/factory/registerVirtualWarehousing.d.ts +2 -2
- package/lib/factory/registerVirtualWarehousing.js +12 -3
- package/lib/factory/registerWorker.d.ts +2 -1
- package/lib/factory/registerWorker.js +12 -3
- package/lib/services/createDownloadStream.js +1 -1
- package/lib/services/createFileDownloadURL.js +2 -1
- package/lib/services/createSignedURL.js +2 -1
- package/lib/services/linkFileService.js +1 -1
- package/lib/services/removeFiles.js +1 -1
- package/lib/services/uploadFileFromStream.js +2 -1
- package/lib/services/uploadFileFromURL.js +2 -1
- package/package.json +20 -20
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FilterAdapter
|
|
1
|
+
import { FilterAdapter } from "../core-index.js";
|
|
2
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
2
3
|
export default function registerAssortmentSearchFilter({ orderIndex = 0, search, }) {
|
|
3
|
-
|
|
4
|
+
const adapter = {
|
|
4
5
|
...FilterAdapter,
|
|
5
6
|
key: `shop.unchained.filters.assortment-search-${crypto.randomUUID()}`,
|
|
6
7
|
label: 'Assortment Search Filter (auto-generated)',
|
|
@@ -19,5 +20,13 @@ export default function registerAssortmentSearchFilter({ orderIndex = 0, search,
|
|
|
19
20
|
},
|
|
20
21
|
};
|
|
21
22
|
},
|
|
22
|
-
}
|
|
23
|
+
};
|
|
24
|
+
const plugin = {
|
|
25
|
+
key: adapter.key,
|
|
26
|
+
label: adapter.label,
|
|
27
|
+
version: adapter.version,
|
|
28
|
+
adapters: [adapter],
|
|
29
|
+
};
|
|
30
|
+
pluginRegistry.register(plugin);
|
|
31
|
+
return plugin;
|
|
23
32
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PaymentConfiguration } from '@unchainedshop/core-payment';
|
|
2
|
-
import { type PaymentContext, type PaymentChargeActionResult } from '../core-index.ts';
|
|
2
|
+
import { type PaymentContext, type PaymentChargeActionResult, type IPlugin } from '../core-index.ts';
|
|
3
3
|
export default function registerInvoicePayment({ adapterId, active, payLaterAllowed, charge, }: {
|
|
4
4
|
adapterId: string;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
payLaterAllowed?: boolean;
|
|
7
7
|
charge: false | ((configuration: PaymentConfiguration, context: PaymentContext) => Promise<PaymentChargeActionResult | false>);
|
|
8
|
-
}):
|
|
8
|
+
}): IPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PaymentAdapter,
|
|
1
|
+
import { PaymentAdapter, } from "../core-index.js";
|
|
2
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
2
3
|
import { PaymentProviderType } from '@unchainedshop/core-payment';
|
|
3
4
|
export default function registerInvoicePayment({ adapterId, active, payLaterAllowed, charge, }) {
|
|
4
|
-
|
|
5
|
+
const adapter = {
|
|
5
6
|
...PaymentAdapter,
|
|
6
7
|
key: `shop.unchained.payment.invoice-${adapterId}`,
|
|
7
8
|
label: 'Invoice Payment: ' + adapterId,
|
|
@@ -27,5 +28,13 @@ export default function registerInvoicePayment({ adapterId, active, payLaterAllo
|
|
|
27
28
|
},
|
|
28
29
|
};
|
|
29
30
|
},
|
|
30
|
-
}
|
|
31
|
+
};
|
|
32
|
+
const plugin = {
|
|
33
|
+
key: adapter.key,
|
|
34
|
+
label: adapter.label,
|
|
35
|
+
version: adapter.version,
|
|
36
|
+
adapters: [adapter],
|
|
37
|
+
};
|
|
38
|
+
pluginRegistry.register(plugin);
|
|
39
|
+
return plugin;
|
|
31
40
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { WarehousingConfiguration } from '@unchainedshop/core-warehousing';
|
|
2
|
-
import { type WarehousingContext } from '../core-index.ts';
|
|
2
|
+
import { type WarehousingContext, type IPlugin } from '../core-index.ts';
|
|
3
3
|
export default function registerPhysicalWarehousing({ adapterId, orderIndex, stock, productionTime, commissioningTime, }: {
|
|
4
4
|
adapterId: string;
|
|
5
5
|
orderIndex?: number;
|
|
6
6
|
stock?: number | ((referenceDate: Date, configuration: WarehousingConfiguration, context: WarehousingContext) => Promise<number>);
|
|
7
7
|
productionTime?: number | ((quantityToProduct: number, configuration: WarehousingConfiguration, context: WarehousingContext) => Promise<number>);
|
|
8
8
|
commissioningTime?: number | ((quantity: number, configuration: WarehousingConfiguration, context: WarehousingContext) => Promise<number>);
|
|
9
|
-
}):
|
|
9
|
+
}): IPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
|
|
2
|
-
import { WarehousingAdapter,
|
|
2
|
+
import { WarehousingAdapter, } from "../core-index.js";
|
|
3
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
3
4
|
export default function registerPhysicalWarehousing({ adapterId, orderIndex = 0, stock, productionTime, commissioningTime, }) {
|
|
4
|
-
|
|
5
|
+
const adapter = {
|
|
5
6
|
...WarehousingAdapter,
|
|
6
7
|
key: 'shop.unchained.warehousing.physical.' + adapterId,
|
|
7
8
|
label: 'Physical Warehousing: ' + adapterId,
|
|
@@ -49,5 +50,13 @@ export default function registerPhysicalWarehousing({ adapterId, orderIndex = 0,
|
|
|
49
50
|
},
|
|
50
51
|
};
|
|
51
52
|
},
|
|
52
|
-
}
|
|
53
|
+
};
|
|
54
|
+
const plugin = {
|
|
55
|
+
key: adapter.key,
|
|
56
|
+
label: adapter.label,
|
|
57
|
+
version: adapter.version,
|
|
58
|
+
adapters: [adapter],
|
|
59
|
+
};
|
|
60
|
+
pluginRegistry.register(plugin);
|
|
61
|
+
return plugin;
|
|
53
62
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DeliveryConfiguration, type DeliveryLocation } from '@unchainedshop/core-delivery';
|
|
2
|
-
import { type DeliveryContext } from '../core-index.ts';
|
|
2
|
+
import { type DeliveryContext, type IPlugin } from '../core-index.ts';
|
|
3
3
|
import type { Work } from '@unchainedshop/core-worker';
|
|
4
4
|
export default function registerPickUpDelivery({ adapterId, locations, active, autoReleaseAllowed, estimatedDeliveryThroughput, send, }: {
|
|
5
5
|
adapterId: string;
|
|
@@ -8,4 +8,4 @@ export default function registerPickUpDelivery({ adapterId, locations, active, a
|
|
|
8
8
|
estimatedDeliveryThroughput?: (warehousingThroughputTime: number, context: DeliveryContext) => Promise<number | null>;
|
|
9
9
|
send: boolean | ((configuration: DeliveryConfiguration, context: DeliveryContext) => Promise<boolean | Work>);
|
|
10
10
|
locations: DeliveryLocation[] | ((context: DeliveryContext) => Promise<DeliveryLocation[]>);
|
|
11
|
-
}):
|
|
11
|
+
}): IPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DeliveryProviderType, } from '@unchainedshop/core-delivery';
|
|
2
|
-
import { DeliveryAdapter,
|
|
2
|
+
import { DeliveryAdapter, } from "../core-index.js";
|
|
3
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
3
4
|
export default function registerPickUpDelivery({ adapterId, locations, active, autoReleaseAllowed, estimatedDeliveryThroughput, send, }) {
|
|
4
|
-
|
|
5
|
+
const adapter = {
|
|
5
6
|
...DeliveryAdapter,
|
|
6
7
|
key: `shop.unchained.delivery.pickup-${adapterId}`,
|
|
7
8
|
label: 'PickUp Delivery: ' + adapterId,
|
|
@@ -41,5 +42,13 @@ export default function registerPickUpDelivery({ adapterId, locations, active, a
|
|
|
41
42
|
},
|
|
42
43
|
};
|
|
43
44
|
},
|
|
44
|
-
}
|
|
45
|
+
};
|
|
46
|
+
const plugin = {
|
|
47
|
+
key: adapter.key,
|
|
48
|
+
label: adapter.label,
|
|
49
|
+
version: adapter.version,
|
|
50
|
+
adapters: [adapter],
|
|
51
|
+
};
|
|
52
|
+
pluginRegistry.register(plugin);
|
|
53
|
+
return plugin;
|
|
45
54
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FilterAdapter
|
|
1
|
+
import { FilterAdapter } from "../core-index.js";
|
|
2
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
2
3
|
export default function registerProductDiscoverabilityFilter({ orderIndex = 0, hiddenTagValue = 'hidden', }) {
|
|
3
|
-
|
|
4
|
+
const adapter = {
|
|
4
5
|
...FilterAdapter,
|
|
5
6
|
key: `shop.unchained.filters.product-discoverability-${crypto.randomUUID()}`,
|
|
6
7
|
label: 'Product Discoverability Filter (auto-generated)',
|
|
@@ -22,5 +23,13 @@ export default function registerProductDiscoverabilityFilter({ orderIndex = 0, h
|
|
|
22
23
|
},
|
|
23
24
|
};
|
|
24
25
|
},
|
|
25
|
-
}
|
|
26
|
+
};
|
|
27
|
+
const plugin = {
|
|
28
|
+
key: adapter.key,
|
|
29
|
+
label: adapter.label,
|
|
30
|
+
version: adapter.version,
|
|
31
|
+
adapters: [adapter],
|
|
32
|
+
};
|
|
33
|
+
pluginRegistry.register(plugin);
|
|
34
|
+
return plugin;
|
|
26
35
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
+
import { type IPlugin } from '../core-index.ts';
|
|
2
3
|
export default function registerProductSearchFilter({ orderIndex, search, }: {
|
|
3
4
|
orderIndex?: number;
|
|
4
5
|
search: (params: SearchQuery & {
|
|
5
6
|
queryString: string;
|
|
6
7
|
locale: Intl.Locale;
|
|
7
8
|
}) => Promise<string[]>;
|
|
8
|
-
}):
|
|
9
|
+
}): IPlugin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FilterAdapter
|
|
1
|
+
import { FilterAdapter } from "../core-index.js";
|
|
2
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
2
3
|
export default function registerProductSearchFilter({ orderIndex = 0, search, }) {
|
|
3
|
-
|
|
4
|
+
const adapter = {
|
|
4
5
|
...FilterAdapter,
|
|
5
6
|
key: `shop.unchained.filters.product-search-${crypto.randomUUID()}`,
|
|
6
7
|
label: 'Product Search Filter (auto-generated)',
|
|
@@ -19,5 +20,13 @@ export default function registerProductSearchFilter({ orderIndex = 0, search, })
|
|
|
19
20
|
},
|
|
20
21
|
};
|
|
21
22
|
},
|
|
22
|
-
}
|
|
23
|
+
};
|
|
24
|
+
const plugin = {
|
|
25
|
+
key: adapter.key,
|
|
26
|
+
label: adapter.label,
|
|
27
|
+
version: adapter.version,
|
|
28
|
+
adapters: [adapter],
|
|
29
|
+
};
|
|
30
|
+
pluginRegistry.register(plugin);
|
|
31
|
+
return plugin;
|
|
23
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DeliveryConfiguration } from '@unchainedshop/core-delivery';
|
|
2
|
-
import { type DeliveryContext } from '../core-index.ts';
|
|
2
|
+
import { type DeliveryContext, type IPlugin } from '../core-index.ts';
|
|
3
3
|
import type { Work } from '@unchainedshop/core-worker';
|
|
4
4
|
export default function registerShippingDelivery({ adapterId, active, autoReleaseAllowed, estimatedDeliveryThroughput, send, }: {
|
|
5
5
|
adapterId: string;
|
|
@@ -7,4 +7,4 @@ export default function registerShippingDelivery({ adapterId, active, autoReleas
|
|
|
7
7
|
autoReleaseAllowed?: boolean;
|
|
8
8
|
estimatedDeliveryThroughput?: (warehousingThroughputTime: number, context: DeliveryContext) => Promise<number | null>;
|
|
9
9
|
send: boolean | ((configuration: DeliveryConfiguration, context: DeliveryContext) => Promise<boolean | Work>);
|
|
10
|
-
}):
|
|
10
|
+
}): IPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
2
|
-
import { DeliveryAdapter,
|
|
2
|
+
import { DeliveryAdapter, } from "../core-index.js";
|
|
3
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
3
4
|
export default function registerShippingDelivery({ adapterId, active, autoReleaseAllowed, estimatedDeliveryThroughput, send, }) {
|
|
4
|
-
|
|
5
|
+
const adapter = {
|
|
5
6
|
...DeliveryAdapter,
|
|
6
7
|
key: `shop.unchained.delivery.shipping-${adapterId}`,
|
|
7
8
|
label: 'Shipping Delivery: ' + adapterId,
|
|
@@ -33,5 +34,13 @@ export default function registerShippingDelivery({ adapterId, active, autoReleas
|
|
|
33
34
|
},
|
|
34
35
|
};
|
|
35
36
|
},
|
|
36
|
-
}
|
|
37
|
+
};
|
|
38
|
+
const plugin = {
|
|
39
|
+
key: adapter.key,
|
|
40
|
+
label: adapter.label,
|
|
41
|
+
version: adapter.version,
|
|
42
|
+
adapters: [adapter],
|
|
43
|
+
};
|
|
44
|
+
pluginRegistry.register(plugin);
|
|
45
|
+
return plugin;
|
|
37
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TokenSurrogate, type WarehousingConfiguration } from '@unchainedshop/core-warehousing';
|
|
2
|
-
import { type WarehousingContext } from '../core-index.ts';
|
|
2
|
+
import { type WarehousingContext, type IPlugin } from '../core-index.ts';
|
|
3
3
|
export default function registerVirtualWarehousing<Metadata = Record<string, any>>({ adapterId, orderIndex, stock, tokenize, tokenMetadata, isInvalidateable, }: {
|
|
4
4
|
adapterId: string;
|
|
5
5
|
orderIndex?: number;
|
|
@@ -7,4 +7,4 @@ export default function registerVirtualWarehousing<Metadata = Record<string, any
|
|
|
7
7
|
tokenize: (configuration: WarehousingConfiguration, context: WarehousingContext) => Promise<Omit<TokenSurrogate, 'userId' | 'productId' | 'orderPositionId'>[]>;
|
|
8
8
|
tokenMetadata?: (serialNumber: string, referenceDate: Date, configuration: WarehousingConfiguration, context: WarehousingContext) => Promise<Metadata>;
|
|
9
9
|
isInvalidateable?: (serialNumber: string, referenceDate: Date, configuration: WarehousingConfiguration, context: WarehousingContext) => Promise<boolean>;
|
|
10
|
-
}):
|
|
10
|
+
}): IPlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WarehousingProviderType, } from '@unchainedshop/core-warehousing';
|
|
2
|
-
import { WarehousingAdapter,
|
|
2
|
+
import { WarehousingAdapter, } from "../core-index.js";
|
|
3
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
3
4
|
export default function registerVirtualWarehousing({ adapterId, orderIndex = 0, stock, tokenize, tokenMetadata, isInvalidateable, }) {
|
|
4
|
-
|
|
5
|
+
const adapter = {
|
|
5
6
|
...WarehousingAdapter,
|
|
6
7
|
key: 'shop.unchained.warehousing.virtual.' + adapterId,
|
|
7
8
|
label: 'Virtual Wareshousing: ' + adapterId,
|
|
@@ -46,5 +47,13 @@ export default function registerVirtualWarehousing({ adapterId, orderIndex = 0,
|
|
|
46
47
|
},
|
|
47
48
|
};
|
|
48
49
|
},
|
|
49
|
-
}
|
|
50
|
+
};
|
|
51
|
+
const plugin = {
|
|
52
|
+
key: adapter.key,
|
|
53
|
+
label: adapter.label,
|
|
54
|
+
version: adapter.version,
|
|
55
|
+
adapters: [adapter],
|
|
56
|
+
};
|
|
57
|
+
pluginRegistry.register(plugin);
|
|
58
|
+
return plugin;
|
|
50
59
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type IPlugin } from '../core-index.ts';
|
|
1
2
|
export default function registerWorker<Input = any, Result = any>({ type, external, maxParallelAllocations, process, }: {
|
|
2
3
|
type: string;
|
|
3
4
|
external?: boolean;
|
|
4
5
|
maxParallelAllocations?: number;
|
|
5
6
|
process?: (input: Input, workId: string) => Promise<Result>;
|
|
6
|
-
}):
|
|
7
|
+
}): IPlugin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { WorkerAdapter
|
|
1
|
+
import { WorkerAdapter } from "../core-index.js";
|
|
2
|
+
import { pluginRegistry } from "../plugins/PluginRegistry.js";
|
|
2
3
|
export default function registerWorker({ type, external, maxParallelAllocations, process, }) {
|
|
3
|
-
|
|
4
|
+
const adapter = {
|
|
4
5
|
...WorkerAdapter,
|
|
5
6
|
key: 'shop.unchained.worker.' + type.toLowerCase(),
|
|
6
7
|
label: 'Worker: ' + type,
|
|
@@ -30,5 +31,13 @@ export default function registerWorker({ type, external, maxParallelAllocations,
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
|
-
}
|
|
34
|
+
};
|
|
35
|
+
const plugin = {
|
|
36
|
+
key: adapter.key,
|
|
37
|
+
label: adapter.label,
|
|
38
|
+
version: adapter.version,
|
|
39
|
+
adapters: [adapter],
|
|
40
|
+
};
|
|
41
|
+
pluginRegistry.register(plugin);
|
|
42
|
+
return plugin;
|
|
34
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFileAdapter } from
|
|
1
|
+
import { getFileAdapter } from "../utils/getFileAdapter.js";
|
|
2
2
|
export async function createDownloadStreamService({ fileId, }) {
|
|
3
3
|
const fileAdapter = getFileAdapter();
|
|
4
4
|
const file = await this.files.findFile({ fileId });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '@unchainedshop/core-files';
|
|
2
|
+
import { getFileAdapter } from "../utils/getFileAdapter.js";
|
|
2
3
|
export async function createFileDownloadURLService({ file, expires, params = {}, }) {
|
|
3
4
|
if (!file)
|
|
4
5
|
return null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getFileFromFileData
|
|
1
|
+
import { getFileFromFileData } from '@unchainedshop/core-files';
|
|
2
|
+
import { getFileAdapter } from "../utils/getFileAdapter.js";
|
|
2
3
|
export async function createSignedURLService({ directoryName, fileName, meta }) {
|
|
3
4
|
const fileUploadAdapter = getFileAdapter();
|
|
4
5
|
const preparedFileData = await fileUploadAdapter.createSignedURL(directoryName, fileName, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFileAdapter } from
|
|
1
|
+
import { getFileAdapter } from "../utils/getFileAdapter.js";
|
|
2
2
|
export async function removeFilesService({ fileIds }) {
|
|
3
3
|
if (fileIds && typeof fileIds !== 'string' && !Array.isArray(fileIds))
|
|
4
4
|
throw Error('Media id/s to be removed not provided as a string or array');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getFileFromFileData
|
|
1
|
+
import { getFileFromFileData } from '@unchainedshop/core-files';
|
|
2
|
+
import { getFileAdapter } from "../utils/getFileAdapter.js";
|
|
2
3
|
export async function uploadFileFromStreamService({ directoryName, rawFile, meta, ...options }) {
|
|
3
4
|
const fileUploadAdapter = getFileAdapter();
|
|
4
5
|
const uploadFileData = await fileUploadAdapter.uploadFileFromStream(directoryName, rawFile, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getFileFromFileData
|
|
1
|
+
import { getFileFromFileData } from '@unchainedshop/core-files';
|
|
2
|
+
import { getFileAdapter } from "../utils/getFileAdapter.js";
|
|
2
3
|
export async function uploadFileFromURLService({ directoryName, fileInput, meta, }) {
|
|
3
4
|
const fileUploadAdapter = getFileAdapter();
|
|
4
5
|
const uploadFileData = await fileUploadAdapter.uploadFileFromURL(directoryName, fileInput, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core",
|
|
3
3
|
"description": "Core orchestration package for the Unchained Engine with business services and directors",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-alpha.1",
|
|
5
5
|
"main": "lib/core-index.js",
|
|
6
6
|
"types": "lib/core-index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unchainedshop/core-assortments": "^
|
|
39
|
-
"@unchainedshop/core-bookmarks": "^
|
|
40
|
-
"@unchainedshop/core-countries": "^
|
|
41
|
-
"@unchainedshop/core-currencies": "^
|
|
42
|
-
"@unchainedshop/core-delivery": "^
|
|
43
|
-
"@unchainedshop/core-enrollments": "^
|
|
44
|
-
"@unchainedshop/core-events": "^
|
|
45
|
-
"@unchainedshop/core-files": "^
|
|
46
|
-
"@unchainedshop/core-filters": "^
|
|
47
|
-
"@unchainedshop/core-languages": "^
|
|
48
|
-
"@unchainedshop/core-orders": "^
|
|
49
|
-
"@unchainedshop/core-payment": "^
|
|
50
|
-
"@unchainedshop/core-products": "^
|
|
51
|
-
"@unchainedshop/core-quotations": "^
|
|
52
|
-
"@unchainedshop/core-users": "^
|
|
53
|
-
"@unchainedshop/core-warehousing": "^
|
|
54
|
-
"@unchainedshop/core-worker": "^
|
|
55
|
-
"@unchainedshop/logger": "^
|
|
56
|
-
"@unchainedshop/utils": "^
|
|
38
|
+
"@unchainedshop/core-assortments": "^5.0.0-alpha.1",
|
|
39
|
+
"@unchainedshop/core-bookmarks": "^5.0.0-alpha.1",
|
|
40
|
+
"@unchainedshop/core-countries": "^5.0.0-alpha.1",
|
|
41
|
+
"@unchainedshop/core-currencies": "^5.0.0-alpha.1",
|
|
42
|
+
"@unchainedshop/core-delivery": "^5.0.0-alpha.1",
|
|
43
|
+
"@unchainedshop/core-enrollments": "^5.0.0-alpha.1",
|
|
44
|
+
"@unchainedshop/core-events": "^5.0.0-alpha.1",
|
|
45
|
+
"@unchainedshop/core-files": "^5.0.0-alpha.1",
|
|
46
|
+
"@unchainedshop/core-filters": "^5.0.0-alpha.1",
|
|
47
|
+
"@unchainedshop/core-languages": "^5.0.0-alpha.1",
|
|
48
|
+
"@unchainedshop/core-orders": "^5.0.0-alpha.1",
|
|
49
|
+
"@unchainedshop/core-payment": "^5.0.0-alpha.1",
|
|
50
|
+
"@unchainedshop/core-products": "^5.0.0-alpha.1",
|
|
51
|
+
"@unchainedshop/core-quotations": "^5.0.0-alpha.1",
|
|
52
|
+
"@unchainedshop/core-users": "^5.0.0-alpha.1",
|
|
53
|
+
"@unchainedshop/core-warehousing": "^5.0.0-alpha.1",
|
|
54
|
+
"@unchainedshop/core-worker": "^5.0.0-alpha.1",
|
|
55
|
+
"@unchainedshop/logger": "^5.0.0-alpha.1",
|
|
56
|
+
"@unchainedshop/utils": "^5.0.0-alpha.1",
|
|
57
57
|
"minipass-json-stream": "^1.0.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|