@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.
- package/README.md +89 -4
- 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 +35 -2
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { CountryCode, FrequentFlyerProgram, HotelMembership, ParticipantSex, PersonAddress, PersonContact, PersonName, SalesStage, TravelDocument, TravelerId, TravelersTripRelationship } from "../models.js";
|
|
2
|
+
/**
|
|
3
|
+
* A trip as the CRM sees it: its sales stage, its primary traveler and how many
|
|
4
|
+
* travel on it, and, in the answers about one trip, who travels on it with the
|
|
5
|
+
* details a checkout needs.
|
|
6
|
+
*/
|
|
7
|
+
export interface CrmTrip {
|
|
8
|
+
/**
|
|
9
|
+
* The user id of the trip's advisor; null while it has none.
|
|
10
|
+
*/
|
|
11
|
+
assignedAdvisorUserId: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* The trip's itinerary (TI…), when its advisor started one; null otherwise.
|
|
14
|
+
*/
|
|
15
|
+
associatedTripItineraryId: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* The agency the trip belongs to.
|
|
18
|
+
*/
|
|
19
|
+
companyName: string;
|
|
20
|
+
/**
|
|
21
|
+
* The traveler the trip is for, its PRIMARY traveler; null while it has none.
|
|
22
|
+
*/
|
|
23
|
+
primaryTravelerId: TravelerId | null;
|
|
24
|
+
/**
|
|
25
|
+
* The primary traveler's name as the agency knows them; null while the trip
|
|
26
|
+
* has no primary traveler.
|
|
27
|
+
*/
|
|
28
|
+
primaryTravelerName: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* The revision of the trip's CRM record: send it back with a change, and a
|
|
31
|
+
* change made since answers 409 CRM_REVISION_CONFLICT. 0 while the CRM keeps
|
|
32
|
+
* nothing of the trip yet.
|
|
33
|
+
*/
|
|
34
|
+
revision: number;
|
|
35
|
+
/**
|
|
36
|
+
* Where the trip stands as a sale; null while it has no stage.
|
|
37
|
+
*/
|
|
38
|
+
salesStage: SalesStage | null;
|
|
39
|
+
/**
|
|
40
|
+
* How many travelers are on the trip.
|
|
41
|
+
*/
|
|
42
|
+
travelerCount: number;
|
|
43
|
+
/**
|
|
44
|
+
* Who travels on the trip, the PRIMARY traveler first. Present in the answers
|
|
45
|
+
* about one trip (GET and PUT /crm/trips/{travelersTripId}, POST
|
|
46
|
+
* /crm/trips/{travelersTripId}/travelers); absent from GET /crm/trips, which
|
|
47
|
+
* never reads a trip's travelers.
|
|
48
|
+
*/
|
|
49
|
+
travelers?: TripTraveler[];
|
|
50
|
+
/**
|
|
51
|
+
* The trip's id (TT…).
|
|
52
|
+
*/
|
|
53
|
+
travelersTripId: string;
|
|
54
|
+
/**
|
|
55
|
+
* The trip's last day, YYYY-MM-DD; null while it has no dates.
|
|
56
|
+
*/
|
|
57
|
+
tripEndDate: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The trip's name; null when it has none.
|
|
60
|
+
*/
|
|
61
|
+
tripName: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* The trip's first day, YYYY-MM-DD; null while it has no dates.
|
|
64
|
+
*/
|
|
65
|
+
tripStartDate: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* When the trip's CRM record last changed; null while the CRM keeps nothing
|
|
68
|
+
* of the trip yet.
|
|
69
|
+
*/
|
|
70
|
+
updatedAt: string | null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* One page of the agency's trips by sales stage, soonest first, without their
|
|
74
|
+
* travelers, and the token of the next page.
|
|
75
|
+
*/
|
|
76
|
+
export interface CrmTripList {
|
|
77
|
+
/**
|
|
78
|
+
* The items of this page.
|
|
79
|
+
*/
|
|
80
|
+
items: CrmTrip[];
|
|
81
|
+
/**
|
|
82
|
+
* Send it back as nextToken to read the next page; null on the last page.
|
|
83
|
+
*/
|
|
84
|
+
nextToken: string | null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The trip's whole list of travelers to keep, its sales stage, or both, with
|
|
88
|
+
* the revision read. A traveler sent as a participant is found by email or
|
|
89
|
+
* phone, or added.
|
|
90
|
+
*/
|
|
91
|
+
export interface CrmTripUpdate {
|
|
92
|
+
/**
|
|
93
|
+
* The trip's revision as read; a change made since answers 409
|
|
94
|
+
* CRM_REVISION_CONFLICT.
|
|
95
|
+
*/
|
|
96
|
+
revision: number;
|
|
97
|
+
/**
|
|
98
|
+
* The sales stage to move the trip to. Only the trip's staff, its advisor or
|
|
99
|
+
* an agency admin, may send it.
|
|
100
|
+
*/
|
|
101
|
+
salesStage?: SalesStage;
|
|
102
|
+
/**
|
|
103
|
+
* Every traveler to keep on the trip, up to 20: one on the trip left out
|
|
104
|
+
* leaves it, and one sent twice keeps the part sent last.
|
|
105
|
+
*/
|
|
106
|
+
travelers?: TripTravelerInput[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The traveler as a checkout takes them: legal name, birth date, sex,
|
|
110
|
+
* nationality, contact, address, documents and frequent flyer memberships.
|
|
111
|
+
*/
|
|
112
|
+
export interface TripParticipant {
|
|
113
|
+
/**
|
|
114
|
+
* The person's postal address; null when unknown.
|
|
115
|
+
*/
|
|
116
|
+
address: PersonAddress | null;
|
|
117
|
+
/**
|
|
118
|
+
* The person's date of birth, YYYY-MM-DD; null when unknown.
|
|
119
|
+
*/
|
|
120
|
+
birthDate: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* How to reach the person.
|
|
123
|
+
*/
|
|
124
|
+
contact: PersonContact;
|
|
125
|
+
/**
|
|
126
|
+
* The person's travel documents (passport, visa, national ID), up to 12;
|
|
127
|
+
* empty when there are none.
|
|
128
|
+
*/
|
|
129
|
+
documents: TravelDocument[];
|
|
130
|
+
/**
|
|
131
|
+
* The person's airline loyalty memberships, up to 8, sent with a flight
|
|
132
|
+
* booking.
|
|
133
|
+
*/
|
|
134
|
+
frequentFlyerPrograms?: FrequentFlyerProgram[];
|
|
135
|
+
/**
|
|
136
|
+
* The person's membership number with the hotel chain (chainCode), for a
|
|
137
|
+
* hotel booking; null or left out when there is none.
|
|
138
|
+
*/
|
|
139
|
+
hotelMembership?: HotelMembership | null;
|
|
140
|
+
/**
|
|
141
|
+
* The person's legal name, as printed on their travel document.
|
|
142
|
+
*/
|
|
143
|
+
name: PersonName;
|
|
144
|
+
/**
|
|
145
|
+
* The person's nationality, as an ISO 3166-1 alpha-2 country code; null when
|
|
146
|
+
* unknown.
|
|
147
|
+
*/
|
|
148
|
+
nationalityCountryCode: CountryCode | null;
|
|
149
|
+
/**
|
|
150
|
+
* The sex marker printed on the person's travel document; null when unknown.
|
|
151
|
+
*/
|
|
152
|
+
sex: ParticipantSex | null;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* One traveler of a trip, their part in it and the details a checkout needs.
|
|
156
|
+
*/
|
|
157
|
+
export interface TripTraveler {
|
|
158
|
+
/**
|
|
159
|
+
* The traveler's details as a checkout takes them. Their documents are
|
|
160
|
+
* answered to the trip's staff, and to a traveler on the trip for themselves
|
|
161
|
+
* and the relatives they fill in for; anyone else reads an empty list.
|
|
162
|
+
*/
|
|
163
|
+
participant: TripParticipant;
|
|
164
|
+
/**
|
|
165
|
+
* The traveler's part in the trip; PRIMARY is the traveler the trip is for.
|
|
166
|
+
*/
|
|
167
|
+
relationship: TravelersTripRelationship;
|
|
168
|
+
/**
|
|
169
|
+
* The traveler's id in the CRM (TRV…).
|
|
170
|
+
*/
|
|
171
|
+
travelerId: TravelerId;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* A traveler to keep on a trip: an existing one by travelerId, or a person as a
|
|
175
|
+
* checkout collects them, found by email or phone or added.
|
|
176
|
+
*/
|
|
177
|
+
export interface TripTravelerInput {
|
|
178
|
+
/**
|
|
179
|
+
* A person as a checkout collects them, used when travelerId is left out: for
|
|
180
|
+
* the trip's staff, the agency's traveler with this email or phone when they
|
|
181
|
+
* may see one; otherwise a new traveler of the agency.
|
|
182
|
+
*/
|
|
183
|
+
participant?: TripParticipant;
|
|
184
|
+
/**
|
|
185
|
+
* The traveler's part in the trip.
|
|
186
|
+
*/
|
|
187
|
+
relationship: TravelersTripRelationship;
|
|
188
|
+
/**
|
|
189
|
+
* An existing traveler of the agency (TRV…). Required unless participant is
|
|
190
|
+
* sent. Only the trip's staff may name one who is not on the trip yet.
|
|
191
|
+
*/
|
|
192
|
+
travelerId?: TravelerId;
|
|
193
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
|
|
2
|
+
import type { CrmTrip } from "../models.js";
|
|
3
|
+
import type { TripTravelerAdd } 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 to a trip
|
|
13
|
+
*
|
|
14
|
+
* Puts one existing traveler of the agency on the trip with their part in it,
|
|
15
|
+
* and leaves the trip's other travelers as they are. Nobody is messaged. A
|
|
16
|
+
* traveler already on the trip is left as they are, so the same call again
|
|
17
|
+
* changes nothing and answers the same trip. A trip keeps at most 20
|
|
18
|
+
* travelers and one PRIMARY. Only the trip's advisor or an agency admin adds
|
|
19
|
+
* a traveler, one they may see in the CRM. Returns the trip with its
|
|
20
|
+
* travelers as GET /crm/trips/{travelersTripId} does; the addition publishes
|
|
21
|
+
* crm.trip-updated.v1. Errors: 400 ERROR_BODY_VALIDATION, also for a trip
|
|
22
|
+
* with 20 travelers already or a second PRIMARY; 404 ERROR_ITEM_NOT_FOUND for
|
|
23
|
+
* a trip or a traveler the caller may not see; 409 CRM_REVISION_CONFLICT only
|
|
24
|
+
* when other changes to the trip kept landing through three tries.
|
|
25
|
+
*/
|
|
26
|
+
add(request: AddRequest, options?: RequestOptions): Promise<AddResponse>;
|
|
27
|
+
}
|
|
28
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
29
|
+
export declare function bind(transport: Transport): Client;
|
|
30
|
+
export type AddRequest = {
|
|
31
|
+
travelersTripId: string;
|
|
32
|
+
} & TripTravelerAdd;
|
|
33
|
+
export type AddResponse = CrmTrip;
|
|
@@ -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
|
+
add: (request, options) => transport.send(AddOperation, request, options),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const AddOperation = {
|
|
13
|
+
method: "POST",
|
|
14
|
+
route: "/crm/trips/{travelersTripId}/travelers",
|
|
15
|
+
body: "flat",
|
|
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, AddRequest, AddResponse, } from "./client.js";
|
|
5
|
+
export type { TripTravelerAdd } from "./models.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TravelerId, TravelersTripRelationship } from "../../models.js";
|
|
2
|
+
/**
|
|
3
|
+
* An existing traveler of the agency to put on the trip, and their part in it.
|
|
4
|
+
*/
|
|
5
|
+
export interface TripTravelerAdd {
|
|
6
|
+
/**
|
|
7
|
+
* The traveler's part in the trip; PRIMARY is the traveler the trip is for.
|
|
8
|
+
*/
|
|
9
|
+
relationship: TravelersTripRelationship;
|
|
10
|
+
/**
|
|
11
|
+
* The traveler's id in the CRM (TRV…).
|
|
12
|
+
*/
|
|
13
|
+
travelerId: TravelerId;
|
|
14
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -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, AddOfferRequest, AddOfferResponse, ApproveSegmentRequest, ApproveSegmentResponse, BalancesGetRequest, BalancesGetResponse, ChatGetRequest, ChatGetResponse, ChatListRequest, ChatListResponse, ChatReplyRequest, ChatReplyResponse, CheckoutCreateRequest, CheckoutCreateResponse, CommissionExportCreateRequest, CommissionExportCreateResponse, CommissionExportGetRequest, CommissionExportGetResponse, CommissionExportsListRequest, CommissionExportsListResponse, CommissionImportActionRunRequest, CommissionImportActionRunResponse, CommissionImportCreateRequest, CommissionImportCreateResponse, CommissionImportGetRequest, CommissionImportGetResponse, CommissionItemActionRunRequest, CommissionItemActionRunResponse, CommissionItemGetRequest, CommissionItemGetResponse, CommissionItemsListRequest, CommissionItemsListResponse, CommissionReportGetRequest, CommissionReportGetResponse, CommissionSummaryGetRequest, CommissionSummaryGetResponse, CreateBookingSelectionRequest, CreateBookingSelectionResponse, CreateInsuranceQuotesRequest, CreateInsuranceQuotesResponse, CreateItineraryDocumentRequest, CreateItineraryDocumentResponse, CreateQuoteRequest, CreateQuoteResponse, CreateTravelersTripRequest, CreateTravelersTripResponse, DeleteFavoriteRequest, DeleteFavoriteResponse, DestinationsQueryRequest, DestinationsQueryResponse, DiscoverCarRentalDetailsRequest, DiscoverCarRentalDetailsResponse, DiscoverCarRentalsRequest, DiscoverCarRentalsResponse, DiscoverFlightDetailsRequest, DiscoverFlightDetailsResponse, DiscoverFlightsRequest, DiscoverFlightsResponse, DiscoverHotelDetailsRequest, DiscoverHotelDetailsResponse, DiscoverHotelsRequest, DiscoverHotelsResponse, EarningsListRequest, EarningsListResponse, ExternalBookingCreateRequest, ExternalBookingCreateResponse, ExternalBookingGetRequest, ExternalBookingGetResponse, ExternalBookingUpdateRequest, ExternalBookingUpdateResponse, ExternalPaymentRecordRequest, ExternalPaymentRecordResponse, GetBookingSelectionRequest, GetBookingSelectionResponse, GetFavoritesShareRequest, GetFavoritesShareResponse, GetOfferRequirementsRequest, GetOfferRequirementsResponse, GetPlaceRequest, GetPlaceResponse, GetProductRequest, GetProductResponse, GetSharedFavoritesRequest, GetSharedFavoritesResponse, GetTravelersTripRequest, GetTravelersTripResponse, GetTripItineraryRequest, GetTripItineraryResponse, GetTripItineraryAgentViewRequest, GetTripItineraryAgentViewResponse, ListFavoritesRequest, ListFavoritesResponse, ListTravelersTripRequest, ListTravelersTripResponse, ListTripItineraryRequest, ListTripItineraryResponse, LookupFlightRequest, LookupFlightResponse, OrderActionRunRequest, OrderActionRunResponse, OrderAdvisorAssignRequest, OrderAdvisorAssignResponse, OrderConfirmationSendRequest, OrderConfirmationSendResponse, OrderCreateRequest, OrderCreateResponse, OrderGetRequest, OrderGetResponse, OrderPaymentSubmitRequest, OrderPaymentSubmitResponse, OrdersListRequest, OrdersListResponse, PayeeActionRunRequest, PayeeActionRunResponse, PayeesListRequest, PayeesListResponse, PaymentMethodActionRunRequest, PaymentMethodActionRunResponse, RemittanceActionRunRequest, RemittanceActionRunResponse, RemittanceBatchActionRunRequest, RemittanceBatchActionRunResponse, RemittanceBatchCreateRequest, RemittanceBatchCreateResponse, RemittanceBatchGetRequest, RemittanceBatchGetResponse, RemittanceBatchesListRequest, RemittanceBatchesListResponse, RemittanceCreateRequest, RemittanceCreateResponse, RemittanceGetRequest, RemittanceGetResponse, RemittanceLineClaimRequest, RemittanceLineClaimResponse, RemittanceSuggestionsGetRequest, RemittanceSuggestionsGetResponse, RemittancesListRequest, RemittancesListResponse, SaveFavoriteRequest, SaveFavoriteResponse, SearchCarriersRequest, SearchCarriersResponse, SearchPlacesRequest, SearchPlacesResponse, SearchProductsRequest, SearchProductsResponse, SegmentOpRequest, SegmentOpResponse, SelectOptionRequest, SelectOptionResponse, SendTripItineraryRequest, SendTripItineraryResponse, ShareFavoritesRequest, ShareFavoritesResponse, StatementActionRunRequest, StatementActionRunResponse, StatementGetRequest, StatementGetResponse, StatementsListRequest, StatementsListResponse, StopSharingFavoritesRequest, StopSharingFavoritesResponse, SupplierActionRunRequest, SupplierActionRunResponse, SupplierCreateRequest, SupplierCreateResponse, SupplierGetRequest, SupplierGetResponse, SuppliersSearchRequest, SuppliersSearchResponse, ToggleArchiveRequest, ToggleArchiveResponse, TravelersTripInviteRequest, TravelersTripInviteResponse, TravelersTripToggleArchiveRequest, TravelersTripToggleArchiveResponse, UpdateTravelersTripRequest, UpdateTravelersTripResponse, UpdateTripItineraryRequest, UpdateTripItineraryResponse, } from "./client.js";
|
|
5
|
+
export type { Accessibility, AddOfferBody, AddOfferResponse as AddOfferResponse$, AirPreferences, AirportCode, AllocationRequest, AllocationSplit, ApproveSegmentBody, ApproveSegmentResponse as ApproveSegmentResponse$, Attachment, BaggageSize, BaggageWeight, BalancesGetResponse as BalancesGetResponse$, BookingCommercialSnapshot, BookingImportMapping, BookingPriceSnapshot, BookingProductSnapshot, BookingQuote, BookingQuoteResponse, BookingSelectionPreviewResponse, CarDiscoveryDetails, CarDiscoveryResponse, CarRentalLocationSnapshot, CarRentalOffer, CarRentalProductSnapshot, Carrier, CarrierCode, CarriersResponse, ChatReplyBody, ChatReplyResponse as ChatReplyResponse$, CheckoutCreateBody, CheckoutCreateResponse as CheckoutCreateResponse$, CommissionAttachment, CommissionExport, CommissionExportCreateBody, CommissionExportsListResponse as CommissionExportsListResponse$, CommissionFilter, CommissionIdentifierRef, CommissionImport, CommissionImportActionRunBody, CommissionImportCreateBody, CommissionImportCreateResponse as CommissionImportCreateResponse$, CommissionImportGetResponse as CommissionImportGetResponse$, CommissionItemActionRunBody, CommissionItemActionRunResponse as CommissionItemActionRunResponse$, CommissionItemDetail, CommissionItemRevision, CommissionItemSummary, CommissionItemsListResponse as CommissionItemsListResponse$, CommissionNote, CommissionReport, CommissionReportPeriod, CommissionSummary, CommissionTag, CountryCode, CreateBookingSelectionBody, CreateBookingSelectionResponse as CreateBookingSelectionResponse$, CreateInsuranceQuotesBody, CreateInsuranceQuotesResponse as CreateInsuranceQuotesResponse$, CreateItineraryDocumentBody, CreateItineraryDocumentResponse as CreateItineraryDocumentResponse$, CreateQuoteRequest as CreateQuoteRequest$, CreateTravelersTripBody, CreateTravelersTripResponse as CreateTravelersTripResponse$, CurrencyCode, CurrencyTotal, DeleteFavoriteResponse as DeleteFavoriteResponse$, Deleted, Destination, Dietary, DirectProductSnapshot, DiscoverHotelDetailsResponse as DiscoverHotelDetailsResponse$, E164Phone, EarningsListResponse as EarningsListResponse$, EmergencyContact, ErrorResponse, EstimatedCommission, ExportColumn, ExternalBooking, ExternalBookingCreateBody, ExternalBookingUpdateBody, ExternalPaymentRecordBody, Favorite, FavoriteActivity, FavoriteKind, FlightAirportSnapshot, FlightBaggageCharge, FlightBaggageSnapshot, FlightBrandFeatureSnapshot, FlightCarrierSnapshot, FlightDetailsResponse, FlightDiscoveryGroup, FlightDiscoveryResponse, FlightEndpointSnapshot, FlightFareOption, FlightFareRuleSnapshot, FlightHiddenStopSnapshot, FlightItinerary, FlightLegSnapshot, FlightLookupAirport, FlightLookupLeg, FlightLookupResponse, FlightMatrixCell, FlightMeal, FlightOffer, FlightPassengerSnapshot, FlightProductSnapshot, FlightRules, FlightSegment, FlightSelectedSeat, FlightSelectedService, FlightSliceSnapshot, FlightSort, FrequentFlyerProgram, FxRate, GetBookingSelectionResponse as GetBookingSelectionResponse$, GetFavoritesShareResponse as GetFavoritesShareResponse$, GetOfferRequirementsResponse as GetOfferRequirementsResponse$, GetSharedFavoritesResponse as GetSharedFavoritesResponse$, GetTravelersTripResponse as GetTravelersTripResponse$, GetTripItineraryAgentViewResponse as GetTripItineraryAgentViewResponse$, HotelBookingRequirements, HotelDetailsResponse, HotelDiscoveryResponse, HotelMembership, HotelPreferences, HotelProductSnapshot, HotelRatesResponse, HotelStayOffer, HotelSummary, ImportAdvisor, ImportRow, ImportRowValues, ImportantDate, ImportantDateInput, ImportantDateKind, InsuranceCoverageOption, InsuranceProductSnapshot, Interests, LanguageTag, ListFavoritesResponse as ListFavoritesResponse$, ListTravelersTripResponse as ListTravelersTripResponse$, Location, LoyaltyProgram, MarketingConsent, MatchFeatures, MatchProposal, Money, Order, OrderActionRunBody, OrderActionRunResponse as OrderActionRunResponse$, OrderAdvisorAssignBody, OrderAdvisorAssignResponse as OrderAdvisorAssignResponse$, OrderConfirmationSendBody, OrderConfirmationSendResponse as OrderConfirmationSendResponse$, OrderCreateBody, OrderCreateResponse as OrderCreateResponse$, OrderGetResponse as OrderGetResponse$, OrderListItem, OrderPaymentSubmitBody, OrderPaymentSubmitResponse as OrderPaymentSubmitResponse$, OrderProductSnapshot, OrdersListResponse as OrdersListResponse$, ParticipantField, ParticipantRequirements, ParticipantSex, ParticipantSlotRequirement, PayeeActionRunBody, PayeeActionRunResponse as PayeeActionRunResponse$, PayeeSettings, PayeesListResponse as PayeesListResponse$, PaymentMethodActionRunBody, PaymentMethodCardLinkCompleteResponse, PaymentTerms, Payout, PersonAddress, PersonContact, PersonName, Pet, Place, PlaceDetails, PlaceKind, PlacePhoto, PlaceSource, PlacesResponse, PreferredChannel, PriceComponent, ProductKind, ProductionByAdvisorRow, ProductionByClientRow, ProductionByDestinationRow, ProductionBySupplierRow, ProductionTotal, ProviderKey, QuoteImage, QuoteOutcomeResponse, QuotePolicy, ReceivablesAgingRow, ReceivablesTotal, ReconciliationExceptionRow, ReconciliationExceptionTotal, RemittanceAction, RemittanceAllocation, RemittanceBatch, RemittanceBatchAction, RemittanceBatchActionRunResponse as RemittanceBatchActionRunResponse$, RemittanceBatchCreateBody, RemittanceBatchCreateResponse as RemittanceBatchCreateResponse$, RemittanceBatchGetResponse as RemittanceBatchGetResponse$, RemittanceBatchStats, RemittanceBatchesListResponse as RemittanceBatchesListResponse$, RemittanceClaim, RemittanceCreateBody, RemittanceDetail, RemittanceImportMapping, RemittanceLine, RemittanceLineClaimBody, RemittanceLineEdit, RemittanceLineReceived, RemittanceSuggestionsGetResponse as RemittanceSuggestionsGetResponse$, RemittanceSummary, RemittancesListResponse as RemittancesListResponse$, Room, SalesStage, SaveFavoriteBody, SearchProductsBody, SegmentOpBody, SelectOptionBody, SelectOptionResponse as SelectOptionResponse$, SendTripItineraryBody, ShareFavoritesBody, ShareFavoritesResponse as ShareFavoritesResponse$, StatementActionRunBody, StatementActionRunResponse as StatementActionRunResponse$, StatementAdjustment, StatementDetail, StatementLine, StatementSummary, StatementsListResponse as StatementsListResponse$, StopSharingFavoritesResponse as StopSharingFavoritesResponse$, Suite, SupplierActionRunBody, SupplierAddress, SupplierContact, SupplierCreateBody, SupplierDetail, SupplierDirectoryRow, SupplierProduction, SupplierProfile, SupplierSuggestion, SupplierSummary, SuppliersSearchResponse as SuppliersSearchResponse$, Task, TaskList, TaskOrigin, TermsDigest, ToggleArchiveBody, ToggleArchiveResponse as ToggleArchiveResponse$, TravelDocument, TravelDocumentKind, TravelProfile, TravelProfileUpdate, TravelerDocument, TravelerDocumentInput, TravelerId, TravelerRelationshipKind, TravelerSelf, TravelerSelfUpdate, TravelerStage, TravelerTag, TravelerVisibility, TravelersTripInviteBody, TravelersTripRelationship, TravelersTripToggleArchiveBody, TravelersTripToggleArchiveResponse as TravelersTripToggleArchiveResponse$, TripItineraryMode, TripItineraryStatus, UpdateTravelersTripBody, UpdateTripItineraryBody, UpdateTripItineraryResponse as UpdateTripItineraryResponse$, UploadLink, } from "./models.js";
|
package/dist/index.js
ADDED
|
@@ -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";
|
package/dist/me/index.js
ADDED
|
@@ -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
|
+
}
|