@mountaya/client 0.1.0 → 0.2.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/CHANGELOG.md +45 -0
- package/README.md +2 -2
- package/dist/admin/index.cjs +2876 -3502
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.d.cts +731 -912
- package/dist/admin/index.d.ts +731 -912
- package/dist/admin/index.js +188 -285
- package/dist/admin/index.js.map +1 -1
- package/dist/browser.cjs +5913 -7993
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +42 -78
- package/dist/browser.d.ts +42 -78
- package/dist/browser.js +18 -49
- package/dist/browser.js.map +1 -1
- package/dist/chunk-CeEX7ayk.d.cts +75531 -0
- package/dist/chunk-CeEX7ayk.d.ts +75531 -0
- package/dist/chunk-Cg7Dtcb4.js +2987 -0
- package/dist/chunk-Cg7Dtcb4.js.map +1 -0
- package/dist/chunk-DJqUsgsy.d.ts +1463 -0
- package/dist/chunk-DNc8T5K1.js +241 -0
- package/dist/chunk-DNc8T5K1.js.map +1 -0
- package/dist/chunk-DTxzw3hu.d.cts +1463 -0
- package/dist/chunk-DmxQID5X.js +2289 -0
- package/dist/chunk-DmxQID5X.js.map +1 -0
- package/dist/chunk-DoZt_oIV.d.ts +3991 -0
- package/dist/chunk-DpJrqANO.js +11 -0
- package/dist/chunk-Dx8mPAdC.d.cts +3991 -0
- package/dist/chunk-X2ukY3ho.js +419 -0
- package/dist/chunk-X2ukY3ho.js.map +1 -0
- package/dist/events/index.cjs +1338 -1874
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.d.cts +373 -382
- package/dist/events/index.d.ts +373 -382
- package/dist/events/index.js +523 -806
- package/dist/events/index.js.map +1 -1
- package/dist/index.cjs +5908 -7988
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -69
- package/dist/index.d.ts +37 -69
- package/dist/index.js +17 -48
- package/dist/index.js.map +1 -1
- package/package.json +7 -8
- package/src/browser.ts +1 -0
- package/src/core/rules/clientHeader.ts +1 -1
- package/src/core/rules/errors.ts +1 -1
- package/src/core/rules/nullMasks.gen.ts +14 -2
- package/src/core/rules/version.gen.ts +1 -1
- package/src/events/index.ts +1 -5
- package/src/rest/adminResources.gen.ts +2 -0
- package/src/rest/dates.gen.ts +1 -1
- package/src/rest/resources.gen.ts +2 -0
- package/src/rest/schema.gen.ts +247 -60
- package/src/tiles/schema.gen.ts +1 -3
- package/dist/chunk-BM526BHG.js +0 -342
- package/dist/chunk-BM526BHG.js.map +0 -1
- package/dist/chunk-D2YEVTG7.js +0 -327
- package/dist/chunk-D2YEVTG7.js.map +0 -1
- package/dist/chunk-OHKVUREN.js +0 -3500
- package/dist/chunk-OHKVUREN.js.map +0 -1
- package/dist/chunk-TDTK2L5H.js +0 -3842
- package/dist/chunk-TDTK2L5H.js.map +0 -1
- package/dist/coreOperations.gen-BMYPoBbz.d.ts +0 -1760
- package/dist/coreOperations.gen-BxX5xRxw.d.cts +0 -1760
- package/dist/errors-B-GqAtQv.d.cts +0 -75960
- package/dist/errors-B-GqAtQv.d.ts +0 -75960
- package/dist/operations.gen-CvTyzKNF.d.cts +0 -3993
- package/dist/operations.gen-DUD406TV.d.ts +0 -3993
package/dist/index.d.cts
CHANGED
|
@@ -1,76 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
export { D as DataOptions, c as DataResult, s as DataSelection, F as FieldTree, M as MountayaResponse, d as MountayaSelectionError, P as PagedResponse, e as PaginateOptions, R as ResourceKind, f as ResourceRef, S as SCHEMA_VERSION, g as Selected, h as Selection, i as SelectionValue, o as data, j as decodeRestSchema, p as paginate, k as rest, l as tiles } from './coreOperations.gen-BxX5xRxw.cjs';
|
|
6
|
-
import { a5 as bind } from './operations.gen-CvTyzKNF.cjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The Mountaya API client: the Map Studio API, the Tile API and the GraphQL Data API, behind one
|
|
10
|
-
* credential.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { Mountaya } from "@mountaya/client";
|
|
14
|
-
*
|
|
15
|
-
* const mountaya = new Mountaya({ credential: { publishableKey: "pk_…" } });
|
|
16
|
-
*
|
|
17
|
-
* // A Map Studio or Tile API method resolves to the response envelope: the payload is at `data`.
|
|
18
|
-
* const { data: groups } = await mountaya.studio.itineraries.getItineraries();
|
|
19
|
-
* const { data: zones } = await mountaya.studio.zones.getZones();
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* The Map Studio API's map half arrives as `studio` (itineraries, zones, collections,
|
|
23
|
-
* collaboration, catalogs), and `agent` beside it: a run outlives the surface that started it and
|
|
24
|
-
* is addressed by a run id no map holds. The organization behind the map (its keys, settings,
|
|
25
|
-
* members, billing and webhooks, and minting a session token) is the admin unit's, which
|
|
26
|
-
* `@mountaya/client/admin` publishes as `new MountayaAdmin(mountaya)` beside webhook receiving, so
|
|
27
|
-
* an application that never manages an organization never imports it. Which namespace and which
|
|
28
|
-
* unit an operation belongs to is declared in the contract, not decided here, so every language's
|
|
29
|
-
* client divides it the same way.
|
|
30
|
-
*
|
|
31
|
-
* This entry point exposes the secret-key credential, which mints session tokens and must only
|
|
32
|
-
* ever run on a server. Browser code imports `@mountaya/client/browser`, which does not export it
|
|
33
|
-
* at all.
|
|
34
|
-
*/
|
|
35
|
-
|
|
1
|
+
import { $n as CollabLockReleasedEvent, $r as ImportGranularity, $t as AgentRunEvent, A as schema_gen_d_exports$2, Aa as ProposedSegment, Ai as Language, Ao as TerrainVariantConfig, Ar as ConflictResponse, At as SessionTokenSnapshot, B as IsochronesResult, Ba as ResponseMetadataCreatedPart, Bn as CollabCursorEvent, Bo as TileSourceType, Br as ExportVariant, Bt as AgentClientToolManifest, C as MountayaServerError, Cn as BadRequestResponse, Co as SurfaceType, Ct as Credential, D as isMountayaError, Di as ItineraryWaypoint, Do as TerrainVariant, Dt as ShareCredential, E as isMountayaApiError, Ei as ItineraryUpdateParams, Eo as TerrainTileSize, Er as CollectionUpdateParams, Et as SessionTokenSource, Fi as Locales, Fn as CategoryActivities, Fo as TileLegend, Fr as EmbeddedStudioSafetyRules, Ga as ResponseMetadataPatchItinerary, Gi as OkResponse, Gn as CollabDraftUpdateSignal, Go as UnitLegend, Gr as GeoJSONLineString, Gt as AgentErrorCode, H as ItineraryResult, Ha as ResponseMetadataLimitReached, Hn as CollabDraftClearEvent, Ho as TrailDifficultyInfo, Hr as GatewayTimeoutResponse, Ht as AgentConfirmInput, I as ExportItineraryResult, Ii as ManeuverType, In as CategoryOverlays, Io as TileLegendKind, Ir as EmbeddedStudioTheme, It as AgentAwaitingInputEvent, J as ReverseGeocodeResult, Ja as ResponseMetadataPostItinerary, Jn as CollabItineraryChangedEvent, Jo as UnitSlope, Jr as GeoJSONMultiPolygon, Jt as AgentMessageDeltaEvent, K as PoisResult, Ka as ResponseMetadataPatchZone, Ki as Organization, Kn as CollabEntity, Ko as UnitLength, Kr as GeoJSONMultiLineString, Kt as AgentErrorEvent, La as RangeType, Ln as CollabChangeAction, Lo as TileLegendStep, Lr as EmbeddedStudioThemeColors, Lt as AgentBudgetDimension, M as AnalyzeGeometryResult, Mi as LimitKey, Mo as Theme, Mr as Elevation, Mt as Activity, Ni as ListMetadata, Nn as Boundaries, No as TileLayer, Nr as ElevationTileSize, Nt as ActivityCapabilities, Oo as TerrainVariantAsStyle, Or as CollectionZonesAddParams, Ot as SessionTokenEngine, P as DirectionsResult, Pi as LocaleMap, Po as TileLayerType, Pr as EmbeddedStudioDefaultProps, Pt as ActivitySlug, Q as SuggestionsResult, Qa as RoadAccessRestrictionType, Qn as CollabLockReleaseSignal, Qr as IdempotentReplayed, Qt as AgentRunCreateParams, R as GeocodeResult, Ra as ReadSurface, Rn as CollabChangeKind, Ro as TileSource, Rr as Errors, Rt as AgentBudgetExhaustedEvent, S as MountayaRateLimitError, Si as ItinerarySegmentGroup, So as SurfaceInfo, Sr as CollectionItinerariesAddParams, St as CookieCredential, T as errorForStatus, Ta as PaymentRequiredResponse, Ti as ItineraryStatus, To as Terrain, Tt as SecretCredential, Ua as ResponseMetadataLockConflict, Un as CollabDraftClearSignal, Uo as TrailDifficultyType, Ur as GeoJSONGeometry, Ut as AgentConfirmRequiredEvent, Va as ResponseMetadataIdempotentAnswer, Vn as CollabCursorSignal, Vo as TooManyRequestsResponse, Vr as ForbiddenResponse, Vt as AgentCloseInput, W as MatrixResult, Wa as ResponseMetadataPatchCollection, Wn as CollabDraftUpdateEvent, Wo as UnauthorizedResponse, Wr as GeoJSONGeometryCollection, Wt as AgentDoneEvent, X as SearchResult, Xa as ResponseMetadataPostZone, Xn as CollabLockAcquireSignal, Xr as GeoJSONPolygon, Xt as AgentReconnectEvent, Yn as CollabLock, Yo as UnitTemperature, Yr as GeoJSONPoint, Yt as AgentMessageEvent, Za as RoadAccessInfo, Zn as CollabLockAcquiredEvent, Zr as HTTPError, Zt as AgentRun, _ as MountayaIdempotentAnswerUnavailableError, _a as OverlayContentType, _r as CollabZoneChangedEvent, _s as WaypointPropertyFormat, _t as Surface, a as IdempotentAnswer, ac as ZoneFeature, an as AgentRunProfile, ao as SegmentSplitParams, ar as CollabPresenceSnapshotEvent, at as schema_gen_d_exports, b as MountayaPayloadTooLargeError, ba as PayloadTooLargeResponse, bi as ItinerarySegment, br as CollectionCreateParams, bt as parseRateLimit, c as MountayaBadRequestError, cc as ZoneSource, ci as ItineraryCount, cn as AgentToolAbandonedReason, co as Session, cr as CollabSelectionEvent, cs as WaypointAmenity, ct as ClientOptions, d as MountayaConflictError, dc as ZoneUpdateParams, di as ItineraryDuplicateParams, dn as AgentToolErrorCode, dr as CollabSelectionSignal, ds as WaypointIcon, dt as RequestOptions, ei as ImportProvider, en as AgentRunEventType, eo as SegmentConvertParams, er as CollabLockSnapshotEvent, et as TerrainGridResult, f as MountayaConnectionError, fn as AgentToolResultEvent, fo as ShareLink, fr as CollabSignalParams, fs as WaypointLink, ft as ResponseReport, g as MountayaIdempotencyKeyInUseError, ga as OverlayCapabilities, gi as ItineraryImportPreview, go as StudioEntitlement, gr as CollabWaypointChangedEvent, gs as WaypointProperty, gt as RetryOptions, h as MountayaForbiddenError, ha as Overlay, hi as ItineraryImportConfirmWaypoint, ho as StreamReconnectReason, hr as CollabStreamEventType, hs as WaypointPhoto, ht as defaultBaseUrls, i as ErrorMetadata, in as AgentRunInputType, io as SegmentMode, ir as CollabPresenceLeaveEvent, it as TerrainSamplesResult, ja as ProposedWaypoint, ji as Layers, jo as TerrainVariants, jr as CreatedResponse, jt as AcceptedResponse, ka as ProposedCandidate, ki as ItineraryWithDetails, ko as TerrainVariantAsTiles, kr as ConflictMetadata, kt as SessionTokenEngineOptions, l as MountayaBillingError, lc as ZoneSourceKind, li as ItineraryCreateParams, ln as AgentToolCallEvent, lr as CollabSelectionKind, ls as WaypointContact, lt as MountayaTransport, m as MountayaError, mc as schema_gen_d_exports$1, mi as ItineraryImportConfirmSegment, mn as AgentUserMessageInput, mo as SpeedInfo, mr as CollabStreamEvent, ms as WaypointMode, mt as boundFetch, n as ErrorCode, nc as Zone, ni as ImportWarning, nn as AgentRunFeedbackRating, no as SegmentGroupCreateParams, nr as CollabPosition, nt as TerrainProfileResult, o as MountayaApiError, oa as OrganizationRole, oc as ZoneLevel, on as AgentRunReason, oo as SegmentUpdateParams, or as CollabReconnectEvent, os as WayType, ot as BaseUrlOverrides, p as MountayaDataError, pi as ItineraryImportConfirmParams, pn as AgentToolResultInput, po as SlopeInfo, pr as CollabSignalType, ps as WaypointMedia, pt as StreamSeam, qa as ResponseMetadataPostCollection, qn as CollabEntityKind, qo as UnitPace, qr as GeoJSONMultiPoint, qt as AgentManifestUpdateInput, r as ErrorEntry, rc as ZoneCreateParams, ri as InternalErrorResponse, rn as AgentRunInputParams, ro as SegmentGroupUpdateParams, rr as CollabPresenceJoinEvent, s as MountayaAuthenticationError, sa as OrganizationSettings, sc as ZoneMode, si as Itinerary, sn as AgentToolAbandonedEvent, so as ServiceUnavailableResponse, sr as CollabSegmentChangedEvent, ss as WayTypeInfo, st as BinaryBody, t as ApiErrorDetails, ta as OrganizationLookupParams, ti as ImportRecommendationReason, tn as AgentRunFeedbackParams, to as SegmentCreateParams, tr as CollabMember, u as MountayaConfigurationError, uc as ZoneStatus, ui as ItineraryDirectionsStep, un as AgentToolCallTarget, uo as SessionSurface, ur as CollabSelectionRef, us as WaypointCreateParams, ut as RequestArgs, v as MountayaMethodNotAllowedError, va as OverlaySupportedCapabilities, vi as ItineraryPace, vr as Collection, vs as WaypointTiming, vt as RateLimitInfo, w as PAYMENT_REQUIRED_CODE, wr as CollectionItineraryUpdateParams, wt as PublishableCredential, x as MountayaPreconditionFailedError, xo as SuccessExtensions, xt as DateMask, y as MountayaNotFoundError, ya as PaginationMetadata, yi as ItineraryPaceSegment, yr as CollectionCount, ys as WaypointUpdateParams, yt as RateLimitPolicy, za as RelationToUser, zi as NotFoundResponse, zn as CollabCollectionChangedEvent, zo as TileSourceSize, zr as ExportFormat, zt as AgentChecksUnmetEvent } from "./chunk-CeEX7ayk.cjs";
|
|
2
|
+
import { _ as FieldTree, a as PagedResponse, b as Selection, c as MountayaResponse, d as operations_gen_d_exports$1, f as bind, g as DataResult, h as DataOptions, i as ResourceRef, l as decodeRestSchema, m as selection_gen_d_exports, n as SCHEMA_VERSION, o as PaginateOptions, p as operations_gen_d_exports, r as ResourceKind, s as paginate, t as coreOperations_gen_d_exports, u as bind$1, v as MountayaSelectionError, x as SelectionValue, y as Selected } from "./chunk-DTxzw3hu.cjs";
|
|
3
|
+
import { t as bind$2 } from "./chunk-Dx8mPAdC.cjs";
|
|
4
|
+
import { Geometry } from "geojson";
|
|
36
5
|
/**
|
|
37
6
|
* Mountaya is the client. One instance holds one credential and one set of policies.
|
|
38
7
|
*
|
|
39
8
|
* The organization's operations are the admin unit's: `new MountayaAdmin(mountaya)` of
|
|
40
9
|
* `@mountaya/client/admin` answers them, bound to this client's transport.
|
|
41
10
|
*/
|
|
42
|
-
declare class Mountaya {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
11
|
+
export declare class Mountaya {
|
|
12
|
+
/**
|
|
13
|
+
* The AI agent: starting a run, answering it, rating it. Each method resolves to the response
|
|
14
|
+
* envelope, with the payload at `data`; a run's events are read through
|
|
15
|
+
* `createAgentTransport` of `@mountaya/client/events`.
|
|
16
|
+
*/
|
|
17
|
+
readonly agent: ReturnType<typeof bind$2>["agent"];
|
|
18
|
+
/**
|
|
19
|
+
* The GraphQL Data API: directions, search, terrain, isochrones, matrices. Each method resolves
|
|
20
|
+
* to the operation's own field, with no envelope.
|
|
21
|
+
*/
|
|
22
|
+
readonly data: ReturnType<typeof bind>;
|
|
23
|
+
/**
|
|
24
|
+
* The Map Studio API's map half: itineraries, zones, collections, and their catalogs. Each
|
|
25
|
+
* method resolves to the response envelope, with the payload at `data`.
|
|
26
|
+
*/
|
|
27
|
+
readonly studio: ReturnType<typeof bind$2>["studio"];
|
|
28
|
+
/** The Tile API's style specifications. Each method resolves to the response envelope. */
|
|
29
|
+
readonly tiles: ReturnType<typeof bind$1>;
|
|
30
|
+
/**
|
|
31
|
+
* The transport every method calls through: for a call this client binds no method for, and
|
|
32
|
+
* for the openers of `@mountaya/client/events`.
|
|
33
|
+
*/
|
|
34
|
+
readonly transport: MountayaTransport;
|
|
35
|
+
/**
|
|
36
|
+
* Builds a client over one credential and its options, checking both before anything is sent.
|
|
37
|
+
*
|
|
38
|
+
* @throws `MountayaConfigurationError` for options that are not an object, a credential that
|
|
39
|
+
* cannot work, a secret key in a page or a React Native application, or an option outside
|
|
40
|
+
* its range: see {@link ClientOptions}.
|
|
41
|
+
*/
|
|
42
|
+
constructor(options: ClientOptions);
|
|
74
43
|
}
|
|
75
|
-
|
|
76
|
-
export { ClientOptions, Mountaya, MountayaTransport };
|
|
44
|
+
export { type AcceptedResponse, type Activity, type ActivityCapabilities, type ActivitySlug, type AgentAwaitingInputEvent, type AgentBudgetDimension, type AgentBudgetExhaustedEvent, type AgentChecksUnmetEvent, type AgentClientToolManifest, type AgentCloseInput, type AgentConfirmInput, type AgentConfirmRequiredEvent, type AgentDoneEvent, type AgentErrorCode, type AgentErrorEvent, type AgentManifestUpdateInput, type AgentMessageDeltaEvent, type AgentMessageEvent, type AgentReconnectEvent, type AgentRun, type AgentRunCreateParams, type AgentRunEvent, type AgentRunEventType, type AgentRunFeedbackParams, type AgentRunFeedbackRating, type AgentRunInputParams, type AgentRunInputType, type AgentRunProfile, type AgentRunReason, type AgentToolAbandonedEvent, type AgentToolAbandonedReason, type AgentToolCallEvent, type AgentToolCallTarget, type AgentToolErrorCode, type AgentToolResultEvent, type AgentToolResultInput, type AgentUserMessageInput, type AnalyzeGeometryResult, type ApiErrorDetails, type BadRequestResponse, type BaseUrlOverrides, type BinaryBody, type Boundaries, type CategoryActivities, type CategoryOverlays, type ClientOptions, type CollabChangeAction, type CollabChangeKind, type CollabCollectionChangedEvent, type CollabCursorEvent, type CollabCursorSignal, type CollabDraftClearEvent, type CollabDraftClearSignal, type CollabDraftUpdateEvent, type CollabDraftUpdateSignal, type CollabEntity, type CollabEntityKind, type CollabItineraryChangedEvent, type CollabLock, type CollabLockAcquireSignal, type CollabLockAcquiredEvent, type CollabLockReleaseSignal, type CollabLockReleasedEvent, type CollabLockSnapshotEvent, type CollabMember, type CollabPosition, type CollabPresenceJoinEvent, type CollabPresenceLeaveEvent, type CollabPresenceSnapshotEvent, type CollabReconnectEvent, type CollabSegmentChangedEvent, type CollabSelectionEvent, type CollabSelectionKind, type CollabSelectionRef, type CollabSelectionSignal, type CollabSignalParams, type CollabSignalType, type CollabStreamEvent, type CollabStreamEventType, type CollabWaypointChangedEvent, type CollabZoneChangedEvent, type Collection, type CollectionCount, type CollectionCreateParams, type CollectionItinerariesAddParams, type CollectionItineraryUpdateParams, type CollectionUpdateParams, type CollectionZonesAddParams, type ConflictMetadata, type ConflictResponse, type CookieCredential, type CreatedResponse, type Credential, type DataOptions, type DataResult, type schema_gen_d_exports as DataSchema, selection_gen_d_exports as DataSelection, type DateMask, type DirectionsResult, type Elevation, type ElevationTileSize, type EmbeddedStudioDefaultProps, type EmbeddedStudioSafetyRules, type EmbeddedStudioTheme, type EmbeddedStudioThemeColors, type ErrorCode, type ErrorEntry, type ErrorMetadata, type Errors, type ExportFormat, type ExportItineraryResult, type ExportVariant, type FieldTree, type ForbiddenResponse, type GatewayTimeoutResponse, type GeoJSONGeometry, type GeoJSONGeometryCollection, type GeoJSONLineString, type GeoJSONMultiLineString, type GeoJSONMultiPoint, type GeoJSONMultiPolygon, type GeoJSONPoint, type GeoJSONPolygon, type GeocodeResult, type Geometry, type HTTPError, type IdempotentAnswer, type IdempotentReplayed, type ImportGranularity, type ImportProvider, type ImportRecommendationReason, type ImportWarning, type InternalErrorResponse, type IsochronesResult, type Itinerary, type ItineraryCount, type ItineraryCreateParams, type ItineraryDirectionsStep, type ItineraryDuplicateParams, type ItineraryImportConfirmParams, type ItineraryImportConfirmSegment, type ItineraryImportConfirmWaypoint, type ItineraryImportPreview, type ItineraryPace, type ItineraryPaceSegment, type ItineraryResult, type ItinerarySegment, type ItinerarySegmentGroup, type ItineraryStatus, type ItineraryUpdateParams, type ItineraryWaypoint, type ItineraryWithDetails, type Language, type Layers, type LimitKey, type ListMetadata, type LocaleMap, type Locales, type ManeuverType, type MatrixResult, MountayaApiError, MountayaAuthenticationError, MountayaBadRequestError, MountayaBillingError, MountayaConfigurationError, MountayaConflictError, MountayaConnectionError, MountayaDataError, MountayaError, MountayaForbiddenError, MountayaIdempotencyKeyInUseError, MountayaIdempotentAnswerUnavailableError, MountayaMethodNotAllowedError, MountayaNotFoundError, MountayaPayloadTooLargeError, MountayaPreconditionFailedError, MountayaRateLimitError, type MountayaResponse, MountayaSelectionError, MountayaServerError, MountayaTransport, type NotFoundResponse, type OkResponse, type Organization, type OrganizationLookupParams, type OrganizationRole, type OrganizationSettings, type Overlay, type OverlayCapabilities, type OverlayContentType, type OverlaySupportedCapabilities, PAYMENT_REQUIRED_CODE, type PagedResponse, type PaginateOptions, type PaginationMetadata, type PayloadTooLargeResponse, type PaymentRequiredResponse, type PoisResult, type ProposedCandidate, type ProposedSegment, type ProposedWaypoint, type PublishableCredential, type RangeType, type RateLimitInfo, type RateLimitPolicy, type ReadSurface, type RelationToUser, type RequestArgs, type RequestOptions, type ResourceKind, type ResourceRef, type ResponseMetadataCreatedPart, type ResponseMetadataIdempotentAnswer, type ResponseMetadataLimitReached, type ResponseMetadataLockConflict, type ResponseMetadataPatchCollection, type ResponseMetadataPatchItinerary, type ResponseMetadataPatchZone, type ResponseMetadataPostCollection, type ResponseMetadataPostItinerary, type ResponseMetadataPostZone, type ResponseReport, type schema_gen_d_exports$1 as RestSchema, type RetryOptions, type ReverseGeocodeResult, type RoadAccessInfo, type RoadAccessRestrictionType, SCHEMA_VERSION, type SearchResult, type SecretCredential, type SegmentConvertParams, type SegmentCreateParams, type SegmentGroupCreateParams, type SegmentGroupUpdateParams, type SegmentMode, type SegmentSplitParams, type SegmentUpdateParams, type Selected, type Selection, type SelectionValue, type ServiceUnavailableResponse, type Session, type SessionSurface, SessionTokenEngine, type SessionTokenEngineOptions, type SessionTokenSnapshot, type SessionTokenSource, type ShareCredential, type ShareLink, type SlopeInfo, type SpeedInfo, type StreamReconnectReason, type StreamSeam, type StudioEntitlement, type SuccessExtensions, type SuggestionsResult, type Surface, type SurfaceInfo, type SurfaceType, type Terrain, type TerrainGridResult, type TerrainProfileResult, type TerrainSamplesResult, type TerrainTileSize, type TerrainVariant, type TerrainVariantAsStyle, type TerrainVariantAsTiles, type TerrainVariantConfig, type TerrainVariants, type Theme, type TileLayer, type TileLayerType, type TileLegend, type TileLegendKind, type TileLegendStep, type schema_gen_d_exports$2 as TileSchema, type TileSource, type TileSourceSize, type TileSourceType, type TooManyRequestsResponse, type TrailDifficultyInfo, type TrailDifficultyType, type UnauthorizedResponse, type UnitLegend, type UnitLength, type UnitPace, type UnitSlope, type UnitTemperature, type WayType, type WayTypeInfo, type WaypointAmenity, type WaypointContact, type WaypointCreateParams, type WaypointIcon, type WaypointLink, type WaypointMedia, type WaypointMode, type WaypointPhoto, type WaypointProperty, type WaypointPropertyFormat, type WaypointTiming, type WaypointUpdateParams, type Zone, type ZoneCreateParams, type ZoneFeature, type ZoneLevel, type ZoneMode, type ZoneSource, type ZoneSourceKind, type ZoneStatus, type ZoneUpdateParams, boundFetch, operations_gen_d_exports as data, decodeRestSchema, defaultBaseUrls, errorForStatus, isMountayaApiError, isMountayaError, paginate, parseRateLimit, coreOperations_gen_d_exports as rest, operations_gen_d_exports$1 as tiles };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,76 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
export { D as DataOptions, c as DataResult, s as DataSelection, F as FieldTree, M as MountayaResponse, d as MountayaSelectionError, P as PagedResponse, e as PaginateOptions, R as ResourceKind, f as ResourceRef, S as SCHEMA_VERSION, g as Selected, h as Selection, i as SelectionValue, o as data, j as decodeRestSchema, p as paginate, k as rest, l as tiles } from './coreOperations.gen-BMYPoBbz.js';
|
|
6
|
-
import { a5 as bind } from './operations.gen-DUD406TV.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The Mountaya API client: the Map Studio API, the Tile API and the GraphQL Data API, behind one
|
|
10
|
-
* credential.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { Mountaya } from "@mountaya/client";
|
|
14
|
-
*
|
|
15
|
-
* const mountaya = new Mountaya({ credential: { publishableKey: "pk_…" } });
|
|
16
|
-
*
|
|
17
|
-
* // A Map Studio or Tile API method resolves to the response envelope: the payload is at `data`.
|
|
18
|
-
* const { data: groups } = await mountaya.studio.itineraries.getItineraries();
|
|
19
|
-
* const { data: zones } = await mountaya.studio.zones.getZones();
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* The Map Studio API's map half arrives as `studio` (itineraries, zones, collections,
|
|
23
|
-
* collaboration, catalogs), and `agent` beside it: a run outlives the surface that started it and
|
|
24
|
-
* is addressed by a run id no map holds. The organization behind the map (its keys, settings,
|
|
25
|
-
* members, billing and webhooks, and minting a session token) is the admin unit's, which
|
|
26
|
-
* `@mountaya/client/admin` publishes as `new MountayaAdmin(mountaya)` beside webhook receiving, so
|
|
27
|
-
* an application that never manages an organization never imports it. Which namespace and which
|
|
28
|
-
* unit an operation belongs to is declared in the contract, not decided here, so every language's
|
|
29
|
-
* client divides it the same way.
|
|
30
|
-
*
|
|
31
|
-
* This entry point exposes the secret-key credential, which mints session tokens and must only
|
|
32
|
-
* ever run on a server. Browser code imports `@mountaya/client/browser`, which does not export it
|
|
33
|
-
* at all.
|
|
34
|
-
*/
|
|
35
|
-
|
|
1
|
+
import { $n as CollabLockReleasedEvent, $r as ImportGranularity, $t as AgentRunEvent, A as schema_gen_d_exports$2, Aa as ProposedSegment, Ai as Language, Ao as TerrainVariantConfig, Ar as ConflictResponse, At as SessionTokenSnapshot, B as IsochronesResult, Ba as ResponseMetadataCreatedPart, Bn as CollabCursorEvent, Bo as TileSourceType, Br as ExportVariant, Bt as AgentClientToolManifest, C as MountayaServerError, Cn as BadRequestResponse, Co as SurfaceType, Ct as Credential, D as isMountayaError, Di as ItineraryWaypoint, Do as TerrainVariant, Dt as ShareCredential, E as isMountayaApiError, Ei as ItineraryUpdateParams, Eo as TerrainTileSize, Er as CollectionUpdateParams, Et as SessionTokenSource, Fi as Locales, Fn as CategoryActivities, Fo as TileLegend, Fr as EmbeddedStudioSafetyRules, Ga as ResponseMetadataPatchItinerary, Gi as OkResponse, Gn as CollabDraftUpdateSignal, Go as UnitLegend, Gr as GeoJSONLineString, Gt as AgentErrorCode, H as ItineraryResult, Ha as ResponseMetadataLimitReached, Hn as CollabDraftClearEvent, Ho as TrailDifficultyInfo, Hr as GatewayTimeoutResponse, Ht as AgentConfirmInput, I as ExportItineraryResult, Ii as ManeuverType, In as CategoryOverlays, Io as TileLegendKind, Ir as EmbeddedStudioTheme, It as AgentAwaitingInputEvent, J as ReverseGeocodeResult, Ja as ResponseMetadataPostItinerary, Jn as CollabItineraryChangedEvent, Jo as UnitSlope, Jr as GeoJSONMultiPolygon, Jt as AgentMessageDeltaEvent, K as PoisResult, Ka as ResponseMetadataPatchZone, Ki as Organization, Kn as CollabEntity, Ko as UnitLength, Kr as GeoJSONMultiLineString, Kt as AgentErrorEvent, La as RangeType, Ln as CollabChangeAction, Lo as TileLegendStep, Lr as EmbeddedStudioThemeColors, Lt as AgentBudgetDimension, M as AnalyzeGeometryResult, Mi as LimitKey, Mo as Theme, Mr as Elevation, Mt as Activity, Ni as ListMetadata, Nn as Boundaries, No as TileLayer, Nr as ElevationTileSize, Nt as ActivityCapabilities, Oo as TerrainVariantAsStyle, Or as CollectionZonesAddParams, Ot as SessionTokenEngine, P as DirectionsResult, Pi as LocaleMap, Po as TileLayerType, Pr as EmbeddedStudioDefaultProps, Pt as ActivitySlug, Q as SuggestionsResult, Qa as RoadAccessRestrictionType, Qn as CollabLockReleaseSignal, Qr as IdempotentReplayed, Qt as AgentRunCreateParams, R as GeocodeResult, Ra as ReadSurface, Rn as CollabChangeKind, Ro as TileSource, Rr as Errors, Rt as AgentBudgetExhaustedEvent, S as MountayaRateLimitError, Si as ItinerarySegmentGroup, So as SurfaceInfo, Sr as CollectionItinerariesAddParams, St as CookieCredential, T as errorForStatus, Ta as PaymentRequiredResponse, Ti as ItineraryStatus, To as Terrain, Tt as SecretCredential, Ua as ResponseMetadataLockConflict, Un as CollabDraftClearSignal, Uo as TrailDifficultyType, Ur as GeoJSONGeometry, Ut as AgentConfirmRequiredEvent, Va as ResponseMetadataIdempotentAnswer, Vn as CollabCursorSignal, Vo as TooManyRequestsResponse, Vr as ForbiddenResponse, Vt as AgentCloseInput, W as MatrixResult, Wa as ResponseMetadataPatchCollection, Wn as CollabDraftUpdateEvent, Wo as UnauthorizedResponse, Wr as GeoJSONGeometryCollection, Wt as AgentDoneEvent, X as SearchResult, Xa as ResponseMetadataPostZone, Xn as CollabLockAcquireSignal, Xr as GeoJSONPolygon, Xt as AgentReconnectEvent, Yn as CollabLock, Yo as UnitTemperature, Yr as GeoJSONPoint, Yt as AgentMessageEvent, Za as RoadAccessInfo, Zn as CollabLockAcquiredEvent, Zr as HTTPError, Zt as AgentRun, _ as MountayaIdempotentAnswerUnavailableError, _a as OverlayContentType, _r as CollabZoneChangedEvent, _s as WaypointPropertyFormat, _t as Surface, a as IdempotentAnswer, ac as ZoneFeature, an as AgentRunProfile, ao as SegmentSplitParams, ar as CollabPresenceSnapshotEvent, at as schema_gen_d_exports, b as MountayaPayloadTooLargeError, ba as PayloadTooLargeResponse, bi as ItinerarySegment, br as CollectionCreateParams, bt as parseRateLimit, c as MountayaBadRequestError, cc as ZoneSource, ci as ItineraryCount, cn as AgentToolAbandonedReason, co as Session, cr as CollabSelectionEvent, cs as WaypointAmenity, ct as ClientOptions, d as MountayaConflictError, dc as ZoneUpdateParams, di as ItineraryDuplicateParams, dn as AgentToolErrorCode, dr as CollabSelectionSignal, ds as WaypointIcon, dt as RequestOptions, ei as ImportProvider, en as AgentRunEventType, eo as SegmentConvertParams, er as CollabLockSnapshotEvent, et as TerrainGridResult, f as MountayaConnectionError, fn as AgentToolResultEvent, fo as ShareLink, fr as CollabSignalParams, fs as WaypointLink, ft as ResponseReport, g as MountayaIdempotencyKeyInUseError, ga as OverlayCapabilities, gi as ItineraryImportPreview, go as StudioEntitlement, gr as CollabWaypointChangedEvent, gs as WaypointProperty, gt as RetryOptions, h as MountayaForbiddenError, ha as Overlay, hi as ItineraryImportConfirmWaypoint, ho as StreamReconnectReason, hr as CollabStreamEventType, hs as WaypointPhoto, ht as defaultBaseUrls, i as ErrorMetadata, in as AgentRunInputType, io as SegmentMode, ir as CollabPresenceLeaveEvent, it as TerrainSamplesResult, ja as ProposedWaypoint, ji as Layers, jo as TerrainVariants, jr as CreatedResponse, jt as AcceptedResponse, ka as ProposedCandidate, ki as ItineraryWithDetails, ko as TerrainVariantAsTiles, kr as ConflictMetadata, kt as SessionTokenEngineOptions, l as MountayaBillingError, lc as ZoneSourceKind, li as ItineraryCreateParams, ln as AgentToolCallEvent, lr as CollabSelectionKind, ls as WaypointContact, lt as MountayaTransport, m as MountayaError, mc as schema_gen_d_exports$1, mi as ItineraryImportConfirmSegment, mn as AgentUserMessageInput, mo as SpeedInfo, mr as CollabStreamEvent, ms as WaypointMode, mt as boundFetch, n as ErrorCode, nc as Zone, ni as ImportWarning, nn as AgentRunFeedbackRating, no as SegmentGroupCreateParams, nr as CollabPosition, nt as TerrainProfileResult, o as MountayaApiError, oa as OrganizationRole, oc as ZoneLevel, on as AgentRunReason, oo as SegmentUpdateParams, or as CollabReconnectEvent, os as WayType, ot as BaseUrlOverrides, p as MountayaDataError, pi as ItineraryImportConfirmParams, pn as AgentToolResultInput, po as SlopeInfo, pr as CollabSignalType, ps as WaypointMedia, pt as StreamSeam, qa as ResponseMetadataPostCollection, qn as CollabEntityKind, qo as UnitPace, qr as GeoJSONMultiPoint, qt as AgentManifestUpdateInput, r as ErrorEntry, rc as ZoneCreateParams, ri as InternalErrorResponse, rn as AgentRunInputParams, ro as SegmentGroupUpdateParams, rr as CollabPresenceJoinEvent, s as MountayaAuthenticationError, sa as OrganizationSettings, sc as ZoneMode, si as Itinerary, sn as AgentToolAbandonedEvent, so as ServiceUnavailableResponse, sr as CollabSegmentChangedEvent, ss as WayTypeInfo, st as BinaryBody, t as ApiErrorDetails, ta as OrganizationLookupParams, ti as ImportRecommendationReason, tn as AgentRunFeedbackParams, to as SegmentCreateParams, tr as CollabMember, u as MountayaConfigurationError, uc as ZoneStatus, ui as ItineraryDirectionsStep, un as AgentToolCallTarget, uo as SessionSurface, ur as CollabSelectionRef, us as WaypointCreateParams, ut as RequestArgs, v as MountayaMethodNotAllowedError, va as OverlaySupportedCapabilities, vi as ItineraryPace, vr as Collection, vs as WaypointTiming, vt as RateLimitInfo, w as PAYMENT_REQUIRED_CODE, wr as CollectionItineraryUpdateParams, wt as PublishableCredential, x as MountayaPreconditionFailedError, xo as SuccessExtensions, xt as DateMask, y as MountayaNotFoundError, ya as PaginationMetadata, yi as ItineraryPaceSegment, yr as CollectionCount, ys as WaypointUpdateParams, yt as RateLimitPolicy, za as RelationToUser, zi as NotFoundResponse, zn as CollabCollectionChangedEvent, zo as TileSourceSize, zr as ExportFormat, zt as AgentChecksUnmetEvent } from "./chunk-CeEX7ayk.js";
|
|
2
|
+
import { _ as FieldTree, a as PagedResponse, b as Selection, c as MountayaResponse, d as operations_gen_d_exports$1, f as bind, g as DataResult, h as DataOptions, i as ResourceRef, l as decodeRestSchema, m as selection_gen_d_exports, n as SCHEMA_VERSION, o as PaginateOptions, p as operations_gen_d_exports, r as ResourceKind, s as paginate, t as coreOperations_gen_d_exports, u as bind$1, v as MountayaSelectionError, x as SelectionValue, y as Selected } from "./chunk-DJqUsgsy.js";
|
|
3
|
+
import { t as bind$2 } from "./chunk-DoZt_oIV.js";
|
|
4
|
+
import { Geometry } from "geojson";
|
|
36
5
|
/**
|
|
37
6
|
* Mountaya is the client. One instance holds one credential and one set of policies.
|
|
38
7
|
*
|
|
39
8
|
* The organization's operations are the admin unit's: `new MountayaAdmin(mountaya)` of
|
|
40
9
|
* `@mountaya/client/admin` answers them, bound to this client's transport.
|
|
41
10
|
*/
|
|
42
|
-
declare class Mountaya {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
11
|
+
export declare class Mountaya {
|
|
12
|
+
/**
|
|
13
|
+
* The AI agent: starting a run, answering it, rating it. Each method resolves to the response
|
|
14
|
+
* envelope, with the payload at `data`; a run's events are read through
|
|
15
|
+
* `createAgentTransport` of `@mountaya/client/events`.
|
|
16
|
+
*/
|
|
17
|
+
readonly agent: ReturnType<typeof bind$2>["agent"];
|
|
18
|
+
/**
|
|
19
|
+
* The GraphQL Data API: directions, search, terrain, isochrones, matrices. Each method resolves
|
|
20
|
+
* to the operation's own field, with no envelope.
|
|
21
|
+
*/
|
|
22
|
+
readonly data: ReturnType<typeof bind>;
|
|
23
|
+
/**
|
|
24
|
+
* The Map Studio API's map half: itineraries, zones, collections, and their catalogs. Each
|
|
25
|
+
* method resolves to the response envelope, with the payload at `data`.
|
|
26
|
+
*/
|
|
27
|
+
readonly studio: ReturnType<typeof bind$2>["studio"];
|
|
28
|
+
/** The Tile API's style specifications. Each method resolves to the response envelope. */
|
|
29
|
+
readonly tiles: ReturnType<typeof bind$1>;
|
|
30
|
+
/**
|
|
31
|
+
* The transport every method calls through: for a call this client binds no method for, and
|
|
32
|
+
* for the openers of `@mountaya/client/events`.
|
|
33
|
+
*/
|
|
34
|
+
readonly transport: MountayaTransport;
|
|
35
|
+
/**
|
|
36
|
+
* Builds a client over one credential and its options, checking both before anything is sent.
|
|
37
|
+
*
|
|
38
|
+
* @throws `MountayaConfigurationError` for options that are not an object, a credential that
|
|
39
|
+
* cannot work, a secret key in a page or a React Native application, or an option outside
|
|
40
|
+
* its range: see {@link ClientOptions}.
|
|
41
|
+
*/
|
|
42
|
+
constructor(options: ClientOptions);
|
|
74
43
|
}
|
|
75
|
-
|
|
76
|
-
export { ClientOptions, Mountaya, MountayaTransport };
|
|
44
|
+
export { type AcceptedResponse, type Activity, type ActivityCapabilities, type ActivitySlug, type AgentAwaitingInputEvent, type AgentBudgetDimension, type AgentBudgetExhaustedEvent, type AgentChecksUnmetEvent, type AgentClientToolManifest, type AgentCloseInput, type AgentConfirmInput, type AgentConfirmRequiredEvent, type AgentDoneEvent, type AgentErrorCode, type AgentErrorEvent, type AgentManifestUpdateInput, type AgentMessageDeltaEvent, type AgentMessageEvent, type AgentReconnectEvent, type AgentRun, type AgentRunCreateParams, type AgentRunEvent, type AgentRunEventType, type AgentRunFeedbackParams, type AgentRunFeedbackRating, type AgentRunInputParams, type AgentRunInputType, type AgentRunProfile, type AgentRunReason, type AgentToolAbandonedEvent, type AgentToolAbandonedReason, type AgentToolCallEvent, type AgentToolCallTarget, type AgentToolErrorCode, type AgentToolResultEvent, type AgentToolResultInput, type AgentUserMessageInput, type AnalyzeGeometryResult, type ApiErrorDetails, type BadRequestResponse, type BaseUrlOverrides, type BinaryBody, type Boundaries, type CategoryActivities, type CategoryOverlays, type ClientOptions, type CollabChangeAction, type CollabChangeKind, type CollabCollectionChangedEvent, type CollabCursorEvent, type CollabCursorSignal, type CollabDraftClearEvent, type CollabDraftClearSignal, type CollabDraftUpdateEvent, type CollabDraftUpdateSignal, type CollabEntity, type CollabEntityKind, type CollabItineraryChangedEvent, type CollabLock, type CollabLockAcquireSignal, type CollabLockAcquiredEvent, type CollabLockReleaseSignal, type CollabLockReleasedEvent, type CollabLockSnapshotEvent, type CollabMember, type CollabPosition, type CollabPresenceJoinEvent, type CollabPresenceLeaveEvent, type CollabPresenceSnapshotEvent, type CollabReconnectEvent, type CollabSegmentChangedEvent, type CollabSelectionEvent, type CollabSelectionKind, type CollabSelectionRef, type CollabSelectionSignal, type CollabSignalParams, type CollabSignalType, type CollabStreamEvent, type CollabStreamEventType, type CollabWaypointChangedEvent, type CollabZoneChangedEvent, type Collection, type CollectionCount, type CollectionCreateParams, type CollectionItinerariesAddParams, type CollectionItineraryUpdateParams, type CollectionUpdateParams, type CollectionZonesAddParams, type ConflictMetadata, type ConflictResponse, type CookieCredential, type CreatedResponse, type Credential, type DataOptions, type DataResult, type schema_gen_d_exports as DataSchema, selection_gen_d_exports as DataSelection, type DateMask, type DirectionsResult, type Elevation, type ElevationTileSize, type EmbeddedStudioDefaultProps, type EmbeddedStudioSafetyRules, type EmbeddedStudioTheme, type EmbeddedStudioThemeColors, type ErrorCode, type ErrorEntry, type ErrorMetadata, type Errors, type ExportFormat, type ExportItineraryResult, type ExportVariant, type FieldTree, type ForbiddenResponse, type GatewayTimeoutResponse, type GeoJSONGeometry, type GeoJSONGeometryCollection, type GeoJSONLineString, type GeoJSONMultiLineString, type GeoJSONMultiPoint, type GeoJSONMultiPolygon, type GeoJSONPoint, type GeoJSONPolygon, type GeocodeResult, type Geometry, type HTTPError, type IdempotentAnswer, type IdempotentReplayed, type ImportGranularity, type ImportProvider, type ImportRecommendationReason, type ImportWarning, type InternalErrorResponse, type IsochronesResult, type Itinerary, type ItineraryCount, type ItineraryCreateParams, type ItineraryDirectionsStep, type ItineraryDuplicateParams, type ItineraryImportConfirmParams, type ItineraryImportConfirmSegment, type ItineraryImportConfirmWaypoint, type ItineraryImportPreview, type ItineraryPace, type ItineraryPaceSegment, type ItineraryResult, type ItinerarySegment, type ItinerarySegmentGroup, type ItineraryStatus, type ItineraryUpdateParams, type ItineraryWaypoint, type ItineraryWithDetails, type Language, type Layers, type LimitKey, type ListMetadata, type LocaleMap, type Locales, type ManeuverType, type MatrixResult, MountayaApiError, MountayaAuthenticationError, MountayaBadRequestError, MountayaBillingError, MountayaConfigurationError, MountayaConflictError, MountayaConnectionError, MountayaDataError, MountayaError, MountayaForbiddenError, MountayaIdempotencyKeyInUseError, MountayaIdempotentAnswerUnavailableError, MountayaMethodNotAllowedError, MountayaNotFoundError, MountayaPayloadTooLargeError, MountayaPreconditionFailedError, MountayaRateLimitError, type MountayaResponse, MountayaSelectionError, MountayaServerError, MountayaTransport, type NotFoundResponse, type OkResponse, type Organization, type OrganizationLookupParams, type OrganizationRole, type OrganizationSettings, type Overlay, type OverlayCapabilities, type OverlayContentType, type OverlaySupportedCapabilities, PAYMENT_REQUIRED_CODE, type PagedResponse, type PaginateOptions, type PaginationMetadata, type PayloadTooLargeResponse, type PaymentRequiredResponse, type PoisResult, type ProposedCandidate, type ProposedSegment, type ProposedWaypoint, type PublishableCredential, type RangeType, type RateLimitInfo, type RateLimitPolicy, type ReadSurface, type RelationToUser, type RequestArgs, type RequestOptions, type ResourceKind, type ResourceRef, type ResponseMetadataCreatedPart, type ResponseMetadataIdempotentAnswer, type ResponseMetadataLimitReached, type ResponseMetadataLockConflict, type ResponseMetadataPatchCollection, type ResponseMetadataPatchItinerary, type ResponseMetadataPatchZone, type ResponseMetadataPostCollection, type ResponseMetadataPostItinerary, type ResponseMetadataPostZone, type ResponseReport, type schema_gen_d_exports$1 as RestSchema, type RetryOptions, type ReverseGeocodeResult, type RoadAccessInfo, type RoadAccessRestrictionType, SCHEMA_VERSION, type SearchResult, type SecretCredential, type SegmentConvertParams, type SegmentCreateParams, type SegmentGroupCreateParams, type SegmentGroupUpdateParams, type SegmentMode, type SegmentSplitParams, type SegmentUpdateParams, type Selected, type Selection, type SelectionValue, type ServiceUnavailableResponse, type Session, type SessionSurface, SessionTokenEngine, type SessionTokenEngineOptions, type SessionTokenSnapshot, type SessionTokenSource, type ShareCredential, type ShareLink, type SlopeInfo, type SpeedInfo, type StreamReconnectReason, type StreamSeam, type StudioEntitlement, type SuccessExtensions, type SuggestionsResult, type Surface, type SurfaceInfo, type SurfaceType, type Terrain, type TerrainGridResult, type TerrainProfileResult, type TerrainSamplesResult, type TerrainTileSize, type TerrainVariant, type TerrainVariantAsStyle, type TerrainVariantAsTiles, type TerrainVariantConfig, type TerrainVariants, type Theme, type TileLayer, type TileLayerType, type TileLegend, type TileLegendKind, type TileLegendStep, type schema_gen_d_exports$2 as TileSchema, type TileSource, type TileSourceSize, type TileSourceType, type TooManyRequestsResponse, type TrailDifficultyInfo, type TrailDifficultyType, type UnauthorizedResponse, type UnitLegend, type UnitLength, type UnitPace, type UnitSlope, type UnitTemperature, type WayType, type WayTypeInfo, type WaypointAmenity, type WaypointContact, type WaypointCreateParams, type WaypointIcon, type WaypointLink, type WaypointMedia, type WaypointMode, type WaypointPhoto, type WaypointProperty, type WaypointPropertyFormat, type WaypointTiming, type WaypointUpdateParams, type Zone, type ZoneCreateParams, type ZoneFeature, type ZoneLevel, type ZoneMode, type ZoneSource, type ZoneSourceKind, type ZoneStatus, type ZoneUpdateParams, boundFetch, operations_gen_d_exports as data, decodeRestSchema, defaultBaseUrls, errorForStatus, isMountayaApiError, isMountayaError, paginate, parseRateLimit, coreOperations_gen_d_exports as rest, operations_gen_d_exports$1 as tiles };
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,21 @@
|
|
|
1
|
-
import { MountayaTransport,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './chunk-D2YEVTG7.js';
|
|
5
|
-
import { bind } from './chunk-TDTK2L5H.js';
|
|
6
|
-
export { MountayaApiError, MountayaAuthenticationError, MountayaBadRequestError, MountayaBillingError, MountayaConfigurationError, MountayaConflictError, MountayaConnectionError, MountayaDataError, MountayaError, MountayaForbiddenError, MountayaIdempotencyKeyInUseError, MountayaIdempotentAnswerUnavailableError, MountayaMethodNotAllowedError, MountayaNotFoundError, MountayaPayloadTooLargeError, MountayaPreconditionFailedError, MountayaRateLimitError, MountayaServerError, PAYMENT_REQUIRED_CODE, errorForStatus, isMountayaApiError, isMountayaError, parseRateLimit } from './chunk-TDTK2L5H.js';
|
|
7
|
-
|
|
8
|
-
// src/index.ts
|
|
1
|
+
import { a as bind$1, c as operations_gen_exports, d as MountayaTransport, f as boundFetch, i as SessionTokenEngine, l as selection_gen_exports, n as SCHEMA_VERSION, o as operations_gen_exports$1, p as defaultBaseUrls, r as paginate, s as bind, t as coreOperations_gen_exports, u as MountayaSelectionError } from "./chunk-DmxQID5X.js";
|
|
2
|
+
import { An as MountayaConnectionError, Bn as MountayaRateLimitError, Dn as MountayaBillingError, En as MountayaBadRequestError, Fn as MountayaIdempotentAnswerUnavailableError, Hn as PAYMENT_REQUIRED_CODE, In as MountayaMethodNotAllowedError, Kn as errorForStatus, Ln as MountayaNotFoundError, Mn as MountayaError, Nn as MountayaForbiddenError, On as MountayaConfigurationError, Pn as MountayaIdempotencyKeyInUseError, Rn as MountayaPayloadTooLargeError, Tn as MountayaAuthenticationError, Vn as MountayaServerError, Xn as isMountayaApiError, Zn as isMountayaError, jn as MountayaDataError, kn as MountayaConflictError, rr as parseRateLimit, t as bind$2, wn as MountayaApiError, zn as MountayaPreconditionFailedError } from "./chunk-Cg7Dtcb4.js";
|
|
3
|
+
import { t as decodeRestSchema } from "./chunk-X2ukY3ho.js";
|
|
9
4
|
var Mountaya = class {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* method resolves to the response envelope, with the payload at `data`.
|
|
24
|
-
*/
|
|
25
|
-
studio;
|
|
26
|
-
/** The Tile API's style specifications. Each method resolves to the response envelope. */
|
|
27
|
-
tiles;
|
|
28
|
-
/**
|
|
29
|
-
* The transport every method calls through: for a call this client binds no method for, and
|
|
30
|
-
* for the openers of `@mountaya/client/events`.
|
|
31
|
-
*/
|
|
32
|
-
transport;
|
|
33
|
-
/**
|
|
34
|
-
* Builds a client over one credential and its options, checking both before anything is sent.
|
|
35
|
-
*
|
|
36
|
-
* @throws `MountayaConfigurationError` for options that are not an object, a credential that
|
|
37
|
-
* cannot work, a secret key in a page or a React Native application, or an option outside
|
|
38
|
-
* its range: see {@link ClientOptions}.
|
|
39
|
-
*/
|
|
40
|
-
constructor(options) {
|
|
41
|
-
this.transport = new MountayaTransport(options);
|
|
42
|
-
const api = bind(this.transport);
|
|
43
|
-
this.agent = api.agent;
|
|
44
|
-
this.data = bind$1(this.transport);
|
|
45
|
-
this.studio = api.studio;
|
|
46
|
-
this.tiles = bind2(this.transport);
|
|
47
|
-
}
|
|
5
|
+
agent;
|
|
6
|
+
data;
|
|
7
|
+
studio;
|
|
8
|
+
tiles;
|
|
9
|
+
transport;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.transport = new MountayaTransport(options);
|
|
12
|
+
const api = bind$2(this.transport);
|
|
13
|
+
this.agent = api.agent;
|
|
14
|
+
this.data = bind(this.transport);
|
|
15
|
+
this.studio = api.studio;
|
|
16
|
+
this.tiles = bind$1(this.transport);
|
|
17
|
+
}
|
|
48
18
|
};
|
|
19
|
+
export { selection_gen_exports as DataSelection, Mountaya, MountayaApiError, MountayaAuthenticationError, MountayaBadRequestError, MountayaBillingError, MountayaConfigurationError, MountayaConflictError, MountayaConnectionError, MountayaDataError, MountayaError, MountayaForbiddenError, MountayaIdempotencyKeyInUseError, MountayaIdempotentAnswerUnavailableError, MountayaMethodNotAllowedError, MountayaNotFoundError, MountayaPayloadTooLargeError, MountayaPreconditionFailedError, MountayaRateLimitError, MountayaSelectionError, MountayaServerError, MountayaTransport, PAYMENT_REQUIRED_CODE, SCHEMA_VERSION, SessionTokenEngine, boundFetch, operations_gen_exports as data, decodeRestSchema, defaultBaseUrls, errorForStatus, isMountayaApiError, isMountayaError, paginate, parseRateLimit, coreOperations_gen_exports as rest, operations_gen_exports$1 as tiles };
|
|
49
20
|
|
|
50
|
-
export { Mountaya };
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
52
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["bindRest","bindData","bindTiles"],"sources":["../src/index.ts"],"mappings":";;;AAyLA,IAAa,WAAb,MAAsB;CAMpB;CAKA;CAKA;CAEA;CAKA;CASA,YAAY,SAAwB;EAClC,KAAK,YAAY,IAAI,kBAAkB,OAAO;EAK9C,MAAM,MAAMA,OAAS,KAAK,SAAS;EAEnC,KAAK,QAAQ,IAAI;EACjB,KAAK,OAAOC,KAAS,KAAK,SAAS;EACnC,KAAK,SAAS,IAAI;EAClB,KAAK,QAAQC,OAAU,KAAK,SAAS;CACvC;AACF"}
|
package/package.json
CHANGED
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
"description": "The Mountaya API client: Map Studio API, Tile API and the GraphQL Data API, with no runtime dependencies.",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@arethetypeswrong/cli": "0.18.5",
|
|
12
|
-
"@types/node": "26.6.
|
|
12
|
+
"@types/node": "26.6.11",
|
|
13
13
|
"@typescript/typescript6": "6.0.2",
|
|
14
14
|
"publint": "0.3.25",
|
|
15
|
-
"tsup": "9.0.0",
|
|
16
15
|
"typescript": "7.0.2",
|
|
17
|
-
"
|
|
16
|
+
"vite-plus": "1.8.0"
|
|
18
17
|
},
|
|
19
18
|
"engines": {
|
|
20
19
|
"node": ">=22.18.0"
|
|
@@ -99,14 +98,14 @@
|
|
|
99
98
|
},
|
|
100
99
|
"scripts": {
|
|
101
100
|
"attw": "attw --pack .",
|
|
102
|
-
"build": "NODE_OPTIONS='--import=../../scripts/lib/typescriptApi.mjs --max-old-space-size=4096'
|
|
103
|
-
"dev": "NODE_OPTIONS='--import=../../scripts/lib/typescriptApi.mjs --max-old-space-size=4096'
|
|
101
|
+
"build": "NODE_OPTIONS='--import=../../scripts/lib/typescriptApi.mjs --max-old-space-size=4096' vp pack",
|
|
102
|
+
"dev": "NODE_OPTIONS='--import=../../scripts/lib/typescriptApi.mjs --max-old-space-size=4096' vp pack --watch",
|
|
104
103
|
"generate:readme": "node ../../scripts/generate-readme-exports.mjs && node ../../scripts/generate-readme-props.mjs",
|
|
105
104
|
"lint": "npm run typecheck && node ../../scripts/generate-readme-exports.mjs --check && node ../../scripts/generate-readme-props.mjs --check && node ../../scripts/check-readme-snippets.mjs",
|
|
106
105
|
"prepublishOnly": "npm run build && npm run publint && npm run attw",
|
|
107
106
|
"publint": "publint",
|
|
108
|
-
"test": "
|
|
109
|
-
"test:watch": "
|
|
107
|
+
"test": "vp test run",
|
|
108
|
+
"test:watch": "vp test watch",
|
|
110
109
|
"typecheck": "node ../../scripts/typecheck.mjs"
|
|
111
110
|
},
|
|
112
111
|
"sideEffects": false,
|
|
@@ -125,5 +124,5 @@
|
|
|
125
124
|
]
|
|
126
125
|
}
|
|
127
126
|
},
|
|
128
|
-
"version": "0.
|
|
127
|
+
"version": "0.2.0"
|
|
129
128
|
}
|
package/src/browser.ts
CHANGED
|
@@ -166,6 +166,7 @@ export interface BrowserClientOptions extends Omit<ClientOptions, "credential">
|
|
|
166
166
|
* MountayaTransport is the default entry's transport, as a type: the constructor below builds
|
|
167
167
|
* that same class, so a transport this entry hands out is one the default entry's type describes.
|
|
168
168
|
*/
|
|
169
|
+
// oxlint-disable-next-line no-redeclare -- a type and a value of one name, as a class is both.
|
|
169
170
|
export type MountayaTransport = CoreTransport;
|
|
170
171
|
|
|
171
172
|
/**
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* transport writes it beside the credential on every request, a stream's open included.
|
|
12
12
|
*
|
|
13
13
|
* The version is read from this package's manifest, the one place a release moves it. The build
|
|
14
|
-
* inlines what it reads:
|
|
14
|
+
* inlines what it reads: the build bundles the manifest's `version` alone into the entry points, so
|
|
15
15
|
* `dist` carries it as a literal and reads no file at run time, and a toolchain that resolves the
|
|
16
16
|
* `@mountaya/source` condition reads the manifest that ships beside `src`.
|
|
17
17
|
*/
|
package/src/core/rules/errors.ts
CHANGED
|
@@ -907,7 +907,7 @@ const secondsSpelled = (count: number): string => `${count} ${count === 1 ? "sec
|
|
|
907
907
|
|
|
908
908
|
/**
|
|
909
909
|
* The moment a wait of `seconds` from now ends, as an instant in UTC to the second
|
|
910
|
-
* (`2026-
|
|
910
|
+
* (`2026-12-01T00:00:00Z`), or undefined where it lies past the last moment a `Date` holds.
|
|
911
911
|
*/
|
|
912
912
|
const momentAfter = (seconds: number): string | undefined => {
|
|
913
913
|
// A `Retry-After` delay counts from the answer's receipt (RFC 9110, section 10.2.3), so it is
|
|
@@ -115,10 +115,10 @@ export const notificationPreferenceNulls = { locked_reason: true } as const;
|
|
|
115
115
|
export const notificationPreferencesNulls = { notifications: [notificationPreferenceNulls] } as const;
|
|
116
116
|
|
|
117
117
|
/** The members of `SubscriptionDiscount` that read null where a value leaves them out. */
|
|
118
|
-
export const subscriptionDiscountNulls = { ends_at: true } as const;
|
|
118
|
+
export const subscriptionDiscountNulls = { covers_through: true, ends_at: true } as const;
|
|
119
119
|
|
|
120
120
|
/** The members of `OrganizationSubscription` that read null where a value leaves them out. */
|
|
121
|
-
export const organizationSubscriptionNulls = { discount: subscriptionDiscountNulls } as const;
|
|
121
|
+
export const organizationSubscriptionNulls = { discount: subscriptionDiscountNulls, end_reason: true, ended_at: true } as const;
|
|
122
122
|
|
|
123
123
|
/** The members of `OrganizationSubscriptionSummary` that read null where a value leaves them out. */
|
|
124
124
|
export const organizationSubscriptionSummaryNulls = { api: organizationSubscriptionNulls } as const;
|
|
@@ -126,6 +126,12 @@ export const organizationSubscriptionSummaryNulls = { api: organizationSubscript
|
|
|
126
126
|
/** The members of `Session` that read null where a value leaves them out. */
|
|
127
127
|
export const sessionNulls = { user_id: true } as const;
|
|
128
128
|
|
|
129
|
+
/** The members of `UsageDataPoint` that read null where a value leaves them out. */
|
|
130
|
+
export const usageDataPointNulls = { client_version: true } as const;
|
|
131
|
+
|
|
132
|
+
/** The members of `UsageTilePoint` that read null where a value leaves them out. */
|
|
133
|
+
export const usageTilePointNulls = { client_version: true } as const;
|
|
134
|
+
|
|
129
135
|
/** The members of `WebhookDelivery` that read null where a value leaves them out. */
|
|
130
136
|
export const webhookDeliveryNulls = { next_attempt_at: true } as const;
|
|
131
137
|
|
|
@@ -219,6 +225,8 @@ export const restSchemaNulls: { readonly [schema: string]: NullableMask } = {
|
|
|
219
225
|
TileLayer: tileLayerNulls,
|
|
220
226
|
TileLegend: tileLegendNulls,
|
|
221
227
|
TileSource: tileSourceNulls,
|
|
228
|
+
UsageDataPoint: usageDataPointNulls,
|
|
229
|
+
UsageTilePoint: usageTilePointNulls,
|
|
222
230
|
WebhookDelivery: webhookDeliveryNulls,
|
|
223
231
|
WebhookDeliveryTrigger: webhookDeliveryTriggerNulls,
|
|
224
232
|
WebhookDeliveryWithAttempts: webhookDeliveryWithAttemptsNulls,
|
|
@@ -325,6 +333,10 @@ export const responseNulls: { readonly [operationId: string]: NullableMask } = {
|
|
|
325
333
|
getOrganizationMembers: { extensions: { metadata: listMetadataNulls } },
|
|
326
334
|
/** GET /v1/organizations/{organization_id}/publishable-keys */
|
|
327
335
|
getOrganizationPublishableKeys: { extensions: { metadata: listMetadataNulls } },
|
|
336
|
+
/** GET /v1/organizations/{organization_id}/usage/data */
|
|
337
|
+
getOrganizationUsageData: { data: [usageDataPointNulls] },
|
|
338
|
+
/** GET /v1/organizations/{organization_id}/usage/tiles */
|
|
339
|
+
getOrganizationUsageTiles: { data: [usageTilePointNulls] },
|
|
328
340
|
/** GET /v1/organizations/{organization_id}/webhook-deliveries */
|
|
329
341
|
getOrganizationWebhookDeliveries: { data: [webhookDeliveryNulls], extensions: { metadata: listMetadataNulls } },
|
|
330
342
|
/** GET /v1/organizations/{organization_id}/webhook-deliveries/{delivery_id} */
|
package/src/events/index.ts
CHANGED
|
@@ -40,11 +40,7 @@ export type {
|
|
|
40
40
|
AgentTransport,
|
|
41
41
|
AgentWriteOptions,
|
|
42
42
|
} from "./rules/agent.js";
|
|
43
|
-
export {
|
|
44
|
-
agentTerminalEventTypes,
|
|
45
|
-
createAgentTransport,
|
|
46
|
-
decodeAgentFrame,
|
|
47
|
-
} from "./rules/agent.js";
|
|
43
|
+
export { agentTerminalEventTypes, createAgentTransport, decodeAgentFrame } from "./rules/agent.js";
|
|
48
44
|
export type {
|
|
49
45
|
CollabDurableChange,
|
|
50
46
|
CollabEvent,
|
package/src/rest/dates.gen.ts
CHANGED
|
@@ -111,7 +111,7 @@ export const organizationMemberEventObjectDates = { joined_at: true } as const;
|
|
|
111
111
|
export const subscriptionDiscountDates = { ends_at: true } as const;
|
|
112
112
|
|
|
113
113
|
/** The instants in `OrganizationSubscription`. */
|
|
114
|
-
export const organizationSubscriptionDates = { current_period_end_at: true, discount: subscriptionDiscountDates } as const;
|
|
114
|
+
export const organizationSubscriptionDates = { current_period_end_at: true, discount: subscriptionDiscountDates, ended_at: true } as const;
|
|
115
115
|
|
|
116
116
|
/** The instants in `OrganizationSubscriptionEventObject`. */
|
|
117
117
|
export const organizationSubscriptionEventObjectDates = { current_period_end_at: true } as const;
|
|
@@ -266,6 +266,7 @@ export type {
|
|
|
266
266
|
StudioEntitlement,
|
|
267
267
|
SubscriptionCollectionMethod,
|
|
268
268
|
SubscriptionDiscount,
|
|
269
|
+
SubscriptionEndReason,
|
|
269
270
|
SubscriptionStatus,
|
|
270
271
|
SuccessExtensions,
|
|
271
272
|
SurfaceInfo,
|
|
@@ -296,6 +297,7 @@ export type {
|
|
|
296
297
|
UnitPace,
|
|
297
298
|
UnitSlope,
|
|
298
299
|
UnitTemperature,
|
|
300
|
+
UsageClientName,
|
|
299
301
|
UsageDataPoint,
|
|
300
302
|
UsageDataResourceType,
|
|
301
303
|
UsageDataSurface,
|