@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.
Files changed (67) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +2 -2
  3. package/dist/admin/index.cjs +2876 -3502
  4. package/dist/admin/index.cjs.map +1 -1
  5. package/dist/admin/index.d.cts +731 -912
  6. package/dist/admin/index.d.ts +731 -912
  7. package/dist/admin/index.js +188 -285
  8. package/dist/admin/index.js.map +1 -1
  9. package/dist/browser.cjs +5913 -7993
  10. package/dist/browser.cjs.map +1 -1
  11. package/dist/browser.d.cts +42 -78
  12. package/dist/browser.d.ts +42 -78
  13. package/dist/browser.js +18 -49
  14. package/dist/browser.js.map +1 -1
  15. package/dist/chunk-CeEX7ayk.d.cts +75531 -0
  16. package/dist/chunk-CeEX7ayk.d.ts +75531 -0
  17. package/dist/chunk-Cg7Dtcb4.js +2987 -0
  18. package/dist/chunk-Cg7Dtcb4.js.map +1 -0
  19. package/dist/chunk-DJqUsgsy.d.ts +1463 -0
  20. package/dist/chunk-DNc8T5K1.js +241 -0
  21. package/dist/chunk-DNc8T5K1.js.map +1 -0
  22. package/dist/chunk-DTxzw3hu.d.cts +1463 -0
  23. package/dist/chunk-DmxQID5X.js +2289 -0
  24. package/dist/chunk-DmxQID5X.js.map +1 -0
  25. package/dist/chunk-DoZt_oIV.d.ts +3991 -0
  26. package/dist/chunk-DpJrqANO.js +11 -0
  27. package/dist/chunk-Dx8mPAdC.d.cts +3991 -0
  28. package/dist/chunk-X2ukY3ho.js +419 -0
  29. package/dist/chunk-X2ukY3ho.js.map +1 -0
  30. package/dist/events/index.cjs +1338 -1874
  31. package/dist/events/index.cjs.map +1 -1
  32. package/dist/events/index.d.cts +373 -382
  33. package/dist/events/index.d.ts +373 -382
  34. package/dist/events/index.js +523 -806
  35. package/dist/events/index.js.map +1 -1
  36. package/dist/index.cjs +5908 -7988
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +37 -69
  39. package/dist/index.d.ts +37 -69
  40. package/dist/index.js +17 -48
  41. package/dist/index.js.map +1 -1
  42. package/package.json +7 -8
  43. package/src/browser.ts +1 -0
  44. package/src/core/rules/clientHeader.ts +1 -1
  45. package/src/core/rules/errors.ts +1 -1
  46. package/src/core/rules/nullMasks.gen.ts +14 -2
  47. package/src/core/rules/version.gen.ts +1 -1
  48. package/src/events/index.ts +1 -5
  49. package/src/rest/adminResources.gen.ts +2 -0
  50. package/src/rest/dates.gen.ts +1 -1
  51. package/src/rest/resources.gen.ts +2 -0
  52. package/src/rest/schema.gen.ts +247 -60
  53. package/src/tiles/schema.gen.ts +1 -3
  54. package/dist/chunk-BM526BHG.js +0 -342
  55. package/dist/chunk-BM526BHG.js.map +0 -1
  56. package/dist/chunk-D2YEVTG7.js +0 -327
  57. package/dist/chunk-D2YEVTG7.js.map +0 -1
  58. package/dist/chunk-OHKVUREN.js +0 -3500
  59. package/dist/chunk-OHKVUREN.js.map +0 -1
  60. package/dist/chunk-TDTK2L5H.js +0 -3842
  61. package/dist/chunk-TDTK2L5H.js.map +0 -1
  62. package/dist/coreOperations.gen-BMYPoBbz.d.ts +0 -1760
  63. package/dist/coreOperations.gen-BxX5xRxw.d.cts +0 -1760
  64. package/dist/errors-B-GqAtQv.d.cts +0 -75960
  65. package/dist/errors-B-GqAtQv.d.ts +0 -75960
  66. package/dist/operations.gen-CvTyzKNF.d.cts +0 -3993
  67. package/dist/operations.gen-DUD406TV.d.ts +0 -3993
@@ -3735,6 +3735,10 @@ export interface paths {
3735
3735
  * Mountaya, as the agreement states, once an agreement covers it. Calls
3736
3736
  * from the organization's own servers, which name no page, work either
3737
3737
  * way.
3738
+ * - `terms_accepted` is required and must be `true`: the user the session token
3739
+ * names accepts the Terms of Service on the organization's behalf, and
3740
+ * Mountaya keeps a dated record of it. Left out, or `false`, the request is a
3741
+ * 400 and nothing is created.
3738
3742
  * - A name of more than 30 characters as sent, or of fewer than 2 once leading
3739
3743
  * and trailing whitespace is trimmed, is a 400.
3740
3744
  * - Send an `Idempotency-Key`: a create sent again without one makes a second
@@ -5826,7 +5830,7 @@ export interface paths {
5826
5830
  /**
5827
5831
  * Retrieve an organization's Tile API usage.
5828
5832
  * @description Returns Tile API usage a day at a time, one figure per kind of resource per
5829
- * surface per status class. The split is deliberate: a day on which a resource
5833
+ * surface per SDK and version per status class. The split is deliberate: a day on which a resource
5830
5834
  * was served from both the embed and the API, or both succeeded and failed,
5831
5835
  * yields one figure per combination rather than one total, so a reader can add
5832
5836
  * them for a headline number, take the `2xx` ones of the `api` and
@@ -5838,9 +5842,9 @@ export interface paths {
5838
5842
  * waited. A caller that leaves once its tile has begun does not change how
5839
5843
  * it is counted. A request the server could not finish checking once it
5840
5844
  * knew the organization, its own or the one a share link belongs to, is
5841
- * answered `500` and counted as a `5xx`. A combination with usage anywhere
5842
- * in the range carries a figure for every day of it, `0` on the days it had
5843
- * none.
5845
+ * answered `500` and counted as a `5xx`. A combination carries a figure only
5846
+ * on the days it recorded usage: a day it recorded none has no figure, and no
5847
+ * figure is `0`.
5844
5848
  * - A session token minted for `api` without `user_id` is what authorizes this
5845
5849
  * read, and no member role is checked on top of it; one minted for
5846
5850
  * `studio-embedded` without `user_id` is the `401` a key alone gets. One
@@ -5868,6 +5872,22 @@ export interface paths {
5868
5872
  * one of the organization's share links. A `terrain` figure, the base map
5869
5873
  * served through the Tile API, is recorded on whichever surface asked for
5870
5874
  * it and never counted, on any surface.
5875
+ * - Each figure names the SDK its requests named in `X-Mountaya-Client`,
5876
+ * `client_name`, and that SDK's version, `client_version`, as the
5877
+ * requests sent them. Neither changes what counts: whether a tile is
5878
+ * counted or limited never depends on the SDK it names. Each series of
5879
+ * figures, one kind of resource, surface and status class, ranks its own
5880
+ * versions: of each SDK, the ten highest that series recorded in the
5881
+ * window, among the requests of `used_publishable_key` and of `resource_id`
5882
+ * when they are given, are reported as themselves, and every lower one is
5883
+ * summed under `older`. A series therefore carries at most twelve figures
5884
+ * of an SDK a day, its ten highest versions, `older` and `null`, whatever
5885
+ * versions callers name. `resource_type` keeps or leaves out whole series
5886
+ * and never changes which version a figure names, and the figures of any
5887
+ * set of series, added together, name each of the set's ten highest
5888
+ * versions as itself, whole, so a reader can sum the rest under `older`
5889
+ * again. A version not in the form `MAJOR.MINOR.PATCH` is `null`, and so is
5890
+ * the version of `unknown`, a request that named no SDK.
5871
5891
  * - The figures are a series over the window, not a listing of resources, so
5872
5892
  * they are not paged: every figure of the window comes back at once.
5873
5893
  *
@@ -5911,8 +5931,9 @@ export interface paths {
5911
5931
  /**
5912
5932
  * Retrieve an organization's data usage.
5913
5933
  * @description Returns data usage a day at a time, one figure per operation per surface
5914
- * per metric per status class. A combination with usage anywhere in the
5915
- * range carries a figure for every day of it, `0` on the days it had none.
5934
+ * per SDK and version per metric per status class. A combination carries a
5935
+ * figure only on the days it recorded usage: a day it recorded none has no
5936
+ * figure, and no figure is `0`.
5916
5937
  * `requests` is recorded for every call that gets past the credential
5917
5938
  * check; the other metrics count the work one kind of call did, so each
5918
5939
  * appears only beside the operation that can emit it. A refused request
@@ -5969,6 +5990,22 @@ export interface paths {
5969
5990
  * the invoice. The two studio surfaces are reported so the organization
5970
5991
  * can see them, and are never counted. `surface` keeps one of them;
5971
5992
  * omitted, all four are reported.
5993
+ * - Each figure names the SDK its requests named in `X-Mountaya-Client`,
5994
+ * `client_name`, and that SDK's version, `client_version`, as the
5995
+ * requests sent them. Neither changes what counts: whether a request is
5996
+ * counted, limited or invoiced never depends on the SDK it names. Each
5997
+ * series of figures, one operation, surface, metric and status class, ranks
5998
+ * its own versions: of each SDK, the ten highest that series recorded in
5999
+ * the window, among the requests of `used_publishable_key` when it is
6000
+ * given, are reported as themselves, and every lower one is summed under
6001
+ * `older`. A series therefore carries at most twelve figures of an SDK a
6002
+ * day, its ten highest versions, `older` and `null`, whatever versions
6003
+ * callers name. `resource_type`, `metric` and `surface` keep or leave out
6004
+ * whole series and never change which version a figure names, and the
6005
+ * figures of any set of series, added together, name each of the set's ten
6006
+ * highest versions as itself, whole, so a reader can sum the rest under
6007
+ * `older` again. A version not in the form `MAJOR.MINOR.PATCH` is `null`,
6008
+ * and so is the version of `unknown`, a request that named no SDK.
5972
6009
  * - The figures are a series over the window, not a listing of resources, so
5973
6010
  * they are not paged: every figure of the window comes back at once.
5974
6011
  *
@@ -6443,9 +6480,9 @@ export interface paths {
6443
6480
  * it comes first. One that does not answers 404.
6444
6481
  * - For a self-serve organization, the history is empty until its first
6445
6482
  * card opens its Data API subscription. From then it grows by one invoice
6446
- * for each billing period the subscription is in force, a period running
6447
- * from the day of the month it opened to the same day of the next, each
6448
- * billing the Data API requests of the period that has just closed, and by
6483
+ * for each billing period the subscription is in force, the calendar month
6484
+ * in UTC, each dated the 1st and billing the Data API requests of the month
6485
+ * that has just closed, and by
6449
6486
  * the closing invoice of a subscription that ends. It never shrinks.
6450
6487
  * - For an organization billed by its agreement with Mountaya, or awaiting
6451
6488
  * one, the history holds the invoices issued to it and never a draft, so
@@ -6570,7 +6607,7 @@ export interface paths {
6570
6607
  * then the organization holds `data`, which a key carrying `data` or `mcp`
6571
6608
  * needs. It is metered: nothing is charged as it opens, and the requests the
6572
6609
  * organization made are invoiced with tax at the end of each billing
6573
- * period, a month counted from the day it opened.
6610
+ * period, the calendar month in UTC.
6574
6611
  * The promotion code recorded by `postOrganizationBillingProvision` is
6575
6612
  * applied to the organization's first subscription and to no later one.
6576
6613
  * Where a subscription has not ended, none is opened, and its outstanding
@@ -6619,8 +6656,9 @@ export interface paths {
6619
6656
  * an invoice whose payment is still processing. What that organization
6620
6657
  * owes is settled on it, and this is called again once it is.
6621
6658
  * - The subscription is opened on the card being saved. Nothing is charged
6622
- * as it opens, unless the organization already owes an amount outside any
6623
- * subscription, which its first invoice collects on that card at once.
6659
+ * as it opens: an amount the organization already owes outside any
6660
+ * subscription waits for the subscription's first monthly invoice, which
6661
+ * that card pays.
6624
6662
  * When the card is refused as the subscription opens, the answer is a 400
6625
6663
  * naming `setup_intent_id`: nothing is opened, and the card is saved but is
6626
6664
  * not made the default. Another card opens the subscription.
@@ -9936,10 +9974,10 @@ export interface components {
9936
9974
  /**
9937
9975
  * @description Stream event carrying one incremental piece of streamed assistant text, a
9938
9976
  * live preview of the turn's answer. Deltas are best-effort: one can be lost,
9939
- * they are never replayed, and a turn the server retries streams its text
9940
- * again, so they need not add up to the final text. The matching `message`
9941
- * event carries that text in full and is authoritative: a client that renders
9942
- * deltas live replaces them with it rather than rendering both.
9977
+ * they are never replayed, and a turn the server retries may stream only part
9978
+ * of its text, or none, so they need not add up to the final text. The matching
9979
+ * `message` event carries that text in full and is authoritative: a client that
9980
+ * renders deltas live replaces them with it rather than rendering both.
9943
9981
  * @example {
9944
9982
  * "type": "message-delta",
9945
9983
  * "text": "Looking at the second day"
@@ -16879,8 +16917,8 @@ export interface components {
16879
16917
  white_label: boolean;
16880
16918
  };
16881
16919
  /**
16882
- * @description A new organization. The name is required. The website is optional and does
16883
- * one thing: its host seeds the embed domain allowlist, so a new
16920
+ * @description A new organization. The name and the acceptance of the Terms of Service are
16921
+ * required. The website is optional and does one thing: its host seeds the embed domain allowlist, so a new
16884
16922
  * organization's keys work from its own site from the start. Omit it and the
16885
16923
  * allowlist starts empty: no page but Mountaya's own can call the API with the
16886
16924
  * organization's keys from a browser, and no site but Mountaya's own can frame
@@ -16892,7 +16930,8 @@ export interface components {
16892
16930
  * the card it saves for the Data API.
16893
16931
  * @example {
16894
16932
  * "name": "Compagnie des Guides",
16895
- * "website": "https://guides.example.com"
16933
+ * "website": "https://guides.example.com",
16934
+ * "terms_accepted": true
16896
16935
  * }
16897
16936
  */
16898
16937
  OrganizationCreateParams: {
@@ -16933,6 +16972,17 @@ export interface components {
16933
16972
  * @default false
16934
16973
  */
16935
16974
  agreement_requested?: boolean | undefined;
16975
+ /**
16976
+ * @description Whether the user the session token names accepts Mountaya's
16977
+ * [Terms of Service](https://www.mountaya.com/en/legal/terms-of-service/)
16978
+ * on behalf of the new organization, and confirms that it acts for business
16979
+ * purposes. It must be `true`: `false` is a `400` at `terms_accepted`, and
16980
+ * nothing is created.
16981
+ * Mountaya keeps a dated record of the acceptance, with the version of the
16982
+ * terms and the user who accepted them, so send `true` only once that user
16983
+ * has accepted.
16984
+ */
16985
+ terms_accepted: boolean;
16936
16986
  };
16937
16987
  /**
16938
16988
  * @description One invitation: the address invited and the role it grants on acceptance.
@@ -17844,7 +17894,7 @@ export interface components {
17844
17894
  * @example {
17845
17895
  * "id": "in_1QeChamonix",
17846
17896
  * "number": "MTYA-0042",
17847
- * "created_at": "2026-08-01T02:14:07Z",
17897
+ * "created_at": "2026-08-01T00:00:00Z",
17848
17898
  * "total": 5700,
17849
17899
  * "amount_due": 0,
17850
17900
  * "currency": "eur",
@@ -17957,8 +18007,8 @@ export interface components {
17957
18007
  * subscription is opened by the first card the organization saves, unless the
17958
18008
  * customer, or that card, still owes an invoice, which is the `402` and opens
17959
18009
  * nothing, and is
17960
- * invoiced at the end of each billing period, a month counted from the day it
17961
- * opened, for the requests made in it, so there is
18010
+ * invoiced at the end of each billing period, the calendar month in UTC, for
18011
+ * the requests made in it, so there is
17962
18012
  * no interval to choose and the one thing a caller decides here is the
17963
18013
  * promotion code.
17964
18014
  * @example {
@@ -17988,9 +18038,11 @@ export interface components {
17988
18038
  * "status": "active",
17989
18039
  * "collection_method": "charge-automatically",
17990
18040
  * "currency": "eur",
17991
- * "current_period_end_at": "2026-09-01T02:14:07Z",
18041
+ * "current_period_end_at": "2026-09-01T00:00:00Z",
17992
18042
  * "cancel_at_period_end": false,
17993
18043
  * "paused": false,
18044
+ * "ended_at": null,
18045
+ * "end_reason": null,
17994
18046
  * "items": [
17995
18047
  * {
17996
18048
  * "price_id": "price_1QeDataRequests",
@@ -18043,6 +18095,23 @@ export interface components {
18043
18095
  * canceled, which is a different thing to ask the payer to fix.
18044
18096
  */
18045
18097
  paused: boolean;
18098
+ /**
18099
+ * Format: date-time
18100
+ * @description When the subscription ended, null while it has not. One that ran to the
18101
+ * end of its period ended at `current_period_end_at`; one ended inside it,
18102
+ * as at the end of dunning, ended earlier, while `current_period_end_at`
18103
+ * keeps the end of the month its period would have run to. The last day
18104
+ * it bills is the UTC day of the instant before it.
18105
+ */
18106
+ ended_at: Date | null;
18107
+ /**
18108
+ * @description Why the subscription ended, null while it has not, or when the payment
18109
+ * provider recorded no reason. An organization whose
18110
+ * subscription ended `payment-failed` still owes its unpaid invoices, the
18111
+ * final one included, and its first card or a reopen pays them before the
18112
+ * Data API opens again: `getOrganizationBillingInvoices` lists them.
18113
+ */
18114
+ end_reason: components["schemas"]["SubscriptionEndReason"] | null;
18046
18115
  /**
18047
18116
  * @description The discount on this subscription: on the Data API subscription, the one
18048
18117
  * the promotion code given to `postOrganizationBillingProvision` put on it
@@ -18098,9 +18167,11 @@ export interface components {
18098
18167
  * "status": "active",
18099
18168
  * "collection_method": "charge-automatically",
18100
18169
  * "currency": "eur",
18101
- * "current_period_end_at": "2026-09-01T02:14:07Z",
18170
+ * "current_period_end_at": "2026-09-01T00:00:00Z",
18102
18171
  * "cancel_at_period_end": false,
18103
18172
  * "paused": false,
18173
+ * "ended_at": null,
18174
+ * "end_reason": null,
18104
18175
  * "items": [
18105
18176
  * {
18106
18177
  * "price_id": "price_1QeDataRequests",
@@ -18115,8 +18186,8 @@ export interface components {
18115
18186
  /**
18116
18187
  * @description The metered Data API subscription. It carries the Data API line, which
18117
18188
  * bills the requests the organization makes, the MCP server's included,
18118
- * at the end of each billing period, a month counted from the day the
18119
- * subscription opened. A line's price says
18189
+ * at the end of each billing period, the calendar month in UTC, from the
18190
+ * 1st to its last day. A line's price says
18120
18191
  * nothing a client should read a product from: `organization_capabilities`
18121
18192
  * on `getMyOrganizations` says which products the organization holds. An
18122
18193
  * organization that has never held one, as before its first card opens
@@ -18251,7 +18322,9 @@ export interface components {
18251
18322
  * "valid": true,
18252
18323
  * "label": "Early guide, 20% off",
18253
18324
  * "percent_off": 20,
18254
- * "duration": "repeating"
18325
+ * "duration": "repeating",
18326
+ * "duration_in_months": 2,
18327
+ * "covers_through": "2026-12-31"
18255
18328
  * }
18256
18329
  */
18257
18330
  PromotionCodePreview: {
@@ -18299,6 +18372,24 @@ export interface components {
18299
18372
  * to widen.
18300
18373
  */
18301
18374
  duration?: string | undefined;
18375
+ /**
18376
+ * Format: int64
18377
+ * @description How many months a `repeating` code repeats for, as the payment provider
18378
+ * counts them from the moment the subscription opens. Present only when
18379
+ * `valid` is true and `duration` is `repeating`. `covers_through` says
18380
+ * which calendar months that covers.
18381
+ */
18382
+ duration_in_months?: number | undefined;
18383
+ /**
18384
+ * Format: date
18385
+ * @description For a `repeating` code, the last day of usage, in UTC, it would cover if
18386
+ * the subscription it discounts opened now, as
18387
+ * `SubscriptionDiscount.covers_through` counts it: the part of the month
18388
+ * the subscription opens in and the full calendar months after it, so a
18389
+ * client can say what the code covers before the card is added. Present
18390
+ * only when `valid` is true and `duration` is `repeating`.
18391
+ */
18392
+ covers_through?: string | undefined;
18302
18393
  };
18303
18394
  /**
18304
18395
  * @description A single-use secret for collecting a card in the caller's own page rather
@@ -18328,18 +18419,29 @@ export interface components {
18328
18419
  * @enum {string}
18329
18420
  */
18330
18421
  SubscriptionCollectionMethod: "charge-automatically" | "send-invoice";
18422
+ /**
18423
+ * @description Why a subscription ended, so a client can tell the payer what happened and
18424
+ * what, if anything, is left to settle.
18425
+ * @example payment-failed
18426
+ * @enum {string}
18427
+ */
18428
+ SubscriptionEndReason: "requested" | "payment-failed" | "payment-disputed";
18331
18429
  /**
18332
18430
  * @description The discount on a subscription. It is read from the subscription itself rather
18333
18431
  * than remembered from the moment the code was given, so a client shows the
18334
18432
  * active discount on every visit and not only on the one where the code was
18335
18433
  * entered. It says how long the discount lasts and, when it stops, when, so a
18336
18434
  * client never presents a discount that is about to lapse as a lasting one.
18337
- * Absent from a subscription carrying no discount.
18435
+ * A subscription carrying more than one discount answers the code given at
18436
+ * signup when it carries one, else the first. Absent from a subscription
18437
+ * carrying no discount, and from one whose `ends_at` has passed, since no later
18438
+ * invoice carries it.
18338
18439
  * @example {
18339
18440
  * "label": "Early guide, 20% off",
18340
18441
  * "percent_off": 20,
18341
18442
  * "duration": "repeating",
18342
- * "ends_at": "2026-12-01T00:00:00Z"
18443
+ * "ends_at": "2027-01-01T00:00:00Z",
18444
+ * "covers_through": "2026-12-31"
18343
18445
  * }
18344
18446
  */
18345
18447
  SubscriptionDiscount: {
@@ -18355,12 +18457,31 @@ export interface components {
18355
18457
  duration: string;
18356
18458
  /**
18357
18459
  * Format: date-time
18358
- * @description When the discount stops applying, for a `repeating` discount: invoices
18359
- * issued after it carry no discount. Null for a `forever` discount, which
18360
- * never ends, and for a `once` discount, which applies to a single
18361
- * invoice and has no date of its own.
18460
+ * @description When the discount stops applying, for a `repeating` discount: the start
18461
+ * of the day after `covers_through`, at 00:00 UTC, when the invoice for its
18462
+ * last month is issued; invoices issued after it carry no discount. Null
18463
+ * for a `forever` discount, which never ends, and for a `once` discount,
18464
+ * which applies to a single invoice and has no date of its own.
18362
18465
  */
18363
18466
  ends_at: Date | null;
18467
+ /**
18468
+ * Format: date
18469
+ * @description The last day of usage, in UTC, that the discount covers, for a
18470
+ * `repeating` discount: the last day of the last calendar month it
18471
+ * discounts, every invoice for a later month being charged in full. A
18472
+ * discount repeating for two months or more covers the part of the month
18473
+ * the subscription opened in and as many full calendar months as it
18474
+ * repeats, less one, the month it opened in counting as the first of them
18475
+ * when it opened on the 1st; one repeating for a single month covers the
18476
+ * month the subscription opened in. So a code repeating for two months on a
18477
+ * subscription opened on 15 November covers its usage through 31 December,
18478
+ * and opened on 1 December, through 31 December too. A discount that did
18479
+ * not start with the subscription, one added to it later, covers the months
18480
+ * the payment provider discounts: through the day before the latest 1st, at
18481
+ * 00:00 UTC, that comes strictly before the provider ends it. Null for a
18482
+ * `once` or `forever` discount.
18483
+ */
18484
+ covers_through: string | null;
18364
18485
  /**
18365
18486
  * @description How to name the discount to the payer, never empty: the discount's own
18366
18487
  * name, else the promotion code it was applied with, else, for an unnamed
@@ -18395,9 +18516,11 @@ export interface components {
18395
18516
  * answers `402` rather than failing silently. `active`, `trialing` and
18396
18517
  * `incomplete` keep what it grants in force, and so does `past-due` once the
18397
18518
  * subscription has paid an invoice. `past-due` is the window, at most 7 days,
18398
- * in which a failed renewal is retried before the subscription is canceled. A
18399
- * subscription that has never paid an invoice keeps nothing from its first
18400
- * failed payment. No operation in this contract opens a subscription that
18519
+ * in which a failed renewal is retried. Once every retry has failed the
18520
+ * subscription reads `unpaid`, and Mountaya ends it, `canceled` with
18521
+ * `end_reason` `payment-failed`, raising a final invoice for the requests made
18522
+ * since the last one. A subscription that has never paid an invoice keeps
18523
+ * nothing from its first failed payment. No operation in this contract opens a subscription that
18401
18524
  * reads `trialing`, `incomplete` or `incomplete-expired`: the Data API
18402
18525
  * subscription is opened by the organization's first card and reads `active`
18403
18526
  * from that moment, or is not opened at all when that card is refused, or
@@ -18436,21 +18559,35 @@ export interface components {
18436
18559
  value: string;
18437
18560
  };
18438
18561
  /**
18439
- * @description One day's data usage, for one operation, on one surface, on one metric, in
18440
- * one status class. A day on which an operation both succeeded and failed yields one
18441
- * point per class rather than one total, so availability is read from the same
18442
- * payload as the volume that counts, which is the `requests` figures of class
18562
+ * @description The SDK a request named itself as, in its `X-Mountaya-Client` header
18563
+ * (`mountaya-<language>/<version>`), which every official SDK sends on each
18564
+ * request it makes. It is reported as the request sent it, and whether the
18565
+ * request is counted, limited or invoiced never depends on it.
18566
+ * A client that is not one of the SDKs may send any of these values, so a
18567
+ * figure under one says what its requests claimed.
18568
+ * @example sdk-typescript
18569
+ * @enum {string}
18570
+ */
18571
+ UsageClientName: "sdk-typescript" | "sdk-swift" | "sdk-kotlin" | "sdk-dart" | "unknown";
18572
+ /**
18573
+ * @description One day's data usage, for one operation, on one surface, from one SDK at one
18574
+ * version, on one metric, in one status class. A day on which an operation
18575
+ * both succeeded and failed yields one point per class rather than one
18576
+ * total, so availability is read from the same payload as the volume that
18577
+ * counts, which is the `requests` figures of class
18443
18578
  * `2xx` alone, one per root field answered without an error, what a monthly
18444
18579
  * allowance counts and what a self-serve organization is invoiced for (the
18445
18580
  * per-minute limit counts HTTP requests instead): every other metric measures work inside a
18446
18581
  * request and is reported, not counted. A failed request records `requests`
18447
18582
  * alone: the other metrics count work that did not happen. Only the `api` and
18448
- * `mcp` surfaces count; `studio-online` and `studio-embedded` are reported and
18449
- * never counted.
18583
+ * `mcp` surfaces count, whichever SDK they name; `studio-online` and
18584
+ * `studio-embedded` are reported and never counted.
18450
18585
  * @example {
18451
18586
  * "date": "2026-08-22",
18452
18587
  * "resource_type": "directions",
18453
18588
  * "surface": "api",
18589
+ * "client_name": "sdk-typescript",
18590
+ * "client_version": "0.1.0",
18454
18591
  * "metric": "requests",
18455
18592
  * "status_class": "2xx",
18456
18593
  * "value": 1284
@@ -18471,6 +18608,26 @@ export interface components {
18471
18608
  * did, which is reported and never counted.
18472
18609
  */
18473
18610
  surface: components["schemas"]["UsageDataSurface"];
18611
+ /**
18612
+ * @description The SDK the requests named themselves as, in their `X-Mountaya-Client`
18613
+ * header. It is reported as they sent it and never decides what counts.
18614
+ */
18615
+ client_name: components["schemas"]["UsageClientName"];
18616
+ /**
18617
+ * @description The version of that SDK the requests named: one of the ten highest
18618
+ * versions of it that carry a figure in the point's series over the
18619
+ * requested window, a series being the points that differ from this one
18620
+ * only by day, SDK, version and figure, or `older` for every lower version
18621
+ * of it in that series, summed into one figure. `null` when the requests
18622
+ * named no version in the form `MAJOR.MINOR.PATCH`, when they were refused
18623
+ * before their operation ran (a `402`, a `403`, a `429`, or a `500` while
18624
+ * their credential was checked), and always when `client_name` is
18625
+ * `unknown`. A day records a bounded number of versions of an SDK for an
18626
+ * organization: every one when its requests name at most 32 that UTC day,
18627
+ * and past that a version named later in the day may be reported as
18628
+ * `null`.
18629
+ */
18630
+ client_version: string | null;
18474
18631
  /** @description What this figure counts, which decides how to read `value`. */
18475
18632
  metric: components["schemas"]["UsageMetric"];
18476
18633
  /**
@@ -18608,16 +18765,20 @@ export interface components {
18608
18765
  */
18609
18766
  UsageTileSurface: "api" | "studio-online" | "studio-embedded" | "embedding" | "share";
18610
18767
  /**
18611
- * @description One day's Tile API usage, for one kind of resource, from one surface, in one
18612
- * status class. A day on which a resource was served from both the embed and
18613
- * the API, or both succeeded and failed, yields one point per combination
18614
- * rather than one total: a client that wants the combined figure adds them,
18615
- * and a client that wants what the monthly allowance counts reads the `2xx`
18616
- * points of the `api` and `embedding` surfaces, the only ones counted.
18768
+ * @description One day's Tile API usage, for one kind of resource, from one surface, from
18769
+ * one SDK at one version, in one status class. A day on which a resource was
18770
+ * served from both the embed and the API, or both succeeded and failed, yields
18771
+ * one point per combination rather than one total: a client that wants the
18772
+ * combined figure adds them, and a client that wants what the monthly
18773
+ * allowance counts reads the `2xx` points of the `api` and `embedding`
18774
+ * surfaces, the only ones counted, whichever SDK they name, `terrain` aside,
18775
+ * which is never counted on any surface.
18617
18776
  * @example {
18618
18777
  * "date": "2026-08-22",
18619
18778
  * "resource_type": "itinerary",
18620
18779
  * "surface": "api",
18780
+ * "client_name": "sdk-typescript",
18781
+ * "client_version": "0.1.0",
18621
18782
  * "status_class": "2xx",
18622
18783
  * "requests": 91043
18623
18784
  * }
@@ -18632,6 +18793,26 @@ export interface components {
18632
18793
  resource_type: components["schemas"]["UsageTileResourceType"];
18633
18794
  /** @description Where the requests came from. */
18634
18795
  surface: components["schemas"]["UsageTileSurface"];
18796
+ /**
18797
+ * @description The SDK the requests named themselves as, in their `X-Mountaya-Client`
18798
+ * header. It is reported as they sent it and never decides what counts.
18799
+ */
18800
+ client_name: components["schemas"]["UsageClientName"];
18801
+ /**
18802
+ * @description The version of that SDK the requests named: one of the ten highest
18803
+ * versions of it that carry a figure in the point's series over the
18804
+ * requested window, a series being the points that differ from this one
18805
+ * only by day, SDK, version and figure, or `older` for every lower version
18806
+ * of it in that series, summed into one figure. `null` when the requests
18807
+ * named no version in the form `MAJOR.MINOR.PATCH`, when they were refused
18808
+ * before their operation ran (a `402`, a `403`, a `429`, or a `500` while
18809
+ * their credential was checked), and always when `client_name` is
18810
+ * `unknown`. A day records a bounded number of versions of an SDK for an
18811
+ * organization: every one when its requests name at most 32 that UTC day,
18812
+ * and past that a version named later in the day may be reported as
18813
+ * `null`.
18814
+ */
18815
+ client_version: string | null;
18635
18816
  /**
18636
18817
  * @description How the requests ended, so availability is read from the same payload as
18637
18818
  * the volume the monthly allowance counts.
@@ -24579,9 +24760,7 @@ export interface components {
24579
24760
  * organizations one user creates or the invitations one organization sends,
24580
24761
  * to the next day in UTC, so it is at most 86400; for a spent monthly
24581
24762
  * allowance, to the start of the organization's next billing period, the
24582
- * first day after the days its Data API subscription's current invoice
24583
- * bills, the next occurrence of the day of the month its agreement names, or
24584
- * else the first day of the next calendar month, each at midnight in UTC.
24763
+ * first day of the next calendar month at midnight in UTC.
24585
24764
  * Send the request again once it has passed, with a little jitter of your
24586
24765
  * own; a request sent before then is refused again and counts toward the
24587
24766
  * same window.
@@ -37690,9 +37869,9 @@ export interface operations {
37690
37869
  cookie?: undefined;
37691
37870
  };
37692
37871
  /**
37693
- * @description The organization's name, optionally the website whose host seeds its
37694
- * embed domain allowlist, and whether it is meant to be covered by an
37695
- * agreement.
37872
+ * @description The organization's name, the acceptance of the Terms of Service on its
37873
+ * behalf, optionally the website whose host seeds its embed domain
37874
+ * allowlist, and whether it is meant to be covered by an agreement.
37696
37875
  */
37697
37876
  requestBody: {
37698
37877
  content: {
@@ -43296,12 +43475,14 @@ export interface operations {
43296
43475
  */
43297
43476
  request_id?: string | undefined;
43298
43477
  /**
43299
- * @description Keep only the events this kind of actor made.
43478
+ * @description Keep only the events this kind of actor made. `user` includes what
43479
+ * Mountaya's support made as a person, at their request.
43300
43480
  * @example user
43301
43481
  */
43302
43482
  actor_type?: (string & components["schemas"]["WebhookEventActorType"]) | undefined;
43303
43483
  /**
43304
- * @description Keep only the events this person made.
43484
+ * @description Keep only the events this person made, or Mountaya's support made as this
43485
+ * person, at their request.
43305
43486
  * @example 1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18
43306
43487
  */
43307
43488
  actor_user_id?: string | undefined;
@@ -44287,7 +44468,7 @@ export interface operations {
44287
44468
  responses: {
44288
44469
  /**
44289
44470
  * @description Tile API usage a day at a time, one figure per kind of resource per
44290
- * surface per status class.
44471
+ * surface per SDK and version per status class.
44291
44472
  */
44292
44473
  200: {
44293
44474
  headers: {
@@ -44433,7 +44614,7 @@ export interface operations {
44433
44614
  responses: {
44434
44615
  /**
44435
44616
  * @description Data usage a day at a time, one figure per operation per surface per
44436
- * metric per status class. Only the `requests` figures of class `2xx`
44617
+ * SDK and version per metric per status class. Only the `requests` figures of class `2xx`
44437
44618
  * on the `api` and `mcp` surfaces are what the monthly allowance and
44438
44619
  * the invoice count.
44439
44620
  */
@@ -44777,9 +44958,11 @@ export interface operations {
44777
44958
  * "status": "active",
44778
44959
  * "collection_method": "charge-automatically",
44779
44960
  * "currency": "eur",
44780
- * "current_period_end_at": "2026-09-01T02:14:07Z",
44961
+ * "current_period_end_at": "2026-09-01T00:00:00Z",
44781
44962
  * "cancel_at_period_end": false,
44782
44963
  * "paused": false,
44964
+ * "ended_at": null,
44965
+ * "end_reason": null,
44783
44966
  * "items": [
44784
44967
  * {
44785
44968
  * "price_id": "price_1QeDataRequests",
@@ -45143,9 +45326,11 @@ export interface operations {
45143
45326
  * "status": "active",
45144
45327
  * "collection_method": "charge-automatically",
45145
45328
  * "currency": "eur",
45146
- * "current_period_end_at": "2026-09-01T02:14:07Z",
45329
+ * "current_period_end_at": "2026-09-01T00:00:00Z",
45147
45330
  * "cancel_at_period_end": true,
45148
45331
  * "paused": false,
45332
+ * "ended_at": null,
45333
+ * "end_reason": null,
45149
45334
  * "items": [
45150
45335
  * {
45151
45336
  * "price_id": "price_1QeDataRequests",
@@ -56685,9 +56870,11 @@ export type PaymentMethodSepaDebit = _schemas["PaymentMethodSepaDebit"];
56685
56870
  export type PromotionCodePreview = _schemas["PromotionCodePreview"];
56686
56871
  export type SetupIntentSession = _schemas["SetupIntentSession"];
56687
56872
  export type SubscriptionCollectionMethod = _schemas["SubscriptionCollectionMethod"];
56873
+ export type SubscriptionEndReason = _schemas["SubscriptionEndReason"];
56688
56874
  export type SubscriptionDiscount = _schemas["SubscriptionDiscount"];
56689
56875
  export type SubscriptionStatus = _schemas["SubscriptionStatus"];
56690
56876
  export type TaxId = _schemas["TaxId"];
56877
+ export type UsageClientName = _schemas["UsageClientName"];
56691
56878
  export type UsageDataPoint = _schemas["UsageDataPoint"];
56692
56879
  export type UsageDataResourceType = _schemas["UsageDataResourceType"];
56693
56880
  export type UsageDataSurface = _schemas["UsageDataSurface"];
@@ -4143,9 +4143,7 @@ export interface components {
4143
4143
  * organizations one user creates or the invitations one organization sends,
4144
4144
  * to the next day in UTC, so it is at most 86400; for a spent monthly
4145
4145
  * allowance, to the start of the organization's next billing period, the
4146
- * first day after the days its Data API subscription's current invoice
4147
- * bills, the next occurrence of the day of the month its agreement names, or
4148
- * else the first day of the next calendar month, each at midnight in UTC.
4146
+ * first day of the next calendar month at midnight in UTC.
4149
4147
  * Send the request again once it has passed, with a little jitter of your
4150
4148
  * own; a request sent before then is refused again and counts toward the
4151
4149
  * same window.