multivendor-wallet 0.0.3 → 0.0.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/dist/hooks/index.cjs +3 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/{store-BQ3whei-.d.mts → store-By30oqos.d.mts} +7 -1
- package/dist/{store-BQ3whei-.d.ts → store-By30oqos.d.ts} +7 -1
- package/dist/typeorm/index.cjs +25 -8
- package/dist/typeorm/index.cjs.map +1 -1
- package/dist/typeorm/index.d.mts +1 -1
- package/dist/typeorm/index.d.ts +1 -1
- package/dist/typeorm/index.js +25 -8
- package/dist/typeorm/index.js.map +1 -1
- package/dist/{types-iNUEzUgo.d.ts → types-BzaT7Aqh.d.ts} +1 -1
- package/dist/{types-CrJxUVwX.d.mts → types-D46FcrKZ.d.mts} +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as WalletPluginConfig, f as WalletPlugin, I as IWalletPaymentProvider } from './types-
|
|
2
|
-
export { D as DeliveredContext, O as OrderPaidContext, P as PaymentProviderWallet, R as RefundContext, S as SettlementDebitContext, g as WALLET_PLUGIN_TOKEN, h as WalletAdminMutationEvent, i as WalletConfig, C as WalletCreatePaymentInput, j as WalletFeatureFlags, k as WalletHttpConfig, l as WalletLedgerClient, W as WalletLifecycleHooks, b as WalletOrderPaidLine, m as WalletReconciliationConfig } from './types-
|
|
3
|
-
import { W as WalletAccountType } from './store-
|
|
4
|
-
export { B as BalanceDeltas, d as CancelHoldParams, C as CreditParams, D as DebitParams, G as GetTransactionsParams, H as HoldParams, f as HoldStatus, I as IWalletStore, g as IWalletStoreTx, h as LedgerEntryType, L as LedgerMutationResult, R as ReleaseParams, T as TransferParams, b as WalletAccount, c as WalletBalance, i as WalletHold, e as WalletLedgerEntry, j as WalletReference, a as WalletStoreContext } from './store-
|
|
1
|
+
import { e as WalletPluginConfig, f as WalletPlugin, I as IWalletPaymentProvider } from './types-D46FcrKZ.mjs';
|
|
2
|
+
export { D as DeliveredContext, O as OrderPaidContext, P as PaymentProviderWallet, R as RefundContext, S as SettlementDebitContext, g as WALLET_PLUGIN_TOKEN, h as WalletAdminMutationEvent, i as WalletConfig, C as WalletCreatePaymentInput, j as WalletFeatureFlags, k as WalletHttpConfig, l as WalletLedgerClient, W as WalletLifecycleHooks, b as WalletOrderPaidLine, m as WalletReconciliationConfig } from './types-D46FcrKZ.mjs';
|
|
3
|
+
import { W as WalletAccountType } from './store-By30oqos.mjs';
|
|
4
|
+
export { B as BalanceDeltas, d as CancelHoldParams, C as CreditParams, D as DebitParams, G as GetTransactionsParams, H as HoldParams, f as HoldStatus, I as IWalletStore, g as IWalletStoreTx, h as LedgerEntryType, L as LedgerMutationResult, R as ReleaseParams, T as TransferParams, b as WalletAccount, c as WalletBalance, i as WalletHold, e as WalletLedgerEntry, j as WalletReference, a as WalletStoreContext } from './store-By30oqos.mjs';
|
|
5
5
|
export { CreateWalletTables1790000000000, TypeOrmWalletStore, WalletAccountEntity, WalletHoldEntity, WalletLedgerEntryEntity, getWalletOrmMetadata } from './typeorm/index.mjs';
|
|
6
6
|
import { Router } from 'express';
|
|
7
7
|
import 'typeorm';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as WalletPluginConfig, f as WalletPlugin, I as IWalletPaymentProvider } from './types-
|
|
2
|
-
export { D as DeliveredContext, O as OrderPaidContext, P as PaymentProviderWallet, R as RefundContext, S as SettlementDebitContext, g as WALLET_PLUGIN_TOKEN, h as WalletAdminMutationEvent, i as WalletConfig, C as WalletCreatePaymentInput, j as WalletFeatureFlags, k as WalletHttpConfig, l as WalletLedgerClient, W as WalletLifecycleHooks, b as WalletOrderPaidLine, m as WalletReconciliationConfig } from './types-
|
|
3
|
-
import { W as WalletAccountType } from './store-
|
|
4
|
-
export { B as BalanceDeltas, d as CancelHoldParams, C as CreditParams, D as DebitParams, G as GetTransactionsParams, H as HoldParams, f as HoldStatus, I as IWalletStore, g as IWalletStoreTx, h as LedgerEntryType, L as LedgerMutationResult, R as ReleaseParams, T as TransferParams, b as WalletAccount, c as WalletBalance, i as WalletHold, e as WalletLedgerEntry, j as WalletReference, a as WalletStoreContext } from './store-
|
|
1
|
+
import { e as WalletPluginConfig, f as WalletPlugin, I as IWalletPaymentProvider } from './types-BzaT7Aqh.js';
|
|
2
|
+
export { D as DeliveredContext, O as OrderPaidContext, P as PaymentProviderWallet, R as RefundContext, S as SettlementDebitContext, g as WALLET_PLUGIN_TOKEN, h as WalletAdminMutationEvent, i as WalletConfig, C as WalletCreatePaymentInput, j as WalletFeatureFlags, k as WalletHttpConfig, l as WalletLedgerClient, W as WalletLifecycleHooks, b as WalletOrderPaidLine, m as WalletReconciliationConfig } from './types-BzaT7Aqh.js';
|
|
3
|
+
import { W as WalletAccountType } from './store-By30oqos.js';
|
|
4
|
+
export { B as BalanceDeltas, d as CancelHoldParams, C as CreditParams, D as DebitParams, G as GetTransactionsParams, H as HoldParams, f as HoldStatus, I as IWalletStore, g as IWalletStoreTx, h as LedgerEntryType, L as LedgerMutationResult, R as ReleaseParams, T as TransferParams, b as WalletAccount, c as WalletBalance, i as WalletHold, e as WalletLedgerEntry, j as WalletReference, a as WalletStoreContext } from './store-By30oqos.js';
|
|
5
5
|
export { CreateWalletTables1790000000000, TypeOrmWalletStore, WalletAccountEntity, WalletHoldEntity, WalletLedgerEntryEntity, getWalletOrmMetadata } from './typeorm/index.js';
|
|
6
6
|
import { Router } from 'express';
|
|
7
7
|
import 'typeorm';
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,9 @@ var WalletAccountType = /* @__PURE__ */ (function(WalletAccountType2) {
|
|
|
72
72
|
WalletAccountType2["CUSTOMER"] = "customer";
|
|
73
73
|
WalletAccountType2["VENDOR"] = "vendor";
|
|
74
74
|
WalletAccountType2["PLATFORM"] = "platform";
|
|
75
|
+
WalletAccountType2["INVESTOR"] = "investor";
|
|
76
|
+
WalletAccountType2["PLATFORM_INVESTOR_LIABILITY"] = "platform_investor_liability";
|
|
77
|
+
WalletAccountType2["PLATFORM_TDS_PAYABLE"] = "platform_tds_payable";
|
|
75
78
|
return WalletAccountType2;
|
|
76
79
|
})({});
|
|
77
80
|
var LedgerEntryType = /* @__PURE__ */ (function(LedgerEntryType2) {
|
|
@@ -1769,14 +1772,31 @@ var TypeOrmWalletStoreTx = (_a2 = class {
|
|
|
1769
1772
|
}
|
|
1770
1773
|
});
|
|
1771
1774
|
if (!row) {
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1775
|
+
try {
|
|
1776
|
+
row = await repo.save(repo.create({
|
|
1777
|
+
ownerType: type,
|
|
1778
|
+
ownerId,
|
|
1779
|
+
currency,
|
|
1780
|
+
availableBalance: "0",
|
|
1781
|
+
heldBalance: "0"
|
|
1782
|
+
}));
|
|
1783
|
+
} catch (error) {
|
|
1784
|
+
const err = error;
|
|
1785
|
+
const code = err?.code || err?.errno;
|
|
1786
|
+
if (code === "ER_DUP_ENTRY" || code === 1062) {
|
|
1787
|
+
row = await repo.findOne({
|
|
1788
|
+
where: {
|
|
1789
|
+
ownerType: type,
|
|
1790
|
+
ownerId,
|
|
1791
|
+
currency
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
if (row) {
|
|
1795
|
+
return toLedgerAccount(row);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
throw error;
|
|
1799
|
+
}
|
|
1780
1800
|
}
|
|
1781
1801
|
return toLedgerAccount(row);
|
|
1782
1802
|
}
|