@vitrina/api 17.123.1 → 17.125.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 +150 -2
- package/dist/index.d.ts +150 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -7170,6 +7170,118 @@ interface paths {
|
|
|
7170
7170
|
patch?: never;
|
|
7171
7171
|
trace?: never;
|
|
7172
7172
|
};
|
|
7173
|
+
"/pipelines/{id}/qualifying-stage": {
|
|
7174
|
+
parameters: {
|
|
7175
|
+
query?: never;
|
|
7176
|
+
header?: never;
|
|
7177
|
+
path?: never;
|
|
7178
|
+
cookie?: never;
|
|
7179
|
+
};
|
|
7180
|
+
get?: never;
|
|
7181
|
+
put?: never;
|
|
7182
|
+
/**
|
|
7183
|
+
* Add the qualifying stage to a clinic board
|
|
7184
|
+
* @description «Agregar etapa calificadora» (ADR 0163, vitrina-app#8081): gives a clinic's selling board its Etapa calificadora in one step: an open stage «Calificado» right after the entry stage, marked `qualifies_lead`, driver `conversation`, Paso del embudo «Sin cita» on the clinic board, with its standard description. The board's transition whitelist is opened for it (from the entry stage, and from whatever reaches the entry stage); an EMPTY whitelist stays unrestricted. `outcome`: `created`; `marked_existing` (an unmarked open stage already named «Calificado» was marked instead of adding a second); `already_marked` (the board marks one already; nothing written). While the board marks it, the clinic's AI agent may move a lead there when its own instructions define filter questions and the patient's answers pass them; un-marking the stage (`PUT /stages/{id}` `{ "qualifies_lead": false }`) turns that off. 422 `STAGE_QUALIFIES_LEAD_NOT_ALLOWED` outside clinics or on a board that does not sell.
|
|
7185
|
+
*/
|
|
7186
|
+
post: {
|
|
7187
|
+
parameters: {
|
|
7188
|
+
query?: never;
|
|
7189
|
+
header?: {
|
|
7190
|
+
/** @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. */
|
|
7191
|
+
"Idempotency-Key"?: string;
|
|
7192
|
+
};
|
|
7193
|
+
path: {
|
|
7194
|
+
id: string;
|
|
7195
|
+
};
|
|
7196
|
+
cookie?: never;
|
|
7197
|
+
};
|
|
7198
|
+
requestBody?: never;
|
|
7199
|
+
responses: {
|
|
7200
|
+
/** @description Qualifying stage */
|
|
7201
|
+
200: {
|
|
7202
|
+
headers: {
|
|
7203
|
+
[name: string]: unknown;
|
|
7204
|
+
};
|
|
7205
|
+
content: {
|
|
7206
|
+
/**
|
|
7207
|
+
* @example {
|
|
7208
|
+
* "data": {
|
|
7209
|
+
* "pipeline_id": "44444444-0000-4000-8000-000000000001",
|
|
7210
|
+
* "stage_id": "9b2f6c1e-4d7a-4f3b-8c2e-1a5d7e9f0b34",
|
|
7211
|
+
* "outcome": "created"
|
|
7212
|
+
* }
|
|
7213
|
+
* }
|
|
7214
|
+
*/
|
|
7215
|
+
"application/json": {
|
|
7216
|
+
data?: unknown;
|
|
7217
|
+
meta?: {
|
|
7218
|
+
[key: string]: unknown;
|
|
7219
|
+
};
|
|
7220
|
+
};
|
|
7221
|
+
};
|
|
7222
|
+
};
|
|
7223
|
+
/** @description Validation error */
|
|
7224
|
+
400: {
|
|
7225
|
+
headers: {
|
|
7226
|
+
[name: string]: unknown;
|
|
7227
|
+
};
|
|
7228
|
+
content: {
|
|
7229
|
+
"application/json": components["schemas"]["Error"];
|
|
7230
|
+
};
|
|
7231
|
+
};
|
|
7232
|
+
/** @description Unauthorized */
|
|
7233
|
+
401: {
|
|
7234
|
+
headers: {
|
|
7235
|
+
[name: string]: unknown;
|
|
7236
|
+
};
|
|
7237
|
+
content: {
|
|
7238
|
+
"application/json": components["schemas"]["Error"];
|
|
7239
|
+
};
|
|
7240
|
+
};
|
|
7241
|
+
/** @description Forbidden */
|
|
7242
|
+
403: {
|
|
7243
|
+
headers: {
|
|
7244
|
+
[name: string]: unknown;
|
|
7245
|
+
};
|
|
7246
|
+
content: {
|
|
7247
|
+
"application/json": components["schemas"]["Error"];
|
|
7248
|
+
};
|
|
7249
|
+
};
|
|
7250
|
+
/** @description Not found */
|
|
7251
|
+
404: {
|
|
7252
|
+
headers: {
|
|
7253
|
+
[name: string]: unknown;
|
|
7254
|
+
};
|
|
7255
|
+
content: {
|
|
7256
|
+
"application/json": components["schemas"]["Error"];
|
|
7257
|
+
};
|
|
7258
|
+
};
|
|
7259
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
7260
|
+
409: {
|
|
7261
|
+
headers: {
|
|
7262
|
+
[name: string]: unknown;
|
|
7263
|
+
};
|
|
7264
|
+
content: {
|
|
7265
|
+
"application/json": components["schemas"]["Error"];
|
|
7266
|
+
};
|
|
7267
|
+
};
|
|
7268
|
+
/** @description Rate limited */
|
|
7269
|
+
429: {
|
|
7270
|
+
headers: {
|
|
7271
|
+
[name: string]: unknown;
|
|
7272
|
+
};
|
|
7273
|
+
content: {
|
|
7274
|
+
"application/json": components["schemas"]["Error"];
|
|
7275
|
+
};
|
|
7276
|
+
};
|
|
7277
|
+
};
|
|
7278
|
+
};
|
|
7279
|
+
delete?: never;
|
|
7280
|
+
options?: never;
|
|
7281
|
+
head?: never;
|
|
7282
|
+
patch?: never;
|
|
7283
|
+
trace?: never;
|
|
7284
|
+
};
|
|
7173
7285
|
"/pipelines/{id}": {
|
|
7174
7286
|
parameters: {
|
|
7175
7287
|
query?: never;
|
|
@@ -341602,14 +341714,50 @@ interface components {
|
|
|
341602
341714
|
}[];
|
|
341603
341715
|
};
|
|
341604
341716
|
status: {
|
|
341605
|
-
/** @description
|
|
341717
|
+
/** @description The DRAFT is done: the year is ready (`year_complete`) AND no line that counts waits on a person (`blocking_lines` is 0). Limits do not stop it: see `has_limits`. Two separate notions: YEAR READINESS (`year_*`, `incomplete`, `limits`: the same rule and the same sentences as the Paquete anual) and DRAFT LINES PENDING (`blocking_lines`, `state_counts`). */
|
|
341606
341718
|
complete: boolean;
|
|
341719
|
+
/** @description «Completo», «Completo, con límites» (complete, and `has_limits`), «Incompleto» or «Año en curso: incompleto». Render as is; an unknown value gets a neutral badge. */
|
|
341607
341720
|
label: string;
|
|
341721
|
+
/** @description YEAR READINESS: the year is over and no ACTIONABLE reason remains (`actionable_count` is 0). Same rule as the Paquete anual `complete`. Says nothing about the lines. */
|
|
341722
|
+
year_complete: boolean;
|
|
341723
|
+
/**
|
|
341724
|
+
* @description YEAR READINESS, the Paquete anual `status`: «Completo», «Completo, con límites», «Incompleto», «En curso: incompleto».
|
|
341725
|
+
* @enum {string}
|
|
341726
|
+
*/
|
|
341727
|
+
year_status: "complete" | "complete_with_limits" | "incomplete" | "in_progress";
|
|
341728
|
+
/** @description The Spanish label of `year_status`. */
|
|
341729
|
+
year_status_label: string;
|
|
341730
|
+
/** @description The year has limits: things Vitrina does not hold or cannot confirm, and no action in Vitrina clears. They never keep the year or the draft from being complete. */
|
|
341731
|
+
has_limits: boolean;
|
|
341732
|
+
/** @description How many `incomplete` items have `actionable: true`. */
|
|
341733
|
+
actionable_count: number;
|
|
341734
|
+
/** @description Every reason, actionable or not. Group by `actionable` to render «Por revisar» and «Lo que este paquete no trae». */
|
|
341608
341735
|
incomplete: {
|
|
341609
|
-
|
|
341736
|
+
/** @enum {string} */
|
|
341737
|
+
code: "month_not_closed" | "month_in_progress" | "month_not_started" | "sii_not_connected" | "sii_backfill_pending" | "sii_not_read" | "sii_not_read_previous_year" | "unclassified" | "incomplete_month" | "f29_missing" | "f29_not_filed" | "undated_collections" | "undated_payments" | "unexplained_outflows" | "rows_truncated";
|
|
341738
|
+
/** @description `YYYY-MM`, or null for an item about the whole year. */
|
|
341610
341739
|
month: string | null;
|
|
341740
|
+
/** @description Spanish, ready to show. */
|
|
341611
341741
|
message: string;
|
|
341742
|
+
/** @description A person can clear it in Vitrina. False: Vitrina does not hold the data or it only needs time; it is also summarised in `limits`. An undated-payments or undated-collections reason is split into an actionable item and a non-actionable one (documents marked paid before Vitrina have no date to give). */
|
|
341743
|
+
actionable: boolean;
|
|
341744
|
+
}[];
|
|
341745
|
+
/** @description The non-actionable reasons, ONE entry per kind for the year (not one per month). Nothing a person does in Vitrina clears them. */
|
|
341746
|
+
limits: {
|
|
341747
|
+
/** @enum {string} */
|
|
341748
|
+
kind: "sii_not_read_previous_year" | "sii_not_read" | "f29_not_readable" | "undated_collections_before_vitrina" | "undated_payments_before_vitrina" | "month_in_progress" | "month_not_started" | "rows_truncated";
|
|
341749
|
+
/** @description The reason codes collapsed into this limit. */
|
|
341750
|
+
codes: ("month_not_closed" | "month_in_progress" | "month_not_started" | "sii_not_connected" | "sii_backfill_pending" | "sii_not_read" | "sii_not_read_previous_year" | "unclassified" | "incomplete_month" | "f29_missing" | "f29_not_filed" | "undated_collections" | "undated_payments" | "unexplained_outflows" | "rows_truncated")[];
|
|
341751
|
+
/** @description Spanish, neutral register: what the package does not contain or cannot confirm. */
|
|
341752
|
+
message: string;
|
|
341753
|
+
/** @description Months for the month kinds, documents for the undated kinds, files for `rows_truncated`. */
|
|
341754
|
+
count: number;
|
|
341755
|
+
/** @description In base de caja, for the undated kinds; null otherwise. */
|
|
341756
|
+
amount_clp: number | null;
|
|
341757
|
+
/** @description `YYYY-MM` months it covers; empty for a year-wide limit. */
|
|
341758
|
+
months: string[];
|
|
341612
341759
|
}[];
|
|
341760
|
+
/** @description DRAFT LINES PENDING: lines that count for completeness and still wait on a person (a «needs» state, an incomplete formula, a figure only the SII holds). */
|
|
341613
341761
|
blocking_lines: number;
|
|
341614
341762
|
state_counts: {
|
|
341615
341763
|
[key: string]: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -7170,6 +7170,118 @@ interface paths {
|
|
|
7170
7170
|
patch?: never;
|
|
7171
7171
|
trace?: never;
|
|
7172
7172
|
};
|
|
7173
|
+
"/pipelines/{id}/qualifying-stage": {
|
|
7174
|
+
parameters: {
|
|
7175
|
+
query?: never;
|
|
7176
|
+
header?: never;
|
|
7177
|
+
path?: never;
|
|
7178
|
+
cookie?: never;
|
|
7179
|
+
};
|
|
7180
|
+
get?: never;
|
|
7181
|
+
put?: never;
|
|
7182
|
+
/**
|
|
7183
|
+
* Add the qualifying stage to a clinic board
|
|
7184
|
+
* @description «Agregar etapa calificadora» (ADR 0163, vitrina-app#8081): gives a clinic's selling board its Etapa calificadora in one step: an open stage «Calificado» right after the entry stage, marked `qualifies_lead`, driver `conversation`, Paso del embudo «Sin cita» on the clinic board, with its standard description. The board's transition whitelist is opened for it (from the entry stage, and from whatever reaches the entry stage); an EMPTY whitelist stays unrestricted. `outcome`: `created`; `marked_existing` (an unmarked open stage already named «Calificado» was marked instead of adding a second); `already_marked` (the board marks one already; nothing written). While the board marks it, the clinic's AI agent may move a lead there when its own instructions define filter questions and the patient's answers pass them; un-marking the stage (`PUT /stages/{id}` `{ "qualifies_lead": false }`) turns that off. 422 `STAGE_QUALIFIES_LEAD_NOT_ALLOWED` outside clinics or on a board that does not sell.
|
|
7185
|
+
*/
|
|
7186
|
+
post: {
|
|
7187
|
+
parameters: {
|
|
7188
|
+
query?: never;
|
|
7189
|
+
header?: {
|
|
7190
|
+
/** @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. */
|
|
7191
|
+
"Idempotency-Key"?: string;
|
|
7192
|
+
};
|
|
7193
|
+
path: {
|
|
7194
|
+
id: string;
|
|
7195
|
+
};
|
|
7196
|
+
cookie?: never;
|
|
7197
|
+
};
|
|
7198
|
+
requestBody?: never;
|
|
7199
|
+
responses: {
|
|
7200
|
+
/** @description Qualifying stage */
|
|
7201
|
+
200: {
|
|
7202
|
+
headers: {
|
|
7203
|
+
[name: string]: unknown;
|
|
7204
|
+
};
|
|
7205
|
+
content: {
|
|
7206
|
+
/**
|
|
7207
|
+
* @example {
|
|
7208
|
+
* "data": {
|
|
7209
|
+
* "pipeline_id": "44444444-0000-4000-8000-000000000001",
|
|
7210
|
+
* "stage_id": "9b2f6c1e-4d7a-4f3b-8c2e-1a5d7e9f0b34",
|
|
7211
|
+
* "outcome": "created"
|
|
7212
|
+
* }
|
|
7213
|
+
* }
|
|
7214
|
+
*/
|
|
7215
|
+
"application/json": {
|
|
7216
|
+
data?: unknown;
|
|
7217
|
+
meta?: {
|
|
7218
|
+
[key: string]: unknown;
|
|
7219
|
+
};
|
|
7220
|
+
};
|
|
7221
|
+
};
|
|
7222
|
+
};
|
|
7223
|
+
/** @description Validation error */
|
|
7224
|
+
400: {
|
|
7225
|
+
headers: {
|
|
7226
|
+
[name: string]: unknown;
|
|
7227
|
+
};
|
|
7228
|
+
content: {
|
|
7229
|
+
"application/json": components["schemas"]["Error"];
|
|
7230
|
+
};
|
|
7231
|
+
};
|
|
7232
|
+
/** @description Unauthorized */
|
|
7233
|
+
401: {
|
|
7234
|
+
headers: {
|
|
7235
|
+
[name: string]: unknown;
|
|
7236
|
+
};
|
|
7237
|
+
content: {
|
|
7238
|
+
"application/json": components["schemas"]["Error"];
|
|
7239
|
+
};
|
|
7240
|
+
};
|
|
7241
|
+
/** @description Forbidden */
|
|
7242
|
+
403: {
|
|
7243
|
+
headers: {
|
|
7244
|
+
[name: string]: unknown;
|
|
7245
|
+
};
|
|
7246
|
+
content: {
|
|
7247
|
+
"application/json": components["schemas"]["Error"];
|
|
7248
|
+
};
|
|
7249
|
+
};
|
|
7250
|
+
/** @description Not found */
|
|
7251
|
+
404: {
|
|
7252
|
+
headers: {
|
|
7253
|
+
[name: string]: unknown;
|
|
7254
|
+
};
|
|
7255
|
+
content: {
|
|
7256
|
+
"application/json": components["schemas"]["Error"];
|
|
7257
|
+
};
|
|
7258
|
+
};
|
|
7259
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
7260
|
+
409: {
|
|
7261
|
+
headers: {
|
|
7262
|
+
[name: string]: unknown;
|
|
7263
|
+
};
|
|
7264
|
+
content: {
|
|
7265
|
+
"application/json": components["schemas"]["Error"];
|
|
7266
|
+
};
|
|
7267
|
+
};
|
|
7268
|
+
/** @description Rate limited */
|
|
7269
|
+
429: {
|
|
7270
|
+
headers: {
|
|
7271
|
+
[name: string]: unknown;
|
|
7272
|
+
};
|
|
7273
|
+
content: {
|
|
7274
|
+
"application/json": components["schemas"]["Error"];
|
|
7275
|
+
};
|
|
7276
|
+
};
|
|
7277
|
+
};
|
|
7278
|
+
};
|
|
7279
|
+
delete?: never;
|
|
7280
|
+
options?: never;
|
|
7281
|
+
head?: never;
|
|
7282
|
+
patch?: never;
|
|
7283
|
+
trace?: never;
|
|
7284
|
+
};
|
|
7173
7285
|
"/pipelines/{id}": {
|
|
7174
7286
|
parameters: {
|
|
7175
7287
|
query?: never;
|
|
@@ -341602,14 +341714,50 @@ interface components {
|
|
|
341602
341714
|
}[];
|
|
341603
341715
|
};
|
|
341604
341716
|
status: {
|
|
341605
|
-
/** @description
|
|
341717
|
+
/** @description The DRAFT is done: the year is ready (`year_complete`) AND no line that counts waits on a person (`blocking_lines` is 0). Limits do not stop it: see `has_limits`. Two separate notions: YEAR READINESS (`year_*`, `incomplete`, `limits`: the same rule and the same sentences as the Paquete anual) and DRAFT LINES PENDING (`blocking_lines`, `state_counts`). */
|
|
341606
341718
|
complete: boolean;
|
|
341719
|
+
/** @description «Completo», «Completo, con límites» (complete, and `has_limits`), «Incompleto» or «Año en curso: incompleto». Render as is; an unknown value gets a neutral badge. */
|
|
341607
341720
|
label: string;
|
|
341721
|
+
/** @description YEAR READINESS: the year is over and no ACTIONABLE reason remains (`actionable_count` is 0). Same rule as the Paquete anual `complete`. Says nothing about the lines. */
|
|
341722
|
+
year_complete: boolean;
|
|
341723
|
+
/**
|
|
341724
|
+
* @description YEAR READINESS, the Paquete anual `status`: «Completo», «Completo, con límites», «Incompleto», «En curso: incompleto».
|
|
341725
|
+
* @enum {string}
|
|
341726
|
+
*/
|
|
341727
|
+
year_status: "complete" | "complete_with_limits" | "incomplete" | "in_progress";
|
|
341728
|
+
/** @description The Spanish label of `year_status`. */
|
|
341729
|
+
year_status_label: string;
|
|
341730
|
+
/** @description The year has limits: things Vitrina does not hold or cannot confirm, and no action in Vitrina clears. They never keep the year or the draft from being complete. */
|
|
341731
|
+
has_limits: boolean;
|
|
341732
|
+
/** @description How many `incomplete` items have `actionable: true`. */
|
|
341733
|
+
actionable_count: number;
|
|
341734
|
+
/** @description Every reason, actionable or not. Group by `actionable` to render «Por revisar» and «Lo que este paquete no trae». */
|
|
341608
341735
|
incomplete: {
|
|
341609
|
-
|
|
341736
|
+
/** @enum {string} */
|
|
341737
|
+
code: "month_not_closed" | "month_in_progress" | "month_not_started" | "sii_not_connected" | "sii_backfill_pending" | "sii_not_read" | "sii_not_read_previous_year" | "unclassified" | "incomplete_month" | "f29_missing" | "f29_not_filed" | "undated_collections" | "undated_payments" | "unexplained_outflows" | "rows_truncated";
|
|
341738
|
+
/** @description `YYYY-MM`, or null for an item about the whole year. */
|
|
341610
341739
|
month: string | null;
|
|
341740
|
+
/** @description Spanish, ready to show. */
|
|
341611
341741
|
message: string;
|
|
341742
|
+
/** @description A person can clear it in Vitrina. False: Vitrina does not hold the data or it only needs time; it is also summarised in `limits`. An undated-payments or undated-collections reason is split into an actionable item and a non-actionable one (documents marked paid before Vitrina have no date to give). */
|
|
341743
|
+
actionable: boolean;
|
|
341744
|
+
}[];
|
|
341745
|
+
/** @description The non-actionable reasons, ONE entry per kind for the year (not one per month). Nothing a person does in Vitrina clears them. */
|
|
341746
|
+
limits: {
|
|
341747
|
+
/** @enum {string} */
|
|
341748
|
+
kind: "sii_not_read_previous_year" | "sii_not_read" | "f29_not_readable" | "undated_collections_before_vitrina" | "undated_payments_before_vitrina" | "month_in_progress" | "month_not_started" | "rows_truncated";
|
|
341749
|
+
/** @description The reason codes collapsed into this limit. */
|
|
341750
|
+
codes: ("month_not_closed" | "month_in_progress" | "month_not_started" | "sii_not_connected" | "sii_backfill_pending" | "sii_not_read" | "sii_not_read_previous_year" | "unclassified" | "incomplete_month" | "f29_missing" | "f29_not_filed" | "undated_collections" | "undated_payments" | "unexplained_outflows" | "rows_truncated")[];
|
|
341751
|
+
/** @description Spanish, neutral register: what the package does not contain or cannot confirm. */
|
|
341752
|
+
message: string;
|
|
341753
|
+
/** @description Months for the month kinds, documents for the undated kinds, files for `rows_truncated`. */
|
|
341754
|
+
count: number;
|
|
341755
|
+
/** @description In base de caja, for the undated kinds; null otherwise. */
|
|
341756
|
+
amount_clp: number | null;
|
|
341757
|
+
/** @description `YYYY-MM` months it covers; empty for a year-wide limit. */
|
|
341758
|
+
months: string[];
|
|
341612
341759
|
}[];
|
|
341760
|
+
/** @description DRAFT LINES PENDING: lines that count for completeness and still wait on a person (a «needs» state, an incomplete formula, a figure only the SII holds). */
|
|
341613
341761
|
blocking_lines: number;
|
|
341614
341762
|
state_counts: {
|
|
341615
341763
|
[key: string]: number;
|
package/package.json
CHANGED