@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,224 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { CreateTravelersTripBody, CreateTravelersTripResponse, CrmTrip, CrmTripList, CrmTripUpdate, GetTravelersTripResponse, ListTravelersTripResponse, TravelersTripInviteBody, TravelersTripToggleArchiveBody, TravelersTripToggleArchiveResponse, TripTravelerAdd, UpdateTravelersTripBody } 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
+ * Add a traveler to a trip
12
+ *
13
+ * Puts one existing traveler of the agency on the trip with their part in it,
14
+ * and leaves the trip's other travelers as they are. Nobody is messaged. A
15
+ * traveler already on the trip is left as they are, so the same call again
16
+ * changes nothing and answers the same trip. A trip keeps at most 20
17
+ * travelers and one PRIMARY. Only the trip's advisor or an agency admin adds
18
+ * a traveler, one they may see in the CRM. Returns the trip with its
19
+ * travelers as GET /crm/trips/{travelersTripId} does; the addition publishes
20
+ * crm.trip-updated.v1. Errors: 400 ERROR_BODY_VALIDATION, also for a trip
21
+ * with 20 travelers already or a second PRIMARY; 404 ERROR_ITEM_NOT_FOUND for
22
+ * a trip or a traveler the caller may not see; 409 CRM_REVISION_CONFLICT only
23
+ * when other changes to the trip kept landing through three tries.
24
+ */
25
+ addTraveler(request: AddTravelerRequest, options?: RequestOptions): Promise<AddTravelerResponse>;
26
+ /**
27
+ * Create a trip
28
+ *
29
+ * Opens a trip: the container every itinerary, proposal, message and order
30
+ * hangs off. Send at least a title, the travel dates and one destination. The
31
+ * trip is created together with its itinerary and its conversation, so a
32
+ * single call is enough to start planning. Dates accept any parseable date
33
+ * string and are stored as `YYYY-MM-DD`; the start date cannot be in the past
34
+ * and the end date must come after it.
35
+ */
36
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
37
+ /**
38
+ * Get a trip
39
+ *
40
+ * Returns a single trip with its destinations, dates, travelers and the ids
41
+ * of the itinerary and conversation attached to it. `status` is derived on
42
+ * read from the trip dates and whether anything has been booked yet, so it is
43
+ * always current. Readable by the people on the trip, its advisor of record,
44
+ * the admins of the agency that owns it and Nicer staff; anyone else is
45
+ * refused (ERROR_UNAUTHORIZED), whatever the id.
46
+ */
47
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
48
+ /**
49
+ * Get a trip's travelers
50
+ *
51
+ * Returns the trip as a CrmTrip with its travelers: who travels on it, the
52
+ * PRIMARY traveler first, each with the details a checkout needs, and the
53
+ * trip's sales stage, primary traveler, traveler count, itinerary and the
54
+ * revision PUT /crm/trips/{travelersTripId} sends back. The trip's staff (its
55
+ * advisor of record and the agency's admins) and the trip's own members
56
+ * signed in may read it; a payment link never does. Staff read every
57
+ * traveler's documents; a traveler on the trip reads only their own and those
58
+ * of the relatives they fill in for (a child, spouse or partner without an
59
+ * account of their own), and every other companion comes back with no
60
+ * documents. A trip the CRM keeps nothing of yet answers revision 0 and
61
+ * salesStage null. Errors: 404 ERROR_ITEM_NOT_FOUND for a trip that does not
62
+ * exist or that the caller may not read.
63
+ */
64
+ getTravelers(request: GetTravelersRequest, options?: RequestOptions): Promise<GetTravelersResponse>;
65
+ /**
66
+ * Invite a traveler to a trip
67
+ *
68
+ * Invites a travel companion to a trip. A phone number, an email address or a
69
+ * name is enough. A person with a Nicer account joins the trip at once; a
70
+ * person without one becomes a traveler of the agency on the trip in the CRM,
71
+ * and joins the trip when they sign up, so a group can be assembled before
72
+ * everyone has an account. Returns the trip.
73
+ */
74
+ invite(request: InviteRequest, options?: RequestOptions): Promise<InviteResponse>;
75
+ /**
76
+ * List trips
77
+ *
78
+ * Returns one page of the trips the caller belongs to, newest first — 20 by
79
+ * default, at most 100, with `nextToken` for the next page. Travelers see
80
+ * their own trips; advisors and staff see the trips of the company they are
81
+ * signed in to. Each item carries the same derived `status` and `isArchived`
82
+ * as the single-trip endpoint, and trips whose end date has passed are
83
+ * archived as they are listed.
84
+ */
85
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
86
+ /**
87
+ * List the sales pipeline
88
+ *
89
+ * Lists the agency's trips by sales stage, soonest first and undated trips
90
+ * last: an advisor's own trips, or for an admin every trip or one advisor's
91
+ * (assignedAdvisorUserId). salesStage keeps one column of the pipeline, NONE
92
+ * the trips without a stage; left out, the list runs stage by stage. Each
93
+ * trip is a CrmTrip without travelers: its primary traveler's id and name,
94
+ * how many travel on it, its itinerary and the revision PUT
95
+ * /crm/trips/{travelersTripId} needs. GET /crm/trips/{travelersTripId}
96
+ * answers who travels on one. 50 a page unless limit says otherwise; send the
97
+ * answer's nextToken back to read the next page, until it is null. The
98
+ * agency's advisors and admins may list. Errors: 400 ERROR_INVALID_QUERY for
99
+ * an unknown parameter, a limit out of range, a salesStage outside the
100
+ * pipeline or a nextToken of another list; 403 ERROR_UNAUTHORIZED for a
101
+ * traveler.
102
+ */
103
+ listPipeline(request?: ListPipelineRequest, options?: RequestOptions): Promise<ListPipelineResponse>;
104
+ /**
105
+ * Archive or restore a trip
106
+ *
107
+ * Archives or restores a trip for the caller only. Archiving hides the trip
108
+ * from their list and their inbox; everyone else on the trip keeps seeing it.
109
+ * Nothing is deleted.
110
+ */
111
+ setArchived(request: SetArchivedRequest, options?: RequestOptions): Promise<SetArchivedResponse>;
112
+ /**
113
+ * Update a trip
114
+ *
115
+ * Edits a trip in place. Every field is optional; only what you send changes.
116
+ * Moving `tripStartDate` or `tripEndDate` is checked against the segments
117
+ * already in the itinerary, so a date change that would orphan a booked
118
+ * segment is rejected instead of silently breaking the trip.
119
+ */
120
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
121
+ /**
122
+ * Update a trip's travelers or sales stage
123
+ *
124
+ * Keeps exactly the travelers in the body and moves the trip to salesStage,
125
+ * if the trip is still at the revision sent, and answers the trip with its
126
+ * travelers as GET /crm/trips/{travelersTripId} does, at the next revision. A
127
+ * traveler on the trip left out of travelers leaves it, and stays among the
128
+ * agency's travelers; a body without travelers leaves the list as it is. A
129
+ * traveler sent as a participant, as a checkout collects them, is found by
130
+ * email or phone or added to the agency; a traveler added that way stays the
131
+ * agency's even if the trip's own change then fails. The trip's staff (its
132
+ * advisor of record and the agency's admins) and its members signed in may
133
+ * update its travelers; only staff move its sales stage. The change publishes
134
+ * crm.trip-updated.v1 with the sections it changed. Errors: 400
135
+ * ERROR_BODY_VALIDATION, also for a body with neither travelers nor
136
+ * salesStage; 403 ERROR_UNAUTHORIZED for a member moving the sales stage; 404
137
+ * ERROR_ITEM_NOT_FOUND for a trip the caller may not read, or a traveler they
138
+ * may not name; 409 CRM_REVISION_CONFLICT when the trip changed since it was
139
+ * read: read it again.
140
+ */
141
+ updateTravelers(request: UpdateTravelersRequest, options?: RequestOptions): Promise<UpdateTravelersResponse>;
142
+ }
143
+ export declare function createClient(options: ClientOptions): Client;
144
+ export declare function bind(transport: Transport): Client;
145
+ export type AddTravelerRequest = {
146
+ travelersTripId: string;
147
+ } & TripTravelerAdd;
148
+ export type AddTravelerResponse = CrmTrip;
149
+ export type CreateRequest = CreateTravelersTripBody;
150
+ export type CreateResponse = CreateTravelersTripResponse;
151
+ export interface GetRequest {
152
+ travelersTripId: string;
153
+ }
154
+ export type GetResponse = GetTravelersTripResponse;
155
+ export interface GetTravelersRequest {
156
+ travelersTripId: string;
157
+ }
158
+ export type GetTravelersResponse = CrmTrip;
159
+ export type InviteRequest = {
160
+ travelersTripId: string;
161
+ } & TravelersTripInviteBody;
162
+ export type InviteResponse = CreateTravelersTripResponse;
163
+ export interface ListRequest {
164
+ /**
165
+ * Comma-separated item fields to return, dotted for nested ones — for example
166
+ * `travelersTripId,tripTitle,destinations.name`; a leading `-` removes a path
167
+ * from what is kept. `nextToken` is always answered. Omitted, an item carries
168
+ * every projected field except the destination photo galleries, which are
169
+ * more than half the body: ask for `destinations.photos` to get them.
170
+ */
171
+ fields?: string;
172
+ /**
173
+ * URL-encoded `field=value` expressions joined by `&`, applied to the page
174
+ * after it is read — for example `status=PROPOSAL&isArchived=false`.
175
+ */
176
+ filter?: string;
177
+ /**
178
+ * Trips per page. Defaults to 20, at most 100.
179
+ */
180
+ limit?: string;
181
+ /**
182
+ * Cursor from the previous response. Omit for the first page.
183
+ */
184
+ nextToken?: string;
185
+ /**
186
+ * Order by creation time. Defaults to newest first.
187
+ */
188
+ sort?: "asc" | "desc";
189
+ }
190
+ export type ListResponse = ListTravelersTripResponse;
191
+ export interface ListPipelineRequest {
192
+ /**
193
+ * Admins: only this advisor's trips, by user id. An advisor always lists
194
+ * their own trips.
195
+ */
196
+ assignedAdvisorUserId?: string;
197
+ /**
198
+ * How many trips a page holds, 1 to 100; 50 when left out.
199
+ */
200
+ limit?: number;
201
+ /**
202
+ * The nextToken of the page before, to read the next one; left out for the
203
+ * first page.
204
+ */
205
+ nextToken?: string;
206
+ /**
207
+ * One column of the pipeline: a sales stage, or NONE for the trips without
208
+ * one. Left out, every trip, stage by stage.
209
+ */
210
+ salesStage?: "BOOKED" | "COMPLETED" | "INQUIRY" | "LOST" | "PLANNING" | "PROPOSAL" | "TRAVELING" | "NONE";
211
+ }
212
+ export type ListPipelineResponse = CrmTripList;
213
+ export type SetArchivedRequest = {
214
+ travelersTripId: string;
215
+ } & TravelersTripToggleArchiveBody;
216
+ export type SetArchivedResponse = TravelersTripToggleArchiveResponse;
217
+ export type UpdateRequest = {
218
+ travelersTripId: string;
219
+ } & UpdateTravelersTripBody;
220
+ export type UpdateResponse = CreateTravelersTripResponse;
221
+ export type UpdateTravelersRequest = {
222
+ travelersTripId: string;
223
+ } & CrmTripUpdate;
224
+ export type UpdateTravelersResponse = CrmTrip;
@@ -0,0 +1,88 @@
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
+ addTraveler: (request, options) => transport.send(AddTravelerOperation, request, options),
10
+ create: (request, options) => transport.send(CreateOperation, request, options),
11
+ get: (request, options) => transport.send(GetOperation, request, options),
12
+ getTravelers: (request, options) => transport.send(GetTravelersOperation, request, options),
13
+ invite: (request, options) => transport.send(InviteOperation, request, options),
14
+ list: (request, options) => transport.send(ListOperation, request, options),
15
+ listPipeline: (request, options) => transport.send(ListPipelineOperation, request, options),
16
+ setArchived: (request, options) => transport.send(SetArchivedOperation, request, options),
17
+ update: (request, options) => transport.send(UpdateOperation, request, options),
18
+ updateTravelers: (request, options) => transport.send(UpdateTravelersOperation, request, options),
19
+ };
20
+ }
21
+ const AddTravelerOperation = {
22
+ method: "POST",
23
+ route: "/crm/trips/{travelersTripId}/travelers",
24
+ body: "flat",
25
+ response: null,
26
+ errors: { "400": true, "401": true, "403": true },
27
+ };
28
+ const CreateOperation = {
29
+ method: "POST",
30
+ route: "/travelers-trip",
31
+ body: "flat",
32
+ response: null,
33
+ errors: { "400": true, "401": true, "403": true },
34
+ };
35
+ const GetOperation = {
36
+ method: "GET",
37
+ route: "/travelers-trip/{travelersTripId}",
38
+ response: null,
39
+ errors: { "400": true, "401": true, "403": true },
40
+ };
41
+ const GetTravelersOperation = {
42
+ method: "GET",
43
+ route: "/crm/trips/{travelersTripId}",
44
+ response: null,
45
+ errors: { "400": true, "401": true, "403": true },
46
+ };
47
+ const InviteOperation = {
48
+ method: "POST",
49
+ route: "/travelers-trip/{travelersTripId}/invite",
50
+ body: "flat",
51
+ response: null,
52
+ errors: { "400": true, "401": true, "403": true },
53
+ };
54
+ const ListOperation = {
55
+ method: "GET",
56
+ route: "/travelers-trip",
57
+ query: { fields: "fields", filter: "filter", limit: "limit", nextToken: "nextToken", sort: "sort" },
58
+ response: null,
59
+ errors: { "400": true, "401": true, "403": true },
60
+ };
61
+ const ListPipelineOperation = {
62
+ method: "GET",
63
+ route: "/crm/trips",
64
+ query: { assignedAdvisorUserId: "assignedAdvisorUserId", limit: "limit", nextToken: "nextToken", salesStage: "salesStage" },
65
+ response: null,
66
+ errors: { "400": true, "401": true, "403": true },
67
+ };
68
+ const SetArchivedOperation = {
69
+ method: "POST",
70
+ route: "/travelers-trip/{travelersTripId}/toggle-archive",
71
+ body: "flat",
72
+ response: null,
73
+ errors: { "400": true, "401": true, "403": true },
74
+ };
75
+ const UpdateOperation = {
76
+ method: "PUT",
77
+ route: "/travelers-trip/{travelersTripId}",
78
+ body: "flat",
79
+ response: null,
80
+ errors: { "400": true, "401": true, "403": true },
81
+ };
82
+ const UpdateTravelersOperation = {
83
+ method: "PUT",
84
+ route: "/crm/trips/{travelersTripId}",
85
+ body: "flat",
86
+ response: null,
87
+ errors: { "400": true, "401": true, "403": true },
88
+ };
@@ -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, AddTravelerRequest, AddTravelerResponse, CreateRequest, CreateResponse, GetRequest, GetResponse, GetTravelersRequest, GetTravelersResponse, InviteRequest, InviteResponse, ListRequest, ListResponse, ListPipelineRequest, ListPipelineResponse, SetArchivedRequest, SetArchivedResponse, UpdateRequest, UpdateResponse, UpdateTravelersRequest, UpdateTravelersResponse, } from "./client.js";
5
+ export type { CreateTravelersTripBody, CreateTravelersTripResponse, CrmTrip, CrmTripList, CrmTripUpdate, Destination, GetTravelersTripResponse, ListTravelersTripResponse, TravelersTripInviteBody, TravelersTripToggleArchiveBody, TravelersTripToggleArchiveResponse, TripParticipant, TripTraveler, TripTravelerAdd, TripTravelerInput, UpdateTravelersTripBody, } 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";