@nicertravel/sdk 0.0.0 → 1.0.0-beta.2

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 (270) hide show
  1. package/README.md +89 -3
  2. package/dist/_/codec.d.ts +93 -0
  3. package/dist/_/codec.js +298 -0
  4. package/dist/_/error.d.ts +27 -0
  5. package/dist/_/error.js +68 -0
  6. package/dist/_/hooks/envelope.d.ts +11 -0
  7. package/dist/_/hooks/envelope.js +15 -0
  8. package/dist/_/index.d.ts +3 -0
  9. package/dist/_/index.js +5 -0
  10. package/dist/_/transport.d.ts +146 -0
  11. package/dist/_/transport.js +220 -0
  12. package/dist/activities/client.d.ts +35 -0
  13. package/dist/activities/client.js +23 -0
  14. package/dist/activities/index.d.ts +5 -0
  15. package/dist/activities/index.js +4 -0
  16. package/dist/activities/models.d.ts +27 -0
  17. package/dist/activities/models.js +3 -0
  18. package/dist/activityDestinations/client.d.ts +24 -0
  19. package/dist/activityDestinations/client.js +17 -0
  20. package/dist/activityDestinations/index.d.ts +4 -0
  21. package/dist/activityDestinations/index.js +4 -0
  22. package/dist/balances/client.d.ts +29 -0
  23. package/dist/balances/client.js +18 -0
  24. package/dist/balances/index.d.ts +5 -0
  25. package/dist/balances/index.js +4 -0
  26. package/dist/balances/models.d.ts +12 -0
  27. package/dist/balances/models.js +3 -0
  28. package/dist/bookingSelections/client.d.ts +54 -0
  29. package/dist/bookingSelections/client.js +25 -0
  30. package/dist/bookingSelections/index.d.ts +5 -0
  31. package/dist/bookingSelections/index.js +4 -0
  32. package/dist/bookingSelections/models.d.ts +35 -0
  33. package/dist/bookingSelections/models.js +3 -0
  34. package/dist/carRentals/client.d.ts +55 -0
  35. package/dist/carRentals/client.js +25 -0
  36. package/dist/carRentals/index.d.ts +5 -0
  37. package/dist/carRentals/index.js +4 -0
  38. package/dist/carRentals/models.d.ts +157 -0
  39. package/dist/carRentals/models.js +3 -0
  40. package/dist/carriers/client.d.ts +32 -0
  41. package/dist/carriers/client.js +18 -0
  42. package/dist/carriers/index.d.ts +5 -0
  43. package/dist/carriers/index.js +4 -0
  44. package/dist/carriers/models.d.ts +9 -0
  45. package/dist/carriers/models.js +3 -0
  46. package/dist/chats/client.d.ts +69 -0
  47. package/dist/chats/client.js +38 -0
  48. package/dist/chats/index.d.ts +5 -0
  49. package/dist/chats/index.js +4 -0
  50. package/dist/chats/models.d.ts +25 -0
  51. package/dist/chats/models.js +3 -0
  52. package/dist/checkouts/client.d.ts +27 -0
  53. package/dist/checkouts/client.js +18 -0
  54. package/dist/checkouts/index.d.ts +5 -0
  55. package/dist/checkouts/index.js +4 -0
  56. package/dist/checkouts/models.d.ts +23 -0
  57. package/dist/checkouts/models.js +3 -0
  58. package/dist/client.d.ts +95 -0
  59. package/dist/client.js +220 -0
  60. package/dist/commissionExports/client.d.ts +62 -0
  61. package/dist/commissionExports/client.js +33 -0
  62. package/dist/commissionExports/index.d.ts +5 -0
  63. package/dist/commissionExports/index.js +4 -0
  64. package/dist/commissionExports/models.d.ts +165 -0
  65. package/dist/commissionExports/models.js +3 -0
  66. package/dist/commissionImports/client.d.ts +61 -0
  67. package/dist/commissionImports/client.js +34 -0
  68. package/dist/commissionImports/index.d.ts +5 -0
  69. package/dist/commissionImports/index.js +4 -0
  70. package/dist/commissionImports/models.d.ts +118 -0
  71. package/dist/commissionImports/models.js +3 -0
  72. package/dist/commissionItems/client.d.ts +128 -0
  73. package/dist/commissionItems/client.js +41 -0
  74. package/dist/commissionItems/index.d.ts +5 -0
  75. package/dist/commissionItems/index.js +4 -0
  76. package/dist/commissionItems/models.d.ts +217 -0
  77. package/dist/commissionItems/models.js +3 -0
  78. package/dist/commissionReports/client.d.ts +76 -0
  79. package/dist/commissionReports/client.js +18 -0
  80. package/dist/commissionReports/index.d.ts +5 -0
  81. package/dist/commissionReports/index.js +4 -0
  82. package/dist/commissionReports/models.d.ts +208 -0
  83. package/dist/commissionReports/models.js +3 -0
  84. package/dist/crmSettings/client.d.ts +50 -0
  85. package/dist/crmSettings/client.js +25 -0
  86. package/dist/crmSettings/index.d.ts +5 -0
  87. package/dist/crmSettings/index.js +4 -0
  88. package/dist/crmSettings/models.d.ts +313 -0
  89. package/dist/crmSettings/models.js +3 -0
  90. package/dist/earnings/client.d.ts +30 -0
  91. package/dist/earnings/client.js +18 -0
  92. package/dist/earnings/index.d.ts +5 -0
  93. package/dist/earnings/index.js +4 -0
  94. package/dist/earnings/models.d.ts +16 -0
  95. package/dist/earnings/models.js +3 -0
  96. package/dist/externalBookings/client.d.ts +56 -0
  97. package/dist/externalBookings/client.js +33 -0
  98. package/dist/externalBookings/index.d.ts +5 -0
  99. package/dist/externalBookings/index.js +4 -0
  100. package/dist/externalBookings/models.d.ts +93 -0
  101. package/dist/externalBookings/models.js +3 -0
  102. package/dist/externalPayments/client.d.ts +23 -0
  103. package/dist/externalPayments/client.js +18 -0
  104. package/dist/externalPayments/index.d.ts +5 -0
  105. package/dist/externalPayments/index.js +4 -0
  106. package/dist/externalPayments/models.d.ts +47 -0
  107. package/dist/externalPayments/models.js +3 -0
  108. package/dist/favorites/client.d.ts +87 -0
  109. package/dist/favorites/client.js +63 -0
  110. package/dist/favorites/index.d.ts +5 -0
  111. package/dist/favorites/index.js +4 -0
  112. package/dist/favorites/models.d.ts +79 -0
  113. package/dist/favorites/models.js +3 -0
  114. package/dist/flightSchedules/client.d.ts +29 -0
  115. package/dist/flightSchedules/client.js +18 -0
  116. package/dist/flightSchedules/index.d.ts +5 -0
  117. package/dist/flightSchedules/index.js +4 -0
  118. package/dist/flightSchedules/models.d.ts +25 -0
  119. package/dist/flightSchedules/models.js +3 -0
  120. package/dist/flights/client.d.ts +73 -0
  121. package/dist/flights/client.js +25 -0
  122. package/dist/flights/index.d.ts +5 -0
  123. package/dist/flights/index.js +4 -0
  124. package/dist/flights/models.d.ts +345 -0
  125. package/dist/flights/models.js +3 -0
  126. package/dist/hotels/client.d.ts +104 -0
  127. package/dist/hotels/client.js +26 -0
  128. package/dist/hotels/index.d.ts +5 -0
  129. package/dist/hotels/index.js +4 -0
  130. package/dist/hotels/models.d.ts +355 -0
  131. package/dist/hotels/models.js +3 -0
  132. package/dist/index.d.ts +5 -0
  133. package/dist/index.js +4 -0
  134. package/dist/insuranceQuotes/client.d.ts +27 -0
  135. package/dist/insuranceQuotes/client.js +18 -0
  136. package/dist/insuranceQuotes/index.d.ts +5 -0
  137. package/dist/insuranceQuotes/index.js +4 -0
  138. package/dist/insuranceQuotes/models.d.ts +76 -0
  139. package/dist/insuranceQuotes/models.js +3 -0
  140. package/dist/itineraries/client.d.ts +165 -0
  141. package/dist/itineraries/client.js +86 -0
  142. package/dist/itineraries/index.d.ts +5 -0
  143. package/dist/itineraries/index.js +4 -0
  144. package/dist/itineraries/models.d.ts +1619 -0
  145. package/dist/itineraries/models.js +4 -0
  146. package/dist/models.d.ts +1361 -0
  147. package/dist/models.js +3 -0
  148. package/dist/notes/client.d.ts +82 -0
  149. package/dist/notes/client.js +41 -0
  150. package/dist/notes/index.d.ts +5 -0
  151. package/dist/notes/index.js +4 -0
  152. package/dist/notes/models.d.ts +116 -0
  153. package/dist/notes/models.js +3 -0
  154. package/dist/offers/client.d.ts +27 -0
  155. package/dist/offers/client.js +17 -0
  156. package/dist/offers/index.d.ts +5 -0
  157. package/dist/offers/index.js +4 -0
  158. package/dist/offers/models.d.ts +19 -0
  159. package/dist/offers/models.js +3 -0
  160. package/dist/options/index.d.ts +114 -0
  161. package/dist/options/index.js +115 -0
  162. package/dist/orders/client.d.ts +154 -0
  163. package/dist/orders/client.js +65 -0
  164. package/dist/orders/index.d.ts +5 -0
  165. package/dist/orders/index.js +4 -0
  166. package/dist/orders/models.d.ts +2510 -0
  167. package/dist/orders/models.js +3 -0
  168. package/dist/payees/client.d.ts +48 -0
  169. package/dist/payees/client.js +26 -0
  170. package/dist/payees/index.d.ts +5 -0
  171. package/dist/payees/index.js +4 -0
  172. package/dist/payees/models.d.ts +50 -0
  173. package/dist/payees/models.js +3 -0
  174. package/dist/paymentMethods/client.d.ts +24 -0
  175. package/dist/paymentMethods/client.js +18 -0
  176. package/dist/paymentMethods/index.d.ts +5 -0
  177. package/dist/paymentMethods/index.js +4 -0
  178. package/dist/paymentMethods/models.d.ts +60 -0
  179. package/dist/paymentMethods/models.js +3 -0
  180. package/dist/places/client.d.ts +61 -0
  181. package/dist/places/client.js +25 -0
  182. package/dist/places/index.d.ts +5 -0
  183. package/dist/places/index.js +4 -0
  184. package/dist/places/models.d.ts +51 -0
  185. package/dist/places/models.js +3 -0
  186. package/dist/profileForms/client.d.ts +38 -0
  187. package/dist/profileForms/client.js +25 -0
  188. package/dist/profileForms/index.d.ts +5 -0
  189. package/dist/profileForms/index.js +4 -0
  190. package/dist/profileForms/models.d.ts +24 -0
  191. package/dist/profileForms/models.js +3 -0
  192. package/dist/quotes/client.d.ts +30 -0
  193. package/dist/quotes/client.js +18 -0
  194. package/dist/quotes/index.d.ts +5 -0
  195. package/dist/quotes/index.js +4 -0
  196. package/dist/quotes/models.d.ts +47 -0
  197. package/dist/quotes/models.js +3 -0
  198. package/dist/remittanceBatches/client.d.ts +78 -0
  199. package/dist/remittanceBatches/client.js +42 -0
  200. package/dist/remittanceBatches/index.d.ts +5 -0
  201. package/dist/remittanceBatches/index.js +4 -0
  202. package/dist/remittanceBatches/models.d.ts +131 -0
  203. package/dist/remittanceBatches/models.js +3 -0
  204. package/dist/remittanceClaims/client.d.ts +27 -0
  205. package/dist/remittanceClaims/client.js +18 -0
  206. package/dist/remittanceClaims/index.d.ts +5 -0
  207. package/dist/remittanceClaims/index.js +4 -0
  208. package/dist/remittanceClaims/models.d.ts +5 -0
  209. package/dist/remittanceClaims/models.js +3 -0
  210. package/dist/remittanceLines/client.d.ts +27 -0
  211. package/dist/remittanceLines/client.js +18 -0
  212. package/dist/remittanceLines/index.d.ts +5 -0
  213. package/dist/remittanceLines/index.js +4 -0
  214. package/dist/remittanceLines/models.d.ts +5 -0
  215. package/dist/remittanceLines/models.js +3 -0
  216. package/dist/remittances/client.d.ts +78 -0
  217. package/dist/remittances/client.js +42 -0
  218. package/dist/remittances/index.d.ts +5 -0
  219. package/dist/remittances/index.js +4 -0
  220. package/dist/remittances/models.d.ts +116 -0
  221. package/dist/remittances/models.js +3 -0
  222. package/dist/statements/client.d.ts +75 -0
  223. package/dist/statements/client.js +34 -0
  224. package/dist/statements/index.d.ts +5 -0
  225. package/dist/statements/index.js +4 -0
  226. package/dist/statements/models.d.ts +147 -0
  227. package/dist/statements/models.js +3 -0
  228. package/dist/suppliers/client.d.ts +71 -0
  229. package/dist/suppliers/client.js +41 -0
  230. package/dist/suppliers/index.d.ts +5 -0
  231. package/dist/suppliers/index.js +4 -0
  232. package/dist/suppliers/models.d.ts +130 -0
  233. package/dist/suppliers/models.js +3 -0
  234. package/dist/taskTemplates/client.d.ts +36 -0
  235. package/dist/taskTemplates/client.js +18 -0
  236. package/dist/taskTemplates/index.d.ts +5 -0
  237. package/dist/taskTemplates/index.js +4 -0
  238. package/dist/taskTemplates/models.d.ts +15 -0
  239. package/dist/taskTemplates/models.js +3 -0
  240. package/dist/tasks/client.d.ts +105 -0
  241. package/dist/tasks/client.js +41 -0
  242. package/dist/tasks/index.d.ts +5 -0
  243. package/dist/tasks/index.js +4 -0
  244. package/dist/tasks/models.d.ts +59 -0
  245. package/dist/tasks/models.js +3 -0
  246. package/dist/timeline/client.d.ts +42 -0
  247. package/dist/timeline/client.js +18 -0
  248. package/dist/timeline/index.d.ts +5 -0
  249. package/dist/timeline/index.js +4 -0
  250. package/dist/timeline/models.d.ts +65 -0
  251. package/dist/timeline/models.js +3 -0
  252. package/dist/travelProfile/client.d.ts +56 -0
  253. package/dist/travelProfile/client.js +25 -0
  254. package/dist/travelProfile/index.d.ts +5 -0
  255. package/dist/travelProfile/index.js +4 -0
  256. package/dist/travelProfile/models.d.ts +95 -0
  257. package/dist/travelProfile/models.js +3 -0
  258. package/dist/travelers/client.d.ts +214 -0
  259. package/dist/travelers/client.js +76 -0
  260. package/dist/travelers/index.d.ts +5 -0
  261. package/dist/travelers/index.js +4 -0
  262. package/dist/travelers/models.d.ts +576 -0
  263. package/dist/travelers/models.js +3 -0
  264. package/dist/trips/client.d.ts +224 -0
  265. package/dist/trips/client.js +88 -0
  266. package/dist/trips/index.d.ts +5 -0
  267. package/dist/trips/index.js +4 -0
  268. package/dist/trips/models.d.ts +486 -0
  269. package/dist/trips/models.js +3 -0
  270. package/package.json +35 -2
@@ -0,0 +1,78 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { RemittanceBatchAction, RemittanceBatchActionRunResponse, RemittanceBatchCreateBody, RemittanceBatchCreateResponse, RemittanceBatchGetResponse, RemittanceBatchesListResponse } from "./models.js";
3
+ export interface ClientOptions extends BaseClientOptions {
4
+ /**
5
+ * The URL the paths of the API are relative to.
6
+ */
7
+ baseUrl: string;
8
+ }
9
+ export interface Client {
10
+ /**
11
+ * Upload a remittance file
12
+ *
13
+ * Registers a remittance file (CSV, TSV, TXT or XLSX, up to 100 MiB: a
14
+ * clearinghouse or chain statement, an EFT detail) and answers a presigned
15
+ * upload. Once S3 has the file, a worker reads it into draft remittances and
16
+ * lines and matches them (status PARSING, then READY); without a preset it
17
+ * stops at UPLOADED with the column names until APPLY_MAPPING. The same file
18
+ * twice answers 409 COMMISSION_FILE_ALREADY_IMPORTED. Poll `GET
19
+ * /remittance-batches/{batchId}`. Agency admins and finance staff.
20
+ */
21
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
22
+ /**
23
+ * Get a remittance file
24
+ *
25
+ * A remittance file with a page of its lines (50 by default, at most 200, in
26
+ * file order; `matchState` keeps the lines of the review tabs), each with the
27
+ * engine's proposals, the chosen match and, once reconciled, its allocations
28
+ * (a line the reconcile matched, excluded or found zero keeps only its chosen
29
+ * proposals, and no cells). Agency admins and finance staff; another
30
+ * company's file answers 404.
31
+ */
32
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
33
+ /**
34
+ * List remittance files
35
+ *
36
+ * The company's remittance files, newest first (25 by default, at most 100,
37
+ * keyset-paged), each with its status and where its lines stand. Agency
38
+ * admins and finance staff.
39
+ */
40
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
41
+ /**
42
+ * Run an action on a remittance file
43
+ *
44
+ * Runs one action on a remittance file under review: APPLY_MAPPING (reads the
45
+ * file again), SAVE_PRESET, EDIT_LINE, EXCLUDE_LINE, INCLUDE_LINE, SET_MATCH
46
+ * (the items a line pays and how much), RESET_MATCHES, RERUN_MATCHING,
47
+ * RECONCILE (posts the money and allocates every chosen match as a resumable
48
+ * job), UNDO_RECONCILE (reverses every allocation and voids the remittances)
49
+ * and DISCARD (before reconciling). Jobs answer at once with `jobId`; poll
50
+ * the file (status COMMITTING while the reconcile runs, then COMMITTED; a
51
+ * reconcile that failed resumes when asked again). A file reconciled once
52
+ * cannot be reconciled again. Agency admins and finance staff; UNDO_RECONCILE
53
+ * Nicer staff only.
54
+ */
55
+ runAction(request: RunActionRequest, options?: RequestOptions): Promise<RunActionResponse>;
56
+ }
57
+ export declare function createClient(options: ClientOptions): Client;
58
+ export declare function bind(transport: Transport): Client;
59
+ export type CreateRequest = RemittanceBatchCreateBody;
60
+ export type CreateResponse = RemittanceBatchCreateResponse;
61
+ export interface GetRequest {
62
+ batchId: string;
63
+ cursor?: string;
64
+ limit?: number;
65
+ matchState?: string;
66
+ }
67
+ export type GetResponse = RemittanceBatchGetResponse;
68
+ export interface ListRequest {
69
+ channel?: string;
70
+ cursor?: string;
71
+ limit?: number;
72
+ status?: string;
73
+ }
74
+ export type ListResponse = RemittanceBatchesListResponse;
75
+ export type RunActionRequest = {
76
+ batchId: string;
77
+ } & RemittanceBatchAction;
78
+ export type RunActionResponse = RemittanceBatchActionRunResponse;
@@ -0,0 +1,42 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, } from "../_/index.js";
4
+ export function createClient(options) {
5
+ return bind(new Transport(options));
6
+ }
7
+ export function bind(transport) {
8
+ return {
9
+ create: (request, options) => transport.send(CreateOperation, request, options),
10
+ get: (request, options) => transport.send(GetOperation, request, options),
11
+ list: (request, options) => transport.send(ListOperation, request, options),
12
+ runAction: (request, options) => transport.send(RunActionOperation, request, options),
13
+ };
14
+ }
15
+ const CreateOperation = {
16
+ method: "POST",
17
+ route: "/commerce/remittance-batches",
18
+ body: "flat",
19
+ response: null,
20
+ errors: { "400": true, "401": true, "403": true },
21
+ };
22
+ const GetOperation = {
23
+ method: "GET",
24
+ route: "/commerce/remittance-batches/{batchId}",
25
+ query: { cursor: "cursor", limit: "limit", matchState: "matchState" },
26
+ response: null,
27
+ errors: { "400": true, "401": true, "403": true },
28
+ };
29
+ const ListOperation = {
30
+ method: "GET",
31
+ route: "/commerce/remittance-batches",
32
+ query: { channel: "channel", cursor: "cursor", limit: "limit", status: "status" },
33
+ response: null,
34
+ errors: { "400": true, "401": true, "403": true },
35
+ };
36
+ const RunActionOperation = {
37
+ method: "POST",
38
+ route: "/commerce/remittance-batches/{batchId}/actions",
39
+ body: "flat",
40
+ response: null,
41
+ errors: { "400": true, "401": true, "403": true },
42
+ };
@@ -0,0 +1,5 @@
1
+ export { ApiError } from "../_/index.js";
2
+ export type { RequestOptions } from "../_/index.js";
3
+ export { createClient } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, GetRequest, GetResponse, ListRequest, ListResponse, RunActionRequest, RunActionResponse, } from "./client.js";
5
+ export type { RemittanceBatch, RemittanceBatchAction, RemittanceBatchActionRunResponse, RemittanceBatchCreateBody, RemittanceBatchCreateResponse, RemittanceBatchGetResponse, RemittanceBatchStats, RemittanceBatchesListResponse, RemittanceImportField, RemittanceImportMapping, RemittanceLineEdit, } from "./models.js";
@@ -0,0 +1,4 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export { ApiError } from "../_/index.js";
4
+ export { createClient } from "./client.js";
@@ -0,0 +1,131 @@
1
+ import type { AllocationRequest, CommissionChannel, CommissionFileStatus, CurrencyCode, LineExclusionReason, RemittanceLine, UploadLink } from "../models.js";
2
+ export interface RemittanceBatch {
3
+ allowedActions: ("APPLY_MAPPING" | "SAVE_PRESET" | "EDIT_LINE" | "EXCLUDE_LINE" | "INCLUDE_LINE" | "SET_MATCH" | "RESET_MATCHES" | "RERUN_MATCHING" | "RECONCILE" | "UNDO_RECONCILE" | "DISCARD")[];
4
+ batchId: string;
5
+ channel: CommissionChannel;
6
+ committedAt: string | null;
7
+ committedByUserId: string | null;
8
+ companyName: string;
9
+ createdAt: string;
10
+ createdByUserId: string;
11
+ errorCode: string | null;
12
+ fileName: string;
13
+ format: "CSV" | "TSV" | "TXT" | "XLSX";
14
+ headers: string[];
15
+ jobId: string | null;
16
+ mapping: RemittanceImportMapping | null;
17
+ number: string;
18
+ parsedAt: string | null;
19
+ presetId: string | null;
20
+ sizeBytes: number;
21
+ source: "FILE_IMPORT";
22
+ stats: RemittanceBatchStats;
23
+ status: CommissionFileStatus;
24
+ undoneAt: string | null;
25
+ updatedAt: string;
26
+ }
27
+ export type RemittanceBatchAction = {
28
+ mapping: RemittanceImportMapping;
29
+ type: "APPLY_MAPPING";
30
+ } | {
31
+ name: string;
32
+ type: "SAVE_PRESET";
33
+ } | {
34
+ changes: RemittanceLineEdit;
35
+ remittanceLineId: string;
36
+ type: "EDIT_LINE";
37
+ } | {
38
+ reason: LineExclusionReason;
39
+ remittanceLineId: string;
40
+ type: "EXCLUDE_LINE";
41
+ } | {
42
+ remittanceLineId: string;
43
+ type: "INCLUDE_LINE";
44
+ } | {
45
+ allocations: AllocationRequest[];
46
+ remittanceLineId: string;
47
+ type: "SET_MATCH";
48
+ } | {
49
+ remittanceLineId?: string;
50
+ type: "RESET_MATCHES";
51
+ } | {
52
+ type: "RERUN_MATCHING";
53
+ } | {
54
+ type: "RECONCILE";
55
+ } | {
56
+ reason: string;
57
+ type: "UNDO_RECONCILE";
58
+ } | {
59
+ reason?: string;
60
+ type: "DISCARD";
61
+ };
62
+ export interface RemittanceBatchActionRunResponse {
63
+ batch: RemittanceBatch;
64
+ line: RemittanceLine | null;
65
+ }
66
+ export interface RemittanceBatchCreateBody {
67
+ channel: CommissionChannel;
68
+ fileName: string;
69
+ format: "CSV" | "TSV" | "TXT" | "XLSX";
70
+ presetId?: string | null;
71
+ sha256: string;
72
+ sizeBytes: number;
73
+ source?: "FILE_IMPORT";
74
+ }
75
+ export interface RemittanceBatchCreateResponse {
76
+ batch: RemittanceBatch;
77
+ upload: UploadLink;
78
+ }
79
+ export interface RemittanceBatchGetResponse {
80
+ batch: RemittanceBatch;
81
+ lines: RemittanceLine[];
82
+ nextCursor: string | null;
83
+ }
84
+ export interface RemittanceBatchStats {
85
+ excluded: number;
86
+ invalid: number;
87
+ invalidRows: {
88
+ errors: {
89
+ code: "REQUIRED" | "INVALID_AMOUNT" | "INVALID_DATE" | "INVALID_RATE" | "INVALID_VALUE";
90
+ field: RemittanceImportField;
91
+ }[];
92
+ rowNumber: number;
93
+ }[];
94
+ lines: number;
95
+ matched: number;
96
+ pendingReview: number;
97
+ proposed: number;
98
+ totals: {
99
+ amountMinor: number;
100
+ currency: CurrencyCode;
101
+ matchedMinor: number;
102
+ }[];
103
+ unmatched: number;
104
+ zero: number;
105
+ }
106
+ export interface RemittanceBatchesListResponse {
107
+ items: RemittanceBatch[];
108
+ nextCursor: string | null;
109
+ }
110
+ export type RemittanceImportField = "amount" | "bookingGross" | "checkIn" | "checkOut" | "clientName" | "confirmationNumber" | "currency" | "fee" | "fxRate" | "identifierNumber" | "originalAmount" | "originalCurrency" | "payableOn" | "payerName" | "paymentReference" | "rate" | "receivedOn" | "supplierName";
111
+ export interface RemittanceImportMapping {
112
+ columns: {
113
+ [key: string]: string;
114
+ };
115
+ dateFormat: "ISO" | "US" | "EU";
116
+ decimalSeparator: "." | ",";
117
+ defaults: {
118
+ [key: string]: string;
119
+ };
120
+ headerRow: number;
121
+ sheet: string | null;
122
+ }
123
+ export interface RemittanceLineEdit {
124
+ amountMinor?: number;
125
+ checkIn?: string | null;
126
+ checkOut?: string | null;
127
+ clientName?: string | null;
128
+ confirmationNumber?: string | null;
129
+ identifierNumber?: string | null;
130
+ supplierName?: string | null;
131
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,27 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { RemittanceClaim } from "../models.js";
3
+ import type { RemittanceLineClaimBody } from "./models.js";
4
+ export interface ClientOptions extends BaseClientOptions {
5
+ /**
6
+ * The URL the paths of the API are relative to.
7
+ */
8
+ baseUrl: string;
9
+ }
10
+ export interface Client {
11
+ /**
12
+ * Claim unmatched money
13
+ *
14
+ * Claims unmatched money for one of the caller's bookings
15
+ * (07-business-rules.md §12): a line of the caller's own company or of a host
16
+ * it is a member of, not archived for members, with money left. The receiving
17
+ * company approves or rejects the claim from the remittance. Advisors claim
18
+ * for their own bookings; a line the caller may not see answers 404.
19
+ */
20
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
21
+ }
22
+ export declare function createClient(options: ClientOptions): Client;
23
+ export declare function bind(transport: Transport): Client;
24
+ export type CreateRequest = {
25
+ remittanceLineId: string;
26
+ } & RemittanceLineClaimBody;
27
+ export type CreateResponse = RemittanceClaim;
@@ -0,0 +1,18 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, } from "../_/index.js";
4
+ export function createClient(options) {
5
+ return bind(new Transport(options));
6
+ }
7
+ export function bind(transport) {
8
+ return {
9
+ create: (request, options) => transport.send(CreateOperation, request, options),
10
+ };
11
+ }
12
+ const CreateOperation = {
13
+ method: "POST",
14
+ route: "/commerce/remittance-lines/{remittanceLineId}/claims",
15
+ body: "flat",
16
+ response: null,
17
+ errors: { "400": true, "401": true, "403": true },
18
+ };
@@ -0,0 +1,5 @@
1
+ export { ApiError } from "../_/index.js";
2
+ export type { RequestOptions } from "../_/index.js";
3
+ export { createClient } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, } from "./client.js";
5
+ export type { RemittanceLineClaimBody } from "./models.js";
@@ -0,0 +1,4 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export { ApiError } from "../_/index.js";
4
+ export { createClient } from "./client.js";
@@ -0,0 +1,5 @@
1
+ export interface RemittanceLineClaimBody {
2
+ amountMinor?: number;
3
+ commissionItemId: string;
4
+ note?: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,27 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { RemittanceSuggestionsGetResponse } from "./models.js";
3
+ export interface ClientOptions extends BaseClientOptions {
4
+ /**
5
+ * The URL the paths of the API are relative to.
6
+ */
7
+ baseUrl: string;
8
+ }
9
+ export interface Client {
10
+ /**
11
+ * Suggest matches for a line
12
+ *
13
+ * The commission items a line most likely pays, scored now by the matching
14
+ * engine (07-business-rules.md §6): five by default, at most ten, each with
15
+ * its score, the points every feature added and the amount the line would
16
+ * give it. Agency admins and finance staff of the company that received the
17
+ * money.
18
+ */
19
+ listSuggestions(request: ListSuggestionsRequest, options?: RequestOptions): Promise<ListSuggestionsResponse>;
20
+ }
21
+ export declare function createClient(options: ClientOptions): Client;
22
+ export declare function bind(transport: Transport): Client;
23
+ export interface ListSuggestionsRequest {
24
+ remittanceLineId: string;
25
+ limit?: number;
26
+ }
27
+ export type ListSuggestionsResponse = RemittanceSuggestionsGetResponse;
@@ -0,0 +1,18 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, } from "../_/index.js";
4
+ export function createClient(options) {
5
+ return bind(new Transport(options));
6
+ }
7
+ export function bind(transport) {
8
+ return {
9
+ listSuggestions: (request, options) => transport.send(ListSuggestionsOperation, request, options),
10
+ };
11
+ }
12
+ const ListSuggestionsOperation = {
13
+ method: "GET",
14
+ route: "/commerce/remittance-lines/{remittanceLineId}/suggestions",
15
+ query: { limit: "limit" },
16
+ response: null,
17
+ errors: { "400": true, "401": true, "403": true },
18
+ };
@@ -0,0 +1,5 @@
1
+ export { ApiError } from "../_/index.js";
2
+ export type { RequestOptions } from "../_/index.js";
3
+ export { createClient } from "./client.js";
4
+ export type { Client, ClientOptions, ListSuggestionsRequest, ListSuggestionsResponse, } from "./client.js";
5
+ export type { RemittanceSuggestionsGetResponse } from "./models.js";
@@ -0,0 +1,4 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export { ApiError } from "../_/index.js";
4
+ export { createClient } from "./client.js";
@@ -0,0 +1,5 @@
1
+ import type { MatchProposal, RemittanceLine } from "../models.js";
2
+ export interface RemittanceSuggestionsGetResponse {
3
+ line: RemittanceLine;
4
+ suggestions: MatchProposal[];
5
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,78 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { RemittanceAction, RemittanceCreateBody, RemittanceDetail, RemittancesListResponse } from "./models.js";
3
+ export interface ClientOptions extends BaseClientOptions {
4
+ /**
5
+ * The URL the paths of the API are relative to.
6
+ */
7
+ baseUrl: string;
8
+ }
9
+ export interface Client {
10
+ /**
11
+ * Record a payment
12
+ *
13
+ * Records a payment by hand: one remittance, posted, with up to 100 lines and
14
+ * where each line's money goes. One atomic write posts the deposit and its
15
+ * fee journal, the allocations, the earnings their split plan gives each
16
+ * party, the audit rows and the events; a line left unallocated stays
17
+ * claimable. Agency admins for the money they received, and finance staff.
18
+ */
19
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
20
+ /**
21
+ * Get a remittance
22
+ *
23
+ * One remittance with a page of its lines (100 by default, at most 500, in
24
+ * line order), each line's allocations and their frozen split, the claims on
25
+ * it, notes, tags and the actions the caller may run. Another company's
26
+ * remittance answers 404.
27
+ */
28
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
29
+ /**
30
+ * List remittances
31
+ *
32
+ * The money the company received, newest first (25 by default, at most 100,
33
+ * keyset-paged by received date): posted, duplicate and void remittances and
34
+ * the drafts of batches under review, with allocated and unallocated totals
35
+ * computed on read. Agency admins and finance staff; staff reads of another
36
+ * company are audited.
37
+ */
38
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
39
+ /**
40
+ * Run an action on a remittance
41
+ *
42
+ * Runs one action on posted money: ALLOCATE a line's unallocated money to
43
+ * commission items, REVERSE_ALLOCATION (all or part; the earnings and
44
+ * journals reverse with it), MARK_DUPLICATE or VOID (every allocation is
45
+ * reversed and the deposit's journal mirrored), UNMARK_DUPLICATE, or
46
+ * APPROVE_CLAIM / REJECT_CLAIM a member's claim. Allocating answers 409
47
+ * COMMISSION_ALLOCATION_EXCEEDS_LINE past the line and 409
48
+ * COMMISSION_ALLOCATION_WRONG_RECEIVER for money owed to another company.
49
+ * Reversing, voiding and duplicates are finance staff only.
50
+ */
51
+ runAction(request: RunActionRequest, options?: RequestOptions): Promise<RunActionResponse>;
52
+ }
53
+ export declare function createClient(options: ClientOptions): Client;
54
+ export declare function bind(transport: Transport): Client;
55
+ export type CreateRequest = RemittanceCreateBody;
56
+ export type CreateResponse = RemittanceDetail;
57
+ export interface GetRequest {
58
+ remittanceId: string;
59
+ cursor?: string;
60
+ limit?: number;
61
+ }
62
+ export type GetResponse = RemittanceDetail;
63
+ export interface ListRequest {
64
+ batchId?: string;
65
+ channel?: string;
66
+ cursor?: string;
67
+ from?: string;
68
+ limit?: number;
69
+ q?: string;
70
+ state?: string;
71
+ to?: string;
72
+ unallocated?: "true" | "false";
73
+ }
74
+ export type ListResponse = RemittancesListResponse;
75
+ export type RunActionRequest = {
76
+ remittanceId: string;
77
+ } & RemittanceAction;
78
+ export type RunActionResponse = RemittanceDetail;
@@ -0,0 +1,42 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, } from "../_/index.js";
4
+ export function createClient(options) {
5
+ return bind(new Transport(options));
6
+ }
7
+ export function bind(transport) {
8
+ return {
9
+ create: (request, options) => transport.send(CreateOperation, request, options),
10
+ get: (request, options) => transport.send(GetOperation, request, options),
11
+ list: (request, options) => transport.send(ListOperation, request, options),
12
+ runAction: (request, options) => transport.send(RunActionOperation, request, options),
13
+ };
14
+ }
15
+ const CreateOperation = {
16
+ method: "POST",
17
+ route: "/commerce/remittances",
18
+ body: "flat",
19
+ response: null,
20
+ errors: { "400": true, "401": true, "403": true },
21
+ };
22
+ const GetOperation = {
23
+ method: "GET",
24
+ route: "/commerce/remittances/{remittanceId}",
25
+ query: { cursor: "cursor", limit: "limit" },
26
+ response: null,
27
+ errors: { "400": true, "401": true, "403": true },
28
+ };
29
+ const ListOperation = {
30
+ method: "GET",
31
+ route: "/commerce/remittances",
32
+ query: { batchId: "batchId", channel: "channel", cursor: "cursor", from: "from", limit: "limit", q: "q", state: "state", to: "to", unallocated: "unallocated" },
33
+ response: null,
34
+ errors: { "400": true, "401": true, "403": true },
35
+ };
36
+ const RunActionOperation = {
37
+ method: "POST",
38
+ route: "/commerce/remittances/{remittanceId}/actions",
39
+ body: "flat",
40
+ response: null,
41
+ errors: { "400": true, "401": true, "403": true },
42
+ };
@@ -0,0 +1,5 @@
1
+ export { ApiError } from "../_/index.js";
2
+ export type { RequestOptions } from "../_/index.js";
3
+ export { createClient } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, GetRequest, GetResponse, ListRequest, ListResponse, RunActionRequest, RunActionResponse, } from "./client.js";
5
+ export type { RemittanceAction, RemittanceCreateBody, RemittanceDetail, RemittancePayerKind, RemittanceState, RemittanceSummary, RemittancesListResponse, } from "./models.js";
@@ -0,0 +1,4 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export { ApiError } from "../_/index.js";
4
+ export { createClient } from "./client.js";
@@ -0,0 +1,116 @@
1
+ import type { AllocationRequest, CommissionChannel, CommissionNote, CommissionTag, CurrencyCode, RemittanceClaim, RemittanceLine } from "../models.js";
2
+ export type RemittanceAction = {
3
+ allocations: AllocationRequest[];
4
+ note?: string;
5
+ remittanceLineId: string;
6
+ type: "ALLOCATE";
7
+ } | {
8
+ allocationId: string;
9
+ amountMinor?: number;
10
+ reason: string;
11
+ type: "REVERSE_ALLOCATION";
12
+ } | {
13
+ duplicateOfRemittanceId: string;
14
+ reason: string;
15
+ type: "MARK_DUPLICATE";
16
+ } | {
17
+ reason: string;
18
+ type: "UNMARK_DUPLICATE";
19
+ } | {
20
+ reason: string;
21
+ type: "VOID";
22
+ } | {
23
+ claimId: string;
24
+ note?: string;
25
+ type: "APPROVE_CLAIM";
26
+ } | {
27
+ claimId: string;
28
+ reason: string;
29
+ type: "REJECT_CLAIM";
30
+ };
31
+ export interface RemittanceCreateBody {
32
+ channel: CommissionChannel;
33
+ currency: CurrencyCode;
34
+ feeMinor?: number;
35
+ lines: {
36
+ allocations?: AllocationRequest[];
37
+ amountMinor: number;
38
+ checkIn?: string;
39
+ checkOut?: string;
40
+ clientName?: string;
41
+ confirmationNumber?: string;
42
+ grossMinor?: number;
43
+ identifierNumber?: string;
44
+ rateBps?: number;
45
+ supplierName?: string;
46
+ }[];
47
+ note?: string;
48
+ payableOn?: string;
49
+ payerKind: RemittancePayerKind;
50
+ payerName?: string;
51
+ receivedOn: string;
52
+ reference?: string;
53
+ supplierId?: string;
54
+ tags?: CommissionTag[];
55
+ }
56
+ export interface RemittanceDetail {
57
+ allocatedMinor: number;
58
+ allowedActions: ("ALLOCATE" | "REVERSE_ALLOCATION" | "MARK_DUPLICATE" | "UNMARK_DUPLICATE" | "VOID" | "APPROVE_CLAIM" | "REJECT_CLAIM")[];
59
+ batchId: string | null;
60
+ channel: CommissionChannel;
61
+ claims: RemittanceClaim[];
62
+ companyName: string;
63
+ createdAt: string;
64
+ createdByUserId: string | null;
65
+ currency: CurrencyCode;
66
+ duplicateOfRemittanceId: string | null;
67
+ feeMinor: number;
68
+ grossMinor: number;
69
+ lineCount: number;
70
+ lines: RemittanceLine[];
71
+ nextLineCursor: string | null;
72
+ notes: CommissionNote[];
73
+ number: string;
74
+ payableOn: string;
75
+ payerKind: RemittancePayerKind;
76
+ payerName: string | null;
77
+ postedAt: string | null;
78
+ receivedOn: string;
79
+ reference: string | null;
80
+ remittanceId: string;
81
+ source: "MANUAL" | "FILE_IMPORT";
82
+ state: RemittanceState;
83
+ supplierId: string | null;
84
+ tags: CommissionTag[];
85
+ unallocatedMinor: number;
86
+ voidReason: string | null;
87
+ }
88
+ export type RemittancePayerKind = "SUPPLIER" | "HOST" | "CLIENT" | "OTHER";
89
+ export type RemittanceState = "DRAFT" | "POSTED" | "DUPLICATE" | "VOID";
90
+ export interface RemittanceSummary {
91
+ allocatedMinor: number;
92
+ batchId: string | null;
93
+ channel: CommissionChannel;
94
+ companyName: string;
95
+ createdAt: string;
96
+ currency: CurrencyCode;
97
+ feeMinor: number;
98
+ grossMinor: number;
99
+ lineCount: number;
100
+ number: string;
101
+ payableOn: string;
102
+ payerKind: RemittancePayerKind;
103
+ payerName: string | null;
104
+ postedAt: string | null;
105
+ receivedOn: string;
106
+ reference: string | null;
107
+ remittanceId: string;
108
+ source: "MANUAL" | "FILE_IMPORT";
109
+ state: RemittanceState;
110
+ supplierId: string | null;
111
+ unallocatedMinor: number;
112
+ }
113
+ export interface RemittancesListResponse {
114
+ items: RemittanceSummary[];
115
+ nextCursor: string | null;
116
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};