@fabriktor/client 0.0.57 → 0.0.59
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type CreditLedgerEntry, type InCreditLedgerEntry, type InPayment, type InPmtAccount, type InPmtBankAccount, type InPmtCard, type InPmtCustomer, type InPmtPublicSession, type InPmtRefund, type OperationResult, type Payment, type PLPaymentsBalance, type PLPaymentsOpenPublicSession, type PLPaymentsPaymentFromPublicSession, type PLPaymentsPurchaseCredits, type PLPaymentsTotalCredits, type PmtAccount, type PmtBankAccount, type PmtCard, type PmtCustomer, type PmtPublicSession, type PmtRefund, type RPPaymentsTotalCredits, type SortStripeBalanceResult } from "@fabriktor/schema";
|
|
1
|
+
import { type CreditLedgerEntry, type InCreditLedgerEntry, type InPayment, type InPmtAccount, type InPmtBankAccount, type InPmtCard, type InPmtCustomer, type InPmtPublicSession, type InPmtRefund, type OperationResult, type Payment, type PLPaymentsBalance, type PLPaymentsOnboarding, type PLPaymentsOpenPublicSession, type PLPaymentsPaymentFromPublicSession, type PLPaymentsPurchaseCredits, type PLPaymentsTotalCredits, type PmtAccount, type PmtBankAccount, type PmtCard, type PmtCustomer, type PmtPublicSession, type PmtRefund, type RPPaymentsOnboarding, type RPPaymentsTotalCredits, type SortStripeBalanceResult } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
3
|
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
4
|
import type { HTTPDoer } from "../core/http.js";
|
|
5
5
|
import type { CompletePayload } from "../core/type.js";
|
|
6
6
|
export type BalanceOptions = CompletePayload<PLPaymentsBalance>;
|
|
7
|
+
export type OnboardingOptions = CompletePayload<PLPaymentsOnboarding>;
|
|
7
8
|
export type PaymentsBalance = SortStripeBalanceResult;
|
|
8
9
|
export type OpenPmtPublicSessionOptions = CompletePayload<PLPaymentsOpenPublicSession>;
|
|
9
10
|
export type PaymentFromPublicSessionOptions = CompletePayload<PLPaymentsPaymentFromPublicSession>;
|
|
@@ -64,6 +65,7 @@ export interface PaymentsOperator {
|
|
|
64
65
|
deleteOneCreditLedgerEntry(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
65
66
|
searchManyCreditLedger(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<CreditLedgerEntry>>>;
|
|
66
67
|
balance(opts: BalanceOptions): Promise<OperationResultOf<PaymentsBalance>>;
|
|
68
|
+
onboarding(opts: OnboardingOptions): Promise<OperationResultOf<RPPaymentsOnboarding>>;
|
|
67
69
|
openPmtPublicSession(opts: OpenPmtPublicSessionOptions): Promise<OperationResultOf<PmtPublicSession> | void>;
|
|
68
70
|
paymentFromPublicSession(opts: PaymentFromPublicSessionOptions): Promise<OperationResult>;
|
|
69
71
|
purchaseCredits(opts: PurchaseCreditsOptions): Promise<OperationResult>;
|
|
@@ -131,6 +133,7 @@ export declare class PaymentsClient implements PaymentsOperator {
|
|
|
131
133
|
deleteOneCreditLedgerEntry(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
132
134
|
searchManyCreditLedger(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<CreditLedgerEntry>>>;
|
|
133
135
|
balance(opts: BalanceOptions): Promise<OperationResultOf<PaymentsBalance>>;
|
|
136
|
+
onboarding(opts: OnboardingOptions): Promise<OperationResultOf<RPPaymentsOnboarding>>;
|
|
134
137
|
openPmtPublicSession(opts: OpenPmtPublicSessionOptions): Promise<OperationResultOf<PmtPublicSession> | void>;
|
|
135
138
|
paymentFromPublicSession(opts: PaymentFromPublicSessionOptions): Promise<OperationResult>;
|
|
136
139
|
purchaseCredits(opts: PurchaseCreditsOptions): Promise<OperationResult>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
4
4
|
// not use this file except in compliance with the License. You may obtain
|
|
5
5
|
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
import { ColPaymentsCreditLedger, ColPaymentsPayments, ColPaymentsPmtAccounts, ColPaymentsPmtBankAccounts, ColPaymentsPmtCards, ColPaymentsPmtCustomers, ColPaymentsPmtPublicSessions, ColPaymentsPmtRefunds, HTTPMethodPost, PathPaymentsBalance, PathPaymentsFromPublicSession, PathPaymentsOpen, PathPaymentsPurchase, PathPaymentsTotal, SvcPayments, } from "@fabriktor/schema";
|
|
6
|
+
import { ColPaymentsCreditLedger, ColPaymentsPayments, ColPaymentsPmtAccounts, ColPaymentsPmtBankAccounts, ColPaymentsPmtCards, ColPaymentsPmtCustomers, ColPaymentsPmtPublicSessions, ColPaymentsPmtRefunds, HTTPMethodPost, PathPaymentsBalance, PathPaymentsFromPublicSession, PathPaymentsOnboarding, PathPaymentsOpen, PathPaymentsPurchase, PathPaymentsTotal, SvcPayments, } from "@fabriktor/schema";
|
|
7
7
|
import { requiredToken } from "../core/auth.js";
|
|
8
8
|
import { newCRUDClient } from "../core/crud.js";
|
|
9
9
|
import { buildPath } from "../core/path.js";
|
|
@@ -234,6 +234,16 @@ export class PaymentsClient {
|
|
|
234
234
|
body: opts,
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
+
async onboarding(opts) {
|
|
238
|
+
const token = await requiredToken(this.get_token);
|
|
239
|
+
return await this.http.do({
|
|
240
|
+
base_url: this.base_url,
|
|
241
|
+
path: pmtAccountPath(PathPaymentsOnboarding),
|
|
242
|
+
method: HTTPMethodPost,
|
|
243
|
+
token,
|
|
244
|
+
body: opts,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
237
247
|
async openPmtPublicSession(opts) {
|
|
238
248
|
return await this.http.do({
|
|
239
249
|
base_url: this.base_url,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabriktor/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"typescript": "^6.0.3"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fabriktor/schema": "0.0.
|
|
20
|
+
"@fabriktor/schema": "0.0.41"
|
|
21
21
|
}
|
|
22
22
|
}
|