evo360-types 1.3.381 → 1.3.384

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.
@@ -5,18 +5,33 @@ export declare const zChannelProviderRefSchema: z.ZodObject<{
5
5
  waba_id: z.ZodOptional<z.ZodString>;
6
6
  phone_number_id: z.ZodOptional<z.ZodString>;
7
7
  business_id: z.ZodOptional<z.ZodString>;
8
+ ig_account_id: z.ZodOptional<z.ZodString>;
9
+ ig_user_token: z.ZodOptional<z.ZodString>;
10
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11
+ username: z.ZodOptional<z.ZodString>;
12
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
8
13
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
9
14
  channel_id: z.ZodOptional<z.ZodString>;
10
15
  channel_uuid: z.ZodOptional<z.ZodString>;
11
16
  waba_id: z.ZodOptional<z.ZodString>;
12
17
  phone_number_id: z.ZodOptional<z.ZodString>;
13
18
  business_id: z.ZodOptional<z.ZodString>;
19
+ ig_account_id: z.ZodOptional<z.ZodString>;
20
+ ig_user_token: z.ZodOptional<z.ZodString>;
21
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
22
+ username: z.ZodOptional<z.ZodString>;
23
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
14
24
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
15
25
  channel_id: z.ZodOptional<z.ZodString>;
16
26
  channel_uuid: z.ZodOptional<z.ZodString>;
17
27
  waba_id: z.ZodOptional<z.ZodString>;
18
28
  phone_number_id: z.ZodOptional<z.ZodString>;
19
29
  business_id: z.ZodOptional<z.ZodString>;
30
+ ig_account_id: z.ZodOptional<z.ZodString>;
31
+ ig_user_token: z.ZodOptional<z.ZodString>;
32
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
33
+ username: z.ZodOptional<z.ZodString>;
34
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
20
35
  }, z.ZodTypeAny, "passthrough">>;
21
36
  export declare const zChannelSchema: z.ZodObject<{
22
37
  id: z.ZodString;
@@ -40,18 +55,33 @@ export declare const zChannelSchema: z.ZodObject<{
40
55
  waba_id: z.ZodOptional<z.ZodString>;
41
56
  phone_number_id: z.ZodOptional<z.ZodString>;
42
57
  business_id: z.ZodOptional<z.ZodString>;
58
+ ig_account_id: z.ZodOptional<z.ZodString>;
59
+ ig_user_token: z.ZodOptional<z.ZodString>;
60
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
61
+ username: z.ZodOptional<z.ZodString>;
62
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
43
63
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
44
64
  channel_id: z.ZodOptional<z.ZodString>;
45
65
  channel_uuid: z.ZodOptional<z.ZodString>;
46
66
  waba_id: z.ZodOptional<z.ZodString>;
47
67
  phone_number_id: z.ZodOptional<z.ZodString>;
48
68
  business_id: z.ZodOptional<z.ZodString>;
69
+ ig_account_id: z.ZodOptional<z.ZodString>;
70
+ ig_user_token: z.ZodOptional<z.ZodString>;
71
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
72
+ username: z.ZodOptional<z.ZodString>;
73
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
49
74
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
50
75
  channel_id: z.ZodOptional<z.ZodString>;
51
76
  channel_uuid: z.ZodOptional<z.ZodString>;
52
77
  waba_id: z.ZodOptional<z.ZodString>;
53
78
  phone_number_id: z.ZodOptional<z.ZodString>;
54
79
  business_id: z.ZodOptional<z.ZodString>;
80
+ ig_account_id: z.ZodOptional<z.ZodString>;
81
+ ig_user_token: z.ZodOptional<z.ZodString>;
82
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
83
+ username: z.ZodOptional<z.ZodString>;
84
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
55
85
  }, z.ZodTypeAny, "passthrough">>;
56
86
  hub_ia: z.ZodOptional<z.ZodAny>;
57
87
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -76,18 +106,33 @@ export declare const zChannelSchema: z.ZodObject<{
76
106
  waba_id: z.ZodOptional<z.ZodString>;
77
107
  phone_number_id: z.ZodOptional<z.ZodString>;
78
108
  business_id: z.ZodOptional<z.ZodString>;
109
+ ig_account_id: z.ZodOptional<z.ZodString>;
110
+ ig_user_token: z.ZodOptional<z.ZodString>;
111
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
112
+ username: z.ZodOptional<z.ZodString>;
113
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
79
114
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
80
115
  channel_id: z.ZodOptional<z.ZodString>;
81
116
  channel_uuid: z.ZodOptional<z.ZodString>;
82
117
  waba_id: z.ZodOptional<z.ZodString>;
83
118
  phone_number_id: z.ZodOptional<z.ZodString>;
84
119
  business_id: z.ZodOptional<z.ZodString>;
120
+ ig_account_id: z.ZodOptional<z.ZodString>;
121
+ ig_user_token: z.ZodOptional<z.ZodString>;
122
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
123
+ username: z.ZodOptional<z.ZodString>;
124
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
85
125
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
86
126
  channel_id: z.ZodOptional<z.ZodString>;
87
127
  channel_uuid: z.ZodOptional<z.ZodString>;
88
128
  waba_id: z.ZodOptional<z.ZodString>;
89
129
  phone_number_id: z.ZodOptional<z.ZodString>;
90
130
  business_id: z.ZodOptional<z.ZodString>;
131
+ ig_account_id: z.ZodOptional<z.ZodString>;
132
+ ig_user_token: z.ZodOptional<z.ZodString>;
133
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
134
+ username: z.ZodOptional<z.ZodString>;
135
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
91
136
  }, z.ZodTypeAny, "passthrough">>;
92
137
  hub_ia: z.ZodOptional<z.ZodAny>;
93
138
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -112,18 +157,33 @@ export declare const zChannelSchema: z.ZodObject<{
112
157
  waba_id: z.ZodOptional<z.ZodString>;
113
158
  phone_number_id: z.ZodOptional<z.ZodString>;
114
159
  business_id: z.ZodOptional<z.ZodString>;
160
+ ig_account_id: z.ZodOptional<z.ZodString>;
161
+ ig_user_token: z.ZodOptional<z.ZodString>;
162
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
163
+ username: z.ZodOptional<z.ZodString>;
164
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
115
165
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
116
166
  channel_id: z.ZodOptional<z.ZodString>;
117
167
  channel_uuid: z.ZodOptional<z.ZodString>;
118
168
  waba_id: z.ZodOptional<z.ZodString>;
119
169
  phone_number_id: z.ZodOptional<z.ZodString>;
120
170
  business_id: z.ZodOptional<z.ZodString>;
171
+ ig_account_id: z.ZodOptional<z.ZodString>;
172
+ ig_user_token: z.ZodOptional<z.ZodString>;
173
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
174
+ username: z.ZodOptional<z.ZodString>;
175
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
121
176
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
122
177
  channel_id: z.ZodOptional<z.ZodString>;
123
178
  channel_uuid: z.ZodOptional<z.ZodString>;
124
179
  waba_id: z.ZodOptional<z.ZodString>;
125
180
  phone_number_id: z.ZodOptional<z.ZodString>;
126
181
  business_id: z.ZodOptional<z.ZodString>;
182
+ ig_account_id: z.ZodOptional<z.ZodString>;
183
+ ig_user_token: z.ZodOptional<z.ZodString>;
184
+ token_expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
185
+ username: z.ZodOptional<z.ZodString>;
186
+ token_health: z.ZodOptional<z.ZodEnum<["ok", "expiring", "failed"]>>;
127
187
  }, z.ZodTypeAny, "passthrough">>;
128
188
  hub_ia: z.ZodOptional<z.ZodAny>;
129
189
  }, z.ZodTypeAny, "passthrough">>;
@@ -9,6 +9,12 @@ exports.zChannelProviderRefSchema = zod_1.z.object({
9
9
  waba_id: zod_1.z.string().optional(),
10
10
  phone_number_id: zod_1.z.string().optional(),
11
11
  business_id: zod_1.z.string().optional(),
12
+ // hub-instagram (feat-030)
13
+ ig_account_id: zod_1.z.string().optional(),
14
+ ig_user_token: zod_1.z.string().optional(),
15
+ token_expires_at: zod_1.z.coerce.date().nullable().optional(),
16
+ username: zod_1.z.string().optional(),
17
+ token_health: zod_1.z.enum(['ok', 'expiring', 'failed']).optional(),
12
18
  }).passthrough();
13
19
  exports.zChannelSchema = zod_schemas_1.zFireDocSchema
14
20
  .extend({
@@ -7,6 +7,12 @@ export const zChannelProviderRefSchema = z.object({
7
7
  waba_id: z.string().optional(),
8
8
  phone_number_id: z.string().optional(),
9
9
  business_id: z.string().optional(),
10
+ // hub-instagram (feat-030)
11
+ ig_account_id: z.string().optional(),
12
+ ig_user_token: z.string().optional(),
13
+ token_expires_at: z.coerce.date().nullable().optional(),
14
+ username: z.string().optional(),
15
+ token_health: z.enum(['ok', 'expiring', 'failed']).optional(),
10
16
  }).passthrough();
11
17
 
12
18
  export const zChannelSchema = zFireDocSchema
@@ -224,6 +224,9 @@ export declare const zChatContactSchema: z.ZodObject<{
224
224
  wa_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
225
  provider: z.ZodOptional<z.ZodString>;
226
226
  channel_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
227
+ ig_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
+ username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
+ profile_pic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
230
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
228
231
  id: z.ZodString;
229
232
  ref: z.ZodAny;
@@ -449,6 +452,9 @@ export declare const zChatContactSchema: z.ZodObject<{
449
452
  wa_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
450
453
  provider: z.ZodOptional<z.ZodString>;
451
454
  channel_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
455
+ ig_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
456
+ username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
457
+ profile_pic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
452
458
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
453
459
  id: z.ZodString;
454
460
  ref: z.ZodAny;
@@ -674,4 +680,7 @@ export declare const zChatContactSchema: z.ZodObject<{
674
680
  wa_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
675
681
  provider: z.ZodOptional<z.ZodString>;
676
682
  channel_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
683
+ ig_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
684
+ username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
685
+ profile_pic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
677
686
  }, z.ZodTypeAny, "passthrough">>;
@@ -27,5 +27,9 @@ exports.zChatContactSchema = zod_schemas_1.zFireDocSchema
27
27
  wa_id: zod_1.z.string().nullable().optional(),
28
28
  provider: zod_1.z.string().optional(),
29
29
  channel_ids: zod_1.z.array(zod_1.z.string()).optional(),
30
+ // hub-instagram fields (feat-030)
31
+ ig_id: zod_1.z.string().nullable().optional(),
32
+ username: zod_1.z.string().nullable().optional(),
33
+ profile_pic: zod_1.z.string().nullable().optional(),
30
34
  })
31
35
  .passthrough();
@@ -29,5 +29,9 @@ export const zChatContactSchema = zFireDocSchema
29
29
  wa_id: z.string().nullable().optional(),
30
30
  provider: z.string().optional(),
31
31
  channel_ids: z.array(z.string()).optional(),
32
+ // hub-instagram fields (feat-030)
33
+ ig_id: z.string().nullable().optional(),
34
+ username: z.string().nullable().optional(),
35
+ profile_pic: z.string().nullable().optional(),
32
36
  })
33
37
  .passthrough();
@@ -0,0 +1,103 @@
1
+ import { z } from "zod";
2
+ export declare const zIgSetupStatusSchema: z.ZodEnum<["pending", "connected", "error"]>;
3
+ export declare const zIgSetupStepsSchema: z.ZodObject<{
4
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
5
+ subscribed: z.ZodOptional<z.ZodBoolean>;
6
+ indexed: z.ZodOptional<z.ZodBoolean>;
7
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
8
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
9
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
10
+ subscribed: z.ZodOptional<z.ZodBoolean>;
11
+ indexed: z.ZodOptional<z.ZodBoolean>;
12
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
13
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
15
+ subscribed: z.ZodOptional<z.ZodBoolean>;
16
+ indexed: z.ZodOptional<z.ZodBoolean>;
17
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
18
+ }, z.ZodTypeAny, "passthrough">>;
19
+ export declare const zIgSetupSchema: z.ZodObject<{
20
+ state: z.ZodString;
21
+ tenant_id: z.ZodOptional<z.ZodString>;
22
+ channel_id: z.ZodOptional<z.ZodString>;
23
+ status: z.ZodEnum<["pending", "connected", "error"]>;
24
+ last_error: z.ZodOptional<z.ZodString>;
25
+ steps_completed: z.ZodOptional<z.ZodObject<{
26
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
27
+ subscribed: z.ZodOptional<z.ZodBoolean>;
28
+ indexed: z.ZodOptional<z.ZodBoolean>;
29
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
30
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
31
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
32
+ subscribed: z.ZodOptional<z.ZodBoolean>;
33
+ indexed: z.ZodOptional<z.ZodBoolean>;
34
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
35
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
36
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
37
+ subscribed: z.ZodOptional<z.ZodBoolean>;
38
+ indexed: z.ZodOptional<z.ZodBoolean>;
39
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
40
+ }, z.ZodTypeAny, "passthrough">>>;
41
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
42
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
43
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
44
+ connected_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
45
+ ig_account_id: z.ZodOptional<z.ZodString>;
46
+ username: z.ZodOptional<z.ZodString>;
47
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
48
+ state: z.ZodString;
49
+ tenant_id: z.ZodOptional<z.ZodString>;
50
+ channel_id: z.ZodOptional<z.ZodString>;
51
+ status: z.ZodEnum<["pending", "connected", "error"]>;
52
+ last_error: z.ZodOptional<z.ZodString>;
53
+ steps_completed: z.ZodOptional<z.ZodObject<{
54
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
55
+ subscribed: z.ZodOptional<z.ZodBoolean>;
56
+ indexed: z.ZodOptional<z.ZodBoolean>;
57
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
58
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
59
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
60
+ subscribed: z.ZodOptional<z.ZodBoolean>;
61
+ indexed: z.ZodOptional<z.ZodBoolean>;
62
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
63
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
64
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
65
+ subscribed: z.ZodOptional<z.ZodBoolean>;
66
+ indexed: z.ZodOptional<z.ZodBoolean>;
67
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
68
+ }, z.ZodTypeAny, "passthrough">>>;
69
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
70
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
71
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
72
+ connected_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
73
+ ig_account_id: z.ZodOptional<z.ZodString>;
74
+ username: z.ZodOptional<z.ZodString>;
75
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
76
+ state: z.ZodString;
77
+ tenant_id: z.ZodOptional<z.ZodString>;
78
+ channel_id: z.ZodOptional<z.ZodString>;
79
+ status: z.ZodEnum<["pending", "connected", "error"]>;
80
+ last_error: z.ZodOptional<z.ZodString>;
81
+ steps_completed: z.ZodOptional<z.ZodObject<{
82
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
83
+ subscribed: z.ZodOptional<z.ZodBoolean>;
84
+ indexed: z.ZodOptional<z.ZodBoolean>;
85
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
86
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
87
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
88
+ subscribed: z.ZodOptional<z.ZodBoolean>;
89
+ indexed: z.ZodOptional<z.ZodBoolean>;
90
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
91
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
92
+ token_exchanged: z.ZodOptional<z.ZodBoolean>;
93
+ subscribed: z.ZodOptional<z.ZodBoolean>;
94
+ indexed: z.ZodOptional<z.ZodBoolean>;
95
+ channel_updated: z.ZodOptional<z.ZodBoolean>;
96
+ }, z.ZodTypeAny, "passthrough">>>;
97
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
98
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
99
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
100
+ connected_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
101
+ ig_account_id: z.ZodOptional<z.ZodString>;
102
+ username: z.ZodOptional<z.ZodString>;
103
+ }, z.ZodTypeAny, "passthrough">>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zIgSetupSchema = exports.zIgSetupStepsSchema = exports.zIgSetupStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.zIgSetupStatusSchema = zod_1.z.enum([
6
+ 'pending',
7
+ 'connected',
8
+ 'error',
9
+ ]);
10
+ exports.zIgSetupStepsSchema = zod_1.z.object({
11
+ token_exchanged: zod_1.z.boolean().optional(),
12
+ subscribed: zod_1.z.boolean().optional(),
13
+ indexed: zod_1.z.boolean().optional(),
14
+ channel_updated: zod_1.z.boolean().optional(),
15
+ }).passthrough();
16
+ exports.zIgSetupSchema = zod_1.z.object({
17
+ state: zod_1.z.string(),
18
+ tenant_id: zod_1.z.string().optional(),
19
+ channel_id: zod_1.z.string().optional(),
20
+ status: exports.zIgSetupStatusSchema,
21
+ last_error: zod_1.z.string().optional(),
22
+ steps_completed: exports.zIgSetupStepsSchema.optional(),
23
+ created_at: zod_1.z.coerce.date().nullable().optional(),
24
+ updated_at: zod_1.z.coerce.date().nullable().optional(),
25
+ expires_at: zod_1.z.coerce.date().nullable().optional(),
26
+ connected_at: zod_1.z.coerce.date().nullable().optional(),
27
+ ig_account_id: zod_1.z.string().optional(),
28
+ username: zod_1.z.string().optional(),
29
+ }).passthrough();
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+
3
+ export const zIgSetupStatusSchema = z.enum([
4
+ 'pending',
5
+ 'connected',
6
+ 'error',
7
+ ]);
8
+
9
+ export const zIgSetupStepsSchema = z.object({
10
+ token_exchanged: z.boolean().optional(),
11
+ subscribed: z.boolean().optional(),
12
+ indexed: z.boolean().optional(),
13
+ channel_updated: z.boolean().optional(),
14
+ }).passthrough();
15
+
16
+ export const zIgSetupSchema = z.object({
17
+ state: z.string(),
18
+ tenant_id: z.string().optional(),
19
+ channel_id: z.string().optional(),
20
+
21
+ status: zIgSetupStatusSchema,
22
+ last_error: z.string().optional(),
23
+ steps_completed: zIgSetupStepsSchema.optional(),
24
+
25
+ created_at: z.coerce.date().nullable().optional(),
26
+ updated_at: z.coerce.date().nullable().optional(),
27
+ expires_at: z.coerce.date().nullable().optional(),
28
+ connected_at: z.coerce.date().nullable().optional(),
29
+
30
+ ig_account_id: z.string().optional(),
31
+ username: z.string().optional(),
32
+ }).passthrough();
package/dist/index.d.ts CHANGED
@@ -46,6 +46,7 @@ export * from "./apps/evo-chat/ticket/zod-schemas";
46
46
  export * from "./apps/evo-chat/inbox/zod-schemas";
47
47
  export * from "./apps/evo-chat/waba-template/zod-schemas";
48
48
  export * from "./apps/evo-chat/waba-setup/zod-schemas";
49
+ export * from "./apps/evo-chat/ig-setup/zod-schemas";
49
50
  export * from "./apps/evo-chat/quick-reply/zod-schemas";
50
51
  export * from "./apps/evo-hub-ia/channel/zod-schemas";
51
52
  export * from "./apps/evo-hub-ia/v1/zod-schemas";
package/dist/index.js CHANGED
@@ -64,6 +64,7 @@ __exportStar(require("./apps/evo-chat/ticket/zod-schemas"), exports);
64
64
  __exportStar(require("./apps/evo-chat/inbox/zod-schemas"), exports);
65
65
  __exportStar(require("./apps/evo-chat/waba-template/zod-schemas"), exports);
66
66
  __exportStar(require("./apps/evo-chat/waba-setup/zod-schemas"), exports);
67
+ __exportStar(require("./apps/evo-chat/ig-setup/zod-schemas"), exports);
67
68
  __exportStar(require("./apps/evo-chat/quick-reply/zod-schemas"), exports);
68
69
  __exportStar(require("./apps/evo-hub-ia/channel/zod-schemas"), exports);
69
70
  __exportStar(require("./apps/evo-hub-ia/v1/zod-schemas"), exports);
package/dist/index.ts CHANGED
@@ -49,6 +49,7 @@ export * from "./apps/evo-chat/ticket/zod-schemas";
49
49
  export * from "./apps/evo-chat/inbox/zod-schemas";
50
50
  export * from "./apps/evo-chat/waba-template/zod-schemas";
51
51
  export * from "./apps/evo-chat/waba-setup/zod-schemas";
52
+ export * from "./apps/evo-chat/ig-setup/zod-schemas";
52
53
  export * from "./apps/evo-chat/quick-reply/zod-schemas";
53
54
  export * from "./apps/evo-hub-ia/channel/zod-schemas";
54
55
  export * from "./apps/evo-hub-ia/v1/zod-schemas";
@@ -1,14 +1,20 @@
1
1
  import type { IHubIAConfig } from "../../evo-hub-ia/channel";
2
2
  import { IFireDoc } from "../../shared";
3
- export type ChannelProvider = 'chatbee' | 'hub-waba';
3
+ export type ChannelProvider = 'chatbee' | 'hub-waba' | 'hub-instagram';
4
4
  export type ChannelType = 'waba' | 'instagram' | 'telegram' | 'email' | 'sms';
5
5
  export type ChannelStatus = 'active' | 'paused' | 'disabled' | 'pending';
6
+ export type IgTokenHealth = 'ok' | 'expiring' | 'failed';
6
7
  export interface IChannelProviderRef {
7
8
  channel_id?: string;
8
9
  channel_uuid?: string;
9
10
  waba_id?: string;
10
11
  phone_number_id?: string;
11
12
  business_id?: string;
13
+ ig_account_id?: string;
14
+ ig_user_token?: string;
15
+ token_expires_at?: Date | null;
16
+ username?: string;
17
+ token_health?: IgTokenHealth;
12
18
  }
13
19
  export interface ICallDeflectionConfig {
14
20
  enabled: boolean;
@@ -3,12 +3,14 @@ import { IFireDoc } from "../../shared";
3
3
 
4
4
  // ── Channel provider/type enums ──
5
5
 
6
- export type ChannelProvider = 'chatbee' | 'hub-waba';
6
+ export type ChannelProvider = 'chatbee' | 'hub-waba' | 'hub-instagram';
7
7
  export type ChannelType = 'waba' | 'instagram' | 'telegram' | 'email' | 'sms';
8
8
  export type ChannelStatus = 'active' | 'paused' | 'disabled' | 'pending';
9
9
 
10
10
  // ── Provider-specific references ──
11
11
 
12
+ export type IgTokenHealth = 'ok' | 'expiring' | 'failed';
13
+
12
14
  export interface IChannelProviderRef {
13
15
  // chatbee
14
16
  channel_id?: string;
@@ -17,6 +19,12 @@ export interface IChannelProviderRef {
17
19
  waba_id?: string;
18
20
  phone_number_id?: string;
19
21
  business_id?: string;
22
+ // hub-instagram (feat-030) — IG user token long-lived (60d, renovável)
23
+ ig_account_id?: string; // IGSID da conta business (também chave do channel-index)
24
+ ig_user_token?: string; // long-lived (MVP em Firestore; backlog Secret Manager)
25
+ token_expires_at?: Date | null; // expiração do long-lived token
26
+ username?: string; // @handle da conta business
27
+ token_health?: IgTokenHealth; // saúde do refresh (cron DS1)
20
28
  }
21
29
 
22
30
  // ── Calls config (feat-029) ──
@@ -19,8 +19,11 @@ export interface IChatContact extends IFireDoc {
19
19
  userRef?: FirestoreDocumentReference;
20
20
  bsuid?: string | null;
21
21
  wa_id?: string | null;
22
- provider?: 'chatbee' | 'hub-waba' | string;
22
+ provider?: 'chatbee' | 'hub-waba' | 'hub-instagram' | string;
23
23
  channel_ids?: string[];
24
+ ig_id?: string | null;
25
+ username?: string | null;
26
+ profile_pic?: string | null;
24
27
  call_permission?: ICallPermissionState;
25
28
  [key: string]: unknown;
26
29
  }
@@ -26,9 +26,14 @@ export interface IChatContact extends IFireDoc {
26
26
  // ── hub-waba fields (optional — backward compatible) ──
27
27
  bsuid?: string | null;
28
28
  wa_id?: string | null;
29
- provider?: 'chatbee' | 'hub-waba' | string;
29
+ provider?: 'chatbee' | 'hub-waba' | 'hub-instagram' | string;
30
30
  channel_ids?: string[];
31
31
 
32
+ // ── hub-instagram fields (feat-030 — optional, backward compatible) ──
33
+ ig_id?: string | null; // IGSID do contato (scoped por app/conta) — chave de dedup
34
+ username?: string | null; // @handle do Instagram
35
+ profile_pic?: string | null; // URL da foto de perfil (do GET /{IGSID})
36
+
32
37
  // ── call permission (feat-029 Fase 2) ──
33
38
  // Última permissão de ligação conhecida deste contato (espelho local; a fonte
34
39
  // de verdade é a Meta via GET /{phone_number_id}/call_permissions). Atualizado
@@ -21,3 +21,5 @@ export declare const HubWabaCollections: {
21
21
  };
22
22
  export declare const WABA_SETUP_PATH = "platform/evo-chat/waba-setup";
23
23
  export declare const WABA_CHANNEL_INDEX_PATH = "platform/evo-chat/waba-channel-index";
24
+ export declare const IG_SETUP_PATH = "platform/evo-chat/ig-setup";
25
+ export declare const IG_CHANNEL_INDEX_PATH = "platform/evo-chat/ig-channel-index";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WABA_CHANNEL_INDEX_PATH = exports.WABA_SETUP_PATH = exports.HubWabaCollections = exports.CALL_SIGNAL_REMOTE_DOC = exports.CALL_SIGNALING_COLLECTION = exports.CALL_SESSIONS_COLLECTION = exports.INBOXES_COLLECTION = exports.TICKETS_COLLECTION = exports.THREAD_MESSAGES_COLLECTION = exports.THREADS_COLLECTION = exports.CHANNELS_COLLECTION = exports.CHATBEE_CHANNELS_COLLECTION = exports.HSM_MESSAGES_COLLECTION = exports.PROTOCOLS_COLLECTION = exports.CONTACTS_COLLECTION = exports.TICKET_CLOSE_TYPES_COLLECTION = exports.TICKET_CLOSES_COLLECTION = exports.TICKET_CLOSES = exports.CHAT_DICS_COLLECTION = exports.EVO_CHAT_APP = void 0;
3
+ exports.IG_CHANNEL_INDEX_PATH = exports.IG_SETUP_PATH = exports.WABA_CHANNEL_INDEX_PATH = exports.WABA_SETUP_PATH = exports.HubWabaCollections = exports.CALL_SIGNAL_REMOTE_DOC = exports.CALL_SIGNALING_COLLECTION = exports.CALL_SESSIONS_COLLECTION = exports.INBOXES_COLLECTION = exports.TICKETS_COLLECTION = exports.THREAD_MESSAGES_COLLECTION = exports.THREADS_COLLECTION = exports.CHANNELS_COLLECTION = exports.CHATBEE_CHANNELS_COLLECTION = exports.HSM_MESSAGES_COLLECTION = exports.PROTOCOLS_COLLECTION = exports.CONTACTS_COLLECTION = exports.TICKET_CLOSE_TYPES_COLLECTION = exports.TICKET_CLOSES_COLLECTION = exports.TICKET_CLOSES = exports.CHAT_DICS_COLLECTION = exports.EVO_CHAT_APP = void 0;
4
4
  //EVO Chat Application Doc
5
5
  exports.EVO_CHAT_APP = "evo-chat";
6
6
  //dictionaries
@@ -33,3 +33,6 @@ exports.HubWabaCollections = {
33
33
  // hub-waba cross-tenant platform paths
34
34
  exports.WABA_SETUP_PATH = "platform/evo-chat/waba-setup";
35
35
  exports.WABA_CHANNEL_INDEX_PATH = "platform/evo-chat/waba-channel-index";
36
+ // hub-instagram cross-tenant platform paths (feat-030)
37
+ exports.IG_SETUP_PATH = "platform/evo-chat/ig-setup"; // bridging onboarding (key = state token)
38
+ exports.IG_CHANNEL_INDEX_PATH = "platform/evo-chat/ig-channel-index"; // ig_account_id -> tenant + channel
@@ -38,3 +38,7 @@ export const HubWabaCollections = {
38
38
  // hub-waba cross-tenant platform paths
39
39
  export const WABA_SETUP_PATH = "platform/evo-chat/waba-setup";
40
40
  export const WABA_CHANNEL_INDEX_PATH = "platform/evo-chat/waba-channel-index";
41
+
42
+ // hub-instagram cross-tenant platform paths (feat-030)
43
+ export const IG_SETUP_PATH = "platform/evo-chat/ig-setup"; // bridging onboarding (key = state token)
44
+ export const IG_CHANNEL_INDEX_PATH = "platform/evo-chat/ig-channel-index"; // ig_account_id -> tenant + channel
@@ -0,0 +1,21 @@
1
+ export type IgSetupStatus = 'pending' | 'connected' | 'error';
2
+ export interface IIgSetupSteps {
3
+ token_exchanged?: boolean;
4
+ subscribed?: boolean;
5
+ indexed?: boolean;
6
+ channel_updated?: boolean;
7
+ }
8
+ export interface IIgSetup {
9
+ state: string;
10
+ tenant_id?: string;
11
+ channel_id?: string;
12
+ status: IgSetupStatus;
13
+ last_error?: string;
14
+ steps_completed?: IIgSetupSteps;
15
+ created_at: Date | null;
16
+ updated_at?: Date | null;
17
+ expires_at?: Date | null;
18
+ connected_at?: Date | null;
19
+ ig_account_id?: string;
20
+ username?: string;
21
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Bridging doc cross-tenant entre uma conta Instagram e canal/tenant (feat-030).
3
+ // Path: platform/evo-chat/ig-setup/{state} (state = token OAuth assinado/aleatório, document ID).
4
+ // Criado no clique "Conectar Instagram"; resolvido no callback OAuth (Instagram Login).
5
+ // Frontend NUNCA lê este doc diretamente (reflete pending->active pelo doc do canal).
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ // Bridging doc cross-tenant entre uma conta Instagram e canal/tenant (feat-030).
2
+ // Path: platform/evo-chat/ig-setup/{state} (state = token OAuth assinado/aleatório, document ID).
3
+ // Criado no clique "Conectar Instagram"; resolvido no callback OAuth (Instagram Login).
4
+ // Frontend NUNCA lê este doc diretamente (reflete pending->active pelo doc do canal).
5
+
6
+ export type IgSetupStatus = 'pending' | 'connected' | 'error';
7
+
8
+ export interface IIgSetupSteps {
9
+ token_exchanged?: boolean; // code -> short-lived -> long-lived
10
+ subscribed?: boolean; // POST /me/subscribed_apps (messages, comments)
11
+ indexed?: boolean; // ig-channel-index/{ig_account_id} criado
12
+ channel_updated?: boolean; // canal do tenant marcado active + provider_ref
13
+ }
14
+
15
+ export interface IIgSetup {
16
+ // Identificação
17
+ state: string; // token OAuth (também é o document ID)
18
+ tenant_id?: string;
19
+ channel_id?: string;
20
+
21
+ // Estado
22
+ status: IgSetupStatus;
23
+ last_error?: string; // ex.: IG_ACCOUNT_TAKEN
24
+ steps_completed?: IIgSetupSteps;
25
+
26
+ // Timestamps
27
+ created_at: Date | null;
28
+ updated_at?: Date | null;
29
+ expires_at?: Date | null; // 30 dias após created_at — informativo (sem cron no MVP)
30
+ connected_at?: Date | null;
31
+
32
+ // Dados Instagram (preenchidos no callback)
33
+ ig_account_id?: string; // IGSID da conta business
34
+ username?: string;
35
+ }
@@ -10,6 +10,7 @@ export * from "./ticket";
10
10
  export * from "./inbox";
11
11
  export * from "./waba-template";
12
12
  export * from "./waba-setup";
13
+ export * from "./ig-setup";
13
14
  export * from "./quick-reply";
14
15
  export * from "./search";
15
16
  export declare const EvoChatPermissions: {
@@ -27,6 +27,7 @@ __exportStar(require("./ticket"), exports);
27
27
  __exportStar(require("./inbox"), exports);
28
28
  __exportStar(require("./waba-template"), exports);
29
29
  __exportStar(require("./waba-setup"), exports);
30
+ __exportStar(require("./ig-setup"), exports);
30
31
  __exportStar(require("./quick-reply"), exports);
31
32
  __exportStar(require("./search"), exports);
32
33
  // Permissões para o evo-chat
@@ -10,6 +10,7 @@ export * from "./ticket";
10
10
  export * from "./inbox";
11
11
  export * from "./waba-template";
12
12
  export * from "./waba-setup";
13
+ export * from "./ig-setup";
13
14
  export * from "./quick-reply";
14
15
  export * from "./search";
15
16
 
@@ -1,4 +1,15 @@
1
1
  export declare const EvoMcpPermissions: {
2
+ /**
3
+ * @deprecated desde feat-022 (2026-06-03). Não gateia mais a conexão nem
4
+ * tools — a conexão passou a exigir Read/WriteLowRisk/WriteHighRisk.
5
+ * Mantido exportado apenas para compatibilidade com consumidores antigos.
6
+ */
2
7
  readonly Access: "evo_mcp_access";
8
+ /** Gate de leitura: exigido por toda read tool, junto da perm read do módulo. */
9
+ readonly Read: "evo_mcp_read";
10
+ /** Gate de write reversível/baixo blast-radius (criar lead, fechar ticket, etc.). */
11
+ readonly WriteLowRisk: "evo_mcp_write_low_risk";
12
+ /** Gate de write com side-effect externo/irreversível (enviar WhatsApp, mover appointment, etc.). */
13
+ readonly WriteHighRisk: "evo_mcp_write_high_risk";
3
14
  };
4
15
  export type EvoMcpPermissions = (typeof EvoMcpPermissions)[keyof typeof EvoMcpPermissions];
@@ -2,6 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EvoMcpPermissions = void 0;
4
4
  // Permissões para o evo-mcp (servidor MCP tenant-level)
5
+ //
6
+ // Modelo de gating (feat-022, reconciliação 2026-06-03):
7
+ // - Conexão: usuário precisa de Read OU WriteLowRisk OU WriteHighRisk no tenant.
8
+ // - Read tool: Read + perm read do módulo.
9
+ // - Write low-risk: WriteLowRisk + perm write do módulo.
10
+ // - Write high-risk: WriteHighRisk + perm write do módulo.
11
+ // - Admin (is_admin no JWT) bypassa membership + perms (tenant continua obrigatório).
5
12
  exports.EvoMcpPermissions = {
13
+ /**
14
+ * @deprecated desde feat-022 (2026-06-03). Não gateia mais a conexão nem
15
+ * tools — a conexão passou a exigir Read/WriteLowRisk/WriteHighRisk.
16
+ * Mantido exportado apenas para compatibilidade com consumidores antigos.
17
+ */
6
18
  Access: "evo_mcp_access",
19
+ /** Gate de leitura: exigido por toda read tool, junto da perm read do módulo. */
20
+ Read: "evo_mcp_read",
21
+ /** Gate de write reversível/baixo blast-radius (criar lead, fechar ticket, etc.). */
22
+ WriteLowRisk: "evo_mcp_write_low_risk",
23
+ /** Gate de write com side-effect externo/irreversível (enviar WhatsApp, mover appointment, etc.). */
24
+ WriteHighRisk: "evo_mcp_write_high_risk",
7
25
  };
@@ -1,6 +1,24 @@
1
1
  // Permissões para o evo-mcp (servidor MCP tenant-level)
2
+ //
3
+ // Modelo de gating (feat-022, reconciliação 2026-06-03):
4
+ // - Conexão: usuário precisa de Read OU WriteLowRisk OU WriteHighRisk no tenant.
5
+ // - Read tool: Read + perm read do módulo.
6
+ // - Write low-risk: WriteLowRisk + perm write do módulo.
7
+ // - Write high-risk: WriteHighRisk + perm write do módulo.
8
+ // - Admin (is_admin no JWT) bypassa membership + perms (tenant continua obrigatório).
2
9
  export const EvoMcpPermissions = {
10
+ /**
11
+ * @deprecated desde feat-022 (2026-06-03). Não gateia mais a conexão nem
12
+ * tools — a conexão passou a exigir Read/WriteLowRisk/WriteHighRisk.
13
+ * Mantido exportado apenas para compatibilidade com consumidores antigos.
14
+ */
3
15
  Access: "evo_mcp_access",
16
+ /** Gate de leitura: exigido por toda read tool, junto da perm read do módulo. */
17
+ Read: "evo_mcp_read",
18
+ /** Gate de write reversível/baixo blast-radius (criar lead, fechar ticket, etc.). */
19
+ WriteLowRisk: "evo_mcp_write_low_risk",
20
+ /** Gate de write com side-effect externo/irreversível (enviar WhatsApp, mover appointment, etc.). */
21
+ WriteHighRisk: "evo_mcp_write_high_risk",
4
22
  } as const;
5
23
 
6
24
  export type EvoMcpPermissions =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.381",
3
+ "version": "1.3.384",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",