evo360-types 1.3.342 → 1.3.346

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.ts CHANGED
@@ -24,6 +24,7 @@ export * from "./types/evo-notifications";
24
24
  export * from "./types/evo-task-runner";
25
25
  export * from "./types/evo-integrations";
26
26
  export * from "./types/nex-customers";
27
+ export * from "./types/nex-tenants";
27
28
  export * from "./apps/shared/zod-schemas";
28
29
  export * from "./apps/evo-core/zod-schemas";
29
30
  export * from "./apps/evo-tenant/zod-schemas";
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ __exportStar(require("./types/evo-notifications"), exports);
41
41
  __exportStar(require("./types/evo-task-runner"), exports);
42
42
  __exportStar(require("./types/evo-integrations"), exports);
43
43
  __exportStar(require("./types/nex-customers"), exports);
44
+ __exportStar(require("./types/nex-tenants"), exports);
44
45
  // zod schemas
45
46
  __exportStar(require("./apps/shared/zod-schemas"), exports);
46
47
  __exportStar(require("./apps/evo-core/zod-schemas"), exports);
package/dist/index.ts CHANGED
@@ -25,6 +25,7 @@ export * from "./types/evo-notifications";
25
25
  export * from "./types/evo-task-runner";
26
26
  export * from "./types/evo-integrations";
27
27
  export * from "./types/nex-customers";
28
+ export * from "./types/nex-tenants";
28
29
 
29
30
  // zod schemas
30
31
  export * from "./apps/shared/zod-schemas";
@@ -0,0 +1 @@
1
+ export * from "./lgpd-export";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lgpd-export"), exports);
@@ -0,0 +1 @@
1
+ export * from "./lgpd-export";
@@ -0,0 +1,73 @@
1
+ import { z } from "zod";
2
+ import type { IFireGlobalDoc } from "../shared";
3
+ export declare const LGPD_EXPORT_SCHEMA_VERSION: 1;
4
+ export declare const LGPD_EXPORT_FIRESTORE_PATH: "core/nexus/apps/nex-tenants/lgpd_exports";
5
+ export declare const LGPD_EXPORT_PUBSUB_TOPIC: "app_nexus_lgpd-exports_request";
6
+ export type LgpdExportStatus = "pending" | "generating" | "ready" | "failed" | "expired";
7
+ export type LgpdExportAuditAction = "export_requested" | "export_started" | "export_completed" | "export_failed" | "export_downloaded" | "export_expired";
8
+ export interface ILgpdExportFileEntry {
9
+ name: string;
10
+ record_count: number;
11
+ sha256: string;
12
+ size_bytes: number;
13
+ }
14
+ export interface ILgpdExportRecordCounts {
15
+ whatsapp_messages: number;
16
+ whatsapp_contacts: number;
17
+ leads: number;
18
+ media_files: number;
19
+ }
20
+ export interface ILgpdExportError {
21
+ code: string;
22
+ message: string;
23
+ }
24
+ export interface ILgpdExportRequestedBy {
25
+ uid: string;
26
+ email: string;
27
+ loginId: string;
28
+ }
29
+ export interface ILgpdExportDoc extends IFireGlobalDoc {
30
+ tenant: string;
31
+ requested_by: ILgpdExportRequestedBy;
32
+ requested_at: Date | null;
33
+ started_at?: Date | null;
34
+ generated_at?: Date | null;
35
+ expires_at?: Date | null;
36
+ status: LgpdExportStatus;
37
+ file_path?: string | null;
38
+ file_size?: number | null;
39
+ sha256?: string | null;
40
+ record_counts?: ILgpdExportRecordCounts | null;
41
+ files?: ILgpdExportFileEntry[] | null;
42
+ error?: ILgpdExportError | null;
43
+ export_schema_version: typeof LGPD_EXPORT_SCHEMA_VERSION;
44
+ notes?: string | null;
45
+ }
46
+ export declare const LgpdExportRequestSchema: z.ZodObject<{
47
+ tenant: z.ZodString;
48
+ }, "strip", z.ZodTypeAny, {
49
+ tenant: string;
50
+ }, {
51
+ tenant: string;
52
+ }>;
53
+ export type ILgpdExportRequestPayload = z.infer<typeof LgpdExportRequestSchema>;
54
+ export declare const LgpdExportGetDownloadUrlSchema: z.ZodObject<{
55
+ exportId: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ exportId: string;
58
+ }, {
59
+ exportId: string;
60
+ }>;
61
+ export type ILgpdExportGetDownloadUrlPayload = z.infer<typeof LgpdExportGetDownloadUrlSchema>;
62
+ export interface ILgpdExportPubSubEvent {
63
+ exportId: string;
64
+ tenant: string;
65
+ requested_by: {
66
+ uid: string;
67
+ loginId: string;
68
+ };
69
+ trace_id: string;
70
+ }
71
+ export declare const WHATSAPP_MESSAGES_EXPORT_COLUMNS: readonly ["timestamp", "channel_id", "tenant_external_id", "channel_name", "contact_id", "contact_name", "contact_address", "contact_type", "attendant_name", "is_automatic", "direction", "message_type", "message_text"];
72
+ export declare const WHATSAPP_CONTACTS_EXPORT_COLUMNS: readonly ["contact_id", "contact_name", "contact_address", "contact_type", "message_count", "first_message_at", "last_message_at"];
73
+ export declare const LEAD_EXPORT_COLUMNS: readonly ["display_name", "first_name", "last_name", "gender", "status", "address", "origin", "contact_email", "contact_mobile", "contact_phone", "contact_instagram", "contact_type", "qualification_name", "qualification_funnel_level", "distChannel_name", "last_department_name", "created_at", "updated_at"];
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LEAD_EXPORT_COLUMNS = exports.WHATSAPP_CONTACTS_EXPORT_COLUMNS = exports.WHATSAPP_MESSAGES_EXPORT_COLUMNS = exports.LgpdExportGetDownloadUrlSchema = exports.LgpdExportRequestSchema = exports.LGPD_EXPORT_PUBSUB_TOPIC = exports.LGPD_EXPORT_FIRESTORE_PATH = exports.LGPD_EXPORT_SCHEMA_VERSION = void 0;
4
+ const zod_1 = require("zod");
5
+ // ── Constants ──
6
+ exports.LGPD_EXPORT_SCHEMA_VERSION = 1;
7
+ exports.LGPD_EXPORT_FIRESTORE_PATH = "core/nexus/apps/nex-tenants/lgpd_exports";
8
+ exports.LGPD_EXPORT_PUBSUB_TOPIC = "app_nexus_lgpd-exports_request";
9
+ // ── Zod Schemas (callable payloads) ──
10
+ exports.LgpdExportRequestSchema = zod_1.z.object({
11
+ tenant: zod_1.z.string().min(1),
12
+ });
13
+ exports.LgpdExportGetDownloadUrlSchema = zod_1.z.object({
14
+ exportId: zod_1.z.string().min(1),
15
+ });
16
+ // ── Whitelists (CSV column order) ──
17
+ exports.WHATSAPP_MESSAGES_EXPORT_COLUMNS = [
18
+ "timestamp",
19
+ "channel_id",
20
+ "tenant_external_id",
21
+ "channel_name",
22
+ "contact_id",
23
+ "contact_name",
24
+ "contact_address",
25
+ "contact_type",
26
+ "attendant_name",
27
+ "is_automatic",
28
+ "direction",
29
+ "message_type",
30
+ "message_text",
31
+ ];
32
+ exports.WHATSAPP_CONTACTS_EXPORT_COLUMNS = [
33
+ "contact_id",
34
+ "contact_name",
35
+ "contact_address",
36
+ "contact_type",
37
+ "message_count",
38
+ "first_message_at",
39
+ "last_message_at",
40
+ ];
41
+ exports.LEAD_EXPORT_COLUMNS = [
42
+ "display_name",
43
+ "first_name",
44
+ "last_name",
45
+ "gender",
46
+ "status",
47
+ "address",
48
+ "origin",
49
+ "contact_email",
50
+ "contact_mobile",
51
+ "contact_phone",
52
+ "contact_instagram",
53
+ "contact_type",
54
+ "qualification_name",
55
+ "qualification_funnel_level",
56
+ "distChannel_name",
57
+ "last_department_name",
58
+ "created_at",
59
+ "updated_at",
60
+ ];
@@ -0,0 +1,153 @@
1
+ import { z } from "zod";
2
+ import type { IFireGlobalDoc } from "../shared";
3
+
4
+ // ── Constants ──
5
+
6
+ export const LGPD_EXPORT_SCHEMA_VERSION = 1 as const;
7
+
8
+ export const LGPD_EXPORT_FIRESTORE_PATH =
9
+ "core/nexus/apps/nex-tenants/lgpd_exports" as const;
10
+
11
+ export const LGPD_EXPORT_PUBSUB_TOPIC =
12
+ "app_nexus_lgpd-exports_request" as const;
13
+
14
+ // ── Enums / Literals ──
15
+
16
+ export type LgpdExportStatus =
17
+ | "pending"
18
+ | "generating"
19
+ | "ready"
20
+ | "failed"
21
+ | "expired";
22
+
23
+ export type LgpdExportAuditAction =
24
+ | "export_requested"
25
+ | "export_started"
26
+ | "export_completed"
27
+ | "export_failed"
28
+ | "export_downloaded"
29
+ | "export_expired";
30
+
31
+ // ── Sub-interfaces ──
32
+
33
+ export interface ILgpdExportFileEntry {
34
+ name: string;
35
+ record_count: number;
36
+ sha256: string;
37
+ size_bytes: number;
38
+ }
39
+
40
+ export interface ILgpdExportRecordCounts {
41
+ whatsapp_messages: number;
42
+ whatsapp_contacts: number;
43
+ leads: number;
44
+ media_files: number;
45
+ }
46
+
47
+ export interface ILgpdExportError {
48
+ code: string;
49
+ message: string;
50
+ }
51
+
52
+ export interface ILgpdExportRequestedBy {
53
+ uid: string;
54
+ email: string;
55
+ loginId: string;
56
+ }
57
+
58
+ // ── Main Document ──
59
+
60
+ export interface ILgpdExportDoc extends IFireGlobalDoc {
61
+ tenant: string;
62
+ requested_by: ILgpdExportRequestedBy;
63
+ requested_at: Date | null;
64
+ started_at?: Date | null;
65
+ generated_at?: Date | null;
66
+ expires_at?: Date | null;
67
+ status: LgpdExportStatus;
68
+ file_path?: string | null;
69
+ file_size?: number | null;
70
+ sha256?: string | null;
71
+ record_counts?: ILgpdExportRecordCounts | null;
72
+ files?: ILgpdExportFileEntry[] | null;
73
+ error?: ILgpdExportError | null;
74
+ export_schema_version: typeof LGPD_EXPORT_SCHEMA_VERSION;
75
+ notes?: string | null;
76
+ }
77
+
78
+ // ── Zod Schemas (callable payloads) ──
79
+
80
+ export const LgpdExportRequestSchema = z.object({
81
+ tenant: z.string().min(1),
82
+ });
83
+
84
+ export type ILgpdExportRequestPayload = z.infer<typeof LgpdExportRequestSchema>;
85
+
86
+ export const LgpdExportGetDownloadUrlSchema = z.object({
87
+ exportId: z.string().min(1),
88
+ });
89
+
90
+ export type ILgpdExportGetDownloadUrlPayload = z.infer<
91
+ typeof LgpdExportGetDownloadUrlSchema
92
+ >;
93
+
94
+ // ── PubSub Event ──
95
+
96
+ export interface ILgpdExportPubSubEvent {
97
+ exportId: string;
98
+ tenant: string;
99
+ requested_by: {
100
+ uid: string;
101
+ loginId: string;
102
+ };
103
+ trace_id: string;
104
+ }
105
+
106
+ // ── Whitelists (CSV column order) ──
107
+
108
+ export const WHATSAPP_MESSAGES_EXPORT_COLUMNS = [
109
+ "timestamp",
110
+ "channel_id",
111
+ "tenant_external_id",
112
+ "channel_name",
113
+ "contact_id",
114
+ "contact_name",
115
+ "contact_address",
116
+ "contact_type",
117
+ "attendant_name",
118
+ "is_automatic",
119
+ "direction",
120
+ "message_type",
121
+ "message_text",
122
+ ] as const;
123
+
124
+ export const WHATSAPP_CONTACTS_EXPORT_COLUMNS = [
125
+ "contact_id",
126
+ "contact_name",
127
+ "contact_address",
128
+ "contact_type",
129
+ "message_count",
130
+ "first_message_at",
131
+ "last_message_at",
132
+ ] as const;
133
+
134
+ export const LEAD_EXPORT_COLUMNS = [
135
+ "display_name",
136
+ "first_name",
137
+ "last_name",
138
+ "gender",
139
+ "status",
140
+ "address",
141
+ "origin",
142
+ "contact_email",
143
+ "contact_mobile",
144
+ "contact_phone",
145
+ "contact_instagram",
146
+ "contact_type",
147
+ "qualification_name",
148
+ "qualification_funnel_level",
149
+ "distChannel_name",
150
+ "last_department_name",
151
+ "created_at",
152
+ "updated_at",
153
+ ] as const;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.342",
3
+ "version": "1.3.346",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",