@periskope/types 0.6.88 → 0.6.89
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 +389 -223
- package/dist/types.d.ts +23 -4
- package/mod_json_type.ps1 +108 -108
- package/package.json +16 -16
- package/supabase.types.ts +1741 -1579
- package/tsconfig.json +105 -105
- package/types.ts +22 -7
- package/update_package.ps1 +21 -21
package/dist/types.d.ts
CHANGED
|
@@ -39,6 +39,11 @@ export type MicrosurveyData = {
|
|
|
39
39
|
text: string;
|
|
40
40
|
checked: boolean;
|
|
41
41
|
}[];
|
|
42
|
+
export type OrgPreferences = {
|
|
43
|
+
disable_ai_flagging?: boolean;
|
|
44
|
+
allow_exports?: boolean;
|
|
45
|
+
sync_phone_contacts?: boolean;
|
|
46
|
+
};
|
|
42
47
|
export type OrgMetadata = {
|
|
43
48
|
phone_number: string;
|
|
44
49
|
ticket_prefix: string;
|
|
@@ -46,6 +51,15 @@ export type OrgMetadata = {
|
|
|
46
51
|
surveyData?: MicrosurveyData;
|
|
47
52
|
onboarding: Record<string, boolean>;
|
|
48
53
|
onboarding_completed_at: Date | null;
|
|
54
|
+
preferences?: OrgPreferences;
|
|
55
|
+
hubspot_pipelines?: {
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
default_stage: {
|
|
59
|
+
id: string;
|
|
60
|
+
label: string;
|
|
61
|
+
};
|
|
62
|
+
}[];
|
|
49
63
|
};
|
|
50
64
|
export type OrgType = OverrideProperties<Merge<Tables<'tbl_org'>, {
|
|
51
65
|
user: Tables<'tbl_org_members'>;
|
|
@@ -121,14 +135,19 @@ export type TicketType = OverrideProperties<Tables<'tbl_chat_tickets'>, {
|
|
|
121
135
|
[key: string]: boolean;
|
|
122
136
|
};
|
|
123
137
|
hubspot_metadata: {
|
|
124
|
-
id
|
|
125
|
-
type
|
|
126
|
-
hubId
|
|
127
|
-
|
|
138
|
+
id?: string;
|
|
139
|
+
type?: string;
|
|
140
|
+
hubId?: string;
|
|
141
|
+
pipeline: {
|
|
142
|
+
id: string;
|
|
143
|
+
label: string;
|
|
144
|
+
};
|
|
145
|
+
object_data?: HubspotObjectDataType;
|
|
128
146
|
} | null;
|
|
129
147
|
}>;
|
|
130
148
|
export type ContactType = Merge<Tables<'tbl_contacts'>, {
|
|
131
149
|
chats: ChatType[] | null;
|
|
150
|
+
chat_ids?: string[];
|
|
132
151
|
}>;
|
|
133
152
|
export type ReactionType = Tables<'tbl_chat_reactions'>;
|
|
134
153
|
export type NotificationType = Tables<'tbl_chat_notifications'>;
|
package/mod_json_type.ps1
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
# Define the path to the TypeScript file
|
|
2
|
-
$filePath = ".\supabase.types.ts"
|
|
3
|
-
|
|
4
|
-
# Read the content of the file as a single string
|
|
5
|
-
$fileContent = Get-Content $filePath -Raw
|
|
6
|
-
|
|
7
|
-
# Define the current and new type definitions
|
|
8
|
-
$oldTypeDefinition = 'export type Json =\s*\| string\s*\| number\s*\| boolean\s*\| null\s*\| \{ \[key: string\]: Json \| undefined \}\s*\| Json\[\]'
|
|
9
|
-
$newTypeDefinition = 'export type Json = { [key: string]: any } | any'
|
|
10
|
-
|
|
11
|
-
# Replace the old type definition with the new one
|
|
12
|
-
$updatedContent = $fileContent -replace $oldTypeDefinition, $newTypeDefinition
|
|
13
|
-
|
|
14
|
-
# Update interface to type
|
|
15
|
-
$oldText = 'export interface Database '
|
|
16
|
-
$newText = 'export type Database = '
|
|
17
|
-
|
|
18
|
-
$updatedContent = $updatedContent -replace $oldText, $newText
|
|
19
|
-
|
|
20
|
-
# Append the new type definition if it doesn't exist
|
|
21
|
-
$addContent = @"
|
|
22
|
-
type PublicSchema = Database[Extract<keyof Database, "public">]
|
|
23
|
-
|
|
24
|
-
export type Tables<
|
|
25
|
-
PublicTableNameOrOptions extends
|
|
26
|
-
| keyof (PublicSchema["Tables"] & PublicSchema["Views"])
|
|
27
|
-
| { schema: keyof Database },
|
|
28
|
-
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
|
29
|
-
? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
|
30
|
-
Database[PublicTableNameOrOptions["schema"]]["Views"])
|
|
31
|
-
: never = never,
|
|
32
|
-
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
33
|
-
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
|
34
|
-
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
35
|
-
Row: infer R
|
|
36
|
-
}
|
|
37
|
-
? R
|
|
38
|
-
: never
|
|
39
|
-
: PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
|
|
40
|
-
PublicSchema["Views"])
|
|
41
|
-
? (PublicSchema["Tables"] &
|
|
42
|
-
PublicSchema["Views"])[PublicTableNameOrOptions] extends {
|
|
43
|
-
Row: infer R
|
|
44
|
-
}
|
|
45
|
-
? R
|
|
46
|
-
: never
|
|
47
|
-
: never
|
|
48
|
-
|
|
49
|
-
export type TablesInsert<
|
|
50
|
-
PublicTableNameOrOptions extends
|
|
51
|
-
| keyof PublicSchema["Tables"]
|
|
52
|
-
| { schema: keyof Database },
|
|
53
|
-
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
|
54
|
-
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
|
55
|
-
: never = never,
|
|
56
|
-
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
57
|
-
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
58
|
-
Insert: infer I
|
|
59
|
-
}
|
|
60
|
-
? I
|
|
61
|
-
: never
|
|
62
|
-
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
|
63
|
-
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
|
64
|
-
Insert: infer I
|
|
65
|
-
}
|
|
66
|
-
? I
|
|
67
|
-
: never
|
|
68
|
-
: never
|
|
69
|
-
|
|
70
|
-
export type TablesUpdate<
|
|
71
|
-
PublicTableNameOrOptions extends
|
|
72
|
-
| keyof PublicSchema["Tables"]
|
|
73
|
-
| { schema: keyof Database },
|
|
74
|
-
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
|
75
|
-
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
|
76
|
-
: never = never,
|
|
77
|
-
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
78
|
-
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
79
|
-
Update: infer U
|
|
80
|
-
}
|
|
81
|
-
? U
|
|
82
|
-
: never
|
|
83
|
-
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
|
84
|
-
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
|
85
|
-
Update: infer U
|
|
86
|
-
}
|
|
87
|
-
? U
|
|
88
|
-
: never
|
|
89
|
-
: never
|
|
90
|
-
|
|
91
|
-
export type Enums<
|
|
92
|
-
PublicEnumNameOrOptions extends
|
|
93
|
-
| keyof PublicSchema["Enums"]
|
|
94
|
-
| { schema: keyof Database },
|
|
95
|
-
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
|
|
96
|
-
? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
|
|
97
|
-
: never = never,
|
|
98
|
-
> = PublicEnumNameOrOptions extends { schema: keyof Database }
|
|
99
|
-
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
|
100
|
-
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
|
|
101
|
-
? PublicSchema["Enums"][PublicEnumNameOrOptions]
|
|
102
|
-
: never
|
|
103
|
-
"@
|
|
104
|
-
|
|
105
|
-
# Append the new content to the updated content
|
|
106
|
-
$updatedContent += $addContent
|
|
107
|
-
|
|
108
|
-
# Write the updated content back to the file
|
|
1
|
+
# Define the path to the TypeScript file
|
|
2
|
+
$filePath = ".\supabase.types.ts"
|
|
3
|
+
|
|
4
|
+
# Read the content of the file as a single string
|
|
5
|
+
$fileContent = Get-Content $filePath -Raw
|
|
6
|
+
|
|
7
|
+
# Define the current and new type definitions
|
|
8
|
+
$oldTypeDefinition = 'export type Json =\s*\| string\s*\| number\s*\| boolean\s*\| null\s*\| \{ \[key: string\]: Json \| undefined \}\s*\| Json\[\]'
|
|
9
|
+
$newTypeDefinition = 'export type Json = { [key: string]: any } | any'
|
|
10
|
+
|
|
11
|
+
# Replace the old type definition with the new one
|
|
12
|
+
$updatedContent = $fileContent -replace $oldTypeDefinition, $newTypeDefinition
|
|
13
|
+
|
|
14
|
+
# Update interface to type
|
|
15
|
+
$oldText = 'export interface Database '
|
|
16
|
+
$newText = 'export type Database = '
|
|
17
|
+
|
|
18
|
+
$updatedContent = $updatedContent -replace $oldText, $newText
|
|
19
|
+
|
|
20
|
+
# Append the new type definition if it doesn't exist
|
|
21
|
+
$addContent = @"
|
|
22
|
+
type PublicSchema = Database[Extract<keyof Database, "public">]
|
|
23
|
+
|
|
24
|
+
export type Tables<
|
|
25
|
+
PublicTableNameOrOptions extends
|
|
26
|
+
| keyof (PublicSchema["Tables"] & PublicSchema["Views"])
|
|
27
|
+
| { schema: keyof Database },
|
|
28
|
+
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
|
29
|
+
? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
|
30
|
+
Database[PublicTableNameOrOptions["schema"]]["Views"])
|
|
31
|
+
: never = never,
|
|
32
|
+
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
33
|
+
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
|
34
|
+
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
35
|
+
Row: infer R
|
|
36
|
+
}
|
|
37
|
+
? R
|
|
38
|
+
: never
|
|
39
|
+
: PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
|
|
40
|
+
PublicSchema["Views"])
|
|
41
|
+
? (PublicSchema["Tables"] &
|
|
42
|
+
PublicSchema["Views"])[PublicTableNameOrOptions] extends {
|
|
43
|
+
Row: infer R
|
|
44
|
+
}
|
|
45
|
+
? R
|
|
46
|
+
: never
|
|
47
|
+
: never
|
|
48
|
+
|
|
49
|
+
export type TablesInsert<
|
|
50
|
+
PublicTableNameOrOptions extends
|
|
51
|
+
| keyof PublicSchema["Tables"]
|
|
52
|
+
| { schema: keyof Database },
|
|
53
|
+
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
|
54
|
+
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
|
55
|
+
: never = never,
|
|
56
|
+
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
57
|
+
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
58
|
+
Insert: infer I
|
|
59
|
+
}
|
|
60
|
+
? I
|
|
61
|
+
: never
|
|
62
|
+
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
|
63
|
+
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
|
64
|
+
Insert: infer I
|
|
65
|
+
}
|
|
66
|
+
? I
|
|
67
|
+
: never
|
|
68
|
+
: never
|
|
69
|
+
|
|
70
|
+
export type TablesUpdate<
|
|
71
|
+
PublicTableNameOrOptions extends
|
|
72
|
+
| keyof PublicSchema["Tables"]
|
|
73
|
+
| { schema: keyof Database },
|
|
74
|
+
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
|
75
|
+
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
|
76
|
+
: never = never,
|
|
77
|
+
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
78
|
+
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
79
|
+
Update: infer U
|
|
80
|
+
}
|
|
81
|
+
? U
|
|
82
|
+
: never
|
|
83
|
+
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
|
84
|
+
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
|
85
|
+
Update: infer U
|
|
86
|
+
}
|
|
87
|
+
? U
|
|
88
|
+
: never
|
|
89
|
+
: never
|
|
90
|
+
|
|
91
|
+
export type Enums<
|
|
92
|
+
PublicEnumNameOrOptions extends
|
|
93
|
+
| keyof PublicSchema["Enums"]
|
|
94
|
+
| { schema: keyof Database },
|
|
95
|
+
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
|
|
96
|
+
? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
|
|
97
|
+
: never = never,
|
|
98
|
+
> = PublicEnumNameOrOptions extends { schema: keyof Database }
|
|
99
|
+
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
|
100
|
+
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
|
|
101
|
+
? PublicSchema["Enums"][PublicEnumNameOrOptions]
|
|
102
|
+
: never
|
|
103
|
+
"@
|
|
104
|
+
|
|
105
|
+
# Append the new content to the updated content
|
|
106
|
+
$updatedContent += $addContent
|
|
107
|
+
|
|
108
|
+
# Write the updated content back to the file
|
|
109
109
|
$updatedContent | Set-Content $filePath
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name":
|
|
3
|
-
"version":
|
|
4
|
-
"private":
|
|
5
|
-
"main":
|
|
6
|
-
"types":
|
|
7
|
-
"dependencies":
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"scripts":
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
"name": "@periskope/types",
|
|
3
|
+
"version": "0.6.89",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@periskope/whatsapp-web.js": "1.23.1-alpha.exodus.8",
|
|
9
|
+
"@types/pg": "8.11.2",
|
|
10
|
+
"pg": "^8.11.3",
|
|
11
|
+
"stripe": "^14.19.0",
|
|
12
|
+
"ts-node": "^10.9.2",
|
|
13
|
+
"type-fest": "^4.8.3"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"update-package": "tsc \u0026\u0026 npm publish --access public"
|
|
17
|
+
}
|
|
18
18
|
}
|