@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.
- package/README.md +89 -3
- 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/activities/client.d.ts +35 -0
- package/dist/activities/client.js +23 -0
- package/dist/activities/index.d.ts +5 -0
- package/dist/activities/index.js +4 -0
- package/dist/activities/models.d.ts +27 -0
- package/dist/activities/models.js +3 -0
- package/dist/activityDestinations/client.d.ts +24 -0
- package/dist/activityDestinations/client.js +17 -0
- package/dist/activityDestinations/index.d.ts +4 -0
- package/dist/activityDestinations/index.js +4 -0
- package/dist/balances/client.d.ts +29 -0
- package/dist/balances/client.js +18 -0
- package/dist/balances/index.d.ts +5 -0
- package/dist/balances/index.js +4 -0
- package/dist/balances/models.d.ts +12 -0
- package/dist/balances/models.js +3 -0
- package/dist/bookingSelections/client.d.ts +54 -0
- package/dist/bookingSelections/client.js +25 -0
- package/dist/bookingSelections/index.d.ts +5 -0
- package/dist/bookingSelections/index.js +4 -0
- package/dist/bookingSelections/models.d.ts +35 -0
- package/dist/bookingSelections/models.js +3 -0
- package/dist/carRentals/client.d.ts +55 -0
- package/dist/carRentals/client.js +25 -0
- package/dist/carRentals/index.d.ts +5 -0
- package/dist/carRentals/index.js +4 -0
- package/dist/carRentals/models.d.ts +157 -0
- package/dist/carRentals/models.js +3 -0
- package/dist/carriers/client.d.ts +32 -0
- package/dist/carriers/client.js +18 -0
- package/dist/carriers/index.d.ts +5 -0
- package/dist/carriers/index.js +4 -0
- package/dist/carriers/models.d.ts +9 -0
- package/dist/carriers/models.js +3 -0
- package/dist/chats/client.d.ts +69 -0
- package/dist/chats/client.js +38 -0
- package/dist/chats/index.d.ts +5 -0
- package/dist/chats/index.js +4 -0
- package/dist/chats/models.d.ts +25 -0
- package/dist/chats/models.js +3 -0
- package/dist/checkouts/client.d.ts +27 -0
- package/dist/checkouts/client.js +18 -0
- package/dist/checkouts/index.d.ts +5 -0
- package/dist/checkouts/index.js +4 -0
- package/dist/checkouts/models.d.ts +23 -0
- package/dist/checkouts/models.js +3 -0
- package/dist/client.d.ts +95 -0
- package/dist/client.js +220 -0
- package/dist/commissionExports/client.d.ts +62 -0
- package/dist/commissionExports/client.js +33 -0
- package/dist/commissionExports/index.d.ts +5 -0
- package/dist/commissionExports/index.js +4 -0
- package/dist/commissionExports/models.d.ts +165 -0
- package/dist/commissionExports/models.js +3 -0
- package/dist/commissionImports/client.d.ts +61 -0
- package/dist/commissionImports/client.js +34 -0
- package/dist/commissionImports/index.d.ts +5 -0
- package/dist/commissionImports/index.js +4 -0
- package/dist/commissionImports/models.d.ts +118 -0
- package/dist/commissionImports/models.js +3 -0
- package/dist/commissionItems/client.d.ts +128 -0
- package/dist/commissionItems/client.js +41 -0
- package/dist/commissionItems/index.d.ts +5 -0
- package/dist/commissionItems/index.js +4 -0
- package/dist/commissionItems/models.d.ts +217 -0
- package/dist/commissionItems/models.js +3 -0
- package/dist/commissionReports/client.d.ts +76 -0
- package/dist/commissionReports/client.js +18 -0
- package/dist/commissionReports/index.d.ts +5 -0
- package/dist/commissionReports/index.js +4 -0
- package/dist/commissionReports/models.d.ts +208 -0
- package/dist/commissionReports/models.js +3 -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/earnings/client.d.ts +30 -0
- package/dist/earnings/client.js +18 -0
- package/dist/earnings/index.d.ts +5 -0
- package/dist/earnings/index.js +4 -0
- package/dist/earnings/models.d.ts +16 -0
- package/dist/earnings/models.js +3 -0
- package/dist/externalBookings/client.d.ts +56 -0
- package/dist/externalBookings/client.js +33 -0
- package/dist/externalBookings/index.d.ts +5 -0
- package/dist/externalBookings/index.js +4 -0
- package/dist/externalBookings/models.d.ts +93 -0
- package/dist/externalBookings/models.js +3 -0
- package/dist/externalPayments/client.d.ts +23 -0
- package/dist/externalPayments/client.js +18 -0
- package/dist/externalPayments/index.d.ts +5 -0
- package/dist/externalPayments/index.js +4 -0
- package/dist/externalPayments/models.d.ts +47 -0
- package/dist/externalPayments/models.js +3 -0
- package/dist/favorites/client.d.ts +87 -0
- package/dist/favorites/client.js +63 -0
- package/dist/favorites/index.d.ts +5 -0
- package/dist/favorites/index.js +4 -0
- package/dist/favorites/models.d.ts +79 -0
- package/dist/favorites/models.js +3 -0
- package/dist/flightSchedules/client.d.ts +29 -0
- package/dist/flightSchedules/client.js +18 -0
- package/dist/flightSchedules/index.d.ts +5 -0
- package/dist/flightSchedules/index.js +4 -0
- package/dist/flightSchedules/models.d.ts +25 -0
- package/dist/flightSchedules/models.js +3 -0
- package/dist/flights/client.d.ts +73 -0
- package/dist/flights/client.js +25 -0
- package/dist/flights/index.d.ts +5 -0
- package/dist/flights/index.js +4 -0
- package/dist/flights/models.d.ts +345 -0
- package/dist/flights/models.js +3 -0
- package/dist/hotels/client.d.ts +104 -0
- package/dist/hotels/client.js +26 -0
- package/dist/hotels/index.d.ts +5 -0
- package/dist/hotels/index.js +4 -0
- package/dist/hotels/models.d.ts +355 -0
- package/dist/hotels/models.js +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/insuranceQuotes/client.d.ts +27 -0
- package/dist/insuranceQuotes/client.js +18 -0
- package/dist/insuranceQuotes/index.d.ts +5 -0
- package/dist/insuranceQuotes/index.js +4 -0
- package/dist/insuranceQuotes/models.d.ts +76 -0
- package/dist/insuranceQuotes/models.js +3 -0
- package/dist/itineraries/client.d.ts +165 -0
- package/dist/itineraries/client.js +86 -0
- package/dist/itineraries/index.d.ts +5 -0
- package/dist/itineraries/index.js +4 -0
- package/dist/itineraries/models.d.ts +1619 -0
- package/dist/itineraries/models.js +4 -0
- package/dist/models.d.ts +1361 -0
- package/dist/models.js +3 -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/offers/client.d.ts +27 -0
- package/dist/offers/client.js +17 -0
- package/dist/offers/index.d.ts +5 -0
- package/dist/offers/index.js +4 -0
- package/dist/offers/models.d.ts +19 -0
- package/dist/offers/models.js +3 -0
- package/dist/options/index.d.ts +114 -0
- package/dist/options/index.js +115 -0
- package/dist/orders/client.d.ts +154 -0
- package/dist/orders/client.js +65 -0
- package/dist/orders/index.d.ts +5 -0
- package/dist/orders/index.js +4 -0
- package/dist/orders/models.d.ts +2510 -0
- package/dist/orders/models.js +3 -0
- package/dist/payees/client.d.ts +48 -0
- package/dist/payees/client.js +26 -0
- package/dist/payees/index.d.ts +5 -0
- package/dist/payees/index.js +4 -0
- package/dist/payees/models.d.ts +50 -0
- package/dist/payees/models.js +3 -0
- package/dist/paymentMethods/client.d.ts +24 -0
- package/dist/paymentMethods/client.js +18 -0
- package/dist/paymentMethods/index.d.ts +5 -0
- package/dist/paymentMethods/index.js +4 -0
- package/dist/paymentMethods/models.d.ts +60 -0
- package/dist/paymentMethods/models.js +3 -0
- package/dist/places/client.d.ts +61 -0
- package/dist/places/client.js +25 -0
- package/dist/places/index.d.ts +5 -0
- package/dist/places/index.js +4 -0
- package/dist/places/models.d.ts +51 -0
- package/dist/places/models.js +3 -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/quotes/client.d.ts +30 -0
- package/dist/quotes/client.js +18 -0
- package/dist/quotes/index.d.ts +5 -0
- package/dist/quotes/index.js +4 -0
- package/dist/quotes/models.d.ts +47 -0
- package/dist/quotes/models.js +3 -0
- package/dist/remittanceBatches/client.d.ts +78 -0
- package/dist/remittanceBatches/client.js +42 -0
- package/dist/remittanceBatches/index.d.ts +5 -0
- package/dist/remittanceBatches/index.js +4 -0
- package/dist/remittanceBatches/models.d.ts +131 -0
- package/dist/remittanceBatches/models.js +3 -0
- package/dist/remittanceClaims/client.d.ts +27 -0
- package/dist/remittanceClaims/client.js +18 -0
- package/dist/remittanceClaims/index.d.ts +5 -0
- package/dist/remittanceClaims/index.js +4 -0
- package/dist/remittanceClaims/models.d.ts +5 -0
- package/dist/remittanceClaims/models.js +3 -0
- package/dist/remittanceLines/client.d.ts +27 -0
- package/dist/remittanceLines/client.js +18 -0
- package/dist/remittanceLines/index.d.ts +5 -0
- package/dist/remittanceLines/index.js +4 -0
- package/dist/remittanceLines/models.d.ts +5 -0
- package/dist/remittanceLines/models.js +3 -0
- package/dist/remittances/client.d.ts +78 -0
- package/dist/remittances/client.js +42 -0
- package/dist/remittances/index.d.ts +5 -0
- package/dist/remittances/index.js +4 -0
- package/dist/remittances/models.d.ts +116 -0
- package/dist/remittances/models.js +3 -0
- package/dist/statements/client.d.ts +75 -0
- package/dist/statements/client.js +34 -0
- package/dist/statements/index.d.ts +5 -0
- package/dist/statements/index.js +4 -0
- package/dist/statements/models.d.ts +147 -0
- package/dist/statements/models.js +3 -0
- package/dist/suppliers/client.d.ts +71 -0
- package/dist/suppliers/client.js +41 -0
- package/dist/suppliers/index.d.ts +5 -0
- package/dist/suppliers/index.js +4 -0
- package/dist/suppliers/models.d.ts +130 -0
- package/dist/suppliers/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/timeline/client.d.ts +42 -0
- package/dist/timeline/client.js +18 -0
- package/dist/timeline/index.d.ts +5 -0
- package/dist/timeline/index.js +4 -0
- package/dist/timeline/models.d.ts +65 -0
- package/dist/timeline/models.js +3 -0
- package/dist/travelProfile/client.d.ts +56 -0
- package/dist/travelProfile/client.js +25 -0
- package/dist/travelProfile/index.d.ts +5 -0
- package/dist/travelProfile/index.js +4 -0
- package/dist/travelProfile/models.d.ts +95 -0
- package/dist/travelProfile/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/dist/trips/client.d.ts +224 -0
- package/dist/trips/client.js +88 -0
- package/dist/trips/index.d.ts +5 -0
- package/dist/trips/index.js +4 -0
- package/dist/trips/models.d.ts +486 -0
- package/dist/trips/models.js +3 -0
- 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,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,42 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
|
|
2
|
+
import type { TravelerId } from "../models.js";
|
|
3
|
+
import type { ActivityList } 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
|
+
* List a traveler's timeline
|
|
13
|
+
*
|
|
14
|
+
* Returns what happened to one traveler (travelerId), newest first: changes
|
|
15
|
+
* in the CRM, notes and tasks, trips, bookings, payments, invitations, emails
|
|
16
|
+
* and itineraries sent. Each entry has its type, a one-line summary and the
|
|
17
|
+
* ids it is about in data, never the values that changed. 50 a page unless
|
|
18
|
+
* limit says otherwise; send the answer's nextToken back to read the next
|
|
19
|
+
* page, until it is null. Errors: 400 ERROR_INVALID_QUERY for a missing
|
|
20
|
+
* travelerId, a limit out of range or a nextToken of another list; 404
|
|
21
|
+
* ERROR_ITEM_NOT_FOUND for a traveler the caller may not see.
|
|
22
|
+
*/
|
|
23
|
+
list(request: ListRequest, options?: RequestOptions): Promise<ListResponse>;
|
|
24
|
+
}
|
|
25
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
26
|
+
export declare function bind(transport: Transport): Client;
|
|
27
|
+
export interface ListRequest {
|
|
28
|
+
/**
|
|
29
|
+
* How many entries a page holds, 1 to 100; 50 when left out.
|
|
30
|
+
*/
|
|
31
|
+
limit?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The nextToken of the page before, to read the next one; left out for the
|
|
34
|
+
* first page.
|
|
35
|
+
*/
|
|
36
|
+
nextToken?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The traveler (TRV…) whose timeline to list.
|
|
39
|
+
*/
|
|
40
|
+
travelerId: TravelerId;
|
|
41
|
+
}
|
|
42
|
+
export type ListResponse = ActivityList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport, } from "../_/index.js";
|
|
4
|
+
export function createClient(options) {
|
|
5
|
+
return bind(new Transport(options));
|
|
6
|
+
}
|
|
7
|
+
export function bind(transport) {
|
|
8
|
+
return {
|
|
9
|
+
list: (request, options) => transport.send(ListOperation, request, options),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const ListOperation = {
|
|
13
|
+
method: "GET",
|
|
14
|
+
route: "/crm/activity",
|
|
15
|
+
query: { limit: "limit", nextToken: "nextToken", travelerId: "travelerId" },
|
|
16
|
+
response: null,
|
|
17
|
+
errors: { "400": true, "401": true, "403": true },
|
|
18
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ApiError } from "../_/index.js";
|
|
2
|
+
export type { RequestOptions } from "../_/index.js";
|
|
3
|
+
export { createClient } from "./client.js";
|
|
4
|
+
export type { Client, ClientOptions, ListRequest, ListResponse, } from "./client.js";
|
|
5
|
+
export type { Activity, ActivityList, ActivityType, } from "./models.js";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { TravelerId } from "../models.js";
|
|
2
|
+
/**
|
|
3
|
+
* One entry of a traveler's timeline: an event of the CRM or of another domain,
|
|
4
|
+
* with ids and a readable summary.
|
|
5
|
+
*/
|
|
6
|
+
export interface Activity {
|
|
7
|
+
/**
|
|
8
|
+
* The event's id; the same entry is never recorded twice.
|
|
9
|
+
*/
|
|
10
|
+
activityId: string;
|
|
11
|
+
/**
|
|
12
|
+
* The user id of who did it; null for the system and other domains'
|
|
13
|
+
* automations.
|
|
14
|
+
*/
|
|
15
|
+
actorUserId: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Ids, section names and counts the entry is about, as the event of its type
|
|
18
|
+
* gives them.
|
|
19
|
+
*/
|
|
20
|
+
data: {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* When it happened.
|
|
25
|
+
*/
|
|
26
|
+
occurredAt: string;
|
|
27
|
+
/**
|
|
28
|
+
* One readable line, e.g. "Hotel booked" or "Passport updated".
|
|
29
|
+
*/
|
|
30
|
+
summary: string;
|
|
31
|
+
/**
|
|
32
|
+
* The traveler whose timeline holds the entry.
|
|
33
|
+
*/
|
|
34
|
+
travelerId: TravelerId | null;
|
|
35
|
+
/**
|
|
36
|
+
* The trip (TT…) the entry is about, when it is about one.
|
|
37
|
+
*/
|
|
38
|
+
travelersTripId: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The event the entry was written from.
|
|
41
|
+
*/
|
|
42
|
+
type: ActivityType;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One page of a traveler's timeline, newest first, and the token of the next
|
|
46
|
+
* page.
|
|
47
|
+
*/
|
|
48
|
+
export interface ActivityList {
|
|
49
|
+
/**
|
|
50
|
+
* The items of this page.
|
|
51
|
+
*/
|
|
52
|
+
items: Activity[];
|
|
53
|
+
/**
|
|
54
|
+
* Send it back as nextToken to read the next page; null on the last page.
|
|
55
|
+
*/
|
|
56
|
+
nextToken: string | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The event a timeline entry was written from: a trip created or joined
|
|
60
|
+
* (app.TravelersTrip.*), a proposal sent or approved (app.TripItinerary.*), an
|
|
61
|
+
* order, a booking confirmation or a payment (commerce.*), a change in the CRM
|
|
62
|
+
* (crm.*), or an email the agency sent the traveler
|
|
63
|
+
* (notifications.traveler-email-sent.v1).
|
|
64
|
+
*/
|
|
65
|
+
export type ActivityType = "app.TravelersTrip.created" | "app.TravelersTrip.user.added" | "app.TripItinerary.Send" | "app.TripItinerary.approved" | "commerce.order-confirmation-requested.v1" | "commerce.order-projection-changed.v1" | "commerce.payment-receipt-requested.v1" | "crm.note-changed.v1" | "crm.task-changed.v1" | "crm.traveler-advisors-changed.v1" | "crm.traveler-created.v1" | "crm.traveler-documents-changed.v1" | "crm.traveler-invitation-requested.v1" | "crm.traveler-linked.v1" | "crm.traveler-unlinked.v1" | "crm.traveler-updated.v1" | "crm.travelers-merged.v1" | "crm.trip-updated.v1" | "notifications.traveler-email-sent.v1";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../_/index.js";
|
|
2
|
+
import type { Me, MeUpdate } from "./models.js";
|
|
3
|
+
export interface ClientOptions extends BaseClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The URL the paths of the API are relative to.
|
|
6
|
+
*/
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Client {
|
|
10
|
+
/**
|
|
11
|
+
* Get my travel profile
|
|
12
|
+
*
|
|
13
|
+
* Returns the signed-in person's own traveler at the agency they act in, as
|
|
14
|
+
* they see and fill it; the family they may fill in for there; and the
|
|
15
|
+
* advisors who serve them at every agency, each with the name and photo of
|
|
16
|
+
* their Nicer account. The caller is a person signed in to Nicer, with their
|
|
17
|
+
* id token as Authorization: Bearer <token>. x-nicer-company names the
|
|
18
|
+
* agency; a person who belongs to one agency may leave it out. The answer
|
|
19
|
+
* holds only the caller's own records: traveler is null before they have one
|
|
20
|
+
* at that agency or when no agency is selected, family lists only the
|
|
21
|
+
* children, spouse or partner related to their traveler there who have no
|
|
22
|
+
* account of their own, and the traveler's documents come with their full
|
|
23
|
+
* numbers. A traveler without an account fills their profile through the
|
|
24
|
+
* profile form link an advisor sends instead. Errors: 401 when the token is
|
|
25
|
+
* missing or invalid, 403 ERROR_DO_NOT_HAVE_PERMISSION for an agency the
|
|
26
|
+
* caller does not belong to.
|
|
27
|
+
*/
|
|
28
|
+
get(request?: GetRequest, options?: RequestOptions): Promise<GetResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Update my travel profile
|
|
31
|
+
*
|
|
32
|
+
* Saves the signed-in person's own traveler at the agency they act in, adding
|
|
33
|
+
* it on the first change, and the travelers of the children, spouse or
|
|
34
|
+
* partner they fill in for there, then answers as GET /crm/me does. The
|
|
35
|
+
* caller is a person signed in to Nicer, with their id token as
|
|
36
|
+
* Authorization: Bearer <token>; x-nicer-company names the agency, and a
|
|
37
|
+
* person who belongs to one agency may leave it out. They may change only the
|
|
38
|
+
* sections of TravelerSelfUpdate: identity, contact, documents, important
|
|
39
|
+
* dates and preferences, never the agency's own fields. Send each traveler's
|
|
40
|
+
* revision; the change that adds their own traveler needs name instead. The
|
|
41
|
+
* traveler is saved first and then each family member in the order sent: a
|
|
42
|
+
* refusal stops there and keeps what was saved before it. Errors: 400
|
|
43
|
+
* ERROR_BODY_VALIDATION, 400 ERROR_COMPANY_REQUIRED without an agency, 401
|
|
44
|
+
* when the token is missing or invalid, 403 ERROR_DO_NOT_HAVE_PERMISSION for
|
|
45
|
+
* an agency the caller does not belong to, 404 ERROR_ITEM_NOT_FOUND for a
|
|
46
|
+
* family member they may not fill in for, 409 CRM_REVISION_CONFLICT.
|
|
47
|
+
*/
|
|
48
|
+
update(request?: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
|
|
49
|
+
}
|
|
50
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
51
|
+
export declare function bind(transport: Transport): Client;
|
|
52
|
+
export interface GetRequest {
|
|
53
|
+
}
|
|
54
|
+
export type GetResponse = Me;
|
|
55
|
+
export type UpdateRequest = MeUpdate;
|
|
56
|
+
export type UpdateResponse = Me;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport, } from "../_/index.js";
|
|
4
|
+
export function createClient(options) {
|
|
5
|
+
return bind(new Transport(options));
|
|
6
|
+
}
|
|
7
|
+
export function bind(transport) {
|
|
8
|
+
return {
|
|
9
|
+
get: (request, options) => transport.send(GetOperation, request, options),
|
|
10
|
+
update: (request, options) => transport.send(UpdateOperation, request, options),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const GetOperation = {
|
|
14
|
+
method: "GET",
|
|
15
|
+
route: "/crm/me",
|
|
16
|
+
response: null,
|
|
17
|
+
errors: { "400": true, "401": true, "403": true },
|
|
18
|
+
};
|
|
19
|
+
const UpdateOperation = {
|
|
20
|
+
method: "PUT",
|
|
21
|
+
route: "/crm/me",
|
|
22
|
+
body: "flat",
|
|
23
|
+
response: null,
|
|
24
|
+
errors: { "400": true, "401": true, "403": true },
|
|
25
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ApiError } from "../_/index.js";
|
|
2
|
+
export type { RequestOptions } from "../_/index.js";
|
|
3
|
+
export { createClient } from "./client.js";
|
|
4
|
+
export type { Client, ClientOptions, GetRequest, GetResponse, UpdateRequest, UpdateResponse, } from "./client.js";
|
|
5
|
+
export type { FamilyMember, FamilyMemberInput, Me, MeUpdate, MyAdvisor, } from "./models.js";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { TravelerId, TravelerRelationshipKind, TravelerSelf, TravelerSelfUpdate } from "../models.js";
|
|
2
|
+
/**
|
|
3
|
+
* A traveler the person may fill in for: their child, spouse or partner at the
|
|
4
|
+
* agency, who has no Nicer account of their own.
|
|
5
|
+
*/
|
|
6
|
+
export interface FamilyMember {
|
|
7
|
+
/**
|
|
8
|
+
* What the family member is to the person: CHILD, SPOUSE or PARTNER.
|
|
9
|
+
*/
|
|
10
|
+
relationship: TravelerRelationshipKind;
|
|
11
|
+
/**
|
|
12
|
+
* The family member's traveler, as the person fills it for them.
|
|
13
|
+
*/
|
|
14
|
+
traveler: TravelerSelf;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A change to one family member the person may fill in for.
|
|
18
|
+
*/
|
|
19
|
+
export interface FamilyMemberInput {
|
|
20
|
+
/**
|
|
21
|
+
* The family member's traveler, one of the family GET /crm/me answers; any
|
|
22
|
+
* other answers 404 ERROR_ITEM_NOT_FOUND.
|
|
23
|
+
*/
|
|
24
|
+
travelerId: TravelerId;
|
|
25
|
+
/**
|
|
26
|
+
* The change to the family member's traveler, with the revision read.
|
|
27
|
+
*/
|
|
28
|
+
update: TravelerSelfUpdate;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The signed-in person in the CRM: their own traveler at the agency they act
|
|
32
|
+
* in, the family they may fill in for there, and the advisors who serve them at
|
|
33
|
+
* every agency.
|
|
34
|
+
*/
|
|
35
|
+
export interface Me {
|
|
36
|
+
/**
|
|
37
|
+
* The advisors who serve the person at every agency where they are a
|
|
38
|
+
* traveler, one entry per advisor and agency.
|
|
39
|
+
*/
|
|
40
|
+
advisors: MyAdvisor[];
|
|
41
|
+
/**
|
|
42
|
+
* The family members the person may fill in for at the agency they act in;
|
|
43
|
+
* empty when no agency is selected.
|
|
44
|
+
*/
|
|
45
|
+
family: FamilyMember[];
|
|
46
|
+
/**
|
|
47
|
+
* The person's own traveler at the agency they act in; null before they have
|
|
48
|
+
* one there, or when no agency is selected.
|
|
49
|
+
*/
|
|
50
|
+
traveler: TravelerSelf | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The changes the person makes to their own traveler and to the family members
|
|
54
|
+
* they may fill in for. Send traveler, family or both.
|
|
55
|
+
*/
|
|
56
|
+
export interface MeUpdate {
|
|
57
|
+
/**
|
|
58
|
+
* Changes to the family members the person may fill in for, at most 10, saved
|
|
59
|
+
* one after the other in the order sent.
|
|
60
|
+
*/
|
|
61
|
+
family?: FamilyMemberInput[];
|
|
62
|
+
/**
|
|
63
|
+
* The change to the person's own traveler at the agency they act in; the
|
|
64
|
+
* first one adds it and must include name.
|
|
65
|
+
*/
|
|
66
|
+
traveler?: TravelerSelfUpdate;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* An advisor who serves the person at one agency, named and pictured as their
|
|
70
|
+
* Nicer account shows them.
|
|
71
|
+
*/
|
|
72
|
+
export interface MyAdvisor {
|
|
73
|
+
/**
|
|
74
|
+
* A link to the photo on the advisor's Nicer account; null when they have
|
|
75
|
+
* none.
|
|
76
|
+
*/
|
|
77
|
+
advisorAvatar: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* The advisor's name, as their Nicer account spells it; null when it has
|
|
80
|
+
* none.
|
|
81
|
+
*/
|
|
82
|
+
advisorName: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* The advisor's user id.
|
|
85
|
+
*/
|
|
86
|
+
advisorUserId: string;
|
|
87
|
+
/**
|
|
88
|
+
* The agency where the advisor serves the person.
|
|
89
|
+
*/
|
|
90
|
+
companyName: string;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the advisor is the one responsible for the person at that agency.
|
|
93
|
+
*/
|
|
94
|
+
isAssigned: boolean;
|
|
95
|
+
}
|