@withnicer/sdk 0.0.0-stage → 1.0.0-beta.1
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.
- package/README.md +91 -2
- package/dist/_/codec.d.ts +93 -0
- package/dist/_/codec.js +298 -0
- package/dist/_/error.d.ts +27 -0
- package/dist/_/error.js +68 -0
- package/dist/_/hooks/envelope.d.ts +11 -0
- package/dist/_/hooks/envelope.js +15 -0
- package/dist/_/index.d.ts +3 -0
- package/dist/_/index.js +5 -0
- package/dist/_/transport.d.ts +146 -0
- package/dist/_/transport.js +220 -0
- package/dist/activity/client.d.ts +42 -0
- package/dist/activity/client.js +18 -0
- package/dist/activity/index.d.ts +5 -0
- package/dist/activity/index.js +4 -0
- package/dist/activity/models.d.ts +65 -0
- package/dist/activity/models.js +3 -0
- package/dist/client.d.ts +1680 -0
- package/dist/client.js +748 -0
- package/dist/crmSettings/client.d.ts +50 -0
- package/dist/crmSettings/client.js +25 -0
- package/dist/crmSettings/index.d.ts +5 -0
- package/dist/crmSettings/index.js +4 -0
- package/dist/crmSettings/models.d.ts +313 -0
- package/dist/crmSettings/models.js +3 -0
- package/dist/crmTrips/client.d.ts +100 -0
- package/dist/crmTrips/client.js +38 -0
- package/dist/crmTrips/index.d.ts +5 -0
- package/dist/crmTrips/index.js +4 -0
- package/dist/crmTrips/models.d.ts +193 -0
- package/dist/crmTrips/models.js +3 -0
- package/dist/crmTrips/travelers/client.d.ts +33 -0
- package/dist/crmTrips/travelers/client.js +18 -0
- package/dist/crmTrips/travelers/index.d.ts +5 -0
- package/dist/crmTrips/travelers/index.js +4 -0
- package/dist/crmTrips/travelers/models.d.ts +14 -0
- package/dist/crmTrips/travelers/models.js +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/me/client.d.ts +56 -0
- package/dist/me/client.js +25 -0
- package/dist/me/index.d.ts +5 -0
- package/dist/me/index.js +4 -0
- package/dist/me/models.d.ts +95 -0
- package/dist/me/models.js +3 -0
- package/dist/models.d.ts +9269 -0
- package/dist/models.js +4 -0
- package/dist/notes/client.d.ts +82 -0
- package/dist/notes/client.js +41 -0
- package/dist/notes/index.d.ts +5 -0
- package/dist/notes/index.js +4 -0
- package/dist/notes/models.d.ts +116 -0
- package/dist/notes/models.js +3 -0
- package/dist/options/index.d.ts +52 -0
- package/dist/options/index.js +53 -0
- package/dist/profileForms/client.d.ts +38 -0
- package/dist/profileForms/client.js +25 -0
- package/dist/profileForms/index.d.ts +5 -0
- package/dist/profileForms/index.js +4 -0
- package/dist/profileForms/models.d.ts +24 -0
- package/dist/profileForms/models.js +3 -0
- package/dist/taskTemplates/client.d.ts +36 -0
- package/dist/taskTemplates/client.js +18 -0
- package/dist/taskTemplates/index.d.ts +5 -0
- package/dist/taskTemplates/index.js +4 -0
- package/dist/taskTemplates/models.d.ts +15 -0
- package/dist/taskTemplates/models.js +3 -0
- package/dist/tasks/client.d.ts +105 -0
- package/dist/tasks/client.js +41 -0
- package/dist/tasks/index.d.ts +5 -0
- package/dist/tasks/index.js +4 -0
- package/dist/tasks/models.d.ts +59 -0
- package/dist/tasks/models.js +3 -0
- package/dist/travelers/client.d.ts +214 -0
- package/dist/travelers/client.js +76 -0
- package/dist/travelers/index.d.ts +5 -0
- package/dist/travelers/index.js +4 -0
- package/dist/travelers/models.d.ts +576 -0
- package/dist/travelers/models.js +3 -0
- package/package.json +47 -4
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import type { CountryCode, FrequentFlyerProgram, ImportantDate, ImportantDateInput, LanguageTag, MarketingConsent, Money, ParticipantSex, PersonAddress, PersonContact, PersonName, PreferredChannel, SalesStage, TravelProfile, TravelProfileUpdate, TravelerDocument, TravelerDocumentInput, TravelerId, TravelerRelationshipKind, TravelerStage, TravelerTag, TravelerVisibility, TravelersTripRelationship } from "../models.js";
|
|
2
|
+
/**
|
|
3
|
+
* The value of a custom field the agency defined: text, a number, a yes or no,
|
|
4
|
+
* or null.
|
|
5
|
+
*/
|
|
6
|
+
export type CustomFieldValue = string | number | boolean | null;
|
|
7
|
+
/**
|
|
8
|
+
* How likely two travelers are one person: HIGH for the same email, MEDIUM for
|
|
9
|
+
* the same phone or the same name and birth date.
|
|
10
|
+
*/
|
|
11
|
+
export type DuplicateConfidence = "HIGH" | "MEDIUM";
|
|
12
|
+
/**
|
|
13
|
+
* What two travelers share: EMAIL, the same email; PHONE, the same phone;
|
|
14
|
+
* NAME_AND_BIRTH_DATE, the same legal name and date of birth.
|
|
15
|
+
*/
|
|
16
|
+
export type DuplicateReason = "EMAIL" | "NAME_AND_BIRTH_DATE" | "PHONE";
|
|
17
|
+
/**
|
|
18
|
+
* A person the agency serves, with or without a Nicer account. Every route that
|
|
19
|
+
* answers a traveler answers this object: its own fields always, and profile,
|
|
20
|
+
* documents, importantDates, relationships, trips and possibleDuplicates only
|
|
21
|
+
* when the route's expand query names them.
|
|
22
|
+
*/
|
|
23
|
+
export interface Traveler {
|
|
24
|
+
/**
|
|
25
|
+
* The traveler's postal address; null when nobody gave one.
|
|
26
|
+
*/
|
|
27
|
+
address: PersonAddress | null;
|
|
28
|
+
/**
|
|
29
|
+
* The user id of the advisor responsible for the traveler; null until an
|
|
30
|
+
* admin assigns one.
|
|
31
|
+
*/
|
|
32
|
+
assignedAdvisorUserId: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Date of birth, YYYY-MM-DD; null when unknown.
|
|
35
|
+
*/
|
|
36
|
+
birthDate: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* What the traveler has booked, in minor units of one currency. Informative
|
|
39
|
+
* only: commerce holds the money. Null before the first booking.
|
|
40
|
+
*/
|
|
41
|
+
bookedTotal: Money | null;
|
|
42
|
+
/**
|
|
43
|
+
* The agency the traveler belongs to.
|
|
44
|
+
*/
|
|
45
|
+
companyName: string;
|
|
46
|
+
/**
|
|
47
|
+
* The traveler's email and phone, the phone in E.164; each is null when
|
|
48
|
+
* unknown.
|
|
49
|
+
*/
|
|
50
|
+
contact: PersonContact;
|
|
51
|
+
/**
|
|
52
|
+
* The user ids of every advisor who serves the traveler, the assigned one
|
|
53
|
+
* included.
|
|
54
|
+
*/
|
|
55
|
+
contributingAdvisorIds: string[];
|
|
56
|
+
/**
|
|
57
|
+
* When the traveler was added, ISO 8601 in UTC.
|
|
58
|
+
*/
|
|
59
|
+
createdAt: string;
|
|
60
|
+
/**
|
|
61
|
+
* The user id of who added the traveler, or SYSTEM.
|
|
62
|
+
*/
|
|
63
|
+
createdBy: string;
|
|
64
|
+
/**
|
|
65
|
+
* The values of the agency's own custom fields, by the field's key.
|
|
66
|
+
*/
|
|
67
|
+
customFields: {
|
|
68
|
+
[key: string]: CustomFieldValue;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The name to show: the preferred name, else the given name, then the family
|
|
72
|
+
* name.
|
|
73
|
+
*/
|
|
74
|
+
displayName: string;
|
|
75
|
+
/**
|
|
76
|
+
* The traveler's travel documents with their full numbers, oldest first. Only
|
|
77
|
+
* with expand=documents; never in a list.
|
|
78
|
+
*/
|
|
79
|
+
documents?: TravelerDocument[];
|
|
80
|
+
/**
|
|
81
|
+
* Airline loyalty memberships, as a flight reservation carries them.
|
|
82
|
+
*/
|
|
83
|
+
frequentFlyerPrograms: FrequentFlyerProgram[];
|
|
84
|
+
/**
|
|
85
|
+
* The dates the agency remembers every year; the birthday is birthDate, not
|
|
86
|
+
* one of these. Only with expand=importantDates.
|
|
87
|
+
*/
|
|
88
|
+
importantDates?: ImportantDate[];
|
|
89
|
+
/**
|
|
90
|
+
* Whether the traveler is archived: kept, but out of the lists and searches.
|
|
91
|
+
*/
|
|
92
|
+
isArchived: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* When something last happened with the traveler, ISO 8601 in UTC; null when
|
|
95
|
+
* nothing has.
|
|
96
|
+
*/
|
|
97
|
+
lastActivityAt: string | null;
|
|
98
|
+
/**
|
|
99
|
+
* The user id of who last changed the traveler, or SYSTEM.
|
|
100
|
+
*/
|
|
101
|
+
lastModifiedBy: string;
|
|
102
|
+
/**
|
|
103
|
+
* The last day, YYYY-MM-DD, of the traveler's latest trip that has ended;
|
|
104
|
+
* null when none has.
|
|
105
|
+
*/
|
|
106
|
+
lastTripEndDate: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* When the traveler was linked to a Nicer account, ISO 8601 in UTC; null
|
|
109
|
+
* while they have none.
|
|
110
|
+
*/
|
|
111
|
+
linkedAt: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Whether the traveler agreed to marketing messages, per channel.
|
|
114
|
+
*/
|
|
115
|
+
marketingConsent: MarketingConsent;
|
|
116
|
+
/**
|
|
117
|
+
* The legal name, as printed on the travel document.
|
|
118
|
+
*/
|
|
119
|
+
name: PersonName;
|
|
120
|
+
/**
|
|
121
|
+
* Nationality, as an ISO 3166-1 alpha-2 country code; null when unknown.
|
|
122
|
+
*/
|
|
123
|
+
nationalityCountryCode: CountryCode | null;
|
|
124
|
+
/**
|
|
125
|
+
* The first day, YYYY-MM-DD, of the traveler's next trip; null when none is
|
|
126
|
+
* coming.
|
|
127
|
+
*/
|
|
128
|
+
nextTripStartDate: string | null;
|
|
129
|
+
/**
|
|
130
|
+
* How the traveler entered the CRM.
|
|
131
|
+
*/
|
|
132
|
+
origin: TravelerOrigin;
|
|
133
|
+
/**
|
|
134
|
+
* Other travelers of the agency, among those the caller may see, who may be
|
|
135
|
+
* the same person. Only with expand=possibleDuplicates, and always on the
|
|
136
|
+
* answer to adding a traveler.
|
|
137
|
+
*/
|
|
138
|
+
possibleDuplicates?: TravelerDuplicate[];
|
|
139
|
+
/**
|
|
140
|
+
* How the traveler prefers to be contacted; null when they have not said.
|
|
141
|
+
*/
|
|
142
|
+
preferredChannel: PreferredChannel | null;
|
|
143
|
+
/**
|
|
144
|
+
* The language to write to the traveler in, e.g. es or en-US; null when
|
|
145
|
+
* unknown.
|
|
146
|
+
*/
|
|
147
|
+
preferredLanguage: LanguageTag | null;
|
|
148
|
+
/**
|
|
149
|
+
* The name the traveler goes by when it is not their given name; null
|
|
150
|
+
* otherwise.
|
|
151
|
+
*/
|
|
152
|
+
preferredName: string | null;
|
|
153
|
+
/**
|
|
154
|
+
* The travel profile: air and hotel preferences, dietary and accessibility
|
|
155
|
+
* needs, loyalty programs, emergency contacts, interests and pets. Only with
|
|
156
|
+
* expand=profile.
|
|
157
|
+
*/
|
|
158
|
+
profile?: TravelProfile;
|
|
159
|
+
/**
|
|
160
|
+
* The traveler who referred this one; null when nobody did.
|
|
161
|
+
*/
|
|
162
|
+
referredByTravelerId: string | null;
|
|
163
|
+
/**
|
|
164
|
+
* Other travelers of the agency this one is related to. Only with
|
|
165
|
+
* expand=relationships.
|
|
166
|
+
*/
|
|
167
|
+
relationships?: TravelerRelationship[];
|
|
168
|
+
/**
|
|
169
|
+
* Country of residence, as an ISO 3166-1 alpha-2 country code; null when
|
|
170
|
+
* unknown.
|
|
171
|
+
*/
|
|
172
|
+
residenceCountryCode: CountryCode | null;
|
|
173
|
+
/**
|
|
174
|
+
* Goes up by one on every change. Send it back with an update, so a change
|
|
175
|
+
* made meanwhile is never overwritten.
|
|
176
|
+
*/
|
|
177
|
+
revision: number;
|
|
178
|
+
/**
|
|
179
|
+
* The sex marker on the travel document; null when unknown.
|
|
180
|
+
*/
|
|
181
|
+
sex: ParticipantSex | null;
|
|
182
|
+
/**
|
|
183
|
+
* LEAD until the traveler's first booking is confirmed, then CLIENT.
|
|
184
|
+
*/
|
|
185
|
+
stage: TravelerStage;
|
|
186
|
+
/**
|
|
187
|
+
* Labels the agency groups travelers by, such as VIP.
|
|
188
|
+
*/
|
|
189
|
+
tags: TravelerTag[];
|
|
190
|
+
/**
|
|
191
|
+
* The traveler's id.
|
|
192
|
+
*/
|
|
193
|
+
travelerId: TravelerId;
|
|
194
|
+
/**
|
|
195
|
+
* The trips the traveler is on, the latest start first and undated ones last.
|
|
196
|
+
* Only with expand=trips.
|
|
197
|
+
*/
|
|
198
|
+
trips?: TravelerTrip[];
|
|
199
|
+
/**
|
|
200
|
+
* How many trips the traveler is on.
|
|
201
|
+
*/
|
|
202
|
+
tripsCount: number;
|
|
203
|
+
/**
|
|
204
|
+
* When the traveler last changed, ISO 8601 in UTC.
|
|
205
|
+
*/
|
|
206
|
+
updatedAt: string;
|
|
207
|
+
/**
|
|
208
|
+
* The traveler's Nicer account, once they have one and it is linked; null
|
|
209
|
+
* otherwise.
|
|
210
|
+
*/
|
|
211
|
+
userId: string | null;
|
|
212
|
+
/**
|
|
213
|
+
* Which of the agency's advisors see the traveler.
|
|
214
|
+
*/
|
|
215
|
+
visibility: TravelerVisibility;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* A new traveler. Only the legal name is required; every other section can be
|
|
219
|
+
* filled later.
|
|
220
|
+
*/
|
|
221
|
+
export interface TravelerCreate {
|
|
222
|
+
/**
|
|
223
|
+
* The traveler's postal address; null or absent leaves none.
|
|
224
|
+
*/
|
|
225
|
+
address?: PersonAddress | null;
|
|
226
|
+
/**
|
|
227
|
+
* Admins only: the user id of the advisor responsible for the traveler. An
|
|
228
|
+
* advisor's new traveler is always their own.
|
|
229
|
+
*/
|
|
230
|
+
assignedAdvisorUserId?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Date of birth, YYYY-MM-DD.
|
|
233
|
+
*/
|
|
234
|
+
birthDate?: string | null;
|
|
235
|
+
/**
|
|
236
|
+
* The traveler's email and phone, the phone in E.164.
|
|
237
|
+
*/
|
|
238
|
+
contact?: PersonContact;
|
|
239
|
+
/**
|
|
240
|
+
* Values of the agency's own custom fields, by key; each key must be a field
|
|
241
|
+
* the agency defined.
|
|
242
|
+
*/
|
|
243
|
+
customFields?: {
|
|
244
|
+
[key: string]: CustomFieldValue;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Up to 8 airline loyalty memberships.
|
|
248
|
+
*/
|
|
249
|
+
frequentFlyerPrograms?: FrequentFlyerProgram[];
|
|
250
|
+
/**
|
|
251
|
+
* Whether the traveler agreed to marketing messages, per channel; absent
|
|
252
|
+
* means none.
|
|
253
|
+
*/
|
|
254
|
+
marketingConsent?: MarketingConsent;
|
|
255
|
+
/**
|
|
256
|
+
* The legal name, as printed on the travel document. The one required field.
|
|
257
|
+
*/
|
|
258
|
+
name: PersonName;
|
|
259
|
+
/**
|
|
260
|
+
* Nationality, as an ISO 3166-1 alpha-2 country code.
|
|
261
|
+
*/
|
|
262
|
+
nationalityCountryCode?: CountryCode | null;
|
|
263
|
+
/**
|
|
264
|
+
* How the traveler prefers to be contacted.
|
|
265
|
+
*/
|
|
266
|
+
preferredChannel?: PreferredChannel | null;
|
|
267
|
+
/**
|
|
268
|
+
* The language to write to the traveler in, e.g. es or en-US.
|
|
269
|
+
*/
|
|
270
|
+
preferredLanguage?: LanguageTag | null;
|
|
271
|
+
/**
|
|
272
|
+
* The name the traveler goes by when it is not their given name, 1 to 100
|
|
273
|
+
* characters.
|
|
274
|
+
*/
|
|
275
|
+
preferredName?: string | null;
|
|
276
|
+
/**
|
|
277
|
+
* The traveler of the agency who referred this one.
|
|
278
|
+
*/
|
|
279
|
+
referredByTravelerId?: TravelerId | null;
|
|
280
|
+
/**
|
|
281
|
+
* Country of residence, as an ISO 3166-1 alpha-2 country code.
|
|
282
|
+
*/
|
|
283
|
+
residenceCountryCode?: CountryCode | null;
|
|
284
|
+
/**
|
|
285
|
+
* The sex marker on the travel document.
|
|
286
|
+
*/
|
|
287
|
+
sex?: ParticipantSex | null;
|
|
288
|
+
/**
|
|
289
|
+
* LEAD when absent, or CLIENT.
|
|
290
|
+
*/
|
|
291
|
+
stage?: TravelerStage;
|
|
292
|
+
/**
|
|
293
|
+
* Up to 20 labels, each 1 to 40 characters.
|
|
294
|
+
*/
|
|
295
|
+
tags?: TravelerTag[];
|
|
296
|
+
/**
|
|
297
|
+
* Which of the agency's advisors see the traveler; the agency's default when
|
|
298
|
+
* absent.
|
|
299
|
+
*/
|
|
300
|
+
visibility?: TravelerVisibility;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Another traveler of the agency who may be the same person: HIGH for the same
|
|
304
|
+
* email, MEDIUM for the same phone or the same name and birth date.
|
|
305
|
+
*/
|
|
306
|
+
export interface TravelerDuplicate {
|
|
307
|
+
/**
|
|
308
|
+
* HIGH for the same email, MEDIUM for the same phone or the same name and
|
|
309
|
+
* birth date.
|
|
310
|
+
*/
|
|
311
|
+
confidence: DuplicateConfidence;
|
|
312
|
+
/**
|
|
313
|
+
* The other traveler's display name.
|
|
314
|
+
*/
|
|
315
|
+
displayName: string;
|
|
316
|
+
/**
|
|
317
|
+
* What the two travelers share.
|
|
318
|
+
*/
|
|
319
|
+
reason: DuplicateReason;
|
|
320
|
+
/**
|
|
321
|
+
* The other traveler's id: merge the two with POST
|
|
322
|
+
* /crm/travelers/{travelerId}/merge.
|
|
323
|
+
*/
|
|
324
|
+
travelerId: TravelerId;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Up to 200 travelers to add. A row whose email or phone matches a traveler of
|
|
328
|
+
* the agency is matched, not duplicated.
|
|
329
|
+
*/
|
|
330
|
+
export interface TravelerImport {
|
|
331
|
+
rows: TravelerCreate[];
|
|
332
|
+
}
|
|
333
|
+
export interface TravelerImportResult {
|
|
334
|
+
results: {
|
|
335
|
+
errorCode: string | null;
|
|
336
|
+
index: number;
|
|
337
|
+
outcome: "CREATED" | "FAILED" | "MATCHED";
|
|
338
|
+
travelerId: TravelerId | null;
|
|
339
|
+
}[];
|
|
340
|
+
}
|
|
341
|
+
export interface TravelerInvitation {
|
|
342
|
+
channel: "EMAIL" | "SMS";
|
|
343
|
+
expiresAt: string | null;
|
|
344
|
+
kind: "ACCOUNT" | "PROFILE_FORM";
|
|
345
|
+
profileFormToken: string | null;
|
|
346
|
+
/**
|
|
347
|
+
* The traveler's id in the CRM, e.g. TRV01JD4Q9W0Y5X3M2K8B7N6P4R1T.
|
|
348
|
+
*/
|
|
349
|
+
travelerId: TravelerId;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* ACCOUNT invites the traveler to create a Nicer account; PROFILE_FORM sends a
|
|
353
|
+
* link to fill their profile without one.
|
|
354
|
+
*/
|
|
355
|
+
export interface TravelerInvitationCreate {
|
|
356
|
+
channel: "EMAIL" | "SMS";
|
|
357
|
+
kind: "ACCOUNT" | "PROFILE_FORM";
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* One page of travelers, each with its own fields only (a list takes no
|
|
361
|
+
* expand), the token of the next page, and how many travelers the whole list
|
|
362
|
+
* holds.
|
|
363
|
+
*/
|
|
364
|
+
export interface TravelerList {
|
|
365
|
+
/**
|
|
366
|
+
* The items of this page.
|
|
367
|
+
*/
|
|
368
|
+
items: Traveler[];
|
|
369
|
+
/**
|
|
370
|
+
* Send it back as nextToken to read the next page; null on the last page.
|
|
371
|
+
*/
|
|
372
|
+
nextToken: string | null;
|
|
373
|
+
/**
|
|
374
|
+
* How many travelers the whole list holds across its pages; null for a search
|
|
375
|
+
* or a segment with dates.
|
|
376
|
+
*/
|
|
377
|
+
total: number | null;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* The traveler to merge into this one. This traveler keeps its values, fills
|
|
381
|
+
* its empty fields from the duplicate and takes its documents, notes, tasks,
|
|
382
|
+
* relationships and trips; the duplicate is removed.
|
|
383
|
+
*/
|
|
384
|
+
export interface TravelerMerge {
|
|
385
|
+
/**
|
|
386
|
+
* The traveler's id in the CRM, e.g. TRV01JD4Q9W0Y5X3M2K8B7N6P4R1T.
|
|
387
|
+
*/
|
|
388
|
+
duplicateTravelerId: TravelerId;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* How the traveler entered the CRM.
|
|
392
|
+
*/
|
|
393
|
+
export type TravelerOrigin = "BACKFILL" | "CHECKOUT" | "IMPORT" | "INVITE" | "MANUAL" | "REFERRAL" | "SIGNUP" | "TRIP";
|
|
394
|
+
/**
|
|
395
|
+
* Another traveler of the agency this one is related to, and who they are to
|
|
396
|
+
* this one.
|
|
397
|
+
*/
|
|
398
|
+
export interface TravelerRelationship {
|
|
399
|
+
/**
|
|
400
|
+
* The related traveler's display name.
|
|
401
|
+
*/
|
|
402
|
+
displayName: string;
|
|
403
|
+
/**
|
|
404
|
+
* The related traveler's id.
|
|
405
|
+
*/
|
|
406
|
+
relatedTravelerId: TravelerId;
|
|
407
|
+
/**
|
|
408
|
+
* Who the related traveler is to this one.
|
|
409
|
+
*/
|
|
410
|
+
relationship: TravelerRelationshipKind;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* A relationship to another traveler of the agency. It is written on both
|
|
414
|
+
* travelers, the other one with the inverse kind.
|
|
415
|
+
*/
|
|
416
|
+
export interface TravelerRelationshipInput {
|
|
417
|
+
/**
|
|
418
|
+
* The related traveler: one of the agency's, never this traveler.
|
|
419
|
+
*/
|
|
420
|
+
relatedTravelerId: TravelerId;
|
|
421
|
+
/**
|
|
422
|
+
* Who the related traveler is to this one; the other traveler gets the
|
|
423
|
+
* inverse.
|
|
424
|
+
*/
|
|
425
|
+
relationship: TravelerRelationshipKind;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* A trip the traveler is on: its id, name, dates, sales stage and the
|
|
429
|
+
* traveler's part on it.
|
|
430
|
+
*/
|
|
431
|
+
export interface TravelerTrip {
|
|
432
|
+
/**
|
|
433
|
+
* The traveler's part on the trip.
|
|
434
|
+
*/
|
|
435
|
+
relationship: TravelersTripRelationship;
|
|
436
|
+
/**
|
|
437
|
+
* Where the trip stands as a sale; null when it has no stage.
|
|
438
|
+
*/
|
|
439
|
+
salesStage: SalesStage | null;
|
|
440
|
+
/**
|
|
441
|
+
* The trip's id, e.g. TT….
|
|
442
|
+
*/
|
|
443
|
+
travelersTripId: string;
|
|
444
|
+
/**
|
|
445
|
+
* The trip's last day, YYYY-MM-DD; null while it has no dates.
|
|
446
|
+
*/
|
|
447
|
+
tripEndDate: string | null;
|
|
448
|
+
/**
|
|
449
|
+
* The trip's name; null when it has none.
|
|
450
|
+
*/
|
|
451
|
+
tripName: string | null;
|
|
452
|
+
/**
|
|
453
|
+
* The trip's first day, YYYY-MM-DD; null while it has no dates.
|
|
454
|
+
*/
|
|
455
|
+
tripStartDate: string | null;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Sections of a traveler to replace, with the revision you read. An omitted
|
|
459
|
+
* section is kept and null clears it.
|
|
460
|
+
*/
|
|
461
|
+
export interface TravelerUpdate {
|
|
462
|
+
/**
|
|
463
|
+
* The postal address; null clears it.
|
|
464
|
+
*/
|
|
465
|
+
address?: PersonAddress | null;
|
|
466
|
+
/**
|
|
467
|
+
* Admins only: the user id of the advisor responsible for the traveler; null
|
|
468
|
+
* leaves nobody assigned. The assigned advisor also serves the traveler.
|
|
469
|
+
*/
|
|
470
|
+
assignedAdvisorUserId?: string | null;
|
|
471
|
+
/**
|
|
472
|
+
* Date of birth, YYYY-MM-DD; null clears it.
|
|
473
|
+
*/
|
|
474
|
+
birthDate?: string | null;
|
|
475
|
+
/**
|
|
476
|
+
* The email and phone, both replaced; the phone in E.164.
|
|
477
|
+
*/
|
|
478
|
+
contact?: PersonContact;
|
|
479
|
+
/**
|
|
480
|
+
* Admins only: the user ids of every advisor who serves the traveler, at most
|
|
481
|
+
* 10. The assigned advisor is always kept in the list.
|
|
482
|
+
*/
|
|
483
|
+
contributingAdvisorIds?: string[];
|
|
484
|
+
/**
|
|
485
|
+
* Values of the agency's own custom fields, by key; a key set to null clears
|
|
486
|
+
* that field.
|
|
487
|
+
*/
|
|
488
|
+
customFields?: {
|
|
489
|
+
[key: string]: CustomFieldValue;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* Every travel document the traveler keeps, at most 12: a stored document
|
|
493
|
+
* left out is removed, one sent with its documentId is replaced, and one
|
|
494
|
+
* without is added. Absent leaves the documents as they are.
|
|
495
|
+
*/
|
|
496
|
+
documents?: TravelerDocumentInput[];
|
|
497
|
+
/**
|
|
498
|
+
* Every airline loyalty membership to keep, at most 8.
|
|
499
|
+
*/
|
|
500
|
+
frequentFlyerPrograms?: FrequentFlyerProgram[];
|
|
501
|
+
/**
|
|
502
|
+
* Every important date to keep, at most 20: a stored date left out is
|
|
503
|
+
* removed, one sent with its dateId is replaced, and one without is added.
|
|
504
|
+
*/
|
|
505
|
+
importantDates?: ImportantDateInput[];
|
|
506
|
+
/**
|
|
507
|
+
* true takes the traveler out of the lists and searches without erasing them;
|
|
508
|
+
* false brings them back.
|
|
509
|
+
*/
|
|
510
|
+
isArchived?: boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Whether the traveler agreed to marketing messages, per channel.
|
|
513
|
+
*/
|
|
514
|
+
marketingConsent?: MarketingConsent;
|
|
515
|
+
/**
|
|
516
|
+
* The legal name, as printed on the travel document.
|
|
517
|
+
*/
|
|
518
|
+
name?: PersonName;
|
|
519
|
+
/**
|
|
520
|
+
* Nationality, as an ISO 3166-1 alpha-2 country code; null clears it.
|
|
521
|
+
*/
|
|
522
|
+
nationalityCountryCode?: CountryCode | null;
|
|
523
|
+
/**
|
|
524
|
+
* How the traveler prefers to be contacted; null clears it.
|
|
525
|
+
*/
|
|
526
|
+
preferredChannel?: PreferredChannel | null;
|
|
527
|
+
/**
|
|
528
|
+
* The language to write to the traveler in, e.g. es or en-US; null clears it.
|
|
529
|
+
*/
|
|
530
|
+
preferredLanguage?: LanguageTag | null;
|
|
531
|
+
/**
|
|
532
|
+
* The name the traveler goes by, 1 to 100 characters; null clears it.
|
|
533
|
+
*/
|
|
534
|
+
preferredName?: string | null;
|
|
535
|
+
/**
|
|
536
|
+
* Sections of the travel profile to replace: a section left out is kept and
|
|
537
|
+
* null clears it.
|
|
538
|
+
*/
|
|
539
|
+
profile?: TravelProfileUpdate;
|
|
540
|
+
/**
|
|
541
|
+
* The traveler of the agency who referred this one, never the traveler
|
|
542
|
+
* itself; null clears it.
|
|
543
|
+
*/
|
|
544
|
+
referredByTravelerId?: TravelerId | null;
|
|
545
|
+
/**
|
|
546
|
+
* Every relationship to keep, at most 20, written on both travelers: one left
|
|
547
|
+
* out is removed from both.
|
|
548
|
+
*/
|
|
549
|
+
relationships?: TravelerRelationshipInput[];
|
|
550
|
+
/**
|
|
551
|
+
* Country of residence, as an ISO 3166-1 alpha-2 country code; null clears
|
|
552
|
+
* it.
|
|
553
|
+
*/
|
|
554
|
+
residenceCountryCode?: CountryCode | null;
|
|
555
|
+
/**
|
|
556
|
+
* The revision you read. A traveler changed since answers 409
|
|
557
|
+
* CRM_REVISION_CONFLICT: read it again and reapply.
|
|
558
|
+
*/
|
|
559
|
+
revision: number;
|
|
560
|
+
/**
|
|
561
|
+
* The sex marker on the travel document; null clears it.
|
|
562
|
+
*/
|
|
563
|
+
sex?: ParticipantSex | null;
|
|
564
|
+
/**
|
|
565
|
+
* LEAD or CLIENT.
|
|
566
|
+
*/
|
|
567
|
+
stage?: TravelerStage;
|
|
568
|
+
/**
|
|
569
|
+
* Every label to keep, at most 20, each 1 to 40 characters.
|
|
570
|
+
*/
|
|
571
|
+
tags?: TravelerTag[];
|
|
572
|
+
/**
|
|
573
|
+
* Which of the agency's advisors see the traveler.
|
|
574
|
+
*/
|
|
575
|
+
visibility?: TravelerVisibility;
|
|
576
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withnicer/sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "The Nicer API for TypeScript and JavaScript, generated by Cloudflare Forge from Nicer's public OpenAPI document.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/withnicer/sdk-js.git"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./_": null,
|
|
22
|
+
"./_/*": null,
|
|
23
|
+
"./*": {
|
|
24
|
+
"types": "./dist/*/index.d.ts",
|
|
25
|
+
"default": "./dist/*/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"openapi": "curl -fsS --proto =https --max-redirs 0 --max-filesize 33554432 -o openapi.json \"$OPENAPI_URL\"",
|
|
33
|
+
"hash": "bun scripts/release.ts hash",
|
|
34
|
+
"generate": "rm -rf src && bun scripts/prepare.ts && forge generate openapi.sdk.json --target ts --out src && bun scripts/release.ts record",
|
|
35
|
+
"check-types": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"build": "rm -rf dist && tsc -p tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@cloudflare/forge": "0.3.0",
|
|
40
|
+
"typescript": "7.0.2"
|
|
41
|
+
},
|
|
42
|
+
"packageManager": "bun@1.3.14",
|
|
43
|
+
"nicer": {
|
|
44
|
+
"openapi": {
|
|
45
|
+
"release": "1.0.0",
|
|
46
|
+
"sha256": "58989aef910eaa24bad444ddfb7d1c688d636d454b29d468ede9e1df787a33aa"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|