@unchainedshop/plugins 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/README.md +0 -2
- package/lib/events/node-event-emitter.d.ts +3 -1
- package/lib/events/node-event-emitter.js +3 -3
- package/lib/files/gridfs/adapter.d.ts +2 -2
- package/lib/files/gridfs/adapter.js +2 -5
- package/lib/files/gridfs/index.d.ts +5 -4
- package/lib/files/gridfs/index.js +30 -3
- package/lib/files/minio/api.js +1 -2
- package/lib/files/minio/index.d.ts +4 -5
- package/lib/files/minio/index.js +18 -157
- package/lib/files/temp-upload/api.d.ts +2 -0
- package/lib/files/temp-upload/api.js +1 -2
- package/lib/payment/apple-iap/adapter.d.ts +2 -1
- package/lib/payment/apple-iap/adapter.js +2 -3
- package/lib/payment/apple-iap/api.js +1 -1
- package/lib/payment/apple-iap/index.d.ts +6 -4
- package/lib/payment/apple-iap/index.js +28 -3
- package/lib/payment/cryptopay/api.js +1 -1
- package/lib/payment/cryptopay/handle-webhook.js +2 -1
- package/lib/payment/cryptopay/index.d.ts +5 -4
- package/lib/payment/cryptopay/index.js +31 -3
- package/lib/payment/datatrans-v2/adapter.js +11 -3
- package/lib/payment/datatrans-v2/api/authorize.js +1 -1
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js +1 -1
- package/lib/payment/datatrans-v2/api/cancel.js +1 -1
- package/lib/payment/datatrans-v2/api/init.js +1 -1
- package/lib/payment/datatrans-v2/api/secureFields.js +1 -1
- package/lib/payment/datatrans-v2/api/settle.js +1 -1
- package/lib/payment/datatrans-v2/api/status.js +1 -1
- package/lib/payment/datatrans-v2/api/validate.js +1 -1
- package/lib/payment/datatrans-v2/index.d.ts +4 -1
- package/lib/payment/datatrans-v2/index.js +17 -411
- package/lib/payment/payrexx/api/index.js +2 -2
- package/lib/payment/payrexx/api.js +1 -1
- package/lib/payment/payrexx/index.d.ts +4 -1
- package/lib/payment/payrexx/index.js +19 -158
- package/lib/payment/postfinance-checkout/index.d.ts +5 -0
- package/lib/payment/postfinance-checkout/index.js +25 -186
- package/lib/payment/saferpay/adapter.js +1 -2
- package/lib/payment/saferpay/index.d.ts +5 -4
- package/lib/payment/saferpay/index.js +29 -3
- package/lib/payment/stripe/index.d.ts +4 -1
- package/lib/payment/stripe/index.js +22 -116
- package/lib/payment/stripe/stripe.js +1 -4
- package/lib/presets/all.d.ts +1 -70
- package/lib/presets/all.js +41 -27
- package/lib/presets/base.d.ts +1 -25
- package/lib/presets/base.js +56 -25
- package/lib/presets/countries/ch.d.ts +1 -2
- package/lib/presets/countries/ch.js +7 -2
- package/lib/presets/crypto.d.ts +3 -7
- package/lib/presets/crypto.js +18 -7
- package/lib/worker/bulk-import/api.d.ts +2 -0
- package/lib/worker/bulk-import/api.js +1 -2
- package/lib/worker/bulkgate/adapter.js +1 -1
- package/lib/worker/twilio/adapter.js +1 -1
- package/lib/worker/update-coinbase-rates/adapter.js +3 -5
- package/package.json +25 -30
package/lib/presets/base.js
CHANGED
|
@@ -1,25 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../pricing/
|
|
10
|
-
import "../pricing/
|
|
11
|
-
import "../pricing/
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../worker/
|
|
21
|
-
import "../worker/
|
|
22
|
-
import "../worker/
|
|
23
|
-
import "../worker/
|
|
24
|
-
import
|
|
25
|
-
|
|
1
|
+
import { pluginRegistry } from '@unchainedshop/core';
|
|
2
|
+
import { setEmitAdapter } from '@unchainedshop/events';
|
|
3
|
+
import { GridFSPlugin } from "../files/gridfs/index.js";
|
|
4
|
+
import { TempUploadPlugin } from "../files/temp-upload/index.js";
|
|
5
|
+
import { InvoicePlugin } from "../payment/invoice/index.js";
|
|
6
|
+
import { PostPlugin } from "../delivery/post/index.js";
|
|
7
|
+
import { StorePlugin } from "../warehousing/store/index.js";
|
|
8
|
+
import { ERCMetadataPlugin } from "../warehousing/erc-metadata/index.js";
|
|
9
|
+
import { PaymentFreePricePlugin } from "../pricing/free-payment/index.js";
|
|
10
|
+
import { DeliveryFreePricePlugin } from "../pricing/free-delivery/index.js";
|
|
11
|
+
import { OrderItemsPlugin } from "../pricing/order-items/index.js";
|
|
12
|
+
import { OrderDiscountPlugin } from "../pricing/order-discount/index.js";
|
|
13
|
+
import { OrderDeliveryPlugin } from "../pricing/order-delivery/index.js";
|
|
14
|
+
import { OrderPaymentPlugin } from "../pricing/order-payment/index.js";
|
|
15
|
+
import { ProductPricePlugin } from "../pricing/product-catalog-price/index.js";
|
|
16
|
+
import { ProductDiscountPlugin } from "../pricing/product-discount/index.js";
|
|
17
|
+
import { ManualOfferingPlugin } from "../quotations/manual/index.js";
|
|
18
|
+
import { LicensedEnrollmentsPlugin } from "../enrollments/licensed/index.js";
|
|
19
|
+
import { NodeEventEmitter } from "../events/node-event-emitter.js";
|
|
20
|
+
import { BulkImportPlugin } from "../worker/bulk-import/index.js";
|
|
21
|
+
import { ZombieKillerPlugin } from "../worker/zombie-killer/index.js";
|
|
22
|
+
import { MessagePlugin } from "../worker/message/index.js";
|
|
23
|
+
import { ExternalPlugin } from "../worker/external/index.js";
|
|
24
|
+
import { HttpRequestPlugin } from "../worker/http-request/index.js";
|
|
25
|
+
import { HeartbeatPlugin } from "../worker/heartbeat/index.js";
|
|
26
|
+
import { EmailPlugin } from "../worker/email/index.js";
|
|
27
|
+
import { ErrorNotificationsPlugin } from "../worker/error-notifications/index.js";
|
|
28
|
+
import { BulkExportPlugin } from "../worker/bulk-export/index.js";
|
|
29
|
+
export function registerBasePlugins() {
|
|
30
|
+
pluginRegistry.register(GridFSPlugin);
|
|
31
|
+
pluginRegistry.register(TempUploadPlugin);
|
|
32
|
+
pluginRegistry.register(InvoicePlugin);
|
|
33
|
+
pluginRegistry.register(PostPlugin);
|
|
34
|
+
pluginRegistry.register(StorePlugin);
|
|
35
|
+
pluginRegistry.register(ERCMetadataPlugin);
|
|
36
|
+
pluginRegistry.register(PaymentFreePricePlugin);
|
|
37
|
+
pluginRegistry.register(DeliveryFreePricePlugin);
|
|
38
|
+
pluginRegistry.register(OrderItemsPlugin);
|
|
39
|
+
pluginRegistry.register(OrderDiscountPlugin);
|
|
40
|
+
pluginRegistry.register(OrderDeliveryPlugin);
|
|
41
|
+
pluginRegistry.register(OrderPaymentPlugin);
|
|
42
|
+
pluginRegistry.register(ProductPricePlugin);
|
|
43
|
+
pluginRegistry.register(ProductDiscountPlugin);
|
|
44
|
+
pluginRegistry.register(ManualOfferingPlugin);
|
|
45
|
+
pluginRegistry.register(LicensedEnrollmentsPlugin);
|
|
46
|
+
setEmitAdapter(NodeEventEmitter());
|
|
47
|
+
pluginRegistry.register(BulkImportPlugin);
|
|
48
|
+
pluginRegistry.register(ZombieKillerPlugin);
|
|
49
|
+
pluginRegistry.register(MessagePlugin);
|
|
50
|
+
pluginRegistry.register(ExternalPlugin);
|
|
51
|
+
pluginRegistry.register(HttpRequestPlugin);
|
|
52
|
+
pluginRegistry.register(HeartbeatPlugin);
|
|
53
|
+
pluginRegistry.register(EmailPlugin);
|
|
54
|
+
pluginRegistry.register(ErrorNotificationsPlugin);
|
|
55
|
+
pluginRegistry.register(BulkExportPlugin);
|
|
56
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import '../../pricing/delivery-swiss-tax.ts';
|
|
1
|
+
export declare function registerSwissTaxPlugins(): void;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import "../../pricing/product-swiss-tax.js";
|
|
2
|
-
import "../../pricing/delivery-swiss-tax.js";
|
|
1
|
+
import { ProductSwissTaxPlugin } from "../../pricing/product-swiss-tax/index.js";
|
|
2
|
+
import { DeliverySwissTaxPlugin } from "../../pricing/delivery-swiss-tax/index.js";
|
|
3
|
+
import { pluginRegistry } from '@unchainedshop/core';
|
|
4
|
+
export function registerSwissTaxPlugins() {
|
|
5
|
+
pluginRegistry.register(ProductSwissTaxPlugin);
|
|
6
|
+
pluginRegistry.register(DeliverySwissTaxPlugin);
|
|
7
|
+
}
|
package/lib/presets/crypto.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import '../worker/update-ecb-rates.ts';
|
|
5
|
-
import '../worker/update-coinbase-rates.ts';
|
|
6
|
-
import '../worker/export-token.ts';
|
|
7
|
-
export default cryptopayModules;
|
|
1
|
+
declare const _default: {};
|
|
2
|
+
export default _default;
|
|
3
|
+
export declare function registerCryptoPlugins(): void;
|
package/lib/presets/crypto.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../worker/
|
|
6
|
-
import "../worker/
|
|
7
|
-
|
|
1
|
+
import { pluginRegistry } from '@unchainedshop/core';
|
|
2
|
+
import { CryptopayPlugin } from "../payment/cryptopay/index.js";
|
|
3
|
+
import { ETHMinterPlugin } from "../warehousing/eth-minter/index.js";
|
|
4
|
+
import { ProductPriceRateConversionPlugin } from "../pricing/product-price-rateconversion/index.js";
|
|
5
|
+
import { ExportTokenPlugin } from "../worker/export-token/index.js";
|
|
6
|
+
import { UpdateECBRatesPlugin } from "../worker/update-ecb-rates/index.js";
|
|
7
|
+
import { UpdateCoinbaseRatesPlugin } from "../worker/update-coinbase-rates/index.js";
|
|
8
|
+
import { UpdateTokenOwnershipPlugin } from "../worker/update-token-ownership/index.js";
|
|
9
|
+
export default {};
|
|
10
|
+
export function registerCryptoPlugins() {
|
|
11
|
+
pluginRegistry.register(CryptopayPlugin);
|
|
12
|
+
pluginRegistry.register(ETHMinterPlugin);
|
|
13
|
+
pluginRegistry.register(ProductPriceRateConversionPlugin);
|
|
14
|
+
pluginRegistry.register(ExportTokenPlugin);
|
|
15
|
+
pluginRegistry.register(UpdateECBRatesPlugin);
|
|
16
|
+
pluginRegistry.register(UpdateCoinbaseRatesPlugin);
|
|
17
|
+
pluginRegistry.register(UpdateTokenOwnershipPlugin);
|
|
18
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import type { RolesInterface } from '@unchainedshop/roles';
|
|
2
3
|
export declare function bulkImportHandler(request: Request, context: UnchainedCore & {
|
|
3
4
|
params: Record<string, string>;
|
|
4
5
|
rawRequest?: any;
|
|
6
|
+
roles?: RolesInterface;
|
|
5
7
|
userId?: string;
|
|
6
8
|
user?: any;
|
|
7
9
|
}): Promise<Response>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
-
import { Roles } from '@unchainedshop/roles';
|
|
3
2
|
const logger = createLogger('unchained:bulk-import');
|
|
4
3
|
export async function bulkImportHandler(request, context) {
|
|
5
4
|
try {
|
|
6
|
-
const hasPermission = await
|
|
5
|
+
const hasPermission = await context.roles?.userHasPermission(context, 'bulkImport', []);
|
|
7
6
|
if (!hasPermission) {
|
|
8
7
|
return Response.json({ error: 'Permission denied', message: 'User does not have bulkImport permission' }, { status: 403 });
|
|
9
8
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { WorkerAdapter, WorkerDirector, schedule } from '@unchainedshop/core';
|
|
2
2
|
import { resolveBestCurrency } from '@unchainedshop/utils';
|
|
3
3
|
const getExchangeRates = async (base) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.then((res) => res.json())
|
|
8
|
-
.then((r) => r?.data);
|
|
4
|
+
const res = await fetch(`https://api.coinbase.com/v2/exchange-rates?currency=${base}`);
|
|
5
|
+
const { data } = (await res.json());
|
|
6
|
+
return data;
|
|
9
7
|
};
|
|
10
8
|
const everyMinute = schedule.parse.cron('* * * * *');
|
|
11
9
|
export const UpdateCoinbaseRates = {
|
package/package.json
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/plugins",
|
|
3
3
|
"description": "Official plugin collection for the Unchained Engine with payment, delivery, and pricing adapters",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-alpha.1",
|
|
5
5
|
"main": "lib/plugins-index.js",
|
|
6
6
|
"types": "lib/plugins-index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
"
|
|
8
|
+
"./presets/*": "./lib/presets/*.js",
|
|
9
|
+
"./presets/countries/*": "./lib/presets/countries/*.js",
|
|
10
|
+
"./events/*": "./lib/events/*.js",
|
|
11
|
+
"./enrollments/*": "./lib/enrollments/*/index.js",
|
|
12
|
+
"./quotations/*": "./lib/quotations/*/index.js",
|
|
13
|
+
"./filters/*": "./lib/filters/*/index.js",
|
|
14
|
+
"./delivery/*": "./lib/delivery/*/index.js",
|
|
15
|
+
"./warehousing/*": "./lib/warehousing/*/index.js",
|
|
16
|
+
"./payment/*": "./lib/payment/*/index.js",
|
|
17
|
+
"./files/*": "./lib/files/*/index.js",
|
|
18
|
+
"./pricing/*": "./lib/pricing/*/index.js",
|
|
19
|
+
"./worker/*": "./lib/worker/*/index.js"
|
|
9
20
|
},
|
|
10
21
|
"type": "module",
|
|
11
22
|
"scripts": {
|
|
@@ -37,32 +48,28 @@
|
|
|
37
48
|
},
|
|
38
49
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
39
50
|
"dependencies": {
|
|
40
|
-
"@unchainedshop/api": "^
|
|
41
|
-
"@unchainedshop/core-delivery": "^
|
|
42
|
-
"@unchainedshop/core-enrollments": "^
|
|
43
|
-
"@unchainedshop/core-orders": "^
|
|
44
|
-
"@unchainedshop/core-payment": "^
|
|
45
|
-
"@unchainedshop/core-products": "^
|
|
46
|
-
"@unchainedshop/core-warehousing": "^
|
|
47
|
-
"@unchainedshop/core-worker": "^
|
|
48
|
-
"@unchainedshop/events": "^
|
|
49
|
-
"@unchainedshop/
|
|
50
|
-
"@unchainedshop/
|
|
51
|
-
"@unchainedshop/utils": "^4.6.0"
|
|
51
|
+
"@unchainedshop/api": "^5.0.0-alpha.1",
|
|
52
|
+
"@unchainedshop/core-delivery": "^5.0.0-alpha.1",
|
|
53
|
+
"@unchainedshop/core-enrollments": "^5.0.0-alpha.1",
|
|
54
|
+
"@unchainedshop/core-orders": "^5.0.0-alpha.1",
|
|
55
|
+
"@unchainedshop/core-payment": "^5.0.0-alpha.1",
|
|
56
|
+
"@unchainedshop/core-products": "^5.0.0-alpha.1",
|
|
57
|
+
"@unchainedshop/core-warehousing": "^5.0.0-alpha.1",
|
|
58
|
+
"@unchainedshop/core-worker": "^5.0.0-alpha.1",
|
|
59
|
+
"@unchainedshop/events": "^5.0.0-alpha.1",
|
|
60
|
+
"@unchainedshop/logger": "^5.0.0-alpha.1",
|
|
61
|
+
"@unchainedshop/utils": "^5.0.0-alpha.1"
|
|
52
62
|
},
|
|
53
63
|
"peerDependencies": {
|
|
54
64
|
"@aws-sdk/client-eventbridge": ">= 3.714 < 4",
|
|
55
|
-
"@paypal/checkout-server-sdk": "1.x",
|
|
56
65
|
"@redis/client": ">= 1 < 6",
|
|
57
66
|
"@scure/bip32": ">= 2",
|
|
58
67
|
"@scure/btc-signer": ">= 2",
|
|
59
68
|
"mime": ">= 4 < 5",
|
|
60
|
-
"expiry-map": "2.x",
|
|
61
69
|
"express": ">= 5 < 6",
|
|
62
70
|
"fastify": ">= 5.2 < 6",
|
|
63
71
|
"minio": "8.x",
|
|
64
72
|
"nodemailer": ">= 6.9 < 9",
|
|
65
|
-
"p-memoize": "8.x",
|
|
66
73
|
"stripe": ">= 19 < 21",
|
|
67
74
|
"web-push": ">= 3.6 <4",
|
|
68
75
|
"xml-js": ">= 1.6 < 2"
|
|
@@ -71,9 +78,6 @@
|
|
|
71
78
|
"@aws-sdk/client-eventbridge": {
|
|
72
79
|
"optional": true
|
|
73
80
|
},
|
|
74
|
-
"@paypal/checkout-server-sdk": {
|
|
75
|
-
"optional": true
|
|
76
|
-
},
|
|
77
81
|
"@redis/client": {
|
|
78
82
|
"optional": true
|
|
79
83
|
},
|
|
@@ -83,9 +87,6 @@
|
|
|
83
87
|
"@scure/btc-signer": {
|
|
84
88
|
"optional": true
|
|
85
89
|
},
|
|
86
|
-
"expiry-map": {
|
|
87
|
-
"optional": true
|
|
88
|
-
},
|
|
89
90
|
"express": {
|
|
90
91
|
"optional": true
|
|
91
92
|
},
|
|
@@ -98,9 +99,6 @@
|
|
|
98
99
|
"nodemailer": {
|
|
99
100
|
"optional": true
|
|
100
101
|
},
|
|
101
|
-
"p-memoize": {
|
|
102
|
-
"optional": true
|
|
103
|
-
},
|
|
104
102
|
"stripe": {
|
|
105
103
|
"optional": true
|
|
106
104
|
},
|
|
@@ -112,18 +110,15 @@
|
|
|
112
110
|
}
|
|
113
111
|
},
|
|
114
112
|
"devDependencies": {
|
|
115
|
-
"@paypal/checkout-server-sdk": "^1.0.3",
|
|
116
113
|
"@redis/client": "^5.6.0",
|
|
117
114
|
"@scure/bip32": "^2.0.0",
|
|
118
115
|
"@scure/btc-signer": "^2.0.0",
|
|
119
116
|
"@types/express": "^5.0.3",
|
|
120
117
|
"@types/node": "^25.0.0",
|
|
121
|
-
"expiry-map": "^2.0.0",
|
|
122
118
|
"express": "^5.1.0",
|
|
123
119
|
"fastify": "^5.4.0",
|
|
124
120
|
"minio": "^8.0.5",
|
|
125
|
-
"nodemailer": "^8.0.
|
|
126
|
-
"p-memoize": "^8.0.0",
|
|
121
|
+
"nodemailer": "^8.0.1",
|
|
127
122
|
"stripe": "^20.0.0",
|
|
128
123
|
"typescript": "^5.8.3",
|
|
129
124
|
"web-push": "^3.6.7",
|