@periskope/types 0.6.181 → 0.6.182

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
 
@@ -98,6 +98,7 @@ export type OrgMetadata = {
98
98
  };
99
99
  };
100
100
  attribution?: Object;
101
+ affiliate_id?: string;
101
102
  custom_properties?: {
102
103
  chats_order?: {
103
104
  [id: string]: number;
@@ -108,10 +109,10 @@ export type OrgMetadata = {
108
109
  };
109
110
  rules?: {
110
111
  limit?: number;
111
- }
112
+ };
112
113
  ai?: {
113
114
  flag_prompt?: string;
114
- }
115
+ };
115
116
  };
116
117
 
117
118
  type AccessScopes = {
@@ -202,7 +203,7 @@ export type MediaType = {
202
203
 
203
204
  export type MessageType = Merge<
204
205
  OverrideProperties<
205
- Tables<'tbl_chat_messages'>,
206
+ TablesInsert<'tbl_chat_messages'>,
206
207
  {
207
208
  message_id: string;
208
209
  org_id: string;
@@ -210,7 +211,7 @@ export type MessageType = Merge<
210
211
  chat_id: string;
211
212
  message_type: (typeof SUPPORTED_TYPES)[number];
212
213
  media: MediaType | null;
213
- flag_metadata: MessageFlagType | null;
214
+ flag_metadata?: MessageFlagType | null;
214
215
  poll_info?: PollSendType | null;
215
216
  poll_results?: PollResultType | null;
216
217
  delivery_info?: DeliveryInfoType | null;
@@ -220,6 +221,7 @@ export type MessageType = Merge<
220
221
  reactions?: ReactionType[];
221
222
  message_payload?: SingleMessagePayload;
222
223
  highlight?: number;
224
+ is_private_note?: boolean;
223
225
  }
224
226
  >;
225
227
 
@@ -279,11 +281,11 @@ export type ChatAccessType = Merge<
279
281
  >;
280
282
 
281
283
  export type PhoneQueueStatusType = {
282
- active: number;
283
- failed: number;
284
- completed: number;
285
- is_running: boolean;
286
- pending: number;
284
+ active: number;
285
+ failed: number;
286
+ completed: number;
287
+ is_running: boolean;
288
+ pending: number;
287
289
  };
288
290
 
289
291
  export type PhoneType = OverrideProperties<
@@ -874,3 +876,50 @@ export type RuleLogsType = OverrideProperties<
874
876
  };
875
877
  }
876
878
  >;
879
+
880
+ /************************** TASKS ***************************/
881
+
882
+ export type TaskType = OverrideProperties<
883
+ Tables<'tbl_org_tasks'>,
884
+ {
885
+ reminder_setting: {
886
+ remind_in:
887
+ | `${number} ${'minutes' | 'hours' | 'days'} ${'before' | 'after'}`
888
+ | string
889
+ | null;
890
+ repeat?: {
891
+ frequency: number,
892
+ interval: 'days' | 'weeks' | 'months' | 'years',
893
+ end: 'never' | 'after' | 'on',
894
+ on?: string;
895
+ }
896
+ } | null;
897
+ associated_object_metadata:
898
+ | {
899
+ type: 'chat';
900
+ index: 'chat_id';
901
+ id: string;
902
+ object: ChatType;
903
+ }
904
+ | {
905
+ type: 'message';
906
+ index: 'message_id';
907
+ id: string;
908
+ object: MessageType;
909
+ }
910
+ | {
911
+ type: 'ticket';
912
+ index: 'ticket_id';
913
+ id: string;
914
+ object: TicketType;
915
+ }
916
+ | null;
917
+ status: 'open' | 'inprogress' | 'closed';
918
+ priority: 0 | 1 | 2 | 3 | 4;
919
+ completed_metadata?: {
920
+ completed_at: string;
921
+ completed_by: string;
922
+ } | null;
923
+ type: 'todo' | 'chat' | 'message' | 'ticket';
924
+ }
925
+ >;
@@ -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
- };