@bygnet/types 1.3.2 → 1.4.1

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,86 @@
1
+ import { BygSubscription } from '../unions/subscription';
2
+ export interface BygMessageSharedPost {
3
+ id: number;
4
+ title: string;
5
+ content: string;
6
+ author: string;
7
+ createdDate: string;
8
+ }
9
+ export interface BygMessageSharedImage {
10
+ id: number;
11
+ title: string;
12
+ imageUrl: string;
13
+ author: string;
14
+ createdDate: string;
15
+ }
16
+ export interface BygMessage {
17
+ id: number;
18
+ senderId: number;
19
+ senderUsername: string;
20
+ senderAvatarUrl: string | null;
21
+ senderSubscriptionState: BygSubscription;
22
+ recipientId: number;
23
+ recipientUsername: string;
24
+ recipientAvatarUrl: string | null;
25
+ recipientSubscriptionState: BygSubscription;
26
+ content: string;
27
+ createdDate: string;
28
+ sharedPost: BygMessageSharedPost | null;
29
+ sharedImage: BygMessageSharedImage | null;
30
+ }
31
+ export interface BygMessageThread {
32
+ userId: number;
33
+ username: string;
34
+ avatarUrl: string | null;
35
+ subscriptionState: BygSubscription;
36
+ lastMessagePreview: string;
37
+ lastMessageDate: string;
38
+ }
39
+ export interface BygMessageConversation {
40
+ userId: number;
41
+ username: string;
42
+ avatarUrl: string | null;
43
+ subscriptionState: BygSubscription;
44
+ messages: BygMessage[];
45
+ }
46
+ export interface BygMessageShareTarget {
47
+ userId: number;
48
+ username: string;
49
+ avatarUrl: string | null;
50
+ subscriptionState: BygSubscription;
51
+ source: 'recent' | 'following';
52
+ }
53
+ export interface BygMessageSendRequest {
54
+ recipientId: number;
55
+ content?: string;
56
+ sharedPostId?: number;
57
+ sharedImageId?: number;
58
+ }
59
+ export type BygMessageLiveClientEvent = {
60
+ type: 'auth';
61
+ token: string;
62
+ } | {
63
+ type: 'typing';
64
+ toUserId: number;
65
+ isTyping: boolean;
66
+ };
67
+ export type BygMessageLiveServerEvent = {
68
+ type: 'auth:required';
69
+ } | {
70
+ type: 'auth:ok';
71
+ userId: number;
72
+ username: string;
73
+ } | {
74
+ type: 'auth:error';
75
+ } | {
76
+ type: 'error';
77
+ reason: string;
78
+ } | {
79
+ type: 'typing';
80
+ fromUserId: number;
81
+ fromUsername: string;
82
+ isTyping: boolean;
83
+ } | {
84
+ type: 'message:new';
85
+ message: BygMessage;
86
+ };
@@ -0,0 +1,12 @@
1
+ import { BygSubscription } from '../unions/subscription';
2
+ export type BygNotificationType = 'follow' | 'post_comment' | 'image_comment' | 'post_mention' | 'comment_mention' | 'message';
3
+ export interface BygNotification {
4
+ id: string;
5
+ type: BygNotificationType;
6
+ actorUsername: string;
7
+ actorAvatarUrl: string | null;
8
+ actorSubscriptionState: BygSubscription;
9
+ text: string;
10
+ path: string;
11
+ createdDate: string;
12
+ }
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  export * from './content/ad';
2
2
  export * from './content/comment';
3
3
  export * from './content/image';
4
+ export * from './content/message';
5
+ export * from './content/notification';
4
6
  export * from './content/post';
5
- export * from './content/shop';
6
7
  export * from './people/profile';
7
8
  export * from './people/user';
8
9
  export * from './unions/create';
9
10
  export * from './unions/subscription';
10
11
  export * from './web/page';
12
+ export * from './web/push';
@@ -9,3 +9,9 @@ export interface BygUser {
9
9
  bannerUrl: string | null;
10
10
  subscriptionState: BygSubscription;
11
11
  }
12
+ export interface BygUserSuggestion {
13
+ id: number;
14
+ username: string;
15
+ avatarUrl: string | null;
16
+ subscriptionState: BygSubscription;
17
+ }
@@ -0,0 +1,23 @@
1
+ export interface BygPushSubscriptionKeys {
2
+ p256dh: string;
3
+ auth: string;
4
+ }
5
+ export interface BygPushSubscription {
6
+ endpoint: string;
7
+ expirationTime: number | null;
8
+ keys: BygPushSubscriptionKeys;
9
+ }
10
+ export interface BygPushUnsubscribeRequest {
11
+ endpoint: string;
12
+ }
13
+ export interface BygPushPublicKeyResponse {
14
+ publicKey: string;
15
+ }
16
+ export interface BygPushAlertPayload {
17
+ type: 'follow' | 'post_comment' | 'image_comment' | 'post_mention' | 'comment_mention' | 'message';
18
+ title: string;
19
+ body: string;
20
+ path: string;
21
+ tag: string;
22
+ createdDate: string;
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygnet/types",
3
- "version": "1.3.2",
3
+ "version": "1.4.1",
4
4
  "description": "Byg Platform's types for posts, images, and more, for Byg devs and the community.",
5
5
  "keywords": [
6
6
  "social-network",
@@ -37,7 +37,7 @@
37
37
  "format:check": "prettier --check ."
38
38
  },
39
39
  "dependencies": {
40
- "@a35hie/ts-pkg": "^0.3.1",
40
+ "@opk/ts-pkg": "^0.6.1",
41
41
  "prettier": "^3.8.1"
42
42
  }
43
43
  }
package/src/index.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  export * from './content/ad'
3
3
  export * from './content/comment'
4
4
  export * from './content/image'
5
+ export * from './content/notification'
5
6
  export * from './content/post'
6
- export * from './content/shop'
7
7
 
8
8
  // people
9
9
  export * from './people/profile'
@@ -15,3 +15,4 @@ export * from './unions/subscription'
15
15
 
16
16
  // web
17
17
  export * from './web/page'
18
+ export * from './web/push'