@vitrina/api 11.9.0 → 11.10.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/dist/index.d.cts CHANGED
@@ -13154,6 +13154,228 @@ interface paths {
13154
13154
  patch?: never;
13155
13155
  trace?: never;
13156
13156
  };
13157
+ "/tenant/settings": {
13158
+ parameters: {
13159
+ query?: never;
13160
+ header?: never;
13161
+ path?: never;
13162
+ cookie?: never;
13163
+ };
13164
+ /**
13165
+ * Read tenant-level settings
13166
+ * @description The stored settings object, as saved through `PUT /tenant/settings`. Among its keys, `ads` holds the Vitrina Ads wizard choice: `{ tag_choice: "site" | "no_site" | null, tag_choice_at: string | null }` (`tag_choice_at` is stamped by the server on every write); absent when the workspace never answered the «Instalar el tag» step. Only the keys documented here are part of the API pública: the workspace's general identity (`name`, `timezone`, `language`, `currency`, `date_format`, `website`) and the Vitrina Ads choices under `ads`. A connected app receives exactly those keys; the workspace's own credentials may see further workspace-configuration keys, which are not contract and may change without notice.
13167
+ */
13168
+ get: {
13169
+ parameters: {
13170
+ query?: never;
13171
+ header?: never;
13172
+ path?: never;
13173
+ cookie?: never;
13174
+ };
13175
+ requestBody?: never;
13176
+ responses: {
13177
+ /** @description Tenant settings */
13178
+ 200: {
13179
+ headers: {
13180
+ [name: string]: unknown;
13181
+ };
13182
+ content: {
13183
+ /**
13184
+ * @example {
13185
+ * "data": {
13186
+ * "name": "Automotora Demo",
13187
+ * "timezone": "America/Santiago",
13188
+ * "language": "es",
13189
+ * "currency": "CLP",
13190
+ * "website": "https://www.automotora-demo.cl",
13191
+ * "ads": {
13192
+ * "tag_choice": "site",
13193
+ * "tag_choice_at": "2026-09-23T15:00:00.000Z",
13194
+ * "goal": {
13195
+ * "kind": "outcomes",
13196
+ * "target": 30,
13197
+ * "period": "month"
13198
+ * },
13199
+ * "goal_at": "2026-09-01T12:00:00.000Z",
13200
+ * "goal_by": "20000000-0000-4000-8000-000000000001"
13201
+ * }
13202
+ * }
13203
+ * }
13204
+ */
13205
+ "application/json": {
13206
+ data: components["schemas"]["TenantSettingsPublic"];
13207
+ };
13208
+ };
13209
+ };
13210
+ /** @description Validation error */
13211
+ 400: {
13212
+ headers: {
13213
+ [name: string]: unknown;
13214
+ };
13215
+ content: {
13216
+ "application/json": components["schemas"]["Error"];
13217
+ };
13218
+ };
13219
+ /** @description Unauthorized */
13220
+ 401: {
13221
+ headers: {
13222
+ [name: string]: unknown;
13223
+ };
13224
+ content: {
13225
+ "application/json": components["schemas"]["Error"];
13226
+ };
13227
+ };
13228
+ /** @description Forbidden */
13229
+ 403: {
13230
+ headers: {
13231
+ [name: string]: unknown;
13232
+ };
13233
+ content: {
13234
+ "application/json": components["schemas"]["Error"];
13235
+ };
13236
+ };
13237
+ /** @description Not found */
13238
+ 404: {
13239
+ headers: {
13240
+ [name: string]: unknown;
13241
+ };
13242
+ content: {
13243
+ "application/json": components["schemas"]["Error"];
13244
+ };
13245
+ };
13246
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13247
+ 409: {
13248
+ headers: {
13249
+ [name: string]: unknown;
13250
+ };
13251
+ content: {
13252
+ "application/json": components["schemas"]["Error"];
13253
+ };
13254
+ };
13255
+ /** @description Rate limited */
13256
+ 429: {
13257
+ headers: {
13258
+ [name: string]: unknown;
13259
+ };
13260
+ content: {
13261
+ "application/json": components["schemas"]["Error"];
13262
+ };
13263
+ };
13264
+ };
13265
+ };
13266
+ /**
13267
+ * Patch tenant-level settings
13268
+ * @description Shallow-merges the body into the stored settings and answers the result. `ads` is merged key by key (a write that sends only `ads.tag_choice` keeps `ads.goal`), and the server stamps `tag_choice_at` / `goal_at` / `goal_by` — a client never sends them (400). A connected app may write only `ads`; any other key is refused with 403 and nothing is written. Only the keys documented here are part of the API pública: the workspace's general identity (`name`, `timezone`, `language`, `currency`, `date_format`, `website`) and the Vitrina Ads choices under `ads`. A connected app receives exactly those keys; the workspace's own credentials may see further workspace-configuration keys, which are not contract and may change without notice.
13269
+ */
13270
+ put: {
13271
+ parameters: {
13272
+ query?: never;
13273
+ header?: never;
13274
+ path?: never;
13275
+ cookie?: never;
13276
+ };
13277
+ requestBody?: {
13278
+ content: {
13279
+ /**
13280
+ * @example {
13281
+ * "ads": {
13282
+ * "tag_choice": "site"
13283
+ * }
13284
+ * }
13285
+ */
13286
+ "application/json": components["schemas"]["TenantSettingsPublicWrite"];
13287
+ };
13288
+ };
13289
+ responses: {
13290
+ /** @description Tenant settings */
13291
+ 200: {
13292
+ headers: {
13293
+ [name: string]: unknown;
13294
+ };
13295
+ content: {
13296
+ /**
13297
+ * @example {
13298
+ * "data": {
13299
+ * "name": "Automotora Demo",
13300
+ * "timezone": "America/Santiago",
13301
+ * "language": "es",
13302
+ * "currency": "CLP",
13303
+ * "website": "https://www.automotora-demo.cl",
13304
+ * "ads": {
13305
+ * "tag_choice": "site",
13306
+ * "tag_choice_at": "2026-09-24T12:00:00.000Z"
13307
+ * }
13308
+ * }
13309
+ * }
13310
+ */
13311
+ "application/json": {
13312
+ data: components["schemas"]["TenantSettingsPublic"];
13313
+ };
13314
+ };
13315
+ };
13316
+ /** @description Validation error */
13317
+ 400: {
13318
+ headers: {
13319
+ [name: string]: unknown;
13320
+ };
13321
+ content: {
13322
+ "application/json": components["schemas"]["Error"];
13323
+ };
13324
+ };
13325
+ /** @description Unauthorized */
13326
+ 401: {
13327
+ headers: {
13328
+ [name: string]: unknown;
13329
+ };
13330
+ content: {
13331
+ "application/json": components["schemas"]["Error"];
13332
+ };
13333
+ };
13334
+ /** @description Forbidden */
13335
+ 403: {
13336
+ headers: {
13337
+ [name: string]: unknown;
13338
+ };
13339
+ content: {
13340
+ "application/json": components["schemas"]["Error"];
13341
+ };
13342
+ };
13343
+ /** @description Not found */
13344
+ 404: {
13345
+ headers: {
13346
+ [name: string]: unknown;
13347
+ };
13348
+ content: {
13349
+ "application/json": components["schemas"]["Error"];
13350
+ };
13351
+ };
13352
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13353
+ 409: {
13354
+ headers: {
13355
+ [name: string]: unknown;
13356
+ };
13357
+ content: {
13358
+ "application/json": components["schemas"]["Error"];
13359
+ };
13360
+ };
13361
+ /** @description Rate limited */
13362
+ 429: {
13363
+ headers: {
13364
+ [name: string]: unknown;
13365
+ };
13366
+ content: {
13367
+ "application/json": components["schemas"]["Error"];
13368
+ };
13369
+ };
13370
+ };
13371
+ };
13372
+ post?: never;
13373
+ delete?: never;
13374
+ options?: never;
13375
+ head?: never;
13376
+ patch?: never;
13377
+ trace?: never;
13378
+ };
13157
13379
  "/entitlements": {
13158
13380
  parameters: {
13159
13381
  query?: never;
@@ -28963,6 +29185,240 @@ interface paths {
28963
29185
  patch?: never;
28964
29186
  trace?: never;
28965
29187
  };
29188
+ "/billing/payment-method": {
29189
+ parameters: {
29190
+ query?: never;
29191
+ header?: never;
29192
+ path?: never;
29193
+ cookie?: never;
29194
+ };
29195
+ /**
29196
+ * Current payment provider + mandate status for the tenant
29197
+ * @description The workspace's chosen payment provider (`fintoc` for a PAC bank mandate, `mercadopago` for a tokenized card) and the status of its newest mandate: `active` means add-ons can be activated self-serve (`POST /entitlements/{feature}/activate`), `pending` means the Fintoc hosted setup was started but not finished. All three fields are `null` before any enrollment. Carries no payment instrument data — no card number, bank account or provider token is ever returned.
29198
+ */
29199
+ get: {
29200
+ parameters: {
29201
+ query?: never;
29202
+ header?: never;
29203
+ path?: never;
29204
+ cookie?: never;
29205
+ };
29206
+ requestBody?: never;
29207
+ responses: {
29208
+ /** @description Payment method status */
29209
+ 200: {
29210
+ headers: {
29211
+ [name: string]: unknown;
29212
+ };
29213
+ content: {
29214
+ /**
29215
+ * @example {
29216
+ * "data": {
29217
+ * "provider": "fintoc",
29218
+ * "status": "active",
29219
+ * "mandateId": "f1f1f1f1-0000-4000-8000-000000000001"
29220
+ * }
29221
+ * }
29222
+ */
29223
+ "application/json": {
29224
+ data: components["schemas"]["PaymentMethodStatus"];
29225
+ };
29226
+ };
29227
+ };
29228
+ /** @description Validation error */
29229
+ 400: {
29230
+ headers: {
29231
+ [name: string]: unknown;
29232
+ };
29233
+ content: {
29234
+ "application/json": components["schemas"]["Error"];
29235
+ };
29236
+ };
29237
+ /** @description Unauthorized */
29238
+ 401: {
29239
+ headers: {
29240
+ [name: string]: unknown;
29241
+ };
29242
+ content: {
29243
+ "application/json": components["schemas"]["Error"];
29244
+ };
29245
+ };
29246
+ /** @description Forbidden */
29247
+ 403: {
29248
+ headers: {
29249
+ [name: string]: unknown;
29250
+ };
29251
+ content: {
29252
+ "application/json": components["schemas"]["Error"];
29253
+ };
29254
+ };
29255
+ /** @description Not found */
29256
+ 404: {
29257
+ headers: {
29258
+ [name: string]: unknown;
29259
+ };
29260
+ content: {
29261
+ "application/json": components["schemas"]["Error"];
29262
+ };
29263
+ };
29264
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
29265
+ 409: {
29266
+ headers: {
29267
+ [name: string]: unknown;
29268
+ };
29269
+ content: {
29270
+ "application/json": components["schemas"]["Error"];
29271
+ };
29272
+ };
29273
+ /** @description Rate limited */
29274
+ 429: {
29275
+ headers: {
29276
+ [name: string]: unknown;
29277
+ };
29278
+ content: {
29279
+ "application/json": components["schemas"]["Error"];
29280
+ };
29281
+ };
29282
+ };
29283
+ };
29284
+ put?: never;
29285
+ post?: never;
29286
+ delete?: never;
29287
+ options?: never;
29288
+ head?: never;
29289
+ patch?: never;
29290
+ trace?: never;
29291
+ };
29292
+ "/billing/payment-method/setup": {
29293
+ parameters: {
29294
+ query?: never;
29295
+ header?: never;
29296
+ path?: never;
29297
+ cookie?: never;
29298
+ };
29299
+ get?: never;
29300
+ put?: never;
29301
+ /**
29302
+ * Connect a payment provider (Fintoc hosted PAC redirect, or MercadoPago tokenized card)
29303
+ * @description Makes `provider` the workspace's single payment account and creates its mandate. Fintoc answers `status: "pending"` with a `setupUrl` to send the owner to (the hosted PAC setup, which returns to `returnUrl`); MercadoPago takes a `cardToken` minted client-side by MercadoPago's own SDK — never a raw card number — and answers `status: "active"` with `setupUrl: null`. `email` (the payer) is required by both providers; `rut` (optional) goes on the Fintoc customer. Requires `billing:write`, which only the workspace owner holds.
29304
+ */
29305
+ post: {
29306
+ parameters: {
29307
+ query?: never;
29308
+ header?: {
29309
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
29310
+ "Idempotency-Key"?: string;
29311
+ };
29312
+ path?: never;
29313
+ cookie?: never;
29314
+ };
29315
+ requestBody?: {
29316
+ content: {
29317
+ /**
29318
+ * @example {
29319
+ * "provider": "fintoc",
29320
+ * "returnUrl": "https://app.vitrinadev.com/settings/complementos",
29321
+ * "email": "facturacion@automotora-demo.cl",
29322
+ * "rut": "76.123.456-7"
29323
+ * }
29324
+ */
29325
+ "application/json": {
29326
+ /** @enum {string} */
29327
+ provider: "fintoc" | "mercadopago";
29328
+ /** Format: uri */
29329
+ returnUrl?: string;
29330
+ cardToken?: string;
29331
+ /** Format: email */
29332
+ email?: string;
29333
+ name?: string;
29334
+ rut?: string;
29335
+ };
29336
+ };
29337
+ };
29338
+ responses: {
29339
+ /** @description Enrollment started (Fintoc → setupUrl) or completed (MercadoPago → active) */
29340
+ 200: {
29341
+ headers: {
29342
+ [name: string]: unknown;
29343
+ };
29344
+ content: {
29345
+ /**
29346
+ * @example {
29347
+ * "data": {
29348
+ * "provider": "fintoc",
29349
+ * "status": "pending",
29350
+ * "mandateId": "f1f1f1f1-0000-4000-8000-000000000002",
29351
+ * "setupUrl": "https://pay.fintoc.com/subscriptions/setup/example"
29352
+ * }
29353
+ * }
29354
+ */
29355
+ "application/json": {
29356
+ data: components["schemas"]["PaymentMethodSetup"];
29357
+ };
29358
+ };
29359
+ };
29360
+ /** @description Validation error */
29361
+ 400: {
29362
+ headers: {
29363
+ [name: string]: unknown;
29364
+ };
29365
+ content: {
29366
+ "application/json": components["schemas"]["Error"];
29367
+ };
29368
+ };
29369
+ /** @description Unauthorized */
29370
+ 401: {
29371
+ headers: {
29372
+ [name: string]: unknown;
29373
+ };
29374
+ content: {
29375
+ "application/json": components["schemas"]["Error"];
29376
+ };
29377
+ };
29378
+ /** @description Forbidden */
29379
+ 403: {
29380
+ headers: {
29381
+ [name: string]: unknown;
29382
+ };
29383
+ content: {
29384
+ "application/json": components["schemas"]["Error"];
29385
+ };
29386
+ };
29387
+ /** @description Not found */
29388
+ 404: {
29389
+ headers: {
29390
+ [name: string]: unknown;
29391
+ };
29392
+ content: {
29393
+ "application/json": components["schemas"]["Error"];
29394
+ };
29395
+ };
29396
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
29397
+ 409: {
29398
+ headers: {
29399
+ [name: string]: unknown;
29400
+ };
29401
+ content: {
29402
+ "application/json": components["schemas"]["Error"];
29403
+ };
29404
+ };
29405
+ /** @description Rate limited */
29406
+ 429: {
29407
+ headers: {
29408
+ [name: string]: unknown;
29409
+ };
29410
+ content: {
29411
+ "application/json": components["schemas"]["Error"];
29412
+ };
29413
+ };
29414
+ };
29415
+ };
29416
+ delete?: never;
29417
+ options?: never;
29418
+ head?: never;
29419
+ patch?: never;
29420
+ trace?: never;
29421
+ };
28966
29422
  "/sale-notes": {
28967
29423
  parameters: {
28968
29424
  query?: never;
@@ -110334,6 +110790,99 @@ interface components {
110334
110790
  name: string;
110335
110791
  };
110336
110792
  };
110793
+ TenantSettingsPublic: {
110794
+ /** @description Workspace display name. */
110795
+ name?: string;
110796
+ /** @description IANA time zone, e.g. `America/Santiago`. */
110797
+ timezone?: string;
110798
+ /** @description Default language, e.g. `es`. */
110799
+ language?: string;
110800
+ /** @description ISO 4217 currency, e.g. `CLP`. */
110801
+ currency?: string;
110802
+ /** @enum {string} */
110803
+ date_format?: "latam" | "us" | "iso";
110804
+ /** @description The workspace's declared public website. */
110805
+ website?: string;
110806
+ /** @description Vitrina Ads workspace choices; absent until first answered. */
110807
+ ads?: {
110808
+ /**
110809
+ * @description How the «Instalar el tag» step was answered: `site` (the tag goes on the workspace website) or `no_site` (no website; skipped on purpose). Absent/`null` = never answered.
110810
+ * @enum {string|null}
110811
+ */
110812
+ tag_choice?: "site" | "no_site" | null;
110813
+ /**
110814
+ * Format: date-time
110815
+ * @description Server-stamped on every `tag_choice` write.
110816
+ */
110817
+ tag_choice_at?: string | null;
110818
+ /** @description The monthly goal the Ads hero measures pace against. */
110819
+ goal?: {
110820
+ /**
110821
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
110822
+ * @enum {string}
110823
+ */
110824
+ kind: "outcomes" | "value" | "roas";
110825
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
110826
+ target: number;
110827
+ /**
110828
+ * @description The only period: the calendar month.
110829
+ * @enum {string}
110830
+ */
110831
+ period: "month";
110832
+ } | null;
110833
+ /**
110834
+ * Format: date-time
110835
+ * @description Server-stamped on every `goal` write.
110836
+ */
110837
+ goal_at?: string | null;
110838
+ /** @description Who last wrote the goal: the member's user id, or the API key id. */
110839
+ goal_by?: string | null;
110840
+ /** @description `{ [action key]: until ISO }` — Ads actions hidden until that instant; expired entries are pruned on every write. */
110841
+ dismissed_actions?: {
110842
+ [key: string]: string;
110843
+ };
110844
+ };
110845
+ };
110846
+ TenantSettingsPublicWrite: {
110847
+ /** @description Vitrina Ads workspace choices. `tag_choice`: how the «Instalar el tag» step was answered — `site` (the tag goes on the workspace's website, pasted or through Google Tag Manager) or `no_site` (no website; step skipped on purpose); `null` clears it. `goal`: the monthly goal the Ads hero measures pace against (`{kind, target, period:'month'}`; `null` clears it — `PUT /ads/goal` is the dedicated door). `dismissed_actions`: `{ [action id]: until ISO }` merged onto the stored map (`null` removes an id; expired entries are pruned). Merged into the stored `ads` object; the server stamps `tag_choice_at` / `goal_at` / `goal_by` on every write, and `GET /tenant/settings` returns them under `ads`. */
110848
+ ads?: {
110849
+ /** @enum {string|null} */
110850
+ tag_choice?: "site" | "no_site" | null;
110851
+ goal?: {
110852
+ /**
110853
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
110854
+ * @enum {string}
110855
+ */
110856
+ kind: "outcomes" | "value" | "roas";
110857
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
110858
+ target: number;
110859
+ /**
110860
+ * @description The only period: the calendar month.
110861
+ * @enum {string}
110862
+ */
110863
+ period: "month";
110864
+ } | null;
110865
+ dismissed_actions?: {
110866
+ [key: string]: string | null;
110867
+ };
110868
+ };
110869
+ };
110870
+ PaymentMethodSetup: {
110871
+ /** @enum {string} */
110872
+ provider: "fintoc" | "mercadopago";
110873
+ /** @enum {string} */
110874
+ status: "pending" | "active";
110875
+ mandateId: string;
110876
+ /** Format: uri */
110877
+ setupUrl: string | null;
110878
+ };
110879
+ PaymentMethodStatus: {
110880
+ /** @enum {string|null} */
110881
+ provider: "fintoc" | "mercadopago" | null;
110882
+ /** @enum {string|null} */
110883
+ status: "pending" | "active" | "revoked" | "failed" | null;
110884
+ mandateId: string | null;
110885
+ };
110337
110886
  ClinicProfessional: {
110338
110887
  /** Format: uuid */
110339
110888
  id: string;
package/dist/index.d.ts CHANGED
@@ -13154,6 +13154,228 @@ interface paths {
13154
13154
  patch?: never;
13155
13155
  trace?: never;
13156
13156
  };
13157
+ "/tenant/settings": {
13158
+ parameters: {
13159
+ query?: never;
13160
+ header?: never;
13161
+ path?: never;
13162
+ cookie?: never;
13163
+ };
13164
+ /**
13165
+ * Read tenant-level settings
13166
+ * @description The stored settings object, as saved through `PUT /tenant/settings`. Among its keys, `ads` holds the Vitrina Ads wizard choice: `{ tag_choice: "site" | "no_site" | null, tag_choice_at: string | null }` (`tag_choice_at` is stamped by the server on every write); absent when the workspace never answered the «Instalar el tag» step. Only the keys documented here are part of the API pública: the workspace's general identity (`name`, `timezone`, `language`, `currency`, `date_format`, `website`) and the Vitrina Ads choices under `ads`. A connected app receives exactly those keys; the workspace's own credentials may see further workspace-configuration keys, which are not contract and may change without notice.
13167
+ */
13168
+ get: {
13169
+ parameters: {
13170
+ query?: never;
13171
+ header?: never;
13172
+ path?: never;
13173
+ cookie?: never;
13174
+ };
13175
+ requestBody?: never;
13176
+ responses: {
13177
+ /** @description Tenant settings */
13178
+ 200: {
13179
+ headers: {
13180
+ [name: string]: unknown;
13181
+ };
13182
+ content: {
13183
+ /**
13184
+ * @example {
13185
+ * "data": {
13186
+ * "name": "Automotora Demo",
13187
+ * "timezone": "America/Santiago",
13188
+ * "language": "es",
13189
+ * "currency": "CLP",
13190
+ * "website": "https://www.automotora-demo.cl",
13191
+ * "ads": {
13192
+ * "tag_choice": "site",
13193
+ * "tag_choice_at": "2026-09-23T15:00:00.000Z",
13194
+ * "goal": {
13195
+ * "kind": "outcomes",
13196
+ * "target": 30,
13197
+ * "period": "month"
13198
+ * },
13199
+ * "goal_at": "2026-09-01T12:00:00.000Z",
13200
+ * "goal_by": "20000000-0000-4000-8000-000000000001"
13201
+ * }
13202
+ * }
13203
+ * }
13204
+ */
13205
+ "application/json": {
13206
+ data: components["schemas"]["TenantSettingsPublic"];
13207
+ };
13208
+ };
13209
+ };
13210
+ /** @description Validation error */
13211
+ 400: {
13212
+ headers: {
13213
+ [name: string]: unknown;
13214
+ };
13215
+ content: {
13216
+ "application/json": components["schemas"]["Error"];
13217
+ };
13218
+ };
13219
+ /** @description Unauthorized */
13220
+ 401: {
13221
+ headers: {
13222
+ [name: string]: unknown;
13223
+ };
13224
+ content: {
13225
+ "application/json": components["schemas"]["Error"];
13226
+ };
13227
+ };
13228
+ /** @description Forbidden */
13229
+ 403: {
13230
+ headers: {
13231
+ [name: string]: unknown;
13232
+ };
13233
+ content: {
13234
+ "application/json": components["schemas"]["Error"];
13235
+ };
13236
+ };
13237
+ /** @description Not found */
13238
+ 404: {
13239
+ headers: {
13240
+ [name: string]: unknown;
13241
+ };
13242
+ content: {
13243
+ "application/json": components["schemas"]["Error"];
13244
+ };
13245
+ };
13246
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13247
+ 409: {
13248
+ headers: {
13249
+ [name: string]: unknown;
13250
+ };
13251
+ content: {
13252
+ "application/json": components["schemas"]["Error"];
13253
+ };
13254
+ };
13255
+ /** @description Rate limited */
13256
+ 429: {
13257
+ headers: {
13258
+ [name: string]: unknown;
13259
+ };
13260
+ content: {
13261
+ "application/json": components["schemas"]["Error"];
13262
+ };
13263
+ };
13264
+ };
13265
+ };
13266
+ /**
13267
+ * Patch tenant-level settings
13268
+ * @description Shallow-merges the body into the stored settings and answers the result. `ads` is merged key by key (a write that sends only `ads.tag_choice` keeps `ads.goal`), and the server stamps `tag_choice_at` / `goal_at` / `goal_by` — a client never sends them (400). A connected app may write only `ads`; any other key is refused with 403 and nothing is written. Only the keys documented here are part of the API pública: the workspace's general identity (`name`, `timezone`, `language`, `currency`, `date_format`, `website`) and the Vitrina Ads choices under `ads`. A connected app receives exactly those keys; the workspace's own credentials may see further workspace-configuration keys, which are not contract and may change without notice.
13269
+ */
13270
+ put: {
13271
+ parameters: {
13272
+ query?: never;
13273
+ header?: never;
13274
+ path?: never;
13275
+ cookie?: never;
13276
+ };
13277
+ requestBody?: {
13278
+ content: {
13279
+ /**
13280
+ * @example {
13281
+ * "ads": {
13282
+ * "tag_choice": "site"
13283
+ * }
13284
+ * }
13285
+ */
13286
+ "application/json": components["schemas"]["TenantSettingsPublicWrite"];
13287
+ };
13288
+ };
13289
+ responses: {
13290
+ /** @description Tenant settings */
13291
+ 200: {
13292
+ headers: {
13293
+ [name: string]: unknown;
13294
+ };
13295
+ content: {
13296
+ /**
13297
+ * @example {
13298
+ * "data": {
13299
+ * "name": "Automotora Demo",
13300
+ * "timezone": "America/Santiago",
13301
+ * "language": "es",
13302
+ * "currency": "CLP",
13303
+ * "website": "https://www.automotora-demo.cl",
13304
+ * "ads": {
13305
+ * "tag_choice": "site",
13306
+ * "tag_choice_at": "2026-09-24T12:00:00.000Z"
13307
+ * }
13308
+ * }
13309
+ * }
13310
+ */
13311
+ "application/json": {
13312
+ data: components["schemas"]["TenantSettingsPublic"];
13313
+ };
13314
+ };
13315
+ };
13316
+ /** @description Validation error */
13317
+ 400: {
13318
+ headers: {
13319
+ [name: string]: unknown;
13320
+ };
13321
+ content: {
13322
+ "application/json": components["schemas"]["Error"];
13323
+ };
13324
+ };
13325
+ /** @description Unauthorized */
13326
+ 401: {
13327
+ headers: {
13328
+ [name: string]: unknown;
13329
+ };
13330
+ content: {
13331
+ "application/json": components["schemas"]["Error"];
13332
+ };
13333
+ };
13334
+ /** @description Forbidden */
13335
+ 403: {
13336
+ headers: {
13337
+ [name: string]: unknown;
13338
+ };
13339
+ content: {
13340
+ "application/json": components["schemas"]["Error"];
13341
+ };
13342
+ };
13343
+ /** @description Not found */
13344
+ 404: {
13345
+ headers: {
13346
+ [name: string]: unknown;
13347
+ };
13348
+ content: {
13349
+ "application/json": components["schemas"]["Error"];
13350
+ };
13351
+ };
13352
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13353
+ 409: {
13354
+ headers: {
13355
+ [name: string]: unknown;
13356
+ };
13357
+ content: {
13358
+ "application/json": components["schemas"]["Error"];
13359
+ };
13360
+ };
13361
+ /** @description Rate limited */
13362
+ 429: {
13363
+ headers: {
13364
+ [name: string]: unknown;
13365
+ };
13366
+ content: {
13367
+ "application/json": components["schemas"]["Error"];
13368
+ };
13369
+ };
13370
+ };
13371
+ };
13372
+ post?: never;
13373
+ delete?: never;
13374
+ options?: never;
13375
+ head?: never;
13376
+ patch?: never;
13377
+ trace?: never;
13378
+ };
13157
13379
  "/entitlements": {
13158
13380
  parameters: {
13159
13381
  query?: never;
@@ -28963,6 +29185,240 @@ interface paths {
28963
29185
  patch?: never;
28964
29186
  trace?: never;
28965
29187
  };
29188
+ "/billing/payment-method": {
29189
+ parameters: {
29190
+ query?: never;
29191
+ header?: never;
29192
+ path?: never;
29193
+ cookie?: never;
29194
+ };
29195
+ /**
29196
+ * Current payment provider + mandate status for the tenant
29197
+ * @description The workspace's chosen payment provider (`fintoc` for a PAC bank mandate, `mercadopago` for a tokenized card) and the status of its newest mandate: `active` means add-ons can be activated self-serve (`POST /entitlements/{feature}/activate`), `pending` means the Fintoc hosted setup was started but not finished. All three fields are `null` before any enrollment. Carries no payment instrument data — no card number, bank account or provider token is ever returned.
29198
+ */
29199
+ get: {
29200
+ parameters: {
29201
+ query?: never;
29202
+ header?: never;
29203
+ path?: never;
29204
+ cookie?: never;
29205
+ };
29206
+ requestBody?: never;
29207
+ responses: {
29208
+ /** @description Payment method status */
29209
+ 200: {
29210
+ headers: {
29211
+ [name: string]: unknown;
29212
+ };
29213
+ content: {
29214
+ /**
29215
+ * @example {
29216
+ * "data": {
29217
+ * "provider": "fintoc",
29218
+ * "status": "active",
29219
+ * "mandateId": "f1f1f1f1-0000-4000-8000-000000000001"
29220
+ * }
29221
+ * }
29222
+ */
29223
+ "application/json": {
29224
+ data: components["schemas"]["PaymentMethodStatus"];
29225
+ };
29226
+ };
29227
+ };
29228
+ /** @description Validation error */
29229
+ 400: {
29230
+ headers: {
29231
+ [name: string]: unknown;
29232
+ };
29233
+ content: {
29234
+ "application/json": components["schemas"]["Error"];
29235
+ };
29236
+ };
29237
+ /** @description Unauthorized */
29238
+ 401: {
29239
+ headers: {
29240
+ [name: string]: unknown;
29241
+ };
29242
+ content: {
29243
+ "application/json": components["schemas"]["Error"];
29244
+ };
29245
+ };
29246
+ /** @description Forbidden */
29247
+ 403: {
29248
+ headers: {
29249
+ [name: string]: unknown;
29250
+ };
29251
+ content: {
29252
+ "application/json": components["schemas"]["Error"];
29253
+ };
29254
+ };
29255
+ /** @description Not found */
29256
+ 404: {
29257
+ headers: {
29258
+ [name: string]: unknown;
29259
+ };
29260
+ content: {
29261
+ "application/json": components["schemas"]["Error"];
29262
+ };
29263
+ };
29264
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
29265
+ 409: {
29266
+ headers: {
29267
+ [name: string]: unknown;
29268
+ };
29269
+ content: {
29270
+ "application/json": components["schemas"]["Error"];
29271
+ };
29272
+ };
29273
+ /** @description Rate limited */
29274
+ 429: {
29275
+ headers: {
29276
+ [name: string]: unknown;
29277
+ };
29278
+ content: {
29279
+ "application/json": components["schemas"]["Error"];
29280
+ };
29281
+ };
29282
+ };
29283
+ };
29284
+ put?: never;
29285
+ post?: never;
29286
+ delete?: never;
29287
+ options?: never;
29288
+ head?: never;
29289
+ patch?: never;
29290
+ trace?: never;
29291
+ };
29292
+ "/billing/payment-method/setup": {
29293
+ parameters: {
29294
+ query?: never;
29295
+ header?: never;
29296
+ path?: never;
29297
+ cookie?: never;
29298
+ };
29299
+ get?: never;
29300
+ put?: never;
29301
+ /**
29302
+ * Connect a payment provider (Fintoc hosted PAC redirect, or MercadoPago tokenized card)
29303
+ * @description Makes `provider` the workspace's single payment account and creates its mandate. Fintoc answers `status: "pending"` with a `setupUrl` to send the owner to (the hosted PAC setup, which returns to `returnUrl`); MercadoPago takes a `cardToken` minted client-side by MercadoPago's own SDK — never a raw card number — and answers `status: "active"` with `setupUrl: null`. `email` (the payer) is required by both providers; `rut` (optional) goes on the Fintoc customer. Requires `billing:write`, which only the workspace owner holds.
29304
+ */
29305
+ post: {
29306
+ parameters: {
29307
+ query?: never;
29308
+ header?: {
29309
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
29310
+ "Idempotency-Key"?: string;
29311
+ };
29312
+ path?: never;
29313
+ cookie?: never;
29314
+ };
29315
+ requestBody?: {
29316
+ content: {
29317
+ /**
29318
+ * @example {
29319
+ * "provider": "fintoc",
29320
+ * "returnUrl": "https://app.vitrinadev.com/settings/complementos",
29321
+ * "email": "facturacion@automotora-demo.cl",
29322
+ * "rut": "76.123.456-7"
29323
+ * }
29324
+ */
29325
+ "application/json": {
29326
+ /** @enum {string} */
29327
+ provider: "fintoc" | "mercadopago";
29328
+ /** Format: uri */
29329
+ returnUrl?: string;
29330
+ cardToken?: string;
29331
+ /** Format: email */
29332
+ email?: string;
29333
+ name?: string;
29334
+ rut?: string;
29335
+ };
29336
+ };
29337
+ };
29338
+ responses: {
29339
+ /** @description Enrollment started (Fintoc → setupUrl) or completed (MercadoPago → active) */
29340
+ 200: {
29341
+ headers: {
29342
+ [name: string]: unknown;
29343
+ };
29344
+ content: {
29345
+ /**
29346
+ * @example {
29347
+ * "data": {
29348
+ * "provider": "fintoc",
29349
+ * "status": "pending",
29350
+ * "mandateId": "f1f1f1f1-0000-4000-8000-000000000002",
29351
+ * "setupUrl": "https://pay.fintoc.com/subscriptions/setup/example"
29352
+ * }
29353
+ * }
29354
+ */
29355
+ "application/json": {
29356
+ data: components["schemas"]["PaymentMethodSetup"];
29357
+ };
29358
+ };
29359
+ };
29360
+ /** @description Validation error */
29361
+ 400: {
29362
+ headers: {
29363
+ [name: string]: unknown;
29364
+ };
29365
+ content: {
29366
+ "application/json": components["schemas"]["Error"];
29367
+ };
29368
+ };
29369
+ /** @description Unauthorized */
29370
+ 401: {
29371
+ headers: {
29372
+ [name: string]: unknown;
29373
+ };
29374
+ content: {
29375
+ "application/json": components["schemas"]["Error"];
29376
+ };
29377
+ };
29378
+ /** @description Forbidden */
29379
+ 403: {
29380
+ headers: {
29381
+ [name: string]: unknown;
29382
+ };
29383
+ content: {
29384
+ "application/json": components["schemas"]["Error"];
29385
+ };
29386
+ };
29387
+ /** @description Not found */
29388
+ 404: {
29389
+ headers: {
29390
+ [name: string]: unknown;
29391
+ };
29392
+ content: {
29393
+ "application/json": components["schemas"]["Error"];
29394
+ };
29395
+ };
29396
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
29397
+ 409: {
29398
+ headers: {
29399
+ [name: string]: unknown;
29400
+ };
29401
+ content: {
29402
+ "application/json": components["schemas"]["Error"];
29403
+ };
29404
+ };
29405
+ /** @description Rate limited */
29406
+ 429: {
29407
+ headers: {
29408
+ [name: string]: unknown;
29409
+ };
29410
+ content: {
29411
+ "application/json": components["schemas"]["Error"];
29412
+ };
29413
+ };
29414
+ };
29415
+ };
29416
+ delete?: never;
29417
+ options?: never;
29418
+ head?: never;
29419
+ patch?: never;
29420
+ trace?: never;
29421
+ };
28966
29422
  "/sale-notes": {
28967
29423
  parameters: {
28968
29424
  query?: never;
@@ -110334,6 +110790,99 @@ interface components {
110334
110790
  name: string;
110335
110791
  };
110336
110792
  };
110793
+ TenantSettingsPublic: {
110794
+ /** @description Workspace display name. */
110795
+ name?: string;
110796
+ /** @description IANA time zone, e.g. `America/Santiago`. */
110797
+ timezone?: string;
110798
+ /** @description Default language, e.g. `es`. */
110799
+ language?: string;
110800
+ /** @description ISO 4217 currency, e.g. `CLP`. */
110801
+ currency?: string;
110802
+ /** @enum {string} */
110803
+ date_format?: "latam" | "us" | "iso";
110804
+ /** @description The workspace's declared public website. */
110805
+ website?: string;
110806
+ /** @description Vitrina Ads workspace choices; absent until first answered. */
110807
+ ads?: {
110808
+ /**
110809
+ * @description How the «Instalar el tag» step was answered: `site` (the tag goes on the workspace website) or `no_site` (no website; skipped on purpose). Absent/`null` = never answered.
110810
+ * @enum {string|null}
110811
+ */
110812
+ tag_choice?: "site" | "no_site" | null;
110813
+ /**
110814
+ * Format: date-time
110815
+ * @description Server-stamped on every `tag_choice` write.
110816
+ */
110817
+ tag_choice_at?: string | null;
110818
+ /** @description The monthly goal the Ads hero measures pace against. */
110819
+ goal?: {
110820
+ /**
110821
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
110822
+ * @enum {string}
110823
+ */
110824
+ kind: "outcomes" | "value" | "roas";
110825
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
110826
+ target: number;
110827
+ /**
110828
+ * @description The only period: the calendar month.
110829
+ * @enum {string}
110830
+ */
110831
+ period: "month";
110832
+ } | null;
110833
+ /**
110834
+ * Format: date-time
110835
+ * @description Server-stamped on every `goal` write.
110836
+ */
110837
+ goal_at?: string | null;
110838
+ /** @description Who last wrote the goal: the member's user id, or the API key id. */
110839
+ goal_by?: string | null;
110840
+ /** @description `{ [action key]: until ISO }` — Ads actions hidden until that instant; expired entries are pruned on every write. */
110841
+ dismissed_actions?: {
110842
+ [key: string]: string;
110843
+ };
110844
+ };
110845
+ };
110846
+ TenantSettingsPublicWrite: {
110847
+ /** @description Vitrina Ads workspace choices. `tag_choice`: how the «Instalar el tag» step was answered — `site` (the tag goes on the workspace's website, pasted or through Google Tag Manager) or `no_site` (no website; step skipped on purpose); `null` clears it. `goal`: the monthly goal the Ads hero measures pace against (`{kind, target, period:'month'}`; `null` clears it — `PUT /ads/goal` is the dedicated door). `dismissed_actions`: `{ [action id]: until ISO }` merged onto the stored map (`null` removes an id; expired entries are pruned). Merged into the stored `ads` object; the server stamps `tag_choice_at` / `goal_at` / `goal_by` on every write, and `GET /tenant/settings` returns them under `ads`. */
110848
+ ads?: {
110849
+ /** @enum {string|null} */
110850
+ tag_choice?: "site" | "no_site" | null;
110851
+ goal?: {
110852
+ /**
110853
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
110854
+ * @enum {string}
110855
+ */
110856
+ kind: "outcomes" | "value" | "roas";
110857
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
110858
+ target: number;
110859
+ /**
110860
+ * @description The only period: the calendar month.
110861
+ * @enum {string}
110862
+ */
110863
+ period: "month";
110864
+ } | null;
110865
+ dismissed_actions?: {
110866
+ [key: string]: string | null;
110867
+ };
110868
+ };
110869
+ };
110870
+ PaymentMethodSetup: {
110871
+ /** @enum {string} */
110872
+ provider: "fintoc" | "mercadopago";
110873
+ /** @enum {string} */
110874
+ status: "pending" | "active";
110875
+ mandateId: string;
110876
+ /** Format: uri */
110877
+ setupUrl: string | null;
110878
+ };
110879
+ PaymentMethodStatus: {
110880
+ /** @enum {string|null} */
110881
+ provider: "fintoc" | "mercadopago" | null;
110882
+ /** @enum {string|null} */
110883
+ status: "pending" | "active" | "revoked" | "failed" | null;
110884
+ mandateId: string | null;
110885
+ };
110337
110886
  ClinicProfessional: {
110338
110887
  /** Format: uuid */
110339
110888
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "11.9.0",
3
+ "version": "11.10.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",