@periskope/types 0.6.181 → 0.6.183

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/types.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { default as _Stripe } from 'stripe';
2
2
  import { Merge, OverrideProperties } from 'type-fest';
3
3
  import { Filter, Rule } from './rules.types';
4
- import { Tables, TablesUpdate } from './supabase.types';
4
+ import { Tables, TablesInsert, TablesUpdate } from './supabase.types';
5
5
 
6
6
  /* ----------------------------- TYPE SHORTHANDS ---------------------------- */
7
7
 
@@ -33,6 +33,8 @@ export type OrgPlanEnterprise = {
33
33
  phone_limit: number;
34
34
  current_period_start: number;
35
35
  current_period_end: number | null;
36
+ additional_user_limit?: number;
37
+ additional_phone_limit?: number;
36
38
  };
37
39
 
38
40
  export type OrgPlanNonEnterprise = {
@@ -44,6 +46,8 @@ export type OrgPlanNonEnterprise = {
44
46
  phone_limit: number;
45
47
  current_period_end: number;
46
48
  current_period_start: number;
49
+ additional_user_limit?: number;
50
+ additional_phone_limit?: number;
47
51
  };
48
52
 
49
53
  export type OrgPlan<T extends AllPlans | Enterprise> = T extends Enterprise
@@ -98,6 +102,7 @@ export type OrgMetadata = {
98
102
  };
99
103
  };
100
104
  attribution?: Object;
105
+ affiliate_id?: string;
101
106
  custom_properties?: {
102
107
  chats_order?: {
103
108
  [id: string]: number;
@@ -108,10 +113,10 @@ export type OrgMetadata = {
108
113
  };
109
114
  rules?: {
110
115
  limit?: number;
111
- }
116
+ };
112
117
  ai?: {
113
118
  flag_prompt?: string;
114
- }
119
+ };
115
120
  };
116
121
 
117
122
  type AccessScopes = {
@@ -202,7 +207,7 @@ export type MediaType = {
202
207
 
203
208
  export type MessageType = Merge<
204
209
  OverrideProperties<
205
- Tables<'tbl_chat_messages'>,
210
+ TablesInsert<'tbl_chat_messages'>,
206
211
  {
207
212
  message_id: string;
208
213
  org_id: string;
@@ -210,7 +215,7 @@ export type MessageType = Merge<
210
215
  chat_id: string;
211
216
  message_type: (typeof SUPPORTED_TYPES)[number];
212
217
  media: MediaType | null;
213
- flag_metadata: MessageFlagType | null;
218
+ flag_metadata?: MessageFlagType | null;
214
219
  poll_info?: PollSendType | null;
215
220
  poll_results?: PollResultType | null;
216
221
  delivery_info?: DeliveryInfoType | null;
@@ -220,6 +225,7 @@ export type MessageType = Merge<
220
225
  reactions?: ReactionType[];
221
226
  message_payload?: SingleMessagePayload;
222
227
  highlight?: number;
228
+ is_private_note?: boolean;
223
229
  }
224
230
  >;
225
231
 
@@ -279,11 +285,11 @@ export type ChatAccessType = Merge<
279
285
  >;
280
286
 
281
287
  export type PhoneQueueStatusType = {
282
- active: number;
283
- failed: number;
284
- completed: number;
285
- is_running: boolean;
286
- pending: number;
288
+ active: number;
289
+ failed: number;
290
+ completed: number;
291
+ is_running: boolean;
292
+ pending: number;
287
293
  };
288
294
 
289
295
  export type PhoneType = OverrideProperties<
@@ -323,7 +329,14 @@ export const enumChatColors = [
323
329
  '#DB2777',
324
330
  ] as const;
325
331
 
326
- export type RepeatDaysType = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
332
+ export type RepeatDaysType =
333
+ | 'monday'
334
+ | 'tuesday'
335
+ | 'wednesday'
336
+ | 'thursday'
337
+ | 'friday'
338
+ | 'saturday'
339
+ | 'sunday';
327
340
  export type RepeatIntervalType = 'day' | 'week' | 'month';
328
341
 
329
342
  /* -------------------------- SEND MESSAGE PAYLOAD -------------------------- */
@@ -365,7 +378,6 @@ export type QuickReplyContent = Omit<
365
378
  'broadcast_id' | 'variables'
366
379
  >;
367
380
 
368
-
369
381
  export type ScheduleMessagePayload = {
370
382
  scheduled_id?: string;
371
383
  is_repeat?: boolean | null;
@@ -874,3 +886,50 @@ export type RuleLogsType = OverrideProperties<
874
886
  };
875
887
  }
876
888
  >;
889
+
890
+ /************************** TASKS ***************************/
891
+
892
+ export type TaskType = OverrideProperties<
893
+ Tables<'tbl_org_tasks'>,
894
+ {
895
+ reminder_setting: {
896
+ remind_in:
897
+ | `${number} ${'minutes' | 'hours' | 'days'} ${'before' | 'after'}`
898
+ | string
899
+ | null;
900
+ repeat?: {
901
+ frequency: number;
902
+ interval: 'days' | 'weeks' | 'months' | 'years';
903
+ end: 'never' | 'after' | 'on';
904
+ on?: string;
905
+ };
906
+ } | null;
907
+ associated_object_metadata:
908
+ | {
909
+ type: 'chat';
910
+ index: 'chat_id';
911
+ id: string;
912
+ object: ChatType;
913
+ }
914
+ | {
915
+ type: 'message';
916
+ index: 'message_id';
917
+ id: string;
918
+ object: MessageType;
919
+ }
920
+ | {
921
+ type: 'ticket';
922
+ index: 'ticket_id';
923
+ id: string;
924
+ object: TicketType;
925
+ }
926
+ | null;
927
+ status: 'open' | 'inprogress' | 'closed';
928
+ priority: 1 | 2 | 3;
929
+ completed_metadata?: {
930
+ completed_at: string;
931
+ completed_by: string;
932
+ } | null;
933
+ type: 'todo' | 'chat' | 'message' | 'ticket';
934
+ }
935
+ >;
@@ -1,21 +1,21 @@
1
- # Define the path to your package.json file
2
- $packageJsonPath = "./package.json"
3
-
4
- # Read the package.json file
5
- $packageJson = Get-Content $packageJsonPath -Raw | ConvertFrom-Json
6
-
7
- # Increment the patch version
8
- $versionParts = $packageJson.version -split '\.'
9
- $versionParts[2] = [int]$versionParts[2] + 1
10
- $newVersion = $versionParts -join '.'
11
-
12
- Write-Host "Updating package version to $newVersion"
13
-
14
- # Update the version in the object
15
- $packageJson.version = $newVersion
16
-
17
- # Convert the object back to JSON and save
18
- $packageJson | ConvertTo-Json -Depth 100 | Set-Content $packageJsonPath
19
-
20
- # Run npm command
21
- npm run update-package
1
+ # Define the path to your package.json file
2
+ $packageJsonPath = "./package.json"
3
+
4
+ # Read the package.json file
5
+ $packageJson = Get-Content $packageJsonPath -Raw | ConvertFrom-Json
6
+
7
+ # Increment the patch version
8
+ $versionParts = $packageJson.version -split '\.'
9
+ $versionParts[2] = [int]$versionParts[2] + 1
10
+ $newVersion = $versionParts -join '.'
11
+
12
+ Write-Host "Updating package version to $newVersion"
13
+
14
+ # Update the version in the object
15
+ $packageJson.version = $newVersion
16
+
17
+ # Convert the object back to JSON and save
18
+ $packageJson | ConvertTo-Json -Depth 100 | Set-Content $packageJsonPath
19
+
20
+ # Run npm command
21
+ npm run update-package
@@ -1,19 +0,0 @@
1
- export declare const TableColumns: {
2
- readonly tbl_broadcast_messages: readonly ["broadcast_id", "created_at", "chat_ids", "scheduled_at", "org_id", "message_payload", "completed_at", "performed_by"];
3
- readonly tbl_broadcast_templates: readonly ["template_id", "created_at", "template_name", "org_id", "updated_at", "message_payload"];
4
- readonly tbl_chat_access: readonly ["org_id", "email", "chat_id", "has_access", "last_read_timestamp", "active_phone"];
5
- readonly tbl_chat_messages: readonly ["message_id", "org_id", "ack", "author", "body", "broadcast", "device_type", "duration", "forwarding_score", "from", "from_me", "has_media", "has_quoted_msg", "has_reaction", "id", "invite_v4", "is_ephemeral", "is_forwarded", "is_gif", "is_starred", "is_status", "links", "location", "media_key", "mentioned_ids", "order_id", "raw_data", "to", "token", "message_type", "vcards", "chat_id", "timestamp", "org_phone", "broadcast_id", "is_deleted", "media", "performed_by", "prev_body", "quoted_message_id", "sent_message_id", "delivery_info", "updated_at", "message_ticket_id"];
6
- readonly tbl_chat_notifications: readonly ["org_id", "notification_id", "chat_id", "author", "body", "id", "recipientids", "type", "timestamp", "org_phone"];
7
- readonly tbl_chat_participants: readonly ["org_id", "chat_id", "contact_id", "id", "is_admin", "is_super_admin", "org_phone"];
8
- readonly tbl_chat_reactions: readonly ["org_id", "message_id", "ack", "id", "orphan", "reaction", "read", "reaction_id", "timestamp", "msg_id", "orphan_reason", "sender_id", "org_phone"];
9
- readonly tbl_chat_tickets: readonly ["created_at", "ticket_id", "subject", "status", "assignee", "assigned_by", "chat_id", "due_date", "org_id", "label_ids", "quoted_message_id", "raised_by", "priority", "last_updated_at", "is_deleted"];
10
- readonly tbl_chats: readonly ["org_id", "chat_id", "archived", "id", "is_group", "is_muted", "is_read_only", "mute_expiration", "name", "pinned", "unread_count", "group_metadata", "chat_image", "timestamp", "invite_link", "org_phone", "label_ids", "updated_at"];
11
- readonly tbl_contacts: readonly ["org_id", "contact_id", "id", "number", "is_business", "is_enterprise", "name", "pushname", "short_name", "contact_type", "is_me", "is_user", "is_group", "is_wa_contact", "is_my_contact", "is_blocked", "contact_image", "contact_color", "business_profile", "verified_name", "is_internal", "label_ids", "verified_level", "updated_at"];
12
- readonly tbl_org: readonly ["org_id", "created_at", "org_image", "org_name", "support_link", "org_metadata", "org_plan", "stripe_customer_details", "stripe_customer_id", "stripe_subscription_details"];
13
- readonly tbl_org_labels: readonly ["label_id", "created_at", "org_id", "name", "color", "type"];
14
- readonly tbl_org_members: readonly ["created_at", "email", "user_id", "invited_at", "invited_by", "org_id", "role", "member_image", "member_name", "is_active", "member_color"];
15
- readonly tbl_org_phones: readonly ["org_id", "org_phone", "created_at", "updated_at", "wa_state", "phone_id", "qr_code", "phone_image", "phone_name", "server_ip"];
16
- readonly view_broadcast_logs: readonly ["broadcast_id", "org_id", "message_payload", "created_at", "total_chats", "sent_chats", "failed_chats", "total_member_count", "delivered_member_count", "read_member_count", "completed_at", "scheduled_at", "performed_by", "delivery_percentage", "read_percentage"];
17
- readonly view_chat_messages: readonly ["message_id", "org_id", "ack", "author", "body", "from_me", "invite_v4", "links", "location", "mentioned_ids", "message_type", "vcards", "chat_id", "timestamp", "org_phone", "broadcast_id", "is_deleted", "media", "performed_by", "prev_body", "quoted_message_id", "sender_phone", "sent_message_id", "delivery_info", "updated_at", "message_ticket_id", "unique_id", "is_gif", "is_forwarded", "is_starred"];
18
- readonly view_chats: readonly ["org_id", "chat_id", "org_phone", "chat_image", "invite_link", "label_ids", "updated_at", "chat_name", "latest_message", "message_unread_count", "member_count", "chat_type", "chat_access", "has_access", "last_read_timestamp", "chat_org_phones", "active_phone", "group_description"];
19
- };
@@ -1,290 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableColumns = void 0;
4
- exports.TableColumns = {
5
- "tbl_broadcast_messages": [
6
- "broadcast_id",
7
- "created_at",
8
- "chat_ids",
9
- "scheduled_at",
10
- "org_id",
11
- "message_payload",
12
- "completed_at",
13
- "performed_by"
14
- ],
15
- "tbl_broadcast_templates": [
16
- "template_id",
17
- "created_at",
18
- "template_name",
19
- "org_id",
20
- "updated_at",
21
- "message_payload"
22
- ],
23
- "tbl_chat_access": [
24
- "org_id",
25
- "email",
26
- "chat_id",
27
- "has_access",
28
- "last_read_timestamp",
29
- "active_phone"
30
- ],
31
- "tbl_chat_messages": [
32
- "message_id",
33
- "org_id",
34
- "ack",
35
- "author",
36
- "body",
37
- "broadcast",
38
- "device_type",
39
- "duration",
40
- "forwarding_score",
41
- "from",
42
- "from_me",
43
- "has_media",
44
- "has_quoted_msg",
45
- "has_reaction",
46
- "id",
47
- "invite_v4",
48
- "is_ephemeral",
49
- "is_forwarded",
50
- "is_gif",
51
- "is_starred",
52
- "is_status",
53
- "links",
54
- "location",
55
- "media_key",
56
- "mentioned_ids",
57
- "order_id",
58
- "raw_data",
59
- "to",
60
- "token",
61
- "message_type",
62
- "vcards",
63
- "chat_id",
64
- "timestamp",
65
- "org_phone",
66
- "broadcast_id",
67
- "is_deleted",
68
- "media",
69
- "performed_by",
70
- "prev_body",
71
- "quoted_message_id",
72
- "sent_message_id",
73
- "delivery_info",
74
- "updated_at",
75
- "message_ticket_id"
76
- ],
77
- "tbl_chat_notifications": [
78
- "org_id",
79
- "notification_id",
80
- "chat_id",
81
- "author",
82
- "body",
83
- "id",
84
- "recipientids",
85
- "type",
86
- "timestamp",
87
- "org_phone"
88
- ],
89
- "tbl_chat_participants": [
90
- "org_id",
91
- "chat_id",
92
- "contact_id",
93
- "id",
94
- "is_admin",
95
- "is_super_admin",
96
- "org_phone"
97
- ],
98
- "tbl_chat_reactions": [
99
- "org_id",
100
- "message_id",
101
- "ack",
102
- "id",
103
- "orphan",
104
- "reaction",
105
- "read",
106
- "reaction_id",
107
- "timestamp",
108
- "msg_id",
109
- "orphan_reason",
110
- "sender_id",
111
- "org_phone"
112
- ],
113
- "tbl_chat_tickets": [
114
- "created_at",
115
- "ticket_id",
116
- "subject",
117
- "status",
118
- "assignee",
119
- "assigned_by",
120
- "chat_id",
121
- "due_date",
122
- "org_id",
123
- "label_ids",
124
- "quoted_message_id",
125
- "raised_by",
126
- "priority",
127
- "last_updated_at",
128
- "is_deleted"
129
- ],
130
- "tbl_chats": [
131
- "org_id",
132
- "chat_id",
133
- "archived",
134
- "id",
135
- "is_group",
136
- "is_muted",
137
- "is_read_only",
138
- "mute_expiration",
139
- "name",
140
- "pinned",
141
- "unread_count",
142
- "group_metadata",
143
- "chat_image",
144
- "timestamp",
145
- "invite_link",
146
- "org_phone",
147
- "label_ids",
148
- "updated_at"
149
- ],
150
- "tbl_contacts": [
151
- "org_id",
152
- "contact_id",
153
- "id",
154
- "number",
155
- "is_business",
156
- "is_enterprise",
157
- "name",
158
- "pushname",
159
- "short_name",
160
- "contact_type",
161
- "is_me",
162
- "is_user",
163
- "is_group",
164
- "is_wa_contact",
165
- "is_my_contact",
166
- "is_blocked",
167
- "contact_image",
168
- "contact_color",
169
- "business_profile",
170
- "verified_name",
171
- "is_internal",
172
- "label_ids",
173
- "verified_level",
174
- "updated_at"
175
- ],
176
- "tbl_org": [
177
- "org_id",
178
- "created_at",
179
- "org_image",
180
- "org_name",
181
- "support_link",
182
- "org_metadata",
183
- "org_plan",
184
- "stripe_customer_details",
185
- "stripe_customer_id",
186
- "stripe_subscription_details"
187
- ],
188
- "tbl_org_labels": [
189
- "label_id",
190
- "created_at",
191
- "org_id",
192
- "name",
193
- "color",
194
- "type"
195
- ],
196
- "tbl_org_members": [
197
- "created_at",
198
- "email",
199
- "user_id",
200
- "invited_at",
201
- "invited_by",
202
- "org_id",
203
- "role",
204
- "member_image",
205
- "member_name",
206
- "is_active",
207
- "member_color"
208
- ],
209
- "tbl_org_phones": [
210
- "org_id",
211
- "org_phone",
212
- "created_at",
213
- "updated_at",
214
- "wa_state",
215
- "phone_id",
216
- "qr_code",
217
- "phone_image",
218
- "phone_name",
219
- "server_ip"
220
- ],
221
- "view_broadcast_logs": [
222
- "broadcast_id",
223
- "org_id",
224
- "message_payload",
225
- "created_at",
226
- "total_chats",
227
- "sent_chats",
228
- "failed_chats",
229
- "total_member_count",
230
- "delivered_member_count",
231
- "read_member_count",
232
- "completed_at",
233
- "scheduled_at",
234
- "performed_by",
235
- "delivery_percentage",
236
- "read_percentage"
237
- ],
238
- "view_chat_messages": [
239
- "message_id",
240
- "org_id",
241
- "ack",
242
- "author",
243
- "body",
244
- "from_me",
245
- "invite_v4",
246
- "links",
247
- "location",
248
- "mentioned_ids",
249
- "message_type",
250
- "vcards",
251
- "chat_id",
252
- "timestamp",
253
- "org_phone",
254
- "broadcast_id",
255
- "is_deleted",
256
- "media",
257
- "performed_by",
258
- "prev_body",
259
- "quoted_message_id",
260
- "sender_phone",
261
- "sent_message_id",
262
- "delivery_info",
263
- "updated_at",
264
- "message_ticket_id",
265
- "unique_id",
266
- "is_gif",
267
- "is_forwarded",
268
- "is_starred"
269
- ],
270
- "view_chats": [
271
- "org_id",
272
- "chat_id",
273
- "org_phone",
274
- "chat_image",
275
- "invite_link",
276
- "label_ids",
277
- "updated_at",
278
- "chat_name",
279
- "latest_message",
280
- "message_unread_count",
281
- "member_count",
282
- "chat_type",
283
- "chat_access",
284
- "has_access",
285
- "last_read_timestamp",
286
- "chat_org_phones",
287
- "active_phone",
288
- "group_description"
289
- ]
290
- };