@surfiran/public-api-client 0.15.0 → 0.21.0
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 +62 -160
- package/dist/client.d.ts +8 -2
- package/dist/client.js +34 -3
- package/dist/generated/public-api-v1.d.ts +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +218 -6
- package/dist/types.js +1 -1
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -1,195 +1,97 @@
|
|
|
1
1
|
# Public API Client
|
|
2
2
|
|
|
3
|
-
TypeScript types and
|
|
3
|
+
Zero-runtime-dependency TypeScript types and fetch client for SURFIRAN Public API V1. The checked-in package-local contract snapshot is OpenAPI `v0.14.0`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Repository: `SURFIRAN/surfiran-public-api-client`
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
contract/public-api-v1.yaml (v0.9.0 package snapshot)
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
The backend API remains the canonical contract owner at
|
|
12
|
-
`server/openapi/public-api-v1.yaml`. This package contains an explicit,
|
|
13
|
-
checked-in snapshot with provenance linking it to the canonical source commit
|
|
14
|
-
and checksum. The package never reads backend source during generation.
|
|
15
|
-
|
|
16
|
-
## Current Runtime Scope
|
|
17
|
-
|
|
18
|
-
Active read endpoints:
|
|
19
|
-
|
|
20
|
-
```http
|
|
21
|
-
GET /api/v1/homepage
|
|
22
|
-
GET /api/v1/site-navigation
|
|
23
|
-
GET /api/v1/sitemap
|
|
24
|
-
GET /api/v1/search-suggestions
|
|
25
|
-
GET /api/v1/tour-categories
|
|
26
|
-
GET /api/v1/tours
|
|
27
|
-
GET /api/v1/tours/:slug
|
|
28
|
-
GET /api/v1/tours/:slug/departures
|
|
29
|
-
GET /api/v1/tours/:slug/availability
|
|
30
|
-
GET /api/v1/destinations
|
|
31
|
-
GET /api/v1/destinations/:slug
|
|
32
|
-
GET /api/v1/travel-knowledge
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Active narrow public write endpoints:
|
|
7
|
+
Cross-repository ownership, API boundaries, and cutover status are maintained once in [`surfiran-crm-api/docs/architecture/REPOSITORY_BOUNDARIES.md`](https://github.com/SURFIRAN/surfiran-crm-api/blob/main/docs/architecture/REPOSITORY_BOUNDARIES.md).
|
|
36
8
|
|
|
37
|
-
|
|
38
|
-
POST /api/v1/inquiries
|
|
39
|
-
POST /api/v1/booking-intents
|
|
40
|
-
```
|
|
9
|
+
## Repository status
|
|
41
10
|
|
|
42
|
-
|
|
11
|
+
The repository split and production cutover are complete. This repository is the active source for typed-client development, contract snapshot synchronization, generation, versioning, publication, package verification, and rollback.
|
|
43
12
|
|
|
44
|
-
|
|
45
|
-
GET /api/v1/booking-intents/:id
|
|
46
|
-
```
|
|
13
|
+
`SURFIRAN/Tour-Operator-CRM` is a legacy monorepo retained only for historical reference, rollback/recovery history, and legitimate historical provenance. Do not use its former `packages/public-api-client/` tree or monorepo workflows for current client work.
|
|
47
14
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`GET /api/v1/booking-intents/:id` remains blocked at `501 PUBLIC_API_ROUTE_NOT_IMPLEMENTED` and is intentionally not exposed by this client.
|
|
51
|
-
|
|
52
|
-
## Exported Types
|
|
53
|
-
|
|
54
|
-
All types are aligned with the OpenAPI specification. Key exports:
|
|
55
|
-
|
|
56
|
-
- `PublicApiErrorCode` - union of current public error code strings
|
|
57
|
-
- `PublicApiV1Path` - union of active client paths
|
|
58
|
-
- `PublicApiV1RouteMap` - maps supported `GET` and `POST` client operations to response types
|
|
59
|
-
- `PublicTourListItem`, `PublicTourDetail`
|
|
60
|
-
- `PublicDepartureListItem`
|
|
61
|
-
- `PublicAvailabilityListItem`, `PublicAvailabilityListResponse`
|
|
62
|
-
- `PublicDestinationListItem`, `PublicDestinationDetail`
|
|
63
|
-
- `PublicTourListResponse`, `PublicTourDetailResponse`
|
|
64
|
-
- `PublicDepartureListResponse`
|
|
65
|
-
- `PublicDestinationListResponse`, `PublicDestinationDetailResponse`
|
|
66
|
-
- `PublicInquiryRequest`, `PublicInquiryResponse`
|
|
67
|
-
- `PublicBookingIntentRequest`, `PublicBookingIntentResponse`
|
|
68
|
-
- `PublicTravelKnowledgeItem`, `PublicTravelKnowledgeResponse`
|
|
69
|
-
- `PublicError`, `PublicErrorEnvelope`
|
|
70
|
-
- `PublicApiNotImplementedError`, `PublicApiValidationError`
|
|
71
|
-
- `PublicApiRateLimitError`, `PublicApiAbuseBlockedError`
|
|
72
|
-
- `PublicApiIdempotencyConflictError`
|
|
73
|
-
|
|
74
|
-
## Client Functions
|
|
75
|
-
|
|
76
|
-
```ts
|
|
77
|
-
import { createPublicApiClient } from '@surfiran/public-api-client';
|
|
78
|
-
|
|
79
|
-
const client = createPublicApiClient({ baseUrl: 'https://crm.example.com' });
|
|
80
|
-
|
|
81
|
-
const homepage = await client.getPublicHomepage();
|
|
82
|
-
const siteNavigation = await client.getPublicSiteNavigation();
|
|
83
|
-
const sitemap = await client.getPublicSitemap({ type: 'tour' });
|
|
84
|
-
const suggestions = await client.getPublicSearchSuggestions({ q: 'iran' });
|
|
85
|
-
const categories = await client.listPublicTourCategories({ limit: 20 });
|
|
86
|
-
const tours = await client.listPublicTours({ limit: 20 });
|
|
87
|
-
const tour = await client.getPublicTourBySlug('iran-hiking-tour');
|
|
88
|
-
const departures = await client.listPublicTourDepartures('iran-hiking-tour', { limit: 20 });
|
|
89
|
-
const availability = await client.listPublicTourAvailability('iran-hiking-tour', { limit: 20 });
|
|
90
|
-
const destinations = await client.listPublicDestinations({ limit: 20 });
|
|
91
|
-
const destination = await client.getPublicDestinationBySlug('tehran');
|
|
92
|
-
const travelKnowledge = await client.getPublicTravelKnowledge({ type: 'city', q: 'shiraz' });
|
|
93
|
-
```
|
|
15
|
+
## Contract ownership
|
|
94
16
|
|
|
95
|
-
Public
|
|
17
|
+
`SURFIRAN/surfiran-crm-api` owns Public API business semantics and the canonical OpenAPI contract at [`openapi/public-api-v1.yaml`](https://github.com/SURFIRAN/surfiran-crm-api/blob/main/openapi/public-api-v1.yaml). This is the source path for future releases. This repository does not invent or redefine backend behavior.
|
|
96
18
|
|
|
97
|
-
|
|
98
|
-
const inquiry = await client.createPublicInquiry(
|
|
99
|
-
{ name: 'Traveler', email: 'traveler@example.com', message: 'I am interested in Iran tours.' },
|
|
100
|
-
'client-generated-idempotency-key',
|
|
101
|
-
);
|
|
19
|
+
`contract/public-api-v1.yaml` is the package-local immutable snapshot used for generation. `contract/provenance.json` records its source identity, immutable source revision, checksums, and, for standalone releases, the exact API artifact identity.
|
|
102
20
|
|
|
103
|
-
|
|
104
|
-
{ tourSlug: 'iran-hiking-tour', travelerCount: 2 },
|
|
105
|
-
'client-generated-idempotency-key',
|
|
106
|
-
);
|
|
107
|
-
```
|
|
21
|
+
The checked-in `0.21.0` snapshot and provenance come from the `SURFIRAN/surfiran-crm-api` main-branch artifact `public-api-contract-536ebba901fda5a96dcbbd173d1f533336e3bae7-35118709282-1`. Published `0.20.0` and earlier keep their historical provenance, which may still reference the former monorepo owner or path. Do not rewrite an already published package version solely to rename historical provenance.
|
|
108
22
|
|
|
109
|
-
|
|
23
|
+
New client versions must consume an immutable reviewed contract artifact produced by a successful `SURFIRAN/surfiran-crm-api` main-branch CI run. The artifact is bound to the API source commit, GitHub Actions run identity, source ref/event, contract version, and checksum. Pull-request artifacts are verification evidence only and are not valid release inputs. This repository must never read another repository's private working tree at build time.
|
|
110
24
|
|
|
111
|
-
|
|
25
|
+
Generated client source is never hand-edited.
|
|
112
26
|
|
|
113
|
-
|
|
114
|
-
- Call internal CRM routes
|
|
115
|
-
- Export raw CRM row types or sensitive fields
|
|
116
|
-
- Expose `storage_path`, upload-private fields, passenger data, supplier-private data, payment data, audit data, tokens, cookies, or internal notes
|
|
117
|
-
- Add a client method for `GET /api/v1/booking-intents/:id` until that route is separately approved and implemented
|
|
27
|
+
## Boundary
|
|
118
28
|
|
|
119
|
-
|
|
29
|
+
The client exposes only operations present and implemented in the pinned Public API contract. It must never:
|
|
120
30
|
|
|
121
|
-
|
|
31
|
+
- import backend modules or connect to MariaDB;
|
|
32
|
+
- call internal CRM or generic-table routes;
|
|
33
|
+
- export raw CRM rows or passenger, supplier-private, payment, audit, internal-note, credential, cookie, token, or private-storage fields;
|
|
34
|
+
- manufacture public media URLs from private upload fields;
|
|
35
|
+
- create new business semantics that the API owner has not reviewed and released.
|
|
122
36
|
|
|
123
|
-
|
|
37
|
+
Booking-intent creation remains intent-only. It does not create a Booking, Passenger, payment, inventory hold, supplier confirmation, checkout, or Public Web behavior.
|
|
124
38
|
|
|
125
|
-
|
|
39
|
+
## Install and verify
|
|
126
40
|
|
|
127
|
-
|
|
41
|
+
Use Node.js 20 as configured in CI (the package requires Node.js 20 or later). Clone independently; no sibling working tree or legacy checkout is required.
|
|
128
42
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
```text
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://github.com/SURFIRAN/surfiran-public-api-client.git
|
|
45
|
+
cd surfiran-public-api-client
|
|
133
46
|
npm ci --include=dev
|
|
134
47
|
npm run generate
|
|
135
48
|
npm run verify:contract
|
|
49
|
+
npm run verify:api-contract-artifact -- --self-test
|
|
50
|
+
npm run verify:package
|
|
51
|
+
npm run verify:repository
|
|
136
52
|
npm run verify:generated
|
|
53
|
+
npm run typecheck
|
|
54
|
+
npm test
|
|
55
|
+
npm run build
|
|
56
|
+
npm run verify:pack
|
|
57
|
+
npm run verify:reproducibility
|
|
137
58
|
```
|
|
138
59
|
|
|
139
|
-
Generation
|
|
140
|
-
no machine-specific paths, and no uncontrolled timestamps. To synchronize the
|
|
141
|
-
snapshot from the canonical backend source during monorepo development, use the
|
|
142
|
-
explicit root command with a recorded source commit:
|
|
60
|
+
Generation is deterministic: stable ordering and formatting, LF newlines, no machine paths, random IDs, or uncontrolled timestamps.
|
|
143
61
|
|
|
144
|
-
|
|
145
|
-
npm run sync:public-api-client-contract -- --source-commit <canonical-source-commit>
|
|
146
|
-
```
|
|
62
|
+
[ci.yml](.github/workflows/ci.yml) owns the package verification sequence and runner requirements. This package has no development server or production service to restart; generation and tests are the local development loop.
|
|
147
63
|
|
|
148
|
-
|
|
149
|
-
not be used to create a competing contract.
|
|
64
|
+
## Contract updates
|
|
150
65
|
|
|
151
|
-
|
|
66
|
+
A new contract update must:
|
|
152
67
|
|
|
153
|
-
|
|
68
|
+
1. use the exact immutable artifact from a successful API run on `refs/heads/main` triggered by `push` or `workflow_dispatch`;
|
|
69
|
+
2. make a reviewed package version change before rewriting contract provenance;
|
|
70
|
+
3. run `sync:api-contract-artifact` with the exact API commit, run ID, and run attempt;
|
|
71
|
+
4. update `contract/public-api-v1.yaml` and `contract/provenance.json` together;
|
|
72
|
+
5. regenerate the client;
|
|
73
|
+
6. pass artifact verification, package verification, reproducibility, tests, typecheck, and build;
|
|
74
|
+
7. use a reviewed compatible or breaking version decision before publication.
|
|
154
75
|
|
|
155
|
-
|
|
156
|
-
npm run verify:contract
|
|
157
|
-
npm run generate
|
|
158
|
-
npm run verify:generated
|
|
159
|
-
npm run verify:package
|
|
160
|
-
npm run typecheck
|
|
161
|
-
npm test
|
|
162
|
-
npm run build
|
|
163
|
-
npm pack --dry-run --json
|
|
164
|
-
npm run verify:pack
|
|
165
|
-
npm run verify:publication-preflight -- <previous-exact-version>
|
|
166
|
-
```
|
|
76
|
+
The sync command rejects rewriting provenance for the current package version and rejects API artifacts that are not valid release inputs.
|
|
167
77
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
npm run verify:provenance -- \
|
|
180
|
-
--file <evidence-directory>/public-api-client-provenance.json \
|
|
181
|
-
--tarball <packed-tarball>
|
|
182
|
-
```
|
|
78
|
+
## Consumer usage
|
|
79
|
+
|
|
80
|
+
Consumers install an exact immutable `@surfiran/public-api-client` version and create a client with their supported Public API base URL. They check the typed success/error result for every operation and keep credentials/environment values outside code and logs.
|
|
81
|
+
|
|
82
|
+
Do not duplicate the endpoint list here; the pinned OpenAPI snapshot and generated route/types are the executable inventory.
|
|
83
|
+
|
|
84
|
+
## Publication and rollback
|
|
85
|
+
|
|
86
|
+
Publication is manual and repository-local through [public-api-client-publish.yml](.github/workflows/public-api-client-publish.yml). It runs on `main` only with explicit publication authorization and `publish_confirm=PUBLISH`. A future version must be bound to an exact reviewed API contract artifact, pass package/reproducibility checks and publication preflight, create release provenance, and provide an exact previous rollback version. Missing or unverifiable artifact provenance blocks publication. The workflow defines required inputs and the download/verification sequence.
|
|
87
|
+
|
|
88
|
+
Published versions are immutable. Rollback means pinning consumers to the previous verified exact package version. Package publication never deploys a consumer, changes API runtime behavior, applies a database migration, or authorizes production data/configuration access.
|
|
183
89
|
|
|
184
|
-
|
|
185
|
-
package name and version, canonical source commit, canonical and snapshot
|
|
186
|
-
checksums, generated artifact checksum, allowlist checksum, generation tool,
|
|
187
|
-
explicit generation timestamp policy, rollback version, and tarball checksum.
|
|
188
|
-
The package is immutable on npm. Consumers roll back by pinning the previous
|
|
189
|
-
verified exact version; an existing version is never overwritten.
|
|
90
|
+
## Documentation index
|
|
190
91
|
|
|
191
|
-
|
|
92
|
+
- This README owns local setup, contract synchronization, CI, publication, and rollback guidance.
|
|
93
|
+
- [AGENTS.md](AGENTS.md) owns agent operating instructions.
|
|
94
|
+
- [Repository boundaries and documentation governance](https://github.com/SURFIRAN/surfiran-crm-api/blob/main/docs/architecture/REPOSITORY_BOUNDARIES.md) own shared architecture and current system state.
|
|
95
|
+
- [Contract snapshot](contract/public-api-v1.yaml) and [provenance](contract/provenance.json) are immutable evidence for `0.21.0`, not current API ownership authorities.
|
|
192
96
|
|
|
193
|
-
|
|
194
|
-
- Synchronize the explicit snapshot only from the API-owned canonical source
|
|
195
|
-
- Run package-local generation, validation, provenance, and clean-clone checks
|
|
97
|
+
Update existing guidance instead of creating duplicate contract or publication authorities. Preserve the historical snapshot, provenance, and generated bytes until a reviewed new package version imports a verified API artifact.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetPublicSearchResultsParams, GetPublicSearchSuggestionsParams, GetPublicSitemapParams, GetPublicTourPreviewParams, GetPublicTravelKnowledgeParams, ListPublicDeparturesParams, ListPublicDestinationsParams, ListPublicTourAccommodationsParams, ListPublicTourAvailabilityParams, ListPublicTourCategoriesParams, ListPublicTourExperiencesParams, ListPublicTravellerStoriesParams, ListPublicTourQuestionsParams, ListPublicTourReviewsParams, ListPublicTourItineraryParams, ListPublicTourRouteParams, ListPublicToursParams, PublicApiResult, PublicAvailabilityListResponse, PublicBookingIntentRequest, PublicBookingIntentResponse, PublicBrochureLeadRequest, PublicBrochureLeadResponse, PublicDepartureListResponse, PublicDestinationDetailResponse, PublicDestinationListResponse, PublicHomepageResponse, PublicInquiryRequest, PublicInquiryResponse, PublicSearchResultsResponse, PublicSearchSuggestionsResponse, PublicSitemapResponse, PublicSiteChromeContentResponse, PublicSiteFeaturesResponse, PublicSiteHomeContentResponse, PublicSiteNavigationResponse, PublicSiteTrustPageContentResponse, PublicTourAccommodationListResponse, PublicTourCategoryListResponse, PublicTourDetailResponse, PublicTourExperienceListResponse, PublicTravellerStoryListResponse, PublicTourListResponse, PublicTourQuestionListResponse, PublicTourReviewsSummaryResponse, PublicTourReviewListResponse, PublicTourItineraryResponse, PublicTourRouteResponse, PublicTravelKnowledgeResponse, PublicTravelStatusResponse } from './types.js';
|
|
1
|
+
import type { GetPublicSearchResultsParams, GetPublicSearchSuggestionsParams, GetPublicSitemapParams, GetPublicTourPreviewParams, GetPublicTravelKnowledgeParams, ListPublicDeparturesParams, ListPublicDestinationsParams, ListPublicTourAccommodationsParams, ListPublicTourAvailabilityParams, ListPublicTourCategoriesParams, ListPublicTourExperiencesParams, ListPublicTravellerStoriesParams, ListPublicTourQuestionsParams, ListPublicTourReviewsParams, ListPublicTourItineraryParams, ListPublicTourRouteParams, ListPublicToursParams, GetPublicTourParams, PublicApiResult, PublicAvailabilityListResponse, PublicBookingIntentRequest, PublicBookingIntentResponse, PublicBrochureLeadRequest, PublicBrochureLeadResponse, PublicDepartureListResponse, PublicDestinationDetailResponse, PublicDestinationListResponse, PublicHomepageResponse, PublicInquiryRequest, PublicInquiryResponse, PublicSearchResultsResponse, PublicSearchSuggestionsResponse, PublicSitemapResponse, PublicSiteChromeContentResponse, PublicSiteFeaturesResponse, PublicLocaleRegistryResponse, PublicLocalizationCandidatePreviewResponse, PublicLocalizationReleaseResponse, PublicUiCatalogResponse, LocalizationReleaseId, LocalizationPreviewCapability, UiCatalogSnapshotId, PublicSiteHomeContentResponse, PublicSiteNavigationResponse, PublicSiteTrustPageContentResponse, PublicSiteBlockPageContentResponse, PublicTourAccommodationListResponse, PublicTourCategoryListResponse, PublicTourDetailResponse, PublicTourExperienceListResponse, PublicTravellerStoryListResponse, PublicTourListResponse, PublicTourQuestionListResponse, PublicTourReviewsSummaryResponse, PublicTourReviewListResponse, PublicTourItineraryResponse, PublicTourRouteResponse, PublicTravelKnowledgeResponse, PublicTravelStatusResponse } from './types.js';
|
|
2
2
|
export type PublicApiClientOptions = {
|
|
3
3
|
baseUrl: string;
|
|
4
4
|
fetchImpl?: typeof fetch;
|
|
@@ -12,7 +12,7 @@ export type PublicApiClientOptions = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare const createPublicApiClient: (options: PublicApiClientOptions) => {
|
|
14
14
|
listPublicTours(params?: ListPublicToursParams): Promise<PublicApiResult<PublicTourListResponse>>;
|
|
15
|
-
getPublicTourBySlug(slug: string): Promise<PublicApiResult<PublicTourDetailResponse>>;
|
|
15
|
+
getPublicTourBySlug(slug: string, params?: GetPublicTourParams): Promise<PublicApiResult<PublicTourDetailResponse>>;
|
|
16
16
|
/**
|
|
17
17
|
* ADR-0022 Tour Product/Edition MVP candidate preview: renders the same
|
|
18
18
|
* public-safe DTO as getPublicTourBySlug, with the Edition-sourced
|
|
@@ -41,6 +41,10 @@ export declare const createPublicApiClient: (options: PublicApiClientOptions) =>
|
|
|
41
41
|
getPublicHomepage(): Promise<PublicApiResult<PublicHomepageResponse>>;
|
|
42
42
|
getPublicSiteNavigation(): Promise<PublicApiResult<PublicSiteNavigationResponse>>;
|
|
43
43
|
getPublicSiteFeatures(): Promise<PublicApiResult<PublicSiteFeaturesResponse>>;
|
|
44
|
+
listPublicLocales(): Promise<PublicApiResult<PublicLocaleRegistryResponse>>;
|
|
45
|
+
getPublicLocalizationRelease(releaseId: LocalizationReleaseId): Promise<PublicApiResult<PublicLocalizationReleaseResponse>>;
|
|
46
|
+
getPublicLocalizationCandidatePreview(candidateId: LocalizationReleaseId, capability: LocalizationPreviewCapability): Promise<PublicApiResult<PublicLocalizationCandidatePreviewResponse>>;
|
|
47
|
+
getPublicUiCatalog(snapshotId: UiCatalogSnapshotId): Promise<PublicApiResult<PublicUiCatalogResponse>>;
|
|
44
48
|
getPublicSitemap(params?: GetPublicSitemapParams): Promise<PublicApiResult<PublicSitemapResponse>>;
|
|
45
49
|
getPublicSearchSuggestions(params: GetPublicSearchSuggestionsParams): Promise<PublicApiResult<PublicSearchSuggestionsResponse>>;
|
|
46
50
|
getPublicSearchResults(params: GetPublicSearchResultsParams): Promise<PublicApiResult<PublicSearchResultsResponse>>;
|
|
@@ -64,5 +68,7 @@ export declare const createPublicApiClient: (options: PublicApiClientOptions) =>
|
|
|
64
68
|
getPublicSiteContentBookingCancellationPolicy(): Promise<PublicApiResult<PublicSiteTrustPageContentResponse>>;
|
|
65
69
|
getPublicSiteContentCookiePolicy(): Promise<PublicApiResult<PublicSiteTrustPageContentResponse>>;
|
|
66
70
|
getPublicSiteContentAccessibilityStatement(): Promise<PublicApiResult<PublicSiteTrustPageContentResponse>>;
|
|
71
|
+
/** The Iran country page's CMS-owned editorial composition (`/destinations/iran`). */
|
|
72
|
+
getPublicSiteContentDestinationIran(): Promise<PublicApiResult<PublicSiteBlockPageContentResponse>>;
|
|
67
73
|
getPublicTravelKnowledge(params: GetPublicTravelKnowledgeParams): Promise<PublicApiResult<PublicTravelKnowledgeResponse>>;
|
|
68
74
|
};
|
package/dist/client.js
CHANGED
|
@@ -30,11 +30,13 @@ const toPublicError = async (response) => {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
const requestJson = async (url, options) => {
|
|
33
|
+
const requestJson = async (url, options, authorization) => {
|
|
34
34
|
const fetcher = options.fetchImpl || fetch;
|
|
35
35
|
const headers = new Headers();
|
|
36
36
|
if (options.requestId)
|
|
37
37
|
headers.set('x-request-id', options.requestId);
|
|
38
|
+
if (authorization)
|
|
39
|
+
headers.set('Authorization', authorization);
|
|
38
40
|
const controller = new AbortController();
|
|
39
41
|
const timeoutId = setTimeout(() => controller.abort(), options.timeoutMs ?? DEFAULT_TIMEOUT_MS);
|
|
40
42
|
let response;
|
|
@@ -83,9 +85,22 @@ const toQueryString = (params) => {
|
|
|
83
85
|
search.set('minDuration', String(params.minDuration));
|
|
84
86
|
if (params?.maxDuration !== undefined)
|
|
85
87
|
search.set('maxDuration', String(params.maxDuration));
|
|
88
|
+
if (params?.locale)
|
|
89
|
+
search.set('locale', params.locale);
|
|
90
|
+
for (const key of ['countries', 'styles', 'travelFormats', 'activityLevels', 'durationBuckets', 'journeyTypes', 'months']) {
|
|
91
|
+
if (params?.[key]?.length)
|
|
92
|
+
search.set(key, params[key].join(','));
|
|
93
|
+
}
|
|
94
|
+
for (const key of ['includeFacets', 'hasUpcomingDepartures', 'isSignature']) {
|
|
95
|
+
if (params?.[key] !== undefined)
|
|
96
|
+
search.set(key, String(params[key]));
|
|
97
|
+
}
|
|
98
|
+
if (params?.sort)
|
|
99
|
+
search.set('sort', params.sort);
|
|
86
100
|
const value = search.toString();
|
|
87
101
|
return value ? `?${value}` : '';
|
|
88
102
|
};
|
|
103
|
+
const toContentLocaleQueryString = (params) => params?.locale ? `?locale=${encodeURIComponent(params.locale)}` : '';
|
|
89
104
|
const toSitemapQueryString = (params) => {
|
|
90
105
|
const search = new URLSearchParams();
|
|
91
106
|
if (params?.type)
|
|
@@ -173,8 +188,8 @@ export const createPublicApiClient = (options) => {
|
|
|
173
188
|
listPublicTours(params) {
|
|
174
189
|
return requestJson(`${baseUrl}/api/v1/tours${toQueryString(params)}`, options);
|
|
175
190
|
},
|
|
176
|
-
getPublicTourBySlug(slug) {
|
|
177
|
-
return requestJson(`${baseUrl}/api/v1/tours/${encodeURIComponent(slug)}`, options);
|
|
191
|
+
getPublicTourBySlug(slug, params) {
|
|
192
|
+
return requestJson(`${baseUrl}/api/v1/tours/${encodeURIComponent(slug)}${toContentLocaleQueryString(params)}`, options);
|
|
178
193
|
},
|
|
179
194
|
/**
|
|
180
195
|
* ADR-0022 Tour Product/Edition MVP candidate preview: renders the same
|
|
@@ -247,6 +262,18 @@ export const createPublicApiClient = (options) => {
|
|
|
247
262
|
getPublicSiteFeatures() {
|
|
248
263
|
return requestJson(`${baseUrl}/api/v1/site-features`, options);
|
|
249
264
|
},
|
|
265
|
+
listPublicLocales() {
|
|
266
|
+
return requestJson(`${baseUrl}/api/v1/locales`, options);
|
|
267
|
+
},
|
|
268
|
+
getPublicLocalizationRelease(releaseId) {
|
|
269
|
+
return requestJson(`${baseUrl}/api/v1/localization/releases/${encodeURIComponent(releaseId)}`, options);
|
|
270
|
+
},
|
|
271
|
+
getPublicLocalizationCandidatePreview(candidateId, capability) {
|
|
272
|
+
return requestJson(`${baseUrl}/api/v1/localization/previews/${encodeURIComponent(candidateId)}`, options, `Bearer ${capability}`);
|
|
273
|
+
},
|
|
274
|
+
getPublicUiCatalog(snapshotId) {
|
|
275
|
+
return requestJson(`${baseUrl}/api/v1/localization/ui-catalogs/${encodeURIComponent(snapshotId)}`, options);
|
|
276
|
+
},
|
|
250
277
|
getPublicSitemap(params) {
|
|
251
278
|
return requestJson(`${baseUrl}/api/v1/sitemap${toSitemapQueryString(params)}`, options);
|
|
252
279
|
},
|
|
@@ -318,6 +345,10 @@ export const createPublicApiClient = (options) => {
|
|
|
318
345
|
getPublicSiteContentAccessibilityStatement() {
|
|
319
346
|
return requestJson(`${baseUrl}/api/v1/site-content/accessibility-statement`, options);
|
|
320
347
|
},
|
|
348
|
+
/** The Iran country page's CMS-owned editorial composition (`/destinations/iran`). */
|
|
349
|
+
getPublicSiteContentDestinationIran() {
|
|
350
|
+
return requestJson(`${baseUrl}/api/v1/site-content/destination-iran`, options);
|
|
351
|
+
},
|
|
321
352
|
getPublicTravelKnowledge(params) {
|
|
322
353
|
return requestJson(`${baseUrl}/api/v1/travel-knowledge${toTravelKnowledgeQueryString(params)}`, options);
|
|
323
354
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type GeneratedPublicApiVersion = '0.
|
|
2
|
-
export type GeneratedPublicApiPath = '/booking-intents' | '/booking-intents/{id}' | '/brochure-leads' | '/destinations' | '/destinations/{slug}' | '/homepage' | '/inquiries' | '/search' | '/search-suggestions' | '/site-content/about' | '/site-content/accessibility-statement' | '/site-content/booking-cancellation-policy' | '/site-content/contact' | '/site-content/cookie-policy' | '/site-content/faqs' | '/site-content/footer' | '/site-content/header' | '/site-content/health-safety-support' | '/site-content/home' | '/site-content/iran-travel-status' | '/site-content/iran-visa-information' | '/site-content/money-in-iran' | '/site-content/privacy' | '/site-content/responsible-travel' | '/site-content/tailor-made' | '/site-content/terms' | '/site-content/travel-insurance' | '/site-features' | '/site-navigation' | '/sitemap' | '/tour-categories' | '/tours' | '/tours/{slug}' | '/tours/{slug}/accommodations' | '/tours/{slug}/availability' | '/tours/{slug}/departures' | '/tours/{slug}/experiences' | '/tours/{slug}/itinerary' | '/tours/{slug}/preview' | '/tours/{slug}/questions' | '/tours/{slug}/reviews' | '/tours/{slug}/reviews-summary' | '/tours/{slug}/route' | '/travel-knowledge' | '/travel-status' | '/traveller-stories';
|
|
3
|
-
export type GeneratedPublicApiOperation = 'GET /booking-intents/{id}' | 'GET /destinations' | 'GET /destinations/{slug}' | 'GET /homepage' | 'GET /search' | 'GET /search-suggestions' | 'GET /site-content/about' | 'GET /site-content/accessibility-statement' | 'GET /site-content/booking-cancellation-policy' | 'GET /site-content/contact' | 'GET /site-content/cookie-policy' | 'GET /site-content/faqs' | 'GET /site-content/footer' | 'GET /site-content/header' | 'GET /site-content/health-safety-support' | 'GET /site-content/home' | 'GET /site-content/iran-travel-status' | 'GET /site-content/iran-visa-information' | 'GET /site-content/money-in-iran' | 'GET /site-content/privacy' | 'GET /site-content/responsible-travel' | 'GET /site-content/tailor-made' | 'GET /site-content/terms' | 'GET /site-content/travel-insurance' | 'GET /site-features' | 'GET /site-navigation' | 'GET /sitemap' | 'GET /tour-categories' | 'GET /tours' | 'GET /tours/{slug}' | 'GET /tours/{slug}/accommodations' | 'GET /tours/{slug}/availability' | 'GET /tours/{slug}/departures' | 'GET /tours/{slug}/experiences' | 'GET /tours/{slug}/itinerary' | 'GET /tours/{slug}/preview' | 'GET /tours/{slug}/questions' | 'GET /tours/{slug}/reviews' | 'GET /tours/{slug}/reviews-summary' | 'GET /tours/{slug}/route' | 'GET /travel-knowledge' | 'GET /travel-status' | 'GET /traveller-stories' | 'POST /booking-intents' | 'POST /brochure-leads' | 'POST /inquiries';
|
|
4
|
-
export type GeneratedPublicApiActiveOperation = 'GET /destinations' | 'GET /destinations/{slug}' | 'GET /homepage' | 'GET /search' | 'GET /search-suggestions' | 'GET /site-content/about' | 'GET /site-content/accessibility-statement' | 'GET /site-content/booking-cancellation-policy' | 'GET /site-content/contact' | 'GET /site-content/cookie-policy' | 'GET /site-content/faqs' | 'GET /site-content/footer' | 'GET /site-content/header' | 'GET /site-content/health-safety-support' | 'GET /site-content/home' | 'GET /site-content/iran-travel-status' | 'GET /site-content/iran-visa-information' | 'GET /site-content/money-in-iran' | 'GET /site-content/privacy' | 'GET /site-content/responsible-travel' | 'GET /site-content/tailor-made' | 'GET /site-content/terms' | 'GET /site-content/travel-insurance' | 'GET /site-features' | 'GET /site-navigation' | 'GET /sitemap' | 'GET /tour-categories' | 'GET /tours' | 'GET /tours/{slug}' | 'GET /tours/{slug}/accommodations' | 'GET /tours/{slug}/availability' | 'GET /tours/{slug}/departures' | 'GET /tours/{slug}/experiences' | 'GET /tours/{slug}/itinerary' | 'GET /tours/{slug}/preview' | 'GET /tours/{slug}/questions' | 'GET /tours/{slug}/reviews' | 'GET /tours/{slug}/reviews-summary' | 'GET /tours/{slug}/route' | 'GET /travel-knowledge' | 'GET /travel-status' | 'GET /traveller-stories' | 'POST /booking-intents' | 'POST /brochure-leads' | 'POST /inquiries';
|
|
1
|
+
export type GeneratedPublicApiVersion = '0.14.0';
|
|
2
|
+
export type GeneratedPublicApiPath = '/booking-intents' | '/booking-intents/{id}' | '/brochure-leads' | '/destinations' | '/destinations/{slug}' | '/homepage' | '/inquiries' | '/locales' | '/localization/previews/{candidateId}' | '/localization/releases/{releaseId}' | '/localization/ui-catalogs/{snapshotId}' | '/search' | '/search-suggestions' | '/site-content/about' | '/site-content/accessibility-statement' | '/site-content/booking-cancellation-policy' | '/site-content/contact' | '/site-content/cookie-policy' | '/site-content/destination-iran' | '/site-content/faqs' | '/site-content/footer' | '/site-content/header' | '/site-content/health-safety-support' | '/site-content/home' | '/site-content/iran-travel-status' | '/site-content/iran-visa-information' | '/site-content/money-in-iran' | '/site-content/privacy' | '/site-content/responsible-travel' | '/site-content/tailor-made' | '/site-content/terms' | '/site-content/travel-insurance' | '/site-features' | '/site-navigation' | '/sitemap' | '/tour-categories' | '/tours' | '/tours/{slug}' | '/tours/{slug}/accommodations' | '/tours/{slug}/availability' | '/tours/{slug}/departures' | '/tours/{slug}/experiences' | '/tours/{slug}/itinerary' | '/tours/{slug}/preview' | '/tours/{slug}/questions' | '/tours/{slug}/reviews' | '/tours/{slug}/reviews-summary' | '/tours/{slug}/route' | '/travel-knowledge' | '/travel-status' | '/traveller-stories';
|
|
3
|
+
export type GeneratedPublicApiOperation = 'GET /booking-intents/{id}' | 'GET /destinations' | 'GET /destinations/{slug}' | 'GET /homepage' | 'GET /locales' | 'GET /localization/previews/{candidateId}' | 'GET /localization/releases/{releaseId}' | 'GET /localization/ui-catalogs/{snapshotId}' | 'GET /search' | 'GET /search-suggestions' | 'GET /site-content/about' | 'GET /site-content/accessibility-statement' | 'GET /site-content/booking-cancellation-policy' | 'GET /site-content/contact' | 'GET /site-content/cookie-policy' | 'GET /site-content/destination-iran' | 'GET /site-content/faqs' | 'GET /site-content/footer' | 'GET /site-content/header' | 'GET /site-content/health-safety-support' | 'GET /site-content/home' | 'GET /site-content/iran-travel-status' | 'GET /site-content/iran-visa-information' | 'GET /site-content/money-in-iran' | 'GET /site-content/privacy' | 'GET /site-content/responsible-travel' | 'GET /site-content/tailor-made' | 'GET /site-content/terms' | 'GET /site-content/travel-insurance' | 'GET /site-features' | 'GET /site-navigation' | 'GET /sitemap' | 'GET /tour-categories' | 'GET /tours' | 'GET /tours/{slug}' | 'GET /tours/{slug}/accommodations' | 'GET /tours/{slug}/availability' | 'GET /tours/{slug}/departures' | 'GET /tours/{slug}/experiences' | 'GET /tours/{slug}/itinerary' | 'GET /tours/{slug}/preview' | 'GET /tours/{slug}/questions' | 'GET /tours/{slug}/reviews' | 'GET /tours/{slug}/reviews-summary' | 'GET /tours/{slug}/route' | 'GET /travel-knowledge' | 'GET /travel-status' | 'GET /traveller-stories' | 'POST /booking-intents' | 'POST /brochure-leads' | 'POST /inquiries';
|
|
4
|
+
export type GeneratedPublicApiActiveOperation = 'GET /destinations' | 'GET /destinations/{slug}' | 'GET /homepage' | 'GET /locales' | 'GET /localization/previews/{candidateId}' | 'GET /localization/releases/{releaseId}' | 'GET /localization/ui-catalogs/{snapshotId}' | 'GET /search' | 'GET /search-suggestions' | 'GET /site-content/about' | 'GET /site-content/accessibility-statement' | 'GET /site-content/booking-cancellation-policy' | 'GET /site-content/contact' | 'GET /site-content/cookie-policy' | 'GET /site-content/destination-iran' | 'GET /site-content/faqs' | 'GET /site-content/footer' | 'GET /site-content/header' | 'GET /site-content/health-safety-support' | 'GET /site-content/home' | 'GET /site-content/iran-travel-status' | 'GET /site-content/iran-visa-information' | 'GET /site-content/money-in-iran' | 'GET /site-content/privacy' | 'GET /site-content/responsible-travel' | 'GET /site-content/tailor-made' | 'GET /site-content/terms' | 'GET /site-content/travel-insurance' | 'GET /site-features' | 'GET /site-navigation' | 'GET /sitemap' | 'GET /tour-categories' | 'GET /tours' | 'GET /tours/{slug}' | 'GET /tours/{slug}/accommodations' | 'GET /tours/{slug}/availability' | 'GET /tours/{slug}/departures' | 'GET /tours/{slug}/experiences' | 'GET /tours/{slug}/itinerary' | 'GET /tours/{slug}/preview' | 'GET /tours/{slug}/questions' | 'GET /tours/{slug}/reviews' | 'GET /tours/{slug}/reviews-summary' | 'GET /tours/{slug}/route' | 'GET /travel-knowledge' | 'GET /travel-status' | 'GET /traveller-stories' | 'POST /booking-intents' | 'POST /brochure-leads' | 'POST /inquiries';
|
|
5
5
|
export type GeneratedPublicApiBlockedOperation = 'GET /booking-intents/{id}';
|
|
6
|
-
export type GeneratedPublicApiOperationId = 'getBookingIntent' | 'listPublicDestinations' | 'getPublicDestinationBySlug' | 'getPublicHomepage' | 'getPublicSearchResults' | 'getPublicSearchSuggestions' | 'getPublicSiteContentAbout' | 'getPublicSiteContentAccessibilityStatement' | 'getPublicSiteContentBookingCancellationPolicy' | 'getPublicSiteContentContact' | 'getPublicSiteContentCookiePolicy' | 'getPublicSiteContentFaqs' | 'getPublicSiteContentFooter' | 'getPublicSiteContentHeader' | 'getPublicSiteContentHealthSafetySupport' | 'getPublicSiteContentHome' | 'getPublicSiteContentIranTravelStatus' | 'getPublicSiteContentIranVisaInformation' | 'getPublicSiteContentMoneyInIran' | 'getPublicSiteContentPrivacy' | 'getPublicSiteContentResponsibleTravel' | 'getPublicSiteContentTailorMade' | 'getPublicSiteContentTerms' | 'getPublicSiteContentTravelInsurance' | 'getPublicSiteFeatures' | 'getPublicSiteNavigation' | 'getPublicSitemap' | 'listPublicTourCategories' | 'listPublicTours' | 'getPublicTourBySlug' | 'listPublicTourAccommodations' | 'listPublicTourAvailability' | 'listPublicTourDepartures' | 'listPublicTourExperiences' | 'listPublicTourItinerary' | 'getPublicTourPreviewBySlug' | 'listPublicTourQuestions' | 'listPublicTourReviews' | 'getPublicTourReviewsSummary' | 'listPublicTourRoute' | 'listPublicTravelKnowledge' | 'getPublicTravelStatus' | 'listPublicTravellerStories' | 'createPublicBookingIntent' | 'createPublicBrochureLead' | 'createPublicInquiry';
|
|
7
|
-
export type GeneratedPublicApiSchemaName = 'BookingIntentConflictErrorResponse' | 'BookingIntentResponse' | 'CanonicalIntakeAttribution' | 'CanonicalIntakeConsent' | 'CreateBookingIntentRequest' | 'CreateBookingIntentSuccessResponse' | 'CreateBrochureLeadRequest' | 'CreateBrochureLeadResponse' | 'CreateInquiryRequest' | 'CreateInquiryResponse' | 'GetBookingIntentStatusResponse' | 'PaginationMeta' | 'PublicApiAbuseBlockedError' | 'PublicApiError' | 'PublicApiInternalError' | 'PublicApiNotFoundError' | 'PublicApiNotImplementedError' | 'PublicApiRateLimitError' | 'PublicApiTravelStatusUnavailableError' | 'PublicApiValidationError' | 'PublicAvailabilityListItem' | 'PublicAvailabilityListResponse' | 'PublicBookingIntentLinks' | 'PublicBookingIntentPublicStatus' | 'PublicBookingIntentStatus' | 'PublicCityDestinationContent' | 'PublicCityExperience' | 'PublicCityImage' | 'PublicCityLabelledValue' | 'PublicCityLink' | 'PublicCityNextPlace' | 'PublicCityReason' | 'PublicCityResource' | 'PublicCityRoutePattern' | 'PublicCityStayLink' | 'PublicDepartureListItem' | 'PublicDepartureListResponse' | 'PublicDestinationDetail' | 'PublicDestinationDetailResponse' | 'PublicDestinationListItem' | 'PublicDestinationListResponse' | 'PublicError' | 'PublicErrorEnvelope' | 'PublicHomepageResponse' | 'PublicHomepageSeo' | 'PublicHomepageStats' | 'PublicNavLink' | 'PublicOfficialSourceCard' | 'PublicPriceDisplayByCurrency' | 'PublicSearchResultGroup' | 'PublicSearchResultItem' | 'PublicSearchResultsResponse' | 'PublicSearchSuggestion' | 'PublicSearchSuggestionsResponse' | 'PublicSeo' | 'PublicSiteChromeContent' | 'PublicSiteChromeContentResponse' | 'PublicSiteCta' | 'PublicSiteFeaturesResponse' | 'PublicSiteFeatureStates' | 'PublicSiteHeaderMenuCategory' | 'PublicSiteHeaderMenuEditorial' | 'PublicSiteHeaderOffice' | 'PublicSiteHeaderQuickLink' | 'PublicSiteHeaderSearchShortcuts' | 'PublicSiteHomeContent' | 'PublicSiteHomeContentResponse' | 'PublicSiteHomeSection' | 'PublicSitemapEntry' | 'PublicSitemapResponse' | 'PublicSiteNavigationResponse' | 'PublicSiteNavItem' | 'PublicSiteRouteKey' | 'PublicSiteSocialLink' | 'PublicSiteTrustPageContent' | 'PublicSiteTrustPageContentResponse' | 'PublicSiteTrustPageSeo' | 'PublicSiteTrustSection' | 'PublicSiteTrustTitledItem' | 'PublicStaticLink' | 'PublicSurfiranOperationalUpdate' | 'PublicTourAccommodationListItem' | 'PublicTourAccommodationListResponse' | 'PublicTourCategoryListItem' | 'PublicTourCategoryListResponse' | 'PublicTourDetail' | 'PublicTourDetailEditorial' | 'PublicTourDetailResponse' | 'PublicTourExperienceFrame' | 'PublicTourExperienceListItem' | 'PublicTourExperienceListResponse' | 'PublicTourItineraryDay' | 'PublicTourItineraryResponse' | 'PublicTourListItem' | 'PublicTourListResponse' | 'PublicTourQuestionListItem' | 'PublicTourQuestionListResponse' | 'PublicTourRatingBreakdownItem' | 'PublicTourReviewListItem' | 'PublicTourReviewListResponse' | 'PublicTourReviewsAggregate' | 'PublicTourReviewsSummary' | 'PublicTourReviewsSummaryResponse' | 'PublicTourRouteResponse' | 'PublicTourRouteStop' | 'PublicTourTailorJourney' | 'PublicTravelKnowledgeItem' | 'PublicTravelKnowledgeResponse' | 'PublicTravellerStoryListItem' | 'PublicTravellerStoryListResponse' | 'PublicTravelStatusCorrectionNotice' | 'PublicTravelStatusFreshness' | 'PublicTravelStatusHandoff' | 'PublicTravelStatusResponse' | 'PublicTravelStatusReviewerLabel' | 'PublicTravelStatusSection' | 'PublicTravelStatusState' | 'PublicTripBrief';
|
|
6
|
+
export type GeneratedPublicApiOperationId = 'getBookingIntent' | 'listPublicDestinations' | 'getPublicDestinationBySlug' | 'getPublicHomepage' | 'listPublicLocales' | 'getPublicLocalizationCandidatePreview' | 'getPublicLocalizationRelease' | 'getPublicUiCatalog' | 'getPublicSearchResults' | 'getPublicSearchSuggestions' | 'getPublicSiteContentAbout' | 'getPublicSiteContentAccessibilityStatement' | 'getPublicSiteContentBookingCancellationPolicy' | 'getPublicSiteContentContact' | 'getPublicSiteContentCookiePolicy' | 'getPublicSiteContentDestinationIran' | 'getPublicSiteContentFaqs' | 'getPublicSiteContentFooter' | 'getPublicSiteContentHeader' | 'getPublicSiteContentHealthSafetySupport' | 'getPublicSiteContentHome' | 'getPublicSiteContentIranTravelStatus' | 'getPublicSiteContentIranVisaInformation' | 'getPublicSiteContentMoneyInIran' | 'getPublicSiteContentPrivacy' | 'getPublicSiteContentResponsibleTravel' | 'getPublicSiteContentTailorMade' | 'getPublicSiteContentTerms' | 'getPublicSiteContentTravelInsurance' | 'getPublicSiteFeatures' | 'getPublicSiteNavigation' | 'getPublicSitemap' | 'listPublicTourCategories' | 'listPublicTours' | 'getPublicTourBySlug' | 'listPublicTourAccommodations' | 'listPublicTourAvailability' | 'listPublicTourDepartures' | 'listPublicTourExperiences' | 'listPublicTourItinerary' | 'getPublicTourPreviewBySlug' | 'listPublicTourQuestions' | 'listPublicTourReviews' | 'getPublicTourReviewsSummary' | 'listPublicTourRoute' | 'listPublicTravelKnowledge' | 'getPublicTravelStatus' | 'listPublicTravellerStories' | 'createPublicBookingIntent' | 'createPublicBrochureLead' | 'createPublicInquiry';
|
|
7
|
+
export type GeneratedPublicApiSchemaName = 'BookingIntentConflictErrorResponse' | 'BookingIntentResponse' | 'CanonicalIntakeAttribution' | 'CanonicalIntakeConsent' | 'CreateBookingIntentRequest' | 'CreateBookingIntentSuccessResponse' | 'CreateBrochureLeadRequest' | 'CreateBrochureLeadResponse' | 'CreateInquiryRequest' | 'CreateInquiryResponse' | 'GetBookingIntentStatusResponse' | 'PaginationMeta' | 'PublicApiAbuseBlockedError' | 'PublicApiError' | 'PublicApiInternalError' | 'PublicApiNotFoundError' | 'PublicApiNotImplementedError' | 'PublicApiRateLimitError' | 'PublicApiTravelStatusUnavailableError' | 'PublicApiValidationError' | 'PublicAvailabilityListItem' | 'PublicAvailabilityListResponse' | 'PublicBookingIntentLinks' | 'PublicBookingIntentPublicStatus' | 'PublicBookingIntentStatus' | 'PublicCityDestinationContent' | 'PublicCityExperience' | 'PublicCityImage' | 'PublicCityLabelledValue' | 'PublicCityLink' | 'PublicCityNextPlace' | 'PublicCityReason' | 'PublicCityResource' | 'PublicCityRoutePattern' | 'PublicCityStayLink' | 'PublicCmsContentSnapshotId' | 'PublicDepartureListItem' | 'PublicDepartureListResponse' | 'PublicDestinationDetail' | 'PublicDestinationDetailResponse' | 'PublicDestinationListItem' | 'PublicDestinationListResponse' | 'PublicError' | 'PublicErrorEnvelope' | 'PublicHomepageResponse' | 'PublicHomepageSeo' | 'PublicHomepageStats' | 'PublicLocaleRegistryData' | 'PublicLocaleRegistryItem' | 'PublicLocaleRegistryResponse' | 'PublicLocaleTag' | 'PublicLocalizationCandidatePreview' | 'PublicLocalizationCandidatePreviewResponse' | 'PublicLocalizationRelease' | 'PublicLocalizationReleaseId' | 'PublicLocalizationReleaseResponse' | 'PublicLocalizationSnapshotReferences' | 'PublicNavLink' | 'PublicOfficialSourceCard' | 'PublicPriceDisplayByCurrency' | 'PublicSearchResultGroup' | 'PublicSearchResultItem' | 'PublicSearchResultsResponse' | 'PublicSearchSuggestion' | 'PublicSearchSuggestionsResponse' | 'PublicSeo' | 'PublicSiteBlockPageContentResponse' | 'PublicSiteChromeContent' | 'PublicSiteChromeContentResponse' | 'PublicSiteCta' | 'PublicSiteFeaturesResponse' | 'PublicSiteFeatureStates' | 'PublicSiteFooterNavGroup' | 'PublicSiteFooterNavGroupLink' | 'PublicSiteFooterPaymentNote' | 'PublicSiteFooterSupportBand' | 'PublicSiteHeaderMenuCategory' | 'PublicSiteHeaderMenuEditorial' | 'PublicSiteHeaderOffice' | 'PublicSiteHeaderQuickLink' | 'PublicSiteHeaderSearchShortcuts' | 'PublicSiteHomeContent' | 'PublicSiteHomeContentResponse' | 'PublicSiteHomeSection' | 'PublicSitemapEntry' | 'PublicSitemapResponse' | 'PublicSiteNavigationResponse' | 'PublicSiteNavItem' | 'PublicSiteRouteKey' | 'PublicSiteSocialLink' | 'PublicSiteTrustPageContent' | 'PublicSiteTrustPageContentResponse' | 'PublicSiteTrustPageSeo' | 'PublicSiteTrustSection' | 'PublicSiteTrustTitledItem' | 'PublicStaticLink' | 'PublicSurfiranOperationalUpdate' | 'PublicTourAccommodationListItem' | 'PublicTourAccommodationListResponse' | 'PublicTourCatalogDepartureSummary' | 'PublicTourCatalogFacetOption' | 'PublicTourCatalogMetadata' | 'PublicTourCatalogStartingFrom' | 'PublicTourCategoryListItem' | 'PublicTourCategoryListResponse' | 'PublicTourDetail' | 'PublicTourDetailEditorial' | 'PublicTourDetailResponse' | 'PublicTourExperienceFrame' | 'PublicTourExperienceListItem' | 'PublicTourExperienceListResponse' | 'PublicTourItineraryDay' | 'PublicTourItineraryResponse' | 'PublicTourListItem' | 'PublicTourListResponse' | 'PublicTourMediaItem' | 'PublicTourQuestionListItem' | 'PublicTourQuestionListResponse' | 'PublicTourRatingBreakdownItem' | 'PublicTourReviewListItem' | 'PublicTourReviewListResponse' | 'PublicTourReviewsAggregate' | 'PublicTourReviewsSummary' | 'PublicTourReviewsSummaryResponse' | 'PublicTourRouteResponse' | 'PublicTourRouteStop' | 'PublicTourTailorJourney' | 'PublicTravelKnowledgeItem' | 'PublicTravelKnowledgeResponse' | 'PublicTravellerStoryListItem' | 'PublicTravellerStoryListResponse' | 'PublicTravelStatusCorrectionNotice' | 'PublicTravelStatusFreshness' | 'PublicTravelStatusHandoff' | 'PublicTravelStatusResponse' | 'PublicTravelStatusReviewerLabel' | 'PublicTravelStatusSection' | 'PublicTravelStatusState' | 'PublicTripBrief' | 'PublicUiCatalog' | 'PublicUiCatalogFallbackSummary' | 'PublicUiCatalogMessage' | 'PublicUiCatalogResponse' | 'PublicUiCatalogSnapshotId';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createPublicApiClient } from './client.js';
|
|
2
|
-
export type { PublicApiErrorCode, PublicApiV1Path, PublicApiV1RouteMap, PublicError, PublicErrorEnvelope, PublicApiError, PublicApiNotImplementedError, PublicApiValidationError, PublicApiRateLimitError, PublicApiAbuseBlockedError, PublicTourListItem, PublicTourDetail, PublicTourDetailEditorial, PublicDepartureListItem, PublicAvailabilityStatus, PublicAvailabilityListItem, PublicAvailabilityListResponse, PublicDestinationListItem, PublicCityDestinationContent, PublicCityExperience, PublicCityImage, PublicCityLabelledValue, PublicCityLink, PublicCityNextPlace, PublicCityReason, PublicCityResource, PublicCityStayLink, PublicDestinationDetail, PublicTourListResponse, PublicTourDetailResponse, PublicDepartureListResponse, PublicDestinationListResponse, PublicDestinationDetailResponse, PublicApiResult, ListPublicToursParams, GetPublicTourPreviewParams, ListPublicDeparturesParams, ListPublicTourAvailabilityParams, ListPublicDestinationsParams, PublicInquiryRequest, PublicTourTailorJourney, PublicInquiryResponse, PublicBookingIntentRequest, PublicBookingIntentData, PublicBookingIntentResponse, PublicHomepageStats, PublicHomepageSeo, PublicHomepageResponse, PublicSitemapEntry, PublicSitemapResponse, PublicNavLink, PublicStaticLink, PublicSiteNavigationResponse, PublicTourCategoryListItem, PublicTourCategoryListResponse, PublicPriceDisplayByCurrency, PublicSearchResultItem, PublicSearchResultGroup, PublicSearchResultsResponse, PublicSearchSuggestion, PublicSearchSuggestionsResponse, PublicSiteRouteKey, PublicSiteCta, PublicSiteHomeSectionType, PublicSiteHomeSection, PublicSiteHomeContent, PublicSiteHomeContentResponse, PublicSiteNavItem, PublicSiteSocialPlatform, PublicSiteSocialLink, PublicSiteHeaderOffice, PublicSiteHeaderMenuCategory, PublicSiteHeaderMenuEditorial, PublicSiteHeaderQuickLink, PublicSiteHeaderSearchShortcuts, PublicSiteChromeContent, PublicSiteChromeContentResponse, PublicSiteFeatureStates, PublicSiteFeaturesResponse, PublicSiteTrustSectionType, PublicSiteTrustTitledItem, PublicSiteTrustParagraphGroup, PublicSiteTrustTitledItemList, PublicSiteTrustBulletList, PublicSiteTrustSection, PublicSiteTrustPageSeo, PublicSiteTrustPageContent, PublicSiteTrustPageContentResponse, PublicTravelStatusState, PublicTravelStatusFreshness, PublicSurfiranOperationalUpdate, PublicTravelStatusResponse, PublicTravelKnowledgeType, PublicTravelKnowledgeItem, PublicTravelKnowledgeResponse, GetPublicSitemapParams, GetPublicSearchResultsParams, GetPublicSearchSuggestionsParams, GetPublicTravelKnowledgeParams, ListPublicTourCategoriesParams, PublicTravellerStoryListItem, PublicTravellerStoryListResponse, ListPublicTravellerStoriesParams, PublicTourQuestionListItem, PublicTourQuestionListResponse, ListPublicTourQuestionsParams, PublicTourExperienceFrame, PublicTourExperienceListItem, PublicTourExperienceListResponse, ListPublicTourExperiencesParams, PublicTourAccommodationListItem, PublicTourAccommodationListResponse, ListPublicTourAccommodationsParams, PublicTourReviewsAggregate, PublicTourRatingBreakdownItem, PublicTourReviewsSummary, PublicTourReviewsSummaryResponse, PublicTourReviewListItem, PublicTourReviewListResponse, PublicTourReviewsLimit, ListPublicTourReviewsParams, PublicTourRouteStop, PublicTourRouteResponse, ListPublicTourRouteParams, PublicItineraryMealCode, PublicTourItineraryDay, PublicTourItineraryResponse, ListPublicTourItineraryParams, PublicBrochureLeadRequest, PublicBrochureLeadResponse, } from './types.js';
|
|
2
|
+
export type { PublicApiErrorCode, PublicApiV1Path, PublicApiV1RouteMap, PublicError, PublicErrorEnvelope, PublicApiError, PublicApiNotImplementedError, PublicApiValidationError, PublicApiRateLimitError, PublicApiAbuseBlockedError, PublicTourListItem, PublicTourDetail, PublicTourDetailEditorial, PublicDepartureListItem, PublicAvailabilityStatus, PublicAvailabilityListItem, PublicAvailabilityListResponse, PublicDestinationListItem, PublicCityDestinationContent, PublicCityExperience, PublicCityImage, PublicCityLabelledValue, PublicCityLink, PublicCityNextPlace, PublicCityReason, PublicCityResource, PublicCityStayLink, PublicDestinationDetail, PublicTourListResponse, PublicTourCatalogMetadata, PublicTourCatalogFacetKey, PublicTourCatalogFacetOption, PublicTourCatalogSort, PublicTourCatalogStartingFrom, PublicTourCatalogDepartureSummary, PublicTourDetailResponse, PublicDepartureListResponse, PublicDestinationListResponse, PublicDestinationDetailResponse, PublicApiResult, ListPublicToursParams, GetPublicTourParams, PublicContentLocale, GetPublicTourPreviewParams, ListPublicDeparturesParams, ListPublicTourAvailabilityParams, ListPublicDestinationsParams, PublicInquiryRequest, PublicTourTailorJourney, PublicInquiryResponse, PublicBookingIntentRequest, PublicBookingIntentData, PublicBookingIntentResponse, PublicHomepageStats, PublicHomepageSeo, PublicHomepageResponse, PublicSitemapEntry, PublicSitemapResponse, PublicNavLink, PublicStaticLink, PublicSiteNavigationResponse, PublicTourCategoryListItem, PublicTourCategoryListResponse, PublicPriceDisplayByCurrency, PublicSearchResultItem, PublicSearchResultGroup, PublicSearchResultsResponse, PublicSearchSuggestion, PublicSearchSuggestionsResponse, PublicSiteRouteKey, PublicSiteCta, PublicSiteHomeSectionType, PublicSiteHomeSection, PublicSiteHomeContent, PublicSiteHomeContentResponse, PublicSiteNavItem, PublicSiteSocialPlatform, PublicSiteSocialLink, PublicSiteHeaderOffice, PublicSiteHeaderMenuCategory, PublicSiteHeaderMenuEditorial, PublicSiteHeaderQuickLink, PublicSiteHeaderSearchShortcuts, PublicSiteFooterNavGroupLink, PublicSiteFooterNavGroup, PublicSiteFooterSupportBand, PublicSiteFooterPaymentNote, PublicSiteChromeContent, PublicSiteChromeContentResponse, PublicSiteFeatureStates, PublicSiteFeaturesResponse, LocaleTag, LocalizationReleaseId, UiCatalogSnapshotId, CmsContentSnapshotId, PublicLocaleRegistryItem, PublicLocaleRegistryResponse, PublicLocalizationRelease, PublicLocalizationReleaseResponse, PublicUiCatalogMessage, PublicUiCatalog, PublicUiCatalogResponse, PublicSiteTrustSectionType, PublicSiteTrustTitledItem, PublicSiteTrustParagraphGroup, PublicSiteTrustTitledItemList, PublicSiteTrustBulletList, PublicSiteTrustSection, PublicSiteTrustPageSeo, PublicSiteTrustPageContent, PublicSiteTrustPageContentResponse, PublicSiteBlock, PublicSiteBlockPageContent, PublicSiteBlockPageContentResponse, PublicTravelStatusState, PublicTravelStatusFreshness, PublicSurfiranOperationalUpdate, PublicTravelStatusResponse, PublicTravelKnowledgeType, PublicTravelKnowledgeItem, PublicTravelKnowledgeResponse, GetPublicSitemapParams, GetPublicSearchResultsParams, GetPublicSearchSuggestionsParams, GetPublicTravelKnowledgeParams, ListPublicTourCategoriesParams, PublicTravellerStoryListItem, PublicTravellerStoryListResponse, ListPublicTravellerStoriesParams, PublicTourQuestionListItem, PublicTourQuestionListResponse, ListPublicTourQuestionsParams, PublicTourExperienceFrame, PublicTourExperienceListItem, PublicTourExperienceListResponse, ListPublicTourExperiencesParams, PublicTourAccommodationListItem, PublicTourAccommodationListResponse, ListPublicTourAccommodationsParams, PublicTourReviewsAggregate, PublicTourRatingBreakdownItem, PublicTourReviewsSummary, PublicTourReviewsSummaryResponse, PublicTourReviewListItem, PublicTourReviewListResponse, PublicTourReviewsLimit, ListPublicTourReviewsParams, PublicTourRouteStop, PublicTourRouteResponse, ListPublicTourRouteParams, PublicItineraryMealCode, PublicTourItineraryDay, PublicTourItineraryResponse, ListPublicTourItineraryParams, PublicBrochureLeadRequest, PublicBrochureLeadResponse, } from './types.js';
|
|
3
3
|
export type { PublicApiClientOptions } from './client.js';
|
|
4
4
|
export type { GeneratedPublicApiVersion, GeneratedPublicApiPath, GeneratedPublicApiOperation, GeneratedPublicApiActiveOperation, GeneratedPublicApiBlockedOperation, GeneratedPublicApiOperationId, GeneratedPublicApiSchemaName, } from './generated/public-api-v1.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type PublicApiErrorCode = 'PUBLIC_API_ROUTE_NOT_IMPLEMENTED' | 'PUBLIC_API_INTERNAL_ERROR' | 'PUBLIC_API_TOUR_NOT_FOUND' | 'PUBLIC_API_DESTINATION_NOT_FOUND' | 'PUBLIC_API_INVALID_QUERY' | 'PUBLIC_API_BOOKING_INTENT_VALIDATION_ERROR' | 'PUBLIC_API_IDEMPOTENCY_CONFLICT' | 'PUBLIC_API_RATE_LIMITED' | 'PUBLIC_API_ABUSE_BLOCKED' | 'PUBLIC_API_TRAVEL_STATUS_UNAVAILABLE' | 'PUBLIC_API_SITE_CONTENT_UNAVAILABLE' | 'PUBLIC_API_CLIENT_TIMEOUT';
|
|
2
|
-
export type PublicApiV1Path = '/homepage' | '/site-navigation' | '/site-features' | '/sitemap' | '/search-suggestions' | '/tour-categories' | '/tours' | '/tours/{slug}' | '/tours/{slug}/preview' | '/tours/{slug}/departures' | '/tours/{slug}/availability' | '/tours/{slug}/reviews' | '/destinations' | '/destinations/{slug}' | '/inquiries' | '/booking-intents' | '/travel-status' | '/travel-knowledge' | '/site-content/home' | '/site-content/header' | '/site-content/footer' | '/site-content/about' | '/site-content/contact' | '/site-content/tailor-made' | '/site-content/faqs' | '/site-content/privacy' | '/site-content/terms' | '/site-content/responsible-travel' | '/site-content/iran-travel-status' | '/site-content/iran-visa-information' | '/site-content/money-in-iran' | '/site-content/travel-insurance' | '/site-content/health-safety-support' | '/site-content/booking-cancellation-policy' | '/site-content/cookie-policy' | '/site-content/accessibility-statement';
|
|
1
|
+
export type PublicApiErrorCode = 'PUBLIC_API_ROUTE_NOT_IMPLEMENTED' | 'PUBLIC_API_INTERNAL_ERROR' | 'PUBLIC_API_TOUR_NOT_FOUND' | 'PUBLIC_API_DESTINATION_NOT_FOUND' | 'PUBLIC_API_INVALID_QUERY' | 'PUBLIC_API_BOOKING_INTENT_VALIDATION_ERROR' | 'PUBLIC_API_IDEMPOTENCY_CONFLICT' | 'PUBLIC_API_RATE_LIMITED' | 'PUBLIC_API_ABUSE_BLOCKED' | 'PUBLIC_API_TRAVEL_STATUS_UNAVAILABLE' | 'PUBLIC_API_SITE_CONTENT_UNAVAILABLE' | 'PUBLIC_API_LOCALIZATION_NOT_FOUND' | 'PUBLIC_API_LOCALIZATION_UNAVAILABLE' | 'PUBLIC_API_CLIENT_TIMEOUT';
|
|
2
|
+
export type PublicApiV1Path = '/homepage' | '/site-navigation' | '/site-features' | '/locales' | '/localization/previews/{candidateId}' | '/localization/releases/{releaseId}' | '/localization/ui-catalogs/{snapshotId}' | '/sitemap' | '/search-suggestions' | '/tour-categories' | '/tours' | '/tours/{slug}' | '/tours/{slug}/preview' | '/tours/{slug}/departures' | '/tours/{slug}/availability' | '/tours/{slug}/reviews' | '/destinations' | '/destinations/{slug}' | '/inquiries' | '/booking-intents' | '/travel-status' | '/travel-knowledge' | '/site-content/home' | '/site-content/header' | '/site-content/footer' | '/site-content/about' | '/site-content/contact' | '/site-content/tailor-made' | '/site-content/faqs' | '/site-content/privacy' | '/site-content/terms' | '/site-content/responsible-travel' | '/site-content/iran-travel-status' | '/site-content/iran-visa-information' | '/site-content/money-in-iran' | '/site-content/travel-insurance' | '/site-content/health-safety-support' | '/site-content/booking-cancellation-policy' | '/site-content/cookie-policy' | '/site-content/accessibility-statement' | '/site-content/destination-iran';
|
|
3
3
|
export type PublicError = {
|
|
4
4
|
code: string;
|
|
5
5
|
message: string;
|
|
@@ -66,6 +66,8 @@ export type PublicPriceDisplayByCurrency = {
|
|
|
66
66
|
GBP: string | null;
|
|
67
67
|
};
|
|
68
68
|
export type PublicTourListItem = {
|
|
69
|
+
/** Published dates, independent of capacity; present in catalog mode. */
|
|
70
|
+
departureSummary?: PublicTourCatalogDepartureSummary;
|
|
69
71
|
id: number;
|
|
70
72
|
slug: string;
|
|
71
73
|
title: string;
|
|
@@ -81,10 +83,9 @@ export type PublicTourListItem = {
|
|
|
81
83
|
* string and can neither round nor format differently.
|
|
82
84
|
*
|
|
83
85
|
* A currency with no active rate for this price's own currency is `null`, and
|
|
84
|
-
* the consumer falls back to `startingPriceDisplay` as published.
|
|
85
|
-
* a response projected before this field existed still typechecks.
|
|
86
|
+
* the consumer falls back to `startingPriceDisplay` as published.
|
|
86
87
|
*/
|
|
87
|
-
priceDisplayByCurrency
|
|
88
|
+
priceDisplayByCurrency: PublicPriceDisplayByCurrency;
|
|
88
89
|
heroImage: string | null;
|
|
89
90
|
primaryDestinations: string[];
|
|
90
91
|
/**
|
|
@@ -408,6 +409,7 @@ export type PublicAvailabilityListItem = {
|
|
|
408
409
|
bookingStatus: 'open' | 'closed' | null;
|
|
409
410
|
currency: string | null;
|
|
410
411
|
priceDisplay: string | null;
|
|
412
|
+
priceDisplayByCurrency: PublicPriceDisplayByCurrency;
|
|
411
413
|
promoLabel?: string | null;
|
|
412
414
|
publicNote?: string | null;
|
|
413
415
|
roomBasis?: 'twin_share' | 'double_share' | 'single_room' | 'triple_share' | 'family_room' | null;
|
|
@@ -415,6 +417,7 @@ export type PublicAvailabilityListItem = {
|
|
|
415
417
|
basis: 'twin_share' | 'double_share' | 'single_room' | 'private_departure';
|
|
416
418
|
label: string;
|
|
417
419
|
priceDisplay: string;
|
|
420
|
+
priceDisplayByCurrency: PublicPriceDisplayByCurrency;
|
|
418
421
|
minimumTravelers?: number;
|
|
419
422
|
}>;
|
|
420
423
|
remainingCapacityBucket: 'available' | 'limited' | 'full' | 'unconstrained' | 'unknown';
|
|
@@ -575,7 +578,47 @@ export type PublicTourListResponse = {
|
|
|
575
578
|
data: PublicTourListItem[];
|
|
576
579
|
nextCursor: string | null;
|
|
577
580
|
total: number;
|
|
581
|
+
catalog?: PublicTourCatalogMetadata;
|
|
578
582
|
};
|
|
583
|
+
export type PublicTourCatalogDepartureSummary = {
|
|
584
|
+
nextDepartureDate: string | null;
|
|
585
|
+
upcomingCount: number;
|
|
586
|
+
upcomingMonths: string[];
|
|
587
|
+
};
|
|
588
|
+
export type PublicTourCatalogFacetKey = 'countries' | 'styles' | 'travelFormats' | 'activityLevels' | 'durationBuckets' | 'journeyTypes' | 'months';
|
|
589
|
+
export type PublicTourCatalogFacetOption = {
|
|
590
|
+
value: string;
|
|
591
|
+
label: string;
|
|
592
|
+
count: number;
|
|
593
|
+
};
|
|
594
|
+
/**
|
|
595
|
+
* Lowest published starting price across every tour the filters match, not only
|
|
596
|
+
* the returned page, resolved through the same tiers as a tour card. Finished
|
|
597
|
+
* display strings only.
|
|
598
|
+
*/
|
|
599
|
+
export type PublicTourCatalogStartingFrom = {
|
|
600
|
+
startingPriceDisplay: string;
|
|
601
|
+
currency: string;
|
|
602
|
+
priceDisplayByCurrency: PublicPriceDisplayByCurrency;
|
|
603
|
+
/** How many matching tours publish a price; the minimum is over these. */
|
|
604
|
+
pricedTourCount: number;
|
|
605
|
+
};
|
|
606
|
+
export type PublicTourCatalogMetadata = {
|
|
607
|
+
asOf: string;
|
|
608
|
+
unfilteredTotal: number;
|
|
609
|
+
facets: Record<PublicTourCatalogFacetKey, PublicTourCatalogFacetOption[]>;
|
|
610
|
+
/**
|
|
611
|
+
* Null when no matching tour publishes a price or the priced tours span more
|
|
612
|
+
* than one currency.
|
|
613
|
+
*/
|
|
614
|
+
startingFrom: PublicTourCatalogStartingFrom | null;
|
|
615
|
+
};
|
|
616
|
+
/**
|
|
617
|
+
* `signature-rank` selects the operator's Signature band: only tours with a published
|
|
618
|
+
* positive `signatureRank` (null never appears in the band), rank ascending, ties by id.
|
|
619
|
+
* Pair it with `isSignature: true`.
|
|
620
|
+
*/
|
|
621
|
+
export type PublicTourCatalogSort = 'departure-soonest' | 'duration-asc' | 'duration-desc' | 'signature-rank' | 'default';
|
|
579
622
|
export type PublicTourDetailResponse = {
|
|
580
623
|
data: PublicTourDetail;
|
|
581
624
|
};
|
|
@@ -959,7 +1002,7 @@ export type PublicTravelStatusResponse = {
|
|
|
959
1002
|
};
|
|
960
1003
|
};
|
|
961
1004
|
/** Closed public route vocabulary. Routing is resolved by the rendering layer. */
|
|
962
|
-
export type PublicSiteRouteKey = 'home' | 'tours' | 'tour-categories' | 'destinations' | 'about' | 'contact' | 'inquire' | 'faqs' | 'privacy' | 'terms' | 'responsible-travel' | 'iran-travel-status' | 'iran-visa-information' | 'money-in-iran' | 'travel-insurance' | 'health-safety-support' | 'booking-cancellation-policy' | 'cookie-policy' | 'accessibility-statement' | 'reviews' | 'travel-trade' | 'tailor-made';
|
|
1005
|
+
export type PublicSiteRouteKey = 'home' | 'tours' | 'tour-categories' | 'destinations' | 'about' | 'contact' | 'inquire' | 'faqs' | 'privacy' | 'terms' | 'responsible-travel' | 'iran-travel-status' | 'iran-visa-information' | 'money-in-iran' | 'travel-insurance' | 'health-safety-support' | 'booking-cancellation-policy' | 'cookie-policy' | 'accessibility-statement' | 'destination-iran' | 'reviews' | 'travel-trade' | 'tailor-made' | 'ask-a-specialist' | 'journal' | 'travel-guide' | 'airport-transfers';
|
|
963
1006
|
export type PublicSiteCta = {
|
|
964
1007
|
label: string;
|
|
965
1008
|
routeKey: PublicSiteRouteKey;
|
|
@@ -1033,6 +1076,28 @@ export type PublicSiteHeaderSearchShortcuts = {
|
|
|
1033
1076
|
popularSearches: string[];
|
|
1034
1077
|
quickLinks: PublicSiteHeaderQuickLink[];
|
|
1035
1078
|
};
|
|
1079
|
+
/** One link inside a footer navigation group. Carries a closed route key, never a path. */
|
|
1080
|
+
export type PublicSiteFooterNavGroupLink = {
|
|
1081
|
+
label: string;
|
|
1082
|
+
routeKey: PublicSiteRouteKey;
|
|
1083
|
+
};
|
|
1084
|
+
/** One of the footer's grouped navigation columns (for example "Explore"). */
|
|
1085
|
+
export type PublicSiteFooterNavGroup = {
|
|
1086
|
+
title: string;
|
|
1087
|
+
links: PublicSiteFooterNavGroupLink[];
|
|
1088
|
+
};
|
|
1089
|
+
/** The footer's "Planning a trip to Iran?" support band. `null` when nothing is published. */
|
|
1090
|
+
export type PublicSiteFooterSupportBand = {
|
|
1091
|
+
heading: string | null;
|
|
1092
|
+
body: string | null;
|
|
1093
|
+
primary: PublicSiteCta | null;
|
|
1094
|
+
secondary: PublicSiteCta | null;
|
|
1095
|
+
};
|
|
1096
|
+
/** The footer's "Payment" row body copy and its one CTA. `null` when nothing is published. */
|
|
1097
|
+
export type PublicSiteFooterPaymentNote = {
|
|
1098
|
+
body: string | null;
|
|
1099
|
+
cta: PublicSiteCta | null;
|
|
1100
|
+
};
|
|
1036
1101
|
export type PublicSiteChromeContent = {
|
|
1037
1102
|
navItems: PublicSiteNavItem[];
|
|
1038
1103
|
cta: PublicSiteCta | null;
|
|
@@ -1050,6 +1115,16 @@ export type PublicSiteChromeContent = {
|
|
|
1050
1115
|
office?: PublicSiteHeaderOffice | null;
|
|
1051
1116
|
menuEditorial?: PublicSiteHeaderMenuEditorial | null;
|
|
1052
1117
|
searchShortcuts?: PublicSiteHeaderSearchShortcuts | null;
|
|
1118
|
+
/**
|
|
1119
|
+
* Footer editorial. These exist on both shared surfaces so the shape is
|
|
1120
|
+
* stable, but they are Footer concepts: the Header publishes an empty array
|
|
1121
|
+
* / `null` for each.
|
|
1122
|
+
*
|
|
1123
|
+
* Optional so a response projected before these fields existed typechecks.
|
|
1124
|
+
*/
|
|
1125
|
+
navGroups?: PublicSiteFooterNavGroup[];
|
|
1126
|
+
supportBand?: PublicSiteFooterSupportBand | null;
|
|
1127
|
+
paymentNote?: PublicSiteFooterPaymentNote | null;
|
|
1053
1128
|
};
|
|
1054
1129
|
export type PublicSiteChromeContentResponse = {
|
|
1055
1130
|
data: PublicSiteChromeContent | null;
|
|
@@ -1101,6 +1176,27 @@ export type PublicSiteTrustPageContent = {
|
|
|
1101
1176
|
export type PublicSiteTrustPageContentResponse = {
|
|
1102
1177
|
data: PublicSiteTrustPageContent | null;
|
|
1103
1178
|
};
|
|
1179
|
+
/** One published block of a registry-driven CMS page composition. */
|
|
1180
|
+
export type PublicSiteBlock = {
|
|
1181
|
+
/** One of the closed block types in the public block registry. */
|
|
1182
|
+
blockType: string;
|
|
1183
|
+
/** Stable authored id, unique within the page. Used as the DOM anchor. */
|
|
1184
|
+
blockId: string;
|
|
1185
|
+
/** Projected public-safe field values, shaped by the versioned block registry rather than this contract. */
|
|
1186
|
+
values: Record<string, unknown>;
|
|
1187
|
+
};
|
|
1188
|
+
/**
|
|
1189
|
+
* A block-only CMS page such as the Iran country page. There is no flat
|
|
1190
|
+
* trust-page snapshot, so the flat fields are empty strings and `blocks`
|
|
1191
|
+
* carries the page.
|
|
1192
|
+
*/
|
|
1193
|
+
export type PublicSiteBlockPageContent = PublicSiteTrustPageContent & {
|
|
1194
|
+
blocks: PublicSiteBlock[];
|
|
1195
|
+
};
|
|
1196
|
+
export type PublicSiteBlockPageContentResponse = {
|
|
1197
|
+
/** Null when no valid published composition exists for this page. */
|
|
1198
|
+
data: PublicSiteBlockPageContent | null;
|
|
1199
|
+
};
|
|
1104
1200
|
/**
|
|
1105
1201
|
* Effective on/off state for every known public website feature.
|
|
1106
1202
|
*
|
|
@@ -1172,10 +1268,97 @@ export type PublicSiteFeaturesResponse = {
|
|
|
1172
1268
|
features: PublicSiteFeatureStates;
|
|
1173
1269
|
};
|
|
1174
1270
|
};
|
|
1271
|
+
export type LocaleTag = string;
|
|
1272
|
+
export type LocalizationReleaseId = `lr1_${string}`;
|
|
1273
|
+
export type LocalizationPreviewCapability = string;
|
|
1274
|
+
export type UiCatalogSnapshotId = `ui1_${string}`;
|
|
1275
|
+
export type CmsContentSnapshotId = `cms1_${string}`;
|
|
1276
|
+
export type PublicLocaleRegistryItem = {
|
|
1277
|
+
localeTag: LocaleTag;
|
|
1278
|
+
language: string;
|
|
1279
|
+
script: string | null;
|
|
1280
|
+
region: string | null;
|
|
1281
|
+
direction: 'ltr' | 'rtl';
|
|
1282
|
+
routePrefix: string;
|
|
1283
|
+
hreflangTag: LocaleTag;
|
|
1284
|
+
fallbackLocaleTag: LocaleTag | null;
|
|
1285
|
+
isDefault: boolean;
|
|
1286
|
+
defaultCalendar: string;
|
|
1287
|
+
defaultNumberingSystem: string;
|
|
1288
|
+
defaultTimeZone: string;
|
|
1289
|
+
activeReleaseId: LocalizationReleaseId;
|
|
1290
|
+
};
|
|
1291
|
+
export type PublicLocaleRegistryResponse = {
|
|
1292
|
+
data: {
|
|
1293
|
+
schemaVersion: 1;
|
|
1294
|
+
marketScope: 'global';
|
|
1295
|
+
locales: PublicLocaleRegistryItem[];
|
|
1296
|
+
};
|
|
1297
|
+
};
|
|
1298
|
+
export type PublicLocalizationRelease = {
|
|
1299
|
+
schemaVersion: 1;
|
|
1300
|
+
releaseId: LocalizationReleaseId;
|
|
1301
|
+
localeTag: LocaleTag;
|
|
1302
|
+
contentLanguage: LocaleTag;
|
|
1303
|
+
channel: 'public_web';
|
|
1304
|
+
marketScope: string;
|
|
1305
|
+
manifestVersion: string;
|
|
1306
|
+
compatibilityVersion: string;
|
|
1307
|
+
checksum: string;
|
|
1308
|
+
snapshots: {
|
|
1309
|
+
uiCatalog: UiCatalogSnapshotId;
|
|
1310
|
+
cmsContent: CmsContentSnapshotId;
|
|
1311
|
+
};
|
|
1312
|
+
};
|
|
1313
|
+
export type PublicLocalizationReleaseResponse = {
|
|
1314
|
+
data: PublicLocalizationRelease;
|
|
1315
|
+
};
|
|
1316
|
+
export type PublicUiCatalogMessage = {
|
|
1317
|
+
messageId: string;
|
|
1318
|
+
resolvedLocale: LocaleTag;
|
|
1319
|
+
fallbackStatus: 'none' | 'safe_fallback';
|
|
1320
|
+
syntaxVersion: string;
|
|
1321
|
+
variableSchema: Record<string, unknown>;
|
|
1322
|
+
value: unknown;
|
|
1323
|
+
contentChecksum: string;
|
|
1324
|
+
};
|
|
1325
|
+
export type PublicUiCatalog = {
|
|
1326
|
+
schemaVersion: 1;
|
|
1327
|
+
snapshotId: UiCatalogSnapshotId;
|
|
1328
|
+
requestedLocale: LocaleTag;
|
|
1329
|
+
sourceLocale: LocaleTag;
|
|
1330
|
+
contentLanguage: LocaleTag;
|
|
1331
|
+
manifestVersion: string;
|
|
1332
|
+
compatibilityVersion: string;
|
|
1333
|
+
checksum: string;
|
|
1334
|
+
fallbackSummary: {
|
|
1335
|
+
itemCount: number;
|
|
1336
|
+
fallbackCount: number;
|
|
1337
|
+
};
|
|
1338
|
+
messages: PublicUiCatalogMessage[];
|
|
1339
|
+
};
|
|
1340
|
+
export type PublicUiCatalogResponse = {
|
|
1341
|
+
data: PublicUiCatalog;
|
|
1342
|
+
};
|
|
1343
|
+
export type PublicLocalizationCandidatePreview = {
|
|
1344
|
+
schemaVersion: 1;
|
|
1345
|
+
candidateId: LocalizationReleaseId;
|
|
1346
|
+
requestedLocale: LocaleTag;
|
|
1347
|
+
contentLanguage: LocaleTag;
|
|
1348
|
+
release: PublicLocalizationRelease;
|
|
1349
|
+
uiCatalog: PublicUiCatalog;
|
|
1350
|
+
};
|
|
1351
|
+
export type PublicLocalizationCandidatePreviewResponse = {
|
|
1352
|
+
data: PublicLocalizationCandidatePreview;
|
|
1353
|
+
};
|
|
1175
1354
|
export type PublicApiV1RouteMap = {
|
|
1176
1355
|
'GET /homepage': PublicHomepageResponse;
|
|
1177
1356
|
'GET /site-navigation': PublicSiteNavigationResponse;
|
|
1178
1357
|
'GET /site-features': PublicSiteFeaturesResponse;
|
|
1358
|
+
'GET /locales': PublicLocaleRegistryResponse;
|
|
1359
|
+
'GET /localization/previews/{candidateId}': PublicLocalizationCandidatePreviewResponse;
|
|
1360
|
+
'GET /localization/releases/{releaseId}': PublicLocalizationReleaseResponse;
|
|
1361
|
+
'GET /localization/ui-catalogs/{snapshotId}': PublicUiCatalogResponse;
|
|
1179
1362
|
'GET /sitemap': PublicSitemapResponse;
|
|
1180
1363
|
'GET /search': PublicSearchResultsResponse;
|
|
1181
1364
|
'GET /search-suggestions': PublicSearchSuggestionsResponse;
|
|
@@ -1211,6 +1394,7 @@ export type PublicApiV1RouteMap = {
|
|
|
1211
1394
|
'GET /site-content/booking-cancellation-policy': PublicSiteTrustPageContentResponse;
|
|
1212
1395
|
'GET /site-content/cookie-policy': PublicSiteTrustPageContentResponse;
|
|
1213
1396
|
'GET /site-content/accessibility-statement': PublicSiteTrustPageContentResponse;
|
|
1397
|
+
'GET /site-content/destination-iran': PublicSiteBlockPageContentResponse;
|
|
1214
1398
|
};
|
|
1215
1399
|
export type PublicApiResult<T> = {
|
|
1216
1400
|
ok: true;
|
|
@@ -1224,6 +1408,19 @@ export type PublicApiResult<T> = {
|
|
|
1224
1408
|
requestId: string | null;
|
|
1225
1409
|
};
|
|
1226
1410
|
export type ListPublicToursParams = {
|
|
1411
|
+
/** OR within each group, AND between groups. Values are supplied by catalog facets. */
|
|
1412
|
+
countries?: string[];
|
|
1413
|
+
styles?: string[];
|
|
1414
|
+
travelFormats?: string[];
|
|
1415
|
+
activityLevels?: string[];
|
|
1416
|
+
durationBuckets?: string[];
|
|
1417
|
+
journeyTypes?: string[];
|
|
1418
|
+
months?: string[];
|
|
1419
|
+
hasUpcomingDepartures?: boolean;
|
|
1420
|
+
/** Only tours staff flagged as Signature Trips. */
|
|
1421
|
+
isSignature?: boolean;
|
|
1422
|
+
sort?: PublicTourCatalogSort;
|
|
1423
|
+
includeFacets?: boolean;
|
|
1227
1424
|
limit?: number;
|
|
1228
1425
|
cursor?: string;
|
|
1229
1426
|
/** Itinerary-derived destination slug, matched server-side. */
|
|
@@ -1232,6 +1429,21 @@ export type ListPublicToursParams = {
|
|
|
1232
1429
|
minDuration?: number;
|
|
1233
1430
|
/** Inclusive upper bound on `durationDays`. */
|
|
1234
1431
|
maxDuration?: number;
|
|
1432
|
+
/**
|
|
1433
|
+
* Content locale for CRM-authored tour copy (ADR-0023). Every approved and
|
|
1434
|
+
* published translation replaces its English source; anything not translated,
|
|
1435
|
+
* or translated from text that has since changed, stays as published in
|
|
1436
|
+
* English. Omitted, or 'en', requests the English source. Typed facts —
|
|
1437
|
+
* prices, durations, currencies, availability — are formatted per locale by
|
|
1438
|
+
* the consumer and are never affected by this parameter.
|
|
1439
|
+
*/
|
|
1440
|
+
locale?: PublicContentLocale;
|
|
1441
|
+
};
|
|
1442
|
+
/** Locales the public content contract will resolve translations for. */
|
|
1443
|
+
export type PublicContentLocale = 'en' | 'de' | 'fr' | 'es' | 'it' | 'fa' | 'ar';
|
|
1444
|
+
export type GetPublicTourParams = {
|
|
1445
|
+
/** See ListPublicToursParams['locale']. */
|
|
1446
|
+
locale?: PublicContentLocale;
|
|
1235
1447
|
};
|
|
1236
1448
|
export type ListPublicDeparturesParams = {
|
|
1237
1449
|
limit?: number;
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surfiran/public-api-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "TypeScript types and client for SURFIRAN CRM Public API V1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/SURFIRAN/surfiran-public-api-client.git",
|
|
12
12
|
"directory": "."
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/SURFIRAN/surfiran-public-api-client/issues"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://github.com/
|
|
17
|
+
"homepage": "https://github.com/SURFIRAN/surfiran-public-api-client",
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public",
|
|
20
20
|
"registry": "https://registry.npmjs.org"
|
|
@@ -44,15 +44,19 @@
|
|
|
44
44
|
"dist/types.js"
|
|
45
45
|
],
|
|
46
46
|
"scripts": {
|
|
47
|
-
"build": "
|
|
47
|
+
"build": "node scripts/build.cjs",
|
|
48
48
|
"generate": "node scripts/generate-public-api-v1.cjs",
|
|
49
|
-
"prepack": "npm run verify:contract && npm run verify:package && npm run verify:generated && npm run typecheck && npm test && npm run build",
|
|
49
|
+
"prepack": "npm run verify:contract && npm run verify:package && npm run verify:repository && npm run verify:generated && npm run typecheck && npm test && npm run build",
|
|
50
50
|
"typecheck": "tsc --noEmit",
|
|
51
51
|
"test": "vitest run",
|
|
52
52
|
"verify:contract": "node scripts/verify-contract.cjs",
|
|
53
|
+
"verify:api-contract-artifact": "node scripts/verify-api-contract-artifact.cjs",
|
|
54
|
+
"sync:api-contract-artifact": "node scripts/sync-api-contract-artifact.cjs",
|
|
53
55
|
"verify:generated": "node scripts/verify-generated.cjs",
|
|
54
56
|
"verify:package": "node scripts/verify-package.cjs",
|
|
55
57
|
"verify:pack": "node scripts/verify-pack.cjs",
|
|
58
|
+
"verify:repository": "node scripts/verify-standalone-repository.cjs",
|
|
59
|
+
"verify:reproducibility": "node scripts/verify-reproducibility.cjs",
|
|
56
60
|
"verify:publication-preflight": "node scripts/verify-publication-preflight.cjs",
|
|
57
61
|
"create:provenance": "node scripts/create-provenance.cjs",
|
|
58
62
|
"verify:provenance": "node scripts/verify-provenance.cjs"
|