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,496 @@
|
|
|
1
|
+
import type { OperationSensitivity } from "./sensitivity.js";
|
|
2
|
+
/** INTERNAL. Every operation the client ships; the one list `getSensitivity` reads. */
|
|
3
|
+
export declare const shippedOperations: readonly [import("./operation.js").OperationDefinition<{
|
|
4
|
+
[x: string]: unknown;
|
|
5
|
+
paginacao: {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
offset?: number | null | undefined;
|
|
8
|
+
limit?: number | null | undefined;
|
|
9
|
+
parcial?: number | null | undefined;
|
|
10
|
+
total: number;
|
|
11
|
+
};
|
|
12
|
+
clientes: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
id: number & import("zod").$brand<"CustomerId">;
|
|
15
|
+
nome: string;
|
|
16
|
+
tipo: string;
|
|
17
|
+
cpfcnpj: string;
|
|
18
|
+
sexo?: string | null | undefined;
|
|
19
|
+
dataCadastro?: string | null | undefined;
|
|
20
|
+
endereco?: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
logradouro?: string | null | undefined;
|
|
23
|
+
numero?: string | number | null | undefined;
|
|
24
|
+
bairro?: string | null | undefined;
|
|
25
|
+
cidade?: string | null | undefined;
|
|
26
|
+
uf?: string | null | undefined;
|
|
27
|
+
cep?: string | null | undefined;
|
|
28
|
+
complemento?: string | null | undefined;
|
|
29
|
+
latitude?: string | null | undefined;
|
|
30
|
+
longitude?: string | null | undefined;
|
|
31
|
+
} | null | undefined;
|
|
32
|
+
contratos?: {
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
id: number;
|
|
35
|
+
status?: string | null | undefined;
|
|
36
|
+
endereco?: {
|
|
37
|
+
[x: string]: unknown;
|
|
38
|
+
logradouro?: string | null | undefined;
|
|
39
|
+
numero?: string | number | null | undefined;
|
|
40
|
+
bairro?: string | null | undefined;
|
|
41
|
+
cidade?: string | null | undefined;
|
|
42
|
+
uf?: string | null | undefined;
|
|
43
|
+
cep?: string | null | undefined;
|
|
44
|
+
complemento?: string | null | undefined;
|
|
45
|
+
latitude?: string | null | undefined;
|
|
46
|
+
longitude?: string | null | undefined;
|
|
47
|
+
} | null | undefined;
|
|
48
|
+
servicos?: {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
id: number;
|
|
51
|
+
tipo?: string | null | undefined;
|
|
52
|
+
plano?: {
|
|
53
|
+
[x: string]: unknown;
|
|
54
|
+
id: number & import("zod").$brand<"PlanId">;
|
|
55
|
+
descricao?: string | null | undefined;
|
|
56
|
+
} | null | undefined;
|
|
57
|
+
status?: string | null | undefined;
|
|
58
|
+
endereco?: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
logradouro?: string | null | undefined;
|
|
61
|
+
numero?: string | number | null | undefined;
|
|
62
|
+
bairro?: string | null | undefined;
|
|
63
|
+
cidade?: string | null | undefined;
|
|
64
|
+
uf?: string | null | undefined;
|
|
65
|
+
cep?: string | null | undefined;
|
|
66
|
+
complemento?: string | null | undefined;
|
|
67
|
+
latitude?: string | null | undefined;
|
|
68
|
+
longitude?: string | null | undefined;
|
|
69
|
+
} | null | undefined;
|
|
70
|
+
}[] | null | undefined;
|
|
71
|
+
}[] | null | undefined;
|
|
72
|
+
titulos?: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
}[] | null | undefined;
|
|
75
|
+
contatos?: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
telefones?: string[] | null | undefined;
|
|
78
|
+
celulares?: string[] | null | undefined;
|
|
79
|
+
emails?: string[] | null | undefined;
|
|
80
|
+
outros?: unknown[] | null | undefined;
|
|
81
|
+
} | null | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
}, "customers.list">, import("./operation.js").OperationDefinition<{
|
|
84
|
+
[x: string]: unknown;
|
|
85
|
+
msg?: string | null | undefined;
|
|
86
|
+
contratos: {
|
|
87
|
+
[x: string]: unknown;
|
|
88
|
+
contratoId: number;
|
|
89
|
+
clienteId: number & import("zod").$brand<"CustomerId">;
|
|
90
|
+
contratoStatus?: number | null | undefined;
|
|
91
|
+
contratoStatusDisplay?: string | null | undefined;
|
|
92
|
+
contratoValorAberto?: number | null | undefined;
|
|
93
|
+
contratoTitulosAReceber?: number | null | undefined;
|
|
94
|
+
cobVencimento?: number | null | undefined;
|
|
95
|
+
contratoStatusModo?: number | null | undefined;
|
|
96
|
+
motivo_status?: string | null | undefined;
|
|
97
|
+
dataCadastro?: string | null | undefined;
|
|
98
|
+
dataAlteracao?: string | null | undefined;
|
|
99
|
+
popId?: number | null | undefined;
|
|
100
|
+
popNome?: string | null | undefined;
|
|
101
|
+
cobPermuta?: boolean | null | undefined;
|
|
102
|
+
cobIsento?: number | null | undefined;
|
|
103
|
+
promessasPagamentoMes?: number | null | undefined;
|
|
104
|
+
link_quitacao?: string | null | undefined;
|
|
105
|
+
planointernet?: string | null | undefined;
|
|
106
|
+
fidelidade?: {
|
|
107
|
+
[x: string]: unknown;
|
|
108
|
+
data_inicio?: string | null | undefined;
|
|
109
|
+
descricao?: string | null | undefined;
|
|
110
|
+
data_fim?: string | null | undefined;
|
|
111
|
+
} | null | undefined;
|
|
112
|
+
contrato_unificado_principal?: unknown;
|
|
113
|
+
contrato_unificado_filhos?: unknown;
|
|
114
|
+
tags?: {
|
|
115
|
+
[x: string]: unknown;
|
|
116
|
+
color?: string | null | undefined;
|
|
117
|
+
font?: string | null | undefined;
|
|
118
|
+
tag?: string | null | undefined;
|
|
119
|
+
id?: number | null | undefined;
|
|
120
|
+
categoria_id?: unknown;
|
|
121
|
+
}[] | null | undefined;
|
|
122
|
+
anotacoes?: unknown[] | null | undefined;
|
|
123
|
+
contratoCentralLogin?: string | null | undefined;
|
|
124
|
+
contratoCentralSenha?: string | null | undefined;
|
|
125
|
+
servico_login?: string | null | undefined;
|
|
126
|
+
servico_senha?: string | null | undefined;
|
|
127
|
+
servico_plano?: string | null | undefined;
|
|
128
|
+
servico_grupo?: string | null | undefined;
|
|
129
|
+
servico_tipo_conexao?: string | null | undefined;
|
|
130
|
+
servico_vlan?: string | null | undefined;
|
|
131
|
+
servico_mac?: string | null | undefined;
|
|
132
|
+
servico_mac2?: string | null | undefined;
|
|
133
|
+
servico_wifi_ssid?: string | null | undefined;
|
|
134
|
+
servico_wifi_ssid_5?: string | null | undefined;
|
|
135
|
+
servico_wifi_password?: string | null | undefined;
|
|
136
|
+
servico_wifi_password_5?: string | null | undefined;
|
|
137
|
+
servico_wifi_channel?: string | null | undefined;
|
|
138
|
+
servico_wifi_channel_5?: string | null | undefined;
|
|
139
|
+
razaoSocial?: string | null | undefined;
|
|
140
|
+
cpfCnpj?: string | null | undefined;
|
|
141
|
+
dataNascimento?: string | null | undefined;
|
|
142
|
+
telefones?: {
|
|
143
|
+
[x: string]: unknown;
|
|
144
|
+
inscricoes?: string[] | null | undefined;
|
|
145
|
+
tipoContato?: string | null | undefined;
|
|
146
|
+
contato?: string | null | undefined;
|
|
147
|
+
}[] | null | undefined;
|
|
148
|
+
telefones_cargos?: unknown[] | null | undefined;
|
|
149
|
+
emails?: {
|
|
150
|
+
[x: string]: unknown;
|
|
151
|
+
inscricoes?: string[] | null | undefined;
|
|
152
|
+
tipoContato?: string | null | undefined;
|
|
153
|
+
contato?: string | null | undefined;
|
|
154
|
+
}[] | null | undefined;
|
|
155
|
+
outros?: unknown[] | null | undefined;
|
|
156
|
+
endereco_logradouro?: string | null | undefined;
|
|
157
|
+
endereco_numero?: string | number | null | undefined;
|
|
158
|
+
endereco_complemento?: string | null | undefined;
|
|
159
|
+
endereco_bairro?: string | null | undefined;
|
|
160
|
+
endereco_cidade?: string | null | undefined;
|
|
161
|
+
endereco_uf?: string | null | undefined;
|
|
162
|
+
endereco_cep?: string | null | undefined;
|
|
163
|
+
endereco_pontoreferencia?: unknown;
|
|
164
|
+
endereco_ll?: string | null | undefined;
|
|
165
|
+
}[];
|
|
166
|
+
}, "customers.search">, import("./operation.js").OperationDefinition<{
|
|
167
|
+
[x: string]: unknown;
|
|
168
|
+
message: string;
|
|
169
|
+
}, "preRegistrations.create">, import("./operation.js").OperationDefinition<{
|
|
170
|
+
[x: string]: unknown;
|
|
171
|
+
resposta: {
|
|
172
|
+
[x: string]: unknown;
|
|
173
|
+
mensagem?: string | null | undefined;
|
|
174
|
+
contrato: number;
|
|
175
|
+
contrato_status: string;
|
|
176
|
+
};
|
|
177
|
+
}, "contracts.updateStatus">, import("./operation.js").OperationDefinition<{
|
|
178
|
+
[x: string]: unknown;
|
|
179
|
+
resposta: {
|
|
180
|
+
[x: string]: unknown;
|
|
181
|
+
mensagem?: string | null | undefined;
|
|
182
|
+
contrato: number;
|
|
183
|
+
alterados: string[];
|
|
184
|
+
};
|
|
185
|
+
}, "contracts.update">, import("./operation.js").OperationDefinition<{
|
|
186
|
+
[x: string]: unknown;
|
|
187
|
+
id_contrato: number;
|
|
188
|
+
id_cliente: number & import("zod").$brand<"CustomerId">;
|
|
189
|
+
status?: string | null | undefined;
|
|
190
|
+
pop_id?: number | null | undefined;
|
|
191
|
+
nome?: string | null | undefined;
|
|
192
|
+
cpfcnpj?: string | null | undefined;
|
|
193
|
+
email?: string | null | undefined;
|
|
194
|
+
telefone?: string | null | undefined;
|
|
195
|
+
data_status?: string | null | undefined;
|
|
196
|
+
data_cadastro?: string | null | undefined;
|
|
197
|
+
motivo_status?: string | null | undefined;
|
|
198
|
+
}[], "contracts.list">, import("./operation.js").OperationDefinition<{
|
|
199
|
+
[x: string]: unknown;
|
|
200
|
+
paginacao: {
|
|
201
|
+
[x: string]: unknown;
|
|
202
|
+
offset?: number | null | undefined;
|
|
203
|
+
limit?: number | null | undefined;
|
|
204
|
+
parcial?: number | null | undefined;
|
|
205
|
+
total: number;
|
|
206
|
+
};
|
|
207
|
+
titulos: {
|
|
208
|
+
[x: string]: unknown;
|
|
209
|
+
id: number;
|
|
210
|
+
status?: string | null | undefined;
|
|
211
|
+
valor?: number | null | undefined;
|
|
212
|
+
dataVencimento?: string | null | undefined;
|
|
213
|
+
clienteNome?: string | null | undefined;
|
|
214
|
+
clienteCpfcnpj?: string | null | undefined;
|
|
215
|
+
clienteContrato?: number | null | undefined;
|
|
216
|
+
portador?: string | null | undefined;
|
|
217
|
+
numeroDocumento?: string | number | null | undefined;
|
|
218
|
+
nossoNumero?: string | null | undefined;
|
|
219
|
+
link?: string | null | undefined;
|
|
220
|
+
link_cobranca?: string | null | undefined;
|
|
221
|
+
valorDesconto?: number | null | undefined;
|
|
222
|
+
valorCorrigido?: number | null | undefined;
|
|
223
|
+
valorPago?: number | null | undefined;
|
|
224
|
+
valorPagoParcial?: number | null | undefined;
|
|
225
|
+
codigoBarras?: string | null | undefined;
|
|
226
|
+
linhaDigitavel?: string | null | undefined;
|
|
227
|
+
codigoPix?: string | null | undefined;
|
|
228
|
+
dataEmissao?: string | null | undefined;
|
|
229
|
+
dataPagamento?: string | null | undefined;
|
|
230
|
+
dataCancelamento?: string | null | undefined;
|
|
231
|
+
demonstrativo?: string | null | undefined;
|
|
232
|
+
acordoPagamento?: {
|
|
233
|
+
[x: string]: unknown;
|
|
234
|
+
acordados?: unknown[] | null | undefined;
|
|
235
|
+
cobrados?: unknown[] | null | undefined;
|
|
236
|
+
} | null | undefined;
|
|
237
|
+
formaPagamento?: string | null | undefined;
|
|
238
|
+
usuario_baixa?: string | null | undefined;
|
|
239
|
+
}[];
|
|
240
|
+
}, "invoices.list">, import("./operation.js").OperationDefinition<{
|
|
241
|
+
[x: string]: unknown;
|
|
242
|
+
planos: {
|
|
243
|
+
[x: string]: unknown;
|
|
244
|
+
id: number & import("zod").$brand<"PlanId">;
|
|
245
|
+
descricao?: string | null | undefined;
|
|
246
|
+
preco?: number | null | undefined;
|
|
247
|
+
ativo?: boolean | null | undefined;
|
|
248
|
+
grupo?: string | null | undefined;
|
|
249
|
+
tipo?: string | null | undefined;
|
|
250
|
+
pos_pago?: boolean | null | undefined;
|
|
251
|
+
desconto?: number | null | undefined;
|
|
252
|
+
desconto_venc?: number | null | undefined;
|
|
253
|
+
desconto_venc_modo?: string | null | undefined;
|
|
254
|
+
valor_desconto_temporario?: number | null | undefined;
|
|
255
|
+
desconto_temporario_modo?: string | null | undefined;
|
|
256
|
+
desconto_temporario_quantidade?: number | null | undefined;
|
|
257
|
+
descricao_desconto_temporario?: string | null | undefined;
|
|
258
|
+
desconto_temporario_proporcional?: boolean | null | undefined;
|
|
259
|
+
observacao?: string | null | undefined;
|
|
260
|
+
instalacao_qtd_parcelas?: number | null | undefined;
|
|
261
|
+
instalacao_valor?: number | null | undefined;
|
|
262
|
+
instalacao_desconto_max?: number | null | undefined;
|
|
263
|
+
instalacao_desconto_min?: number | null | undefined;
|
|
264
|
+
disponivel_pre_cadastro?: boolean | null | undefined;
|
|
265
|
+
disponivel_pre_cadastro_publico?: boolean | null | undefined;
|
|
266
|
+
data_validade?: string | null | undefined;
|
|
267
|
+
pops?: {
|
|
268
|
+
[x: string]: unknown;
|
|
269
|
+
id?: number | null | undefined;
|
|
270
|
+
uf?: string | null | undefined;
|
|
271
|
+
pop?: string | null | undefined;
|
|
272
|
+
}[] | null | undefined;
|
|
273
|
+
auto_bloqueio?: boolean | null | undefined;
|
|
274
|
+
dias_bloqueio_pos_venc?: number | null | undefined;
|
|
275
|
+
dias_bloqueio_aviso?: number | null | undefined;
|
|
276
|
+
dias_reducao_velocidade?: number | null | undefined;
|
|
277
|
+
download?: number | null | undefined;
|
|
278
|
+
upload?: number | null | undefined;
|
|
279
|
+
trafego_mensal?: number | null | undefined;
|
|
280
|
+
contabilizacao_trafego_mensal?: string | null | undefined;
|
|
281
|
+
trafego_excedente_acao?: string | null | undefined;
|
|
282
|
+
valor_trafego_excedido?: number | null | undefined;
|
|
283
|
+
duplicacao_noturna?: boolean | null | undefined;
|
|
284
|
+
inicio_duplicacao_noturna?: string | null | undefined;
|
|
285
|
+
fim_duplicacao_noturna?: string | null | undefined;
|
|
286
|
+
modo_velocidade_reduzida?: string | null | undefined;
|
|
287
|
+
download_red_financeiro?: number | null | undefined;
|
|
288
|
+
upload_red_financeiro?: number | null | undefined;
|
|
289
|
+
modo_velocidade_red_franquia?: string | null | undefined;
|
|
290
|
+
download_red_franquia?: number | null | undefined;
|
|
291
|
+
upload_red_franquia?: number | null | undefined;
|
|
292
|
+
combo?: unknown[] | null | undefined;
|
|
293
|
+
qtd_servicos?: number | null | undefined;
|
|
294
|
+
}[];
|
|
295
|
+
total_planos?: number | null | undefined;
|
|
296
|
+
total_qtd_servicos?: number | null | undefined;
|
|
297
|
+
}, "plans.list">, import("./operation.js").OperationDefinition<{
|
|
298
|
+
[x: string]: unknown;
|
|
299
|
+
paginacao: {
|
|
300
|
+
[x: string]: unknown;
|
|
301
|
+
offset?: number | null | undefined;
|
|
302
|
+
limit?: number | null | undefined;
|
|
303
|
+
parcial?: number | null | undefined;
|
|
304
|
+
total: number;
|
|
305
|
+
};
|
|
306
|
+
ordens_servicos: {
|
|
307
|
+
[x: string]: unknown;
|
|
308
|
+
id: number;
|
|
309
|
+
contrato?: number | null | undefined;
|
|
310
|
+
status_id?: number | null | undefined;
|
|
311
|
+
status?: string | null | undefined;
|
|
312
|
+
tipo_id?: number | null | undefined;
|
|
313
|
+
data_cadastro?: string | null | undefined;
|
|
314
|
+
cliente?: string | null | undefined;
|
|
315
|
+
contrato_status?: string | null | undefined;
|
|
316
|
+
contrato_status_id?: number | null | undefined;
|
|
317
|
+
ocorrencia?: string | null | undefined;
|
|
318
|
+
hora_cadastro?: string | null | undefined;
|
|
319
|
+
data_agendamento?: string | null | undefined;
|
|
320
|
+
hora_agendamento?: string | null | undefined;
|
|
321
|
+
data_finalizacao?: string | null | undefined;
|
|
322
|
+
hora_finalizacao?: string | null | undefined;
|
|
323
|
+
tipo?: string | null | undefined;
|
|
324
|
+
motivo?: string | null | undefined;
|
|
325
|
+
pop?: string | null | undefined;
|
|
326
|
+
conteudo?: string | null | undefined;
|
|
327
|
+
responsavel?: string | null | undefined;
|
|
328
|
+
tecnicos_auxiliares?: unknown[] | null | undefined;
|
|
329
|
+
usuario?: string | null | undefined;
|
|
330
|
+
usuario_finalizacao?: string | null | undefined;
|
|
331
|
+
classificacoes?: unknown[] | null | undefined;
|
|
332
|
+
}[];
|
|
333
|
+
}, "workOrders.list">, import("./operation.js").OperationDefinition<{
|
|
334
|
+
[x: string]: unknown;
|
|
335
|
+
msg: string;
|
|
336
|
+
}, "services.changePlan">, import("./operation.js").OperationDefinition<{
|
|
337
|
+
[x: string]: unknown;
|
|
338
|
+
msg: string;
|
|
339
|
+
clientecontrato_id?: string | undefined;
|
|
340
|
+
servico_id: number;
|
|
341
|
+
}, "services.addTv">, import("./operation.js").OperationDefinition<{
|
|
342
|
+
[x: string]: unknown;
|
|
343
|
+
msg: string;
|
|
344
|
+
clientecontrato_id?: string | undefined;
|
|
345
|
+
servico_id: number;
|
|
346
|
+
}, "services.removeTv">, import("./operation.js").OperationDefinition<import("./operations/experimental-annotations-list.js").ExperimentalAnnotationsListData, "experimental.annotations.list">, import("./operation.js").OperationDefinition<{
|
|
347
|
+
[x: string]: unknown;
|
|
348
|
+
id: number;
|
|
349
|
+
pop?: string | null | undefined;
|
|
350
|
+
}[], "catalogs.listPops">, import("./operation.js").OperationDefinition<{
|
|
351
|
+
[x: string]: unknown;
|
|
352
|
+
id: number;
|
|
353
|
+
descricao?: string | null | undefined;
|
|
354
|
+
identificador?: string | null | undefined;
|
|
355
|
+
endereco_ip?: string | null | undefined;
|
|
356
|
+
ativo?: boolean | null | undefined;
|
|
357
|
+
pops?: {
|
|
358
|
+
[x: string]: unknown;
|
|
359
|
+
id?: number | null | undefined;
|
|
360
|
+
cidade?: string | null | undefined;
|
|
361
|
+
uf?: string | null | undefined;
|
|
362
|
+
codigo_ibge?: number | null | undefined;
|
|
363
|
+
ativo?: boolean | null | undefined;
|
|
364
|
+
}[] | null | undefined;
|
|
365
|
+
}[], "catalogs.listNas">, import("./operation.js").OperationDefinition<{
|
|
366
|
+
[x: string]: unknown;
|
|
367
|
+
id: number;
|
|
368
|
+
descricao?: string | null | undefined;
|
|
369
|
+
codigo_banco?: string | null | undefined;
|
|
370
|
+
}[], "catalogs.listBillingProfiles">, import("./operation.js").OperationDefinition<{
|
|
371
|
+
[x: string]: unknown;
|
|
372
|
+
id: number;
|
|
373
|
+
codigo: number;
|
|
374
|
+
descricao?: string | null | undefined;
|
|
375
|
+
ativo?: boolean | null | undefined;
|
|
376
|
+
classificacoes?: unknown[] | null | undefined;
|
|
377
|
+
classificacoes_obrigatorio?: boolean | null | undefined;
|
|
378
|
+
setores?: unknown[] | null | undefined;
|
|
379
|
+
classificacoes_obrigatorio_encerramento?: boolean | null | undefined;
|
|
380
|
+
}[], "occurrences.listTypes">, import("./operation.js").OperationDefinition<{
|
|
381
|
+
[x: string]: unknown;
|
|
382
|
+
codigo: number;
|
|
383
|
+
descricao?: string | null | undefined;
|
|
384
|
+
}[], "occurrences.listMethods">, import("./operation.js").OperationDefinition<{
|
|
385
|
+
[x: string]: unknown;
|
|
386
|
+
id: number;
|
|
387
|
+
codigo: number;
|
|
388
|
+
descricao?: string | null | undefined;
|
|
389
|
+
ativo?: boolean | null | undefined;
|
|
390
|
+
classificacoes?: unknown[] | null | undefined;
|
|
391
|
+
classificacoes_obrigatorio?: boolean | null | undefined;
|
|
392
|
+
setores?: unknown[] | null | undefined;
|
|
393
|
+
}[], "workOrders.listReasons">, import("./operation.js").OperationDefinition<{
|
|
394
|
+
[x: string]: unknown;
|
|
395
|
+
id: number & import("zod").$brand<"PreRegistrationPlanId">;
|
|
396
|
+
tipo?: string | null | undefined;
|
|
397
|
+
valor?: number | null | undefined;
|
|
398
|
+
descricao?: string | null | undefined;
|
|
399
|
+
observacao?: string | null | undefined;
|
|
400
|
+
gateway?: {
|
|
401
|
+
[x: string]: unknown;
|
|
402
|
+
gateway_id?: string | number | null | undefined;
|
|
403
|
+
id?: string | number | null | undefined;
|
|
404
|
+
descricao?: string | null | undefined;
|
|
405
|
+
} | null | undefined;
|
|
406
|
+
}[], "preRegistrations.listPlans">, import("./operation.js").OperationDefinition<{
|
|
407
|
+
[x: string]: unknown;
|
|
408
|
+
id: number;
|
|
409
|
+
dia?: number | null | undefined;
|
|
410
|
+
}[], "preRegistrations.listDueDays">, import("./operation.js").OperationDefinition<{
|
|
411
|
+
[x: string]: unknown;
|
|
412
|
+
id: number;
|
|
413
|
+
nome?: string | null | undefined;
|
|
414
|
+
cpf?: string | null | undefined;
|
|
415
|
+
email?: string | null | undefined;
|
|
416
|
+
}[], "preRegistrations.listSellers">, import("./operation.js").OperationDefinition<{
|
|
417
|
+
[x: string]: unknown;
|
|
418
|
+
id: number;
|
|
419
|
+
motivo?: string | null | undefined;
|
|
420
|
+
}[], "contracts.listStatusReasons">, import("./operation.js").OperationDefinition<{
|
|
421
|
+
[x: string]: unknown;
|
|
422
|
+
id: number;
|
|
423
|
+
cliente_id: number & import("zod").$brand<"CustomerId">;
|
|
424
|
+
arquivo?: string | null | undefined;
|
|
425
|
+
descricao?: string | null | undefined;
|
|
426
|
+
usuario?: string | null | undefined;
|
|
427
|
+
}[], "documents.list">, import("./operation.js").OperationDefinition<import("./operations/coverage-check.js").CoverageCheckData, "coverage.check">, import("./operation.js").OperationDefinition<{
|
|
428
|
+
[x: string]: unknown;
|
|
429
|
+
cliente_id: number & import("zod").$brand<"CustomerId">;
|
|
430
|
+
message?: string | null | undefined;
|
|
431
|
+
}, "crm.customers.create">, import("./operation.js").OperationDefinition<{
|
|
432
|
+
[x: string]: unknown;
|
|
433
|
+
cliente_id: number & import("zod").$brand<"CustomerId">;
|
|
434
|
+
message?: string | null | undefined;
|
|
435
|
+
novo_status: {
|
|
436
|
+
[x: string]: unknown;
|
|
437
|
+
codigo: number;
|
|
438
|
+
descricao?: string | null | undefined;
|
|
439
|
+
};
|
|
440
|
+
}, "crm.customers.updateStatus">, import("./operation.js").OperationDefinition<{
|
|
441
|
+
[x: string]: unknown;
|
|
442
|
+
message?: string | null | undefined;
|
|
443
|
+
clientecontrato: number;
|
|
444
|
+
cliente?: string | null | undefined;
|
|
445
|
+
}, "crm.contracts.create">, import("./operation.js").OperationDefinition<{
|
|
446
|
+
[x: string]: unknown;
|
|
447
|
+
message?: string | null | undefined;
|
|
448
|
+
clientecontrato: number;
|
|
449
|
+
cliente?: string | null | undefined;
|
|
450
|
+
}, "crm.contracts.createByCpfCnpj">, import("./operation.js").OperationDefinition<{
|
|
451
|
+
[x: string]: unknown;
|
|
452
|
+
cliente?: string | null | undefined;
|
|
453
|
+
cpf_cnpj?: string | null | undefined;
|
|
454
|
+
contratos: {
|
|
455
|
+
[x: string]: unknown;
|
|
456
|
+
cliente_contrato_id: number;
|
|
457
|
+
data_cadastro?: string | null | undefined;
|
|
458
|
+
vencimento_dia?: number | null | undefined;
|
|
459
|
+
pop?: string | null | undefined;
|
|
460
|
+
endereco?: string | null | undefined;
|
|
461
|
+
forma_cobranca?: string | null | undefined;
|
|
462
|
+
status?: string | null | undefined;
|
|
463
|
+
data_status?: string | null | undefined;
|
|
464
|
+
modo_status?: string | null | undefined;
|
|
465
|
+
motivo_status?: string | null | undefined;
|
|
466
|
+
vendedor?: string | null | undefined;
|
|
467
|
+
servicos?: {
|
|
468
|
+
[x: string]: unknown;
|
|
469
|
+
plano?: string | null | undefined;
|
|
470
|
+
login?: string | null | undefined;
|
|
471
|
+
contrato_tipo?: string | null | undefined;
|
|
472
|
+
situacao?: string | null | undefined;
|
|
473
|
+
aquisicao?: string | null | undefined;
|
|
474
|
+
}[] | null | undefined;
|
|
475
|
+
}[];
|
|
476
|
+
}, "crm.contracts.list">, import("./operation.js").OperationDefinition<{
|
|
477
|
+
[x: string]: unknown;
|
|
478
|
+
status: 1;
|
|
479
|
+
protocolo: string;
|
|
480
|
+
id: number;
|
|
481
|
+
contratoId?: number | null | undefined;
|
|
482
|
+
razaoSocial?: string | null | undefined;
|
|
483
|
+
cpfCnpj?: string | null | undefined;
|
|
484
|
+
msg?: string | null | undefined;
|
|
485
|
+
}, "occurrences.create">, import("./operation.js").OperationDefinition<null, "documents.add">];
|
|
486
|
+
/**
|
|
487
|
+
* Name of every typed operation of the client, as in `SgpError.operation`. `request()` is not one:
|
|
488
|
+
* its `error.operation` is `"request"`, and it declares no sensitivity (see `getSensitivity`).
|
|
489
|
+
*/
|
|
490
|
+
export type OperationName = (typeof shippedOperations)[number]["name"];
|
|
491
|
+
/**
|
|
492
|
+
* The secret and personal keys an operation declares, for its request (`input`) and its 2xx body
|
|
493
|
+
* (`output`), per item path. Use it to know what to strip; to decide what to send on, prefer an
|
|
494
|
+
* allowlist with `pick`: a key that is not listed is not safe, SGP adds fields without notice.
|
|
495
|
+
*/
|
|
496
|
+
export declare const getSensitivity: (operation: OperationName) => OperationSensitivity;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Exposure } from "./exposure.js";
|
|
2
|
+
import type { ResponseBody, SchemaWarning } from "./result.js";
|
|
3
|
+
import type { OperationSensitivity } from "./sensitivity.js";
|
|
4
|
+
/**
|
|
5
|
+
* How a request body is encoded; the executor switches on it. `form` is `multipart/form-data`
|
|
6
|
+
* without files: every param is a text field and the content-type (with its boundary) is left to
|
|
7
|
+
* `fetch`.
|
|
8
|
+
*/
|
|
9
|
+
export type Encoding = "json" | "form";
|
|
10
|
+
/**
|
|
11
|
+
* The encodings an operation may declare: {@link Encoding} plus `form-files`, `multipart/form-data`
|
|
12
|
+
* with file parts next to the text fields (the file parts come from `RequestBuild.files`). Only
|
|
13
|
+
* typed operations use it: `request()` takes {@link Encoding}.
|
|
14
|
+
*/
|
|
15
|
+
type OperationEncoding = Encoding | "form-files";
|
|
16
|
+
/** A file sent as one part of a `form-files` body. */
|
|
17
|
+
export interface FilePart {
|
|
18
|
+
/** The bytes of the file: a `Blob`, raw bytes or an `ArrayBuffer`, sent as they are. */
|
|
19
|
+
data: Blob | Uint8Array | ArrayBuffer;
|
|
20
|
+
/** Name SGP sees for the part. */
|
|
21
|
+
filename: string;
|
|
22
|
+
/** MIME type of the part. Defaults to the `type` of a `Blob`; none for raw bytes. */
|
|
23
|
+
contentType?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The fields every operation has, read or write. */
|
|
26
|
+
interface OperationFields<Data, Name extends string> {
|
|
27
|
+
/** Public name, e.g. `customers.list`; also the `operation` of hooks and errors. */
|
|
28
|
+
name: Name;
|
|
29
|
+
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
30
|
+
/** Path template starting with `/`; `{name}` placeholders are filled from `pathParams`. */
|
|
31
|
+
pathTemplate: string;
|
|
32
|
+
/**
|
|
33
|
+
* Hook metadata leaves out `pathTemplate`: for a call whose path is a literal chosen by the
|
|
34
|
+
* caller (`request()`), not a template. Absent means the template is shown.
|
|
35
|
+
*/
|
|
36
|
+
omitPathFromHooks?: boolean;
|
|
37
|
+
/** Body encoding of POST/PUT/DELETE. A GET has no body: its params go in the query string. */
|
|
38
|
+
encoding: OperationEncoding;
|
|
39
|
+
/** Validates the raw input and builds the request. No I/O. */
|
|
40
|
+
buildRequest: (input: unknown) => RequestBuild;
|
|
41
|
+
/**
|
|
42
|
+
* Recognizes a 2xx body that is a known refusal (a 200 that did not do what was asked). Pure.
|
|
43
|
+
* `undefined` when the body is not a refusal.
|
|
44
|
+
*/
|
|
45
|
+
detectRefusal?: (body: ResponseBody) => Refusal | undefined;
|
|
46
|
+
/** Checks a 2xx body against the contract the method promises. Pure, no I/O. */
|
|
47
|
+
decode: (body: ResponseBody) => DecodeOutcome<Data>;
|
|
48
|
+
/**
|
|
49
|
+
* Secret and personal keys of the request and of the 2xx body, per item path. Required: the
|
|
50
|
+
* single source `getSensitivity` reads. A definition with nothing sensitive says
|
|
51
|
+
* `{ input: [], output: [] }`.
|
|
52
|
+
*/
|
|
53
|
+
sensitivity: OperationSensitivity;
|
|
54
|
+
/**
|
|
55
|
+
* For an operation whose response mixes records outside the requested scope: the executor
|
|
56
|
+
* withholds the body and keeps only message strings in `error.sgp`, on every status and path,
|
|
57
|
+
* before it builds any public object. Absent means the body is the evidence, as everywhere else.
|
|
58
|
+
*/
|
|
59
|
+
exposure?: Exposure;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* INTERNAL. An operation is data plus a few small pure functions; the executor does everything else.
|
|
63
|
+
* Not exported from the package: consumers only see the client methods, their types and options.
|
|
64
|
+
*
|
|
65
|
+
* A read may be `repeatable` (the retry gate of the operation contract; absent means `false`). A write, marked by
|
|
66
|
+
* `write`, carries an `effect` on every failure and is never repeatable: the type forbids
|
|
67
|
+
* `repeatable: true` next to `write`, and the executor refuses such a definition.
|
|
68
|
+
*/
|
|
69
|
+
export type OperationDefinition<Data, Name extends string = string> = (OperationFields<Data, Name> & {
|
|
70
|
+
repeatable?: boolean;
|
|
71
|
+
write?: undefined;
|
|
72
|
+
}) | (OperationFields<Data, Name> & {
|
|
73
|
+
repeatable?: false;
|
|
74
|
+
write: WriteSpec;
|
|
75
|
+
});
|
|
76
|
+
/** What a write declares about itself on top of the default effect rules of the operation contract. */
|
|
77
|
+
export interface WriteSpec {
|
|
78
|
+
/**
|
|
79
|
+
* Every failure after a request was sent has effect `unknown`, whatever the status and body say:
|
|
80
|
+
* for a call the SDK does not interpret (`request()`), where no rejection is known to apply
|
|
81
|
+
* nothing. Absent means the default rules of the operation contract.
|
|
82
|
+
*/
|
|
83
|
+
effectUnknownAfterSend?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Remote rejections this operation is proven to apply no effect for, whatever their body shape
|
|
86
|
+
* (in particular SGP's generic `errors` array, which is `unknown` by default). Declare one only
|
|
87
|
+
* with captured evidence for this operation.
|
|
88
|
+
*/
|
|
89
|
+
knownRejections?: readonly KnownRejection[];
|
|
90
|
+
}
|
|
91
|
+
/** A remote 4xx known to leave the requested change unapplied. Gives the failure its `reason`. */
|
|
92
|
+
export interface KnownRejection {
|
|
93
|
+
/** HTTP status of the rejection. Must be 4xx: any other status is never matched. */
|
|
94
|
+
status: number;
|
|
95
|
+
/** Recognizes the rejection from the body. Pure; must say `false` for a body it cannot read. */
|
|
96
|
+
matches: (body: ResponseBody) => boolean;
|
|
97
|
+
/** Value of `SgpError.reason`. */
|
|
98
|
+
reason: string;
|
|
99
|
+
}
|
|
100
|
+
/** What `buildRequest` returns: the request to send, or the first problem with the input. */
|
|
101
|
+
export type RequestBuild = {
|
|
102
|
+
ok: true;
|
|
103
|
+
/** Values for the `{name}` placeholders of the path template. */
|
|
104
|
+
pathParams?: Readonly<Record<string, string | number>>;
|
|
105
|
+
/**
|
|
106
|
+
* Request fields: the body for POST/PUT/DELETE, the query string for GET. `undefined` values
|
|
107
|
+
* are omitted. A GET or a `form` body takes primitives only (a `json` body takes any value).
|
|
108
|
+
*/
|
|
109
|
+
params?: Readonly<Record<string, unknown>>;
|
|
110
|
+
/**
|
|
111
|
+
* Fields that go in the URL of a request that has a body (POST/PUT/DELETE), after the path;
|
|
112
|
+
* `params` and the credentials stay in the body. Primitives only, `undefined` omitted, never
|
|
113
|
+
* `token` or `app`. A GET puts everything in its query string already: a GET with `query` is
|
|
114
|
+
* refused (`INVALID_INPUT`).
|
|
115
|
+
*/
|
|
116
|
+
query?: Readonly<Record<string, unknown>>;
|
|
117
|
+
/** File parts by field name; only a `form-files` body sends them, after the text fields. */
|
|
118
|
+
files?: Readonly<Record<string, FilePart>>;
|
|
119
|
+
} | {
|
|
120
|
+
ok: false;
|
|
121
|
+
problem: string;
|
|
122
|
+
};
|
|
123
|
+
/** A recognized refusal inside a 2xx response. */
|
|
124
|
+
export interface Refusal {
|
|
125
|
+
reason?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Result of checking a 2xx body. `warnings` lists the non-essential fields the decoder had to drop
|
|
129
|
+
* from `data`; it is absent when nothing was dropped.
|
|
130
|
+
*/
|
|
131
|
+
export type DecodeOutcome<Data> = {
|
|
132
|
+
ok: true;
|
|
133
|
+
data: Data;
|
|
134
|
+
warnings?: readonly SchemaWarning[];
|
|
135
|
+
} | {
|
|
136
|
+
ok: false;
|
|
137
|
+
issues: readonly string[];
|
|
138
|
+
};
|
|
139
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { OperationDefinition } from "../operation.js";
|
|
3
|
+
declare const billingProfilesSchema: z.ZodArray<z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
codigo_banco: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
|
+
}, z.core.$loose>>;
|
|
8
|
+
/**
|
|
9
|
+
* The response of `GET /api/ura/portador/`, in SGP's own shape: a bare array with one entry per
|
|
10
|
+
* billing profile (SGP "portador"). The route is not paginated, so there is no envelope and no
|
|
11
|
+
* total.
|
|
12
|
+
*/
|
|
13
|
+
export type CatalogsListBillingProfilesData = z.output<typeof billingProfilesSchema>;
|
|
14
|
+
/** INTERNAL definition of `catalogs.listBillingProfiles`. */
|
|
15
|
+
export declare const catalogsListBillingProfiles: OperationDefinition<CatalogsListBillingProfilesData, "catalogs.listBillingProfiles">;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { OperationDefinition } from "../operation.js";
|
|
3
|
+
declare const nasListSchema: z.ZodArray<z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
identificador: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
|
+
endereco_ip: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
ativo: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
pops: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
cidade: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
uf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
codigo_ibge: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
14
|
+
ativo: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
15
|
+
}, z.core.$loose>>>>;
|
|
16
|
+
}, z.core.$loose>>;
|
|
17
|
+
/**
|
|
18
|
+
* The response of `POST /api/ura/nas/list/`, in SGP's own shape: a bare array with one entry per
|
|
19
|
+
* NAS (network access server) and the POPs each one serves. The route is not paginated, so there is
|
|
20
|
+
* no envelope and no total.
|
|
21
|
+
*/
|
|
22
|
+
export type CatalogsListNasData = z.output<typeof nasListSchema>;
|
|
23
|
+
/** INTERNAL definition of `catalogs.listNas`. */
|
|
24
|
+
export declare const catalogsListNas: OperationDefinition<CatalogsListNasData, "catalogs.listNas">;
|
|
25
|
+
export {};
|