@payabli/sdk-node 0.0.110 → 0.0.114

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 (193) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +33 -28
  4. package/dist/cjs/api/resources/bill/types/BillResponse.d.ts +1 -1
  5. package/dist/cjs/api/resources/bill/types/EditBillResponse.d.ts +1 -1
  6. package/dist/cjs/api/resources/bill/types/GetBillResponse.d.ts +1 -1
  7. package/dist/cjs/api/{types → resources/chargeBacks/types}/ChargeBackResponse.d.ts +1 -1
  8. package/dist/cjs/api/resources/chargeBacks/types/ChargebackMessage.d.ts +21 -0
  9. package/dist/cjs/api/resources/chargeBacks/types/ChargebackQueryRecords.d.ts +69 -0
  10. package/dist/cjs/api/resources/chargeBacks/types/ChargebackQueryRecords.js +5 -0
  11. package/dist/cjs/api/resources/chargeBacks/types/index.d.ts +3 -0
  12. package/dist/cjs/api/resources/chargeBacks/types/index.js +3 -0
  13. package/dist/cjs/api/resources/index.d.ts +3 -0
  14. package/dist/cjs/api/resources/index.js +4 -1
  15. package/dist/cjs/api/resources/lineItem/types/DeleteItemResponse.d.ts +2 -2
  16. package/dist/cjs/api/resources/moneyIn/types/ReceiptResponse.d.ts +1 -1
  17. package/dist/cjs/api/resources/moneyOutTypes/types/CaptureAllOutResponse.d.ts +1 -1
  18. package/dist/cjs/api/resources/moneyOutTypes/types/VCardGetResponse.d.ts +2 -0
  19. package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +118 -0
  20. package/dist/cjs/api/resources/notificationlogs/client/Client.js +370 -0
  21. package/dist/cjs/api/resources/notificationlogs/client/index.d.ts +2 -0
  22. package/dist/cjs/api/resources/notificationlogs/client/index.js +17 -0
  23. package/dist/cjs/api/resources/notificationlogs/client/requests/SearchNotificationLogsRequest.d.ts +23 -0
  24. package/dist/cjs/api/resources/notificationlogs/client/requests/SearchNotificationLogsRequest.js +5 -0
  25. package/dist/cjs/api/resources/notificationlogs/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/notificationlogs/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/notificationlogs/index.d.ts +2 -0
  28. package/dist/cjs/api/resources/notificationlogs/index.js +18 -0
  29. package/dist/cjs/api/resources/notificationlogs/types/BulkRetryRequest.d.ts +7 -0
  30. package/dist/cjs/api/resources/notificationlogs/types/BulkRetryRequest.js +5 -0
  31. package/dist/cjs/api/resources/notificationlogs/types/KeyValueArray.d.ts +7 -0
  32. package/dist/cjs/api/resources/notificationlogs/types/KeyValueArray.js +5 -0
  33. package/dist/cjs/api/resources/notificationlogs/types/NotificationLog.d.ts +29 -0
  34. package/dist/cjs/api/resources/notificationlogs/types/NotificationLog.js +5 -0
  35. package/dist/cjs/api/resources/notificationlogs/types/NotificationLogDetail.d.ts +9 -0
  36. package/dist/cjs/api/resources/notificationlogs/types/NotificationLogDetail.js +5 -0
  37. package/dist/cjs/api/resources/notificationlogs/types/NotificationLogSearchRequest.d.ts +17 -0
  38. package/dist/cjs/api/resources/notificationlogs/types/NotificationLogSearchRequest.js +5 -0
  39. package/dist/cjs/api/resources/notificationlogs/types/StringStringKeyValuePair.d.ts +7 -0
  40. package/dist/cjs/api/resources/notificationlogs/types/StringStringKeyValuePair.js +5 -0
  41. package/dist/cjs/api/resources/notificationlogs/types/index.d.ts +6 -0
  42. package/dist/cjs/api/resources/notificationlogs/types/index.js +22 -0
  43. package/dist/cjs/api/resources/ocr/types/PayabliApiResponseOcr.d.ts +3 -3
  44. package/dist/cjs/api/resources/organization/types/AddOrganizationResponse.d.ts +1 -1
  45. package/dist/cjs/api/resources/organization/types/DeleteOrganizationResponse.d.ts +1 -1
  46. package/dist/cjs/api/resources/organization/types/EditOrganizationResponse.d.ts +2 -2
  47. package/dist/cjs/api/resources/paymentLink/types/PayabliApiResponsePaymentLinks.d.ts +2 -2
  48. package/dist/cjs/api/resources/paypoint/types/GetBasicEntryByIdResponse.d.ts +2 -2
  49. package/dist/cjs/api/resources/paypoint/types/GetBasicEntryResponse.d.ts +2 -2
  50. package/dist/cjs/api/resources/paypoint/types/GetEntryConfigResponse.d.ts +2 -2
  51. package/dist/cjs/api/resources/paypoint/types/MigratePaypointResponse.d.ts +2 -2
  52. package/dist/cjs/api/resources/subscription/types/AddSubscriptionResponse.d.ts +1 -1
  53. package/dist/cjs/api/resources/subscription/types/RemoveSubscriptionResponse.d.ts +1 -1
  54. package/dist/cjs/api/resources/subscription/types/UpdateSubscriptionResponse.d.ts +1 -1
  55. package/dist/cjs/api/resources/tokenStorage/types/AddMethodResponse.d.ts +5 -5
  56. package/dist/cjs/api/resources/tokenStorage/types/GetMethodResponse.d.ts +1 -1
  57. package/dist/cjs/api/resources/user/types/AddUserResponse.d.ts +1 -1
  58. package/dist/cjs/api/resources/user/types/AuthResetUserResponse.d.ts +1 -1
  59. package/dist/cjs/api/resources/user/types/ChangePswUserResponse.d.ts +1 -1
  60. package/dist/cjs/api/resources/user/types/DeleteUserResponse.d.ts +1 -1
  61. package/dist/cjs/api/resources/user/types/EditMfaUserResponse.d.ts +1 -1
  62. package/dist/cjs/api/resources/user/types/LogoutUserResponse.d.ts +1 -1
  63. package/dist/cjs/api/types/BoardingLinkApiResponse.d.ts +1 -1
  64. package/dist/cjs/api/types/CloudQueryApiResponse.d.ts +1 -1
  65. package/dist/cjs/api/types/ConfigureApplePayOrganizationApiResponse.d.ts +1 -1
  66. package/dist/cjs/api/types/ConfigureApplePaypointApiResponse.d.ts +1 -1
  67. package/dist/cjs/api/types/NotificationStandardRequest.d.ts +75 -1
  68. package/dist/cjs/api/types/NotificationStandardRequest.js +74 -0
  69. package/dist/cjs/api/types/PayabliApiResponse.d.ts +1 -1
  70. package/dist/cjs/api/types/PayabliApiResponse0.d.ts +1 -1
  71. package/dist/cjs/api/types/PayabliApiResponse00.d.ts +1 -1
  72. package/dist/cjs/api/types/PayabliApiResponse0000.d.ts +1 -1
  73. package/dist/cjs/api/types/PayabliApiResponse00Responsedatanonobject.d.ts +1 -1
  74. package/dist/cjs/api/types/PayabliApiResponse6.d.ts +1 -1
  75. package/dist/cjs/api/types/PayabliApiResponseCustomerQuery.d.ts +1 -1
  76. package/dist/cjs/api/types/PayabliApiResponseGeneric2Part.d.ts +1 -1
  77. package/dist/cjs/api/types/PayabliApiResponseImport.d.ts +1 -1
  78. package/dist/cjs/api/types/PayabliApiResponseMfaBasic.d.ts +1 -1
  79. package/dist/cjs/api/types/PayabliApiResponseNotifications.d.ts +1 -1
  80. package/dist/cjs/api/types/PayabliApiResponsePaymethodDelete.d.ts +1 -1
  81. package/dist/cjs/api/types/PayabliApiResponseTemplateId.d.ts +1 -1
  82. package/dist/cjs/api/types/PayabliApiResponseUserMfa.d.ts +1 -1
  83. package/dist/cjs/api/types/PayabliApiResponseVendors.d.ts +1 -1
  84. package/dist/cjs/api/types/PaymentMethodDomainGeneralResponse.d.ts +1 -1
  85. package/dist/cjs/api/types/Transfer.d.ts +18 -15
  86. package/dist/cjs/api/types/TransferMessage.d.ts +8 -8
  87. package/dist/cjs/api/types/TransferMessageProperties.d.ts +2 -2
  88. package/dist/cjs/api/types/TransferQueryResponse.d.ts +2 -1
  89. package/dist/cjs/api/types/VCardRecord.d.ts +43 -0
  90. package/dist/cjs/api/types/index.d.ts +3 -5
  91. package/dist/cjs/api/types/index.js +3 -5
  92. package/dist/cjs/version.d.ts +1 -1
  93. package/dist/cjs/version.js +1 -1
  94. package/dist/esm/Client.d.mts +3 -0
  95. package/dist/esm/Client.mjs +7 -2
  96. package/dist/esm/api/resources/bill/types/BillResponse.d.mts +1 -1
  97. package/dist/esm/api/resources/bill/types/EditBillResponse.d.mts +1 -1
  98. package/dist/esm/api/resources/bill/types/GetBillResponse.d.mts +1 -1
  99. package/dist/esm/api/{types → resources/chargeBacks/types}/ChargeBackResponse.d.mts +1 -1
  100. package/dist/esm/api/resources/chargeBacks/types/ChargebackMessage.d.mts +21 -0
  101. package/dist/esm/api/resources/chargeBacks/types/ChargebackQueryRecords.d.mts +69 -0
  102. package/dist/esm/api/resources/chargeBacks/types/ChargebackQueryRecords.mjs +4 -0
  103. package/dist/esm/api/resources/chargeBacks/types/index.d.mts +3 -0
  104. package/dist/esm/api/resources/chargeBacks/types/index.mjs +3 -0
  105. package/dist/esm/api/resources/index.d.mts +3 -0
  106. package/dist/esm/api/resources/index.mjs +3 -0
  107. package/dist/esm/api/resources/lineItem/types/DeleteItemResponse.d.mts +2 -2
  108. package/dist/esm/api/resources/moneyIn/types/ReceiptResponse.d.mts +1 -1
  109. package/dist/esm/api/resources/moneyOutTypes/types/CaptureAllOutResponse.d.mts +1 -1
  110. package/dist/esm/api/resources/moneyOutTypes/types/VCardGetResponse.d.mts +2 -0
  111. package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +118 -0
  112. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +333 -0
  113. package/dist/esm/api/resources/notificationlogs/client/index.d.mts +2 -0
  114. package/dist/esm/api/resources/notificationlogs/client/index.mjs +1 -0
  115. package/dist/esm/api/resources/notificationlogs/client/requests/SearchNotificationLogsRequest.d.mts +23 -0
  116. package/dist/esm/api/resources/notificationlogs/client/requests/SearchNotificationLogsRequest.mjs +4 -0
  117. package/dist/esm/api/resources/notificationlogs/client/requests/index.d.mts +1 -0
  118. package/dist/esm/api/resources/notificationlogs/client/requests/index.mjs +1 -0
  119. package/dist/esm/api/resources/notificationlogs/index.d.mts +2 -0
  120. package/dist/esm/api/resources/notificationlogs/index.mjs +2 -0
  121. package/dist/esm/api/resources/notificationlogs/types/BulkRetryRequest.d.mts +7 -0
  122. package/dist/esm/api/resources/notificationlogs/types/BulkRetryRequest.mjs +4 -0
  123. package/dist/esm/api/resources/notificationlogs/types/KeyValueArray.d.mts +7 -0
  124. package/dist/esm/api/resources/notificationlogs/types/KeyValueArray.mjs +4 -0
  125. package/dist/esm/api/resources/notificationlogs/types/NotificationLog.d.mts +29 -0
  126. package/dist/esm/api/resources/notificationlogs/types/NotificationLog.mjs +4 -0
  127. package/dist/esm/api/resources/notificationlogs/types/NotificationLogDetail.d.mts +9 -0
  128. package/dist/esm/api/resources/notificationlogs/types/NotificationLogDetail.mjs +4 -0
  129. package/dist/esm/api/resources/notificationlogs/types/NotificationLogSearchRequest.d.mts +17 -0
  130. package/dist/esm/api/resources/notificationlogs/types/NotificationLogSearchRequest.mjs +4 -0
  131. package/dist/esm/api/resources/notificationlogs/types/StringStringKeyValuePair.d.mts +7 -0
  132. package/dist/esm/api/resources/notificationlogs/types/StringStringKeyValuePair.mjs +4 -0
  133. package/dist/esm/api/resources/notificationlogs/types/index.d.mts +6 -0
  134. package/dist/esm/api/resources/notificationlogs/types/index.mjs +6 -0
  135. package/dist/esm/api/resources/ocr/types/PayabliApiResponseOcr.d.mts +3 -3
  136. package/dist/esm/api/resources/organization/types/AddOrganizationResponse.d.mts +1 -1
  137. package/dist/esm/api/resources/organization/types/DeleteOrganizationResponse.d.mts +1 -1
  138. package/dist/esm/api/resources/organization/types/EditOrganizationResponse.d.mts +2 -2
  139. package/dist/esm/api/resources/paymentLink/types/PayabliApiResponsePaymentLinks.d.mts +2 -2
  140. package/dist/esm/api/resources/paypoint/types/GetBasicEntryByIdResponse.d.mts +2 -2
  141. package/dist/esm/api/resources/paypoint/types/GetBasicEntryResponse.d.mts +2 -2
  142. package/dist/esm/api/resources/paypoint/types/GetEntryConfigResponse.d.mts +2 -2
  143. package/dist/esm/api/resources/paypoint/types/MigratePaypointResponse.d.mts +2 -2
  144. package/dist/esm/api/resources/subscription/types/AddSubscriptionResponse.d.mts +1 -1
  145. package/dist/esm/api/resources/subscription/types/RemoveSubscriptionResponse.d.mts +1 -1
  146. package/dist/esm/api/resources/subscription/types/UpdateSubscriptionResponse.d.mts +1 -1
  147. package/dist/esm/api/resources/tokenStorage/types/AddMethodResponse.d.mts +5 -5
  148. package/dist/esm/api/resources/tokenStorage/types/GetMethodResponse.d.mts +1 -1
  149. package/dist/esm/api/resources/user/types/AddUserResponse.d.mts +1 -1
  150. package/dist/esm/api/resources/user/types/AuthResetUserResponse.d.mts +1 -1
  151. package/dist/esm/api/resources/user/types/ChangePswUserResponse.d.mts +1 -1
  152. package/dist/esm/api/resources/user/types/DeleteUserResponse.d.mts +1 -1
  153. package/dist/esm/api/resources/user/types/EditMfaUserResponse.d.mts +1 -1
  154. package/dist/esm/api/resources/user/types/LogoutUserResponse.d.mts +1 -1
  155. package/dist/esm/api/types/BoardingLinkApiResponse.d.mts +1 -1
  156. package/dist/esm/api/types/CloudQueryApiResponse.d.mts +1 -1
  157. package/dist/esm/api/types/ConfigureApplePayOrganizationApiResponse.d.mts +1 -1
  158. package/dist/esm/api/types/ConfigureApplePaypointApiResponse.d.mts +1 -1
  159. package/dist/esm/api/types/NotificationStandardRequest.d.mts +75 -1
  160. package/dist/esm/api/types/NotificationStandardRequest.mjs +74 -0
  161. package/dist/esm/api/types/PayabliApiResponse.d.mts +1 -1
  162. package/dist/esm/api/types/PayabliApiResponse0.d.mts +1 -1
  163. package/dist/esm/api/types/PayabliApiResponse00.d.mts +1 -1
  164. package/dist/esm/api/types/PayabliApiResponse0000.d.mts +1 -1
  165. package/dist/esm/api/types/PayabliApiResponse00Responsedatanonobject.d.mts +1 -1
  166. package/dist/esm/api/types/PayabliApiResponse6.d.mts +1 -1
  167. package/dist/esm/api/types/PayabliApiResponseCustomerQuery.d.mts +1 -1
  168. package/dist/esm/api/types/PayabliApiResponseGeneric2Part.d.mts +1 -1
  169. package/dist/esm/api/types/PayabliApiResponseImport.d.mts +1 -1
  170. package/dist/esm/api/types/PayabliApiResponseMfaBasic.d.mts +1 -1
  171. package/dist/esm/api/types/PayabliApiResponseNotifications.d.mts +1 -1
  172. package/dist/esm/api/types/PayabliApiResponsePaymethodDelete.d.mts +1 -1
  173. package/dist/esm/api/types/PayabliApiResponseTemplateId.d.mts +1 -1
  174. package/dist/esm/api/types/PayabliApiResponseUserMfa.d.mts +1 -1
  175. package/dist/esm/api/types/PayabliApiResponseVendors.d.mts +1 -1
  176. package/dist/esm/api/types/PaymentMethodDomainGeneralResponse.d.mts +1 -1
  177. package/dist/esm/api/types/Transfer.d.mts +18 -15
  178. package/dist/esm/api/types/TransferMessage.d.mts +8 -8
  179. package/dist/esm/api/types/TransferMessageProperties.d.mts +2 -2
  180. package/dist/esm/api/types/TransferQueryResponse.d.mts +2 -1
  181. package/dist/esm/api/types/VCardRecord.d.mts +43 -0
  182. package/dist/esm/api/types/index.d.mts +3 -5
  183. package/dist/esm/api/types/index.mjs +3 -5
  184. package/dist/esm/version.d.mts +1 -1
  185. package/dist/esm/version.mjs +1 -1
  186. package/package.json +1 -1
  187. package/reference.md +278 -0
  188. package/dist/cjs/api/types/ChargebackQueryRecords.d.ts +0 -54
  189. package/dist/esm/api/types/ChargebackQueryRecords.d.mts +0 -54
  190. /package/dist/cjs/api/{types → resources/chargeBacks/types}/ChargeBackResponse.js +0 -0
  191. /package/dist/cjs/api/{types/ChargebackQueryRecords.js → resources/chargeBacks/types/ChargebackMessage.js} +0 -0
  192. /package/dist/esm/api/{types → resources/chargeBacks/types}/ChargeBackResponse.mjs +0 -0
  193. /package/dist/esm/api/{types/ChargebackQueryRecords.mjs → resources/chargeBacks/types/ChargebackMessage.mjs} +0 -0
@@ -0,0 +1,333 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments.mjs";
14
+ import * as core from "../../../../core/index.mjs";
15
+ import * as Payabli from "../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
17
+ import * as errors from "../../../../errors/index.mjs";
18
+ export class Notificationlogs {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Search notification logs with filtering and pagination.
24
+ * - Start date and end date cannot be more than 30 days apart
25
+ * - Either `orgId` or `paypointId` must be provided
26
+ *
27
+ * This endpoint requires the `notifications_create` OR `notifications_read` permission.
28
+ *
29
+ * @param {Payabli.SearchNotificationLogsRequest} request
30
+ * @param {Notificationlogs.RequestOptions} requestOptions - Request-specific configuration.
31
+ *
32
+ * @throws {@link Payabli.BadRequestError}
33
+ * @throws {@link Payabli.UnauthorizedError}
34
+ * @throws {@link Payabli.InternalServerError}
35
+ * @throws {@link Payabli.ServiceUnavailableError}
36
+ *
37
+ * @example
38
+ * await client.notificationlogs.searchNotificationLogs({
39
+ * PageSize: 20,
40
+ * body: {
41
+ * startDate: "2024-01-01T00:00:00Z",
42
+ * endDate: "2024-01-31T23:59:59Z",
43
+ * orgId: 12345,
44
+ * notificationEvent: "ActivatedMerchant",
45
+ * succeeded: true
46
+ * }
47
+ * })
48
+ */
49
+ searchNotificationLogs(request, requestOptions) {
50
+ return core.HttpResponsePromise.fromPromise(this.__searchNotificationLogs(request, requestOptions));
51
+ }
52
+ __searchNotificationLogs(request, requestOptions) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ var _a, _b, _c;
55
+ const { PageSize: pageSize, Skip: skip, body: _body } = request;
56
+ const _queryParams = {};
57
+ if (pageSize != null) {
58
+ _queryParams["PageSize"] = pageSize.toString();
59
+ }
60
+ if (skip != null) {
61
+ _queryParams["Skip"] = skip.toString();
62
+ }
63
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
64
+ const _response = yield core.fetcher({
65
+ 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, "/v2/notificationlogs"),
66
+ method: "POST",
67
+ headers: _headers,
68
+ contentType: "application/json",
69
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
70
+ requestType: "json",
71
+ body: _body,
72
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
73
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
74
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
75
+ });
76
+ if (_response.ok) {
77
+ return { data: _response.body, rawResponse: _response.rawResponse };
78
+ }
79
+ if (_response.error.reason === "status-code") {
80
+ switch (_response.error.statusCode) {
81
+ case 400:
82
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
83
+ case 401:
84
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
85
+ case 500:
86
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
87
+ case 503:
88
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
89
+ default:
90
+ throw new errors.PayabliError({
91
+ statusCode: _response.error.statusCode,
92
+ body: _response.error.body,
93
+ rawResponse: _response.rawResponse,
94
+ });
95
+ }
96
+ }
97
+ switch (_response.error.reason) {
98
+ case "non-json":
99
+ throw new errors.PayabliError({
100
+ statusCode: _response.error.statusCode,
101
+ body: _response.error.rawBody,
102
+ rawResponse: _response.rawResponse,
103
+ });
104
+ case "timeout":
105
+ throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /v2/notificationlogs.");
106
+ case "unknown":
107
+ throw new errors.PayabliError({
108
+ message: _response.error.errorMessage,
109
+ rawResponse: _response.rawResponse,
110
+ });
111
+ }
112
+ });
113
+ }
114
+ /**
115
+ * Get detailed information for a specific notification log entry.
116
+ * This endpoint requires the `notifications_create` OR `notifications_read` permission.
117
+ *
118
+ * @param {string} uuid - The notification log entry.
119
+ * @param {Notificationlogs.RequestOptions} requestOptions - Request-specific configuration.
120
+ *
121
+ * @throws {@link Payabli.BadRequestError}
122
+ * @throws {@link Payabli.UnauthorizedError}
123
+ * @throws {@link Payabli.InternalServerError}
124
+ * @throws {@link Payabli.ServiceUnavailableError}
125
+ *
126
+ * @example
127
+ * await client.notificationlogs.getNotificationLog("550e8400-e29b-41d4-a716-446655440000")
128
+ */
129
+ getNotificationLog(uuid, requestOptions) {
130
+ return core.HttpResponsePromise.fromPromise(this.__getNotificationLog(uuid, requestOptions));
131
+ }
132
+ __getNotificationLog(uuid, requestOptions) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ var _a, _b, _c;
135
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
136
+ const _response = yield core.fetcher({
137
+ 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, `/v2/notificationlogs/${encodeURIComponent(uuid)}`),
138
+ method: "GET",
139
+ headers: _headers,
140
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
141
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
142
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
143
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
144
+ });
145
+ if (_response.ok) {
146
+ return { data: _response.body, rawResponse: _response.rawResponse };
147
+ }
148
+ if (_response.error.reason === "status-code") {
149
+ switch (_response.error.statusCode) {
150
+ case 400:
151
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
152
+ case 401:
153
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
154
+ case 500:
155
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
156
+ case 503:
157
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
158
+ default:
159
+ throw new errors.PayabliError({
160
+ statusCode: _response.error.statusCode,
161
+ body: _response.error.body,
162
+ rawResponse: _response.rawResponse,
163
+ });
164
+ }
165
+ }
166
+ switch (_response.error.reason) {
167
+ case "non-json":
168
+ throw new errors.PayabliError({
169
+ statusCode: _response.error.statusCode,
170
+ body: _response.error.rawBody,
171
+ rawResponse: _response.rawResponse,
172
+ });
173
+ case "timeout":
174
+ throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /v2/notificationlogs/{uuid}.");
175
+ case "unknown":
176
+ throw new errors.PayabliError({
177
+ message: _response.error.errorMessage,
178
+ rawResponse: _response.rawResponse,
179
+ });
180
+ }
181
+ });
182
+ }
183
+ /**
184
+ * Retry sending a specific notification.
185
+ *
186
+ * **Permissions:** notifications_create
187
+ *
188
+ * @param {string} uuid - Unique id
189
+ * @param {Notificationlogs.RequestOptions} requestOptions - Request-specific configuration.
190
+ *
191
+ * @throws {@link Payabli.BadRequestError}
192
+ * @throws {@link Payabli.UnauthorizedError}
193
+ * @throws {@link Payabli.InternalServerError}
194
+ * @throws {@link Payabli.ServiceUnavailableError}
195
+ *
196
+ * @example
197
+ * await client.notificationlogs.retryNotificationLog("550e8400-e29b-41d4-a716-446655440000")
198
+ */
199
+ retryNotificationLog(uuid, requestOptions) {
200
+ return core.HttpResponsePromise.fromPromise(this.__retryNotificationLog(uuid, requestOptions));
201
+ }
202
+ __retryNotificationLog(uuid, requestOptions) {
203
+ return __awaiter(this, void 0, void 0, function* () {
204
+ var _a, _b, _c;
205
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
206
+ const _response = yield core.fetcher({
207
+ 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, `/v2/notificationlogs/${encodeURIComponent(uuid)}/retry`),
208
+ method: "GET",
209
+ headers: _headers,
210
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
211
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
212
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
213
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
214
+ });
215
+ if (_response.ok) {
216
+ return { data: _response.body, rawResponse: _response.rawResponse };
217
+ }
218
+ if (_response.error.reason === "status-code") {
219
+ switch (_response.error.statusCode) {
220
+ case 400:
221
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
222
+ case 401:
223
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
224
+ case 500:
225
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
226
+ case 503:
227
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
228
+ default:
229
+ throw new errors.PayabliError({
230
+ statusCode: _response.error.statusCode,
231
+ body: _response.error.body,
232
+ rawResponse: _response.rawResponse,
233
+ });
234
+ }
235
+ }
236
+ switch (_response.error.reason) {
237
+ case "non-json":
238
+ throw new errors.PayabliError({
239
+ statusCode: _response.error.statusCode,
240
+ body: _response.error.rawBody,
241
+ rawResponse: _response.rawResponse,
242
+ });
243
+ case "timeout":
244
+ throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /v2/notificationlogs/{uuid}/retry.");
245
+ case "unknown":
246
+ throw new errors.PayabliError({
247
+ message: _response.error.errorMessage,
248
+ rawResponse: _response.rawResponse,
249
+ });
250
+ }
251
+ });
252
+ }
253
+ /**
254
+ * Retry sending multiple notifications (maximum 50 IDs).
255
+ * This is an async process, so use the search endpoint again to check the notification status.
256
+ *
257
+ * This endpoint requires the `notifications_create` permission.
258
+ *
259
+ * @param {Payabli.BulkRetryRequest} request
260
+ * @param {Notificationlogs.RequestOptions} requestOptions - Request-specific configuration.
261
+ *
262
+ * @throws {@link Payabli.BadRequestError}
263
+ * @throws {@link Payabli.UnauthorizedError}
264
+ * @throws {@link Payabli.InternalServerError}
265
+ * @throws {@link Payabli.ServiceUnavailableError}
266
+ *
267
+ * @example
268
+ * await client.notificationlogs.bulkRetryNotificationLogs(["550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440001", "550e8400-e29b-41d4-a716-446655440002"])
269
+ */
270
+ bulkRetryNotificationLogs(request, requestOptions) {
271
+ return core.HttpResponsePromise.fromPromise(this.__bulkRetryNotificationLogs(request, requestOptions));
272
+ }
273
+ __bulkRetryNotificationLogs(request, requestOptions) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ var _a, _b, _c;
276
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
+ const _response = yield core.fetcher({
278
+ 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, "/v2/notificationlogs/retry"),
279
+ method: "POST",
280
+ headers: _headers,
281
+ contentType: "application/json",
282
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
283
+ requestType: "json",
284
+ body: request,
285
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
286
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
287
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
288
+ });
289
+ if (_response.ok) {
290
+ return { data: undefined, rawResponse: _response.rawResponse };
291
+ }
292
+ if (_response.error.reason === "status-code") {
293
+ switch (_response.error.statusCode) {
294
+ case 400:
295
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
296
+ case 401:
297
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
298
+ case 500:
299
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
300
+ case 503:
301
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
302
+ default:
303
+ throw new errors.PayabliError({
304
+ statusCode: _response.error.statusCode,
305
+ body: _response.error.body,
306
+ rawResponse: _response.rawResponse,
307
+ });
308
+ }
309
+ }
310
+ switch (_response.error.reason) {
311
+ case "non-json":
312
+ throw new errors.PayabliError({
313
+ statusCode: _response.error.statusCode,
314
+ body: _response.error.rawBody,
315
+ rawResponse: _response.rawResponse,
316
+ });
317
+ case "timeout":
318
+ throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /v2/notificationlogs/retry.");
319
+ case "unknown":
320
+ throw new errors.PayabliError({
321
+ message: _response.error.errorMessage,
322
+ rawResponse: _response.rawResponse,
323
+ });
324
+ }
325
+ });
326
+ }
327
+ _getCustomAuthorizationHeaders() {
328
+ return __awaiter(this, void 0, void 0, function* () {
329
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
330
+ return { requestToken: apiKeyValue };
331
+ });
332
+ }
333
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Payabli from "../../../../index.mjs";
5
+ /**
6
+ * @example
7
+ * {
8
+ * PageSize: 20,
9
+ * body: {
10
+ * startDate: "2024-01-01T00:00:00Z",
11
+ * endDate: "2024-01-31T23:59:59Z",
12
+ * orgId: 12345,
13
+ * notificationEvent: "ActivatedMerchant",
14
+ * succeeded: true
15
+ * }
16
+ * }
17
+ */
18
+ export interface SearchNotificationLogsRequest {
19
+ PageSize?: Payabli.Pagesize;
20
+ /** The number of records to skip before starting to collect the result set. */
21
+ Skip?: number;
22
+ body: Payabli.NotificationLogSearchRequest;
23
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export { type SearchNotificationLogsRequest } from "./SearchNotificationLogsRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./types/index.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./types/index.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * A list of notification log IDs to retry. The maximum number of IDs that can be retried in a single request is 50.
6
+ */
7
+ export type BulkRetryRequest = string[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface KeyValueArray {
5
+ key?: string;
6
+ value?: string[];
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface NotificationLog {
5
+ /** The unique identifier for the notification. */
6
+ id: string;
7
+ /** The ID of the organization that the notification belongs to. */
8
+ orgId: number | null;
9
+ /** The ID of the paypoint that the notification is related to. */
10
+ paypointId: number | null;
11
+ /** The event that triggered the notification. */
12
+ notificationEvent: string | null;
13
+ /** The target URL for the notification. */
14
+ target: string | null;
15
+ /** The HTTP response status of the notification. */
16
+ responseStatus: string | null;
17
+ /** Indicates whether the notification was successful. */
18
+ success: boolean;
19
+ /** Contains the body of the notification. */
20
+ jobData: string | null;
21
+ /** The date and time when the notification was created. */
22
+ createdDate: string;
23
+ /** The date and time when the notification was successfully delivered. */
24
+ successDate: string | null;
25
+ /** The date and time when the notification last failed. */
26
+ lastFailedDate: string | null;
27
+ /** Indicates whether the notification is currently in progress. */
28
+ isInProgress: boolean;
29
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Payabli from "../../../index.mjs";
5
+ export interface NotificationLogDetail extends Payabli.NotificationLog {
6
+ webHeaders?: Payabli.StringStringKeyValuePair[];
7
+ responseHeaders?: Payabli.KeyValueArray[];
8
+ responseContent?: string;
9
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface NotificationLogSearchRequest {
5
+ /** The start date for the search. */
6
+ startDate: string;
7
+ /** The end date for the search. */
8
+ endDate: string;
9
+ /** The type of notification event to filter by. */
10
+ notificationEvent?: string;
11
+ /** Indicates whether the notification was successful. */
12
+ succeeded?: boolean;
13
+ /** The ID of the organization to filter by. */
14
+ orgId?: number;
15
+ /** The ID of the paypoint to filter by. */
16
+ paypointId?: number;
17
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface StringStringKeyValuePair {
5
+ key?: string;
6
+ value?: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from "./NotificationLog.mjs";
2
+ export * from "./NotificationLogDetail.mjs";
3
+ export * from "./StringStringKeyValuePair.mjs";
4
+ export * from "./KeyValueArray.mjs";
5
+ export * from "./NotificationLogSearchRequest.mjs";
6
+ export * from "./BulkRetryRequest.mjs";
@@ -0,0 +1,6 @@
1
+ export * from "./NotificationLog.mjs";
2
+ export * from "./NotificationLogDetail.mjs";
3
+ export * from "./StringStringKeyValuePair.mjs";
4
+ export * from "./KeyValueArray.mjs";
5
+ export * from "./NotificationLogSearchRequest.mjs";
6
+ export * from "./BulkRetryRequest.mjs";
@@ -3,9 +3,9 @@
3
3
  */
4
4
  import * as Payabli from "../../../index.mjs";
5
5
  export interface PayabliApiResponseOcr {
6
- isSuccess?: Payabli.IsSuccess;
7
- responseText?: Payabli.ResponseText;
8
- responseCode?: Payabli.Responsecode;
6
+ isSuccess: Payabli.IsSuccess;
7
+ responseText: Payabli.ResponseText;
8
+ responseCode: Payabli.Responsecode;
9
9
  /** Details of the OCR processing result */
10
10
  responseData?: Payabli.OcrResponseData;
11
11
  }
@@ -6,5 +6,5 @@ export interface AddOrganizationResponse {
6
6
  isSuccess?: Payabli.IsSuccess;
7
7
  /** Returns the organization ID. */
8
8
  responseData?: Payabli.Responsedatanonobject;
9
- responseText?: Payabli.ResponseText;
9
+ responseText: Payabli.ResponseText;
10
10
  }
@@ -6,5 +6,5 @@ export interface DeleteOrganizationResponse {
6
6
  isSuccess?: Payabli.IsSuccess;
7
7
  /** Returns the organization ID. */
8
8
  responseData?: Payabli.Responsedatanonobject;
9
- responseText?: Payabli.ResponseText;
9
+ responseText: Payabli.ResponseText;
10
10
  }
@@ -5,8 +5,8 @@ import * as Payabli from "../../../index.mjs";
5
5
  export interface EditOrganizationResponse {
6
6
  isSuccess?: Payabli.IsSuccess;
7
7
  pageIdentifier?: Payabli.PageIdentifier;
8
- responseCode?: Payabli.Responsecode;
8
+ responseCode: Payabli.Responsecode;
9
9
  /** Returns the organization ID. */
10
10
  responseData?: Payabli.Responsedatanonobject;
11
- responseText?: Payabli.ResponseText;
11
+ responseText: Payabli.ResponseText;
12
12
  }
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import * as Payabli from "../../../index.mjs";
5
5
  export interface PayabliApiResponsePaymentLinks {
6
- isSuccess?: Payabli.IsSuccess;
6
+ isSuccess: Payabli.IsSuccess;
7
7
  /** If `isSuccess` = true, this contains the payment link identifier. If `isSuccess` = false, this contains the reason of the error. */
8
8
  responseData?: string;
9
- responseText?: Payabli.ResponseText;
9
+ responseText: Payabli.ResponseText;
10
10
  }
@@ -3,9 +3,9 @@
3
3
  */
4
4
  import * as Payabli from "../../../index.mjs";
5
5
  export interface GetBasicEntryByIdResponse {
6
- isSuccess?: Payabli.IsSuccess;
6
+ isSuccess: Payabli.IsSuccess;
7
7
  pageIdentifier?: Payabli.PageIdentifier;
8
8
  responseCode?: Payabli.Responsecode;
9
9
  responseData?: Payabli.PaypointEntryConfig;
10
- responseText?: Payabli.ResponseText;
10
+ responseText: Payabli.ResponseText;
11
11
  }
@@ -3,9 +3,9 @@
3
3
  */
4
4
  import * as Payabli from "../../../index.mjs";
5
5
  export interface GetBasicEntryResponse {
6
- isSuccess?: Payabli.IsSuccess;
6
+ isSuccess: Payabli.IsSuccess;
7
7
  pageIdentifier?: Payabli.PageIdentifier;
8
8
  responseCode?: Payabli.Responsecode;
9
9
  responseData?: Payabli.PaypointEntryConfig;
10
- responseText?: Payabli.ResponseText;
10
+ responseText: Payabli.ResponseText;
11
11
  }
@@ -3,9 +3,9 @@
3
3
  */
4
4
  import * as Payabli from "../../../index.mjs";
5
5
  export interface GetEntryConfigResponse {
6
- isSuccess?: Payabli.IsSuccess;
6
+ isSuccess: Payabli.IsSuccess;
7
7
  pageIdentifier?: Payabli.PageIdentifier;
8
8
  responseCode?: Payabli.Responsecode;
9
9
  responseData?: Payabli.PaypointEntryConfig;
10
- responseText?: Payabli.ResponseText;
10
+ responseText: Payabli.ResponseText;
11
11
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Payabli from "../../../index.mjs";
5
5
  export interface MigratePaypointResponse {
6
- isSuccess?: Payabli.IsSuccess;
6
+ isSuccess: Payabli.IsSuccess;
7
7
  responseCode?: Payabli.Responsecode;
8
- responseText?: Payabli.ResponseText;
8
+ responseText: Payabli.ResponseText;
9
9
  }
@@ -15,7 +15,7 @@ import * as Payabli from "../../../index.mjs";
15
15
  */
16
16
  export interface AddSubscriptionResponse {
17
17
  customerId?: Payabli.CustomerId;
18
- responseText?: Payabli.ResponseText;
18
+ responseText: Payabli.ResponseText;
19
19
  isSuccess?: Payabli.IsSuccess;
20
20
  /** The identifier of the newly created subscription. */
21
21
  responseData: number;
@@ -13,5 +13,5 @@ export interface RemoveSubscriptionResponse {
13
13
  * If `isSuccess` = false, this contains the reason for the failure.
14
14
  */
15
15
  responseData?: string;
16
- responseText?: Payabli.ResponseText;
16
+ responseText: Payabli.ResponseText;
17
17
  }