@cristian-israel/giganet_lib_conecta 1.0.32 → 1.0.34

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional, Sequelize as Sequelize$1, Attributes } from 'sequelize';
3
3
  import * as mongoose from 'mongoose';
4
- import { Model as Model$1, InferSchemaType } from 'mongoose';
4
+ import { Model as Model$1, InferSchemaType, HydratedDocument } from 'mongoose';
5
5
  import * as bson from 'bson';
6
6
  import { AxiosRequestConfig, AxiosInstance } from 'axios';
7
7
 
@@ -35812,7 +35812,7 @@ declare class IXCSoftMysqlService {
35812
35812
  }[K];
35813
35813
  }
35814
35814
 
35815
- declare const schemas$1: {
35815
+ declare const schemas$2: {
35816
35816
  tags: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
35817
35817
  cor: string;
35818
35818
  nome: string;
@@ -36315,10 +36315,10 @@ declare const schemas$1: {
36315
36315
  };
36316
36316
 
36317
36317
  type OPASuiteMongoDocuments = {
36318
- [K in keyof typeof schemas$1]: InferSchemaType<(typeof schemas$1)[K]>;
36318
+ [K in keyof typeof schemas$2]: InferSchemaType<(typeof schemas$2)[K]>;
36319
36319
  };
36320
36320
  type OPASuiteMongoCollectionsModels = {
36321
- [K in keyof typeof schemas$1]: Model$1<InferSchemaType<(typeof schemas$1)[K]>>;
36321
+ [K in keyof typeof schemas$2]: Model$1<InferSchemaType<(typeof schemas$2)[K]>>;
36322
36322
  };
36323
36323
 
36324
36324
  type MongoConnectionConfig = {
@@ -36347,7 +36347,7 @@ declare class OPASuiteMongoService {
36347
36347
  getCollection<K extends keyof OPASuiteMongoCollectionsModels>(key: K): OPASuiteMongoCollectionsModels[K];
36348
36348
  }
36349
36349
 
36350
- declare const schemas: {
36350
+ declare const schemas$1: {
36351
36351
  user: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
36352
36352
  timestamps: true;
36353
36353
  }, {
@@ -36457,10 +36457,10 @@ declare const schemas: {
36457
36457
  };
36458
36458
 
36459
36459
  type ToolsMongoDocuments = {
36460
- [K in keyof typeof schemas]: InferSchemaType<(typeof schemas)[K]>;
36460
+ [K in keyof typeof schemas$1]: InferSchemaType<(typeof schemas$1)[K]>;
36461
36461
  };
36462
36462
  type ToolsMongoCollectionsModels = {
36463
- [K in keyof typeof schemas]: Model$1<InferSchemaType<(typeof schemas)[K]>>;
36463
+ [K in keyof typeof schemas$1]: Model$1<InferSchemaType<(typeof schemas$1)[K]>>;
36464
36464
  };
36465
36465
 
36466
36466
  declare class ToolsMongoService {
@@ -36481,6 +36481,148 @@ declare class ToolsMongoService {
36481
36481
  getCollection<K extends keyof ToolsMongoCollectionsModels>(key: K): ToolsMongoCollectionsModels[K];
36482
36482
  }
36483
36483
 
36484
+ declare const schemas: {
36485
+ tasks: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
36486
+ timestamps: true;
36487
+ }, {
36488
+ status: "running" | "stopped" | "waiting";
36489
+ name: string;
36490
+ is_active: boolean;
36491
+ execution_count: number;
36492
+ description?: string | null | undefined;
36493
+ status_last_execution?: "success" | "error" | null | undefined;
36494
+ last_execution_at?: NativeDate | null | undefined;
36495
+ next_execution_at?: NativeDate | null | undefined;
36496
+ cron_expression?: string | null | undefined;
36497
+ last_execution_time_ms?: number | null | undefined;
36498
+ } & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
36499
+ status: "running" | "stopped" | "waiting";
36500
+ name: string;
36501
+ is_active: boolean;
36502
+ execution_count: number;
36503
+ description?: string | null | undefined;
36504
+ status_last_execution?: "success" | "error" | null | undefined;
36505
+ last_execution_at?: NativeDate | null | undefined;
36506
+ next_execution_at?: NativeDate | null | undefined;
36507
+ cron_expression?: string | null | undefined;
36508
+ last_execution_time_ms?: number | null | undefined;
36509
+ } & mongoose.DefaultTimestampProps, {
36510
+ id: string;
36511
+ }, Omit<mongoose.DefaultSchemaOptions, "timestamps"> & {
36512
+ timestamps: true;
36513
+ }> & Omit<{
36514
+ status: "running" | "stopped" | "waiting";
36515
+ name: string;
36516
+ is_active: boolean;
36517
+ execution_count: number;
36518
+ description?: string | null | undefined;
36519
+ status_last_execution?: "success" | "error" | null | undefined;
36520
+ last_execution_at?: NativeDate | null | undefined;
36521
+ next_execution_at?: NativeDate | null | undefined;
36522
+ cron_expression?: string | null | undefined;
36523
+ last_execution_time_ms?: number | null | undefined;
36524
+ } & mongoose.DefaultTimestampProps & {
36525
+ _id: mongoose.Types.ObjectId;
36526
+ } & {
36527
+ __v: number;
36528
+ }, "id"> & {
36529
+ id: string;
36530
+ }, unknown, {
36531
+ status: "running" | "stopped" | "waiting";
36532
+ name: string;
36533
+ is_active: boolean;
36534
+ execution_count: number;
36535
+ description?: string | null | undefined;
36536
+ status_last_execution?: "success" | "error" | null | undefined;
36537
+ last_execution_at?: NativeDate | null | undefined;
36538
+ next_execution_at?: NativeDate | null | undefined;
36539
+ cron_expression?: string | null | undefined;
36540
+ last_execution_time_ms?: number | null | undefined;
36541
+ createdAt: NativeDate;
36542
+ updatedAt: NativeDate;
36543
+ } & {
36544
+ _id: mongoose.Types.ObjectId;
36545
+ } & {
36546
+ __v: number;
36547
+ }>;
36548
+ loger: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
36549
+ timestamps: true;
36550
+ }, {
36551
+ status: "success" | "error" | "info" | "warning";
36552
+ description: string;
36553
+ action: string;
36554
+ task: mongoose.Types.ObjectId;
36555
+ executionTimeMs?: number | null | undefined;
36556
+ metadata?: any;
36557
+ triggered_by?: string | null | undefined;
36558
+ } & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
36559
+ status: "success" | "error" | "info" | "warning";
36560
+ description: string;
36561
+ action: string;
36562
+ task: mongoose.Types.ObjectId;
36563
+ executionTimeMs?: number | null | undefined;
36564
+ metadata?: any;
36565
+ triggered_by?: string | null | undefined;
36566
+ } & mongoose.DefaultTimestampProps, {
36567
+ id: string;
36568
+ }, Omit<mongoose.DefaultSchemaOptions, "timestamps"> & {
36569
+ timestamps: true;
36570
+ }> & Omit<{
36571
+ status: "success" | "error" | "info" | "warning";
36572
+ description: string;
36573
+ action: string;
36574
+ task: mongoose.Types.ObjectId;
36575
+ executionTimeMs?: number | null | undefined;
36576
+ metadata?: any;
36577
+ triggered_by?: string | null | undefined;
36578
+ } & mongoose.DefaultTimestampProps & {
36579
+ _id: mongoose.Types.ObjectId;
36580
+ } & {
36581
+ __v: number;
36582
+ }, "id"> & {
36583
+ id: string;
36584
+ }, unknown, {
36585
+ status: "success" | "error" | "info" | "warning";
36586
+ description: string;
36587
+ action: string;
36588
+ task: mongoose.Types.ObjectId;
36589
+ executionTimeMs?: number | null | undefined;
36590
+ metadata?: any;
36591
+ triggered_by?: string | null | undefined;
36592
+ createdAt: NativeDate;
36593
+ updatedAt: NativeDate;
36594
+ } & {
36595
+ _id: mongoose.Types.ObjectId;
36596
+ } & {
36597
+ __v: number;
36598
+ }>;
36599
+ };
36600
+
36601
+ type RoutinesMongoDocuments = {
36602
+ [K in keyof typeof schemas]: HydratedDocument<InferSchemaType<(typeof schemas)[K]>>;
36603
+ };
36604
+ type RoutinesMongoCollectionsModels = {
36605
+ [K in keyof typeof schemas]: Model$1<InferSchemaType<(typeof schemas)[K]>>;
36606
+ };
36607
+
36608
+ declare class RoutinesMongoService {
36609
+ private static instance;
36610
+ private connection;
36611
+ private initialized;
36612
+ private constructor();
36613
+ private notInitialized;
36614
+ /** Retorna a instância singleton */
36615
+ static getInstance(): RoutinesMongoService;
36616
+ /** Inicializa a conexão e collections */
36617
+ init(config: MongoConnectionConfig): Promise<void>;
36618
+ /** Retorna Mongoose connection */
36619
+ getConnection(): mongoose.Connection;
36620
+ /** Retorna collections tipadas */
36621
+ get collections(): RoutinesMongoCollectionsModels;
36622
+ /** Retorna uma collection específica tipada */
36623
+ getCollection<K extends keyof RoutinesMongoCollectionsModels>(key: K): RoutinesMongoCollectionsModels[K];
36624
+ }
36625
+
36484
36626
  type HttpAuthConfig = {
36485
36627
  type: "bearer";
36486
36628
  token: string;
@@ -36697,4 +36839,4 @@ declare namespace ixcSoftApi_types {
36697
36839
  export type { ixcSoftApi_types_IxcSuOssChamadoResponse as IxcSuOssChamadoResponse, ixcSoftApi_types_MonthlyFeesForClientInput as MonthlyFeesForClientInput, ixcSoftApi_types_MonthlyFeesForClientResponse as MonthlyFeesForClientResponse, ixcSoftApi_types_SuOssChamadoInput as SuOssChamadoInput, ixcSoftApi_types_SuOssChamadoListFilters as SuOssChamadoListFilters };
36698
36840
  }
36699
36841
 
36700
- export { IXCSoftApiClient, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, ixcSoftApi_types as IXCSoftTypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService, type ToolsMongoCollectionsModels, type ToolsMongoDocuments, ToolsMongoService, logger, printSignature };
36842
+ export { IXCSoftApiClient, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, ixcSoftApi_types as IXCSoftTypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService, type RoutinesMongoCollectionsModels, type RoutinesMongoDocuments, RoutinesMongoService, type ToolsMongoCollectionsModels, type ToolsMongoDocuments, ToolsMongoService, logger, printSignature };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional, Sequelize as Sequelize$1, Attributes } from 'sequelize';
3
3
  import * as mongoose from 'mongoose';
4
- import { Model as Model$1, InferSchemaType } from 'mongoose';
4
+ import { Model as Model$1, InferSchemaType, HydratedDocument } from 'mongoose';
5
5
  import * as bson from 'bson';
6
6
  import { AxiosRequestConfig, AxiosInstance } from 'axios';
7
7
 
@@ -35812,7 +35812,7 @@ declare class IXCSoftMysqlService {
35812
35812
  }[K];
35813
35813
  }
35814
35814
 
35815
- declare const schemas$1: {
35815
+ declare const schemas$2: {
35816
35816
  tags: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
35817
35817
  cor: string;
35818
35818
  nome: string;
@@ -36315,10 +36315,10 @@ declare const schemas$1: {
36315
36315
  };
36316
36316
 
36317
36317
  type OPASuiteMongoDocuments = {
36318
- [K in keyof typeof schemas$1]: InferSchemaType<(typeof schemas$1)[K]>;
36318
+ [K in keyof typeof schemas$2]: InferSchemaType<(typeof schemas$2)[K]>;
36319
36319
  };
36320
36320
  type OPASuiteMongoCollectionsModels = {
36321
- [K in keyof typeof schemas$1]: Model$1<InferSchemaType<(typeof schemas$1)[K]>>;
36321
+ [K in keyof typeof schemas$2]: Model$1<InferSchemaType<(typeof schemas$2)[K]>>;
36322
36322
  };
36323
36323
 
36324
36324
  type MongoConnectionConfig = {
@@ -36347,7 +36347,7 @@ declare class OPASuiteMongoService {
36347
36347
  getCollection<K extends keyof OPASuiteMongoCollectionsModels>(key: K): OPASuiteMongoCollectionsModels[K];
36348
36348
  }
36349
36349
 
36350
- declare const schemas: {
36350
+ declare const schemas$1: {
36351
36351
  user: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
36352
36352
  timestamps: true;
36353
36353
  }, {
@@ -36457,10 +36457,10 @@ declare const schemas: {
36457
36457
  };
36458
36458
 
36459
36459
  type ToolsMongoDocuments = {
36460
- [K in keyof typeof schemas]: InferSchemaType<(typeof schemas)[K]>;
36460
+ [K in keyof typeof schemas$1]: InferSchemaType<(typeof schemas$1)[K]>;
36461
36461
  };
36462
36462
  type ToolsMongoCollectionsModels = {
36463
- [K in keyof typeof schemas]: Model$1<InferSchemaType<(typeof schemas)[K]>>;
36463
+ [K in keyof typeof schemas$1]: Model$1<InferSchemaType<(typeof schemas$1)[K]>>;
36464
36464
  };
36465
36465
 
36466
36466
  declare class ToolsMongoService {
@@ -36481,6 +36481,148 @@ declare class ToolsMongoService {
36481
36481
  getCollection<K extends keyof ToolsMongoCollectionsModels>(key: K): ToolsMongoCollectionsModels[K];
36482
36482
  }
36483
36483
 
36484
+ declare const schemas: {
36485
+ tasks: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
36486
+ timestamps: true;
36487
+ }, {
36488
+ status: "running" | "stopped" | "waiting";
36489
+ name: string;
36490
+ is_active: boolean;
36491
+ execution_count: number;
36492
+ description?: string | null | undefined;
36493
+ status_last_execution?: "success" | "error" | null | undefined;
36494
+ last_execution_at?: NativeDate | null | undefined;
36495
+ next_execution_at?: NativeDate | null | undefined;
36496
+ cron_expression?: string | null | undefined;
36497
+ last_execution_time_ms?: number | null | undefined;
36498
+ } & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
36499
+ status: "running" | "stopped" | "waiting";
36500
+ name: string;
36501
+ is_active: boolean;
36502
+ execution_count: number;
36503
+ description?: string | null | undefined;
36504
+ status_last_execution?: "success" | "error" | null | undefined;
36505
+ last_execution_at?: NativeDate | null | undefined;
36506
+ next_execution_at?: NativeDate | null | undefined;
36507
+ cron_expression?: string | null | undefined;
36508
+ last_execution_time_ms?: number | null | undefined;
36509
+ } & mongoose.DefaultTimestampProps, {
36510
+ id: string;
36511
+ }, Omit<mongoose.DefaultSchemaOptions, "timestamps"> & {
36512
+ timestamps: true;
36513
+ }> & Omit<{
36514
+ status: "running" | "stopped" | "waiting";
36515
+ name: string;
36516
+ is_active: boolean;
36517
+ execution_count: number;
36518
+ description?: string | null | undefined;
36519
+ status_last_execution?: "success" | "error" | null | undefined;
36520
+ last_execution_at?: NativeDate | null | undefined;
36521
+ next_execution_at?: NativeDate | null | undefined;
36522
+ cron_expression?: string | null | undefined;
36523
+ last_execution_time_ms?: number | null | undefined;
36524
+ } & mongoose.DefaultTimestampProps & {
36525
+ _id: mongoose.Types.ObjectId;
36526
+ } & {
36527
+ __v: number;
36528
+ }, "id"> & {
36529
+ id: string;
36530
+ }, unknown, {
36531
+ status: "running" | "stopped" | "waiting";
36532
+ name: string;
36533
+ is_active: boolean;
36534
+ execution_count: number;
36535
+ description?: string | null | undefined;
36536
+ status_last_execution?: "success" | "error" | null | undefined;
36537
+ last_execution_at?: NativeDate | null | undefined;
36538
+ next_execution_at?: NativeDate | null | undefined;
36539
+ cron_expression?: string | null | undefined;
36540
+ last_execution_time_ms?: number | null | undefined;
36541
+ createdAt: NativeDate;
36542
+ updatedAt: NativeDate;
36543
+ } & {
36544
+ _id: mongoose.Types.ObjectId;
36545
+ } & {
36546
+ __v: number;
36547
+ }>;
36548
+ loger: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
36549
+ timestamps: true;
36550
+ }, {
36551
+ status: "success" | "error" | "info" | "warning";
36552
+ description: string;
36553
+ action: string;
36554
+ task: mongoose.Types.ObjectId;
36555
+ executionTimeMs?: number | null | undefined;
36556
+ metadata?: any;
36557
+ triggered_by?: string | null | undefined;
36558
+ } & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, {
36559
+ status: "success" | "error" | "info" | "warning";
36560
+ description: string;
36561
+ action: string;
36562
+ task: mongoose.Types.ObjectId;
36563
+ executionTimeMs?: number | null | undefined;
36564
+ metadata?: any;
36565
+ triggered_by?: string | null | undefined;
36566
+ } & mongoose.DefaultTimestampProps, {
36567
+ id: string;
36568
+ }, Omit<mongoose.DefaultSchemaOptions, "timestamps"> & {
36569
+ timestamps: true;
36570
+ }> & Omit<{
36571
+ status: "success" | "error" | "info" | "warning";
36572
+ description: string;
36573
+ action: string;
36574
+ task: mongoose.Types.ObjectId;
36575
+ executionTimeMs?: number | null | undefined;
36576
+ metadata?: any;
36577
+ triggered_by?: string | null | undefined;
36578
+ } & mongoose.DefaultTimestampProps & {
36579
+ _id: mongoose.Types.ObjectId;
36580
+ } & {
36581
+ __v: number;
36582
+ }, "id"> & {
36583
+ id: string;
36584
+ }, unknown, {
36585
+ status: "success" | "error" | "info" | "warning";
36586
+ description: string;
36587
+ action: string;
36588
+ task: mongoose.Types.ObjectId;
36589
+ executionTimeMs?: number | null | undefined;
36590
+ metadata?: any;
36591
+ triggered_by?: string | null | undefined;
36592
+ createdAt: NativeDate;
36593
+ updatedAt: NativeDate;
36594
+ } & {
36595
+ _id: mongoose.Types.ObjectId;
36596
+ } & {
36597
+ __v: number;
36598
+ }>;
36599
+ };
36600
+
36601
+ type RoutinesMongoDocuments = {
36602
+ [K in keyof typeof schemas]: HydratedDocument<InferSchemaType<(typeof schemas)[K]>>;
36603
+ };
36604
+ type RoutinesMongoCollectionsModels = {
36605
+ [K in keyof typeof schemas]: Model$1<InferSchemaType<(typeof schemas)[K]>>;
36606
+ };
36607
+
36608
+ declare class RoutinesMongoService {
36609
+ private static instance;
36610
+ private connection;
36611
+ private initialized;
36612
+ private constructor();
36613
+ private notInitialized;
36614
+ /** Retorna a instância singleton */
36615
+ static getInstance(): RoutinesMongoService;
36616
+ /** Inicializa a conexão e collections */
36617
+ init(config: MongoConnectionConfig): Promise<void>;
36618
+ /** Retorna Mongoose connection */
36619
+ getConnection(): mongoose.Connection;
36620
+ /** Retorna collections tipadas */
36621
+ get collections(): RoutinesMongoCollectionsModels;
36622
+ /** Retorna uma collection específica tipada */
36623
+ getCollection<K extends keyof RoutinesMongoCollectionsModels>(key: K): RoutinesMongoCollectionsModels[K];
36624
+ }
36625
+
36484
36626
  type HttpAuthConfig = {
36485
36627
  type: "bearer";
36486
36628
  token: string;
@@ -36697,4 +36839,4 @@ declare namespace ixcSoftApi_types {
36697
36839
  export type { ixcSoftApi_types_IxcSuOssChamadoResponse as IxcSuOssChamadoResponse, ixcSoftApi_types_MonthlyFeesForClientInput as MonthlyFeesForClientInput, ixcSoftApi_types_MonthlyFeesForClientResponse as MonthlyFeesForClientResponse, ixcSoftApi_types_SuOssChamadoInput as SuOssChamadoInput, ixcSoftApi_types_SuOssChamadoListFilters as SuOssChamadoListFilters };
36698
36840
  }
36699
36841
 
36700
- export { IXCSoftApiClient, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, ixcSoftApi_types as IXCSoftTypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService, type ToolsMongoCollectionsModels, type ToolsMongoDocuments, ToolsMongoService, logger, printSignature };
36842
+ export { IXCSoftApiClient, type IXCSoftMysqlModels, type IXCSoftMysqlModelsAttributes, IXCSoftMysqlService, ixcSoftApi_types as IXCSoftTypes, type OPASuiteMongoCollectionsModels, type OPASuiteMongoDocuments, OPASuiteMongoService, type RoutinesMongoCollectionsModels, type RoutinesMongoDocuments, RoutinesMongoService, type ToolsMongoCollectionsModels, type ToolsMongoDocuments, ToolsMongoService, logger, printSignature };
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ __export(index_exports, {
34
34
  IXCSoftMysqlService: () => IXCSoftMysqlService,
35
35
  IXCSoftTypes: () => ixc_soft_api_types_exports,
36
36
  OPASuiteMongoService: () => OPASuiteMongoService,
37
+ RoutinesMongoService: () => RoutinesMongoService,
37
38
  ToolsMongoService: () => ToolsMongoService,
38
39
  logger: () => logger,
39
40
  printSignature: () => printSignature
@@ -90965,6 +90966,137 @@ var ToolsMongoService = class _ToolsMongoService {
90965
90966
  }
90966
90967
  };
90967
90968
 
90969
+ // src/databases/mongo/routines/routines.mongo.types.ts
90970
+ var configRoutinesMongo = {
90971
+ context: "ROUTINES_MONGO",
90972
+ domain: "MONGO"
90973
+ };
90974
+
90975
+ // src/databases/mongo/routines/collections/tasks.ts
90976
+ var import_mongoose9 = require("mongoose");
90977
+ var TasksSchema = new import_mongoose9.Schema(
90978
+ {
90979
+ name: { type: String, required: true, unique: true },
90980
+ description: { type: String },
90981
+ is_active: { type: Boolean, default: true },
90982
+ status: {
90983
+ type: String,
90984
+ enum: ["running", "stopped", "waiting"],
90985
+ default: "waiting"
90986
+ },
90987
+ status_last_execution: {
90988
+ type: String,
90989
+ enum: ["success", "error", null],
90990
+ default: null
90991
+ },
90992
+ last_execution_at: { type: Date, default: null },
90993
+ next_execution_at: { type: Date, default: null },
90994
+ cron_expression: { type: String, default: null },
90995
+ execution_count: { type: Number, default: 0 },
90996
+ last_execution_time_ms: { type: Number, default: null }
90997
+ },
90998
+ {
90999
+ timestamps: true
91000
+ }
91001
+ );
91002
+
91003
+ // src/databases/mongo/routines/collections/loger.ts
91004
+ var import_mongoose10 = require("mongoose");
91005
+ var LogerSchema2 = new import_mongoose10.Schema(
91006
+ {
91007
+ task: {
91008
+ type: import_mongoose10.Types.ObjectId,
91009
+ ref: "Task",
91010
+ required: true
91011
+ },
91012
+ action: { type: String, required: true },
91013
+ status: {
91014
+ type: String,
91015
+ enum: ["success", "error", "warning", "info"],
91016
+ required: true
91017
+ },
91018
+ triggered_by: { type: String, default: null },
91019
+ description: { type: String, required: true },
91020
+ executionTimeMs: { type: Number, default: null },
91021
+ metadata: { type: import_mongoose10.Schema.Types.Mixed }
91022
+ },
91023
+ {
91024
+ timestamps: true
91025
+ }
91026
+ );
91027
+
91028
+ // src/databases/mongo/routines/collections/index.ts
91029
+ var schemas3 = {
91030
+ tasks: TasksSchema,
91031
+ loger: LogerSchema2
91032
+ };
91033
+
91034
+ // src/databases/mongo/routines/routines.mongo.connection.ts
91035
+ async function createRoutinesMongoConnection(config) {
91036
+ const connection = await createMongoConnection({
91037
+ ...config,
91038
+ database: "routines",
91039
+ context: configRoutinesMongo.context
91040
+ });
91041
+ const collections = Object.entries(schemas3).reduce((acc, [name, schema]) => {
91042
+ acc[name] = connection.model(name, schema);
91043
+ return acc;
91044
+ }, {});
91045
+ return {
91046
+ connection,
91047
+ collections
91048
+ };
91049
+ }
91050
+ var connectRoutinesMongo = createConnectionFactory(createRoutinesMongoConnection);
91051
+
91052
+ // src/databases/mongo/routines/routines.mongo.service.ts
91053
+ var RoutinesMongoService = class _RoutinesMongoService {
91054
+ constructor() {
91055
+ this.initialized = false;
91056
+ }
91057
+ notInitialized() {
91058
+ if (!this.initialized)
91059
+ throw new Error(
91060
+ "RoutinesMongoService n\xE3o inicializado! Chame init() antes."
91061
+ );
91062
+ }
91063
+ /** Retorna a instância singleton */
91064
+ static getInstance() {
91065
+ if (!_RoutinesMongoService.instance)
91066
+ _RoutinesMongoService.instance = new _RoutinesMongoService();
91067
+ return _RoutinesMongoService.instance;
91068
+ }
91069
+ /** Inicializa a conexão e collections */
91070
+ async init(config) {
91071
+ if (this.initialized) return;
91072
+ logger({
91073
+ ...configRoutinesMongo,
91074
+ message: "Inicializando RoutinesMongoService..."
91075
+ });
91076
+ this.connection = await connectRoutinesMongo(config);
91077
+ this.initialized = true;
91078
+ logger({
91079
+ ...configRoutinesMongo,
91080
+ message: "RoutinesMongoService inicializado!"
91081
+ });
91082
+ }
91083
+ /** Retorna Mongoose connection */
91084
+ getConnection() {
91085
+ this.notInitialized();
91086
+ return this.connection.connection;
91087
+ }
91088
+ /** Retorna collections tipadas */
91089
+ get collections() {
91090
+ this.notInitialized();
91091
+ return this.connection.collections;
91092
+ }
91093
+ /** Retorna uma collection específica tipada */
91094
+ getCollection(key) {
91095
+ this.notInitialized();
91096
+ return this.connection.collections[key];
91097
+ }
91098
+ };
91099
+
90968
91100
  // src/apis/core/http-client.ts
90969
91101
  var import_axios = __toESM(require("axios"));
90970
91102
  var https = __toESM(require("https"));
@@ -91170,6 +91302,7 @@ var ixc_soft_api_types_exports = {};
91170
91302
  IXCSoftMysqlService,
91171
91303
  IXCSoftTypes,
91172
91304
  OPASuiteMongoService,
91305
+ RoutinesMongoService,
91173
91306
  ToolsMongoService,
91174
91307
  logger,
91175
91308
  printSignature
package/dist/index.mjs CHANGED
@@ -90923,6 +90923,137 @@ var ToolsMongoService = class _ToolsMongoService {
90923
90923
  }
90924
90924
  };
90925
90925
 
90926
+ // src/databases/mongo/routines/routines.mongo.types.ts
90927
+ var configRoutinesMongo = {
90928
+ context: "ROUTINES_MONGO",
90929
+ domain: "MONGO"
90930
+ };
90931
+
90932
+ // src/databases/mongo/routines/collections/tasks.ts
90933
+ import { Schema as Schema8 } from "mongoose";
90934
+ var TasksSchema = new Schema8(
90935
+ {
90936
+ name: { type: String, required: true, unique: true },
90937
+ description: { type: String },
90938
+ is_active: { type: Boolean, default: true },
90939
+ status: {
90940
+ type: String,
90941
+ enum: ["running", "stopped", "waiting"],
90942
+ default: "waiting"
90943
+ },
90944
+ status_last_execution: {
90945
+ type: String,
90946
+ enum: ["success", "error", null],
90947
+ default: null
90948
+ },
90949
+ last_execution_at: { type: Date, default: null },
90950
+ next_execution_at: { type: Date, default: null },
90951
+ cron_expression: { type: String, default: null },
90952
+ execution_count: { type: Number, default: 0 },
90953
+ last_execution_time_ms: { type: Number, default: null }
90954
+ },
90955
+ {
90956
+ timestamps: true
90957
+ }
90958
+ );
90959
+
90960
+ // src/databases/mongo/routines/collections/loger.ts
90961
+ import { Schema as Schema9, Types as Types2 } from "mongoose";
90962
+ var LogerSchema2 = new Schema9(
90963
+ {
90964
+ task: {
90965
+ type: Types2.ObjectId,
90966
+ ref: "Task",
90967
+ required: true
90968
+ },
90969
+ action: { type: String, required: true },
90970
+ status: {
90971
+ type: String,
90972
+ enum: ["success", "error", "warning", "info"],
90973
+ required: true
90974
+ },
90975
+ triggered_by: { type: String, default: null },
90976
+ description: { type: String, required: true },
90977
+ executionTimeMs: { type: Number, default: null },
90978
+ metadata: { type: Schema9.Types.Mixed }
90979
+ },
90980
+ {
90981
+ timestamps: true
90982
+ }
90983
+ );
90984
+
90985
+ // src/databases/mongo/routines/collections/index.ts
90986
+ var schemas3 = {
90987
+ tasks: TasksSchema,
90988
+ loger: LogerSchema2
90989
+ };
90990
+
90991
+ // src/databases/mongo/routines/routines.mongo.connection.ts
90992
+ async function createRoutinesMongoConnection(config) {
90993
+ const connection = await createMongoConnection({
90994
+ ...config,
90995
+ database: "routines",
90996
+ context: configRoutinesMongo.context
90997
+ });
90998
+ const collections = Object.entries(schemas3).reduce((acc, [name, schema]) => {
90999
+ acc[name] = connection.model(name, schema);
91000
+ return acc;
91001
+ }, {});
91002
+ return {
91003
+ connection,
91004
+ collections
91005
+ };
91006
+ }
91007
+ var connectRoutinesMongo = createConnectionFactory(createRoutinesMongoConnection);
91008
+
91009
+ // src/databases/mongo/routines/routines.mongo.service.ts
91010
+ var RoutinesMongoService = class _RoutinesMongoService {
91011
+ constructor() {
91012
+ this.initialized = false;
91013
+ }
91014
+ notInitialized() {
91015
+ if (!this.initialized)
91016
+ throw new Error(
91017
+ "RoutinesMongoService n\xE3o inicializado! Chame init() antes."
91018
+ );
91019
+ }
91020
+ /** Retorna a instância singleton */
91021
+ static getInstance() {
91022
+ if (!_RoutinesMongoService.instance)
91023
+ _RoutinesMongoService.instance = new _RoutinesMongoService();
91024
+ return _RoutinesMongoService.instance;
91025
+ }
91026
+ /** Inicializa a conexão e collections */
91027
+ async init(config) {
91028
+ if (this.initialized) return;
91029
+ logger({
91030
+ ...configRoutinesMongo,
91031
+ message: "Inicializando RoutinesMongoService..."
91032
+ });
91033
+ this.connection = await connectRoutinesMongo(config);
91034
+ this.initialized = true;
91035
+ logger({
91036
+ ...configRoutinesMongo,
91037
+ message: "RoutinesMongoService inicializado!"
91038
+ });
91039
+ }
91040
+ /** Retorna Mongoose connection */
91041
+ getConnection() {
91042
+ this.notInitialized();
91043
+ return this.connection.connection;
91044
+ }
91045
+ /** Retorna collections tipadas */
91046
+ get collections() {
91047
+ this.notInitialized();
91048
+ return this.connection.collections;
91049
+ }
91050
+ /** Retorna uma collection específica tipada */
91051
+ getCollection(key) {
91052
+ this.notInitialized();
91053
+ return this.connection.collections[key];
91054
+ }
91055
+ };
91056
+
90926
91057
  // src/apis/core/http-client.ts
90927
91058
  import axios from "axios";
90928
91059
  import * as https from "https";
@@ -91127,6 +91258,7 @@ export {
91127
91258
  IXCSoftMysqlService,
91128
91259
  ixc_soft_api_types_exports as IXCSoftTypes,
91129
91260
  OPASuiteMongoService,
91261
+ RoutinesMongoService,
91130
91262
  ToolsMongoService,
91131
91263
  logger,
91132
91264
  printSignature
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cristian-israel/giganet_lib_conecta",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Database Connector Layer",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",