@unchainedshop/plugins 4.8.10 → 4.8.11
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.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/presets/all.d.ts +2 -2
- package/package.json +3 -3
|
@@ -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 });
|
package/lib/presets/all.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ declare const modules: {
|
|
|
35
35
|
cryptopay: {
|
|
36
36
|
configure: ({ db }: {
|
|
37
37
|
db: any;
|
|
38
|
-
}) => {
|
|
38
|
+
}) => Promise<{
|
|
39
39
|
getWalletAddress: (address: string, contract?: string) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction | null>;
|
|
40
40
|
updateMostRecentBlock: (currencyCode: string, blockHeight: number) => Promise<void>;
|
|
41
41
|
updateWalletAddress: ({ address, blockHeight, amount, contract, currencyCode, decimals, }: {
|
|
@@ -54,7 +54,7 @@ declare const modules: {
|
|
|
54
54
|
}) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction>;
|
|
55
55
|
getNextDerivationNumber: (currencyCode: string) => Promise<number>;
|
|
56
56
|
getWalletAddressesByOrderPaymentId: (orderPaymentId: string) => Promise<import("../payment/cryptopay/db/CryptopayTransactions.ts").CryptopayTransaction[]>;
|
|
57
|
-
}
|
|
57
|
+
}>;
|
|
58
58
|
};
|
|
59
59
|
gridfsFileUploads: {
|
|
60
60
|
configure: ({ db }: {
|
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": "4.8.
|
|
4
|
+
"version": "4.8.11",
|
|
5
5
|
"main": "lib/plugins-index.js",
|
|
6
6
|
"types": "lib/plugins-index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"minio": "8.x",
|
|
64
64
|
"nodemailer": ">= 6.9 < 9",
|
|
65
65
|
"p-memoize": "8.x",
|
|
66
|
-
"stripe": ">= 19 <
|
|
66
|
+
"stripe": ">= 19 < 23",
|
|
67
67
|
"web-push": ">= 3.6 <4",
|
|
68
68
|
"xml-js": ">= 1.6 < 2"
|
|
69
69
|
},
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"minio": "^8.0.5",
|
|
125
125
|
"nodemailer": "^8.0.2",
|
|
126
126
|
"p-memoize": "^8.0.0",
|
|
127
|
-
"stripe": "^
|
|
127
|
+
"stripe": "^22.0.2",
|
|
128
128
|
"typescript": "^5.8.3",
|
|
129
129
|
"web-push": "^3.6.7",
|
|
130
130
|
"xml-js": "^1.6.11"
|