sgp-sdk 1.1.3 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +87 -0
- package/COMPATIBILITY.md +151 -0
- package/MIGRATION.md +283 -0
- package/README.md +424 -225
- package/dist/address.d.ts +46 -0
- package/dist/annotation-selection.d.ts +32 -0
- package/dist/budget.d.ts +29 -0
- package/dist/classify.d.ts +15 -0
- package/dist/client.d.ts +662 -155
- package/dist/config.d.ts +115 -0
- package/dist/constants.d.ts +72 -0
- package/dist/effect.d.ts +22 -0
- package/dist/executor.d.ts +9 -0
- package/dist/exposure.d.ts +21 -0
- package/dist/guards.d.ts +2 -0
- package/dist/hooks.d.ts +16 -0
- package/dist/ids.d.ts +19 -0
- package/dist/index.d.ts +45 -47
- package/dist/index.js +2954 -1223
- package/dist/operation-sensitivity.d.ts +496 -0
- package/dist/operation.d.ts +139 -0
- package/dist/operations/catalogs-list-billing-profiles.d.ts +16 -0
- package/dist/operations/catalogs-list-nas.d.ts +25 -0
- package/dist/operations/catalogs-list-pops.d.ts +14 -0
- package/dist/operations/contracts-list-status-reasons.d.ts +15 -0
- package/dist/operations/contracts-list.d.ts +52 -0
- package/dist/operations/contracts-update-status.d.ts +41 -0
- package/dist/operations/contracts-update.d.ts +39 -0
- package/dist/operations/coverage-check.d.ts +42 -0
- package/dist/operations/crm-contracts-create-by-cpf-cnpj.d.ts +97 -0
- package/dist/operations/crm-contracts-create.d.ts +221 -0
- package/dist/operations/crm-contracts-list.d.ts +50 -0
- package/dist/operations/crm-customers-create.d.ts +155 -0
- package/dist/operations/crm-customers-update-status.d.ts +41 -0
- package/dist/operations/customers-list.d.ts +98 -0
- package/dist/{endpoints/ura/lookup-customer.d.ts → operations/customers-search.d.ts} +56 -46
- package/dist/operations/documents-add.d.ts +29 -0
- package/dist/operations/documents-list.d.ts +31 -0
- package/dist/operations/experimental-annotations-list.d.ts +67 -0
- package/dist/operations/invoices-list.d.ts +142 -0
- package/dist/operations/occurrences-create.d.ts +116 -0
- package/dist/operations/occurrences-list-methods.d.ts +14 -0
- package/dist/operations/occurrences-list-types.d.ts +20 -0
- package/dist/{endpoints/ura/list-plans.d.ts → operations/plans-list.d.ts} +33 -23
- package/dist/operations/pre-registrations-create.d.ts +253 -0
- package/dist/operations/pre-registrations-list-due-days.d.ts +15 -0
- package/dist/operations/pre-registrations-list-plans.d.ts +24 -0
- package/dist/operations/pre-registrations-list-sellers.d.ts +16 -0
- package/dist/operations/services-add-tv.d.ts +47 -0
- package/dist/operations/services-change-plan.d.ts +40 -0
- package/dist/operations/services-remove-tv.d.ts +29 -0
- package/dist/operations/work-orders-list-reasons.d.ts +20 -0
- package/dist/operations/work-orders-list.d.ts +81 -0
- package/dist/path.d.ts +13 -0
- package/dist/raw-request.d.ts +26 -0
- package/dist/request.d.ts +28 -0
- package/dist/result.d.ts +111 -43
- package/dist/retry.d.ts +34 -0
- package/dist/sensitivity.d.ts +89 -4
- package/dist/tolerant.d.ts +21 -0
- package/dist/validation.d.ts +3 -0
- package/package.json +6 -3
- package/dist/endpoint.d.ts +0 -66
- package/dist/endpoints/crm/address.d.ts +0 -20
- package/dist/endpoints/crm/create-contract.d.ts +0 -109
- package/dist/endpoints/crm/create-customer.d.ts +0 -65
- package/dist/endpoints/crm/update-customer-status.d.ts +0 -43
- package/dist/endpoints/os/list-occurrence-reasons.d.ts +0 -24
- package/dist/endpoints/os/list-occurrence-types.d.ts +0 -25
- package/dist/endpoints/precadastro/list-due-days.d.ts +0 -19
- package/dist/endpoints/precadastro/list-sellers.d.ts +0 -21
- package/dist/endpoints/suporte/add-customer-document.d.ts +0 -24
- package/dist/endpoints/suporte/list-customer-documents.d.ts +0 -25
- package/dist/endpoints/ura/check-coverage.d.ts +0 -46
- package/dist/endpoints/ura/list-clients.d.ts +0 -58
- package/dist/endpoints/ura/list-contracts.d.ts +0 -45
- package/dist/endpoints/ura/list-invoices.d.ts +0 -107
- package/dist/endpoints/ura/list-nas.d.ts +0 -29
- package/dist/endpoints/ura/list-occurrence-methods.d.ts +0 -19
- package/dist/endpoints/ura/list-payment-carriers.d.ts +0 -20
- package/dist/endpoints/ura/list-pops.d.ts +0 -19
- package/dist/endpoints/ura/list-service-orders.d.ts +0 -64
- package/dist/endpoints/ura/open-ticket.d.ts +0 -81
- package/dist/errors.d.ts +0 -59
- package/dist/schema/parse.d.ts +0 -19
- package/dist/schema/paths.d.ts +0 -38
- package/dist/transport.d.ts +0 -65
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { DecodeOutcome } from "./operation.js";
|
|
3
|
+
import type { ResponseBody } from "./result.js";
|
|
4
|
+
/**
|
|
5
|
+
* The tolerant reader: validates a JSON body with `schema` and applies the fidelity policy.
|
|
6
|
+
*
|
|
7
|
+
* - A mismatch on one of the `invariants` (or anywhere the body cannot be read at all) is
|
|
8
|
+
* `{ ok: false }`: the whole response is outside the contract.
|
|
9
|
+
* - Any other mismatch is tolerated: the offending field leaves its typed position (the nearest
|
|
10
|
+
* enclosing object property when the issue sits on an array element), a warning with the precise
|
|
11
|
+
* location and type names (never values) is returned, and the evidence is not touched because
|
|
12
|
+
* this works on a copy.
|
|
13
|
+
* - An issue inside an array whose elements carry an invariant (an element that is not an object)
|
|
14
|
+
* is an invariant failure; the array is never dropped silently.
|
|
15
|
+
* - Unknown keys are kept by the schema (loose objects), and nothing is ever invented.
|
|
16
|
+
*
|
|
17
|
+
* Invariants are declared per operation as paths: `clientes[].id`, with `[]` for any index. List the
|
|
18
|
+
* containers that must be readable too (`clientes`, `paginacao`), since a container is dropped
|
|
19
|
+
* like any other field unless it is an invariant.
|
|
20
|
+
*/
|
|
21
|
+
export declare const tolerantDecoder: <S extends z.ZodType>(schema: S, invariants: readonly string[]) => (body: ResponseBody) => DecodeOutcome<z.output<S>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sgp-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"description": "Unofficial TypeScript client for the SGP (TSMX) ISP ERP HTTP API, with normalized errors and explicit write outcomes. Not affiliated with TSMX.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
15
|
+
"dist",
|
|
16
|
+
"MIGRATION.md",
|
|
17
|
+
"COMPATIBILITY.md",
|
|
18
|
+
"CHANGELOG.md"
|
|
16
19
|
],
|
|
17
20
|
"engines": {
|
|
18
21
|
"node": ">=22"
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
"test": "bun test",
|
|
24
27
|
"lint": "biome check .",
|
|
25
28
|
"typecheck": "tsc --noEmit",
|
|
26
|
-
"check:consumer-types": "bun run build && tsc -p tests/consumer-types/tsconfig.json"
|
|
29
|
+
"check:consumer-types": "bun run build && tsc -p tests/consumer-types/tsconfig.json && tsc -p tests/consumer-types/tsconfig.bundler.json"
|
|
27
30
|
},
|
|
28
31
|
"dependencies": {
|
|
29
32
|
"zod": "^4"
|
package/dist/endpoint.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { z } from "zod";
|
|
2
|
-
import type { SgpResult, SgpWriteResult } from "./result.js";
|
|
3
|
-
import { type ParamValue, type RequestSpec, type SgpClientConfig, type SgpFile } from "./transport.js";
|
|
4
|
-
/** Static description of one SGP route: how to call it, how to parse it and what is sensitive. */
|
|
5
|
-
export interface EndpointDefinition<S extends z.ZodType> {
|
|
6
|
-
method: "GET" | "POST";
|
|
7
|
-
/** Request path starting with `/`; also the `endpoint` of every error. */
|
|
8
|
-
path: string;
|
|
9
|
-
schema: S;
|
|
10
|
-
/** Normalized paths of the required, strict fields (see `parseResponse`). */
|
|
11
|
-
keyFields: readonly string[];
|
|
12
|
-
/** Normalized path of the response items that carry sensitive keys, e.g. `clientes[]`. */
|
|
13
|
-
itemPath: string;
|
|
14
|
-
/** Keys of an item holding secrets (passwords, MACs, links with embedded token). */
|
|
15
|
-
secretKeys: readonly string[];
|
|
16
|
-
/** Keys of an item holding personal data (CPF/CNPJ, phone, e-mail, address, name). */
|
|
17
|
-
personalKeys: readonly string[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Static description of one SGP write route. Like {@link EndpointDefinition}, but `schema` is the
|
|
21
|
-
* success body: a 2xx only counts as success when it validates (key fields present, right type).
|
|
22
|
-
*/
|
|
23
|
-
export interface WriteEndpointDefinition<S extends z.ZodType> {
|
|
24
|
-
kind: "write";
|
|
25
|
-
method: "POST" | "PUT";
|
|
26
|
-
/** Request path template, e.g. `/api/crm/cliente/{cliente_id}/contratos/`; also the `endpoint` of every error. */
|
|
27
|
-
path: string;
|
|
28
|
-
schema: S;
|
|
29
|
-
/** Normalized paths of the required, strict fields (see `parseResponse`). */
|
|
30
|
-
keyFields: readonly string[];
|
|
31
|
-
/** Normalized path of the response items that carry sensitive keys. */
|
|
32
|
-
itemPath: string;
|
|
33
|
-
/** Keys of an item holding secrets. */
|
|
34
|
-
secretKeys: readonly string[];
|
|
35
|
-
/** Keys of an item holding personal data. */
|
|
36
|
-
personalKeys: readonly string[];
|
|
37
|
-
}
|
|
38
|
-
/** Inputs of one write call: values for the path placeholders, the request params and any files. */
|
|
39
|
-
export interface WriteCall {
|
|
40
|
-
pathParams?: Record<string, string | number>;
|
|
41
|
-
params?: Record<string, ParamValue | undefined>;
|
|
42
|
-
files?: Record<string, SgpFile>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Sends the request described by `def` and parses the response with its schema.
|
|
46
|
-
*
|
|
47
|
-
* Never throws: transport and HTTP failures come back as `{ success: false, error }` and a body
|
|
48
|
-
* that does not match the schema as `SCHEMA_MISMATCH`.
|
|
49
|
-
*/
|
|
50
|
-
export declare const callEndpoint: <S extends z.ZodType>(config: SgpClientConfig, def: EndpointDefinition<S>, params?: RequestSpec["params"], pathParams?: RequestSpec["pathParams"]) => Promise<SgpResult<z.output<S>>>;
|
|
51
|
-
/**
|
|
52
|
-
* Sends the write described by `def` and tells whether SGP applied it.
|
|
53
|
-
*
|
|
54
|
-
* Never throws. Success is a 2xx whose body validates against `def.schema`. A failure carries an
|
|
55
|
-
* `outcome`:
|
|
56
|
-
* - `"not_applied"`: SGP answered 4xx and rejected the request, or the SDK rejected it locally before
|
|
57
|
-
* sending (invalid path params, `VALIDATION` with status 0);
|
|
58
|
-
* - `"unknown"`: no response (timeout, network), 5xx, 3xx (redirects are never followed), a 4xx
|
|
59
|
-
* whose body `errors` is an array (SGP's generic exception wrapper, except 401/403/404/405/422),
|
|
60
|
-
* or a 2xx that is not a valid success (empty or non-JSON body, key field missing). The 2xx case
|
|
61
|
-
* is a `VALIDATION` error with the real HTTP status and, for a JSON body, SGP's own text
|
|
62
|
-
* (`detail`/`msg`/`errors`/`error`) or else the failing paths.
|
|
63
|
-
*
|
|
64
|
-
* Never retried by the SDK. With `outcome: "unknown"`, check the state in SGP before repeating.
|
|
65
|
-
*/
|
|
66
|
-
export declare const callWriteEndpoint: <S extends z.ZodType>(config: SgpClientConfig, def: WriteEndpointDefinition<S>, call?: WriteCall) => Promise<SgpWriteResult<z.output<S>>>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Address as SGP takes it. Pass it once: the SDK serializes it both nested (`endereco`) and as
|
|
3
|
-
* loose fields (`logradouro`, `numero`, ...), which are the two formats the CRM routes read.
|
|
4
|
-
*/
|
|
5
|
-
export interface SgpAddress {
|
|
6
|
-
logradouro: string;
|
|
7
|
-
numero?: string | number;
|
|
8
|
-
complemento?: string;
|
|
9
|
-
bairro: string;
|
|
10
|
-
cidade: string;
|
|
11
|
-
cep: string;
|
|
12
|
-
uf: string;
|
|
13
|
-
pais?: string;
|
|
14
|
-
pontoreferencia?: string;
|
|
15
|
-
/** Map position, `"lat,lng"`. */
|
|
16
|
-
map_ll?: string;
|
|
17
|
-
condominio?: string | number;
|
|
18
|
-
}
|
|
19
|
-
/** The address as a plain record with the same keys and no `undefined` ones. */
|
|
20
|
-
export declare const flatAddress: (address: SgpAddress) => Record<string, string | number>;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
import type { ParamValue } from "../../transport.js";
|
|
4
|
-
import { type SgpAddress } from "./address.js";
|
|
5
|
-
/** SGP's billing methods, by the `forma_cobranca_codigo` it takes. */
|
|
6
|
-
export declare const formaCobrancaCodigo: {
|
|
7
|
-
readonly boleto: 1;
|
|
8
|
-
readonly debitoAutomatico: 2;
|
|
9
|
-
readonly carne: 3;
|
|
10
|
-
readonly cobrancaRecorrente: 4;
|
|
11
|
-
readonly pix: 6;
|
|
12
|
-
};
|
|
13
|
-
/** A valid `forma_cobranca_codigo` of `POST /api/crm/cliente/{cliente_id}/contratos/`. */
|
|
14
|
-
export type FormaCobrancaCodigo = (typeof formaCobrancaCodigo)[keyof typeof formaCobrancaCodigo];
|
|
15
|
-
/**
|
|
16
|
-
* SGP's equipment acquisition modes, by the `modoaquisicao` it takes: 0 Próprio and 1 Comodato.
|
|
17
|
-
* SGP rejects any other value (2 included), although its Postman collection lists 1 and 2.
|
|
18
|
-
*/
|
|
19
|
-
export declare const modoAquisicao: {
|
|
20
|
-
readonly proprio: 0;
|
|
21
|
-
readonly comodato: 1;
|
|
22
|
-
};
|
|
23
|
-
/** A valid `modoaquisicao` of `POST /api/crm/cliente/{cliente_id}/contratos/`. */
|
|
24
|
-
export type ModoAquisicao = (typeof modoAquisicao)[keyof typeof modoAquisicao];
|
|
25
|
-
/**
|
|
26
|
-
* Success body of `POST /api/crm/cliente/{cliente_id}/contratos/`: the new contract ID, SGP's
|
|
27
|
-
* message and the customer's name.
|
|
28
|
-
*/
|
|
29
|
-
export declare const createContractSchema: z.ZodObject<{
|
|
30
|
-
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
|
-
clientecontrato: z.ZodNumber;
|
|
32
|
-
cliente: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
/** Key fields of `crm/cliente/{cliente_id}/contratos/`: required and strict; a 2xx without them is not a success. */
|
|
35
|
-
export declare const createContractKeyFields: readonly ["clientecontrato"];
|
|
36
|
-
/** Normalized path of the created contract in the response (the root object). */
|
|
37
|
-
export declare const contractCreatedItemPath = "";
|
|
38
|
-
/** Keys of the response holding secrets (none in `crm/cliente/{cliente_id}/contratos/`). */
|
|
39
|
-
export declare const contractCreatedSecretKeys: readonly [];
|
|
40
|
-
/** Keys of the response holding personal data: `cliente` is the customer's name. */
|
|
41
|
-
export declare const contractCreatedPersonalKeys: readonly ["cliente"];
|
|
42
|
-
/** Parsed response of `POST /api/crm/cliente/{cliente_id}/contratos/`. */
|
|
43
|
-
export type CreateContractResponse = z.output<typeof createContractSchema>;
|
|
44
|
-
/**
|
|
45
|
-
* Params of `POST /api/crm/cliente/{cliente_id}/contratos/`; `cliente_id` goes in the path.
|
|
46
|
-
* `login`, `senha`, `central_login`, `central_senha`, the addresses and the network fields
|
|
47
|
-
* (`ip`, `mac`, `mac_dhcp`) are secret or personal data.
|
|
48
|
-
*/
|
|
49
|
-
export interface CreateContractParams {
|
|
50
|
-
pop_id: number;
|
|
51
|
-
plano_id: number;
|
|
52
|
-
/** Payer or financial responsible. */
|
|
53
|
-
portador_id: number;
|
|
54
|
-
forma_cobranca_codigo: FormaCobrancaCodigo;
|
|
55
|
-
/** Due day registered in SGP. */
|
|
56
|
-
vencimento_dia: number;
|
|
57
|
-
/** Sent nested and also as the loose fields (`logradouro`, `numero`, ...) SGP reads. */
|
|
58
|
-
endereco_instalacao: SgpAddress;
|
|
59
|
-
endereco_cobranca: SgpAddress;
|
|
60
|
-
/** PPPoE login and password: SGP requires them for an internet service. */
|
|
61
|
-
login?: string;
|
|
62
|
-
senha?: string;
|
|
63
|
-
modoaquisicao?: ModoAquisicao;
|
|
64
|
-
/** Name of the NAS. */
|
|
65
|
-
nas?: string;
|
|
66
|
-
/** Exempt percentage. */
|
|
67
|
-
isento?: number;
|
|
68
|
-
autocobranca?: boolean;
|
|
69
|
-
servicodesc?: string;
|
|
70
|
-
observacao?: string;
|
|
71
|
-
vendedor_id?: number;
|
|
72
|
-
/** 1 = percentage, 2 = fixed amount. */
|
|
73
|
-
comissao_tipo?: 1 | 2;
|
|
74
|
-
comissao?: number;
|
|
75
|
-
/** Contract group for printing. */
|
|
76
|
-
contrato_id?: number;
|
|
77
|
-
fidelidade_id?: number;
|
|
78
|
-
midia_id?: number;
|
|
79
|
-
central_login?: string;
|
|
80
|
-
central_senha?: string;
|
|
81
|
-
ip?: string;
|
|
82
|
-
ippool_id?: number;
|
|
83
|
-
mac_dhcp?: string;
|
|
84
|
-
mac?: string;
|
|
85
|
-
logins_simult?: number;
|
|
86
|
-
splitter_id?: number;
|
|
87
|
-
splitter_port?: number;
|
|
88
|
-
tipo_equipamento?: string;
|
|
89
|
-
usuarioalt_id?: number;
|
|
90
|
-
/** Opens the installation service order, without a date. */
|
|
91
|
-
os_instalacao?: boolean;
|
|
92
|
-
/** Text of the installation occurrence. */
|
|
93
|
-
conteudo?: string;
|
|
94
|
-
instalacao_quantidade_parcelas?: number;
|
|
95
|
-
instalacao_preco?: number;
|
|
96
|
-
instalacao_desconto?: number;
|
|
97
|
-
instalacao_entrada?: number;
|
|
98
|
-
instalacao_entrada_forma?: number;
|
|
99
|
-
instalacao_parcela_forma?: number;
|
|
100
|
-
instalacao_portador?: number;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Request body of the contract route: the params, with both addresses nested and the installation
|
|
104
|
-
* one also as loose fields beside them (SGP describes those as "installation and billing").
|
|
105
|
-
* `undefined` address keys are omitted in both formats.
|
|
106
|
-
*/
|
|
107
|
-
export declare const toContractBody: (params: CreateContractParams) => Record<string, ParamValue | undefined>;
|
|
108
|
-
/** Definition of `POST /api/crm/cliente/{cliente_id}/contratos/` (trailing slash required by the token whitelist). */
|
|
109
|
-
export declare const createContractDefinition: WriteEndpointDefinition<typeof createContractSchema>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
import type { ParamValue } from "../../transport.js";
|
|
4
|
-
import { type SgpAddress } from "./address.js";
|
|
5
|
-
/** Success body of `POST /api/crm/cliente/{F|J}`: the new CRM customer ID and SGP's message. */
|
|
6
|
-
export declare const createCustomerSchema: z.ZodObject<{
|
|
7
|
-
cliente_id: z.ZodNumber;
|
|
8
|
-
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
/** Key fields of `crm/cliente/{F|J}`: required and strict; a 2xx without them is not a success. */
|
|
11
|
-
export declare const createCustomerKeyFields: readonly ["cliente_id"];
|
|
12
|
-
/** Normalized path of the created customer in the response (the root object). */
|
|
13
|
-
export declare const customerCreatedItemPath = "";
|
|
14
|
-
/** Keys of the response holding secrets (none in `crm/cliente/{F|J}`). */
|
|
15
|
-
export declare const customerCreatedSecretKeys: readonly [];
|
|
16
|
-
/** Keys of the response holding personal data: SGP's message carries the name and CPF/CNPJ. */
|
|
17
|
-
export declare const customerCreatedPersonalKeys: readonly ["message"];
|
|
18
|
-
/** Parsed response of `POST /api/crm/cliente/F` and `POST /api/crm/cliente/J`. */
|
|
19
|
-
export type CreateCustomerResponse = z.output<typeof createCustomerSchema>;
|
|
20
|
-
/** Params of `POST /api/crm/cliente/F` (individual). Name, CPF and address are personal data. */
|
|
21
|
-
export interface CreateIndividualCustomerParams {
|
|
22
|
-
nome: string;
|
|
23
|
-
cpfcnpj: string;
|
|
24
|
-
endereco: SgpAddress;
|
|
25
|
-
email?: string;
|
|
26
|
-
celular?: string;
|
|
27
|
-
/** `"DD/MM/AAAA"`. */
|
|
28
|
-
datanasc?: string;
|
|
29
|
-
observacao?: string;
|
|
30
|
-
rg?: string;
|
|
31
|
-
rg_emissor?: string;
|
|
32
|
-
sexo?: "M" | "F";
|
|
33
|
-
/** C = married, S = single, V = widowed, D = divorced. */
|
|
34
|
-
estadocivil?: "C" | "S" | "V" | "D";
|
|
35
|
-
nomemae?: string;
|
|
36
|
-
nomepai?: string;
|
|
37
|
-
profissao?: string;
|
|
38
|
-
nacionalidade?: string;
|
|
39
|
-
naturalidade?: string;
|
|
40
|
-
}
|
|
41
|
-
/** Params of `POST /api/crm/cliente/J` (company). Name, CNPJ and address are personal data. */
|
|
42
|
-
export interface CreateCompanyCustomerParams {
|
|
43
|
-
nome: string;
|
|
44
|
-
cpfcnpj: string;
|
|
45
|
-
endereco: SgpAddress;
|
|
46
|
-
nomefantasia?: string;
|
|
47
|
-
respempresa?: string;
|
|
48
|
-
respcpf?: string;
|
|
49
|
-
insc_estadual?: string;
|
|
50
|
-
insc_municipal?: string;
|
|
51
|
-
email?: string;
|
|
52
|
-
celular?: string;
|
|
53
|
-
/** `"DD/MM/AAAA"`. */
|
|
54
|
-
datafundacao?: string;
|
|
55
|
-
observacao?: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Request body of the customer routes: the params, with the address nested (`endereco`) and also
|
|
59
|
-
* as loose fields beside them, as SGP reads both. `undefined` address keys are omitted in both.
|
|
60
|
-
*/
|
|
61
|
-
export declare const toCustomerBody: (params: CreateIndividualCustomerParams | CreateCompanyCustomerParams) => Record<string, ParamValue | undefined>;
|
|
62
|
-
/** Definition of `POST /api/crm/cliente/F` (individual customer). */
|
|
63
|
-
export declare const createIndividualCustomerDefinition: WriteEndpointDefinition<typeof createCustomerSchema>;
|
|
64
|
-
/** Definition of `POST /api/crm/cliente/J` (company customer). */
|
|
65
|
-
export declare const createCompanyCustomerDefinition: WriteEndpointDefinition<typeof createCustomerSchema>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** SGP's CRM statuses, by the `status_id` it takes. */
|
|
4
|
-
export declare const crmStatus: {
|
|
5
|
-
readonly emAnalise: 1;
|
|
6
|
-
readonly aprovado: 2;
|
|
7
|
-
readonly reprovado: 3;
|
|
8
|
-
readonly aguardandoContato: 4;
|
|
9
|
-
readonly tentandoContato: 5;
|
|
10
|
-
readonly contratoRealizadoNoSgp: 6;
|
|
11
|
-
readonly inviabilidadeTecnica: 7;
|
|
12
|
-
readonly contratoEmProspeccao: 8;
|
|
13
|
-
readonly reprovadoSpcSerasa: 9;
|
|
14
|
-
readonly analiseViabilidadeTecnica: 10;
|
|
15
|
-
};
|
|
16
|
-
/** A valid `status_id` of `POST /api/crm/cliente/{cliente_id}/status/`. */
|
|
17
|
-
export type CrmStatusId = (typeof crmStatus)[keyof typeof crmStatus];
|
|
18
|
-
/** Success body of `POST /api/crm/cliente/{cliente_id}/status/`: the customer and the status now set. */
|
|
19
|
-
export declare const updateCustomerStatusSchema: z.ZodObject<{
|
|
20
|
-
cliente_id: z.ZodNumber;
|
|
21
|
-
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
-
novo_status: z.ZodObject<{
|
|
23
|
-
codigo: z.ZodNumber;
|
|
24
|
-
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
/** Key fields of `crm/cliente/{cliente_id}/status/`: required and strict; a 2xx without them is not a success. */
|
|
28
|
-
export declare const updateCustomerStatusKeyFields: readonly ["cliente_id", "novo_status.codigo"];
|
|
29
|
-
/** Normalized path of the updated customer in the response (the root object). */
|
|
30
|
-
export declare const customerStatusItemPath = "";
|
|
31
|
-
/** Keys of the response holding secrets (none in `crm/cliente/{cliente_id}/status/`). */
|
|
32
|
-
export declare const customerStatusSecretKeys: readonly [];
|
|
33
|
-
/** Keys of the response holding personal data: SGP's message carries the customer's name. */
|
|
34
|
-
export declare const customerStatusPersonalKeys: readonly ["message"];
|
|
35
|
-
/** Parsed response of `POST /api/crm/cliente/{cliente_id}/status/`. */
|
|
36
|
-
export type UpdateCustomerStatusResponse = z.output<typeof updateCustomerStatusSchema>;
|
|
37
|
-
/** Params of `POST /api/crm/cliente/{cliente_id}/status/`; `cliente_id` goes in the path. */
|
|
38
|
-
export interface UpdateCustomerStatusParams {
|
|
39
|
-
status_id: CrmStatusId;
|
|
40
|
-
motivo?: string;
|
|
41
|
-
}
|
|
42
|
-
/** Definition of `POST /api/crm/cliente/{cliente_id}/status/` (trailing slash required by the token whitelist). */
|
|
43
|
-
export declare const updateCustomerStatusDefinition: WriteEndpointDefinition<typeof updateCustomerStatusSchema>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** Response of `GET /api/os/ocorrencia/motivo/list/`: a bare array with the occurrence reasons. */
|
|
4
|
-
export declare const listOccurrenceReasonsSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
codigo: z.ZodNumber;
|
|
7
|
-
descricao: z.ZodString;
|
|
8
|
-
ativo: z.ZodBoolean;
|
|
9
|
-
classificacoes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
10
|
-
classificacoes_obrigatorio: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
-
setores: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
12
|
-
}, z.core.$strip>>;
|
|
13
|
-
/** Key fields of `os/ocorrencia/motivo/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
14
|
-
export declare const listOccurrenceReasonsKeyFields: readonly ["[].id", "[].codigo", "[].descricao", "[].ativo"];
|
|
15
|
-
/** Normalized path of each reason in the `os/ocorrencia/motivo/list` response (the root array). */
|
|
16
|
-
export declare const occurrenceReasonItemPath = "[]";
|
|
17
|
-
/** Keys of an occurrence reason holding secrets (none in `os/ocorrencia/motivo/list`). */
|
|
18
|
-
export declare const occurrenceReasonSecretKeys: readonly [];
|
|
19
|
-
/** Keys of an occurrence reason holding personal data (none in `os/ocorrencia/motivo/list`). */
|
|
20
|
-
export declare const occurrenceReasonPersonalKeys: readonly [];
|
|
21
|
-
/** Parsed response of `GET /api/os/ocorrencia/motivo/list/`. */
|
|
22
|
-
export type ListOccurrenceReasonsResponse = z.output<typeof listOccurrenceReasonsSchema>;
|
|
23
|
-
/** Definition of `GET /api/os/ocorrencia/motivo/list/`. */
|
|
24
|
-
export declare const listOccurrenceReasonsDefinition: EndpointDefinition<typeof listOccurrenceReasonsSchema>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** Response of `GET /api/os/ocorrencia/tipo/list/`: a bare array with the occurrence types. */
|
|
4
|
-
export declare const listOccurrenceTypesSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
codigo: z.ZodNumber;
|
|
7
|
-
descricao: z.ZodString;
|
|
8
|
-
ativo: z.ZodBoolean;
|
|
9
|
-
classificacoes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
10
|
-
classificacoes_obrigatorio: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
-
setores: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
12
|
-
classificacoes_obrigatorio_encerramento: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
13
|
-
}, z.core.$strip>>;
|
|
14
|
-
/** Key fields of `os/ocorrencia/tipo/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
15
|
-
export declare const listOccurrenceTypesKeyFields: readonly ["[].id", "[].codigo", "[].descricao", "[].ativo"];
|
|
16
|
-
/** Normalized path of each type in the `os/ocorrencia/tipo/list` response (the root array). */
|
|
17
|
-
export declare const occurrenceTypeItemPath = "[]";
|
|
18
|
-
/** Keys of an occurrence type holding secrets (none in `os/ocorrencia/tipo/list`). */
|
|
19
|
-
export declare const occurrenceTypeSecretKeys: readonly [];
|
|
20
|
-
/** Keys of an occurrence type holding personal data (none in `os/ocorrencia/tipo/list`). */
|
|
21
|
-
export declare const occurrenceTypePersonalKeys: readonly [];
|
|
22
|
-
/** Parsed response of `GET /api/os/ocorrencia/tipo/list/`. */
|
|
23
|
-
export type ListOccurrenceTypesResponse = z.output<typeof listOccurrenceTypesSchema>;
|
|
24
|
-
/** Definition of `GET /api/os/ocorrencia/tipo/list/`. */
|
|
25
|
-
export declare const listOccurrenceTypesDefinition: EndpointDefinition<typeof listOccurrenceTypesSchema>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** Response of `POST /api/precadastro/vencimento/list`: a bare array with the due days. */
|
|
4
|
-
export declare const listDueDaysSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
dia: z.ZodNumber;
|
|
7
|
-
}, z.core.$strip>>;
|
|
8
|
-
/** Key fields of `precadastro/vencimento/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
9
|
-
export declare const listDueDaysKeyFields: readonly ["[].id", "[].dia"];
|
|
10
|
-
/** Normalized path of each due day in the `precadastro/vencimento/list` response (the root array). */
|
|
11
|
-
export declare const dueDayItemPath = "[]";
|
|
12
|
-
/** Keys of a due day holding secrets (none in `precadastro/vencimento/list`). */
|
|
13
|
-
export declare const dueDaySecretKeys: readonly [];
|
|
14
|
-
/** Keys of a due day holding personal data (none in `precadastro/vencimento/list`). */
|
|
15
|
-
export declare const dueDayPersonalKeys: readonly [];
|
|
16
|
-
/** Parsed response of `POST /api/precadastro/vencimento/list`. */
|
|
17
|
-
export type ListDueDaysResponse = z.output<typeof listDueDaysSchema>;
|
|
18
|
-
/** Definition of `POST /api/precadastro/vencimento/list` (no trailing slash). */
|
|
19
|
-
export declare const listDueDaysDefinition: EndpointDefinition<typeof listDueDaysSchema>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** Response of `POST /api/precadastro/vendedor/list`: a bare array with the sellers. */
|
|
4
|
-
export declare const listSellersSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
nome: z.ZodString;
|
|
7
|
-
cpf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
-
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
-
}, z.core.$strip>>;
|
|
10
|
-
/** Key fields of `precadastro/vendedor/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
11
|
-
export declare const listSellersKeyFields: readonly ["[].id", "[].nome"];
|
|
12
|
-
/** Normalized path of each seller in the `precadastro/vendedor/list` response (the root array). */
|
|
13
|
-
export declare const sellerItemPath = "[]";
|
|
14
|
-
/** Keys of a seller holding secrets (none in `precadastro/vendedor/list`). */
|
|
15
|
-
export declare const sellerSecretKeys: readonly [];
|
|
16
|
-
/** Keys of a seller holding personal data: sellers are employees, so name, CPF and e-mail are personal. */
|
|
17
|
-
export declare const sellerPersonalKeys: readonly ["nome", "cpf", "email"];
|
|
18
|
-
/** Parsed response of `POST /api/precadastro/vendedor/list`. */
|
|
19
|
-
export type ListSellersResponse = z.output<typeof listSellersSchema>;
|
|
20
|
-
/** Definition of `POST /api/precadastro/vendedor/list` (no trailing slash). */
|
|
21
|
-
export declare const listSellersDefinition: EndpointDefinition<typeof listSellersSchema>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/**
|
|
4
|
-
* Success body of `PUT /api/suporte/cliente/{cliente_id}/documento/add/`: none. SGP answers 200 with
|
|
5
|
-
* an empty body, which the transport yields as `null`; anything else is not a confirmed success.
|
|
6
|
-
*/
|
|
7
|
-
export declare const addCustomerDocumentSchema: z.ZodNull;
|
|
8
|
-
/** Key fields of `suporte/cliente/{cliente_id}/documento/add/`: none, the success body is empty. */
|
|
9
|
-
export declare const addCustomerDocumentKeyFields: readonly [];
|
|
10
|
-
/** Normalized path of the success body in the response (the root: it is empty). */
|
|
11
|
-
export declare const customerDocumentAddedItemPath = "";
|
|
12
|
-
/** Keys of the response holding secrets (none: the response is empty). */
|
|
13
|
-
export declare const customerDocumentAddedSecretKeys: readonly [];
|
|
14
|
-
/** Keys of the response holding personal data (none: the response is empty). */
|
|
15
|
-
export declare const customerDocumentAddedPersonalKeys: readonly [];
|
|
16
|
-
/** Parsed response of `PUT /api/suporte/cliente/{cliente_id}/documento/add/`: always `null`. */
|
|
17
|
-
export type AddCustomerDocumentResponse = z.output<typeof addCustomerDocumentSchema>;
|
|
18
|
-
/** Params of `PUT /api/suporte/cliente/{cliente_id}/documento/add/`; `cliente_id` goes in the path. */
|
|
19
|
-
export interface AddCustomerDocumentParams {
|
|
20
|
-
/** Description of the document; personal data when it names the customer. */
|
|
21
|
-
descricao?: string;
|
|
22
|
-
}
|
|
23
|
-
/** Definition of `PUT /api/suporte/cliente/{cliente_id}/documento/add/` (trailing slash required by the token whitelist). */
|
|
24
|
-
export declare const addCustomerDocumentDefinition: WriteEndpointDefinition<typeof addCustomerDocumentSchema>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** Response of `GET /api/suporte/cliente/{cliente_id}/documento/list/`: a bare array with the customer's documents. */
|
|
4
|
-
export declare const listCustomerDocumentsSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
cliente_id: z.ZodNumber;
|
|
7
|
-
arquivo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
-
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
-
usuario: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
-
}, z.core.$strip>>;
|
|
11
|
-
/** Key fields of `suporte/cliente/{cliente_id}/documento/list/`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
12
|
-
export declare const listCustomerDocumentsKeyFields: readonly ["[].id", "[].cliente_id"];
|
|
13
|
-
/** Normalized path of each document in the response (the root array). */
|
|
14
|
-
export declare const customerDocumentItemPath = "[]";
|
|
15
|
-
/** Keys of a document holding secrets (none in `suporte/cliente/{cliente_id}/documento/list/`). */
|
|
16
|
-
export declare const customerDocumentSecretKeys: readonly [];
|
|
17
|
-
/** Keys of a document holding personal data: the file (a customer's document), its description and the operator. */
|
|
18
|
-
export declare const customerDocumentPersonalKeys: readonly ["arquivo", "descricao", "usuario"];
|
|
19
|
-
/** Parsed response of `GET /api/suporte/cliente/{cliente_id}/documento/list/`. */
|
|
20
|
-
export type ListCustomerDocumentsResponse = z.output<typeof listCustomerDocumentsSchema>;
|
|
21
|
-
/**
|
|
22
|
-
* Definition of `GET /api/suporte/cliente/{cliente_id}/documento/list/` (trailing slash required by
|
|
23
|
-
* the token whitelist). Not in the `endpointRegistry`: the route needs a customer ID in its path.
|
|
24
|
-
*/
|
|
25
|
-
export declare const listCustomerDocumentsDefinition: EndpointDefinition<typeof listCustomerDocumentsSchema>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/**
|
|
4
|
-
* Response of `GET /api/ura/viabilidadeinstalacao`: an array whose object is keyed by the
|
|
5
|
-
* gateway's `descricao` (data-defined: `"SGPMaps"`, `"Geogrid"`), holding either the CTOs within
|
|
6
|
-
* the radius (`lat`, `lng`, `distancia` in meters, `nome`, and `id` on Geogrid) or the message
|
|
7
|
-
* `"Localização inviável"` when there are none.
|
|
8
|
-
*
|
|
9
|
-
* `lat`, `lng` and `distancia` are always numbers: Geogrid sends them as numeric strings and the
|
|
10
|
-
* schema converts them, so both gateways look the same to the consumer. `id` is always a string:
|
|
11
|
-
* a numeric id is converted.
|
|
12
|
-
*
|
|
13
|
-
* A gateway entry that is neither CTOs nor a message (for example a CTO with a non-numeric `lat`)
|
|
14
|
-
* is a malformed answer: the result is `SCHEMA_MISMATCH`, never a success without that entry.
|
|
15
|
-
*/
|
|
16
|
-
export declare const checkCoverageSchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
17
|
-
lat: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
|
|
18
|
-
lng: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
|
|
19
|
-
distancia: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
|
|
20
|
-
id: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodNumber, z.ZodTransform<string, number>>]>>>;
|
|
21
|
-
nome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
-
}, z.core.$strip>>, z.ZodString]>>>;
|
|
23
|
-
/**
|
|
24
|
-
* Key fields of `ura/viabilidadeinstalacao`: every gateway entry (`*` is its data-defined name),
|
|
25
|
-
* so a malformed gateway answer is `SCHEMA_MISMATCH`.
|
|
26
|
-
*/
|
|
27
|
-
export declare const checkCoverageKeyFields: readonly ["[].*"];
|
|
28
|
-
/** Normalized path of each gateway answer in the `ura/viabilidadeinstalacao` response (the root array). */
|
|
29
|
-
export declare const coverageItemPath = "[]";
|
|
30
|
-
/** Keys of a gateway answer holding secrets (none in `ura/viabilidadeinstalacao`). */
|
|
31
|
-
export declare const coverageSecretKeys: readonly [];
|
|
32
|
-
/** Keys of a gateway answer holding personal data (none in `ura/viabilidadeinstalacao`). */
|
|
33
|
-
export declare const coveragePersonalKeys: readonly [];
|
|
34
|
-
/** Query parameters of `GET /api/ura/viabilidadeinstalacao` (besides credentials); all required. */
|
|
35
|
-
export interface CheckCoverageParams {
|
|
36
|
-
/** ID of the map gateway, from `/api/ura/listgatewaymapa`. */
|
|
37
|
-
gateway: number;
|
|
38
|
-
/** Search radius in meters. */
|
|
39
|
-
raio: number;
|
|
40
|
-
/** Coordinate to check, `"lat,lng"`, e.g. `"-23.55,-46.63"`. */
|
|
41
|
-
coordenada: string;
|
|
42
|
-
}
|
|
43
|
-
/** Parsed response of `GET /api/ura/viabilidadeinstalacao`. */
|
|
44
|
-
export type CheckCoverageResponse = z.output<typeof checkCoverageSchema>;
|
|
45
|
-
/** Definition of `GET /api/ura/viabilidadeinstalacao`. */
|
|
46
|
-
export declare const checkCoverageDefinition: EndpointDefinition<typeof checkCoverageSchema>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
-
/** Response of `POST /api/ura/clientes/`: one page of clients with their address and contacts. */
|
|
4
|
-
export declare const listClientsSchema: z.ZodObject<{
|
|
5
|
-
paginacao: z.ZodObject<{
|
|
6
|
-
offset: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
-
limit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
-
parcial: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
9
|
-
total: z.ZodNumber;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
clientes: z.ZodArray<z.ZodObject<{
|
|
12
|
-
id: z.ZodNumber;
|
|
13
|
-
nome: z.ZodString;
|
|
14
|
-
tipo: z.ZodString;
|
|
15
|
-
cpfcnpj: z.ZodString;
|
|
16
|
-
sexo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
17
|
-
dataCadastro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
18
|
-
endereco: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
19
|
-
logradouro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
-
numero: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
-
bairro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
-
cidade: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
|
-
uf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
24
|
-
cep: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
25
|
-
complemento: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
26
|
-
latitude: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
27
|
-
longitude: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
28
|
-
}, z.core.$strip>>>;
|
|
29
|
-
contratos: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
30
|
-
titulos: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
31
|
-
contatos: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
32
|
-
telefones: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
33
|
-
celulares: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
34
|
-
emails: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
35
|
-
outros: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
36
|
-
}, z.core.$strip>>>;
|
|
37
|
-
}, z.core.$strip>>;
|
|
38
|
-
}, z.core.$strip>;
|
|
39
|
-
/** Key fields of `ura/clientes`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
40
|
-
export declare const listClientsKeyFields: readonly ["paginacao.total", "clientes", "clientes[].id", "clientes[].nome", "clientes[].cpfcnpj", "clientes[].tipo"];
|
|
41
|
-
/** Normalized path of each client item in the `ura/clientes` response. */
|
|
42
|
-
export declare const clientItemPath = "clientes[]";
|
|
43
|
-
/** Keys of a client item holding secrets (none in `ura/clientes`). */
|
|
44
|
-
export declare const clientSecretKeys: readonly [];
|
|
45
|
-
/** Keys of a client item holding personal data. */
|
|
46
|
-
export declare const clientPersonalKeys: readonly ["nome", "cpfcnpj", "sexo", "endereco", "contatos"];
|
|
47
|
-
/** Body parameters of `POST /api/ura/clientes/` (besides credentials); all optional filters and paging. */
|
|
48
|
-
export interface ListClientsParams {
|
|
49
|
-
offset?: number;
|
|
50
|
-
limit?: number;
|
|
51
|
-
cliente_id?: number;
|
|
52
|
-
cpfcnpj?: string;
|
|
53
|
-
cliente_nome?: string;
|
|
54
|
-
}
|
|
55
|
-
/** Parsed response of `POST /api/ura/clientes/`. */
|
|
56
|
-
export type ListClientsResponse = z.output<typeof listClientsSchema>;
|
|
57
|
-
/** Definition of `POST /api/ura/clientes/`. */
|
|
58
|
-
export declare const listClientsDefinition: EndpointDefinition<typeof listClientsSchema>;
|