@periskope/types 0.6.74 → 0.6.76

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/types.d.ts CHANGED
@@ -34,6 +34,19 @@ export type OrgPlanNonEnterprise = {
34
34
  percent_off: number | null;
35
35
  };
36
36
  export type OrgPlan<T extends AllPlans | Enterprise> = T extends Enterprise ? OrgPlanEnterprise : T extends AllPlans ? OrgPlanNonEnterprise : never;
37
+ export type MicrosurveyData = {
38
+ key: string;
39
+ text: string;
40
+ checked: boolean;
41
+ }[];
42
+ export type OrgMetadata = {
43
+ phone_number: string;
44
+ ticket_prefix: string;
45
+ referralSource?: string;
46
+ surveyData?: MicrosurveyData;
47
+ onboarding: Record<string, boolean>;
48
+ onboarding_completed_at: Date | null;
49
+ };
37
50
  export type OrgType = OverrideProperties<Merge<Tables<'tbl_org'>, {
38
51
  user: Tables<'tbl_org_members'>;
39
52
  members: Tables<'tbl_org_members'>[];
@@ -49,6 +62,7 @@ export type OrgType = OverrideProperties<Merge<Tables<'tbl_org'>, {
49
62
  stripe_customer_details: _Stripe.Customer | null;
50
63
  stripe_subscription_details: Array<_Stripe.Subscription> | null;
51
64
  stripe_customer_id: _Stripe.Customer['id'] | null;
65
+ org_metadata: OrgMetadata;
52
66
  }>;
53
67
  export type ChatMemberType = Merge<Tables<'tbl_chat_participants'>, Tables<'tbl_contacts'>>;
54
68
  export type ChatType = Merge<Tables<'view_chats'>, {
@@ -162,20 +176,69 @@ export type PhoneStateType = {
162
176
  message?: string;
163
177
  error?: string;
164
178
  };
165
- export type TicketLogType = OverrideProperties<Tables<'tbl_integration_logs'>, {
166
- integration_name: IntegrationLogType.NEW_TICKET;
167
- metadata: {
179
+ export type TicketInfoType = {
180
+ chat: {
181
+ chat_id: string;
182
+ chat_name: string;
183
+ chat_image: string;
184
+ chat_labels: string;
185
+ [key: string]: string;
186
+ };
187
+ message: {
188
+ text: string;
189
+ timestamp: string;
190
+ message_id: string;
191
+ sender_phone: string;
192
+ };
193
+ ticket: {
194
+ ticket_labels: string;
195
+ status: string;
196
+ subject: string;
197
+ assignee: string;
198
+ due_date: string;
199
+ priority: 0 | 1 | 2 | 3 | 4;
200
+ raised_by: string;
168
201
  ticket_id: string;
169
- name: string;
202
+ created_at: string;
170
203
  };
171
- }>;
172
- export type IntegrationLogDetailsType = TicketLogType;
204
+ };
173
205
  export declare enum IntegrationLogType {
174
- NEW_TICKET = "ticket.created"
206
+ NEW_CHAT = "chat.created",
207
+ NEW_MESSAGE = "message.created",
208
+ MESSAGE_UPDATED = "message.updated",
209
+ MESSAGE_ACK_UPDATED = "message.ack.updated",
210
+ REACTION_CREATED = "reaction.created",
211
+ REACTION_UPDATED = "reaction.updated",
212
+ REACTION_DELETED = "reaction.deleted",
213
+ NEW_TICKET = "ticket.created",
214
+ TICKET_UPDATED = "ticket.updated"
175
215
  }
176
- export type LogTypeMap<T extends IntegrationLogType> = T extends IntegrationLogType.NEW_TICKET ? TicketLogType : Tables<'tbl_integration_logs'>;
216
+ export type IntegrationLogMetadataType<T extends IntegrationLogType> = T extends IntegrationLogType.NEW_TICKET | IntegrationLogType.TICKET_UPDATED ? TicketInfoType : T extends IntegrationLogType.NEW_CHAT ? Tables<'tbl_chats'> : T extends IntegrationLogType.NEW_MESSAGE | IntegrationLogType.MESSAGE_UPDATED | IntegrationLogType.MESSAGE_ACK_UPDATED ? Tables<'tbl_chat_messages'> : T extends IntegrationLogType.REACTION_CREATED | IntegrationLogType.REACTION_UPDATED | IntegrationLogType.REACTION_DELETED ? Tables<'tbl_chat_reactions'> : {
217
+ [key: string]: unknown;
218
+ };
219
+ export type IntegrationLogDetailsType<T extends IntegrationLogType> = OverrideProperties<Tables<'tbl_integration_logs'>, {
220
+ integration_name: T;
221
+ metadata: {
222
+ event: IntegrationLogMetadataType<T> & {
223
+ event_type: string;
224
+ org_id: string;
225
+ previous_attributes: {
226
+ [key: string]: unknown;
227
+ };
228
+ };
229
+ hook_id: string;
230
+ name: string;
231
+ };
232
+ }>;
177
233
  export type APIAuthDetails = {
178
234
  org_details: Tables<'view_org'> | null;
179
235
  phone_details: Tables<'tbl_org_phones'> | null;
180
236
  token_details: Tables<'tbl_integration_tokens'> | null;
181
237
  };
238
+ export type UserPreferences = {
239
+ theme: 'light' | 'dark';
240
+ language: 'en' | 'es';
241
+ left_sidebar_open: boolean;
242
+ right_sidepanel_open: boolean;
243
+ sync_wa_unread_count: boolean;
244
+ };
package/dist/types.js CHANGED
@@ -52,5 +52,13 @@ exports.SUPPORTED_TYPES = [
52
52
  ];
53
53
  var IntegrationLogType;
54
54
  (function (IntegrationLogType) {
55
+ IntegrationLogType["NEW_CHAT"] = "chat.created";
56
+ IntegrationLogType["NEW_MESSAGE"] = "message.created";
57
+ IntegrationLogType["MESSAGE_UPDATED"] = "message.updated";
58
+ IntegrationLogType["MESSAGE_ACK_UPDATED"] = "message.ack.updated";
59
+ IntegrationLogType["REACTION_CREATED"] = "reaction.created";
60
+ IntegrationLogType["REACTION_UPDATED"] = "reaction.updated";
61
+ IntegrationLogType["REACTION_DELETED"] = "reaction.deleted";
55
62
  IntegrationLogType["NEW_TICKET"] = "ticket.created";
63
+ IntegrationLogType["TICKET_UPDATED"] = "ticket.updated";
56
64
  })(IntegrationLogType || (exports.IntegrationLogType = IntegrationLogType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.74",
3
+ "version": "0.6.76",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",