@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,214 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { Deleted, TravelerStage, TravelerTag } from "../models.js";
3
+ import type { Traveler, TravelerCreate, TravelerImport, TravelerImportResult, TravelerInvitation, TravelerInvitationCreate, TravelerList, TravelerMerge, TravelerUpdate } 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
+ * Add a traveler
13
+ *
14
+ * Adds a traveler to the agency, with or without a Nicer account, and returns
15
+ * it. Only the legal name is required. The new traveler is the caller's; an
16
+ * admin may assign another advisor. The answer always includes
17
+ * possibleDuplicates, the travelers who may be the same person (same email,
18
+ * phone, or name and birth date), so the caller can merge them: finding them
19
+ * is part of adding one, at up to four reads. expand takes the same members
20
+ * as GET /crm/travelers/{travelerId}; on a new traveler they are empty, and
21
+ * asking for them costs no read. Requires an Idempotency-Key header: a retry
22
+ * with the same key and the same body and expand answers the first result.
23
+ * Errors: 400 ERROR_BODY_VALIDATION, 400 ERROR_INVALID_QUERY for an expand
24
+ * name that is not a member, 400 INVALID_HEADERS or INVALID_IDEMPOTENCY_KEY,
25
+ * 409 CRM_IDEMPOTENCY_CONFLICT for a key reused with another body or expand.
26
+ */
27
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
28
+ /**
29
+ * Erase a traveler
30
+ *
31
+ * Erases a traveler for good: their profile, documents, dates, relationships,
32
+ * notes, tasks, trips and timeline. Bookings already made keep their own copy
33
+ * of the travelers in commerce. To keep the traveler but hide them, archive
34
+ * them instead (isArchived on update). Answers the traveler's id with deleted
35
+ * set to true. Admins only. Errors: 403 ERROR_UNAUTHORIZED, 404
36
+ * ERROR_ITEM_NOT_FOUND.
37
+ */
38
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
39
+ /**
40
+ * Get a traveler
41
+ *
42
+ * Returns one traveler. Without expand the answer is the traveler's own
43
+ * fields, read in one call. expand adds members, comma-separated, each at the
44
+ * cost of its own reads, all read at the same time: profile (the travel
45
+ * profile, one read), documents (travel documents with their full numbers,
46
+ * one read), importantDates (one read), relationships (up to two reads: the
47
+ * links, then the related travelers' names), trips (one read) and
48
+ * possibleDuplicates (up to four reads: one lookup per email, phone and name
49
+ * with birth date, then the travelers found, among those the caller may see).
50
+ * Ask only for the members you show. Errors: 400 ERROR_INVALID_QUERY for an
51
+ * expand name that is not a member, 404 ERROR_ITEM_NOT_FOUND for a traveler
52
+ * the caller may not see.
53
+ */
54
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
55
+ /**
56
+ * Import travelers
57
+ *
58
+ * Adds up to 200 travelers in one call, for example from a spreadsheet. A row
59
+ * whose email or phone belongs to a traveler of the agency is MATCHED, not
60
+ * duplicated; each row reports its own outcome. Requires an Idempotency-Key
61
+ * header. Errors: 400 ERROR_BODY_VALIDATION, 409 CRM_IDEMPOTENCY_CONFLICT.
62
+ */
63
+ import(request: ImportRequest, options?: RequestOptions): Promise<ImportResponse>;
64
+ /**
65
+ * Invite a traveler
66
+ *
67
+ * Invites the traveler by email or SMS: to create a Nicer account (ACCOUNT),
68
+ * or to fill their own profile from a link that works for 14 days without an
69
+ * account (PROFILE_FORM). When they sign up, their account is linked to this
70
+ * traveler. Requires an Idempotency-Key header: a retry with the same key
71
+ * answers the first invitation, without its profileFormToken, which Nicer
72
+ * keeps only as a hash. Errors: 400 CRM_INVITATION_NO_CHANNEL when the
73
+ * traveler has no email or phone for the channel, 404 ERROR_ITEM_NOT_FOUND,
74
+ * 409 CRM_IDEMPOTENCY_CONFLICT.
75
+ */
76
+ invite(request: InviteRequest, options?: RequestOptions): Promise<InviteResponse>;
77
+ /**
78
+ * List or search travelers
79
+ *
80
+ * Lists the agency's travelers by name, 50 a page. An advisor sees the
81
+ * travelers they serve (scope=COMPANY adds the ones the agency shares with
82
+ * every advisor); an admin sees them all, or one advisor's with
83
+ * assignedAdvisorUserId. q matches the start of any word of the name, the
84
+ * email or the phone; tag, stage, isArchived and segmentId narrow the list.
85
+ * total counts the whole list, or is null for a search or a segment with
86
+ * dates. Errors: 400 ERROR_INVALID_QUERY.
87
+ */
88
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
89
+ /**
90
+ * Merge a duplicate into a traveler
91
+ *
92
+ * Merges duplicateTravelerId into this traveler and returns the traveler that
93
+ * stays: it keeps its values, fills its empty fields from the duplicate and
94
+ * takes its documents, notes, tasks, relationships, trips and account; the
95
+ * duplicate is removed and its id answers as this one. Without expand the
96
+ * answer is the traveler's own fields; expand adds members exactly as on GET
97
+ * /crm/travelers/{travelerId}, read once the merge is done. Requires an
98
+ * Idempotency-Key header: a retry with the same key, duplicate and expand
99
+ * answers the first result. Errors: 400 CRM_MERGE_SAME_TRAVELER, 400
100
+ * ERROR_INVALID_QUERY for an expand name that is not a member, 404
101
+ * ERROR_ITEM_NOT_FOUND for either traveler, 409 CRM_IDEMPOTENCY_CONFLICT.
102
+ */
103
+ merge(request: MergeRequest, options?: RequestOptions): Promise<MergeResponse>;
104
+ /**
105
+ * Update a traveler
106
+ *
107
+ * Replaces the sections of a traveler the body names and returns the traveler
108
+ * as it is now. Send the revision you read: a traveler changed since answers
109
+ * 409 CRM_REVISION_CONFLICT. An omitted section is kept, null clears it, and
110
+ * a list replaces the stored one; relationships are written on both
111
+ * travelers, and documents is the whole list of travel documents to keep.
112
+ * Only admins change the advisors. Without expand the answer is the
113
+ * traveler's own fields, with no read beyond the one that checks the
114
+ * traveler; expand adds members exactly as on GET
115
+ * /crm/travelers/{travelerId}, each read once the change is saved. Errors:
116
+ * 400 ERROR_BODY_VALIDATION (a documentId or dateId that is not the
117
+ * traveler's included), 400 ERROR_INVALID_QUERY for an expand name that is
118
+ * not a member, 400 CRM_RELATED_TRAVELER_NOT_FOUND, 403 ERROR_UNAUTHORIZED
119
+ * for an advisor changing the advisors, 404 ERROR_ITEM_NOT_FOUND, 409
120
+ * CRM_REVISION_CONFLICT.
121
+ */
122
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
123
+ }
124
+ export declare function createClient(options: ClientOptions): Client;
125
+ export declare function bind(transport: Transport): Client;
126
+ export type CreateRequest = {
127
+ /**
128
+ * The members to add to the answer, comma-separated, e.g. profile,documents.
129
+ * Without it the answer has none of them. Each member costs its own database
130
+ * reads, and the members asked for are read at the same time: profile,
131
+ * documents, importantDates and trips one read each; relationships up to two
132
+ * (the links, then the related travelers' names); possibleDuplicates up to
133
+ * four (one per email, phone and name with birth date the traveler has, then
134
+ * the travelers found). Ask only for what you show. A name that is not a
135
+ * member is 400 ERROR_INVALID_QUERY.
136
+ */
137
+ expand?: string;
138
+ } & TravelerCreate;
139
+ export type CreateResponse = Traveler;
140
+ export interface DeleteRequest {
141
+ travelerId: string;
142
+ }
143
+ export type DeleteResponse = Deleted;
144
+ export interface GetRequest {
145
+ travelerId: string;
146
+ /**
147
+ * The members to add to the answer, comma-separated, e.g. profile,documents.
148
+ * Without it the answer has none of them. Each member costs its own database
149
+ * reads, and the members asked for are read at the same time: profile,
150
+ * documents, importantDates and trips one read each; relationships up to two
151
+ * (the links, then the related travelers' names); possibleDuplicates up to
152
+ * four (one per email, phone and name with birth date the traveler has, then
153
+ * the travelers found). Ask only for what you show. A name that is not a
154
+ * member is 400 ERROR_INVALID_QUERY.
155
+ */
156
+ expand?: string;
157
+ }
158
+ export type GetResponse = Traveler;
159
+ export type ImportRequest = TravelerImport;
160
+ export type ImportResponse = TravelerImportResult;
161
+ export type InviteRequest = {
162
+ travelerId: string;
163
+ } & TravelerInvitationCreate;
164
+ export type InviteResponse = TravelerInvitation;
165
+ export interface ListRequest {
166
+ assignedAdvisorUserId?: string;
167
+ isArchived?: string;
168
+ limit?: number;
169
+ nextToken?: string;
170
+ q?: string;
171
+ scope?: "COMPANY" | "MINE";
172
+ segmentId?: string;
173
+ /**
174
+ * LEAD until the traveler's first booking is confirmed, then CLIENT. An
175
+ * advisor may set it too.
176
+ */
177
+ stage?: TravelerStage;
178
+ /**
179
+ * A label the agency uses to group travelers, e.g. VIP.
180
+ */
181
+ tag?: TravelerTag;
182
+ userId?: string;
183
+ }
184
+ export type ListResponse = TravelerList;
185
+ export type MergeRequest = {
186
+ travelerId: string;
187
+ /**
188
+ * The members to add to the answer, comma-separated, e.g. profile,documents.
189
+ * Without it the answer has none of them. Each member costs its own database
190
+ * reads, and the members asked for are read at the same time: profile,
191
+ * documents, importantDates and trips one read each; relationships up to two
192
+ * (the links, then the related travelers' names); possibleDuplicates up to
193
+ * four (one per email, phone and name with birth date the traveler has, then
194
+ * the travelers found). Ask only for what you show. A name that is not a
195
+ * member is 400 ERROR_INVALID_QUERY.
196
+ */
197
+ expand?: string;
198
+ } & TravelerMerge;
199
+ export type MergeResponse = Traveler;
200
+ export type UpdateRequest = {
201
+ travelerId: string;
202
+ /**
203
+ * The members to add to the answer, comma-separated, e.g. profile,documents.
204
+ * Without it the answer has none of them. Each member costs its own database
205
+ * reads, and the members asked for are read at the same time: profile,
206
+ * documents, importantDates and trips one read each; relationships up to two
207
+ * (the links, then the related travelers' names); possibleDuplicates up to
208
+ * four (one per email, phone and name with birth date the traveler has, then
209
+ * the travelers found). Ask only for what you show. A name that is not a
210
+ * member is 400 ERROR_INVALID_QUERY.
211
+ */
212
+ expand?: string;
213
+ } & TravelerUpdate;
214
+ export type UpdateResponse = Traveler;
@@ -0,0 +1,76 @@
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
+ get: (request, options) => transport.send(GetOperation, request, options),
12
+ import: (request, options) => transport.send(ImportOperation, request, options),
13
+ invite: (request, options) => transport.send(InviteOperation, request, options),
14
+ list: (request, options) => transport.send(ListOperation, request, options),
15
+ merge: (request, options) => transport.send(MergeOperation, request, options),
16
+ update: (request, options) => transport.send(UpdateOperation, request, options),
17
+ };
18
+ }
19
+ const CreateOperation = {
20
+ method: "POST",
21
+ route: "/crm/travelers",
22
+ query: { expand: "expand" },
23
+ body: "flat",
24
+ response: null,
25
+ errors: { "400": true, "401": true, "403": true },
26
+ };
27
+ const DeleteOperation = {
28
+ method: "DELETE",
29
+ route: "/crm/travelers/{travelerId}",
30
+ response: null,
31
+ errors: { "400": true, "401": true, "403": true },
32
+ };
33
+ const GetOperation = {
34
+ method: "GET",
35
+ route: "/crm/travelers/{travelerId}",
36
+ query: { expand: "expand" },
37
+ response: null,
38
+ errors: { "400": true, "401": true, "403": true },
39
+ };
40
+ const ImportOperation = {
41
+ method: "POST",
42
+ route: "/crm/travelers/import",
43
+ body: "flat",
44
+ response: null,
45
+ errors: { "400": true, "401": true, "403": true },
46
+ };
47
+ const InviteOperation = {
48
+ method: "POST",
49
+ route: "/crm/travelers/{travelerId}/invitation",
50
+ body: "flat",
51
+ response: null,
52
+ errors: { "400": true, "401": true, "403": true },
53
+ };
54
+ const ListOperation = {
55
+ method: "GET",
56
+ route: "/crm/travelers",
57
+ query: { assignedAdvisorUserId: "assignedAdvisorUserId", isArchived: "isArchived", limit: "limit", nextToken: "nextToken", q: "q", scope: "scope", segmentId: "segmentId", stage: "stage", tag: "tag", userId: "userId" },
58
+ response: null,
59
+ errors: { "400": true, "401": true, "403": true },
60
+ };
61
+ const MergeOperation = {
62
+ method: "POST",
63
+ route: "/crm/travelers/{travelerId}/merge",
64
+ query: { expand: "expand" },
65
+ body: "flat",
66
+ response: null,
67
+ errors: { "400": true, "401": true, "403": true },
68
+ };
69
+ const UpdateOperation = {
70
+ method: "PUT",
71
+ route: "/crm/travelers/{travelerId}",
72
+ query: { expand: "expand" },
73
+ body: "flat",
74
+ response: null,
75
+ errors: { "400": true, "401": true, "403": true },
76
+ };
@@ -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, GetRequest, GetResponse, ImportRequest, ImportResponse, InviteRequest, InviteResponse, ListRequest, ListResponse, MergeRequest, MergeResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
+ export type { CustomFieldValue, DuplicateConfidence, DuplicateReason, Traveler, TravelerCreate, TravelerDuplicate, TravelerImport, TravelerImportResult, TravelerInvitation, TravelerInvitationCreate, TravelerList, TravelerMerge, TravelerOrigin, TravelerRelationship, TravelerRelationshipInput, TravelerTrip, TravelerUpdate, } 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";