@mountaya/client 0.0.0-stage → 0.1.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.
Files changed (96) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/LICENCE.fr.txt +280 -0
  3. package/LICENSE.txt +262 -0
  4. package/README.md +1260 -2
  5. package/dist/admin/index.cjs +3521 -0
  6. package/dist/admin/index.cjs.map +1 -0
  7. package/dist/admin/index.d.cts +1070 -0
  8. package/dist/admin/index.d.ts +1070 -0
  9. package/dist/admin/index.js +301 -0
  10. package/dist/admin/index.js.map +1 -0
  11. package/dist/browser.cjs +8073 -0
  12. package/dist/browser.cjs.map +1 -0
  13. package/dist/browser.d.cts +106 -0
  14. package/dist/browser.d.ts +106 -0
  15. package/dist/browser.js +53 -0
  16. package/dist/browser.js.map +1 -0
  17. package/dist/chunk-BM526BHG.js +342 -0
  18. package/dist/chunk-BM526BHG.js.map +1 -0
  19. package/dist/chunk-D2YEVTG7.js +327 -0
  20. package/dist/chunk-D2YEVTG7.js.map +1 -0
  21. package/dist/chunk-OHKVUREN.js +3500 -0
  22. package/dist/chunk-OHKVUREN.js.map +1 -0
  23. package/dist/chunk-TDTK2L5H.js +3842 -0
  24. package/dist/chunk-TDTK2L5H.js.map +1 -0
  25. package/dist/coreOperations.gen-BMYPoBbz.d.ts +1760 -0
  26. package/dist/coreOperations.gen-BxX5xRxw.d.cts +1760 -0
  27. package/dist/errors-B-GqAtQv.d.cts +75960 -0
  28. package/dist/errors-B-GqAtQv.d.ts +75960 -0
  29. package/dist/events/index.cjs +1972 -0
  30. package/dist/events/index.cjs.map +1 -0
  31. package/dist/events/index.d.cts +781 -0
  32. package/dist/events/index.d.ts +781 -0
  33. package/dist/events/index.js +826 -0
  34. package/dist/events/index.js.map +1 -0
  35. package/dist/index.cjs +8072 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.cts +76 -0
  38. package/dist/index.d.ts +76 -0
  39. package/dist/index.js +52 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/operations.gen-CvTyzKNF.d.cts +3993 -0
  42. package/dist/operations.gen-DUD406TV.d.ts +3993 -0
  43. package/package.json +127 -4
  44. package/src/admin/index.ts +47 -0
  45. package/src/admin/rules/mountayaAdmin.ts +102 -0
  46. package/src/browser.ts +232 -0
  47. package/src/core/engines/sessionToken.ts +870 -0
  48. package/src/core/rules/auth.ts +1017 -0
  49. package/src/core/rules/clientHeader.ts +28 -0
  50. package/src/core/rules/dates.ts +200 -0
  51. package/src/core/rules/decode.ts +154 -0
  52. package/src/core/rules/envelope.ts +41 -0
  53. package/src/core/rules/errors.ts +1486 -0
  54. package/src/core/rules/graphql.ts +576 -0
  55. package/src/core/rules/headerValue.ts +42 -0
  56. package/src/core/rules/idempotencyKey.ts +64 -0
  57. package/src/core/rules/nullMask.ts +127 -0
  58. package/src/core/rules/nullMasks.gen.ts +416 -0
  59. package/src/core/rules/paginate.ts +316 -0
  60. package/src/core/rules/rateLimit.ts +507 -0
  61. package/src/core/rules/redaction.ts +219 -0
  62. package/src/core/rules/resourceRef.ts +110 -0
  63. package/src/core/rules/responseBody.ts +492 -0
  64. package/src/core/rules/retry.ts +386 -0
  65. package/src/core/rules/selection.ts +416 -0
  66. package/src/core/rules/sessionAnswer.ts +90 -0
  67. package/src/core/rules/sessionSchedule.ts +131 -0
  68. package/src/core/rules/sessionWait.ts +112 -0
  69. package/src/core/rules/transport.ts +2386 -0
  70. package/src/core/rules/version.gen.ts +16 -0
  71. package/src/core/rules/webAddress.ts +165 -0
  72. package/src/core/rules/webAddresses.gen.ts +30 -0
  73. package/src/data/operations.gen.ts +603 -0
  74. package/src/data/schema.gen.ts +8078 -0
  75. package/src/data/selection.gen.ts +472 -0
  76. package/src/events/index.ts +67 -0
  77. package/src/events/rules/agent.ts +439 -0
  78. package/src/events/rules/collab.ts +554 -0
  79. package/src/events/rules/collabNulls.gen.ts +17 -0
  80. package/src/events/rules/eventStream.ts +94 -0
  81. package/src/events/rules/openSseStream.ts +594 -0
  82. package/src/events/rules/sse.ts +349 -0
  83. package/src/index.ts +231 -0
  84. package/src/rest/adminOperations.gen.ts +70 -0
  85. package/src/rest/adminResources.gen.ts +136 -0
  86. package/src/rest/coreOperations.gen.ts +74 -0
  87. package/src/rest/coreResources.gen.ts +244 -0
  88. package/src/rest/dates.gen.ts +217 -0
  89. package/src/rest/operations.gen.ts +4341 -0
  90. package/src/rest/resources.gen.ts +369 -0
  91. package/src/rest/schema.gen.ts +56840 -0
  92. package/src/tiles/operations.gen.ts +206 -0
  93. package/src/tiles/schema.gen.ts +8408 -0
  94. package/src/webhooks/rules/constructWebhookEvent.ts +482 -0
  95. package/src/webhooks/rules/webhookEvent.ts +38 -0
  96. package/src/webhooks/rules/webhookEvents.gen.ts +732 -0
@@ -0,0 +1,76 @@
1
+ export { Geometry } from 'geojson';
2
+ import { a as MountayaTransport, b9 as ClientOptions } from './errors-B-GqAtQv.cjs';
3
+ export { bd as AcceptedResponse, be as Activity, bf as ActivityCapabilities, bg as ActivitySlug, bh as AgentAwaitingInputEvent, bi as AgentBudgetDimension, bj as AgentBudgetExhaustedEvent, bk as AgentChecksUnmetEvent, bl as AgentClientToolManifest, bm as AgentCloseInput, bn as AgentConfirmInput, bo as AgentConfirmRequiredEvent, bp as AgentDoneEvent, bq as AgentErrorCode, br as AgentErrorEvent, bs as AgentManifestUpdateInput, bt as AgentMessageDeltaEvent, bu as AgentMessageEvent, bv as AgentReconnectEvent, bw as AgentRun, bx as AgentRunCreateParams, by as AgentRunEvent, bz as AgentRunEventType, bA as AgentRunFeedbackParams, bB as AgentRunFeedbackRating, bC as AgentRunInputParams, bD as AgentRunInputType, bE as AgentRunProfile, bF as AgentRunReason, bG as AgentToolAbandonedEvent, bH as AgentToolAbandonedReason, bI as AgentToolCallEvent, bJ as AgentToolCallTarget, bK as AgentToolErrorCode, bL as AgentToolResultEvent, bM as AgentToolResultInput, bN as AgentUserMessageInput, bO as AnalyzeGeometryResult, bP as ApiErrorDetails, bQ as BadRequestResponse, bR as BaseUrlOverrides, bS as BinaryBody, bT as Boundaries, bU as CategoryActivities, bV as CategoryOverlays, bW as CollabChangeAction, bX as CollabChangeKind, bY as CollabCollectionChangedEvent, bZ as CollabCursorEvent, b_ as CollabCursorSignal, b$ as CollabDraftClearEvent, c0 as CollabDraftClearSignal, c1 as CollabDraftUpdateEvent, c2 as CollabDraftUpdateSignal, c3 as CollabEntity, c4 as CollabEntityKind, c5 as CollabItineraryChangedEvent, c6 as CollabLock, c7 as CollabLockAcquireSignal, c8 as CollabLockAcquiredEvent, c9 as CollabLockReleaseSignal, ca as CollabLockReleasedEvent, cb as CollabLockSnapshotEvent, cc as CollabMember, cd as CollabPosition, ce as CollabPresenceJoinEvent, cf as CollabPresenceLeaveEvent, cg as CollabPresenceSnapshotEvent, ch as CollabReconnectEvent, ci as CollabSegmentChangedEvent, cj as CollabSelectionEvent, ck as CollabSelectionKind, cl as CollabSelectionRef, cm as CollabSelectionSignal, cn as CollabSignalParams, co as CollabSignalType, cp as CollabStreamEvent, cq as CollabStreamEventType, cr as CollabWaypointChangedEvent, cs as CollabZoneChangedEvent, ct as Collection, cu as CollectionCount, cv as CollectionCreateParams, cw as CollectionItinerariesAddParams, cx as CollectionItineraryUpdateParams, cy as CollectionUpdateParams, cz as CollectionZonesAddParams, cA as ConflictMetadata, cB as ConflictResponse, bc as CookieCredential, cC as CreatedResponse, fQ as Credential, cD as DataSchema, cE as DateMask, cF as DirectionsResult, cG as Elevation, cH as ElevationTileSize, cI as EmbeddedStudioDefaultProps, cJ as EmbeddedStudioSafetyRules, cK as EmbeddedStudioTheme, cL as EmbeddedStudioThemeColors, cM as ErrorCode, cN as ErrorEntry, cO as ErrorMetadata, cP as Errors, cQ as ExportFormat, cR as ExportItineraryResult, cS as ExportVariant, cT as ForbiddenResponse, cU as GatewayTimeoutResponse, cV as GeoJSONGeometry, cW as GeoJSONGeometryCollection, cX as GeoJSONLineString, cY as GeoJSONMultiLineString, cZ as GeoJSONMultiPoint, c_ as GeoJSONMultiPolygon, c$ as GeoJSONPoint, d0 as GeoJSONPolygon, d1 as GeocodeResult, d2 as HTTPError, d3 as IdempotentAnswer, d4 as IdempotentReplayed, d5 as ImportGranularity, d6 as ImportProvider, d7 as ImportRecommendationReason, d8 as ImportWarning, d9 as InternalErrorResponse, da as IsochronesResult, db as Itinerary, dc as ItineraryCount, dd as ItineraryCreateParams, de as ItineraryDirectionsStep, df as ItineraryDuplicateParams, dg as ItineraryImportConfirmParams, dh as ItineraryImportConfirmSegment, di as ItineraryImportConfirmWaypoint, dj as ItineraryImportPreview, dk as ItineraryPace, dl as ItineraryPaceSegment, dm as ItineraryResult, dn as ItinerarySegment, dp as ItinerarySegmentGroup, dq as ItineraryStatus, dr as ItineraryUpdateParams, ds as ItineraryWaypoint, dt as ItineraryWithDetails, du as Language, dv as Layers, dw as LimitKey, dx as ListMetadata, dy as LocaleMap, dz as Locales, dA as ManeuverType, dB as MatrixResult, dC as MountayaApiError, dD as MountayaAuthenticationError, dE as MountayaBadRequestError, dF as MountayaBillingError, dG as MountayaConfigurationError, dH as MountayaConflictError, dI as MountayaConnectionError, dJ as MountayaDataError, M as MountayaError, dK as MountayaForbiddenError, dL as MountayaIdempotencyKeyInUseError, dM as MountayaIdempotentAnswerUnavailableError, dN as MountayaMethodNotAllowedError, dO as MountayaNotFoundError, dP as MountayaPayloadTooLargeError, dQ as MountayaPreconditionFailedError, dR as MountayaRateLimitError, dS as MountayaServerError, dT as NotFoundResponse, dU as OkResponse, dV as Organization, dW as OrganizationLookupParams, dX as OrganizationRole, dY as OrganizationSettings, dZ as Overlay, d_ as OverlayCapabilities, d$ as OverlayContentType, e0 as OverlaySupportedCapabilities, e1 as PAYMENT_REQUIRED_CODE, e2 as PaginationMetadata, e3 as PayloadTooLargeResponse, e4 as PaymentRequiredResponse, e5 as PoisResult, e6 as ProposedCandidate, e7 as ProposedSegment, e8 as ProposedWaypoint, ba as PublishableCredential, e9 as RangeType, ea as RateLimitInfo, eb as RateLimitPolicy, ec as ReadSurface, ed as RelationToUser, ee as RequestArgs, ef as RequestOptions, eg as ResponseMetadataCreatedPart, eh as ResponseMetadataIdempotentAnswer, ei as ResponseMetadataLimitReached, ej as ResponseMetadataLockConflict, ek as ResponseMetadataPatchCollection, el as ResponseMetadataPatchItinerary, em as ResponseMetadataPatchZone, en as ResponseMetadataPostCollection, eo as ResponseMetadataPostItinerary, ep as ResponseMetadataPostZone, eq as ResponseReport, er as RestSchema, es as RetryOptions, et as ReverseGeocodeResult, eu as RoadAccessInfo, ev as RoadAccessRestrictionType, ew as SearchResult, fR as SecretCredential, ex as SegmentConvertParams, ey as SegmentCreateParams, ez as SegmentGroupCreateParams, eA as SegmentGroupUpdateParams, eB as SegmentMode, eC as SegmentSplitParams, eD as SegmentUpdateParams, eE as ServiceUnavailableResponse, eF as Session, eG as SessionSurface, eH as SessionTokenEngine, eI as SessionTokenEngineOptions, eJ as SessionTokenSnapshot, eK as SessionTokenSource, bb as ShareCredential, eL as ShareLink, eM as SlopeInfo, eN as SpeedInfo, eO as StreamReconnectReason, eP as StreamSeam, eQ as StudioEntitlement, eR as SuccessExtensions, eS as SuggestionsResult, eT as Surface, eU as SurfaceInfo, eV as SurfaceType, eW as Terrain, eX as TerrainGridResult, eY as TerrainProfileResult, eZ as TerrainSamplesResult, e_ as TerrainTileSize, e$ as TerrainVariant, f0 as TerrainVariantAsStyle, f1 as TerrainVariantAsTiles, f2 as TerrainVariantConfig, f3 as TerrainVariants, f4 as Theme, f5 as TileLayer, f6 as TileLayerType, f7 as TileLegend, f8 as TileLegendKind, f9 as TileLegendStep, fa as TileSchema, fb as TileSource, fc as TileSourceSize, fd as TileSourceType, fe as TooManyRequestsResponse, ff as TrailDifficultyInfo, fg as TrailDifficultyType, fh as UnauthorizedResponse, fi as UnitLegend, fj as UnitLength, fk as UnitPace, fl as UnitSlope, fm as UnitTemperature, fn as WayType, fo as WayTypeInfo, fp as WaypointAmenity, fq as WaypointContact, fr as WaypointCreateParams, fs as WaypointIcon, ft as WaypointLink, fu as WaypointMedia, fv as WaypointMode, fw as WaypointPhoto, fx as WaypointProperty, fy as WaypointPropertyFormat, fz as WaypointTiming, fA as WaypointUpdateParams, fB as Zone, fC as ZoneCreateParams, fD as ZoneFeature, fE as ZoneLevel, fF as ZoneMode, fG as ZoneSource, fH as ZoneSourceKind, fI as ZoneStatus, fJ as ZoneUpdateParams, fK as boundFetch, fL as defaultBaseUrls, fM as errorForStatus, fN as isMountayaApiError, fO as isMountayaError, fP as parseRateLimit } from './errors-B-GqAtQv.cjs';
4
+ import { b as bind$1, a as bind$2 } from './coreOperations.gen-BxX5xRxw.cjs';
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
+
36
+ /**
37
+ * Mountaya is the client. One instance holds one credential and one set of policies.
38
+ *
39
+ * The organization's operations are the admin unit's: `new MountayaAdmin(mountaya)` of
40
+ * `@mountaya/client/admin` answers them, bound to this client's transport.
41
+ */
42
+ declare class Mountaya {
43
+ /**
44
+ * The AI agent: starting a run, answering it, rating it. Each method resolves to the response
45
+ * envelope, with the payload at `data`; a run's events are read through
46
+ * `createAgentTransport` of `@mountaya/client/events`.
47
+ */
48
+ readonly agent: ReturnType<typeof bind>["agent"];
49
+ /**
50
+ * The GraphQL Data API: directions, search, terrain, isochrones, matrices. Each method resolves
51
+ * to the operation's own field, with no envelope.
52
+ */
53
+ readonly data: ReturnType<typeof bind$1>;
54
+ /**
55
+ * The Map Studio API's map half: itineraries, zones, collections, and their catalogs. Each
56
+ * method resolves to the response envelope, with the payload at `data`.
57
+ */
58
+ readonly studio: ReturnType<typeof bind>["studio"];
59
+ /** The Tile API's style specifications. Each method resolves to the response envelope. */
60
+ readonly tiles: ReturnType<typeof bind$2>;
61
+ /**
62
+ * The transport every method calls through: for a call this client binds no method for, and
63
+ * for the openers of `@mountaya/client/events`.
64
+ */
65
+ readonly transport: MountayaTransport;
66
+ /**
67
+ * Builds a client over one credential and its options, checking both before anything is sent.
68
+ *
69
+ * @throws `MountayaConfigurationError` for options that are not an object, a credential that
70
+ * cannot work, a secret key in a page or a React Native application, or an option outside
71
+ * its range: see {@link ClientOptions}.
72
+ */
73
+ constructor(options: ClientOptions);
74
+ }
75
+
76
+ export { ClientOptions, Mountaya, MountayaTransport };
@@ -0,0 +1,76 @@
1
+ export { Geometry } from 'geojson';
2
+ import { a as MountayaTransport, b9 as ClientOptions } from './errors-B-GqAtQv.js';
3
+ export { bd as AcceptedResponse, be as Activity, bf as ActivityCapabilities, bg as ActivitySlug, bh as AgentAwaitingInputEvent, bi as AgentBudgetDimension, bj as AgentBudgetExhaustedEvent, bk as AgentChecksUnmetEvent, bl as AgentClientToolManifest, bm as AgentCloseInput, bn as AgentConfirmInput, bo as AgentConfirmRequiredEvent, bp as AgentDoneEvent, bq as AgentErrorCode, br as AgentErrorEvent, bs as AgentManifestUpdateInput, bt as AgentMessageDeltaEvent, bu as AgentMessageEvent, bv as AgentReconnectEvent, bw as AgentRun, bx as AgentRunCreateParams, by as AgentRunEvent, bz as AgentRunEventType, bA as AgentRunFeedbackParams, bB as AgentRunFeedbackRating, bC as AgentRunInputParams, bD as AgentRunInputType, bE as AgentRunProfile, bF as AgentRunReason, bG as AgentToolAbandonedEvent, bH as AgentToolAbandonedReason, bI as AgentToolCallEvent, bJ as AgentToolCallTarget, bK as AgentToolErrorCode, bL as AgentToolResultEvent, bM as AgentToolResultInput, bN as AgentUserMessageInput, bO as AnalyzeGeometryResult, bP as ApiErrorDetails, bQ as BadRequestResponse, bR as BaseUrlOverrides, bS as BinaryBody, bT as Boundaries, bU as CategoryActivities, bV as CategoryOverlays, bW as CollabChangeAction, bX as CollabChangeKind, bY as CollabCollectionChangedEvent, bZ as CollabCursorEvent, b_ as CollabCursorSignal, b$ as CollabDraftClearEvent, c0 as CollabDraftClearSignal, c1 as CollabDraftUpdateEvent, c2 as CollabDraftUpdateSignal, c3 as CollabEntity, c4 as CollabEntityKind, c5 as CollabItineraryChangedEvent, c6 as CollabLock, c7 as CollabLockAcquireSignal, c8 as CollabLockAcquiredEvent, c9 as CollabLockReleaseSignal, ca as CollabLockReleasedEvent, cb as CollabLockSnapshotEvent, cc as CollabMember, cd as CollabPosition, ce as CollabPresenceJoinEvent, cf as CollabPresenceLeaveEvent, cg as CollabPresenceSnapshotEvent, ch as CollabReconnectEvent, ci as CollabSegmentChangedEvent, cj as CollabSelectionEvent, ck as CollabSelectionKind, cl as CollabSelectionRef, cm as CollabSelectionSignal, cn as CollabSignalParams, co as CollabSignalType, cp as CollabStreamEvent, cq as CollabStreamEventType, cr as CollabWaypointChangedEvent, cs as CollabZoneChangedEvent, ct as Collection, cu as CollectionCount, cv as CollectionCreateParams, cw as CollectionItinerariesAddParams, cx as CollectionItineraryUpdateParams, cy as CollectionUpdateParams, cz as CollectionZonesAddParams, cA as ConflictMetadata, cB as ConflictResponse, bc as CookieCredential, cC as CreatedResponse, fQ as Credential, cD as DataSchema, cE as DateMask, cF as DirectionsResult, cG as Elevation, cH as ElevationTileSize, cI as EmbeddedStudioDefaultProps, cJ as EmbeddedStudioSafetyRules, cK as EmbeddedStudioTheme, cL as EmbeddedStudioThemeColors, cM as ErrorCode, cN as ErrorEntry, cO as ErrorMetadata, cP as Errors, cQ as ExportFormat, cR as ExportItineraryResult, cS as ExportVariant, cT as ForbiddenResponse, cU as GatewayTimeoutResponse, cV as GeoJSONGeometry, cW as GeoJSONGeometryCollection, cX as GeoJSONLineString, cY as GeoJSONMultiLineString, cZ as GeoJSONMultiPoint, c_ as GeoJSONMultiPolygon, c$ as GeoJSONPoint, d0 as GeoJSONPolygon, d1 as GeocodeResult, d2 as HTTPError, d3 as IdempotentAnswer, d4 as IdempotentReplayed, d5 as ImportGranularity, d6 as ImportProvider, d7 as ImportRecommendationReason, d8 as ImportWarning, d9 as InternalErrorResponse, da as IsochronesResult, db as Itinerary, dc as ItineraryCount, dd as ItineraryCreateParams, de as ItineraryDirectionsStep, df as ItineraryDuplicateParams, dg as ItineraryImportConfirmParams, dh as ItineraryImportConfirmSegment, di as ItineraryImportConfirmWaypoint, dj as ItineraryImportPreview, dk as ItineraryPace, dl as ItineraryPaceSegment, dm as ItineraryResult, dn as ItinerarySegment, dp as ItinerarySegmentGroup, dq as ItineraryStatus, dr as ItineraryUpdateParams, ds as ItineraryWaypoint, dt as ItineraryWithDetails, du as Language, dv as Layers, dw as LimitKey, dx as ListMetadata, dy as LocaleMap, dz as Locales, dA as ManeuverType, dB as MatrixResult, dC as MountayaApiError, dD as MountayaAuthenticationError, dE as MountayaBadRequestError, dF as MountayaBillingError, dG as MountayaConfigurationError, dH as MountayaConflictError, dI as MountayaConnectionError, dJ as MountayaDataError, M as MountayaError, dK as MountayaForbiddenError, dL as MountayaIdempotencyKeyInUseError, dM as MountayaIdempotentAnswerUnavailableError, dN as MountayaMethodNotAllowedError, dO as MountayaNotFoundError, dP as MountayaPayloadTooLargeError, dQ as MountayaPreconditionFailedError, dR as MountayaRateLimitError, dS as MountayaServerError, dT as NotFoundResponse, dU as OkResponse, dV as Organization, dW as OrganizationLookupParams, dX as OrganizationRole, dY as OrganizationSettings, dZ as Overlay, d_ as OverlayCapabilities, d$ as OverlayContentType, e0 as OverlaySupportedCapabilities, e1 as PAYMENT_REQUIRED_CODE, e2 as PaginationMetadata, e3 as PayloadTooLargeResponse, e4 as PaymentRequiredResponse, e5 as PoisResult, e6 as ProposedCandidate, e7 as ProposedSegment, e8 as ProposedWaypoint, ba as PublishableCredential, e9 as RangeType, ea as RateLimitInfo, eb as RateLimitPolicy, ec as ReadSurface, ed as RelationToUser, ee as RequestArgs, ef as RequestOptions, eg as ResponseMetadataCreatedPart, eh as ResponseMetadataIdempotentAnswer, ei as ResponseMetadataLimitReached, ej as ResponseMetadataLockConflict, ek as ResponseMetadataPatchCollection, el as ResponseMetadataPatchItinerary, em as ResponseMetadataPatchZone, en as ResponseMetadataPostCollection, eo as ResponseMetadataPostItinerary, ep as ResponseMetadataPostZone, eq as ResponseReport, er as RestSchema, es as RetryOptions, et as ReverseGeocodeResult, eu as RoadAccessInfo, ev as RoadAccessRestrictionType, ew as SearchResult, fR as SecretCredential, ex as SegmentConvertParams, ey as SegmentCreateParams, ez as SegmentGroupCreateParams, eA as SegmentGroupUpdateParams, eB as SegmentMode, eC as SegmentSplitParams, eD as SegmentUpdateParams, eE as ServiceUnavailableResponse, eF as Session, eG as SessionSurface, eH as SessionTokenEngine, eI as SessionTokenEngineOptions, eJ as SessionTokenSnapshot, eK as SessionTokenSource, bb as ShareCredential, eL as ShareLink, eM as SlopeInfo, eN as SpeedInfo, eO as StreamReconnectReason, eP as StreamSeam, eQ as StudioEntitlement, eR as SuccessExtensions, eS as SuggestionsResult, eT as Surface, eU as SurfaceInfo, eV as SurfaceType, eW as Terrain, eX as TerrainGridResult, eY as TerrainProfileResult, eZ as TerrainSamplesResult, e_ as TerrainTileSize, e$ as TerrainVariant, f0 as TerrainVariantAsStyle, f1 as TerrainVariantAsTiles, f2 as TerrainVariantConfig, f3 as TerrainVariants, f4 as Theme, f5 as TileLayer, f6 as TileLayerType, f7 as TileLegend, f8 as TileLegendKind, f9 as TileLegendStep, fa as TileSchema, fb as TileSource, fc as TileSourceSize, fd as TileSourceType, fe as TooManyRequestsResponse, ff as TrailDifficultyInfo, fg as TrailDifficultyType, fh as UnauthorizedResponse, fi as UnitLegend, fj as UnitLength, fk as UnitPace, fl as UnitSlope, fm as UnitTemperature, fn as WayType, fo as WayTypeInfo, fp as WaypointAmenity, fq as WaypointContact, fr as WaypointCreateParams, fs as WaypointIcon, ft as WaypointLink, fu as WaypointMedia, fv as WaypointMode, fw as WaypointPhoto, fx as WaypointProperty, fy as WaypointPropertyFormat, fz as WaypointTiming, fA as WaypointUpdateParams, fB as Zone, fC as ZoneCreateParams, fD as ZoneFeature, fE as ZoneLevel, fF as ZoneMode, fG as ZoneSource, fH as ZoneSourceKind, fI as ZoneStatus, fJ as ZoneUpdateParams, fK as boundFetch, fL as defaultBaseUrls, fM as errorForStatus, fN as isMountayaApiError, fO as isMountayaError, fP as parseRateLimit } from './errors-B-GqAtQv.js';
4
+ import { b as bind$1, a as bind$2 } from './coreOperations.gen-BMYPoBbz.js';
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
+
36
+ /**
37
+ * Mountaya is the client. One instance holds one credential and one set of policies.
38
+ *
39
+ * The organization's operations are the admin unit's: `new MountayaAdmin(mountaya)` of
40
+ * `@mountaya/client/admin` answers them, bound to this client's transport.
41
+ */
42
+ declare class Mountaya {
43
+ /**
44
+ * The AI agent: starting a run, answering it, rating it. Each method resolves to the response
45
+ * envelope, with the payload at `data`; a run's events are read through
46
+ * `createAgentTransport` of `@mountaya/client/events`.
47
+ */
48
+ readonly agent: ReturnType<typeof bind>["agent"];
49
+ /**
50
+ * The GraphQL Data API: directions, search, terrain, isochrones, matrices. Each method resolves
51
+ * to the operation's own field, with no envelope.
52
+ */
53
+ readonly data: ReturnType<typeof bind$1>;
54
+ /**
55
+ * The Map Studio API's map half: itineraries, zones, collections, and their catalogs. Each
56
+ * method resolves to the response envelope, with the payload at `data`.
57
+ */
58
+ readonly studio: ReturnType<typeof bind>["studio"];
59
+ /** The Tile API's style specifications. Each method resolves to the response envelope. */
60
+ readonly tiles: ReturnType<typeof bind$2>;
61
+ /**
62
+ * The transport every method calls through: for a call this client binds no method for, and
63
+ * for the openers of `@mountaya/client/events`.
64
+ */
65
+ readonly transport: MountayaTransport;
66
+ /**
67
+ * Builds a client over one credential and its options, checking both before anything is sent.
68
+ *
69
+ * @throws `MountayaConfigurationError` for options that are not an object, a credential that
70
+ * cannot work, a secret key in a page or a React Native application, or an option outside
71
+ * its range: see {@link ClientOptions}.
72
+ */
73
+ constructor(options: ClientOptions);
74
+ }
75
+
76
+ export { ClientOptions, Mountaya, MountayaTransport };
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ import { MountayaTransport, bind as bind$1, bind2 } from './chunk-OHKVUREN.js';
2
+ export { selection_gen_exports as DataSelection, MountayaSelectionError, MountayaTransport, SCHEMA_VERSION, SessionTokenEngine, boundFetch, operations_gen_exports as data, defaultBaseUrls, paginate, coreOperations_gen_exports as rest, operations_gen_exports2 as tiles } from './chunk-OHKVUREN.js';
3
+ export { decodeRestSchema } from './chunk-BM526BHG.js';
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
9
+ var Mountaya = class {
10
+ /**
11
+ * The AI agent: starting a run, answering it, rating it. Each method resolves to the response
12
+ * envelope, with the payload at `data`; a run's events are read through
13
+ * `createAgentTransport` of `@mountaya/client/events`.
14
+ */
15
+ agent;
16
+ /**
17
+ * The GraphQL Data API: directions, search, terrain, isochrones, matrices. Each method resolves
18
+ * to the operation's own field, with no envelope.
19
+ */
20
+ data;
21
+ /**
22
+ * The Map Studio API's map half: itineraries, zones, collections, and their catalogs. Each
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
+ }
48
+ };
49
+
50
+ export { Mountaya };
51
+ //# sourceMappingURL=index.js.map
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["bind"],"mappings":";;;;;;;;AAyLO,IAAM,WAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMX,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAA;AAAA;AAAA,EAEA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAST,YAAY,OAAA,EAAwB;AAClC,IAAA,IAAA,CAAK,SAAA,GAAY,IAAI,iBAAA,CAAkB,OAAO,CAAA;AAK9C,IAAA,MAAM,GAAA,GAAMA,IAAAA,CAAS,IAAA,CAAK,SAAS,CAAA;AAEnC,IAAA,IAAA,CAAK,QAAQ,GAAA,CAAI,KAAA;AACjB,IAAA,IAAA,CAAK,IAAA,GAAOA,MAAA,CAAS,IAAA,CAAK,SAAS,CAAA;AACnC,IAAA,IAAA,CAAK,SAAS,GAAA,CAAI,MAAA;AAClB,IAAA,IAAA,CAAK,KAAA,GAAQA,KAAAA,CAAU,IAAA,CAAK,SAAS,CAAA;AAAA,EACvC;AACF","file":"index.js"}