@periskope/types 0.6.17 → 0.6.19
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/supabase.types.d.ts +17 -36
- package/dist/types.d.ts +24 -5
- package/package.json +12 -12
- package/supabase.types.ts +17 -36
- package/types.ts +39 -6
- package/update_package.ps1 +21 -0
package/dist/supabase.types.d.ts
CHANGED
|
@@ -29,90 +29,71 @@ export interface Database {
|
|
|
29
29
|
};
|
|
30
30
|
public: {
|
|
31
31
|
Tables: {
|
|
32
|
-
|
|
32
|
+
tbl_broadcast_messages: {
|
|
33
33
|
Row: {
|
|
34
|
-
|
|
35
|
-
chat_ids:
|
|
34
|
+
broadcast_id: string;
|
|
35
|
+
chat_ids: string[] | null;
|
|
36
36
|
created_at: string;
|
|
37
37
|
message_payload: Json | null;
|
|
38
|
-
org_id: string
|
|
38
|
+
org_id: string;
|
|
39
39
|
scheduled_at: string | null;
|
|
40
|
-
|
|
40
|
+
sent_by: string | null;
|
|
41
41
|
status: string | null;
|
|
42
|
-
template_id: string | null;
|
|
43
42
|
};
|
|
44
43
|
Insert: {
|
|
45
|
-
|
|
46
|
-
chat_ids?:
|
|
44
|
+
broadcast_id?: string;
|
|
45
|
+
chat_ids?: string[] | null;
|
|
47
46
|
created_at?: string;
|
|
48
47
|
message_payload?: Json | null;
|
|
49
|
-
org_id?: string
|
|
48
|
+
org_id?: string;
|
|
50
49
|
scheduled_at?: string | null;
|
|
51
|
-
|
|
50
|
+
sent_by?: string | null;
|
|
52
51
|
status?: string | null;
|
|
53
|
-
template_id?: string | null;
|
|
54
52
|
};
|
|
55
53
|
Update: {
|
|
56
|
-
|
|
57
|
-
chat_ids?:
|
|
54
|
+
broadcast_id?: string;
|
|
55
|
+
chat_ids?: string[] | null;
|
|
58
56
|
created_at?: string;
|
|
59
57
|
message_payload?: Json | null;
|
|
60
|
-
org_id?: string
|
|
58
|
+
org_id?: string;
|
|
61
59
|
scheduled_at?: string | null;
|
|
62
|
-
|
|
60
|
+
sent_by?: string | null;
|
|
63
61
|
status?: string | null;
|
|
64
|
-
template_id?: string | null;
|
|
65
62
|
};
|
|
66
63
|
Relationships: [
|
|
67
64
|
{
|
|
68
|
-
foreignKeyName: "
|
|
65
|
+
foreignKeyName: "tbl_broadcast_messages_org_id_fkey";
|
|
69
66
|
columns: ["org_id"];
|
|
70
67
|
isOneToOne: false;
|
|
71
68
|
referencedRelation: "tbl_org";
|
|
72
69
|
referencedColumns: ["org_id"];
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
foreignKeyName: "tbl_broadcast_scheduled_messages_template_id_fkey";
|
|
76
|
-
columns: ["template_id"];
|
|
77
|
-
isOneToOne: false;
|
|
78
|
-
referencedRelation: "tbl_broadcast_templates";
|
|
79
|
-
referencedColumns: ["template_id"];
|
|
80
70
|
}
|
|
81
71
|
];
|
|
82
72
|
};
|
|
83
73
|
tbl_broadcast_templates: {
|
|
84
74
|
Row: {
|
|
85
|
-
body: string | null;
|
|
86
75
|
created_at: string;
|
|
87
|
-
|
|
88
|
-
mimetype: string | null;
|
|
76
|
+
message_payload: Json | null;
|
|
89
77
|
org_id: string;
|
|
90
78
|
template_id: string;
|
|
91
79
|
template_name: string | null;
|
|
92
80
|
updated_at: string | null;
|
|
93
|
-
url: string | null;
|
|
94
81
|
};
|
|
95
82
|
Insert: {
|
|
96
|
-
body?: string | null;
|
|
97
83
|
created_at?: string;
|
|
98
|
-
|
|
99
|
-
mimetype?: string | null;
|
|
84
|
+
message_payload?: Json | null;
|
|
100
85
|
org_id?: string;
|
|
101
86
|
template_id?: string;
|
|
102
87
|
template_name?: string | null;
|
|
103
88
|
updated_at?: string | null;
|
|
104
|
-
url?: string | null;
|
|
105
89
|
};
|
|
106
90
|
Update: {
|
|
107
|
-
body?: string | null;
|
|
108
91
|
created_at?: string;
|
|
109
|
-
|
|
110
|
-
mimetype?: string | null;
|
|
92
|
+
message_payload?: Json | null;
|
|
111
93
|
org_id?: string;
|
|
112
94
|
template_id?: string;
|
|
113
95
|
template_name?: string | null;
|
|
114
96
|
updated_at?: string | null;
|
|
115
|
-
url?: string | null;
|
|
116
97
|
};
|
|
117
98
|
Relationships: [
|
|
118
99
|
{
|
package/dist/types.d.ts
CHANGED
|
@@ -38,10 +38,29 @@ export type ContactType = Merge<Tables<'tbl_contacts'>, {
|
|
|
38
38
|
chat_ids: string[] | null;
|
|
39
39
|
}>;
|
|
40
40
|
export type ChatAccessType = Merge<Partial<Tables<'tbl_chat_access'>>, Tables<'tbl_org_members'>>;
|
|
41
|
-
export type ServerStateType = {
|
|
42
|
-
loading: boolean;
|
|
43
|
-
percent: number | null;
|
|
44
|
-
ready: boolean;
|
|
45
|
-
};
|
|
46
41
|
export declare const labelColors: string[];
|
|
47
42
|
export declare const enumChatColors: readonly ["#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698", "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA", "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"];
|
|
43
|
+
export type SendMessageContent = {
|
|
44
|
+
message_type?: 'chat' | 'audio' | 'ptt' | 'image' | 'video' | 'document' | 'sticker' | 'location' | 'vcard';
|
|
45
|
+
body?: string;
|
|
46
|
+
media?: {
|
|
47
|
+
url: string;
|
|
48
|
+
mimetype?: string;
|
|
49
|
+
filename?: string;
|
|
50
|
+
};
|
|
51
|
+
contact_ids?: string[];
|
|
52
|
+
location?: Location;
|
|
53
|
+
quoted_message_id?: string;
|
|
54
|
+
quoted_message_type?: 'reply' | 'forward' | 'reply_private';
|
|
55
|
+
broadcast_id?: string;
|
|
56
|
+
variables?: Record<string, VariableType>;
|
|
57
|
+
};
|
|
58
|
+
export type VariableType = Record<string, string>;
|
|
59
|
+
export type BroadcastMessagePayload = SendMessageContent & {
|
|
60
|
+
chat_ids: string[];
|
|
61
|
+
broadcast_id?: string;
|
|
62
|
+
};
|
|
63
|
+
export type SingleMessagePayload = SendMessageContent & {
|
|
64
|
+
chat_id: string;
|
|
65
|
+
job_id?: string;
|
|
66
|
+
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"name": "@periskope/types",
|
|
3
|
+
"version": "0.6.19",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"type-fest": "^4.8.3",
|
|
9
|
+
"whatsapp-web.js": "^1.23.0"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"update-package": "tsc \u0026\u0026 npm publish --access public"
|
|
13
|
+
}
|
|
14
14
|
}
|
package/supabase.types.ts
CHANGED
|
@@ -28,90 +28,71 @@ export interface Database {
|
|
|
28
28
|
}
|
|
29
29
|
public: {
|
|
30
30
|
Tables: {
|
|
31
|
-
|
|
31
|
+
tbl_broadcast_messages: {
|
|
32
32
|
Row: {
|
|
33
|
-
|
|
34
|
-
chat_ids:
|
|
33
|
+
broadcast_id: string
|
|
34
|
+
chat_ids: string[] | null
|
|
35
35
|
created_at: string
|
|
36
36
|
message_payload: Json | null
|
|
37
|
-
org_id: string
|
|
37
|
+
org_id: string
|
|
38
38
|
scheduled_at: string | null
|
|
39
|
-
|
|
39
|
+
sent_by: string | null
|
|
40
40
|
status: string | null
|
|
41
|
-
template_id: string | null
|
|
42
41
|
}
|
|
43
42
|
Insert: {
|
|
44
|
-
|
|
45
|
-
chat_ids?:
|
|
43
|
+
broadcast_id?: string
|
|
44
|
+
chat_ids?: string[] | null
|
|
46
45
|
created_at?: string
|
|
47
46
|
message_payload?: Json | null
|
|
48
|
-
org_id?: string
|
|
47
|
+
org_id?: string
|
|
49
48
|
scheduled_at?: string | null
|
|
50
|
-
|
|
49
|
+
sent_by?: string | null
|
|
51
50
|
status?: string | null
|
|
52
|
-
template_id?: string | null
|
|
53
51
|
}
|
|
54
52
|
Update: {
|
|
55
|
-
|
|
56
|
-
chat_ids?:
|
|
53
|
+
broadcast_id?: string
|
|
54
|
+
chat_ids?: string[] | null
|
|
57
55
|
created_at?: string
|
|
58
56
|
message_payload?: Json | null
|
|
59
|
-
org_id?: string
|
|
57
|
+
org_id?: string
|
|
60
58
|
scheduled_at?: string | null
|
|
61
|
-
|
|
59
|
+
sent_by?: string | null
|
|
62
60
|
status?: string | null
|
|
63
|
-
template_id?: string | null
|
|
64
61
|
}
|
|
65
62
|
Relationships: [
|
|
66
63
|
{
|
|
67
|
-
foreignKeyName: "
|
|
64
|
+
foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
|
|
68
65
|
columns: ["org_id"]
|
|
69
66
|
isOneToOne: false
|
|
70
67
|
referencedRelation: "tbl_org"
|
|
71
68
|
referencedColumns: ["org_id"]
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
foreignKeyName: "tbl_broadcast_scheduled_messages_template_id_fkey"
|
|
75
|
-
columns: ["template_id"]
|
|
76
|
-
isOneToOne: false
|
|
77
|
-
referencedRelation: "tbl_broadcast_templates"
|
|
78
|
-
referencedColumns: ["template_id"]
|
|
79
69
|
}
|
|
80
70
|
]
|
|
81
71
|
}
|
|
82
72
|
tbl_broadcast_templates: {
|
|
83
73
|
Row: {
|
|
84
|
-
body: string | null
|
|
85
74
|
created_at: string
|
|
86
|
-
|
|
87
|
-
mimetype: string | null
|
|
75
|
+
message_payload: Json | null
|
|
88
76
|
org_id: string
|
|
89
77
|
template_id: string
|
|
90
78
|
template_name: string | null
|
|
91
79
|
updated_at: string | null
|
|
92
|
-
url: string | null
|
|
93
80
|
}
|
|
94
81
|
Insert: {
|
|
95
|
-
body?: string | null
|
|
96
82
|
created_at?: string
|
|
97
|
-
|
|
98
|
-
mimetype?: string | null
|
|
83
|
+
message_payload?: Json | null
|
|
99
84
|
org_id?: string
|
|
100
85
|
template_id?: string
|
|
101
86
|
template_name?: string | null
|
|
102
87
|
updated_at?: string | null
|
|
103
|
-
url?: string | null
|
|
104
88
|
}
|
|
105
89
|
Update: {
|
|
106
|
-
body?: string | null
|
|
107
90
|
created_at?: string
|
|
108
|
-
|
|
109
|
-
mimetype?: string | null
|
|
91
|
+
message_payload?: Json | null
|
|
110
92
|
org_id?: string
|
|
111
93
|
template_id?: string
|
|
112
94
|
template_name?: string | null
|
|
113
95
|
updated_at?: string | null
|
|
114
|
-
url?: string | null
|
|
115
96
|
}
|
|
116
97
|
Relationships: [
|
|
117
98
|
{
|
package/types.ts
CHANGED
|
@@ -68,12 +68,6 @@ export type ChatAccessType = Merge<
|
|
|
68
68
|
Tables<'tbl_org_members'>
|
|
69
69
|
>;
|
|
70
70
|
|
|
71
|
-
export type ServerStateType = {
|
|
72
|
-
loading: boolean;
|
|
73
|
-
percent: number | null;
|
|
74
|
-
ready: boolean;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
71
|
/* -------------------------------- CONSTANTS ------------------------------- */
|
|
78
72
|
|
|
79
73
|
export const labelColors = [
|
|
@@ -101,3 +95,42 @@ export const enumChatColors = [
|
|
|
101
95
|
'#FF2E74',
|
|
102
96
|
'#DB2777',
|
|
103
97
|
] as const;
|
|
98
|
+
|
|
99
|
+
/* -------------------------- SEND MESSAGE PAYLOAD -------------------------- */
|
|
100
|
+
|
|
101
|
+
export type SendMessageContent = {
|
|
102
|
+
message_type?:
|
|
103
|
+
| 'chat'
|
|
104
|
+
| 'audio'
|
|
105
|
+
| 'ptt'
|
|
106
|
+
| 'image'
|
|
107
|
+
| 'video'
|
|
108
|
+
| 'document'
|
|
109
|
+
| 'sticker'
|
|
110
|
+
| 'location'
|
|
111
|
+
| 'vcard';
|
|
112
|
+
body?: string;
|
|
113
|
+
media?: {
|
|
114
|
+
url: string;
|
|
115
|
+
mimetype?: string;
|
|
116
|
+
filename?: string;
|
|
117
|
+
};
|
|
118
|
+
contact_ids?: string[];
|
|
119
|
+
location?: Location;
|
|
120
|
+
quoted_message_id?: string;
|
|
121
|
+
quoted_message_type?: 'reply' | 'forward' | 'reply_private';
|
|
122
|
+
broadcast_id?: string;
|
|
123
|
+
variables?: Record<string, VariableType>;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type VariableType = Record<string, string>;
|
|
127
|
+
|
|
128
|
+
export type BroadcastMessagePayload = SendMessageContent & {
|
|
129
|
+
chat_ids: string[];
|
|
130
|
+
broadcast_id?: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type SingleMessagePayload = SendMessageContent & {
|
|
134
|
+
chat_id: string;
|
|
135
|
+
job_id?: string;
|
|
136
|
+
};
|
|
@@ -0,0 +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
|