@cristian-israel/giganet_lib_conecta 1.0.90 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +36 -30
- package/dist/index.d.ts +36 -30
- package/dist/index.js +52 -7
- package/dist/index.mjs +52 -7
- package/package.json +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -37474,6 +37474,7 @@ declare const schemas$4: {
|
|
|
37474
37474
|
id_ixc_soft: number;
|
|
37475
37475
|
is_admin: boolean;
|
|
37476
37476
|
permissions: string[];
|
|
37477
|
+
permissions_socket: string[];
|
|
37477
37478
|
permissions_front: string[];
|
|
37478
37479
|
} & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
|
|
37479
37480
|
email: string;
|
|
@@ -37483,6 +37484,7 @@ declare const schemas$4: {
|
|
|
37483
37484
|
id_ixc_soft: number;
|
|
37484
37485
|
is_admin: boolean;
|
|
37485
37486
|
permissions: string[];
|
|
37487
|
+
permissions_socket: string[];
|
|
37486
37488
|
permissions_front: string[];
|
|
37487
37489
|
} & mongoose.DefaultTimestampProps, {
|
|
37488
37490
|
id: string;
|
|
@@ -37496,6 +37498,7 @@ declare const schemas$4: {
|
|
|
37496
37498
|
id_ixc_soft: number;
|
|
37497
37499
|
is_admin: boolean;
|
|
37498
37500
|
permissions: string[];
|
|
37501
|
+
permissions_socket: string[];
|
|
37499
37502
|
permissions_front: string[];
|
|
37500
37503
|
} & mongoose.DefaultTimestampProps & {
|
|
37501
37504
|
_id: mongoose.Types.ObjectId;
|
|
@@ -37511,6 +37514,7 @@ declare const schemas$4: {
|
|
|
37511
37514
|
id_ixc_soft: number;
|
|
37512
37515
|
is_admin: boolean;
|
|
37513
37516
|
permissions: string[];
|
|
37517
|
+
permissions_socket: string[];
|
|
37514
37518
|
permissions_front: string[];
|
|
37515
37519
|
createdAt: NativeDate;
|
|
37516
37520
|
updatedAt: NativeDate;
|
|
@@ -38310,40 +38314,42 @@ declare class GigacenterMongoService {
|
|
|
38310
38314
|
getCollection<K extends keyof GigacenterMongoCollectionsModels>(key: K): GigacenterMongoCollectionsModels[K];
|
|
38311
38315
|
}
|
|
38312
38316
|
|
|
38313
|
-
|
|
38314
|
-
|
|
38315
|
-
|
|
38316
|
-
|
|
38317
|
-
|
|
38318
|
-
|
|
38319
|
-
|
|
38320
|
-
|
|
38321
|
-
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
|
|
38325
|
-
|
|
38326
|
-
|
|
38327
|
-
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38317
|
+
declare const MonitoringPonsSnapshotSchema: z.ZodObject<{
|
|
38318
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
38319
|
+
id: z.ZodNumber;
|
|
38320
|
+
interface: z.ZodString;
|
|
38321
|
+
transmissor: z.ZodString;
|
|
38322
|
+
slot: z.ZodNumber;
|
|
38323
|
+
numero: z.ZodNumber;
|
|
38324
|
+
vlan: z.ZodString;
|
|
38325
|
+
onus_vinculadas: z.ZodNumber;
|
|
38326
|
+
onus_autorizadas: z.ZodNumber;
|
|
38327
|
+
sinal_alto: z.ZodNumber;
|
|
38328
|
+
os_pendentes: z.ZodNumber;
|
|
38329
|
+
os_recolha: z.ZodNumber;
|
|
38330
|
+
rompimentos: z.ZodNumber;
|
|
38331
|
+
offlines_menos_3_meses: z.ZodNumber;
|
|
38332
|
+
}, z.core.$strict>>;
|
|
38333
|
+
updatedAt: z.ZodString;
|
|
38334
|
+
updatedAtStatic: z.ZodOptional<z.ZodString>;
|
|
38335
|
+
}, z.core.$strict>;
|
|
38336
|
+
declare const MonitoringPonsUpdateMetaSchema: z.ZodObject<{
|
|
38337
|
+
updatedAt: z.ZodString;
|
|
38338
|
+
}, z.core.$strict>;
|
|
38339
|
+
type MonitoringPonsSnapshot = z.infer<typeof MonitoringPonsSnapshotSchema>;
|
|
38340
|
+
type MonitoringPonsUpdateMeta = z.infer<typeof MonitoringPonsUpdateMetaSchema>;
|
|
38341
|
+
|
|
38336
38342
|
type PonsStore = {
|
|
38337
|
-
getSnapshot(): Promise<
|
|
38338
|
-
setSnapshot(snapshot:
|
|
38339
|
-
publishUpdate(meta:
|
|
38340
|
-
subscribe(onUpdate: (meta:
|
|
38343
|
+
getSnapshot(): Promise<MonitoringPonsSnapshot | null>;
|
|
38344
|
+
setSnapshot(snapshot: MonitoringPonsSnapshot): Promise<void>;
|
|
38345
|
+
publishUpdate(meta: MonitoringPonsUpdateMeta): Promise<void>;
|
|
38346
|
+
subscribe(onUpdate: (meta: MonitoringPonsUpdateMeta) => void): () => void;
|
|
38341
38347
|
};
|
|
38342
38348
|
|
|
38343
|
-
declare function
|
|
38349
|
+
declare function createMonitoringPonsStore(client: Redis__default, basePrefix: string): PonsStore;
|
|
38344
38350
|
|
|
38345
38351
|
declare const storeFactories: {
|
|
38346
|
-
readonly
|
|
38352
|
+
readonly monitoring_pons: typeof createMonitoringPonsStore;
|
|
38347
38353
|
};
|
|
38348
38354
|
|
|
38349
38355
|
type RoutinesRedisStores = {
|
|
@@ -38374,4 +38380,4 @@ declare class RoutinesRedisService {
|
|
|
38374
38380
|
getStore<K extends keyof RoutinesRedisStores>(key: K): RoutinesRedisStores[K];
|
|
38375
38381
|
}
|
|
38376
38382
|
|
|
38377
|
-
export { type ExpensesFleetMongoCollectionsModels, type ExpensesFleetMongoDocuments, ExpensesFleetMongoService, GeminiLIBClient, geminiLib_types as GeminiLIBTypes, type GigacenterMongoCollectionsModels, type GigacenterMongoDocuments, GigacenterMongoService, IXCSoftAPIClient, ixcSoftApi_types as IXCSoftAPITypes, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, type MCPGiganetMongoCollectionsModels, type MCPGiganetMongoDocuments, MCPGiganetMongoService, NtfyAPIClient, ntfyApi_types as NtfyAPITypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService,
|
|
38383
|
+
export { type ExpensesFleetMongoCollectionsModels, type ExpensesFleetMongoDocuments, ExpensesFleetMongoService, GeminiLIBClient, geminiLib_types as GeminiLIBTypes, type GigacenterMongoCollectionsModels, type GigacenterMongoDocuments, GigacenterMongoService, IXCSoftAPIClient, ixcSoftApi_types as IXCSoftAPITypes, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, type MCPGiganetMongoCollectionsModels, type MCPGiganetMongoDocuments, MCPGiganetMongoService, NtfyAPIClient, ntfyApi_types as NtfyAPITypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService, RoutinesAPIClient, routinesApi_types as RoutinesAPITypes, type RoutinesMongoCollectionsModels, type RoutinesMongoDocuments, RoutinesMongoService, type RoutinesMysqlModels, type RoutinesMysqlModelsAttributes, RoutinesMysqlService, RoutinesRedisService, type RoutinesRedisStores, type ToolsMongoCollectionsModels, type ToolsMongoDocuments, ToolsMongoService, loger, printSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -37474,6 +37474,7 @@ declare const schemas$4: {
|
|
|
37474
37474
|
id_ixc_soft: number;
|
|
37475
37475
|
is_admin: boolean;
|
|
37476
37476
|
permissions: string[];
|
|
37477
|
+
permissions_socket: string[];
|
|
37477
37478
|
permissions_front: string[];
|
|
37478
37479
|
} & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
|
|
37479
37480
|
email: string;
|
|
@@ -37483,6 +37484,7 @@ declare const schemas$4: {
|
|
|
37483
37484
|
id_ixc_soft: number;
|
|
37484
37485
|
is_admin: boolean;
|
|
37485
37486
|
permissions: string[];
|
|
37487
|
+
permissions_socket: string[];
|
|
37486
37488
|
permissions_front: string[];
|
|
37487
37489
|
} & mongoose.DefaultTimestampProps, {
|
|
37488
37490
|
id: string;
|
|
@@ -37496,6 +37498,7 @@ declare const schemas$4: {
|
|
|
37496
37498
|
id_ixc_soft: number;
|
|
37497
37499
|
is_admin: boolean;
|
|
37498
37500
|
permissions: string[];
|
|
37501
|
+
permissions_socket: string[];
|
|
37499
37502
|
permissions_front: string[];
|
|
37500
37503
|
} & mongoose.DefaultTimestampProps & {
|
|
37501
37504
|
_id: mongoose.Types.ObjectId;
|
|
@@ -37511,6 +37514,7 @@ declare const schemas$4: {
|
|
|
37511
37514
|
id_ixc_soft: number;
|
|
37512
37515
|
is_admin: boolean;
|
|
37513
37516
|
permissions: string[];
|
|
37517
|
+
permissions_socket: string[];
|
|
37514
37518
|
permissions_front: string[];
|
|
37515
37519
|
createdAt: NativeDate;
|
|
37516
37520
|
updatedAt: NativeDate;
|
|
@@ -38310,40 +38314,42 @@ declare class GigacenterMongoService {
|
|
|
38310
38314
|
getCollection<K extends keyof GigacenterMongoCollectionsModels>(key: K): GigacenterMongoCollectionsModels[K];
|
|
38311
38315
|
}
|
|
38312
38316
|
|
|
38313
|
-
|
|
38314
|
-
|
|
38315
|
-
|
|
38316
|
-
|
|
38317
|
-
|
|
38318
|
-
|
|
38319
|
-
|
|
38320
|
-
|
|
38321
|
-
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
|
|
38325
|
-
|
|
38326
|
-
|
|
38327
|
-
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38317
|
+
declare const MonitoringPonsSnapshotSchema: z.ZodObject<{
|
|
38318
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
38319
|
+
id: z.ZodNumber;
|
|
38320
|
+
interface: z.ZodString;
|
|
38321
|
+
transmissor: z.ZodString;
|
|
38322
|
+
slot: z.ZodNumber;
|
|
38323
|
+
numero: z.ZodNumber;
|
|
38324
|
+
vlan: z.ZodString;
|
|
38325
|
+
onus_vinculadas: z.ZodNumber;
|
|
38326
|
+
onus_autorizadas: z.ZodNumber;
|
|
38327
|
+
sinal_alto: z.ZodNumber;
|
|
38328
|
+
os_pendentes: z.ZodNumber;
|
|
38329
|
+
os_recolha: z.ZodNumber;
|
|
38330
|
+
rompimentos: z.ZodNumber;
|
|
38331
|
+
offlines_menos_3_meses: z.ZodNumber;
|
|
38332
|
+
}, z.core.$strict>>;
|
|
38333
|
+
updatedAt: z.ZodString;
|
|
38334
|
+
updatedAtStatic: z.ZodOptional<z.ZodString>;
|
|
38335
|
+
}, z.core.$strict>;
|
|
38336
|
+
declare const MonitoringPonsUpdateMetaSchema: z.ZodObject<{
|
|
38337
|
+
updatedAt: z.ZodString;
|
|
38338
|
+
}, z.core.$strict>;
|
|
38339
|
+
type MonitoringPonsSnapshot = z.infer<typeof MonitoringPonsSnapshotSchema>;
|
|
38340
|
+
type MonitoringPonsUpdateMeta = z.infer<typeof MonitoringPonsUpdateMetaSchema>;
|
|
38341
|
+
|
|
38336
38342
|
type PonsStore = {
|
|
38337
|
-
getSnapshot(): Promise<
|
|
38338
|
-
setSnapshot(snapshot:
|
|
38339
|
-
publishUpdate(meta:
|
|
38340
|
-
subscribe(onUpdate: (meta:
|
|
38343
|
+
getSnapshot(): Promise<MonitoringPonsSnapshot | null>;
|
|
38344
|
+
setSnapshot(snapshot: MonitoringPonsSnapshot): Promise<void>;
|
|
38345
|
+
publishUpdate(meta: MonitoringPonsUpdateMeta): Promise<void>;
|
|
38346
|
+
subscribe(onUpdate: (meta: MonitoringPonsUpdateMeta) => void): () => void;
|
|
38341
38347
|
};
|
|
38342
38348
|
|
|
38343
|
-
declare function
|
|
38349
|
+
declare function createMonitoringPonsStore(client: Redis__default, basePrefix: string): PonsStore;
|
|
38344
38350
|
|
|
38345
38351
|
declare const storeFactories: {
|
|
38346
|
-
readonly
|
|
38352
|
+
readonly monitoring_pons: typeof createMonitoringPonsStore;
|
|
38347
38353
|
};
|
|
38348
38354
|
|
|
38349
38355
|
type RoutinesRedisStores = {
|
|
@@ -38374,4 +38380,4 @@ declare class RoutinesRedisService {
|
|
|
38374
38380
|
getStore<K extends keyof RoutinesRedisStores>(key: K): RoutinesRedisStores[K];
|
|
38375
38381
|
}
|
|
38376
38382
|
|
|
38377
|
-
export { type ExpensesFleetMongoCollectionsModels, type ExpensesFleetMongoDocuments, ExpensesFleetMongoService, GeminiLIBClient, geminiLib_types as GeminiLIBTypes, type GigacenterMongoCollectionsModels, type GigacenterMongoDocuments, GigacenterMongoService, IXCSoftAPIClient, ixcSoftApi_types as IXCSoftAPITypes, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, type MCPGiganetMongoCollectionsModels, type MCPGiganetMongoDocuments, MCPGiganetMongoService, NtfyAPIClient, ntfyApi_types as NtfyAPITypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService,
|
|
38383
|
+
export { type ExpensesFleetMongoCollectionsModels, type ExpensesFleetMongoDocuments, ExpensesFleetMongoService, GeminiLIBClient, geminiLib_types as GeminiLIBTypes, type GigacenterMongoCollectionsModels, type GigacenterMongoDocuments, GigacenterMongoService, IXCSoftAPIClient, ixcSoftApi_types as IXCSoftAPITypes, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, type MCPGiganetMongoCollectionsModels, type MCPGiganetMongoDocuments, MCPGiganetMongoService, NtfyAPIClient, ntfyApi_types as NtfyAPITypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService, RoutinesAPIClient, routinesApi_types as RoutinesAPITypes, type RoutinesMongoCollectionsModels, type RoutinesMongoDocuments, RoutinesMongoService, type RoutinesMysqlModels, type RoutinesMysqlModelsAttributes, RoutinesMysqlService, RoutinesRedisService, type RoutinesRedisStores, type ToolsMongoCollectionsModels, type ToolsMongoDocuments, ToolsMongoService, loger, printSignature };
|
package/dist/index.js
CHANGED
|
@@ -92157,6 +92157,11 @@ var ToolsUserSchema = new import_mongoose7.Schema(
|
|
|
92157
92157
|
required: true,
|
|
92158
92158
|
default: []
|
|
92159
92159
|
},
|
|
92160
|
+
permissions_socket: {
|
|
92161
|
+
type: [String],
|
|
92162
|
+
required: true,
|
|
92163
|
+
default: []
|
|
92164
|
+
},
|
|
92160
92165
|
permissions_front: {
|
|
92161
92166
|
type: [String],
|
|
92162
92167
|
required: true,
|
|
@@ -92890,10 +92895,36 @@ var configRoutinesRedis = {
|
|
|
92890
92895
|
domain: "REDIS"
|
|
92891
92896
|
};
|
|
92892
92897
|
|
|
92893
|
-
// src/databases/redis/routines/stores/pons/pons.ts
|
|
92898
|
+
// src/databases/redis/routines/stores/monitoring-pons/monitoring-pons.schemas.ts
|
|
92899
|
+
var import_zod4 = require("zod");
|
|
92900
|
+
var MonitoringPonsRowSchema = import_zod4.z.object({
|
|
92901
|
+
id: import_zod4.z.number(),
|
|
92902
|
+
interface: import_zod4.z.string(),
|
|
92903
|
+
transmissor: import_zod4.z.string(),
|
|
92904
|
+
slot: import_zod4.z.number(),
|
|
92905
|
+
numero: import_zod4.z.number(),
|
|
92906
|
+
vlan: import_zod4.z.string(),
|
|
92907
|
+
onus_vinculadas: import_zod4.z.number(),
|
|
92908
|
+
onus_autorizadas: import_zod4.z.number(),
|
|
92909
|
+
sinal_alto: import_zod4.z.number(),
|
|
92910
|
+
os_pendentes: import_zod4.z.number(),
|
|
92911
|
+
os_recolha: import_zod4.z.number(),
|
|
92912
|
+
rompimentos: import_zod4.z.number(),
|
|
92913
|
+
offlines_menos_3_meses: import_zod4.z.number()
|
|
92914
|
+
}).strict();
|
|
92915
|
+
var MonitoringPonsSnapshotSchema = import_zod4.z.object({
|
|
92916
|
+
rows: import_zod4.z.array(MonitoringPonsRowSchema),
|
|
92917
|
+
updatedAt: import_zod4.z.string(),
|
|
92918
|
+
updatedAtStatic: import_zod4.z.string().optional()
|
|
92919
|
+
}).strict();
|
|
92920
|
+
var MonitoringPonsUpdateMetaSchema = import_zod4.z.object({
|
|
92921
|
+
updatedAt: import_zod4.z.string()
|
|
92922
|
+
}).strict();
|
|
92923
|
+
|
|
92924
|
+
// src/databases/redis/routines/stores/monitoring-pons/monitoring-pons.ts
|
|
92894
92925
|
var SNAPSHOT_KEY = "snapshot";
|
|
92895
92926
|
var UPDATES_CHANNEL = "updates";
|
|
92896
|
-
function
|
|
92927
|
+
function createMonitoringPonsStore(client, basePrefix) {
|
|
92897
92928
|
const prefix = `${basePrefix}pons:`;
|
|
92898
92929
|
const snapshotKey = `${prefix}${SNAPSHOT_KEY}`;
|
|
92899
92930
|
const updatesChannel = `${client.options.keyPrefix ?? ""}${prefix}${UPDATES_CHANNEL}`;
|
|
@@ -92901,20 +92932,34 @@ function createPonsStore(client, basePrefix) {
|
|
|
92901
92932
|
async getSnapshot() {
|
|
92902
92933
|
const value = await client.get(snapshotKey);
|
|
92903
92934
|
if (value === null) return null;
|
|
92904
|
-
return JSON.parse(value);
|
|
92935
|
+
return MonitoringPonsSnapshotSchema.parse(JSON.parse(value));
|
|
92905
92936
|
},
|
|
92906
92937
|
async setSnapshot(snapshot) {
|
|
92907
|
-
|
|
92938
|
+
const validated = MonitoringPonsSnapshotSchema.parse(snapshot);
|
|
92939
|
+
await client.set(snapshotKey, JSON.stringify(validated));
|
|
92908
92940
|
},
|
|
92909
92941
|
async publishUpdate(meta) {
|
|
92910
|
-
|
|
92942
|
+
const validated = MonitoringPonsUpdateMetaSchema.parse(meta);
|
|
92943
|
+
await client.publish(updatesChannel, JSON.stringify(validated));
|
|
92911
92944
|
},
|
|
92912
92945
|
subscribe(onUpdate) {
|
|
92913
92946
|
const subscriber = client.duplicate();
|
|
92914
92947
|
subscriber.subscribe(updatesChannel);
|
|
92915
92948
|
subscriber.on("message", (channel, message) => {
|
|
92916
92949
|
if (channel !== updatesChannel) return;
|
|
92917
|
-
|
|
92950
|
+
const parsed = MonitoringPonsUpdateMetaSchema.safeParse(
|
|
92951
|
+
JSON.parse(message)
|
|
92952
|
+
);
|
|
92953
|
+
if (!parsed.success) {
|
|
92954
|
+
loger({
|
|
92955
|
+
level: "WARN",
|
|
92956
|
+
context: "PonsStore",
|
|
92957
|
+
domain: "REDIS",
|
|
92958
|
+
message: `Ignoring invalid pons update message: ${parsed.error.message}`
|
|
92959
|
+
});
|
|
92960
|
+
return;
|
|
92961
|
+
}
|
|
92962
|
+
onUpdate(parsed.data);
|
|
92918
92963
|
});
|
|
92919
92964
|
return () => {
|
|
92920
92965
|
subscriber.unsubscribe(updatesChannel);
|
|
@@ -92926,7 +92971,7 @@ function createPonsStore(client, basePrefix) {
|
|
|
92926
92971
|
|
|
92927
92972
|
// src/databases/redis/routines/stores/index.ts
|
|
92928
92973
|
var storeFactories = {
|
|
92929
|
-
|
|
92974
|
+
monitoring_pons: createMonitoringPonsStore
|
|
92930
92975
|
};
|
|
92931
92976
|
|
|
92932
92977
|
// src/databases/redis/routines/routines.redis.connection.ts
|
package/dist/index.mjs
CHANGED
|
@@ -92109,6 +92109,11 @@ var ToolsUserSchema = new Schema6(
|
|
|
92109
92109
|
required: true,
|
|
92110
92110
|
default: []
|
|
92111
92111
|
},
|
|
92112
|
+
permissions_socket: {
|
|
92113
|
+
type: [String],
|
|
92114
|
+
required: true,
|
|
92115
|
+
default: []
|
|
92116
|
+
},
|
|
92112
92117
|
permissions_front: {
|
|
92113
92118
|
type: [String],
|
|
92114
92119
|
required: true,
|
|
@@ -92842,10 +92847,36 @@ var configRoutinesRedis = {
|
|
|
92842
92847
|
domain: "REDIS"
|
|
92843
92848
|
};
|
|
92844
92849
|
|
|
92845
|
-
// src/databases/redis/routines/stores/pons/pons.ts
|
|
92850
|
+
// src/databases/redis/routines/stores/monitoring-pons/monitoring-pons.schemas.ts
|
|
92851
|
+
import { z as z4 } from "zod";
|
|
92852
|
+
var MonitoringPonsRowSchema = z4.object({
|
|
92853
|
+
id: z4.number(),
|
|
92854
|
+
interface: z4.string(),
|
|
92855
|
+
transmissor: z4.string(),
|
|
92856
|
+
slot: z4.number(),
|
|
92857
|
+
numero: z4.number(),
|
|
92858
|
+
vlan: z4.string(),
|
|
92859
|
+
onus_vinculadas: z4.number(),
|
|
92860
|
+
onus_autorizadas: z4.number(),
|
|
92861
|
+
sinal_alto: z4.number(),
|
|
92862
|
+
os_pendentes: z4.number(),
|
|
92863
|
+
os_recolha: z4.number(),
|
|
92864
|
+
rompimentos: z4.number(),
|
|
92865
|
+
offlines_menos_3_meses: z4.number()
|
|
92866
|
+
}).strict();
|
|
92867
|
+
var MonitoringPonsSnapshotSchema = z4.object({
|
|
92868
|
+
rows: z4.array(MonitoringPonsRowSchema),
|
|
92869
|
+
updatedAt: z4.string(),
|
|
92870
|
+
updatedAtStatic: z4.string().optional()
|
|
92871
|
+
}).strict();
|
|
92872
|
+
var MonitoringPonsUpdateMetaSchema = z4.object({
|
|
92873
|
+
updatedAt: z4.string()
|
|
92874
|
+
}).strict();
|
|
92875
|
+
|
|
92876
|
+
// src/databases/redis/routines/stores/monitoring-pons/monitoring-pons.ts
|
|
92846
92877
|
var SNAPSHOT_KEY = "snapshot";
|
|
92847
92878
|
var UPDATES_CHANNEL = "updates";
|
|
92848
|
-
function
|
|
92879
|
+
function createMonitoringPonsStore(client, basePrefix) {
|
|
92849
92880
|
const prefix = `${basePrefix}pons:`;
|
|
92850
92881
|
const snapshotKey = `${prefix}${SNAPSHOT_KEY}`;
|
|
92851
92882
|
const updatesChannel = `${client.options.keyPrefix ?? ""}${prefix}${UPDATES_CHANNEL}`;
|
|
@@ -92853,20 +92884,34 @@ function createPonsStore(client, basePrefix) {
|
|
|
92853
92884
|
async getSnapshot() {
|
|
92854
92885
|
const value = await client.get(snapshotKey);
|
|
92855
92886
|
if (value === null) return null;
|
|
92856
|
-
return JSON.parse(value);
|
|
92887
|
+
return MonitoringPonsSnapshotSchema.parse(JSON.parse(value));
|
|
92857
92888
|
},
|
|
92858
92889
|
async setSnapshot(snapshot) {
|
|
92859
|
-
|
|
92890
|
+
const validated = MonitoringPonsSnapshotSchema.parse(snapshot);
|
|
92891
|
+
await client.set(snapshotKey, JSON.stringify(validated));
|
|
92860
92892
|
},
|
|
92861
92893
|
async publishUpdate(meta) {
|
|
92862
|
-
|
|
92894
|
+
const validated = MonitoringPonsUpdateMetaSchema.parse(meta);
|
|
92895
|
+
await client.publish(updatesChannel, JSON.stringify(validated));
|
|
92863
92896
|
},
|
|
92864
92897
|
subscribe(onUpdate) {
|
|
92865
92898
|
const subscriber = client.duplicate();
|
|
92866
92899
|
subscriber.subscribe(updatesChannel);
|
|
92867
92900
|
subscriber.on("message", (channel, message) => {
|
|
92868
92901
|
if (channel !== updatesChannel) return;
|
|
92869
|
-
|
|
92902
|
+
const parsed = MonitoringPonsUpdateMetaSchema.safeParse(
|
|
92903
|
+
JSON.parse(message)
|
|
92904
|
+
);
|
|
92905
|
+
if (!parsed.success) {
|
|
92906
|
+
loger({
|
|
92907
|
+
level: "WARN",
|
|
92908
|
+
context: "PonsStore",
|
|
92909
|
+
domain: "REDIS",
|
|
92910
|
+
message: `Ignoring invalid pons update message: ${parsed.error.message}`
|
|
92911
|
+
});
|
|
92912
|
+
return;
|
|
92913
|
+
}
|
|
92914
|
+
onUpdate(parsed.data);
|
|
92870
92915
|
});
|
|
92871
92916
|
return () => {
|
|
92872
92917
|
subscriber.unsubscribe(updatesChannel);
|
|
@@ -92878,7 +92923,7 @@ function createPonsStore(client, basePrefix) {
|
|
|
92878
92923
|
|
|
92879
92924
|
// src/databases/redis/routines/stores/index.ts
|
|
92880
92925
|
var storeFactories = {
|
|
92881
|
-
|
|
92926
|
+
monitoring_pons: createMonitoringPonsStore
|
|
92882
92927
|
};
|
|
92883
92928
|
|
|
92884
92929
|
// src/databases/redis/routines/routines.redis.connection.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cristian-israel/giganet_lib_conecta",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.92",
|
|
4
4
|
"description": "Database Connector Layer",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean --external mongoose,sequelize,mysql2,ioredis,zod",
|
|
13
13
|
"release": "npm version patch && npm publish && npm view @cristian-israel/giganet_lib_conecta",
|
|
14
14
|
"br": "pnpm run build && pnpm run release",
|
|
15
|
+
"test": "vitest run",
|
|
15
16
|
"type-check": "tsc --noEmit > type-check.log 2>&1",
|
|
16
17
|
"dev": "tsup src/index.ts --watch"
|
|
17
18
|
},
|
|
@@ -43,11 +44,13 @@
|
|
|
43
44
|
"homepage": "https://github.com/cristian-israel/giganet_lib_conecta#readme",
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@types/node": "^25.6.0",
|
|
47
|
+
"ioredis-mock": "^8.9.0",
|
|
46
48
|
"ioredis": "^5.4.0",
|
|
47
49
|
"mongoose": "^9.4.1",
|
|
48
50
|
"sequelize-auto": "^0.8.8",
|
|
49
51
|
"tsup": "^8.5.1",
|
|
50
52
|
"typescript": "^6.0.2",
|
|
53
|
+
"vitest": "^3.2.4",
|
|
51
54
|
"zod": "^4.3.6"
|
|
52
55
|
},
|
|
53
56
|
"peerDependencies": {
|