@unchainedshop/plugins 5.0.0-alpha.1 → 5.0.0-alpha.2
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/filters/local-search/index.js +0 -6
- package/lib/filters/local-search.js +1 -9
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.js +8 -3
- package/lib/payment/cryptopay/module.d.ts +5 -5
- package/lib/payment/cryptopay/module.js +2 -2
- package/lib/payment/payrexx/payrexx.js +4 -4
- package/lib/payment/stripe/stripe.js +1 -1
- package/package.json +3 -3
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import {} from '@unchainedshop/core';
|
|
2
2
|
import { LocalSearch } from "./adapter.js";
|
|
3
|
-
import { isDocumentDBCompatModeEnabled } from '@unchainedshop/mongodb';
|
|
4
3
|
export const LocalSearchPlugin = {
|
|
5
4
|
key: 'shop.unchained.filters.local-search',
|
|
6
5
|
label: 'Local Search Filter Plugin',
|
|
7
6
|
version: '1.0.0',
|
|
8
7
|
adapters: [LocalSearch],
|
|
9
|
-
onRegister: () => {
|
|
10
|
-
if (isDocumentDBCompatModeEnabled()) {
|
|
11
|
-
throw new Error('Full-text search queries have been disabled due to DocumentDB compatibility mode (env UNCHAINED_DOCUMENTDB_COMPAT_MODE is trueish)');
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
8
|
};
|
|
15
9
|
export default LocalSearchPlugin;
|
|
16
10
|
export { LocalSearch } from "./adapter.js";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { FilterDirector, FilterAdapter } from '@unchainedshop/core';
|
|
2
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
import { isDocumentDBCompatModeEnabled } from '@unchainedshop/mongodb';
|
|
4
|
-
const logger = createLogger('unchained:local-search');
|
|
5
2
|
const LocalSearch = {
|
|
6
3
|
...FilterAdapter,
|
|
7
4
|
key: 'shop.unchained.filters.local-search',
|
|
@@ -58,9 +55,4 @@ const LocalSearch = {
|
|
|
58
55
|
},
|
|
59
56
|
};
|
|
60
57
|
export default LocalSearch;
|
|
61
|
-
|
|
62
|
-
FilterDirector.registerAdapter(LocalSearch);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
logger.warn('Free text search queries have been disabled due to DocumentDB compatibility mode (env UNCHAINED_DOCUMENTDB_COMPAT_MODE is trueish)');
|
|
66
|
-
}
|
|
58
|
+
FilterDirector.registerAdapter(LocalSearch);
|
|
@@ -9,4 +9,4 @@ export type CryptopayTransaction = {
|
|
|
9
9
|
decimals: number;
|
|
10
10
|
orderPaymentId?: string;
|
|
11
11
|
} & TimestampFields;
|
|
12
|
-
export declare const CryptopayTransactionsCollection: (db: mongodb.Db) => mongodb.Collection<CryptopayTransaction
|
|
12
|
+
export declare const CryptopayTransactionsCollection: (db: mongodb.Db) => Promise<mongodb.Collection<CryptopayTransaction>>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { mongodb } from '@unchainedshop/mongodb';
|
|
1
|
+
import { buildDbIndexes, mongodb } from '@unchainedshop/mongodb';
|
|
2
2
|
import {} from '@unchainedshop/mongodb';
|
|
3
|
-
export const CryptopayTransactionsCollection = (db) => {
|
|
4
|
-
|
|
3
|
+
export const CryptopayTransactionsCollection = async (db) => {
|
|
4
|
+
const CryptopayTransactions = db.collection('cryptopay_transactions');
|
|
5
|
+
await buildDbIndexes(CryptopayTransactions, [
|
|
6
|
+
{ index: { currencyCode: 1 } },
|
|
7
|
+
{ index: { orderPaymentId: 1 }, options: { sparse: true } },
|
|
8
|
+
]);
|
|
9
|
+
return CryptopayTransactions;
|
|
5
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CryptopayTransaction } from './db/CryptopayTransactions.ts';
|
|
2
2
|
declare const configureCryptopayModule: ({ db }: {
|
|
3
3
|
db: any;
|
|
4
|
-
}) => {
|
|
4
|
+
}) => Promise<{
|
|
5
5
|
getWalletAddress: (address: string, contract?: string) => Promise<CryptopayTransaction | null>;
|
|
6
6
|
updateMostRecentBlock: (currencyCode: string, blockHeight: number) => Promise<void>;
|
|
7
7
|
updateWalletAddress: ({ address, blockHeight, amount, contract, currencyCode, decimals, }: {
|
|
@@ -20,12 +20,12 @@ declare const configureCryptopayModule: ({ db }: {
|
|
|
20
20
|
}) => Promise<CryptopayTransaction>;
|
|
21
21
|
getNextDerivationNumber: (currencyCode: string) => Promise<number>;
|
|
22
22
|
getWalletAddressesByOrderPaymentId: (orderPaymentId: string) => Promise<CryptopayTransaction[]>;
|
|
23
|
-
}
|
|
23
|
+
}>;
|
|
24
24
|
declare const _default: {
|
|
25
25
|
cryptopay: {
|
|
26
26
|
configure: ({ db }: {
|
|
27
27
|
db: any;
|
|
28
|
-
}) => {
|
|
28
|
+
}) => Promise<{
|
|
29
29
|
getWalletAddress: (address: string, contract?: string) => Promise<CryptopayTransaction | null>;
|
|
30
30
|
updateMostRecentBlock: (currencyCode: string, blockHeight: number) => Promise<void>;
|
|
31
31
|
updateWalletAddress: ({ address, blockHeight, amount, contract, currencyCode, decimals, }: {
|
|
@@ -44,10 +44,10 @@ declare const _default: {
|
|
|
44
44
|
}) => Promise<CryptopayTransaction>;
|
|
45
45
|
getNextDerivationNumber: (currencyCode: string) => Promise<number>;
|
|
46
46
|
getWalletAddressesByOrderPaymentId: (orderPaymentId: string) => Promise<CryptopayTransaction[]>;
|
|
47
|
-
}
|
|
47
|
+
}>;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
export default _default;
|
|
51
51
|
export interface CryptopayModule {
|
|
52
|
-
cryptopay: ReturnType<typeof configureCryptopayModule
|
|
52
|
+
cryptopay: Awaited<ReturnType<typeof configureCryptopayModule>>;
|
|
53
53
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mongodb } from '@unchainedshop/mongodb';
|
|
2
2
|
import { CryptopayTransactionsCollection, } from "./db/CryptopayTransactions.js";
|
|
3
|
-
const configureCryptopayModule = ({ db }) => {
|
|
4
|
-
const CryptoTransactions = CryptopayTransactionsCollection(db);
|
|
3
|
+
const configureCryptopayModule = async ({ db }) => {
|
|
4
|
+
const CryptoTransactions = await CryptopayTransactionsCollection(db);
|
|
5
5
|
const getWalletAddress = async (address, contract) => {
|
|
6
6
|
const addressId = [address, contract].filter(Boolean).join(':');
|
|
7
7
|
return CryptoTransactions.findOne({ _id: addressId });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const getRedirects = () => {
|
|
2
|
-
const { EMAIL_WEBSITE_URL,
|
|
2
|
+
const { EMAIL_WEBSITE_URL, PAYREXX_SUCCESS_PATH = '/payrexx/success', PAYREXX_ERROR_PATH = '/payrexx/error', PAYREXX_CANCEL_PATH = '/payrexx/cancel', } = process.env;
|
|
3
3
|
return {
|
|
4
|
-
successRedirectUrl: `${EMAIL_WEBSITE_URL}${
|
|
5
|
-
failedRedirectUrl: `${EMAIL_WEBSITE_URL}${
|
|
6
|
-
cancelRedirectUrl: `${EMAIL_WEBSITE_URL}${
|
|
4
|
+
successRedirectUrl: `${EMAIL_WEBSITE_URL}${PAYREXX_SUCCESS_PATH}`,
|
|
5
|
+
failedRedirectUrl: `${EMAIL_WEBSITE_URL}${PAYREXX_ERROR_PATH}`,
|
|
6
|
+
cancelRedirectUrl: `${EMAIL_WEBSITE_URL}${PAYREXX_CANCEL_PATH}`,
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export const mapOrderDataToGatewayObject = ({ order, orderPayment, pricing }, options = {}) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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": "5.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.2",
|
|
5
5
|
"main": "lib/plugins-index.js",
|
|
6
6
|
"types": "lib/plugins-index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"fastify": ">= 5.2 < 6",
|
|
71
71
|
"minio": "8.x",
|
|
72
72
|
"nodemailer": ">= 6.9 < 9",
|
|
73
|
-
"stripe": ">= 19 <
|
|
73
|
+
"stripe": ">= 19 < 23",
|
|
74
74
|
"web-push": ">= 3.6 <4",
|
|
75
75
|
"xml-js": ">= 1.6 < 2"
|
|
76
76
|
},
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"fastify": "^5.4.0",
|
|
120
120
|
"minio": "^8.0.5",
|
|
121
121
|
"nodemailer": "^8.0.1",
|
|
122
|
-
"stripe": "^
|
|
122
|
+
"stripe": "^22.1.0",
|
|
123
123
|
"typescript": "^5.8.3",
|
|
124
124
|
"web-push": "^3.6.7",
|
|
125
125
|
"xml-js": "^1.6.11"
|