@payabli/sdk-node 0.0.135 → 0.0.137

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.
Files changed (178) hide show
  1. package/LICENSE.md +5 -6
  2. package/README.md +19 -13
  3. package/dist/cjs/BaseClient.js +2 -2
  4. package/dist/cjs/Client.d.ts +6 -0
  5. package/dist/cjs/Client.js +52 -42
  6. package/dist/cjs/api/resources/ghostCard/client/Client.d.ts +70 -0
  7. package/dist/cjs/api/resources/ghostCard/client/Client.js +204 -0
  8. package/dist/cjs/api/resources/ghostCard/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/ghostCard/client/index.js +17 -0
  10. package/dist/cjs/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.d.ts +54 -0
  11. package/dist/cjs/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.js +3 -0
  12. package/dist/cjs/api/resources/ghostCard/client/requests/UpdateCardRequestBody.d.ts +14 -0
  13. package/dist/cjs/api/resources/ghostCard/client/requests/UpdateCardRequestBody.js +3 -0
  14. package/dist/cjs/api/resources/ghostCard/client/requests/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/ghostCard/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/ghostCard/exports.d.ts +2 -0
  17. package/dist/cjs/api/resources/ghostCard/exports.js +21 -0
  18. package/dist/cjs/api/resources/ghostCard/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/ghostCard/index.js +18 -0
  20. package/dist/cjs/api/resources/ghostCard/types/CardStatus.d.ts +8 -0
  21. package/dist/cjs/api/resources/ghostCard/types/CardStatus.js +11 -0
  22. package/dist/cjs/api/resources/ghostCard/types/CreateGhostCardResponse.d.ts +17 -0
  23. package/dist/cjs/api/resources/ghostCard/types/CreateGhostCardResponse.js +3 -0
  24. package/dist/cjs/api/resources/ghostCard/types/index.d.ts +2 -0
  25. package/dist/cjs/api/resources/ghostCard/types/index.js +18 -0
  26. package/dist/cjs/api/resources/index.d.ts +6 -0
  27. package/dist/cjs/api/resources/index.js +7 -1
  28. package/dist/cjs/api/resources/payoutSubscription/client/Client.d.ts +156 -0
  29. package/dist/cjs/api/resources/payoutSubscription/client/Client.js +385 -0
  30. package/dist/cjs/api/resources/payoutSubscription/client/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/payoutSubscription/client/index.js +17 -0
  32. package/dist/cjs/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.d.ts +67 -0
  33. package/dist/cjs/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.js +3 -0
  34. package/dist/cjs/api/resources/payoutSubscription/client/requests/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/payoutSubscription/client/requests/index.js +2 -0
  36. package/dist/cjs/api/resources/payoutSubscription/exports.d.ts +2 -0
  37. package/dist/cjs/api/resources/payoutSubscription/exports.js +21 -0
  38. package/dist/cjs/api/resources/payoutSubscription/index.d.ts +2 -0
  39. package/dist/cjs/api/resources/payoutSubscription/index.js +18 -0
  40. package/dist/cjs/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.d.ts +20 -0
  41. package/dist/cjs/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.js +3 -0
  42. package/dist/cjs/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.d.ts +14 -0
  43. package/dist/cjs/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.js +3 -0
  44. package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.ts +151 -0
  45. package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.js +3 -0
  46. package/dist/cjs/api/resources/payoutSubscription/types/PayoutPaymentDetail.d.ts +31 -0
  47. package/dist/cjs/api/resources/payoutSubscription/types/PayoutPaymentDetail.js +3 -0
  48. package/dist/cjs/api/resources/payoutSubscription/types/PayoutScheduleDetail.d.ts +9 -0
  49. package/dist/cjs/api/resources/payoutSubscription/types/PayoutScheduleDetail.js +3 -0
  50. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSetPause.d.ts +4 -0
  51. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSetPause.js +3 -0
  52. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.ts +195 -0
  53. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.js +3 -0
  54. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.ts +195 -0
  55. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.js +3 -0
  56. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.d.ts +69 -0
  57. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.js +3 -0
  58. package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.ts +155 -0
  59. package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.js +3 -0
  60. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.d.ts +9 -0
  61. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.js +3 -0
  62. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.d.ts +15 -0
  63. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.js +3 -0
  64. package/dist/cjs/api/resources/payoutSubscription/types/index.d.ts +12 -0
  65. package/dist/cjs/api/resources/payoutSubscription/types/index.js +28 -0
  66. package/dist/cjs/api/resources/query/client/Client.d.ts +46 -6
  67. package/dist/cjs/api/resources/query/client/Client.js +150 -6
  68. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.d.ts +84 -0
  69. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.js +3 -0
  70. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.d.ts +84 -0
  71. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.js +3 -0
  72. package/dist/cjs/api/resources/query/client/requests/index.d.ts +2 -0
  73. package/dist/cjs/api/types/Remitaddress1.d.ts +1 -1
  74. package/dist/cjs/api/types/Remitaddress2.d.ts +1 -1
  75. package/dist/cjs/api/types/Remitcity.d.ts +1 -1
  76. package/dist/cjs/api/types/Remitcountry.d.ts +1 -1
  77. package/dist/cjs/api/types/Remitstate.d.ts +1 -1
  78. package/dist/cjs/api/types/Remitzip.d.ts +1 -1
  79. package/dist/cjs/api/types/VendorData.d.ts +6 -6
  80. package/dist/cjs/api/types/VendorEin.d.ts +1 -1
  81. package/dist/cjs/api/types/VendorName1.d.ts +1 -1
  82. package/dist/cjs/api/types/VendorName2.d.ts +1 -1
  83. package/dist/cjs/api/types/VendorNumber.d.ts +1 -1
  84. package/dist/cjs/api/types/VendorOutData.d.ts +9 -9
  85. package/dist/cjs/api/types/VendorQueryRecord.d.ts +1 -1
  86. package/dist/cjs/api/types/Vendorstatus.d.ts +5 -3
  87. package/dist/cjs/core/file/file.js +3 -2
  88. package/dist/cjs/version.d.ts +1 -1
  89. package/dist/cjs/version.js +1 -1
  90. package/dist/esm/BaseClient.mjs +2 -2
  91. package/dist/esm/Client.d.mts +6 -0
  92. package/dist/esm/Client.mjs +10 -0
  93. package/dist/esm/api/resources/ghostCard/client/Client.d.mts +70 -0
  94. package/dist/esm/api/resources/ghostCard/client/Client.mjs +167 -0
  95. package/dist/esm/api/resources/ghostCard/client/index.d.mts +1 -0
  96. package/dist/esm/api/resources/ghostCard/client/index.mjs +1 -0
  97. package/dist/esm/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.d.mts +54 -0
  98. package/dist/esm/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.mjs +2 -0
  99. package/dist/esm/api/resources/ghostCard/client/requests/UpdateCardRequestBody.d.mts +14 -0
  100. package/dist/esm/api/resources/ghostCard/client/requests/UpdateCardRequestBody.mjs +2 -0
  101. package/dist/esm/api/resources/ghostCard/client/requests/index.d.mts +2 -0
  102. package/dist/esm/api/resources/ghostCard/client/requests/index.mjs +1 -0
  103. package/dist/esm/api/resources/ghostCard/exports.d.mts +2 -0
  104. package/dist/esm/api/resources/ghostCard/exports.mjs +3 -0
  105. package/dist/esm/api/resources/ghostCard/index.d.mts +2 -0
  106. package/dist/esm/api/resources/ghostCard/index.mjs +2 -0
  107. package/dist/esm/api/resources/ghostCard/types/CardStatus.d.mts +8 -0
  108. package/dist/esm/api/resources/ghostCard/types/CardStatus.mjs +8 -0
  109. package/dist/esm/api/resources/ghostCard/types/CreateGhostCardResponse.d.mts +17 -0
  110. package/dist/esm/api/resources/ghostCard/types/CreateGhostCardResponse.mjs +2 -0
  111. package/dist/esm/api/resources/ghostCard/types/index.d.mts +2 -0
  112. package/dist/esm/api/resources/ghostCard/types/index.mjs +2 -0
  113. package/dist/esm/api/resources/index.d.mts +6 -0
  114. package/dist/esm/api/resources/index.mjs +6 -0
  115. package/dist/esm/api/resources/payoutSubscription/client/Client.d.mts +156 -0
  116. package/dist/esm/api/resources/payoutSubscription/client/Client.mjs +348 -0
  117. package/dist/esm/api/resources/payoutSubscription/client/index.d.mts +1 -0
  118. package/dist/esm/api/resources/payoutSubscription/client/index.mjs +1 -0
  119. package/dist/esm/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.d.mts +67 -0
  120. package/dist/esm/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.mjs +2 -0
  121. package/dist/esm/api/resources/payoutSubscription/client/requests/index.d.mts +1 -0
  122. package/dist/esm/api/resources/payoutSubscription/client/requests/index.mjs +1 -0
  123. package/dist/esm/api/resources/payoutSubscription/exports.d.mts +2 -0
  124. package/dist/esm/api/resources/payoutSubscription/exports.mjs +3 -0
  125. package/dist/esm/api/resources/payoutSubscription/index.d.mts +2 -0
  126. package/dist/esm/api/resources/payoutSubscription/index.mjs +2 -0
  127. package/dist/esm/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.d.mts +20 -0
  128. package/dist/esm/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.mjs +2 -0
  129. package/dist/esm/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.d.mts +14 -0
  130. package/dist/esm/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.mjs +2 -0
  131. package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.mts +151 -0
  132. package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.mjs +2 -0
  133. package/dist/esm/api/resources/payoutSubscription/types/PayoutPaymentDetail.d.mts +31 -0
  134. package/dist/esm/api/resources/payoutSubscription/types/PayoutPaymentDetail.mjs +2 -0
  135. package/dist/esm/api/resources/payoutSubscription/types/PayoutScheduleDetail.d.mts +9 -0
  136. package/dist/esm/api/resources/payoutSubscription/types/PayoutScheduleDetail.mjs +2 -0
  137. package/dist/esm/api/resources/payoutSubscription/types/PayoutSetPause.d.mts +4 -0
  138. package/dist/esm/api/resources/payoutSubscription/types/PayoutSetPause.mjs +2 -0
  139. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.mts +195 -0
  140. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.mjs +2 -0
  141. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.mts +195 -0
  142. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.mjs +2 -0
  143. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.d.mts +69 -0
  144. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.mjs +2 -0
  145. package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.mts +155 -0
  146. package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.mjs +2 -0
  147. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.d.mts +9 -0
  148. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.mjs +2 -0
  149. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.d.mts +15 -0
  150. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.mjs +2 -0
  151. package/dist/esm/api/resources/payoutSubscription/types/index.d.mts +12 -0
  152. package/dist/esm/api/resources/payoutSubscription/types/index.mjs +12 -0
  153. package/dist/esm/api/resources/query/client/Client.d.mts +46 -6
  154. package/dist/esm/api/resources/query/client/Client.mjs +150 -6
  155. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.d.mts +84 -0
  156. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.mjs +2 -0
  157. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.d.mts +84 -0
  158. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.mjs +2 -0
  159. package/dist/esm/api/resources/query/client/requests/index.d.mts +2 -0
  160. package/dist/esm/api/types/Remitaddress1.d.mts +1 -1
  161. package/dist/esm/api/types/Remitaddress2.d.mts +1 -1
  162. package/dist/esm/api/types/Remitcity.d.mts +1 -1
  163. package/dist/esm/api/types/Remitcountry.d.mts +1 -1
  164. package/dist/esm/api/types/Remitstate.d.mts +1 -1
  165. package/dist/esm/api/types/Remitzip.d.mts +1 -1
  166. package/dist/esm/api/types/VendorData.d.mts +6 -6
  167. package/dist/esm/api/types/VendorEin.d.mts +1 -1
  168. package/dist/esm/api/types/VendorName1.d.mts +1 -1
  169. package/dist/esm/api/types/VendorName2.d.mts +1 -1
  170. package/dist/esm/api/types/VendorNumber.d.mts +1 -1
  171. package/dist/esm/api/types/VendorOutData.d.mts +9 -9
  172. package/dist/esm/api/types/VendorQueryRecord.d.mts +1 -1
  173. package/dist/esm/api/types/Vendorstatus.d.mts +5 -3
  174. package/dist/esm/core/file/file.mjs +3 -2
  175. package/dist/esm/version.d.mts +1 -1
  176. package/dist/esm/version.mjs +1 -1
  177. package/package.json +29 -7
  178. package/reference.md +685 -78
package/LICENSE.md CHANGED
@@ -1,8 +1,7 @@
1
- Copyright (c) 2026 Payabli, Inc.
1
+ Copyright (c) 2026 Payabli Inc.
2
2
 
3
- All Rights Reserved.
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
5
- This source code is the proprietary property of Payabli, Inc.
6
- The source code contained herein is made available for inspection
7
- and reference purposes only. No license is granted to use, modify,
8
- distribute, or create derivative works from this source code.
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -10,7 +10,9 @@ The Payabli TypeScript library provides convenient access to the Payabli APIs fr
10
10
  - [Documentation](#documentation)
11
11
  - [Installation](#installation)
12
12
  - [Reference](#reference)
13
+ - [Changelog](#changelog)
13
14
  - [Usage](#usage)
15
+ - [Environments](#environments)
14
16
  - [Request and Response Types](#request-and-response-types)
15
17
  - [Exception Handling](#exception-handling)
16
18
  - [File Uploads](#file-uploads)
@@ -41,6 +43,11 @@ npm i -s @payabli/sdk-node
41
43
 
42
44
  A full reference for this library is available [here](https://github.com/payabli/sdk-node/blob/HEAD/./reference.md).
43
45
 
46
+ ## Changelog
47
+
48
+ The changelog for the official Payabli TypeScript SDK is available on the Payabli Docs site. See [TypeScript SDK Changelog](https://docs.payabli.com/changelog/typescript-sdk) for more information.
49
+
50
+
44
51
  ## Usage
45
52
 
46
53
  Instantiate and use the client with the following:
@@ -73,6 +80,18 @@ await client.moneyIn.getpaid({
73
80
  });
74
81
  ```
75
82
 
83
+ ## Environments
84
+
85
+ This SDK allows you to configure different environments for API requests.
86
+
87
+ ```typescript
88
+ import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node";
89
+
90
+ const client = new PayabliClient({
91
+ environment: PayabliEnvironment.Sandbox,
92
+ });
93
+ ```
94
+
76
95
  ## Request and Response Types
77
96
 
78
97
  The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
@@ -346,19 +365,6 @@ The SDK works in the following runtimes:
346
365
  - Bun 1.0+
347
366
  - React Native
348
367
 
349
- ### Customizing Fetch Client
350
-
351
- The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
352
- unsupported environment, this provides a way for you to break glass and ensure the SDK works.
353
-
354
- ```typescript
355
- import { PayabliClient } from "@payabli/sdk-node";
356
-
357
- const client = new PayabliClient({
358
- ...
359
- fetcher: // provide your implementation here
360
- });
361
- ```
362
368
 
363
369
  ## Contributing
364
370
 
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@payabli/sdk-node",
46
- "X-Fern-SDK-Version": "0.0.135",
47
- "User-Agent": "@payabli/sdk-node/0.0.135",
46
+ "X-Fern-SDK-Version": "0.0.137",
47
+ "User-Agent": "@payabli/sdk-node/0.0.137",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -5,6 +5,7 @@ import { CheckCaptureClient } from "./api/resources/checkCapture/client/Client.j
5
5
  import { CloudClient } from "./api/resources/cloud/client/Client.js";
6
6
  import { CustomerClient } from "./api/resources/customer/client/Client.js";
7
7
  import { ExportClient } from "./api/resources/export/client/Client.js";
8
+ import { GhostCardClient } from "./api/resources/ghostCard/client/Client.js";
8
9
  import { HostedPaymentPagesClient } from "./api/resources/hostedPaymentPages/client/Client.js";
9
10
  import { ImportClient } from "./api/resources/import/client/Client.js";
10
11
  import { InvoiceClient } from "./api/resources/invoice/client/Client.js";
@@ -17,6 +18,7 @@ import { OcrClient } from "./api/resources/ocr/client/Client.js";
17
18
  import { OrganizationClient } from "./api/resources/organization/client/Client.js";
18
19
  import { PaymentLinkClient } from "./api/resources/paymentLink/client/Client.js";
19
20
  import { PaymentMethodDomainClient } from "./api/resources/paymentMethodDomain/client/Client.js";
21
+ import { PayoutSubscriptionClient } from "./api/resources/payoutSubscription/client/Client.js";
20
22
  import { PaypointClient } from "./api/resources/paypoint/client/Client.js";
21
23
  import { QueryClient } from "./api/resources/query/client/Client.js";
22
24
  import { StatisticClient } from "./api/resources/statistic/client/Client.js";
@@ -43,6 +45,7 @@ export declare class PayabliClient {
43
45
  protected _cloud: CloudClient | undefined;
44
46
  protected _customer: CustomerClient | undefined;
45
47
  protected _export: ExportClient | undefined;
48
+ protected _ghostCard: GhostCardClient | undefined;
46
49
  protected _hostedPaymentPages: HostedPaymentPagesClient | undefined;
47
50
  protected _import: ImportClient | undefined;
48
51
  protected _invoice: InvoiceClient | undefined;
@@ -55,6 +58,7 @@ export declare class PayabliClient {
55
58
  protected _organization: OrganizationClient | undefined;
56
59
  protected _paymentLink: PaymentLinkClient | undefined;
57
60
  protected _paymentMethodDomain: PaymentMethodDomainClient | undefined;
61
+ protected _payoutSubscription: PayoutSubscriptionClient | undefined;
58
62
  protected _paypoint: PaypointClient | undefined;
59
63
  protected _query: QueryClient | undefined;
60
64
  protected _statistic: StatisticClient | undefined;
@@ -72,6 +76,7 @@ export declare class PayabliClient {
72
76
  get cloud(): CloudClient;
73
77
  get customer(): CustomerClient;
74
78
  get export(): ExportClient;
79
+ get ghostCard(): GhostCardClient;
75
80
  get hostedPaymentPages(): HostedPaymentPagesClient;
76
81
  get import(): ImportClient;
77
82
  get invoice(): InvoiceClient;
@@ -84,6 +89,7 @@ export declare class PayabliClient {
84
89
  get organization(): OrganizationClient;
85
90
  get paymentLink(): PaymentLinkClient;
86
91
  get paymentMethodDomain(): PaymentMethodDomainClient;
92
+ get payoutSubscription(): PayoutSubscriptionClient;
87
93
  get paypoint(): PaypointClient;
88
94
  get query(): QueryClient;
89
95
  get statistic(): StatisticClient;
@@ -51,27 +51,29 @@ const Client_js_4 = require("./api/resources/checkCapture/client/Client.js");
51
51
  const Client_js_5 = require("./api/resources/cloud/client/Client.js");
52
52
  const Client_js_6 = require("./api/resources/customer/client/Client.js");
53
53
  const Client_js_7 = require("./api/resources/export/client/Client.js");
54
- const Client_js_8 = require("./api/resources/hostedPaymentPages/client/Client.js");
55
- const Client_js_9 = require("./api/resources/import/client/Client.js");
56
- const Client_js_10 = require("./api/resources/invoice/client/Client.js");
57
- const Client_js_11 = require("./api/resources/lineItem/client/Client.js");
58
- const Client_js_12 = require("./api/resources/moneyIn/client/Client.js");
59
- const Client_js_13 = require("./api/resources/moneyOut/client/Client.js");
60
- const Client_js_14 = require("./api/resources/notification/client/Client.js");
61
- const Client_js_15 = require("./api/resources/notificationlogs/client/Client.js");
62
- const Client_js_16 = require("./api/resources/ocr/client/Client.js");
63
- const Client_js_17 = require("./api/resources/organization/client/Client.js");
64
- const Client_js_18 = require("./api/resources/paymentLink/client/Client.js");
65
- const Client_js_19 = require("./api/resources/paymentMethodDomain/client/Client.js");
66
- const Client_js_20 = require("./api/resources/paypoint/client/Client.js");
67
- const Client_js_21 = require("./api/resources/query/client/Client.js");
68
- const Client_js_22 = require("./api/resources/statistic/client/Client.js");
69
- const Client_js_23 = require("./api/resources/subscription/client/Client.js");
70
- const Client_js_24 = require("./api/resources/templates/client/Client.js");
71
- const Client_js_25 = require("./api/resources/tokenStorage/client/Client.js");
72
- const Client_js_26 = require("./api/resources/user/client/Client.js");
73
- const Client_js_27 = require("./api/resources/vendor/client/Client.js");
74
- const Client_js_28 = require("./api/resources/wallet/client/Client.js");
54
+ const Client_js_8 = require("./api/resources/ghostCard/client/Client.js");
55
+ const Client_js_9 = require("./api/resources/hostedPaymentPages/client/Client.js");
56
+ const Client_js_10 = require("./api/resources/import/client/Client.js");
57
+ const Client_js_11 = require("./api/resources/invoice/client/Client.js");
58
+ const Client_js_12 = require("./api/resources/lineItem/client/Client.js");
59
+ const Client_js_13 = require("./api/resources/moneyIn/client/Client.js");
60
+ const Client_js_14 = require("./api/resources/moneyOut/client/Client.js");
61
+ const Client_js_15 = require("./api/resources/notification/client/Client.js");
62
+ const Client_js_16 = require("./api/resources/notificationlogs/client/Client.js");
63
+ const Client_js_17 = require("./api/resources/ocr/client/Client.js");
64
+ const Client_js_18 = require("./api/resources/organization/client/Client.js");
65
+ const Client_js_19 = require("./api/resources/paymentLink/client/Client.js");
66
+ const Client_js_20 = require("./api/resources/paymentMethodDomain/client/Client.js");
67
+ const Client_js_21 = require("./api/resources/payoutSubscription/client/Client.js");
68
+ const Client_js_22 = require("./api/resources/paypoint/client/Client.js");
69
+ const Client_js_23 = require("./api/resources/query/client/Client.js");
70
+ const Client_js_24 = require("./api/resources/statistic/client/Client.js");
71
+ const Client_js_25 = require("./api/resources/subscription/client/Client.js");
72
+ const Client_js_26 = require("./api/resources/templates/client/Client.js");
73
+ const Client_js_27 = require("./api/resources/tokenStorage/client/Client.js");
74
+ const Client_js_28 = require("./api/resources/user/client/Client.js");
75
+ const Client_js_29 = require("./api/resources/vendor/client/Client.js");
76
+ const Client_js_30 = require("./api/resources/wallet/client/Client.js");
75
77
  const BaseClient_js_1 = require("./BaseClient.js");
76
78
  const core = __importStar(require("./core/index.js"));
77
79
  class PayabliClient {
@@ -106,89 +108,97 @@ class PayabliClient {
106
108
  var _a;
107
109
  return ((_a = this._export) !== null && _a !== void 0 ? _a : (this._export = new Client_js_7.ExportClient(this._options)));
108
110
  }
111
+ get ghostCard() {
112
+ var _a;
113
+ return ((_a = this._ghostCard) !== null && _a !== void 0 ? _a : (this._ghostCard = new Client_js_8.GhostCardClient(this._options)));
114
+ }
109
115
  get hostedPaymentPages() {
110
116
  var _a;
111
- return ((_a = this._hostedPaymentPages) !== null && _a !== void 0 ? _a : (this._hostedPaymentPages = new Client_js_8.HostedPaymentPagesClient(this._options)));
117
+ return ((_a = this._hostedPaymentPages) !== null && _a !== void 0 ? _a : (this._hostedPaymentPages = new Client_js_9.HostedPaymentPagesClient(this._options)));
112
118
  }
113
119
  get import() {
114
120
  var _a;
115
- return ((_a = this._import) !== null && _a !== void 0 ? _a : (this._import = new Client_js_9.ImportClient(this._options)));
121
+ return ((_a = this._import) !== null && _a !== void 0 ? _a : (this._import = new Client_js_10.ImportClient(this._options)));
116
122
  }
117
123
  get invoice() {
118
124
  var _a;
119
- return ((_a = this._invoice) !== null && _a !== void 0 ? _a : (this._invoice = new Client_js_10.InvoiceClient(this._options)));
125
+ return ((_a = this._invoice) !== null && _a !== void 0 ? _a : (this._invoice = new Client_js_11.InvoiceClient(this._options)));
120
126
  }
121
127
  get lineItem() {
122
128
  var _a;
123
- return ((_a = this._lineItem) !== null && _a !== void 0 ? _a : (this._lineItem = new Client_js_11.LineItemClient(this._options)));
129
+ return ((_a = this._lineItem) !== null && _a !== void 0 ? _a : (this._lineItem = new Client_js_12.LineItemClient(this._options)));
124
130
  }
125
131
  get moneyIn() {
126
132
  var _a;
127
- return ((_a = this._moneyIn) !== null && _a !== void 0 ? _a : (this._moneyIn = new Client_js_12.MoneyInClient(this._options)));
133
+ return ((_a = this._moneyIn) !== null && _a !== void 0 ? _a : (this._moneyIn = new Client_js_13.MoneyInClient(this._options)));
128
134
  }
129
135
  get moneyOut() {
130
136
  var _a;
131
- return ((_a = this._moneyOut) !== null && _a !== void 0 ? _a : (this._moneyOut = new Client_js_13.MoneyOutClient(this._options)));
137
+ return ((_a = this._moneyOut) !== null && _a !== void 0 ? _a : (this._moneyOut = new Client_js_14.MoneyOutClient(this._options)));
132
138
  }
133
139
  get notification() {
134
140
  var _a;
135
- return ((_a = this._notification) !== null && _a !== void 0 ? _a : (this._notification = new Client_js_14.NotificationClient(this._options)));
141
+ return ((_a = this._notification) !== null && _a !== void 0 ? _a : (this._notification = new Client_js_15.NotificationClient(this._options)));
136
142
  }
137
143
  get notificationlogs() {
138
144
  var _a;
139
- return ((_a = this._notificationlogs) !== null && _a !== void 0 ? _a : (this._notificationlogs = new Client_js_15.NotificationlogsClient(this._options)));
145
+ return ((_a = this._notificationlogs) !== null && _a !== void 0 ? _a : (this._notificationlogs = new Client_js_16.NotificationlogsClient(this._options)));
140
146
  }
141
147
  get ocr() {
142
148
  var _a;
143
- return ((_a = this._ocr) !== null && _a !== void 0 ? _a : (this._ocr = new Client_js_16.OcrClient(this._options)));
149
+ return ((_a = this._ocr) !== null && _a !== void 0 ? _a : (this._ocr = new Client_js_17.OcrClient(this._options)));
144
150
  }
145
151
  get organization() {
146
152
  var _a;
147
- return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new Client_js_17.OrganizationClient(this._options)));
153
+ return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new Client_js_18.OrganizationClient(this._options)));
148
154
  }
149
155
  get paymentLink() {
150
156
  var _a;
151
- return ((_a = this._paymentLink) !== null && _a !== void 0 ? _a : (this._paymentLink = new Client_js_18.PaymentLinkClient(this._options)));
157
+ return ((_a = this._paymentLink) !== null && _a !== void 0 ? _a : (this._paymentLink = new Client_js_19.PaymentLinkClient(this._options)));
152
158
  }
153
159
  get paymentMethodDomain() {
154
160
  var _a;
155
- return ((_a = this._paymentMethodDomain) !== null && _a !== void 0 ? _a : (this._paymentMethodDomain = new Client_js_19.PaymentMethodDomainClient(this._options)));
161
+ return ((_a = this._paymentMethodDomain) !== null && _a !== void 0 ? _a : (this._paymentMethodDomain = new Client_js_20.PaymentMethodDomainClient(this._options)));
162
+ }
163
+ get payoutSubscription() {
164
+ var _a;
165
+ return ((_a = this._payoutSubscription) !== null && _a !== void 0 ? _a : (this._payoutSubscription = new Client_js_21.PayoutSubscriptionClient(this._options)));
156
166
  }
157
167
  get paypoint() {
158
168
  var _a;
159
- return ((_a = this._paypoint) !== null && _a !== void 0 ? _a : (this._paypoint = new Client_js_20.PaypointClient(this._options)));
169
+ return ((_a = this._paypoint) !== null && _a !== void 0 ? _a : (this._paypoint = new Client_js_22.PaypointClient(this._options)));
160
170
  }
161
171
  get query() {
162
172
  var _a;
163
- return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new Client_js_21.QueryClient(this._options)));
173
+ return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new Client_js_23.QueryClient(this._options)));
164
174
  }
165
175
  get statistic() {
166
176
  var _a;
167
- return ((_a = this._statistic) !== null && _a !== void 0 ? _a : (this._statistic = new Client_js_22.StatisticClient(this._options)));
177
+ return ((_a = this._statistic) !== null && _a !== void 0 ? _a : (this._statistic = new Client_js_24.StatisticClient(this._options)));
168
178
  }
169
179
  get subscription() {
170
180
  var _a;
171
- return ((_a = this._subscription) !== null && _a !== void 0 ? _a : (this._subscription = new Client_js_23.SubscriptionClient(this._options)));
181
+ return ((_a = this._subscription) !== null && _a !== void 0 ? _a : (this._subscription = new Client_js_25.SubscriptionClient(this._options)));
172
182
  }
173
183
  get templates() {
174
184
  var _a;
175
- return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_js_24.TemplatesClient(this._options)));
185
+ return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_js_26.TemplatesClient(this._options)));
176
186
  }
177
187
  get tokenStorage() {
178
188
  var _a;
179
- return ((_a = this._tokenStorage) !== null && _a !== void 0 ? _a : (this._tokenStorage = new Client_js_25.TokenStorageClient(this._options)));
189
+ return ((_a = this._tokenStorage) !== null && _a !== void 0 ? _a : (this._tokenStorage = new Client_js_27.TokenStorageClient(this._options)));
180
190
  }
181
191
  get user() {
182
192
  var _a;
183
- return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new Client_js_26.UserClient(this._options)));
193
+ return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new Client_js_28.UserClient(this._options)));
184
194
  }
185
195
  get vendor() {
186
196
  var _a;
187
- return ((_a = this._vendor) !== null && _a !== void 0 ? _a : (this._vendor = new Client_js_27.VendorClient(this._options)));
197
+ return ((_a = this._vendor) !== null && _a !== void 0 ? _a : (this._vendor = new Client_js_29.VendorClient(this._options)));
188
198
  }
189
199
  get wallet() {
190
200
  var _a;
191
- return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new Client_js_28.WalletClient(this._options)));
201
+ return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new Client_js_30.WalletClient(this._options)));
192
202
  }
193
203
  /**
194
204
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -0,0 +1,70 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as Payabli from "../../../index.js";
5
+ export declare namespace GhostCardClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class GhostCardClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<GhostCardClient.Options>;
12
+ constructor(options?: GhostCardClient.Options);
13
+ /**
14
+ * Creates a ghost card, a multi-use virtual debit card issued to a vendor for recurring or discretionary spend.
15
+ *
16
+ * Unlike single-use virtual cards issued as part of a payout transaction, ghost cards aren't tied to a specific payout. They're issued directly to a vendor and can be reused up to a configurable number of times within the card's spending limits.
17
+ *
18
+ * Only one ghost card can exist per vendor per paypoint. To issue a new card to the same vendor, cancel the existing card first.
19
+ *
20
+ * @param {Payabli.Entry} entry
21
+ * @param {Payabli.CreateGhostCardRequestBody} request
22
+ * @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @throws {@link Payabli.BadRequestError}
25
+ * @throws {@link Payabli.UnauthorizedError}
26
+ * @throws {@link Payabli.InternalServerError}
27
+ * @throws {@link Payabli.ServiceUnavailableError}
28
+ *
29
+ * @example
30
+ * await client.ghostCard.createGhostCard("8cfec2e0fa", {
31
+ * vendorId: 42,
32
+ * expenseLimit: 500,
33
+ * amount: 500,
34
+ * maxNumberOfUses: 3,
35
+ * exactAmount: false,
36
+ * expenseLimitPeriod: "monthly",
37
+ * billingCycle: "monthly",
38
+ * billingCycleDay: "1",
39
+ * dailyTransactionCount: 5,
40
+ * dailyAmountLimit: 200,
41
+ * transactionAmountLimit: 100,
42
+ * mcc: "5411",
43
+ * tcc: "R",
44
+ * misc1: "PO-98765",
45
+ * misc2: "Dept-Finance"
46
+ * })
47
+ */
48
+ createGhostCard(entry: Payabli.Entry, request: Payabli.CreateGhostCardRequestBody, requestOptions?: GhostCardClient.RequestOptions): core.HttpResponsePromise<Payabli.CreateGhostCardResponse>;
49
+ private __createGhostCard;
50
+ /**
51
+ * Updates the status of a virtual card (including ghost cards) under a paypoint.
52
+ *
53
+ * @param {Payabli.Entry} entry
54
+ * @param {Payabli.UpdateCardRequestBody} request
55
+ * @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
56
+ *
57
+ * @throws {@link Payabli.BadRequestError}
58
+ * @throws {@link Payabli.UnauthorizedError}
59
+ * @throws {@link Payabli.InternalServerError}
60
+ * @throws {@link Payabli.ServiceUnavailableError}
61
+ *
62
+ * @example
63
+ * await client.ghostCard.updateCard("8cfec2e0fa", {
64
+ * cardToken: "gc_abc123def456",
65
+ * status: "Cancelled"
66
+ * })
67
+ */
68
+ updateCard(entry: Payabli.Entry, request: Payabli.UpdateCardRequestBody, requestOptions?: GhostCardClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponse>;
69
+ private __updateCard;
70
+ }
@@ -0,0 +1,204 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.GhostCardClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const Payabli = __importStar(require("../../../index.js"));
54
+ class GhostCardClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Creates a ghost card, a multi-use virtual debit card issued to a vendor for recurring or discretionary spend.
60
+ *
61
+ * Unlike single-use virtual cards issued as part of a payout transaction, ghost cards aren't tied to a specific payout. They're issued directly to a vendor and can be reused up to a configurable number of times within the card's spending limits.
62
+ *
63
+ * Only one ghost card can exist per vendor per paypoint. To issue a new card to the same vendor, cancel the existing card first.
64
+ *
65
+ * @param {Payabli.Entry} entry
66
+ * @param {Payabli.CreateGhostCardRequestBody} request
67
+ * @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link Payabli.BadRequestError}
70
+ * @throws {@link Payabli.UnauthorizedError}
71
+ * @throws {@link Payabli.InternalServerError}
72
+ * @throws {@link Payabli.ServiceUnavailableError}
73
+ *
74
+ * @example
75
+ * await client.ghostCard.createGhostCard("8cfec2e0fa", {
76
+ * vendorId: 42,
77
+ * expenseLimit: 500,
78
+ * amount: 500,
79
+ * maxNumberOfUses: 3,
80
+ * exactAmount: false,
81
+ * expenseLimitPeriod: "monthly",
82
+ * billingCycle: "monthly",
83
+ * billingCycleDay: "1",
84
+ * dailyTransactionCount: 5,
85
+ * dailyAmountLimit: 200,
86
+ * transactionAmountLimit: 100,
87
+ * mcc: "5411",
88
+ * tcc: "R",
89
+ * misc1: "PO-98765",
90
+ * misc2: "Dept-Finance"
91
+ * })
92
+ */
93
+ createGhostCard(entry, request, requestOptions) {
94
+ return core.HttpResponsePromise.fromPromise(this.__createGhostCard(entry, request, requestOptions));
95
+ }
96
+ __createGhostCard(entry, request, requestOptions) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
99
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
100
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
+ const _response = yield core.fetcher({
102
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOutCard/GhostCard/${core.url.encodePathParam(entry)}`),
103
+ method: "POST",
104
+ headers: _headers,
105
+ contentType: "application/json",
106
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
107
+ requestType: "json",
108
+ body: request,
109
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
110
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
111
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
112
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
113
+ logging: this._options.logging,
114
+ });
115
+ if (_response.ok) {
116
+ return { data: _response.body, rawResponse: _response.rawResponse };
117
+ }
118
+ if (_response.error.reason === "status-code") {
119
+ switch (_response.error.statusCode) {
120
+ case 400:
121
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
122
+ case 401:
123
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
124
+ case 500:
125
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
126
+ case 503:
127
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
128
+ default:
129
+ throw new errors.PayabliError({
130
+ statusCode: _response.error.statusCode,
131
+ body: _response.error.body,
132
+ rawResponse: _response.rawResponse,
133
+ });
134
+ }
135
+ }
136
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/MoneyOutCard/GhostCard/{entry}");
137
+ });
138
+ }
139
+ /**
140
+ * Updates the status of a virtual card (including ghost cards) under a paypoint.
141
+ *
142
+ * @param {Payabli.Entry} entry
143
+ * @param {Payabli.UpdateCardRequestBody} request
144
+ * @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
145
+ *
146
+ * @throws {@link Payabli.BadRequestError}
147
+ * @throws {@link Payabli.UnauthorizedError}
148
+ * @throws {@link Payabli.InternalServerError}
149
+ * @throws {@link Payabli.ServiceUnavailableError}
150
+ *
151
+ * @example
152
+ * await client.ghostCard.updateCard("8cfec2e0fa", {
153
+ * cardToken: "gc_abc123def456",
154
+ * status: "Cancelled"
155
+ * })
156
+ */
157
+ updateCard(entry, request, requestOptions) {
158
+ return core.HttpResponsePromise.fromPromise(this.__updateCard(entry, request, requestOptions));
159
+ }
160
+ __updateCard(entry, request, requestOptions) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
163
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
164
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
165
+ const _response = yield core.fetcher({
166
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOutCard/card/${core.url.encodePathParam(entry)}`),
167
+ method: "PATCH",
168
+ headers: _headers,
169
+ contentType: "application/json",
170
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
171
+ requestType: "json",
172
+ body: request,
173
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
174
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
175
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
176
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
177
+ logging: this._options.logging,
178
+ });
179
+ if (_response.ok) {
180
+ return { data: _response.body, rawResponse: _response.rawResponse };
181
+ }
182
+ if (_response.error.reason === "status-code") {
183
+ switch (_response.error.statusCode) {
184
+ case 400:
185
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
186
+ case 401:
187
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
188
+ case 500:
189
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
190
+ case 503:
191
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
192
+ default:
193
+ throw new errors.PayabliError({
194
+ statusCode: _response.error.statusCode,
195
+ body: _response.error.body,
196
+ rawResponse: _response.rawResponse,
197
+ });
198
+ }
199
+ }
200
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/MoneyOutCard/card/{entry}");
201
+ });
202
+ }
203
+ }
204
+ exports.GhostCardClient = GhostCardClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);