@withnicer/sdk 0.0.0 → 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.
Files changed (80) hide show
  1. package/README.md +89 -4
  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/activity/client.d.ts +42 -0
  13. package/dist/activity/client.js +18 -0
  14. package/dist/activity/index.d.ts +5 -0
  15. package/dist/activity/index.js +4 -0
  16. package/dist/activity/models.d.ts +65 -0
  17. package/dist/activity/models.js +3 -0
  18. package/dist/client.d.ts +1680 -0
  19. package/dist/client.js +748 -0
  20. package/dist/crmSettings/client.d.ts +50 -0
  21. package/dist/crmSettings/client.js +25 -0
  22. package/dist/crmSettings/index.d.ts +5 -0
  23. package/dist/crmSettings/index.js +4 -0
  24. package/dist/crmSettings/models.d.ts +313 -0
  25. package/dist/crmSettings/models.js +3 -0
  26. package/dist/crmTrips/client.d.ts +100 -0
  27. package/dist/crmTrips/client.js +38 -0
  28. package/dist/crmTrips/index.d.ts +5 -0
  29. package/dist/crmTrips/index.js +4 -0
  30. package/dist/crmTrips/models.d.ts +193 -0
  31. package/dist/crmTrips/models.js +3 -0
  32. package/dist/crmTrips/travelers/client.d.ts +33 -0
  33. package/dist/crmTrips/travelers/client.js +18 -0
  34. package/dist/crmTrips/travelers/index.d.ts +5 -0
  35. package/dist/crmTrips/travelers/index.js +4 -0
  36. package/dist/crmTrips/travelers/models.d.ts +14 -0
  37. package/dist/crmTrips/travelers/models.js +3 -0
  38. package/dist/index.d.ts +5 -0
  39. package/dist/index.js +4 -0
  40. package/dist/me/client.d.ts +56 -0
  41. package/dist/me/client.js +25 -0
  42. package/dist/me/index.d.ts +5 -0
  43. package/dist/me/index.js +4 -0
  44. package/dist/me/models.d.ts +95 -0
  45. package/dist/me/models.js +3 -0
  46. package/dist/models.d.ts +9269 -0
  47. package/dist/models.js +4 -0
  48. package/dist/notes/client.d.ts +82 -0
  49. package/dist/notes/client.js +41 -0
  50. package/dist/notes/index.d.ts +5 -0
  51. package/dist/notes/index.js +4 -0
  52. package/dist/notes/models.d.ts +116 -0
  53. package/dist/notes/models.js +3 -0
  54. package/dist/options/index.d.ts +52 -0
  55. package/dist/options/index.js +53 -0
  56. package/dist/profileForms/client.d.ts +38 -0
  57. package/dist/profileForms/client.js +25 -0
  58. package/dist/profileForms/index.d.ts +5 -0
  59. package/dist/profileForms/index.js +4 -0
  60. package/dist/profileForms/models.d.ts +24 -0
  61. package/dist/profileForms/models.js +3 -0
  62. package/dist/taskTemplates/client.d.ts +36 -0
  63. package/dist/taskTemplates/client.js +18 -0
  64. package/dist/taskTemplates/index.d.ts +5 -0
  65. package/dist/taskTemplates/index.js +4 -0
  66. package/dist/taskTemplates/models.d.ts +15 -0
  67. package/dist/taskTemplates/models.js +3 -0
  68. package/dist/tasks/client.d.ts +105 -0
  69. package/dist/tasks/client.js +41 -0
  70. package/dist/tasks/index.d.ts +5 -0
  71. package/dist/tasks/index.js +4 -0
  72. package/dist/tasks/models.d.ts +59 -0
  73. package/dist/tasks/models.js +3 -0
  74. package/dist/travelers/client.d.ts +214 -0
  75. package/dist/travelers/client.js +76 -0
  76. package/dist/travelers/index.d.ts +5 -0
  77. package/dist/travelers/index.js +4 -0
  78. package/dist/travelers/models.d.ts +576 -0
  79. package/dist/travelers/models.js +3 -0
  80. package/package.json +35 -2
@@ -0,0 +1,105 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
2
+ import type { Deleted, Task, TaskList, TravelerId } from "../models.js";
3
+ import type { TaskCreate, TaskUpdate } 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 task
13
+ *
14
+ * Adds one task about one traveler (travelerId) or one trip
15
+ * (travelersTripId), assigned to the caller unless assignedUserId says
16
+ * otherwise, and publishes crm.task-changed.v1 with action CREATED. Answers
17
+ * the task, named after what it is about (travelerName, or tripName with
18
+ * associatedTripItineraryId). To add the tasks of one of the agency's task
19
+ * templates to a trip, apply the template instead (POST
20
+ * /crm/task-templates/{templateId}/apply). Requires an Idempotency-Key
21
+ * header: a retry with the same key and body answers the same task. Errors:
22
+ * 400 ERROR_BODY_VALIDATION, 404 ERROR_ITEM_NOT_FOUND for a traveler or trip
23
+ * the caller may not write about, 409 CRM_IDEMPOTENCY_CONFLICT for a key used
24
+ * with another body.
25
+ */
26
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
27
+ /**
28
+ * Delete a task
29
+ *
30
+ * Deletes a task for good, taking it off its assignee's list and its day's
31
+ * reminders, and publishes crm.task-changed.v1 with action DELETED. Answers
32
+ * the task's id with deleted set to true; deleting it again answers 404. To
33
+ * close a task that was done, mark it completed with PUT /crm/tasks/{taskId}
34
+ * instead. Errors: 404 ERROR_ITEM_NOT_FOUND for a task there is not, or about
35
+ * a traveler or trip the caller may not see.
36
+ */
37
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
38
+ /**
39
+ * List tasks
40
+ *
41
+ * Lists open tasks of exactly one of: the caller (assignedUserId=me), another
42
+ * person (their user id, for an admin), one traveler (travelerId) or one trip
43
+ * (travelersTripId). completed=true lists the done ones instead. 50 a page
44
+ * unless limit says otherwise, each page soonest first and the undated last;
45
+ * send the answer's nextToken back to read the next page, until it is null.
46
+ * Each task names what it is about: travelerName, or tripName with the trip's
47
+ * associatedTripItineraryId. Errors: 400 ERROR_INVALID_QUERY for none or more
48
+ * than one of assignedUserId, travelerId and travelersTripId, a value out of
49
+ * range or a nextToken of another list; 403 ERROR_UNAUTHORIZED for another
50
+ * person's tasks unless the caller is an admin; 404 ERROR_ITEM_NOT_FOUND for
51
+ * a traveler or trip the caller may not see.
52
+ */
53
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
54
+ /**
55
+ * Update a task
56
+ *
57
+ * Changes a task: its title, notes, date or assignee, or marks it done.
58
+ * Errors: 400 ERROR_BODY_VALIDATION, 404 ERROR_ITEM_NOT_FOUND.
59
+ */
60
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
61
+ }
62
+ export declare function createClient(options: ClientOptions): Client;
63
+ export declare function bind(transport: Transport): Client;
64
+ export type CreateRequest = TaskCreate;
65
+ export type CreateResponse = Task;
66
+ export interface DeleteRequest {
67
+ taskId: string;
68
+ }
69
+ export type DeleteResponse = Deleted;
70
+ export interface ListRequest {
71
+ /**
72
+ * A person's tasks: their user id, or me for yours. Send exactly one of
73
+ * assignedUserId, travelerId and travelersTripId.
74
+ */
75
+ assignedUserId?: string;
76
+ /**
77
+ * true lists the done tasks instead of the open ones; false, or left out, the
78
+ * open ones.
79
+ */
80
+ completed?: string;
81
+ /**
82
+ * How many tasks a page holds, 1 to 100; 50 when left out.
83
+ */
84
+ limit?: number;
85
+ /**
86
+ * The nextToken of the page before, to read the next one; left out for the
87
+ * first page.
88
+ */
89
+ nextToken?: string;
90
+ /**
91
+ * A traveler's tasks (TRV…). Send exactly one of assignedUserId, travelerId
92
+ * and travelersTripId.
93
+ */
94
+ travelerId?: TravelerId;
95
+ /**
96
+ * A trip's tasks (TT…). Send exactly one of assignedUserId, travelerId and
97
+ * travelersTripId.
98
+ */
99
+ travelersTripId?: string;
100
+ }
101
+ export type ListResponse = TaskList;
102
+ export type UpdateRequest = {
103
+ taskId: string;
104
+ } & TaskUpdate;
105
+ export type UpdateResponse = Task;
@@ -0,0 +1,41 @@
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
+ list: (request, options) => transport.send(ListOperation, request, options),
12
+ update: (request, options) => transport.send(UpdateOperation, request, options),
13
+ };
14
+ }
15
+ const CreateOperation = {
16
+ method: "POST",
17
+ route: "/crm/tasks",
18
+ body: "flat",
19
+ response: null,
20
+ errors: { "400": true, "401": true, "403": true },
21
+ };
22
+ const DeleteOperation = {
23
+ method: "DELETE",
24
+ route: "/crm/tasks/{taskId}",
25
+ response: null,
26
+ errors: { "400": true, "401": true, "403": true },
27
+ };
28
+ const ListOperation = {
29
+ method: "GET",
30
+ route: "/crm/tasks",
31
+ query: { assignedUserId: "assignedUserId", completed: "completed", limit: "limit", nextToken: "nextToken", travelerId: "travelerId", travelersTripId: "travelersTripId" },
32
+ response: null,
33
+ errors: { "400": true, "401": true, "403": true },
34
+ };
35
+ const UpdateOperation = {
36
+ method: "PUT",
37
+ route: "/crm/tasks/{taskId}",
38
+ body: "flat",
39
+ response: null,
40
+ errors: { "400": true, "401": true, "403": true },
41
+ };
@@ -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, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
+ export type { TaskCreate, TaskUpdate, } 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,59 @@
1
+ import type { TravelerId } from "../models.js";
2
+ /**
3
+ * A new task about one traveler or one trip.
4
+ */
5
+ export interface TaskCreate {
6
+ /**
7
+ * The user id of the advisor or admin who should do it; null assigns nobody.
8
+ * The caller when left out.
9
+ */
10
+ assignedUserId?: string | null;
11
+ /**
12
+ * More about it, 1 to 2,000 characters once trimmed.
13
+ */
14
+ notes?: string | null;
15
+ /**
16
+ * When it should be done, as YYYY-MM-DD.
17
+ */
18
+ tentativeDate?: string | null;
19
+ /**
20
+ * What to do, in a few words: 1 to 255 characters once trimmed.
21
+ */
22
+ title: string;
23
+ /**
24
+ * The traveler (TRV…) the task is about. Required unless travelersTripId is
25
+ * sent; never both.
26
+ */
27
+ travelerId?: TravelerId;
28
+ /**
29
+ * The trip (TT…) the task is about. Required unless travelerId is sent; never
30
+ * both.
31
+ */
32
+ travelersTripId?: string;
33
+ }
34
+ /**
35
+ * A change to a task: send at least one field; the ones left out keep their
36
+ * values.
37
+ */
38
+ export interface TaskUpdate {
39
+ /**
40
+ * The user id of the advisor or admin who should do it; null assigns nobody.
41
+ */
42
+ assignedUserId?: string | null;
43
+ /**
44
+ * True marks the task done, false reopens it.
45
+ */
46
+ completed?: boolean;
47
+ /**
48
+ * More about it, 1 to 2,000 characters once trimmed; null clears it.
49
+ */
50
+ notes?: string | null;
51
+ /**
52
+ * When it should be done, as YYYY-MM-DD; null leaves it undated.
53
+ */
54
+ tentativeDate?: string | null;
55
+ /**
56
+ * What to do, in a few words: 1 to 255 characters once trimmed.
57
+ */
58
+ title?: string;
59
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -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";