@payabli/sdk-node 0.0.108 → 0.0.110

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 (136) hide show
  1. package/README.md +5 -1
  2. package/dist/cjs/Client.d.ts +2 -2
  3. package/dist/cjs/Client.js +2 -2
  4. package/dist/cjs/api/resources/bill/client/Client.d.ts +2 -2
  5. package/dist/cjs/api/resources/boarding/client/Client.d.ts +2 -2
  6. package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +2 -2
  7. package/dist/cjs/api/resources/chargeBacks/client/requests/ResponseChargeBack.d.ts +1 -2
  8. package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +2 -2
  9. package/dist/cjs/api/resources/cloud/client/Client.d.ts +2 -2
  10. package/dist/cjs/api/resources/customer/client/Client.d.ts +2 -2
  11. package/dist/cjs/api/resources/export/client/Client.d.ts +2 -2
  12. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +2 -2
  13. package/dist/cjs/api/resources/import/client/Client.d.ts +2 -2
  14. package/dist/cjs/api/resources/invoice/client/Client.d.ts +2 -2
  15. package/dist/cjs/api/resources/lineItem/client/Client.d.ts +2 -2
  16. package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +2 -2
  17. package/dist/cjs/api/resources/moneyIn/errors/CaptureError.js +1 -1
  18. package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +8 -10
  19. package/dist/cjs/api/resources/moneyOut/client/Client.js +6 -8
  20. package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +6 -8
  21. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.d.ts +30 -0
  22. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.js +5 -0
  23. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -10
  24. package/dist/cjs/api/resources/moneyOutTypes/types/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/moneyOutTypes/types/index.js +1 -0
  26. package/dist/cjs/api/resources/notification/client/Client.d.ts +2 -2
  27. package/dist/cjs/api/resources/ocr/client/Client.d.ts +2 -2
  28. package/dist/cjs/api/resources/organization/client/Client.d.ts +2 -2
  29. package/dist/cjs/api/resources/organization/client/requests/AddOrganizationRequest.d.ts +1 -2
  30. package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +2 -2
  31. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +2 -2
  32. package/dist/cjs/api/resources/paypoint/client/Client.d.ts +2 -2
  33. package/dist/cjs/api/resources/query/client/Client.d.ts +2 -2
  34. package/dist/cjs/api/resources/query/client/requests/ListTransfersRequest.d.ts +3 -0
  35. package/dist/cjs/api/resources/query/client/requests/ListVcardsOrgRequest.d.ts +0 -2
  36. package/dist/cjs/api/resources/query/client/requests/ListVcardsRequest.d.ts +0 -2
  37. package/dist/cjs/api/resources/queryTypes/types/ListOrganizationsResponse.d.ts +2 -2
  38. package/dist/cjs/api/resources/queryTypes/types/QueryBatchesDetailResponse.d.ts +7 -7
  39. package/dist/cjs/api/resources/queryTypes/types/QueryBatchesResponse.d.ts +10 -10
  40. package/dist/cjs/api/resources/queryTypes/types/QueryTransferDetailResponse.d.ts +72 -72
  41. package/dist/cjs/api/resources/queryTypes/types/QueryTransferResponse.d.ts +2 -2
  42. package/dist/cjs/api/resources/queryTypes/types/QueryTransferSummary.d.ts +23 -18
  43. package/dist/cjs/api/resources/statistic/client/Client.d.ts +2 -2
  44. package/dist/cjs/api/resources/subscription/client/Client.d.ts +2 -2
  45. package/dist/cjs/api/resources/templates/client/Client.d.ts +2 -2
  46. package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +2 -2
  47. package/dist/cjs/api/resources/user/client/Client.d.ts +2 -2
  48. package/dist/cjs/api/resources/vendor/client/Client.d.ts +2 -2
  49. package/dist/cjs/api/resources/wallet/client/Client.d.ts +2 -2
  50. package/dist/cjs/api/types/AdditionalData.d.ts +1 -1
  51. package/dist/cjs/api/types/BillDetailResponse.d.ts +1 -1
  52. package/dist/cjs/api/types/BillQueryRecord2.d.ts +37 -38
  53. package/dist/cjs/api/types/BillQueryResponse.d.ts +8 -8
  54. package/dist/cjs/api/types/IdempotencyKey.d.ts +1 -1
  55. package/dist/cjs/api/types/PaymentIdString.d.ts +7 -0
  56. package/dist/cjs/api/types/PaymentIdString.js +5 -0
  57. package/dist/cjs/api/types/Paymentid.d.ts +1 -1
  58. package/dist/cjs/api/types/QueryPayoutTransaction.d.ts +2 -2
  59. package/dist/cjs/api/types/TransactionOutQueryRecord.d.ts +1 -1
  60. package/dist/cjs/api/types/Transfer.d.ts +18 -6
  61. package/dist/cjs/api/types/TransferQueryResponse.d.ts +10 -6
  62. package/dist/cjs/api/types/index.d.ts +1 -0
  63. package/dist/cjs/api/types/index.js +1 -0
  64. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
  65. package/dist/cjs/core/fetcher/requestWithRetries.js +34 -2
  66. package/dist/cjs/core/headers.d.ts +2 -2
  67. package/dist/cjs/version.d.ts +1 -1
  68. package/dist/cjs/version.js +1 -1
  69. package/dist/esm/Client.d.mts +2 -2
  70. package/dist/esm/Client.mjs +2 -2
  71. package/dist/esm/api/resources/bill/client/Client.d.mts +2 -2
  72. package/dist/esm/api/resources/boarding/client/Client.d.mts +2 -2
  73. package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +2 -2
  74. package/dist/esm/api/resources/chargeBacks/client/requests/ResponseChargeBack.d.mts +1 -2
  75. package/dist/esm/api/resources/checkCapture/client/Client.d.mts +2 -2
  76. package/dist/esm/api/resources/cloud/client/Client.d.mts +2 -2
  77. package/dist/esm/api/resources/customer/client/Client.d.mts +2 -2
  78. package/dist/esm/api/resources/export/client/Client.d.mts +2 -2
  79. package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +2 -2
  80. package/dist/esm/api/resources/import/client/Client.d.mts +2 -2
  81. package/dist/esm/api/resources/invoice/client/Client.d.mts +2 -2
  82. package/dist/esm/api/resources/lineItem/client/Client.d.mts +2 -2
  83. package/dist/esm/api/resources/moneyIn/client/Client.d.mts +2 -2
  84. package/dist/esm/api/resources/moneyIn/errors/CaptureError.mjs +1 -1
  85. package/dist/esm/api/resources/moneyOut/client/Client.d.mts +8 -10
  86. package/dist/esm/api/resources/moneyOut/client/Client.mjs +6 -8
  87. package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +6 -8
  88. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.d.mts +30 -0
  89. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePaymentMethod.mjs +4 -0
  90. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -10
  91. package/dist/esm/api/resources/moneyOutTypes/types/index.d.mts +1 -0
  92. package/dist/esm/api/resources/moneyOutTypes/types/index.mjs +1 -0
  93. package/dist/esm/api/resources/notification/client/Client.d.mts +2 -2
  94. package/dist/esm/api/resources/ocr/client/Client.d.mts +2 -2
  95. package/dist/esm/api/resources/organization/client/Client.d.mts +2 -2
  96. package/dist/esm/api/resources/organization/client/requests/AddOrganizationRequest.d.mts +1 -2
  97. package/dist/esm/api/resources/paymentLink/client/Client.d.mts +2 -2
  98. package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +2 -2
  99. package/dist/esm/api/resources/paypoint/client/Client.d.mts +2 -2
  100. package/dist/esm/api/resources/query/client/Client.d.mts +2 -2
  101. package/dist/esm/api/resources/query/client/requests/ListTransfersRequest.d.mts +3 -0
  102. package/dist/esm/api/resources/query/client/requests/ListVcardsOrgRequest.d.mts +0 -2
  103. package/dist/esm/api/resources/query/client/requests/ListVcardsRequest.d.mts +0 -2
  104. package/dist/esm/api/resources/queryTypes/types/ListOrganizationsResponse.d.mts +2 -2
  105. package/dist/esm/api/resources/queryTypes/types/QueryBatchesDetailResponse.d.mts +7 -7
  106. package/dist/esm/api/resources/queryTypes/types/QueryBatchesResponse.d.mts +10 -10
  107. package/dist/esm/api/resources/queryTypes/types/QueryTransferDetailResponse.d.mts +72 -72
  108. package/dist/esm/api/resources/queryTypes/types/QueryTransferResponse.d.mts +2 -2
  109. package/dist/esm/api/resources/queryTypes/types/QueryTransferSummary.d.mts +23 -18
  110. package/dist/esm/api/resources/statistic/client/Client.d.mts +2 -2
  111. package/dist/esm/api/resources/subscription/client/Client.d.mts +2 -2
  112. package/dist/esm/api/resources/templates/client/Client.d.mts +2 -2
  113. package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +2 -2
  114. package/dist/esm/api/resources/user/client/Client.d.mts +2 -2
  115. package/dist/esm/api/resources/vendor/client/Client.d.mts +2 -2
  116. package/dist/esm/api/resources/wallet/client/Client.d.mts +2 -2
  117. package/dist/esm/api/types/AdditionalData.d.mts +1 -1
  118. package/dist/esm/api/types/BillDetailResponse.d.mts +1 -1
  119. package/dist/esm/api/types/BillQueryRecord2.d.mts +37 -38
  120. package/dist/esm/api/types/BillQueryResponse.d.mts +8 -8
  121. package/dist/esm/api/types/IdempotencyKey.d.mts +1 -1
  122. package/dist/esm/api/types/PaymentIdString.d.mts +7 -0
  123. package/dist/esm/api/types/PaymentIdString.mjs +4 -0
  124. package/dist/esm/api/types/Paymentid.d.mts +1 -1
  125. package/dist/esm/api/types/QueryPayoutTransaction.d.mts +2 -2
  126. package/dist/esm/api/types/TransactionOutQueryRecord.d.mts +1 -1
  127. package/dist/esm/api/types/Transfer.d.mts +18 -6
  128. package/dist/esm/api/types/TransferQueryResponse.d.mts +10 -6
  129. package/dist/esm/api/types/index.d.mts +1 -0
  130. package/dist/esm/api/types/index.mjs +1 -0
  131. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
  132. package/dist/esm/core/fetcher/requestWithRetries.mjs +34 -2
  133. package/dist/esm/core/headers.d.mts +2 -2
  134. package/dist/esm/version.d.mts +1 -1
  135. package/dist/esm/version.mjs +1 -1
  136. package/package.json +1 -1
@@ -34,7 +34,7 @@ export interface TransactionOutQueryRecord {
34
34
  CheckNumber?: string;
35
35
  /** Object referencing to paper check image. */
36
36
  CheckData?: Payabli.FileContent;
37
- PaymentId?: Payabli.Paymentid | undefined;
37
+ PaymentId?: Payabli.PaymentIdString;
38
38
  PaymentData?: Payabli.QueryPaymentData;
39
39
  /** Events associated to this transaction. */
40
40
  Bills?: Payabli.BillPayOutData[];
@@ -12,10 +12,14 @@ import * as Payabli from "../index.mjs";
12
12
  * batchRecords: 1,
13
13
  * transferIdentifier: "bbcbfed7-e535-45fe-8d62-000000",
14
14
  * batchId: 111430,
15
- * paypointEntryName: "example_entry",
16
- * paypointLegalName: "Example Company LLC",
17
- * paypointDbaName: "Example Company",
15
+ * paypointEntryName: "47ae3de37",
16
+ * paypointLegalName: "Gruzya Outdoor Outfitters LLC",
17
+ * paypointDbaName: "Gruzya Outdoor Outfitters",
18
18
  * paypointLogo: "https://example.com/logo.png",
19
+ * parentOrgName: "Pilgrim Planner",
20
+ * parentOrgId: 12345,
21
+ * parentOrgLogo: "https://example.com/parent-logo.png",
22
+ * externalPaypointId: "ext-12345",
19
23
  * bankAccount: {
20
24
  * accountNumber: "****1234",
21
25
  * routingNumber: "123456789"
@@ -23,15 +27,15 @@ import * as Payabli from "../index.mjs";
23
27
  * transferDate: "2024-11-17T08:20:07.288+00:00",
24
28
  * processor: "gp",
25
29
  * transferStatus: 2,
26
- * grossAmount: 0,
27
- * chargeBackAmount: 0,
30
+ * grossAmount: 1029,
31
+ * chargeBackAmount: 25,
28
32
  * returnedAmount: 0,
29
33
  * holdAmount: 0,
30
34
  * releasedAmount: 0,
31
35
  * billingFeesAmount: 0,
32
36
  * thirdPartyPaidAmount: 0,
33
37
  * adjustmentsAmount: 0,
34
- * netTransferAmount: 2,
38
+ * netTransferAmount: 1004,
35
39
  * eventsData: [{
36
40
  * description: "Transfer Created",
37
41
  * eventTime: "2024-11-16T08:15:33.4364067Z",
@@ -62,6 +66,14 @@ export interface Transfer {
62
66
  paypointDbaName?: Payabli.Dbaname;
63
67
  /** The paypoint logo URL. */
64
68
  paypointLogo?: string;
69
+ /** The parent organization name. */
70
+ parentOrgName?: string;
71
+ /** The parent organization ID. */
72
+ parentOrgId?: number;
73
+ /** The parent organization logo URL. */
74
+ parentOrgLogo?: string;
75
+ /** The external paypoint ID. */
76
+ externalPaypointId?: string;
65
77
  /** Bank account information for the transfer. */
66
78
  bankAccount?: Payabli.TransferBankAccount;
67
79
  /** Date when the transfer occurred. */
@@ -13,10 +13,14 @@ import * as Payabli from "../index.mjs";
13
13
  * batchRecords: 1,
14
14
  * transferIdentifier: "bbcbfed7-e535-45fe-8d62-000000",
15
15
  * batchId: 111430,
16
- * paypointEntryName: "example_entry",
17
- * paypointLegalName: "Example Company LLC",
18
- * paypointDbaName: "Example Company",
16
+ * paypointEntryName: "47ae3de37",
17
+ * paypointLegalName: "Gruzya Outdoor Outfitters LLC",
18
+ * paypointDbaName: "Gruzya Outdoor Outfitters",
19
19
  * paypointLogo: "https://example.com/logo.png",
20
+ * parentOrgName: "Pilgrim Planner",
21
+ * parentOrgId: 12345,
22
+ * parentOrgLogo: "https://example.com/parent-logo.png",
23
+ * externalPaypointId: "ext-12345",
20
24
  * bankAccount: {
21
25
  * accountNumber: "****1234",
22
26
  * routingNumber: "123456789"
@@ -24,15 +28,15 @@ import * as Payabli from "../index.mjs";
24
28
  * transferDate: "2024-11-17T08:20:07.288+00:00",
25
29
  * processor: "gp",
26
30
  * transferStatus: 2,
27
- * grossAmount: 0,
28
- * chargeBackAmount: 0,
31
+ * grossAmount: 1029,
32
+ * chargeBackAmount: 25,
29
33
  * returnedAmount: 0,
30
34
  * holdAmount: 0,
31
35
  * releasedAmount: 0,
32
36
  * billingFeesAmount: 0,
33
37
  * thirdPartyPaidAmount: 0,
34
38
  * adjustmentsAmount: 0,
35
- * netTransferAmount: 2,
39
+ * netTransferAmount: 1004,
36
40
  * eventsData: [{
37
41
  * description: "Transfer Created",
38
42
  * eventTime: "2024-11-16T08:15:33.4364067Z",
@@ -353,6 +353,7 @@ export * from "./PaymentCategories.mjs";
353
353
  export * from "./PaymentDetail.mjs";
354
354
  export * from "./PaymentDetailCredit.mjs";
355
355
  export * from "./Paymentid.mjs";
356
+ export * from "./PaymentIdString.mjs";
356
357
  export * from "./PaymentMethod.mjs";
357
358
  export * from "./PayMethodBodyAllFields.mjs";
358
359
  export * from "./PayMethodCredit.mjs";
@@ -353,6 +353,7 @@ export * from "./PaymentCategories.mjs";
353
353
  export * from "./PaymentDetail.mjs";
354
354
  export * from "./PaymentDetailCredit.mjs";
355
355
  export * from "./Paymentid.mjs";
356
+ export * from "./PaymentIdString.mjs";
356
357
  export * from "./PaymentMethod.mjs";
357
358
  export * from "./PayMethodBodyAllFields.mjs";
358
359
  export * from "./PayMethodCredit.mjs";
@@ -6,7 +6,7 @@ export declare namespace Fetcher {
6
6
  url: string;
7
7
  method: string;
8
8
  contentType?: string;
9
- headers?: Record<string, string | Supplier<string | undefined> | undefined>;
9
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
10
10
  queryParameters?: Record<string, unknown>;
11
11
  body?: unknown;
12
12
  timeoutMs?: number;
@@ -16,13 +16,45 @@ function addJitter(delay) {
16
16
  const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
17
17
  return delay * jitterMultiplier;
18
18
  }
19
+ function getRetryDelayFromHeaders(response, retryAttempt) {
20
+ // Check for Retry-After header first (RFC 7231)
21
+ const retryAfter = response.headers.get("Retry-After");
22
+ if (retryAfter) {
23
+ // Parse as number of seconds...
24
+ const retryAfterSeconds = parseInt(retryAfter, 10);
25
+ if (!isNaN(retryAfterSeconds)) {
26
+ // Convert seconds to milliseconds and cap at MAX_RETRY_DELAY
27
+ return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);
28
+ }
29
+ // ...or as an HTTP date; both are valid
30
+ const retryAfterDate = new Date(retryAfter);
31
+ if (!isNaN(retryAfterDate.getTime())) {
32
+ const delay = retryAfterDate.getTime() - Date.now();
33
+ return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);
34
+ }
35
+ }
36
+ // Then check for industry-standard X-RateLimit-Reset header
37
+ const rateLimitReset = response.headers.get("X-RateLimit-Reset");
38
+ if (rateLimitReset) {
39
+ const resetTime = parseInt(rateLimitReset, 10);
40
+ if (!isNaN(resetTime)) {
41
+ // Assume Unix timestamp in epoch seconds
42
+ const delay = resetTime * 1000 - Date.now();
43
+ if (delay > 0) {
44
+ return Math.min(delay, MAX_RETRY_DELAY);
45
+ }
46
+ }
47
+ }
48
+ // Fall back to exponential backoff
49
+ return Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY);
50
+ }
19
51
  export function requestWithRetries(requestFn_1) {
20
52
  return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
21
53
  let response = yield requestFn();
22
54
  for (let i = 0; i < maxRetries; ++i) {
23
55
  if ([408, 429].includes(response.status) || response.status >= 500) {
24
- // Calculate base delay using exponential backoff (in milliseconds)
25
- const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
56
+ // Get delay from headers or fall back to exponential backoff
57
+ const baseDelay = getRetryDelayFromHeaders(response, i);
26
58
  // Add jitter to the delay
27
59
  const delayWithJitter = addJitter(baseDelay);
28
60
  yield new Promise((resolve) => setTimeout(resolve, delayWithJitter));
@@ -1,3 +1,3 @@
1
1
  import * as core from "./index.mjs";
2
- export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
3
- export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
2
+ export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | null | undefined> | null | undefined> | null | undefined)[]): Record<string, string | core.Supplier<string | null | undefined>>;
3
+ export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | null | undefined> | null | undefined> | null | undefined)[]): Record<string, string | core.Supplier<string | null | undefined>>;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.108";
1
+ export declare const SDK_VERSION = "0.0.110";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.108";
1
+ export const SDK_VERSION = "0.0.110";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payabli/sdk-node",
3
- "version": "0.0.108",
3
+ "version": "0.0.110",
4
4
  "private": false,
5
5
  "repository": "github:payabli/sdk-node",
6
6
  "type": "commonjs",