@navservice/assinatura 1.56.0 → 1.58.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/build/es/backend/schema/schema_assinatura.d.ts +8 -3
- package/build/es/index.js +17 -94
- package/build/es/shared/types/{controller → entidades}/assinatura.d.ts +20 -21
- package/build/es/shared/types/{controller → entidades}/cliente.d.ts +5 -6
- package/build/es/shared/types/{controller → entidades}/creditos.d.ts +4 -5
- package/build/es/shared/types/index.d.ts +3 -5
- package/package.json +1 -2
- package/build/es/shared/types/geral/type_response.d.ts +0 -54
|
@@ -321,9 +321,14 @@ export declare const schema_assinatura: import("drizzle-orm/sqlite-core").SQLite
|
|
|
321
321
|
};
|
|
322
322
|
dialect: "sqlite";
|
|
323
323
|
}>;
|
|
324
|
-
export type
|
|
325
|
-
export type
|
|
326
|
-
export type
|
|
324
|
+
export type Base = InferSelectModel<typeof schema_assinatura>;
|
|
325
|
+
export type Criar = InferInsertModel<typeof schema_assinatura>;
|
|
326
|
+
export type BuscarPeloFiltro = Pick<InferSelectModel<typeof schema_assinatura>, "usuario_id"> & Partial<Pick<InferSelectModel<typeof schema_assinatura>, "_id" | "status">> & {
|
|
327
|
+
pagina: number;
|
|
328
|
+
};
|
|
329
|
+
export type AtualizarPeloId = Pick<InferSelectModel<typeof schema_assinatura>, "usuario_id"> & Partial<Pick<InferSelectModel<typeof schema_assinatura>, "plano_name" | "plano_id" | "price_id" | "status" | "stripe_latest_invoice_id" | "gateway_subscription_id" | "gateway_customer_id" | "valor" | "moeda" | "periodo_inicio" | "periodo_fim" | "ativo" | "data_atualizacao">>;
|
|
330
|
+
export type BuscarPeloId = {
|
|
327
331
|
app: TypesCore.Controller.Usuario.TokenPayload["app"];
|
|
328
332
|
usuario_id: string;
|
|
329
333
|
};
|
|
334
|
+
export type DeletarPeloId = Pick<InferSelectModel<typeof schema_assinatura>, "_id">;
|
package/build/es/index.js
CHANGED
|
@@ -15959,6 +15959,7 @@ var _usuario_TypeControllerUsuario;
|
|
|
15959
15959
|
v4.literal("ACTION_REQUIRED"),
|
|
15960
15960
|
v4.literal("CREATED"),
|
|
15961
15961
|
v4.literal("WARNING"),
|
|
15962
|
+
v4.literal("ERROR"),
|
|
15962
15963
|
v4.literal("AUTHORIZATION_ERROR"),
|
|
15963
15964
|
v4.literal("SCHEMA_VALIDATION"),
|
|
15964
15965
|
v4.literal("SERVER_ERROR"),
|
|
@@ -15968,7 +15969,9 @@ var _usuario_TypeControllerUsuario;
|
|
|
15968
15969
|
v4.literal("SUCCESS_FILE"),
|
|
15969
15970
|
v4.literal("DATABASE_ERROR"),
|
|
15970
15971
|
v4.literal("BUSINESS_RULE_VIOLATION"),
|
|
15971
|
-
v4.literal("PLAN_FORBIDDEN")
|
|
15972
|
+
v4.literal("PLAN_FORBIDDEN"),
|
|
15973
|
+
v4.literal("INTEGRATION_ERROR"),
|
|
15974
|
+
v4.literal("TOKEN_AUTH_USER")
|
|
15972
15975
|
]);
|
|
15973
15976
|
v4.object({
|
|
15974
15977
|
status: StatusSchema,
|
|
@@ -15990,6 +15993,7 @@ var _usuario_TypeControllerUsuario;
|
|
|
15990
15993
|
v4.object({
|
|
15991
15994
|
status: StatusSchema,
|
|
15992
15995
|
message: v4.string().optional(),
|
|
15996
|
+
fn: v4.string(),
|
|
15993
15997
|
file_buffer: v4.union([
|
|
15994
15998
|
v4["instanceof"](Blob),
|
|
15995
15999
|
v4["instanceof"](ArrayBuffer),
|
|
@@ -16635,7 +16639,9 @@ const es_utils = {
|
|
|
16635
16639
|
session_sorage: utils_session_storage,
|
|
16636
16640
|
sistema: utils_sistema,
|
|
16637
16641
|
hooks: utils_hooks,
|
|
16638
|
-
environment: utils_environment
|
|
16642
|
+
environment: utils_environment,
|
|
16643
|
+
axios: lib_axios,
|
|
16644
|
+
zod: v4
|
|
16639
16645
|
};
|
|
16640
16646
|
const src_utils = es_utils;
|
|
16641
16647
|
const createStoreImpl = (createState)=>{
|
|
@@ -18829,18 +18835,18 @@ sqliteTable('assinatura', {
|
|
|
18829
18835
|
usuario_id: v4.string(),
|
|
18830
18836
|
app: AppEnumZod,
|
|
18831
18837
|
data_criacao: v4.number(),
|
|
18832
|
-
data_atualizacao: v4.number().nullable()
|
|
18833
|
-
periodo_inicio: v4.number().nullable()
|
|
18834
|
-
periodo_fim: v4.number().nullable()
|
|
18838
|
+
data_atualizacao: v4.number().nullable(),
|
|
18839
|
+
periodo_inicio: v4.number().nullable(),
|
|
18840
|
+
periodo_fim: v4.number().nullable(),
|
|
18835
18841
|
status: AssinaturaStatusZod,
|
|
18836
18842
|
valor: v4.number(),
|
|
18837
18843
|
moeda: v4.string(),
|
|
18838
|
-
plano_id: v4.string().nullable()
|
|
18844
|
+
plano_id: v4.string().nullable(),
|
|
18839
18845
|
plano_name: PlanNameEnum,
|
|
18840
|
-
gateway_subscription_id: v4.string().nullable()
|
|
18841
|
-
gateway_customer_id: v4.string().nullable()
|
|
18842
|
-
price_id: v4.string().nullable()
|
|
18843
|
-
stripe_latest_invoice_id: v4.string().nullable()
|
|
18846
|
+
gateway_subscription_id: v4.string().nullable(),
|
|
18847
|
+
gateway_customer_id: v4.string().nullable(),
|
|
18848
|
+
price_id: v4.string().nullable(),
|
|
18849
|
+
stripe_latest_invoice_id: v4.string().nullable(),
|
|
18844
18850
|
ativo: v4.union([
|
|
18845
18851
|
v4.literal(1),
|
|
18846
18852
|
v4.literal(0)
|
|
@@ -18908,7 +18914,7 @@ sqliteTable('assinatura', {
|
|
|
18908
18914
|
assinatura: v4.object({
|
|
18909
18915
|
usuario_id: v4.uuidv4(),
|
|
18910
18916
|
plano_id: v4.string().nullable().optional(),
|
|
18911
|
-
plano_name: PlanNameEnum.
|
|
18917
|
+
plano_name: PlanNameEnum.optional(),
|
|
18912
18918
|
status: AssinaturaStatusZod.optional(),
|
|
18913
18919
|
valor: v4.number().optional(),
|
|
18914
18920
|
moeda: v4.string().optional(),
|
|
@@ -19091,95 +19097,12 @@ var cliente_TypeControllerCliente;
|
|
|
19091
19097
|
})(creditos_TypeControllerCreditos || (creditos_TypeControllerCreditos = {}));
|
|
19092
19098
|
const creditos = creditos_TypeControllerCreditos;
|
|
19093
19099
|
var creditos_TypeControllerCreditos;
|
|
19094
|
-
(function(TypeControllerResponse) {
|
|
19095
|
-
const StatusSchema = v4.union([
|
|
19096
|
-
v4.literal(200),
|
|
19097
|
-
v4.literal(201),
|
|
19098
|
-
v4.literal(202),
|
|
19099
|
-
v4.literal(204),
|
|
19100
|
-
v4.literal(400),
|
|
19101
|
-
v4.literal(401),
|
|
19102
|
-
v4.literal(403),
|
|
19103
|
-
v4.literal(404),
|
|
19104
|
-
v4.literal(409),
|
|
19105
|
-
v4.literal(422),
|
|
19106
|
-
v4.literal(500),
|
|
19107
|
-
v4.literal(428),
|
|
19108
|
-
v4.literal(405)
|
|
19109
|
-
]);
|
|
19110
|
-
const TypeSchema = v4.union([
|
|
19111
|
-
v4.literal("success"),
|
|
19112
|
-
v4.literal("warning"),
|
|
19113
|
-
v4.literal("error")
|
|
19114
|
-
]).default("success");
|
|
19115
|
-
const CodeSchema = v4.union([
|
|
19116
|
-
v4.literal("SUCCESS"),
|
|
19117
|
-
v4.literal("ACTION_REQUIRED"),
|
|
19118
|
-
v4.literal("CREATED"),
|
|
19119
|
-
v4.literal("WARNING"),
|
|
19120
|
-
v4.literal("AUTHORIZATION_ERROR"),
|
|
19121
|
-
v4.literal("SCHEMA_VALIDATION"),
|
|
19122
|
-
v4.literal("SERVER_ERROR"),
|
|
19123
|
-
v4.literal("UNAUTHORIZED"),
|
|
19124
|
-
v4.literal("INVALID_TOKEN"),
|
|
19125
|
-
v4.literal("NOT_FOUND"),
|
|
19126
|
-
v4.literal("SUCCESS_FILE"),
|
|
19127
|
-
v4.literal("DATABASE_ERROR")
|
|
19128
|
-
]);
|
|
19129
|
-
v4.object({
|
|
19130
|
-
status: StatusSchema,
|
|
19131
|
-
code: CodeSchema,
|
|
19132
|
-
type: TypeSchema,
|
|
19133
|
-
message: v4.string(),
|
|
19134
|
-
results: v4.unknown().optional(),
|
|
19135
|
-
error: v4.unknown().optional()
|
|
19136
|
-
});
|
|
19137
|
-
(function(C) {
|
|
19138
|
-
C.InputSchema = v4.object({
|
|
19139
|
-
status: StatusSchema,
|
|
19140
|
-
code: CodeSchema,
|
|
19141
|
-
type: TypeSchema.optional().default("success"),
|
|
19142
|
-
message: v4.string().optional(),
|
|
19143
|
-
results: v4.any(),
|
|
19144
|
-
c: v4.custom()
|
|
19145
|
-
});
|
|
19146
|
-
v4.object({
|
|
19147
|
-
status: StatusSchema,
|
|
19148
|
-
message: v4.string().optional(),
|
|
19149
|
-
file_buffer: v4.union([
|
|
19150
|
-
v4["instanceof"](Blob),
|
|
19151
|
-
v4["instanceof"](ArrayBuffer),
|
|
19152
|
-
v4["instanceof"](Uint8Array)
|
|
19153
|
-
]),
|
|
19154
|
-
content_type: v4.string(),
|
|
19155
|
-
filename: v4.string().optional(),
|
|
19156
|
-
c: v4.custom().optional()
|
|
19157
|
-
});
|
|
19158
|
-
})(TypeControllerResponse.C || (TypeControllerResponse.C = {}));
|
|
19159
|
-
(function(Error1) {
|
|
19160
|
-
Error1.InputSchema = v4.object({
|
|
19161
|
-
message: v4.string().optional(),
|
|
19162
|
-
results: v4.union([
|
|
19163
|
-
v4.array(v4.unknown()),
|
|
19164
|
-
v4.unknown()
|
|
19165
|
-
]).optional(),
|
|
19166
|
-
type: TypeSchema.optional().default("success"),
|
|
19167
|
-
code: CodeSchema,
|
|
19168
|
-
status: v4.number().optional().default(200)
|
|
19169
|
-
});
|
|
19170
|
-
})(TypeControllerResponse.Error || (TypeControllerResponse.Error = {}));
|
|
19171
|
-
})(type_response_TypeControllerResponse || (type_response_TypeControllerResponse = {}));
|
|
19172
|
-
const type_response = type_response_TypeControllerResponse;
|
|
19173
|
-
var type_response_TypeControllerResponse;
|
|
19174
19100
|
(function(t) {
|
|
19175
19101
|
(function(Controller) {
|
|
19176
19102
|
Controller.Assinatura = assinatura;
|
|
19177
19103
|
Controller.Cliente = cliente;
|
|
19178
19104
|
Controller.Creditos = creditos;
|
|
19179
19105
|
})(t.Controller || (t.Controller = {}));
|
|
19180
|
-
(function(Geral) {
|
|
19181
|
-
Geral.Response = type_response;
|
|
19182
|
-
})(t.Geral || (t.Geral = {}));
|
|
19183
19106
|
})(shared_types_t || (shared_types_t = {}));
|
|
19184
19107
|
const shared_types = shared_types_t;
|
|
19185
19108
|
var shared_types_t;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AxiosResponse } from "axios";
|
|
2
1
|
import Stripe from "stripe";
|
|
3
2
|
import z4 from "zod/v4";
|
|
4
3
|
import t from "..";
|
|
@@ -16,9 +15,9 @@ declare namespace TypeControllerAssinatura {
|
|
|
16
15
|
"service-oraculo": "service-oraculo";
|
|
17
16
|
}>;
|
|
18
17
|
data_criacao: z4.ZodNumber;
|
|
19
|
-
data_atualizacao: z4.
|
|
20
|
-
periodo_inicio: z4.
|
|
21
|
-
periodo_fim: z4.
|
|
18
|
+
data_atualizacao: z4.ZodNullable<z4.ZodNumber>;
|
|
19
|
+
periodo_inicio: z4.ZodNullable<z4.ZodNumber>;
|
|
20
|
+
periodo_fim: z4.ZodNullable<z4.ZodNumber>;
|
|
22
21
|
status: z4.ZodEnum<{
|
|
23
22
|
canceled: "canceled";
|
|
24
23
|
incomplete: "incomplete";
|
|
@@ -31,17 +30,17 @@ declare namespace TypeControllerAssinatura {
|
|
|
31
30
|
}>;
|
|
32
31
|
valor: z4.ZodNumber;
|
|
33
32
|
moeda: z4.ZodString;
|
|
34
|
-
plano_id: z4.
|
|
33
|
+
plano_id: z4.ZodNullable<z4.ZodString>;
|
|
35
34
|
plano_name: z4.ZodEnum<{
|
|
36
35
|
FREE: "FREE";
|
|
37
36
|
ESSENTIAL: "ESSENTIAL";
|
|
38
37
|
BUSINESS: "BUSINESS";
|
|
39
38
|
ENTERPRISE: "ENTERPRISE";
|
|
40
39
|
}>;
|
|
41
|
-
gateway_subscription_id: z4.
|
|
42
|
-
gateway_customer_id: z4.
|
|
43
|
-
price_id: z4.
|
|
44
|
-
stripe_latest_invoice_id: z4.
|
|
40
|
+
gateway_subscription_id: z4.ZodNullable<z4.ZodString>;
|
|
41
|
+
gateway_customer_id: z4.ZodNullable<z4.ZodString>;
|
|
42
|
+
price_id: z4.ZodNullable<z4.ZodString>;
|
|
43
|
+
stripe_latest_invoice_id: z4.ZodNullable<z4.ZodString>;
|
|
45
44
|
ativo: z4.ZodUnion<readonly [z4.ZodLiteral<1>, z4.ZodLiteral<0>]>;
|
|
46
45
|
}, z4.core.$strip>;
|
|
47
46
|
type AssinaturaBase = z4.infer<typeof AssinaturaBaseSchema>;
|
|
@@ -85,7 +84,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
85
84
|
assinatura: AssinaturaBase;
|
|
86
85
|
};
|
|
87
86
|
};
|
|
88
|
-
type Response =
|
|
87
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
89
88
|
}
|
|
90
89
|
export namespace BuscarPeloFiltro {
|
|
91
90
|
const route: "/api/assinatura";
|
|
@@ -120,7 +119,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
120
119
|
assinatura: AssinaturaBase[];
|
|
121
120
|
};
|
|
122
121
|
};
|
|
123
|
-
type Response =
|
|
122
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
124
123
|
}
|
|
125
124
|
export namespace BuscarPeloId {
|
|
126
125
|
const route: "/api/assinatura/:id";
|
|
@@ -137,7 +136,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
137
136
|
assinatura: AssinaturaBase;
|
|
138
137
|
};
|
|
139
138
|
};
|
|
140
|
-
type Response =
|
|
139
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
141
140
|
}
|
|
142
141
|
export namespace BuscarPeloUsuarioId {
|
|
143
142
|
const route: "/api/assinatura/:app/usuario/:id";
|
|
@@ -165,7 +164,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
165
164
|
};
|
|
166
165
|
};
|
|
167
166
|
};
|
|
168
|
-
type Response =
|
|
167
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
169
168
|
}
|
|
170
169
|
export namespace AtualizarPeloId {
|
|
171
170
|
const route: "/api/assinatura/:id";
|
|
@@ -174,12 +173,12 @@ declare namespace TypeControllerAssinatura {
|
|
|
174
173
|
assinatura: z4.ZodObject<{
|
|
175
174
|
usuario_id: z4.ZodUUID;
|
|
176
175
|
plano_id: z4.ZodOptional<z4.ZodNullable<z4.ZodString>>;
|
|
177
|
-
plano_name: z4.ZodOptional<z4.
|
|
176
|
+
plano_name: z4.ZodOptional<z4.ZodEnum<{
|
|
178
177
|
FREE: "FREE";
|
|
179
178
|
ESSENTIAL: "ESSENTIAL";
|
|
180
179
|
BUSINESS: "BUSINESS";
|
|
181
180
|
ENTERPRISE: "ENTERPRISE";
|
|
182
|
-
}
|
|
181
|
+
}>>;
|
|
183
182
|
status: z4.ZodOptional<z4.ZodEnum<{
|
|
184
183
|
canceled: "canceled";
|
|
185
184
|
incomplete: "incomplete";
|
|
@@ -209,7 +208,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
209
208
|
assinatura: AssinaturaBase;
|
|
210
209
|
};
|
|
211
210
|
};
|
|
212
|
-
type Response =
|
|
211
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
213
212
|
}
|
|
214
213
|
export namespace DeletarPeloId {
|
|
215
214
|
const route: "/api/assinatura/:id";
|
|
@@ -224,7 +223,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
224
223
|
assinatura: AssinaturaBase;
|
|
225
224
|
};
|
|
226
225
|
};
|
|
227
|
-
type Response =
|
|
226
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
228
227
|
}
|
|
229
228
|
export namespace BuscarProdutoStripe {
|
|
230
229
|
const route: "/api/assinatura/produto";
|
|
@@ -236,7 +235,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
236
235
|
plano_atual: t.Controller.Assinatura.BuscarPeloId.Output['data']['assinatura'];
|
|
237
236
|
};
|
|
238
237
|
};
|
|
239
|
-
type Response =
|
|
238
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
240
239
|
}
|
|
241
240
|
export namespace CriarCheckoutSession {
|
|
242
241
|
const route: "/api/assinatura/checkout";
|
|
@@ -267,7 +266,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
267
266
|
assinatura: AssinaturaBase;
|
|
268
267
|
};
|
|
269
268
|
};
|
|
270
|
-
type Response =
|
|
269
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
271
270
|
}
|
|
272
271
|
export namespace Gerenciar {
|
|
273
272
|
const route: "/api/assinatura/gerenciar";
|
|
@@ -284,7 +283,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
284
283
|
assinatura: Stripe.Response<Stripe.BillingPortal.Session>;
|
|
285
284
|
};
|
|
286
285
|
};
|
|
287
|
-
type Response =
|
|
286
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
288
287
|
}
|
|
289
288
|
export namespace UpgradeEDownGradeAssinatura {
|
|
290
289
|
const route: "/api/assinatura/upgrade_downgrade";
|
|
@@ -301,7 +300,7 @@ declare namespace TypeControllerAssinatura {
|
|
|
301
300
|
assinatura: {};
|
|
302
301
|
};
|
|
303
302
|
};
|
|
304
|
-
type Response =
|
|
303
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
305
304
|
}
|
|
306
305
|
export {};
|
|
307
306
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AxiosResponse } from "axios";
|
|
2
1
|
import z4 from "zod/v4";
|
|
3
|
-
import
|
|
2
|
+
import { TypesCore } from "@navservice/core";
|
|
4
3
|
declare namespace TypeControllerCliente {
|
|
5
4
|
const ClienteBaseSchema: z4.ZodObject<{
|
|
6
5
|
_id: z4.ZodString;
|
|
@@ -31,7 +30,7 @@ declare namespace TypeControllerCliente {
|
|
|
31
30
|
cliente: Cliente;
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
|
-
type Response =
|
|
33
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
35
34
|
}
|
|
36
35
|
namespace BuscarPeloFiltro {
|
|
37
36
|
const route: "/api/cliente";
|
|
@@ -58,7 +57,7 @@ declare namespace TypeControllerCliente {
|
|
|
58
57
|
cliente: Cliente[];
|
|
59
58
|
};
|
|
60
59
|
};
|
|
61
|
-
type Response =
|
|
60
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
62
61
|
}
|
|
63
62
|
namespace BuscarPeloAppEUsuarioId {
|
|
64
63
|
const route: "/api/cliente/:id";
|
|
@@ -73,7 +72,7 @@ declare namespace TypeControllerCliente {
|
|
|
73
72
|
cliente: Cliente;
|
|
74
73
|
};
|
|
75
74
|
};
|
|
76
|
-
type Response =
|
|
75
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
77
76
|
}
|
|
78
77
|
namespace AtualizarPeloId {
|
|
79
78
|
const route: "/api/cliente/:id";
|
|
@@ -95,7 +94,7 @@ declare namespace TypeControllerCliente {
|
|
|
95
94
|
cliente: Cliente;
|
|
96
95
|
};
|
|
97
96
|
};
|
|
98
|
-
type Response =
|
|
97
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
export default TypeControllerCliente;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AxiosResponse } from "axios";
|
|
2
1
|
import z4 from "zod/v4";
|
|
3
|
-
import
|
|
2
|
+
import { TypesCore } from "@navservice/core";
|
|
4
3
|
declare namespace TypeControllerCreditos {
|
|
5
4
|
const TipoEnum: readonly ["entrada", "saida", "bonus"];
|
|
6
5
|
const PontosBaseSchema: z4.ZodObject<{
|
|
@@ -43,7 +42,7 @@ declare namespace TypeControllerCreditos {
|
|
|
43
42
|
};
|
|
44
43
|
};
|
|
45
44
|
};
|
|
46
|
-
type Response =
|
|
45
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
47
46
|
}
|
|
48
47
|
namespace UsarCreditosDoUsuario {
|
|
49
48
|
const route: "/api/creditos/usuario/usar";
|
|
@@ -63,7 +62,7 @@ declare namespace TypeControllerCreditos {
|
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
64
|
};
|
|
66
|
-
type Response =
|
|
65
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
67
66
|
}
|
|
68
67
|
namespace CriarCheckoutCreditos {
|
|
69
68
|
const route: "/api/creditos/checkout";
|
|
@@ -83,7 +82,7 @@ declare namespace TypeControllerCreditos {
|
|
|
83
82
|
};
|
|
84
83
|
};
|
|
85
84
|
};
|
|
86
|
-
type Response =
|
|
85
|
+
type Response = TypesCore.Geral.Response.C.AxiosRes<Output>;
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
export default TypeControllerCreditos;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Context as HonoContext } from "hono";
|
|
2
2
|
import type { D1Database, Fetcher } from "@cloudflare/workers-types";
|
|
3
3
|
import { TypesCore } from "@navservice/core";
|
|
4
|
-
import TypeControllerAssinatura from "./
|
|
5
|
-
import TypeControllerCliente from "./
|
|
6
|
-
import TypeControllerCreditos from "./
|
|
7
|
-
import TypeResponse from "./geral/type_response";
|
|
4
|
+
import TypeControllerAssinatura from "./entidades/assinatura";
|
|
5
|
+
import TypeControllerCliente from "./entidades/cliente";
|
|
6
|
+
import TypeControllerCreditos from "./entidades/creditos";
|
|
8
7
|
declare namespace t {
|
|
9
8
|
namespace Controller {
|
|
10
9
|
export import Assinatura = TypeControllerAssinatura;
|
|
@@ -14,7 +13,6 @@ declare namespace t {
|
|
|
14
13
|
namespace Integrations {
|
|
15
14
|
}
|
|
16
15
|
namespace Geral {
|
|
17
|
-
export import Response = TypeResponse;
|
|
18
16
|
interface Env {
|
|
19
17
|
CORS_ORIGIN?: string;
|
|
20
18
|
NODE_ENV?: "PRODUCAO" | "SANDBOX";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navservice/assinatura",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"description": "Service de autenticação de usuários unificado",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/lib/index.js",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"build": "rslib build"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@navservice/usuario": "^1.53.0",
|
|
24
23
|
"react": "^19.0.0",
|
|
25
24
|
"react-dom": "^19.0.0",
|
|
26
25
|
"react-router-dom": "^7.0.0"
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Context } from "hono";
|
|
2
|
-
import z4 from "zod/v4";
|
|
3
|
-
declare namespace TypeControllerResponse {
|
|
4
|
-
const BaseResponseSchema: z4.ZodObject<{
|
|
5
|
-
status: z4.ZodUnion<readonly [z4.ZodLiteral<200>, z4.ZodLiteral<201>, z4.ZodLiteral<202>, z4.ZodLiteral<204>, z4.ZodLiteral<400>, z4.ZodLiteral<401>, z4.ZodLiteral<403>, z4.ZodLiteral<404>, z4.ZodLiteral<409>, z4.ZodLiteral<422>, z4.ZodLiteral<500>, z4.ZodLiteral<428>, z4.ZodLiteral<405>]>;
|
|
6
|
-
code: z4.ZodUnion<readonly [z4.ZodLiteral<"SUCCESS">, z4.ZodLiteral<"ACTION_REQUIRED">, z4.ZodLiteral<"CREATED">, z4.ZodLiteral<"WARNING">, z4.ZodLiteral<"AUTHORIZATION_ERROR">, z4.ZodLiteral<"SCHEMA_VALIDATION">, z4.ZodLiteral<"SERVER_ERROR">, z4.ZodLiteral<"UNAUTHORIZED">, z4.ZodLiteral<"INVALID_TOKEN">, z4.ZodLiteral<"NOT_FOUND">, z4.ZodLiteral<"SUCCESS_FILE">, z4.ZodLiteral<"DATABASE_ERROR">]>;
|
|
7
|
-
type: z4.ZodDefault<z4.ZodUnion<readonly [z4.ZodLiteral<"success">, z4.ZodLiteral<"warning">, z4.ZodLiteral<"error">]>>;
|
|
8
|
-
message: z4.ZodString;
|
|
9
|
-
results: z4.ZodOptional<z4.ZodUnknown>;
|
|
10
|
-
error: z4.ZodOptional<z4.ZodUnknown>;
|
|
11
|
-
}, z4.core.$strip>;
|
|
12
|
-
type BaseResponse<T = unknown> = z4.infer<typeof BaseResponseSchema> & {
|
|
13
|
-
results?: T;
|
|
14
|
-
};
|
|
15
|
-
export namespace C {
|
|
16
|
-
export const InputSchema: z4.ZodObject<{
|
|
17
|
-
status: z4.ZodUnion<readonly [z4.ZodLiteral<200>, z4.ZodLiteral<201>, z4.ZodLiteral<202>, z4.ZodLiteral<204>, z4.ZodLiteral<400>, z4.ZodLiteral<401>, z4.ZodLiteral<403>, z4.ZodLiteral<404>, z4.ZodLiteral<409>, z4.ZodLiteral<422>, z4.ZodLiteral<500>, z4.ZodLiteral<428>, z4.ZodLiteral<405>]>;
|
|
18
|
-
code: z4.ZodUnion<readonly [z4.ZodLiteral<"SUCCESS">, z4.ZodLiteral<"ACTION_REQUIRED">, z4.ZodLiteral<"CREATED">, z4.ZodLiteral<"WARNING">, z4.ZodLiteral<"AUTHORIZATION_ERROR">, z4.ZodLiteral<"SCHEMA_VALIDATION">, z4.ZodLiteral<"SERVER_ERROR">, z4.ZodLiteral<"UNAUTHORIZED">, z4.ZodLiteral<"INVALID_TOKEN">, z4.ZodLiteral<"NOT_FOUND">, z4.ZodLiteral<"SUCCESS_FILE">, z4.ZodLiteral<"DATABASE_ERROR">]>;
|
|
19
|
-
type: z4.ZodDefault<z4.ZodOptional<z4.ZodDefault<z4.ZodUnion<readonly [z4.ZodLiteral<"success">, z4.ZodLiteral<"warning">, z4.ZodLiteral<"error">]>>>>;
|
|
20
|
-
message: z4.ZodOptional<z4.ZodString>;
|
|
21
|
-
results: z4.ZodAny;
|
|
22
|
-
c: z4.ZodCustom<Context<any, any, {}>, Context<any, any, {}>>;
|
|
23
|
-
}, z4.core.$strip>;
|
|
24
|
-
export type Input<T = unknown> = z4.infer<typeof InputSchema> & {
|
|
25
|
-
results?: T;
|
|
26
|
-
};
|
|
27
|
-
export type Output<T = unknown> = BaseResponse<T>;
|
|
28
|
-
const FileResponseParamsSchema: z4.ZodObject<{
|
|
29
|
-
status: z4.ZodUnion<readonly [z4.ZodLiteral<200>, z4.ZodLiteral<201>, z4.ZodLiteral<202>, z4.ZodLiteral<204>, z4.ZodLiteral<400>, z4.ZodLiteral<401>, z4.ZodLiteral<403>, z4.ZodLiteral<404>, z4.ZodLiteral<409>, z4.ZodLiteral<422>, z4.ZodLiteral<500>, z4.ZodLiteral<428>, z4.ZodLiteral<405>]>;
|
|
30
|
-
message: z4.ZodOptional<z4.ZodString>;
|
|
31
|
-
file_buffer: z4.ZodUnion<readonly [z4.ZodCustom<Blob, Blob>, z4.ZodCustom<ArrayBuffer, ArrayBuffer>, z4.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
32
|
-
content_type: z4.ZodString;
|
|
33
|
-
filename: z4.ZodOptional<z4.ZodString>;
|
|
34
|
-
c: z4.ZodOptional<z4.ZodCustom<Context<any, any, {}>, Context<any, any, {}>>>;
|
|
35
|
-
}, z4.core.$strip>;
|
|
36
|
-
export type FileResponseParams = z4.infer<typeof FileResponseParamsSchema>;
|
|
37
|
-
export {};
|
|
38
|
-
}
|
|
39
|
-
export namespace Error {
|
|
40
|
-
const InputSchema: z4.ZodObject<{
|
|
41
|
-
message: z4.ZodOptional<z4.ZodString>;
|
|
42
|
-
results: z4.ZodOptional<z4.ZodUnion<readonly [z4.ZodArray<z4.ZodUnknown>, z4.ZodUnknown]>>;
|
|
43
|
-
type: z4.ZodDefault<z4.ZodOptional<z4.ZodDefault<z4.ZodUnion<readonly [z4.ZodLiteral<"success">, z4.ZodLiteral<"warning">, z4.ZodLiteral<"error">]>>>>;
|
|
44
|
-
code: z4.ZodUnion<readonly [z4.ZodLiteral<"SUCCESS">, z4.ZodLiteral<"ACTION_REQUIRED">, z4.ZodLiteral<"CREATED">, z4.ZodLiteral<"WARNING">, z4.ZodLiteral<"AUTHORIZATION_ERROR">, z4.ZodLiteral<"SCHEMA_VALIDATION">, z4.ZodLiteral<"SERVER_ERROR">, z4.ZodLiteral<"UNAUTHORIZED">, z4.ZodLiteral<"INVALID_TOKEN">, z4.ZodLiteral<"NOT_FOUND">, z4.ZodLiteral<"SUCCESS_FILE">, z4.ZodLiteral<"DATABASE_ERROR">]>;
|
|
45
|
-
status: z4.ZodDefault<z4.ZodOptional<z4.ZodNumber>>;
|
|
46
|
-
}, z4.core.$strip>;
|
|
47
|
-
type Input<T = unknown> = z4.infer<typeof InputSchema> & {
|
|
48
|
-
results?: T;
|
|
49
|
-
};
|
|
50
|
-
type Output<T = unknown> = BaseResponse<T>;
|
|
51
|
-
}
|
|
52
|
-
export {};
|
|
53
|
-
}
|
|
54
|
-
export default TypeControllerResponse;
|