@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,16 @@
1
+ import type { Money } from "../models.js";
2
+ export interface EarningsListResponse {
3
+ items: {
4
+ amount: Money;
5
+ beneficiaryId: string;
6
+ beneficiaryKind: "ADVISOR" | "COMPANY" | "TRAVELER";
7
+ commissionItemId: string | null;
8
+ earningId: string;
9
+ earningKind: "ADJUSTMENT" | "ADVISOR_COMMISSION" | "AGENCY_COMMISSION" | "HOST_SHARE" | "PLANNING_FEE" | "REFERRAL_COMMISSION" | "TRAVELER_REWARD";
10
+ entryType: "EARNING" | "REVERSAL" | "CLAWBACK";
11
+ orderId: string | null;
12
+ status: "PENDING" | "AVAILABLE" | "REVERSED";
13
+ updatedAt: string;
14
+ }[];
15
+ nextCursor: string | null;
16
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,56 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { ExternalBooking, ExternalBookingCreateBody, ExternalBookingUpdateBody } 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 booking made elsewhere
12
+ *
13
+ * Records a booking made outside Nicer (with a cruise line, a DMC, another
14
+ * platform) and the commission items it earns, in one transaction with their
15
+ * audit rows. The supplier is one from the directory or a name; the
16
+ * identifier defaults to the agency's (a host's for a hosted agency); payment
17
+ * terms resolve from the item, the agency's terms with the supplier, the
18
+ * supplier, the category, then the agency default. The same supplier and
19
+ * confirmation as a booking already tracked answers 409
20
+ * COMMISSION_DUPLICATE_BOOKING. An advisor books for themselves; admins and
21
+ * staff may name another advisor.
22
+ */
23
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
24
+ /**
25
+ * Get a booking made elsewhere
26
+ *
27
+ * A booking made elsewhere with its commission items: what the edit form
28
+ * loads. An advisor reads their own bookings; another company's booking
29
+ * answers 404.
30
+ */
31
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
32
+ /**
33
+ * Edit a booking made elsewhere
34
+ *
35
+ * Edits the facts of a booking made elsewhere (supplier, confirmation,
36
+ * client, dates, quantity, identifier, advisor, trip) with the
37
+ * `bookingVersion` read and a reason. Every item of the booking follows in
38
+ * the same transaction, writing a revision; due dates move with the travel
39
+ * end unless they were set by hand. Money changes go through the item
40
+ * actions. A newer edit answers 409 COMMISSION_RECORD_CHANGED; a new
41
+ * identifier once money arrived 409 COMMISSION_IDENTIFIER_LOCKED.
42
+ */
43
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
44
+ }
45
+ export declare function createClient(options: ClientOptions): Client;
46
+ export declare function bind(transport: Transport): Client;
47
+ export type CreateRequest = ExternalBookingCreateBody;
48
+ export type CreateResponse = ExternalBooking;
49
+ export interface GetRequest {
50
+ externalBookingId: string;
51
+ }
52
+ export type GetResponse = ExternalBooking;
53
+ export type UpdateRequest = {
54
+ externalBookingId: string;
55
+ } & ExternalBookingUpdateBody;
56
+ export type UpdateResponse = ExternalBooking;
@@ -0,0 +1,33 @@
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
+ update: (request, options) => transport.send(UpdateOperation, request, options),
12
+ };
13
+ }
14
+ const CreateOperation = {
15
+ method: "POST",
16
+ route: "/commerce/external-bookings",
17
+ body: "flat",
18
+ response: null,
19
+ errors: { "400": true, "401": true, "403": true },
20
+ };
21
+ const GetOperation = {
22
+ method: "GET",
23
+ route: "/commerce/external-bookings/{externalBookingId}",
24
+ response: null,
25
+ errors: { "400": true, "401": true, "403": true },
26
+ };
27
+ const UpdateOperation = {
28
+ method: "PUT",
29
+ route: "/commerce/external-bookings/{externalBookingId}",
30
+ body: "flat",
31
+ response: null,
32
+ errors: { "400": true, "401": true, "403": true },
33
+ };
@@ -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, UpdateRequest, UpdateResponse, } from "./client.js";
5
+ export type { ExternalBooking, ExternalBookingCreateBody, ExternalBookingUpdateBody, } 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,93 @@
1
+ import type { CommissionCategory, CommissionIdentifierRef, CommissionItemSummary, CommissionTag, CurrencyCode } from "../models.js";
2
+ export interface ExternalBooking {
3
+ advisorUserId: string | null;
4
+ bookedOn: string;
5
+ bookingVersion: number;
6
+ category: CommissionCategory;
7
+ clientName: string;
8
+ clientUserId: string | null;
9
+ companyName: string;
10
+ confirmationNumber: string | null;
11
+ createdAt: string;
12
+ createdByUserId: string | null;
13
+ currency: CurrencyCode;
14
+ externalBookingId: string;
15
+ externalReference: string | null;
16
+ grossMinor: number;
17
+ identifier: CommissionIdentifierRef | null;
18
+ importId: string | null;
19
+ items: CommissionItemSummary[];
20
+ providerLocator: string | null;
21
+ quantity: number;
22
+ receivingCompanyName: string;
23
+ source: "MANUAL" | "FILE_IMPORT";
24
+ supplier: {
25
+ name: string | null;
26
+ supplierId: string | null;
27
+ verified: boolean;
28
+ };
29
+ travelEnd: string;
30
+ travelStart: string;
31
+ travelersTripId: string | null;
32
+ updatedAt: string;
33
+ }
34
+ export interface ExternalBookingCreateBody {
35
+ advisorUserId?: string | null;
36
+ bookedOn?: string;
37
+ category: CommissionCategory;
38
+ clientName: string;
39
+ clientUserId?: string | null;
40
+ confirmationNumber: string | null;
41
+ currency: CurrencyCode;
42
+ grossMinor: number;
43
+ identifierId?: string | null;
44
+ items: ({
45
+ commissionableMinor?: number;
46
+ dueOn?: string;
47
+ expectedMinor?: number;
48
+ isCommissionable?: boolean;
49
+ kind: "SUPPLIER_COMMISSION";
50
+ multiplyByQuantity?: boolean;
51
+ paymentTermDays?: number;
52
+ rateBps?: number;
53
+ } | {
54
+ dueOn?: string;
55
+ expectedMinor?: number;
56
+ kind: "CLIENT_NET_MARKUP";
57
+ markupBps?: number;
58
+ paymentTermDays?: number;
59
+ supplierCostMinor: number;
60
+ } | {
61
+ dueOn?: string;
62
+ expectedMinor: number;
63
+ kind: "CLIENT_FEE";
64
+ paymentTermDays?: number;
65
+ })[];
66
+ note?: string;
67
+ providerLocator?: string | null;
68
+ quantity?: number;
69
+ supplierId?: string | null;
70
+ supplierName?: string | null;
71
+ tags?: CommissionTag[];
72
+ travelEnd: string;
73
+ travelStart: string;
74
+ travelersTripId?: string | null;
75
+ }
76
+ export interface ExternalBookingUpdateBody {
77
+ advisorUserId?: string | null;
78
+ bookedOn?: string;
79
+ bookingVersion: number;
80
+ category: CommissionCategory;
81
+ clientName: string;
82
+ clientUserId?: string | null;
83
+ confirmationNumber: string | null;
84
+ identifierId?: string | null;
85
+ providerLocator?: string | null;
86
+ quantity?: number;
87
+ reason: string;
88
+ supplierId?: string | null;
89
+ supplierName?: string | null;
90
+ travelEnd: string;
91
+ travelStart: string;
92
+ travelersTripId?: string | null;
93
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,23 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { ExternalPaymentRecordBody, ExternalPaymentRecordResponse } 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 or reverse an outside payment
12
+ *
13
+ * Books a payment that happened outside the platform, by bank transfer, cash,
14
+ * cheque or card, against an order or an itinerary item, with a receipt asset
15
+ * and its checksum; or reverses a previously recorded one with a reason.
16
+ * Requires an authenticated company user and an `Idempotency-Key`.
17
+ */
18
+ runAction(request: RunActionRequest, options?: RequestOptions): Promise<RunActionResponse>;
19
+ }
20
+ export declare function createClient(options: ClientOptions): Client;
21
+ export declare function bind(transport: Transport): Client;
22
+ export type RunActionRequest = ExternalPaymentRecordBody;
23
+ export type RunActionResponse = ExternalPaymentRecordResponse;
@@ -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
+ runAction: (request, options) => transport.send(RunActionOperation, request, options),
10
+ };
11
+ }
12
+ const RunActionOperation = {
13
+ method: "POST",
14
+ route: "/commerce/external-payments",
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, RunActionRequest, RunActionResponse, } from "./client.js";
5
+ export type { ExternalPaymentRecordBody, ExternalPaymentRecordResponse, } 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,47 @@
1
+ import type { CurrencyCode } from "../models.js";
2
+ export type ExternalPaymentRecordBody = {
3
+ amount: {
4
+ amountMinor: number;
5
+ currency: CurrencyCode;
6
+ };
7
+ paidAt: string;
8
+ payee: string;
9
+ paymentMethod: "BANK_TRANSFER" | "CARD" | "CASH" | "CHECK" | "OTHER";
10
+ providerReference: string;
11
+ purpose: "DEPOSIT" | "FULL_PAYMENT" | "GUARANTEE" | "OTHER";
12
+ receipt: {
13
+ assetKey: string;
14
+ checksumSha256: string;
15
+ };
16
+ target: {
17
+ kind: "ORDER";
18
+ orderId: string;
19
+ } | {
20
+ itineraryItemId: string;
21
+ kind: "ITINERARY_ITEM";
22
+ travelersTripId: string;
23
+ };
24
+ type: "RECORD";
25
+ } | {
26
+ externalPaymentId: string;
27
+ reason: string;
28
+ type: "REVERSE";
29
+ };
30
+ export type ExternalPaymentRecordResponse = {
31
+ amount: {
32
+ amountMinor: number;
33
+ currency: CurrencyCode;
34
+ };
35
+ externalPaymentId: string;
36
+ itineraryItemId: string | null;
37
+ orderId: string | null;
38
+ paidAt: string;
39
+ recordedAt: string;
40
+ status: "RECORDED";
41
+ travelersTripId: string | null;
42
+ } | {
43
+ externalPaymentId: string;
44
+ reversalEntryId: string;
45
+ reversedAt: string;
46
+ status: "REVERSED";
47
+ };
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,87 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { DeleteFavoriteResponse, Favorite, FavoriteKind, GetFavoritesShareResponse, GetSharedFavoritesResponse, ListFavoritesResponse, SaveFavoriteBody, ShareFavoritesBody, ShareFavoritesResponse, StopSharingFavoritesResponse } 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
+ * Save a place
12
+ *
13
+ * Saves a place for the caller, or refreshes its snapshot when it is already
14
+ * saved — saving twice never creates a second entry.
15
+ */
16
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
17
+ /**
18
+ * Remove a saved place
19
+ *
20
+ * Removes a saved place from the caller's list. Removing a place that is not
21
+ * saved succeeds too, so a double tap never errors.
22
+ */
23
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
24
+ /**
25
+ * Get the caller's shared list link
26
+ *
27
+ * Returns the link id of the caller's shared list and the photo it greets
28
+ * with, or nulls when they are not sharing it.
29
+ */
30
+ getShare(request?: GetShareRequest, options?: RequestOptions): Promise<GetShareResponse>;
31
+ /**
32
+ * Get a shared saved list
33
+ *
34
+ * Returns a shared saved list, newest first, with its owner's first name and
35
+ * photo. Reachable without a token: the link id is the only credential, and
36
+ * it stops working the moment its owner stops sharing.
37
+ */
38
+ getShared(request: GetSharedRequest, options?: RequestOptions): Promise<GetSharedResponse>;
39
+ /**
40
+ * List the caller's saved places
41
+ *
42
+ * Returns the places the caller saved, newest first, optionally narrowed to
43
+ * one kind. Always the caller's own list — there is no way to read another
44
+ * user's.
45
+ */
46
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
47
+ /**
48
+ * Share the caller's saved list
49
+ *
50
+ * Shares the caller's saved list through a link and returns its id. One link
51
+ * per person: sharing again returns the same link, with the greeting name and
52
+ * photo refreshed. Anyone with the link can read the list.
53
+ */
54
+ share(request?: ShareRequest, options?: RequestOptions): Promise<ShareResponse>;
55
+ /**
56
+ * Stop sharing the caller's saved list
57
+ *
58
+ * Stops sharing the caller's saved list: the link stops working at once, and
59
+ * sharing again creates a new one. Idempotent.
60
+ */
61
+ stopSharing(request?: StopSharingRequest, options?: RequestOptions): Promise<StopSharingResponse>;
62
+ }
63
+ export declare function createClient(options: ClientOptions): Client;
64
+ export declare function bind(transport: Transport): Client;
65
+ export type CreateRequest = SaveFavoriteBody;
66
+ export type CreateResponse = Favorite;
67
+ export interface DeleteRequest {
68
+ kind: FavoriteKind;
69
+ reference: string;
70
+ }
71
+ export type DeleteResponse = DeleteFavoriteResponse;
72
+ export interface GetShareRequest {
73
+ }
74
+ export type GetShareResponse = GetFavoritesShareResponse;
75
+ export interface GetSharedRequest {
76
+ shareId: string;
77
+ }
78
+ export type GetSharedResponse = GetSharedFavoritesResponse;
79
+ export interface ListRequest {
80
+ kind?: FavoriteKind;
81
+ }
82
+ export type ListResponse = ListFavoritesResponse;
83
+ export type ShareRequest = ShareFavoritesBody;
84
+ export type ShareResponse = ShareFavoritesResponse;
85
+ export interface StopSharingRequest {
86
+ }
87
+ export type StopSharingResponse = StopSharingFavoritesResponse;
@@ -0,0 +1,63 @@
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
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
11
+ getShare: (request, options) => transport.send(GetShareOperation, request, options),
12
+ getShared: (request, options) => transport.send(GetSharedOperation, request, options),
13
+ list: (request, options) => transport.send(ListOperation, request, options),
14
+ share: (request, options) => transport.send(ShareOperation, request, options),
15
+ stopSharing: (request, options) => transport.send(StopSharingOperation, request, options),
16
+ };
17
+ }
18
+ const CreateOperation = {
19
+ method: "PUT",
20
+ route: "/favorites",
21
+ body: "flat",
22
+ response: null,
23
+ errors: { "400": true, "401": true, "403": true },
24
+ };
25
+ const DeleteOperation = {
26
+ method: "DELETE",
27
+ route: "/favorites",
28
+ query: { kind: "kind", reference: "reference" },
29
+ response: null,
30
+ errors: { "400": true, "401": true, "403": true },
31
+ };
32
+ const GetShareOperation = {
33
+ method: "GET",
34
+ route: "/favorites/share",
35
+ response: null,
36
+ errors: { "400": true, "401": true, "403": true },
37
+ };
38
+ const GetSharedOperation = {
39
+ method: "GET",
40
+ route: "/favorites/shared/{shareId}",
41
+ response: null,
42
+ errors: { "400": true },
43
+ };
44
+ const ListOperation = {
45
+ method: "GET",
46
+ route: "/favorites",
47
+ query: { kind: "kind" },
48
+ response: null,
49
+ errors: { "400": true, "401": true, "403": true },
50
+ };
51
+ const ShareOperation = {
52
+ method: "PUT",
53
+ route: "/favorites/share",
54
+ body: "flat",
55
+ response: null,
56
+ errors: { "400": true, "401": true, "403": true },
57
+ };
58
+ const StopSharingOperation = {
59
+ method: "DELETE",
60
+ route: "/favorites/share",
61
+ response: null,
62
+ errors: { "400": true, "401": true, "403": true },
63
+ };
@@ -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, DeleteRequest, DeleteResponse, GetShareRequest, GetShareResponse, GetSharedRequest, GetSharedResponse, ListRequest, ListResponse, ShareRequest, ShareResponse, StopSharingRequest, StopSharingResponse, } from "./client.js";
5
+ export type { DeleteFavoriteResponse, Favorite, FavoriteActivity, FavoriteKind, GetFavoritesShareResponse, GetSharedFavoritesResponse, ListFavoritesResponse, SaveFavoriteBody, ShareFavoritesBody, ShareFavoritesResponse, StopSharingFavoritesResponse, } 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,79 @@
1
+ export interface DeleteFavoriteResponse {
2
+ kind: FavoriteKind;
3
+ reference: string;
4
+ saved: false;
5
+ }
6
+ export interface Favorite {
7
+ activity?: FavoriteActivity | null;
8
+ city?: string | null;
9
+ country?: string | null;
10
+ createdAt: string;
11
+ favoriteId: string;
12
+ imageUrl?: string | null;
13
+ kind: FavoriteKind;
14
+ latitude?: number | null;
15
+ longitude?: number | null;
16
+ name: string;
17
+ rateCodes?: string[] | null;
18
+ reference: string;
19
+ starRating?: number | null;
20
+ type: "Favorite";
21
+ updatedAt: string;
22
+ userId: string;
23
+ }
24
+ export interface FavoriteActivity {
25
+ destinationId: string;
26
+ destinationName: string | null;
27
+ durationMinutes: number | null;
28
+ reviewCount: number | null;
29
+ }
30
+ export type FavoriteKind = "HOTEL" | "ACTIVITY";
31
+ export interface GetFavoritesShareResponse {
32
+ avatarUrl: string | null;
33
+ shareId: string | null;
34
+ }
35
+ export interface GetSharedFavoritesResponse {
36
+ items: {
37
+ activity?: FavoriteActivity | null;
38
+ city?: string | null;
39
+ country?: string | null;
40
+ createdAt?: string;
41
+ imageUrl?: string | null;
42
+ kind: FavoriteKind;
43
+ latitude?: number | null;
44
+ longitude?: number | null;
45
+ name: string;
46
+ rateCodes?: string[] | null;
47
+ reference: string;
48
+ starRating?: number | null;
49
+ }[];
50
+ owner: {
51
+ avatarUrl: string | null;
52
+ firstName: string | null;
53
+ };
54
+ }
55
+ export interface ListFavoritesResponse {
56
+ items: Favorite[];
57
+ }
58
+ export interface SaveFavoriteBody {
59
+ activity?: FavoriteActivity | null;
60
+ city?: string | null;
61
+ country?: string | null;
62
+ imageUrl?: string | null;
63
+ kind: FavoriteKind;
64
+ latitude?: number | null;
65
+ longitude?: number | null;
66
+ name: string;
67
+ rateCodes?: string[] | null;
68
+ reference: string;
69
+ starRating?: number | null;
70
+ }
71
+ export interface ShareFavoritesBody {
72
+ avatarUrl?: string | null;
73
+ }
74
+ export interface ShareFavoritesResponse {
75
+ shareId: string;
76
+ }
77
+ export interface StopSharingFavoritesResponse {
78
+ shareId: null;
79
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { FlightLookupResponse } 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
+ * Look up a flight by number
12
+ *
13
+ * Resolves a flight number and a date to its scheduled legs, with airports
14
+ * from the travel reference, so a flight can be added to an itinerary without
15
+ * running a full search. Anonymous calls share one budget across the search
16
+ * routes, 600 per hour per IP; a valid bearer token lifts it.
17
+ */
18
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
19
+ }
20
+ export declare function createClient(options: ClientOptions): Client;
21
+ export declare function bind(transport: Transport): Client;
22
+ export interface GetRequest {
23
+ flightNumber: string;
24
+ /**
25
+ * Departure date, YYYY-MM-DD.
26
+ */
27
+ date: string;
28
+ }
29
+ export type GetResponse = FlightLookupResponse;
@@ -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
+ get: (request, options) => transport.send(GetOperation, request, options),
10
+ };
11
+ }
12
+ const GetOperation = {
13
+ method: "GET",
14
+ route: "/search/flights/{flightNumber}",
15
+ query: { date: "date" },
16
+ response: null,
17
+ errors: { "400": true, "401": true, "403": true, "429": 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, GetRequest, GetResponse, } from "./client.js";
5
+ export type { FlightLookupAirport, FlightLookupLeg, FlightLookupResponse, } 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,25 @@
1
+ export interface FlightLookupAirport {
2
+ city?: string;
3
+ country?: string;
4
+ countryCode?: string;
5
+ gate?: string;
6
+ iataCode: string;
7
+ latitude?: number;
8
+ longitude?: number;
9
+ name?: string;
10
+ terminal?: string;
11
+ timeZone?: string;
12
+ }
13
+ export interface FlightLookupLeg {
14
+ aircraft?: string;
15
+ arrivingAt: string | null;
16
+ departingAt: string;
17
+ destination: FlightLookupAirport;
18
+ operatingCarrier: {
19
+ iataCode: string;
20
+ name: string | null;
21
+ };
22
+ operatingCarrierFlightNumber: string;
23
+ origin: FlightLookupAirport;
24
+ }
25
+ export type FlightLookupResponse = FlightLookupLeg[];