@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,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,48 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { PayeeActionRunBody, PayeeActionRunResponse, PayeesListResponse } 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
+ * List payees
12
+ *
13
+ * The company's payees with their statement cycle, payout method, legal name,
14
+ * tax form, Stripe Connect status, next cycle date and the earnings no
15
+ * statement holds yet (keyset-paged by payee, at most 100). An advisor sees
16
+ * only themselves, with the defaults before anything is configured; agency
17
+ * admins and finance staff see every configured payee.
18
+ */
19
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
20
+ /**
21
+ * Run a payee action
22
+ *
23
+ * One action on a payee of the company (an advisor's user id, or the agency's
24
+ * company name). SAVE_SETTINGS (statement cycle — one to four days of the
25
+ * month, 31 for its last day —, statements on or off and from which date,
26
+ * minimum payout, payout method, legal name, tax form status) against the
27
+ * version read, agency admins and finance staff. START_STRIPE_ONBOARDING
28
+ * creates the payee's Stripe Connect Express account when it has none and
29
+ * answers a hosted onboarding link; REFRESH_STRIPE_ACCOUNT reads back whether
30
+ * Stripe lets it receive transfers. The payee runs these two for themselves;
31
+ * admins and staff for anyone. Returns the payee.
32
+ */
33
+ runAction(request: RunActionRequest, options?: RequestOptions): Promise<RunActionResponse>;
34
+ }
35
+ export declare function createClient(options: ClientOptions): Client;
36
+ export declare function bind(transport: Transport): Client;
37
+ export interface ListRequest {
38
+ cursor?: string;
39
+ limit?: number;
40
+ payeeId?: string;
41
+ payeeKind?: "ADVISOR" | "COMPANY";
42
+ statementsEnabled?: "true" | "false";
43
+ }
44
+ export type ListResponse = PayeesListResponse;
45
+ export type RunActionRequest = {
46
+ payeeId: string;
47
+ } & PayeeActionRunBody;
48
+ export type RunActionResponse = PayeeActionRunResponse;
@@ -0,0 +1,26 @@
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
+ list: (request, options) => transport.send(ListOperation, request, options),
10
+ runAction: (request, options) => transport.send(RunActionOperation, request, options),
11
+ };
12
+ }
13
+ const ListOperation = {
14
+ method: "GET",
15
+ route: "/commerce/payees",
16
+ query: { cursor: "cursor", limit: "limit", payeeId: "payeeId", payeeKind: "payeeKind", statementsEnabled: "statementsEnabled" },
17
+ response: null,
18
+ errors: { "400": true, "401": true, "403": true },
19
+ };
20
+ const RunActionOperation = {
21
+ method: "POST",
22
+ route: "/commerce/payees/{payeeId}/actions",
23
+ body: "flat",
24
+ response: null,
25
+ errors: { "400": true, "401": true, "403": true },
26
+ };
@@ -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, ListRequest, ListResponse, RunActionRequest, RunActionResponse, } from "./client.js";
5
+ export type { CurrencyTotal, PayeeActionRunBody, PayeeActionRunResponse, PayeeSettings, PayeesListResponse, } 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,50 @@
1
+ import type { CurrencyCode, PayoutMethod } from "../models.js";
2
+ export interface CurrencyTotal {
3
+ amountMinor: number;
4
+ currency: CurrencyCode;
5
+ }
6
+ export type PayeeActionRunBody = {
7
+ cycleDays: number[];
8
+ expectedVersion: number;
9
+ legalName?: string | null;
10
+ minimumPayoutMinor: number;
11
+ payeeKind: "ADVISOR" | "COMPANY";
12
+ payoutMethod?: PayoutMethod | null;
13
+ statementsEnabled: boolean;
14
+ statementsStartOn?: string | null;
15
+ taxFormStatus: "MISSING" | "W9_ON_FILE" | "W8_ON_FILE";
16
+ type: "SAVE_SETTINGS";
17
+ } | {
18
+ payeeKind: "ADVISOR" | "COMPANY";
19
+ type: "START_STRIPE_ONBOARDING";
20
+ } | {
21
+ payeeKind: "ADVISOR" | "COMPANY";
22
+ type: "REFRESH_STRIPE_ACCOUNT";
23
+ };
24
+ export interface PayeeActionRunResponse {
25
+ onboardingUrl: string | null;
26
+ payee: PayeeSettings;
27
+ }
28
+ export interface PayeeSettings {
29
+ companyName: string;
30
+ cycleDays: number[];
31
+ legalName: string | null;
32
+ minimumPayoutMinor: number;
33
+ nextCycleOn: string | null;
34
+ payeeId: string;
35
+ payeeKind: "ADVISOR" | "COMPANY";
36
+ payoutMethod: PayoutMethod | null;
37
+ payoutReady: boolean;
38
+ statementsEnabled: boolean;
39
+ statementsStartOn: string | null;
40
+ stripeAccountId: string | null;
41
+ stripeTransfersEnabled: boolean;
42
+ taxFormStatus: "MISSING" | "W9_ON_FILE" | "W8_ON_FILE";
43
+ unassigned: CurrencyTotal[];
44
+ updatedAt: string | null;
45
+ version: number;
46
+ }
47
+ export interface PayeesListResponse {
48
+ items: PayeeSettings[];
49
+ nextCursor: string | null;
50
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { PaymentMethodActionRunBody, PaymentMethodCardLinkCompleteResponse } 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
+ * List or set up payment methods
12
+ *
13
+ * Runs a payment-method action: listing the stored methods the caller may
14
+ * use, starting a card setup, creating the link a client opens to authorize a
15
+ * card to the advisor who makes it, or revoking a saved card or an
16
+ * authorization. Requires an `Idempotency-Key`. Requires a verified user
17
+ * session.
18
+ */
19
+ runAction(request: RunActionRequest, options?: RequestOptions): Promise<RunActionResponse>;
20
+ }
21
+ export declare function createClient(options: ClientOptions): Client;
22
+ export declare function bind(transport: Transport): Client;
23
+ export type RunActionRequest = PaymentMethodActionRunBody;
24
+ export type RunActionResponse = PaymentMethodCardLinkCompleteResponse;
@@ -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/payment-methods/actions",
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 { PaymentMethodActionRunBody, PaymentMethodCardLinkCompleteResponse, } 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,60 @@
1
+ import type { PaymentMethodSummary, TravelerId } from "../models.js";
2
+ export type PaymentMethodActionRunBody = {
3
+ travelerId?: TravelerId;
4
+ travelersTripId?: string;
5
+ type: "LIST";
6
+ } | {
7
+ saveFor: {
8
+ kind: "NONE";
9
+ } | {
10
+ kind: "USER";
11
+ } | {
12
+ consentAccepted: true;
13
+ kind: "TRIP";
14
+ travelersTripId: string;
15
+ };
16
+ type: "START_SETUP";
17
+ usage: "PROVIDER_CARD";
18
+ } | {
19
+ recipientEmail?: string;
20
+ travelerId?: TravelerId;
21
+ travelersTripId?: string;
22
+ type: "CREATE_TRIP_CARD_LINK";
23
+ } | {
24
+ paymentMethodId: string;
25
+ scope: {
26
+ kind: "USER";
27
+ } | {
28
+ kind: "TRIP";
29
+ travelersTripId: string;
30
+ } | {
31
+ advisorUserId?: string;
32
+ kind: "ADVISOR";
33
+ };
34
+ type: "REVOKE";
35
+ };
36
+ export type PaymentMethodCardLinkCompleteResponse = {
37
+ methods: PaymentMethodSummary[];
38
+ status: "LISTED";
39
+ } | {
40
+ collection: {
41
+ collectionToken: string;
42
+ collectionUrl: string;
43
+ type: "COLLECT_PROVIDER_CARD";
44
+ };
45
+ setupId: string;
46
+ status: "AWAITING_CARD";
47
+ } | {
48
+ nextAction: {
49
+ clientSecret: string;
50
+ type: "CONFIRM_NICER_CARD_SETUP";
51
+ };
52
+ setupId: string;
53
+ status: "REQUIRES_ACTION";
54
+ } | {
55
+ expiresAt: string | null;
56
+ paymentMethodId: string | null;
57
+ status: "COMPLETED";
58
+ travelersTripId: string | null;
59
+ url: string | null;
60
+ };
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,61 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { PlaceDetails, PlacesResponse } 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
+ * Get place details
12
+ *
13
+ * The full record of one place from a places search: every image, amenities,
14
+ * description and reference data. Use it when creating a segment; the list is
15
+ * intentionally light. 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
+ * Search places
21
+ *
22
+ * Search hotels, cities, airports and places by text. Hotels come from the
23
+ * Smith and shared catalogs first, then Google; cities and airports from the
24
+ * travel reference. Anonymous calls share one budget across the search
25
+ * routes, 600 per hour per IP; a valid bearer token lifts it. `Accept:
26
+ * text/event-stream` streams ranked snapshots as sources finish.
27
+ */
28
+ search(request: SearchRequest, options?: RequestOptions): Promise<SearchResponse>;
29
+ }
30
+ export declare function createClient(options: ClientOptions): Client;
31
+ export declare function bind(transport: Transport): Client;
32
+ export interface GetRequest {
33
+ placeId: string;
34
+ }
35
+ export type GetResponse = PlaceDetails;
36
+ export interface SearchRequest {
37
+ /**
38
+ * Free text: a hotel, city, airport or venue name.
39
+ */
40
+ q: string;
41
+ /**
42
+ * Comma-separated kinds to return: hotel, city, airport, place. All kinds
43
+ * when omitted.
44
+ */
45
+ kinds?: string;
46
+ /**
47
+ * Google place type filter for `place` results, for example restaurant or
48
+ * tourist_attraction.
49
+ */
50
+ type?: string;
51
+ /**
52
+ * Maximum items after ranking.
53
+ */
54
+ limit?: number;
55
+ /**
56
+ * Photos per item in the list. The place details resource carries the full
57
+ * album.
58
+ */
59
+ photos?: number;
60
+ }
61
+ export type SearchResponse = PlacesResponse;
@@ -0,0 +1,25 @@
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
+ search: (request, options) => transport.send(SearchOperation, request, options),
11
+ };
12
+ }
13
+ const GetOperation = {
14
+ method: "GET",
15
+ route: "/search/places/{placeId}",
16
+ response: null,
17
+ errors: { "400": true, "401": true, "403": true, "429": true },
18
+ };
19
+ const SearchOperation = {
20
+ method: "GET",
21
+ route: "/search/places",
22
+ query: { q: "q", kinds: "kinds", type: "type", limit: "limit", photos: "photos" },
23
+ response: null,
24
+ errors: { "400": true, "401": true, "403": true, "429": true },
25
+ };
@@ -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, SearchRequest, SearchResponse, } from "./client.js";
5
+ export type { Place, PlaceDetails, PlaceKind, PlacePhoto, PlaceSource, PlacesResponse, } 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,51 @@
1
+ export interface Place {
2
+ address?: string;
3
+ city?: string;
4
+ country?: string;
5
+ countryCode?: string;
6
+ fullAddress?: string;
7
+ hotelReference?: string;
8
+ iataCode?: string;
9
+ id: string;
10
+ kind: PlaceKind;
11
+ latitude?: number;
12
+ longitude?: number;
13
+ name: string;
14
+ photos: PlacePhoto[];
15
+ placeId?: string;
16
+ source: PlaceSource;
17
+ state?: string;
18
+ zipCode?: string;
19
+ }
20
+ export interface PlaceDetails {
21
+ address?: string;
22
+ amenities: string[];
23
+ city?: string;
24
+ country?: string;
25
+ countryCode?: string;
26
+ description?: string;
27
+ fullAddress?: string;
28
+ hotelReference?: string;
29
+ iataCode?: string;
30
+ id: string;
31
+ images: PlacePhoto[];
32
+ kind: PlaceKind;
33
+ latitude?: number;
34
+ longitude?: number;
35
+ name: string;
36
+ photos: PlacePhoto[];
37
+ placeId?: string;
38
+ source: PlaceSource;
39
+ state?: string;
40
+ zipCode?: string;
41
+ }
42
+ export type PlaceKind = "hotel" | "city" | "airport" | "place";
43
+ export interface PlacePhoto {
44
+ key?: string;
45
+ name?: string;
46
+ url: string;
47
+ }
48
+ export type PlaceSource = string;
49
+ export interface PlacesResponse {
50
+ items: Place[];
51
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,38 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { TravelerSelfUpdate } from "../models.js";
3
+ import type { ProfileForm } 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
+ * Open a profile form
13
+ *
14
+ * Opens the traveler a profile form link was sent for, without an account,
15
+ * with the name the agency presents itself with. The token is the link's
16
+ * secret. Errors: 404 ERROR_ITEM_NOT_FOUND for an unknown or expired link.
17
+ */
18
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
19
+ /**
20
+ * Fill a profile form
21
+ *
22
+ * Saves what the traveler filled in a profile form, without an account, and
23
+ * returns it as GET does. Send the revision read. Errors: 400
24
+ * ERROR_BODY_VALIDATION, 404 ERROR_ITEM_NOT_FOUND for an unknown or expired
25
+ * link, 409 CRM_REVISION_CONFLICT.
26
+ */
27
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
28
+ }
29
+ export declare function createClient(options: ClientOptions): Client;
30
+ export declare function bind(transport: Transport): Client;
31
+ export interface GetRequest {
32
+ token: string;
33
+ }
34
+ export type GetResponse = ProfileForm;
35
+ export type UpdateRequest = {
36
+ token: string;
37
+ } & TravelerSelfUpdate;
38
+ export type UpdateResponse = ProfileForm;
@@ -0,0 +1,25 @@
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
+ update: (request, options) => transport.send(UpdateOperation, request, options),
11
+ };
12
+ }
13
+ const GetOperation = {
14
+ method: "GET",
15
+ route: "/crm/profile-forms/{token}",
16
+ response: null,
17
+ errors: { "400": true },
18
+ };
19
+ const UpdateOperation = {
20
+ method: "PUT",
21
+ route: "/crm/profile-forms/{token}",
22
+ body: "flat",
23
+ response: null,
24
+ errors: { "400": true },
25
+ };
@@ -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, UpdateRequest, UpdateResponse, } from "./client.js";
5
+ export type { ProfileForm } 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,24 @@
1
+ import type { TravelerSelf } from "../models.js";
2
+ /**
3
+ * The traveler a profile form link opens, as the person fills it, and when the
4
+ * link expires.
5
+ */
6
+ export interface ProfileForm {
7
+ /**
8
+ * The name the agency presents itself with; null when it has none on file.
9
+ */
10
+ companyDisplayName: string | null;
11
+ /**
12
+ * The agency the traveler belongs to.
13
+ */
14
+ companyName: string;
15
+ /**
16
+ * When the link stops working, ISO 8601 in UTC: 14 days after the advisor
17
+ * sent it.
18
+ */
19
+ expiresAt: string;
20
+ /**
21
+ * The traveler the link was sent for, as the person fills it.
22
+ */
23
+ traveler: TravelerSelf;
24
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -0,0 +1,30 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { CreateQuoteRequest, QuoteOutcomeResponse } 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
+ * Create a bookable quote from an offer
12
+ *
13
+ * Re-validates a live offer (by `offerReference`, or by an existing
14
+ * `bookingSelectionId`) against the provider and stores an immutable quote
15
+ * with price, payment terms and participant requirements. Requires an
16
+ * `Idempotency-Key` header and an `x-nicer-company` header; the caller may be
17
+ * anonymous. Returns `OK`, `PRICE_CHANGED` (with `previousPrice` and
18
+ * `requiresAcceptance`) or `UNAVAILABLE` with a `reasonCode`. The quote
19
+ * carries the commercial snapshot (expected commission and earnings) only for
20
+ * the agency's advisors and admins and for Nicer staff; travelers and
21
+ * anonymous callers get the quote without it. A Sabre offer books under the
22
+ * advisor's own DK, else the agency's default DK; with neither, the quote is
23
+ * refused with 422 `BOOKING_SABRE_DK_REQUIRED` before Sabre is called.
24
+ */
25
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
26
+ }
27
+ export declare function createClient(options: ClientOptions): Client;
28
+ export declare function bind(transport: Transport): Client;
29
+ export type CreateRequest = CreateQuoteRequest;
30
+ export type CreateResponse = QuoteOutcomeResponse;
@@ -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: "/booking/quotes",
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 { BookingQuoteResponse, CreateQuoteRequest, QuoteOutcomeResponse, } 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 { BookingCommercialSnapshot, BookingPriceSnapshot, BookingProductSnapshot, ParticipantRequirements, PaymentTerms, ProductKind, ProviderKey, TermsDigest } from "../models.js";
2
+ export interface BookingQuoteResponse {
3
+ bookingSelectionId: string | null;
4
+ /**
5
+ * Expected supplier commission, advisor earning and traveler reward, with
6
+ * their calculation inputs. Present only for the agency's advisors and admins
7
+ * and for Nicer staff; absent for travelers and anonymous callers.
8
+ */
9
+ commercialSnapshot?: BookingCommercialSnapshot;
10
+ createdAt: string;
11
+ expiresAt: string;
12
+ itineraryItemId: string | null;
13
+ offerReference: string;
14
+ participantRequirements: ParticipantRequirements;
15
+ paymentTerms: PaymentTerms;
16
+ priceSnapshot: BookingPriceSnapshot;
17
+ productSnapshot: BookingProductSnapshot;
18
+ productType: ProductKind;
19
+ providerKey: ProviderKey;
20
+ providerProductId: string;
21
+ quoteId: string;
22
+ searchId: string | null;
23
+ status: "ACTIVE" | "CONSUMED" | "EXPIRED" | "INVALIDATED";
24
+ termsDigest: TermsDigest;
25
+ travelReferenceId: string | null;
26
+ travelersTripId: string | null;
27
+ }
28
+ export type CreateQuoteRequest = {
29
+ itineraryItemId?: string;
30
+ offerReference: string;
31
+ travelersTripId?: string;
32
+ } | {
33
+ bookingSelectionId: string;
34
+ };
35
+ export type QuoteOutcomeResponse = {
36
+ quote: BookingQuoteResponse;
37
+ status: "OK";
38
+ } | {
39
+ previousPrice: BookingPriceSnapshot;
40
+ quote: BookingQuoteResponse;
41
+ requiresAcceptance: true;
42
+ status: "PRICE_CHANGED";
43
+ termsChanged?: boolean;
44
+ } | {
45
+ reasonCode: string;
46
+ status: "UNAVAILABLE";
47
+ };
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};