@periskope/types 0.5.7 → 0.5.9

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.
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,36 @@
1
+ import { Merge, OverrideProperties } from 'type-fest';
2
+ import { Chat, MessageTypes } from 'whatsapp-web.js';
3
+ import { Tables } from './supabase.types';
4
+ export type WhatsappChat = Chat & {
5
+ groupMetadata?: any;
6
+ pinned?: boolean;
7
+ };
8
+ export type OrgType = Tables<'tbl_org'> & {
9
+ user: Tables<'tbl_org_members'>;
10
+ members: Tables<'tbl_org_members'>[];
11
+ phones: Tables<'tbl_org_phones'>[];
12
+ labels: Tables<'tbl_org_labels'>[];
13
+ };
14
+ export type ChatType = Merge<Tables<'view_chats'>, {
15
+ chat_id: string;
16
+ latest_message: MessageType | null;
17
+ members: (Tables<'tbl_chat_participants'> & Partial<Tables<'tbl_contacts'>>)[] | null;
18
+ notifications: Tables<'tbl_chat_notifications'>[] | null;
19
+ chat_type: 'user' | 'group' | 'business';
20
+ active_phone?: boolean;
21
+ org_participants?: Tables<'tbl_chat_participants'>[];
22
+ }>;
23
+ export type MessageType = OverrideProperties<Tables<'view_chat_messages'>, {
24
+ type: MessageTypes;
25
+ }>;
26
+ export type ContactType = Merge<Tables<'tbl_contacts'>, {
27
+ chats: ChatType[] | null;
28
+ chat_count: number | null;
29
+ }>;
30
+ export type ContactsFilterType = {
31
+ page: number;
32
+ total: number;
33
+ contacts: ContactType[];
34
+ };
35
+ export declare const labelColors: string[];
36
+ export declare const enumChatColors: readonly ["#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698", "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA", "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"];
package/dist/types.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.enumChatColors = exports.labelColors = void 0;
4
+ /* -------------------------------- CONSTANTS ------------------------------- */
5
+ exports.labelColors = [
6
+ '#9333EA',
7
+ '#0D9488',
8
+ '#DB2777',
9
+ '#2563EB',
10
+ '#F97316',
11
+ ];
12
+ exports.enumChatColors = [
13
+ "#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698",
14
+ "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA",
15
+ "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"
16
+ ];
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "private": false,
5
- "main": "index.d.ts",
6
- "types": "index.d.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "type-fest": "^4.8.3",
9
9
  "whatsapp-web.js": "^1.23.0"
10
10
  },
11
11
  "scripts": {
12
12
  "update-package": "tsc && npm publish --access public"
13
- }
13
+ },
14
+ "files": [
15
+ "dist/**/*"
16
+ ]
14
17
  }
package/mod_json_type.ps1 DELETED
@@ -1,15 +0,0 @@
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
- # Write the updated content back to the file
15
- $updatedContent | Set-Content $filePath