akeyless-server-commons 1.0.205 → 1.0.207

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.
Files changed (113) hide show
  1. package/dist/cjs/helpers/postponed_actions.d.ts +7 -17
  2. package/dist/cjs/helpers/postponed_actions.js +25 -26
  3. package/dist/cjs/helpers/postponed_actions.js.map +1 -1
  4. package/dist/cjs/helpers/tasks.d.ts +12 -0
  5. package/dist/cjs/helpers/tasks.js +62 -0
  6. package/dist/cjs/helpers/tasks.js.map +1 -0
  7. package/dist/cjs/helpers/tasks_helpers.d.ts +2 -1
  8. package/dist/cjs/helpers/tasks_helpers.js +1 -0
  9. package/dist/cjs/helpers/tasks_helpers.js.map +1 -1
  10. package/dist/cjs/managers/cacche_manager2.d.ts +18 -0
  11. package/dist/cjs/managers/cacche_manager2.js +41 -0
  12. package/dist/cjs/managers/cacche_manager2.js.map +1 -0
  13. package/dist/cjs/managers/socket_manager.js +245 -0
  14. package/dist/cjs/managers/socket_manager.js.map +1 -0
  15. package/dist/esm/helpers/postponed_actions.d.ts +7 -17
  16. package/dist/esm/helpers/postponed_actions.js +12 -12
  17. package/dist/esm/helpers/postponed_actions.js.map +1 -1
  18. package/dist/esm/helpers/tasks.d.ts +12 -0
  19. package/dist/esm/helpers/tasks.js +58 -0
  20. package/dist/esm/helpers/tasks.js.map +1 -0
  21. package/dist/esm/helpers/tasks_helpers.d.ts +2 -1
  22. package/dist/esm/helpers/tasks_helpers.js +1 -0
  23. package/dist/esm/helpers/tasks_helpers.js.map +1 -1
  24. package/dist/esm/managers/cacche_manager2.d.ts +18 -0
  25. package/dist/esm/managers/cacche_manager2.js +37 -0
  26. package/dist/esm/managers/cacche_manager2.js.map +1 -0
  27. package/dist/esm/managers/socket_manager.js +243 -0
  28. package/dist/esm/managers/socket_manager.js.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/cjs/helpers/rabbitmq_helpers.d.ts +0 -64
  31. package/dist/cjs/helpers/rabbitmq_helpers.js +0 -193
  32. package/dist/cjs/helpers/rabbitmq_helpers.js.map +0 -1
  33. package/dist/esm/helpers/rabbitmq_helpers.d.ts +0 -64
  34. package/dist/esm/helpers/rabbitmq_helpers.js +0 -186
  35. package/dist/esm/helpers/rabbitmq_helpers.js.map +0 -1
  36. package/dist/helpers/boards_helpers.js +0 -62
  37. package/dist/helpers/email_helpers.js +0 -153
  38. package/dist/helpers/firebase_helpers.js +0 -601
  39. package/dist/helpers/global_helpers.js +0 -147
  40. package/dist/helpers/index.js +0 -13
  41. package/dist/helpers/location_helpers.js +0 -15
  42. package/dist/helpers/login_helpers.js +0 -18
  43. package/dist/helpers/notification_helpers.js +0 -248
  44. package/dist/helpers/phone_number_helpers.js +0 -96
  45. package/dist/helpers/postponed_actions.js +0 -358
  46. package/dist/helpers/redis/helpers.js +0 -215
  47. package/dist/helpers/redis/index.js +0 -4
  48. package/dist/helpers/redis/initialize.js +0 -139
  49. package/dist/helpers/redis/keys.js +0 -23
  50. package/dist/helpers/redis/snapshot.js +0 -166
  51. package/dist/helpers/start.js +0 -83
  52. package/dist/helpers/tasks_helpers.js +0 -139
  53. package/dist/helpers/time_helpers.js +0 -167
  54. package/dist/index.js +0 -5
  55. package/dist/managers/cache_manager.js +0 -37
  56. package/dist/managers/index.js +0 -4
  57. package/dist/managers/logger_manager.js +0 -68
  58. package/dist/managers/rabbitmq_manager.js +0 -182
  59. package/dist/managers/translation_manager.js +0 -38
  60. package/dist/middlewares/auth_mw.js +0 -50
  61. package/dist/middlewares/error_handling.js +0 -20
  62. package/dist/middlewares/global_mw.js +0 -119
  63. package/dist/middlewares/index.js +0 -4
  64. package/dist/middlewares/trim_mw.js +0 -7
  65. package/dist/test.js +0 -1
  66. package/dist/types/enums/global.js +0 -8
  67. package/dist/types/enums/index.js +0 -1
  68. package/dist/types/helpers/boards_helpers.d.ts +0 -10
  69. package/dist/types/helpers/email_helpers.d.ts +0 -12
  70. package/dist/types/helpers/firebase_helpers.d.ts +0 -56
  71. package/dist/types/helpers/global_helpers.d.ts +0 -16
  72. package/dist/types/helpers/index.d.ts +0 -13
  73. package/dist/types/helpers/location_helpers.d.ts +0 -3
  74. package/dist/types/helpers/login_helpers.d.ts +0 -4
  75. package/dist/types/helpers/notification_helpers.d.ts +0 -11
  76. package/dist/types/helpers/phone_number_helpers.d.ts +0 -19
  77. package/dist/types/helpers/postponed_actions.d.ts +0 -113
  78. package/dist/types/helpers/redis/helpers.d.ts +0 -11
  79. package/dist/types/helpers/redis/index.d.ts +0 -4
  80. package/dist/types/helpers/redis/initialize.d.ts +0 -6
  81. package/dist/types/helpers/redis/keys.d.ts +0 -5
  82. package/dist/types/helpers/redis/snapshot.d.ts +0 -2
  83. package/dist/types/helpers/start.d.ts +0 -4
  84. package/dist/types/helpers/tasks_helpers.d.ts +0 -25
  85. package/dist/types/helpers/time_helpers.d.ts +0 -40
  86. package/dist/types/index.d.ts +0 -5
  87. package/dist/types/index.js +0 -3
  88. package/dist/types/interfaces/index.js +0 -2
  89. package/dist/types/managers/cache_manager.d.ts +0 -12
  90. package/dist/types/managers/index.d.ts +0 -4
  91. package/dist/types/managers/logger_manager.d.ts +0 -14
  92. package/dist/types/managers/rabbitmq_manager.d.ts +0 -60
  93. package/dist/types/managers/translation_manager.d.ts +0 -14
  94. package/dist/types/middlewares/auth_mw.d.ts +0 -4
  95. package/dist/types/middlewares/error_handling.d.ts +0 -11
  96. package/dist/types/middlewares/global_mw.d.ts +0 -5
  97. package/dist/types/middlewares/index.d.ts +0 -4
  98. package/dist/types/middlewares/trim_mw.d.ts +0 -2
  99. package/dist/types/test.d.ts +0 -0
  100. package/dist/types/types/enums/global.d.ts +0 -9
  101. package/dist/types/types/enums/index.d.ts +0 -1
  102. package/dist/types/types/firebase_types.js +0 -1
  103. package/dist/types/types/global.js +0 -1
  104. package/dist/types/types/index.d.ts +0 -3
  105. package/dist/types/types/index.js +0 -2
  106. package/dist/types/types/interfaces/email.d.ts +0 -33
  107. package/dist/types/types/interfaces/global.d.ts +0 -27
  108. package/dist/types/types/interfaces/index.d.ts +0 -2
  109. package/dist/types/types/types/firebase_types.d.ts +0 -50
  110. package/dist/types/types/types/global.d.ts +0 -17
  111. package/dist/types/types/types/index.d.ts +0 -2
  112. /package/dist/{types/interfaces/email.js → cjs/managers/socket_manager.d.ts} +0 -0
  113. /package/dist/{types/interfaces/global.js → esm/managers/socket_manager.d.ts} +0 -0
@@ -1,14 +0,0 @@
1
- import { TObject } from "akeyless-types-commons";
2
- import { EntityOptions, LangOptions } from "../types";
3
- export declare class TranslationManager {
4
- private static instance;
5
- private data;
6
- private constructor();
7
- static getInstance(): TranslationManager;
8
- setTranslationData(data: TObject<any>): void;
9
- getTranslationData(): TObject<any>;
10
- get_translation(scope: string, lang: string, entity: string, key: string): string;
11
- get_sms(lang: LangOptions, entity: EntityOptions, key: string): string;
12
- get_email(lang: LangOptions, entity: EntityOptions, key: string): string;
13
- }
14
- export declare const translation_manager: TranslationManager;
@@ -1,4 +0,0 @@
1
- import { MW } from "../types";
2
- export declare const verify_user_auth: MW;
3
- export declare const nx_user_login: MW;
4
- export declare const client_login: MW;
@@ -1,11 +0,0 @@
1
- import { Request, Response, NextFunction } from "express";
2
- import { Service } from "../types";
3
- /**
4
- * Utility to handle async errors
5
- */
6
- declare const async_error_handler: (service: Service) => (req: Request, res: Response, next: NextFunction) => void;
7
- /**
8
- * Global error-handling middleware.
9
- */
10
- declare const error_handler: (err: Error, req: Request, res: Response, next: NextFunction) => void;
11
- export { error_handler, async_error_handler };
@@ -1,5 +0,0 @@
1
- import { RequestHandler } from "express";
2
- import { LogRequests, MandatoryParams, MW } from "../types";
3
- export declare const mandatory: ({ body, headers }: MandatoryParams) => MW;
4
- export declare const optional: ({ body, headers }: MandatoryParams) => MW;
5
- export declare const request_logger: (log_requests: LogRequests) => RequestHandler;
@@ -1,4 +0,0 @@
1
- export * from "./global_mw";
2
- export * from "./auth_mw";
3
- export * from "./error_handling";
4
- export * from "./trim_mw";
@@ -1,2 +0,0 @@
1
- import { MW } from "../types";
2
- export declare const trim_body_middleware: () => MW;
File without changes
@@ -1,9 +0,0 @@
1
- export declare enum SimProvider {
2
- partner = "partner",
3
- pelephone = "pelephone",
4
- celcom = "celcom",
5
- monogoto = "monogoto",
6
- unknown = "unknown"
7
- }
8
- export type NxServiceName = "bi" | "call_center" | "dashboard" | "devices" | "installer" | "ox_server" | "toolbox" | "end_users" | "notifications";
9
- export type NxServiceNameMap = Record<NxServiceName, string>;
@@ -1 +0,0 @@
1
- export * from "./global";
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from './types';
2
- export * from './interfaces';
3
- export * from './enums';
@@ -1,2 +0,0 @@
1
- export * from "./global";
2
- export * from "./firebase_types";
@@ -1,33 +0,0 @@
1
- export interface EmailData {
2
- subject: string;
3
- entity_for_audit: string;
4
- to?: string | string[];
5
- from?: string | {
6
- email: string;
7
- name?: string;
8
- };
9
- group_name?: string;
10
- cc?: string | string[];
11
- body_plain_text?: string;
12
- body_html?: string;
13
- attachments?: EmailAttachment[];
14
- }
15
- export interface EmailAttachment {
16
- content: string;
17
- filename: string;
18
- type?: string;
19
- disposition?: "attachment" | "inline";
20
- content_id?: string;
21
- }
22
- export interface EmailSettings {
23
- default_from: {
24
- email: string;
25
- name?: string;
26
- };
27
- default_cc: string[];
28
- groups: Record<string, {
29
- cc?: string[];
30
- to: string[];
31
- }>;
32
- sendgrid_api_key: string;
33
- }
@@ -1,27 +0,0 @@
1
- import { InitSnapshotsOptions } from "../types";
2
- export interface MandatoryObject {
3
- key: string;
4
- type: "string" | "number" | "boolean" | "object" | "array";
5
- length?: number;
6
- required_keys?: string[];
7
- array_types?: ("string" | "number" | "boolean" | "object")[];
8
- }
9
- export interface MandatoryParams {
10
- body?: MandatoryObject[];
11
- headers?: MandatoryObject[];
12
- }
13
- export interface LogRequests {
14
- url?: boolean;
15
- headers?: boolean;
16
- query?: boolean;
17
- body?: boolean;
18
- gcp?: boolean;
19
- }
20
- export interface AppOptions {
21
- port?: number;
22
- log_requests?: LogRequests;
23
- init_snapshot_options?: InitSnapshotsOptions;
24
- initialize_redis?: boolean;
25
- enable_axios_keep_alive?: boolean;
26
- on_shutdown?: () => void | Promise<void> | undefined;
27
- }
@@ -1,2 +0,0 @@
1
- export * from './global';
2
- export * from './email';
@@ -1,50 +0,0 @@
1
- import { TObject } from "akeyless-types-commons";
2
- export type QueryDocuments = (collection_path: string, field_name: string, operator: FirebaseFirestore.WhereFilterOp, value: any) => Promise<TObject<any>[]>;
3
- export type WhereCondition = {
4
- field_name: string;
5
- operator: FirebaseFirestore.WhereFilterOp;
6
- value: any;
7
- };
8
- export type QueryDocumentsByConditions = (collection_path: string, where_conditions: WhereCondition[]) => Promise<TObject<any>[]>;
9
- export type QueryDocumentByConditions = (collection_path: string, where_conditions: WhereCondition[], log?: boolean) => Promise<TObject<any>>;
10
- export type QueryDocument = (collection_path: string, field_name: string, operator: FirebaseFirestore.WhereFilterOp, value: any, ignore_log?: boolean) => Promise<TObject<any>>;
11
- export type QueryDocumentOptional = (collection_path: string, field_name: string, operator: FirebaseFirestore.WhereFilterOp, value: any, ignore_log?: boolean) => Promise<TObject<any> | null>;
12
- export type OnSnapshotCallback = (documents: any[], config: OnSnapshotConfig) => void;
13
- export interface OnSnapshotParsers {
14
- on_first_time?: OnSnapshotCallback;
15
- on_add?: OnSnapshotCallback;
16
- on_modify?: OnSnapshotCallback;
17
- on_remove?: OnSnapshotCallback;
18
- }
19
- export interface ExtraSnapshotConfig {
20
- collection_name: string;
21
- extra_parsers?: OnSnapshotParsers[];
22
- conditions?: WhereCondition[];
23
- cache_name?: string;
24
- parse_as?: "object" | "array";
25
- doc_key_property?: string;
26
- subscription_type?: "redis" | "firebase";
27
- debug?: Debug & {
28
- extra_parsers?: Debug;
29
- };
30
- }
31
- interface Debug {
32
- on_first_time?: "documents" | "length";
33
- on_add?: boolean;
34
- on_modify?: boolean;
35
- on_remove?: boolean;
36
- }
37
- export type OnSnapshotConfig = OnSnapshotParsers & ExtraSnapshotConfig;
38
- export type Snapshot = (config: OnSnapshotConfig) => Promise<void>;
39
- export type SnapshotBulk = (snapshots: ReturnType<Snapshot>[], label?: string) => Promise<void>;
40
- export type SnapshotBulkByNamesParamObject = Omit<ExtraSnapshotConfig, "extra_parsers"> & {
41
- extra_parsers: OnSnapshotParsers[];
42
- };
43
- export type SnapshotBulkByNamesParam = string | SnapshotBulkByNamesParamObject;
44
- export type SnapshotBulkByNamesOptions = Pick<ExtraSnapshotConfig, "debug" | "subscription_type" | "parse_as" | "doc_key_property"> & {
45
- label?: string;
46
- };
47
- export type SnapshotBulkByNames = (params: SnapshotBulkByNamesParam[], options?: SnapshotBulkByNamesOptions) => Promise<void>;
48
- export interface InitSnapshotsOptions extends Pick<ExtraSnapshotConfig, "subscription_type" | "debug"> {
49
- }
50
- export {};
@@ -1,17 +0,0 @@
1
- import { Request, Response, Express, NextFunction } from "express";
2
- import { NxUser, TObject } from "akeyless-types-commons";
3
- export type JsonOK<T> = (data?: T) => {
4
- success: true;
5
- data: T | undefined;
6
- };
7
- export type JsonFailed = (error?: any, msg?: string) => {
8
- success: false;
9
- error: any;
10
- };
11
- export type MainRouter = (app: Express) => void;
12
- export type MW = (req: Request, res: Response, next: NextFunction) => void;
13
- export type Service = (req: Request, res: Response) => void;
14
- export type Route = (req: Request, res: Response, next?: NextFunction) => Response;
15
- export type AddAuditRecord = (action: string, entity: string, details: TObject<any>, user?: NxUser) => Promise<void>;
16
- export type LangOptions = "he" | "en" | "ru" | (string & {});
17
- export type EntityOptions = "nx_devices" | (string & {});
@@ -1,2 +0,0 @@
1
- export * from "./global";
2
- export * from "./firebase_types";