@spritz-finance/service-client 0.3.17 → 0.3.19
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/growth/growthServiceClient.d.ts +11 -0
- package/lib/growth/growthServiceClient.js +13 -1
- package/lib/growth/types.d.ts +26 -0
- package/lib/growth/types.js +18 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/payableAccounts/payableAccountsServiceClient.d.ts +1 -0
- package/lib/payableAccounts/payableAccountsServiceClient.js +7 -1
- package/package.json +1 -1
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export * as GrowthClient from './growthServiceClient';
|
|
2
|
+
import { PointsRedemption } from './types';
|
|
2
3
|
export declare function getUserReferrer(userId: string): Promise<string>;
|
|
4
|
+
export declare function initializePointsRedemption(input: {
|
|
5
|
+
userId: string;
|
|
6
|
+
paymentRequestId: string;
|
|
7
|
+
accountId: string;
|
|
8
|
+
redemptionId: string;
|
|
9
|
+
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<PointsRedemption>>;
|
|
10
|
+
export declare function confirmPointsRedemption(input: {
|
|
11
|
+
userId: string;
|
|
12
|
+
redemptionId: string;
|
|
13
|
+
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<PointsRedemption>>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getUserReferrer = exports.GrowthClient = void 0;
|
|
26
|
+
exports.confirmPointsRedemption = exports.initializePointsRedemption = exports.getUserReferrer = exports.GrowthClient = void 0;
|
|
27
27
|
exports.GrowthClient = __importStar(require("./growthServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const GROWTH_ENDPOINT = '/growth';
|
|
@@ -33,3 +33,15 @@ async function getUserReferrer(userId) {
|
|
|
33
33
|
.then((res) => res.data);
|
|
34
34
|
}
|
|
35
35
|
exports.getUserReferrer = getUserReferrer;
|
|
36
|
+
async function initializePointsRedemption(input) {
|
|
37
|
+
return serviceClient_1.baseClient
|
|
38
|
+
.post(`${GROWTH_ENDPOINT}/v2/points/redemption/initialize`, input)
|
|
39
|
+
.then((res) => res.data);
|
|
40
|
+
}
|
|
41
|
+
exports.initializePointsRedemption = initializePointsRedemption;
|
|
42
|
+
async function confirmPointsRedemption(input) {
|
|
43
|
+
return serviceClient_1.baseClient
|
|
44
|
+
.post(`${GROWTH_ENDPOINT}/v2/points/redemption/confirm`, input)
|
|
45
|
+
.then((res) => res.data);
|
|
46
|
+
}
|
|
47
|
+
exports.confirmPointsRedemption = confirmPointsRedemption;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare enum PointsRedemptionStatus {
|
|
2
|
+
Initialized = "Initialized",
|
|
3
|
+
Confirmed = "Confirmed"
|
|
4
|
+
}
|
|
5
|
+
export declare enum PointsRedemptionType {
|
|
6
|
+
FeeDiscount = "FeeDiscount",
|
|
7
|
+
AddToPayment = "AddToPayment"
|
|
8
|
+
}
|
|
9
|
+
export declare enum PointsRedemptionValueType {
|
|
10
|
+
Amount = "Amount",
|
|
11
|
+
Percentage = "Percentage"
|
|
12
|
+
}
|
|
13
|
+
export type PointsRedemption = {
|
|
14
|
+
_id: string;
|
|
15
|
+
id: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
referenceId?: string;
|
|
18
|
+
redemptionId: string;
|
|
19
|
+
type: PointsRedemptionType;
|
|
20
|
+
valueType: PointsRedemptionValueType;
|
|
21
|
+
status: PointsRedemptionStatus;
|
|
22
|
+
value: number;
|
|
23
|
+
cost: number;
|
|
24
|
+
redeemed: boolean;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PointsRedemptionValueType = exports.PointsRedemptionType = exports.PointsRedemptionStatus = void 0;
|
|
4
|
+
var PointsRedemptionStatus;
|
|
5
|
+
(function (PointsRedemptionStatus) {
|
|
6
|
+
PointsRedemptionStatus["Initialized"] = "Initialized";
|
|
7
|
+
PointsRedemptionStatus["Confirmed"] = "Confirmed";
|
|
8
|
+
})(PointsRedemptionStatus || (exports.PointsRedemptionStatus = PointsRedemptionStatus = {}));
|
|
9
|
+
var PointsRedemptionType;
|
|
10
|
+
(function (PointsRedemptionType) {
|
|
11
|
+
PointsRedemptionType["FeeDiscount"] = "FeeDiscount";
|
|
12
|
+
PointsRedemptionType["AddToPayment"] = "AddToPayment";
|
|
13
|
+
})(PointsRedemptionType || (exports.PointsRedemptionType = PointsRedemptionType = {}));
|
|
14
|
+
var PointsRedemptionValueType;
|
|
15
|
+
(function (PointsRedemptionValueType) {
|
|
16
|
+
PointsRedemptionValueType["Amount"] = "Amount";
|
|
17
|
+
PointsRedemptionValueType["Percentage"] = "Percentage";
|
|
18
|
+
})(PointsRedemptionValueType || (exports.PointsRedemptionValueType = PointsRedemptionValueType = {}));
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './verification/types';
|
|
|
4
4
|
export { UsersClient } from './users/usersServiceClient';
|
|
5
5
|
export * from './users/types';
|
|
6
6
|
export { GrowthClient } from './growth/growthServiceClient';
|
|
7
|
+
export * from './growth/types';
|
|
7
8
|
export { PayableAccountsClient } from './payableAccounts/payableAccountsServiceClient';
|
|
8
9
|
export * from './payableAccounts/types';
|
|
9
10
|
export { PaymentsClient } from './payments/paymentsClient';
|
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "UsersClient", { enumerable: true, get: function
|
|
|
24
24
|
__exportStar(require("./users/types"), exports);
|
|
25
25
|
var growthServiceClient_1 = require("./growth/growthServiceClient");
|
|
26
26
|
Object.defineProperty(exports, "GrowthClient", { enumerable: true, get: function () { return growthServiceClient_1.GrowthClient; } });
|
|
27
|
+
__exportStar(require("./growth/types"), exports);
|
|
27
28
|
var payableAccountsServiceClient_1 = require("./payableAccounts/payableAccountsServiceClient");
|
|
28
29
|
Object.defineProperty(exports, "PayableAccountsClient", { enumerable: true, get: function () { return payableAccountsServiceClient_1.PayableAccountsClient; } });
|
|
29
30
|
__exportStar(require("./payableAccounts/types"), exports);
|
|
@@ -78,3 +78,4 @@ export declare function upsertBillFromExternalAccount(input: ExternalBillInput):
|
|
|
78
78
|
testPaymentAvailable: boolean;
|
|
79
79
|
provider: import("../lib/graphClient/generated").AccountProvider;
|
|
80
80
|
}>;
|
|
81
|
+
export declare function getAccountById(accountId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<PayableAccount>>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.upsertBillFromExternalAccount = exports.getAccountInstitution = exports.getAccounts = exports.getAccountsForUser = exports.getAccountByExternalId = exports.getAccount = exports.PayableAccountsClient = void 0;
|
|
26
|
+
exports.getAccountById = exports.upsertBillFromExternalAccount = exports.getAccountInstitution = exports.getAccounts = exports.getAccountsForUser = exports.getAccountByExternalId = exports.getAccount = exports.PayableAccountsClient = void 0;
|
|
27
27
|
exports.PayableAccountsClient = __importStar(require("./payableAccountsServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const PAYABLE_ACCOUNTS_ENDPOINT = '/payable-accounts';
|
|
@@ -63,3 +63,9 @@ async function upsertBillFromExternalAccount(input) {
|
|
|
63
63
|
.then((res) => res.data);
|
|
64
64
|
}
|
|
65
65
|
exports.upsertBillFromExternalAccount = upsertBillFromExternalAccount;
|
|
66
|
+
async function getAccountById(accountId) {
|
|
67
|
+
return serviceClient_1.baseClient
|
|
68
|
+
.get(`${PAYABLE_ACCOUNTS_ENDPOINT}/v2/payable-account/id/${accountId}`)
|
|
69
|
+
.then((res) => res.data);
|
|
70
|
+
}
|
|
71
|
+
exports.getAccountById = getAccountById;
|