@burdenoff/sdk-libs 2026.522.1 → 2026.523.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.
- package/dist/modules/billing/index.cjs +46 -32
- package/dist/modules/billing/index.d.cts +19 -14
- package/dist/modules/billing/index.d.ts +19 -14
- package/dist/modules/billing/index.js +46 -32
- package/dist/modules/conversations/index.cjs +61 -37
- package/dist/modules/conversations/index.d.cts +62 -12
- package/dist/modules/conversations/index.d.ts +62 -12
- package/dist/modules/conversations/index.js +63 -39
- package/dist/modules/devportal/index.cjs +63 -48
- package/dist/modules/devportal/index.d.cts +84 -15
- package/dist/modules/devportal/index.d.ts +84 -15
- package/dist/modules/devportal/index.js +63 -48
- package/dist/modules/store/index.cjs +76 -54
- package/dist/modules/store/index.d.cts +101 -54
- package/dist/modules/store/index.d.ts +101 -54
- package/dist/modules/store/index.js +70 -48
- package/dist/modules/workspaces/index.cjs +19 -15
- package/dist/modules/workspaces/index.d.cts +54 -28
- package/dist/modules/workspaces/index.d.ts +54 -28
- package/dist/modules/workspaces/index.js +19 -15
- package/package.json +3 -3
|
@@ -1,61 +1,85 @@
|
|
|
1
|
-
'use strict';var s=`
|
|
1
|
+
'use strict';var m=["password","secret","clientSecret","apiKey","token","mfaCode","accessToken","refreshToken","workspaceToken","authorization"],A=/\b(eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+)\b/g;function T(s){let n=s.replace(A,"<redacted-jwt>");for(let e of m){let t=new RegExp(`("${e}"\\s*:\\s*")[^"]*(")`,"gi");n=n.replace(t,"$1<redacted>$2");}return n}var o=class extends Error{code;cause;constructor(n,e="SDK_ERROR",t){super(T(n)),this.name="SdkError",this.code=e,this.cause=t;}};var a=`
|
|
2
2
|
fragment ConversationFields on Conversation {
|
|
3
|
-
id title type description
|
|
3
|
+
id title type description avatar settings
|
|
4
|
+
state visibility isGroup memberCount unreadCount mentionCount
|
|
5
|
+
workspaceId createdBy createdAt updatedAt deletedAt
|
|
4
6
|
}
|
|
5
|
-
`,
|
|
7
|
+
`,d=`
|
|
6
8
|
fragment MessageFields on Message {
|
|
7
|
-
id conversationId
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
conversationId notificationsEnabled muted pinned metadata
|
|
9
|
+
id conversationId authorId authorType content type
|
|
10
|
+
metadata status isEdited isPinned isHidden isAnonymous
|
|
11
|
+
readCount replyCount threadLevel threadRootId parentMessageId
|
|
12
|
+
createdAt updatedAt editedAt pinnedAt
|
|
12
13
|
}
|
|
13
|
-
`,
|
|
14
|
-
${
|
|
15
|
-
query Conversations($filter:
|
|
16
|
-
conversations(filter: $filter, first: $first, after: $after) {
|
|
14
|
+
`,c=`
|
|
15
|
+
${a}
|
|
16
|
+
query Conversations($filter: ConversationFilter, $first: Int, $after: String, $sort: ConversationSort) {
|
|
17
|
+
conversations(filter: $filter, first: $first, after: $after, sort: $sort) {
|
|
17
18
|
edges { cursor node { ...ConversationFields } }
|
|
18
|
-
pageInfo { hasNextPage endCursor }
|
|
19
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
20
|
+
totalCount
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
`,
|
|
22
|
-
${
|
|
23
|
+
`,u=`
|
|
24
|
+
${a}
|
|
23
25
|
query Conversation($id: ID!) {
|
|
24
26
|
conversation(id: $id) { ...ConversationFields }
|
|
25
27
|
}
|
|
26
28
|
`,p=`
|
|
27
|
-
${
|
|
29
|
+
${a}
|
|
28
30
|
mutation CreateConversation($input: CreateConversationInput!) {
|
|
29
|
-
createConversation(input: $input) {
|
|
31
|
+
createConversation(input: $input) {
|
|
32
|
+
success
|
|
33
|
+
conversation { ...ConversationFields }
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
|
-
`,
|
|
32
|
-
${
|
|
36
|
+
`,C=`
|
|
37
|
+
${a}
|
|
33
38
|
mutation UpdateConversation($input: UpdateConversationInput!) {
|
|
34
|
-
updateConversation(input: $input) {
|
|
39
|
+
updateConversation(input: $input) {
|
|
40
|
+
success
|
|
41
|
+
conversation { ...ConversationFields }
|
|
42
|
+
}
|
|
35
43
|
}
|
|
36
|
-
`,
|
|
37
|
-
mutation DeleteConversation($id: ID!) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
`,v=`
|
|
45
|
+
mutation DeleteConversation($id: ID!) {
|
|
46
|
+
deleteConversation(id: $id) {
|
|
47
|
+
success
|
|
48
|
+
conversationId
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`,l=`
|
|
52
|
+
${d}
|
|
53
|
+
query Messages($conversationId: ID!, $first: Int, $after: String, $before: String, $filter: MessageFilter) {
|
|
54
|
+
messages(conversationId: $conversationId, first: $first, after: $after, before: $before, filter: $filter) {
|
|
42
55
|
edges { cursor node { ...MessageFields } }
|
|
43
|
-
pageInfo { hasNextPage endCursor }
|
|
56
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
57
|
+
totalCount
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
|
-
`,
|
|
47
|
-
${
|
|
60
|
+
`,g=`
|
|
61
|
+
${d}
|
|
48
62
|
mutation SendMessage($input: SendMessageInput!) {
|
|
49
|
-
sendMessage(input: $input) {
|
|
63
|
+
sendMessage(input: $input) {
|
|
64
|
+
success
|
|
65
|
+
message { ...MessageFields }
|
|
66
|
+
}
|
|
50
67
|
}
|
|
51
|
-
`,
|
|
52
|
-
${r}
|
|
68
|
+
`,E=`
|
|
53
69
|
query ConversationSettings($conversationId: ID!) {
|
|
54
|
-
|
|
70
|
+
conversation(id: $conversationId) {
|
|
71
|
+
id
|
|
72
|
+
settings
|
|
73
|
+
}
|
|
55
74
|
}
|
|
56
75
|
`,I=`
|
|
57
|
-
${
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
mutation UpdateConversationSettings($input: UpdateConversationInput!) {
|
|
77
|
+
updateConversation(input: $input) {
|
|
78
|
+
success
|
|
79
|
+
conversation {
|
|
80
|
+
id
|
|
81
|
+
settings
|
|
82
|
+
}
|
|
83
|
+
}
|
|
60
84
|
}
|
|
61
|
-
`;function
|
|
85
|
+
`;function S(s,n){if(n==null)return null;let e=n??{};return {conversationId:s,notificationsEnabled:typeof e.notificationsEnabled=="boolean"?e.notificationsEnabled:null,muted:typeof e.muted=="boolean"?e.muted:null,pinned:typeof e.pinned=="boolean"?e.pinned:null,metadata:e.metadata??null}}function f(s){let{workspace:n}=s.gql;return {async list(e){return (await n.request(c,{filter:e?.filter,first:e?.first,after:e?.after,sort:e?.sort})).conversations},async get(e){return (await n.request(u,{id:e})).conversation},async create(e){let t=await n.request(p,{input:e});if(!t.createConversation.success||!t.createConversation.conversation)throw new o("conversations.create: server returned empty conversation","CREATE_CONVERSATION_FAILED");return t.createConversation.conversation},async update(e){let t=await n.request(C,{input:e});if(!t.updateConversation.success||!t.updateConversation.conversation)throw new o("conversations.update: server returned empty conversation","UPDATE_CONVERSATION_FAILED");return t.updateConversation.conversation},async delete(e){return (await n.request(v,{id:e})).deleteConversation.success},messages:{async list(e,t){return (await n.request(l,{conversationId:e,first:t?.first,after:t?.after,before:t?.before,filter:t?.filter})).messages},async send(e){let t=await n.request(g,{input:e});if(!t.sendMessage.success||!t.sendMessage.message)throw new o("conversations.messages.send: server returned empty message","SEND_MESSAGE_FAILED");return t.sendMessage.message}},settings:{async get(e){let t=await n.request(E,{conversationId:e});return t.conversation?S(e,t.conversation.settings):null},async set(e){let t={id:e.conversationId,settings:{notificationsEnabled:e.notificationsEnabled,muted:e.muted,pinned:e.pinned,metadata:e.metadata}},r=await n.request(I,{input:t});if(!r.updateConversation.success||!r.updateConversation.conversation)throw new o("conversations.settings.set: server returned empty conversation","UPDATE_CONVERSATION_SETTINGS_FAILED");return S(e.conversationId,r.updateConversation.conversation.settings)??{conversationId:e.conversationId,notificationsEnabled:e.notificationsEnabled??null,muted:e.muted??null,pinned:e.pinned??null,metadata:e.metadata??null}}}}}var N={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth"],attach(s){return f(s)}},w=N;module.exports=w;
|
|
@@ -2,16 +2,26 @@ import { J as Json, S as SdkModule } from '../../module-JDbvil5h.cjs';
|
|
|
2
2
|
import 'graphql-request';
|
|
3
3
|
|
|
4
4
|
type ConversationType = 'DIRECT' | 'GROUP' | 'CHANNEL' | 'BOT' | 'AI';
|
|
5
|
+
type ConversationState = 'ACTIVE' | 'ARCHIVED' | 'DELETED' | 'MUTED';
|
|
6
|
+
type ConversationVisibility = 'PRIVATE' | 'INTERNAL' | 'PUBLIC';
|
|
5
7
|
interface Conversation {
|
|
6
8
|
id: string;
|
|
7
9
|
title?: string | null;
|
|
8
10
|
type: ConversationType;
|
|
9
11
|
description?: string | null;
|
|
10
|
-
|
|
12
|
+
avatar?: string | null;
|
|
11
13
|
settings?: Json;
|
|
12
|
-
|
|
14
|
+
state: ConversationState;
|
|
15
|
+
visibility: ConversationVisibility;
|
|
16
|
+
isGroup: boolean;
|
|
17
|
+
memberCount: number;
|
|
18
|
+
unreadCount: number;
|
|
19
|
+
mentionCount: number;
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
createdBy: string;
|
|
13
22
|
createdAt: string;
|
|
14
23
|
updatedAt: string;
|
|
24
|
+
deletedAt?: string | null;
|
|
15
25
|
}
|
|
16
26
|
interface ConversationConnection {
|
|
17
27
|
edges: Array<{
|
|
@@ -20,37 +30,61 @@ interface ConversationConnection {
|
|
|
20
30
|
}>;
|
|
21
31
|
pageInfo: {
|
|
22
32
|
hasNextPage: boolean;
|
|
33
|
+
hasPreviousPage?: boolean | null;
|
|
34
|
+
startCursor?: string | null;
|
|
23
35
|
endCursor?: string | null;
|
|
24
36
|
};
|
|
37
|
+
totalCount?: number | null;
|
|
25
38
|
}
|
|
26
39
|
interface ConversationFilterInput {
|
|
40
|
+
hasMentions?: boolean;
|
|
27
41
|
type?: ConversationType;
|
|
42
|
+
state?: ConversationState;
|
|
43
|
+
visibility?: ConversationVisibility;
|
|
28
44
|
search?: string;
|
|
29
|
-
|
|
45
|
+
workspaceId?: string;
|
|
30
46
|
}
|
|
47
|
+
type ConversationSort = 'CREATED_AT' | 'UPDATED_AT' | 'LAST_MESSAGE_AT';
|
|
31
48
|
interface CreateConversationInput {
|
|
32
49
|
title?: string;
|
|
33
50
|
type: ConversationType;
|
|
34
51
|
description?: string;
|
|
35
52
|
participantIds?: string[];
|
|
53
|
+
visibility?: ConversationVisibility;
|
|
36
54
|
metadata?: Json;
|
|
37
55
|
}
|
|
38
56
|
interface UpdateConversationInput {
|
|
39
57
|
id: string;
|
|
40
58
|
title?: string;
|
|
41
59
|
description?: string;
|
|
60
|
+
avatar?: string;
|
|
42
61
|
settings?: Json;
|
|
62
|
+
state?: ConversationState;
|
|
63
|
+
visibility?: ConversationVisibility;
|
|
43
64
|
}
|
|
44
|
-
type MessageType = 'TEXT' | 'IMAGE' | 'FILE' | 'SYSTEM';
|
|
65
|
+
type MessageType = 'TEXT' | 'IMAGE' | 'FILE' | 'SYSTEM' | 'CALL' | 'POLL' | 'EVENT' | 'COMMAND' | 'NOTIFICATION';
|
|
45
66
|
interface Message {
|
|
46
67
|
id: string;
|
|
47
68
|
conversationId: string;
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
authorId: string;
|
|
70
|
+
authorType: string;
|
|
71
|
+
content: Json;
|
|
50
72
|
type: MessageType;
|
|
51
73
|
metadata?: Json;
|
|
74
|
+
status: string;
|
|
75
|
+
isEdited: boolean;
|
|
76
|
+
isPinned: boolean;
|
|
77
|
+
isHidden: boolean;
|
|
78
|
+
isAnonymous: boolean;
|
|
79
|
+
readCount: number;
|
|
80
|
+
replyCount: number;
|
|
81
|
+
threadLevel: number;
|
|
82
|
+
threadRootId?: string | null;
|
|
83
|
+
parentMessageId?: string | null;
|
|
52
84
|
createdAt: string;
|
|
53
|
-
updatedAt
|
|
85
|
+
updatedAt: string;
|
|
86
|
+
editedAt?: string | null;
|
|
87
|
+
pinnedAt?: string | null;
|
|
54
88
|
}
|
|
55
89
|
interface MessageConnection {
|
|
56
90
|
edges: Array<{
|
|
@@ -59,14 +93,25 @@ interface MessageConnection {
|
|
|
59
93
|
}>;
|
|
60
94
|
pageInfo: {
|
|
61
95
|
hasNextPage: boolean;
|
|
96
|
+
hasPreviousPage?: boolean | null;
|
|
97
|
+
startCursor?: string | null;
|
|
62
98
|
endCursor?: string | null;
|
|
63
99
|
};
|
|
100
|
+
totalCount?: number | null;
|
|
101
|
+
}
|
|
102
|
+
interface MessageFilter {
|
|
103
|
+
type?: MessageType;
|
|
104
|
+
authorId?: string;
|
|
105
|
+
pinned?: boolean;
|
|
106
|
+
hasAttachments?: boolean;
|
|
107
|
+
search?: string;
|
|
64
108
|
}
|
|
65
109
|
interface SendMessageInput {
|
|
66
110
|
conversationId: string;
|
|
67
|
-
content:
|
|
111
|
+
content: Json;
|
|
68
112
|
type?: MessageType;
|
|
69
113
|
metadata?: Json;
|
|
114
|
+
parentMessageId?: string;
|
|
70
115
|
}
|
|
71
116
|
interface ConversationSettings {
|
|
72
117
|
conversationId: string;
|
|
@@ -87,6 +132,8 @@ interface ConversationMessagesApi {
|
|
|
87
132
|
list(conversationId: string, opts?: {
|
|
88
133
|
first?: number;
|
|
89
134
|
after?: string;
|
|
135
|
+
before?: string;
|
|
136
|
+
filter?: MessageFilter;
|
|
90
137
|
}): Promise<MessageConnection>;
|
|
91
138
|
send(input: SendMessageInput): Promise<Message>;
|
|
92
139
|
}
|
|
@@ -94,11 +141,14 @@ interface ConversationSettingsApi {
|
|
|
94
141
|
get(conversationId: string): Promise<ConversationSettings | null>;
|
|
95
142
|
set(input: UpdateConversationSettingsInput): Promise<ConversationSettings>;
|
|
96
143
|
}
|
|
144
|
+
interface ConversationsListOptions {
|
|
145
|
+
filter?: ConversationFilterInput;
|
|
146
|
+
first?: number;
|
|
147
|
+
after?: string;
|
|
148
|
+
sort?: ConversationSort;
|
|
149
|
+
}
|
|
97
150
|
interface ConversationsApi {
|
|
98
|
-
list(
|
|
99
|
-
first?: number;
|
|
100
|
-
after?: string;
|
|
101
|
-
}): Promise<ConversationConnection>;
|
|
151
|
+
list(opts?: ConversationsListOptions): Promise<ConversationConnection>;
|
|
102
152
|
get(id: string): Promise<Conversation | null>;
|
|
103
153
|
create(input: CreateConversationInput): Promise<Conversation>;
|
|
104
154
|
update(input: UpdateConversationInput): Promise<Conversation>;
|
|
@@ -2,16 +2,26 @@ import { J as Json, S as SdkModule } from '../../module-JDbvil5h.js';
|
|
|
2
2
|
import 'graphql-request';
|
|
3
3
|
|
|
4
4
|
type ConversationType = 'DIRECT' | 'GROUP' | 'CHANNEL' | 'BOT' | 'AI';
|
|
5
|
+
type ConversationState = 'ACTIVE' | 'ARCHIVED' | 'DELETED' | 'MUTED';
|
|
6
|
+
type ConversationVisibility = 'PRIVATE' | 'INTERNAL' | 'PUBLIC';
|
|
5
7
|
interface Conversation {
|
|
6
8
|
id: string;
|
|
7
9
|
title?: string | null;
|
|
8
10
|
type: ConversationType;
|
|
9
11
|
description?: string | null;
|
|
10
|
-
|
|
12
|
+
avatar?: string | null;
|
|
11
13
|
settings?: Json;
|
|
12
|
-
|
|
14
|
+
state: ConversationState;
|
|
15
|
+
visibility: ConversationVisibility;
|
|
16
|
+
isGroup: boolean;
|
|
17
|
+
memberCount: number;
|
|
18
|
+
unreadCount: number;
|
|
19
|
+
mentionCount: number;
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
createdBy: string;
|
|
13
22
|
createdAt: string;
|
|
14
23
|
updatedAt: string;
|
|
24
|
+
deletedAt?: string | null;
|
|
15
25
|
}
|
|
16
26
|
interface ConversationConnection {
|
|
17
27
|
edges: Array<{
|
|
@@ -20,37 +30,61 @@ interface ConversationConnection {
|
|
|
20
30
|
}>;
|
|
21
31
|
pageInfo: {
|
|
22
32
|
hasNextPage: boolean;
|
|
33
|
+
hasPreviousPage?: boolean | null;
|
|
34
|
+
startCursor?: string | null;
|
|
23
35
|
endCursor?: string | null;
|
|
24
36
|
};
|
|
37
|
+
totalCount?: number | null;
|
|
25
38
|
}
|
|
26
39
|
interface ConversationFilterInput {
|
|
40
|
+
hasMentions?: boolean;
|
|
27
41
|
type?: ConversationType;
|
|
42
|
+
state?: ConversationState;
|
|
43
|
+
visibility?: ConversationVisibility;
|
|
28
44
|
search?: string;
|
|
29
|
-
|
|
45
|
+
workspaceId?: string;
|
|
30
46
|
}
|
|
47
|
+
type ConversationSort = 'CREATED_AT' | 'UPDATED_AT' | 'LAST_MESSAGE_AT';
|
|
31
48
|
interface CreateConversationInput {
|
|
32
49
|
title?: string;
|
|
33
50
|
type: ConversationType;
|
|
34
51
|
description?: string;
|
|
35
52
|
participantIds?: string[];
|
|
53
|
+
visibility?: ConversationVisibility;
|
|
36
54
|
metadata?: Json;
|
|
37
55
|
}
|
|
38
56
|
interface UpdateConversationInput {
|
|
39
57
|
id: string;
|
|
40
58
|
title?: string;
|
|
41
59
|
description?: string;
|
|
60
|
+
avatar?: string;
|
|
42
61
|
settings?: Json;
|
|
62
|
+
state?: ConversationState;
|
|
63
|
+
visibility?: ConversationVisibility;
|
|
43
64
|
}
|
|
44
|
-
type MessageType = 'TEXT' | 'IMAGE' | 'FILE' | 'SYSTEM';
|
|
65
|
+
type MessageType = 'TEXT' | 'IMAGE' | 'FILE' | 'SYSTEM' | 'CALL' | 'POLL' | 'EVENT' | 'COMMAND' | 'NOTIFICATION';
|
|
45
66
|
interface Message {
|
|
46
67
|
id: string;
|
|
47
68
|
conversationId: string;
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
authorId: string;
|
|
70
|
+
authorType: string;
|
|
71
|
+
content: Json;
|
|
50
72
|
type: MessageType;
|
|
51
73
|
metadata?: Json;
|
|
74
|
+
status: string;
|
|
75
|
+
isEdited: boolean;
|
|
76
|
+
isPinned: boolean;
|
|
77
|
+
isHidden: boolean;
|
|
78
|
+
isAnonymous: boolean;
|
|
79
|
+
readCount: number;
|
|
80
|
+
replyCount: number;
|
|
81
|
+
threadLevel: number;
|
|
82
|
+
threadRootId?: string | null;
|
|
83
|
+
parentMessageId?: string | null;
|
|
52
84
|
createdAt: string;
|
|
53
|
-
updatedAt
|
|
85
|
+
updatedAt: string;
|
|
86
|
+
editedAt?: string | null;
|
|
87
|
+
pinnedAt?: string | null;
|
|
54
88
|
}
|
|
55
89
|
interface MessageConnection {
|
|
56
90
|
edges: Array<{
|
|
@@ -59,14 +93,25 @@ interface MessageConnection {
|
|
|
59
93
|
}>;
|
|
60
94
|
pageInfo: {
|
|
61
95
|
hasNextPage: boolean;
|
|
96
|
+
hasPreviousPage?: boolean | null;
|
|
97
|
+
startCursor?: string | null;
|
|
62
98
|
endCursor?: string | null;
|
|
63
99
|
};
|
|
100
|
+
totalCount?: number | null;
|
|
101
|
+
}
|
|
102
|
+
interface MessageFilter {
|
|
103
|
+
type?: MessageType;
|
|
104
|
+
authorId?: string;
|
|
105
|
+
pinned?: boolean;
|
|
106
|
+
hasAttachments?: boolean;
|
|
107
|
+
search?: string;
|
|
64
108
|
}
|
|
65
109
|
interface SendMessageInput {
|
|
66
110
|
conversationId: string;
|
|
67
|
-
content:
|
|
111
|
+
content: Json;
|
|
68
112
|
type?: MessageType;
|
|
69
113
|
metadata?: Json;
|
|
114
|
+
parentMessageId?: string;
|
|
70
115
|
}
|
|
71
116
|
interface ConversationSettings {
|
|
72
117
|
conversationId: string;
|
|
@@ -87,6 +132,8 @@ interface ConversationMessagesApi {
|
|
|
87
132
|
list(conversationId: string, opts?: {
|
|
88
133
|
first?: number;
|
|
89
134
|
after?: string;
|
|
135
|
+
before?: string;
|
|
136
|
+
filter?: MessageFilter;
|
|
90
137
|
}): Promise<MessageConnection>;
|
|
91
138
|
send(input: SendMessageInput): Promise<Message>;
|
|
92
139
|
}
|
|
@@ -94,11 +141,14 @@ interface ConversationSettingsApi {
|
|
|
94
141
|
get(conversationId: string): Promise<ConversationSettings | null>;
|
|
95
142
|
set(input: UpdateConversationSettingsInput): Promise<ConversationSettings>;
|
|
96
143
|
}
|
|
144
|
+
interface ConversationsListOptions {
|
|
145
|
+
filter?: ConversationFilterInput;
|
|
146
|
+
first?: number;
|
|
147
|
+
after?: string;
|
|
148
|
+
sort?: ConversationSort;
|
|
149
|
+
}
|
|
97
150
|
interface ConversationsApi {
|
|
98
|
-
list(
|
|
99
|
-
first?: number;
|
|
100
|
-
after?: string;
|
|
101
|
-
}): Promise<ConversationConnection>;
|
|
151
|
+
list(opts?: ConversationsListOptions): Promise<ConversationConnection>;
|
|
102
152
|
get(id: string): Promise<Conversation | null>;
|
|
103
153
|
create(input: CreateConversationInput): Promise<Conversation>;
|
|
104
154
|
update(input: UpdateConversationInput): Promise<Conversation>;
|
|
@@ -1,61 +1,85 @@
|
|
|
1
|
-
var
|
|
1
|
+
import {b as b$1}from'../../chunk-NEREAHJ6.js';var r=`
|
|
2
2
|
fragment ConversationFields on Conversation {
|
|
3
|
-
id title type description
|
|
3
|
+
id title type description avatar settings
|
|
4
|
+
state visibility isGroup memberCount unreadCount mentionCount
|
|
5
|
+
workspaceId createdBy createdAt updatedAt deletedAt
|
|
4
6
|
}
|
|
5
|
-
`,
|
|
7
|
+
`,u=`
|
|
6
8
|
fragment MessageFields on Message {
|
|
7
|
-
id conversationId
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
conversationId notificationsEnabled muted pinned metadata
|
|
9
|
+
id conversationId authorId authorType content type
|
|
10
|
+
metadata status isEdited isPinned isHidden isAnonymous
|
|
11
|
+
readCount replyCount threadLevel threadRootId parentMessageId
|
|
12
|
+
createdAt updatedAt editedAt pinnedAt
|
|
12
13
|
}
|
|
13
|
-
`,
|
|
14
|
-
${
|
|
15
|
-
query Conversations($filter:
|
|
16
|
-
conversations(filter: $filter, first: $first, after: $after) {
|
|
14
|
+
`,c=`
|
|
15
|
+
${r}
|
|
16
|
+
query Conversations($filter: ConversationFilter, $first: Int, $after: String, $sort: ConversationSort) {
|
|
17
|
+
conversations(filter: $filter, first: $first, after: $after, sort: $sort) {
|
|
17
18
|
edges { cursor node { ...ConversationFields } }
|
|
18
|
-
pageInfo { hasNextPage endCursor }
|
|
19
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
20
|
+
totalCount
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
`,
|
|
22
|
-
${
|
|
23
|
+
`,v=`
|
|
24
|
+
${r}
|
|
23
25
|
query Conversation($id: ID!) {
|
|
24
26
|
conversation(id: $id) { ...ConversationFields }
|
|
25
27
|
}
|
|
26
|
-
`,
|
|
27
|
-
${
|
|
28
|
+
`,C=`
|
|
29
|
+
${r}
|
|
28
30
|
mutation CreateConversation($input: CreateConversationInput!) {
|
|
29
|
-
createConversation(input: $input) {
|
|
31
|
+
createConversation(input: $input) {
|
|
32
|
+
success
|
|
33
|
+
conversation { ...ConversationFields }
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
|
-
`,
|
|
32
|
-
${
|
|
36
|
+
`,p=`
|
|
37
|
+
${r}
|
|
33
38
|
mutation UpdateConversation($input: UpdateConversationInput!) {
|
|
34
|
-
updateConversation(input: $input) {
|
|
39
|
+
updateConversation(input: $input) {
|
|
40
|
+
success
|
|
41
|
+
conversation { ...ConversationFields }
|
|
42
|
+
}
|
|
35
43
|
}
|
|
36
|
-
`,
|
|
37
|
-
mutation DeleteConversation($id: ID!) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
messages(conversationId: $conversationId, first: $first, after: $after) {
|
|
42
|
-
edges { cursor node { ...MessageFields } }
|
|
43
|
-
pageInfo { hasNextPage endCursor }
|
|
44
|
+
`,l=`
|
|
45
|
+
mutation DeleteConversation($id: ID!) {
|
|
46
|
+
deleteConversation(id: $id) {
|
|
47
|
+
success
|
|
48
|
+
conversationId
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
`,g=`
|
|
47
|
-
${
|
|
52
|
+
${u}
|
|
53
|
+
query Messages($conversationId: ID!, $first: Int, $after: String, $before: String, $filter: MessageFilter) {
|
|
54
|
+
messages(conversationId: $conversationId, first: $first, after: $after, before: $before, filter: $filter) {
|
|
55
|
+
edges { cursor node { ...MessageFields } }
|
|
56
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
57
|
+
totalCount
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`,S=`
|
|
61
|
+
${u}
|
|
48
62
|
mutation SendMessage($input: SendMessageInput!) {
|
|
49
|
-
sendMessage(input: $input) {
|
|
63
|
+
sendMessage(input: $input) {
|
|
64
|
+
success
|
|
65
|
+
message { ...MessageFields }
|
|
66
|
+
}
|
|
50
67
|
}
|
|
51
|
-
`,
|
|
52
|
-
${d}
|
|
68
|
+
`,f=`
|
|
53
69
|
query ConversationSettings($conversationId: ID!) {
|
|
54
|
-
|
|
70
|
+
conversation(id: $conversationId) {
|
|
71
|
+
id
|
|
72
|
+
settings
|
|
73
|
+
}
|
|
55
74
|
}
|
|
56
|
-
`,
|
|
57
|
-
${
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
`,I=`
|
|
76
|
+
mutation UpdateConversationSettings($input: UpdateConversationInput!) {
|
|
77
|
+
updateConversation(input: $input) {
|
|
78
|
+
success
|
|
79
|
+
conversation {
|
|
80
|
+
id
|
|
81
|
+
settings
|
|
82
|
+
}
|
|
83
|
+
}
|
|
60
84
|
}
|
|
61
|
-
`;function
|
|
85
|
+
`;function E(s,n){if(n==null)return null;let e=n??{};return {conversationId:s,notificationsEnabled:typeof e.notificationsEnabled=="boolean"?e.notificationsEnabled:null,muted:typeof e.muted=="boolean"?e.muted:null,pinned:typeof e.pinned=="boolean"?e.pinned:null,metadata:e.metadata??null}}function m(s){let{workspace:n}=s.gql;return {async list(e){return (await n.request(c,{filter:e?.filter,first:e?.first,after:e?.after,sort:e?.sort})).conversations},async get(e){return (await n.request(v,{id:e})).conversation},async create(e){let t=await n.request(C,{input:e});if(!t.createConversation.success||!t.createConversation.conversation)throw new b$1("conversations.create: server returned empty conversation","CREATE_CONVERSATION_FAILED");return t.createConversation.conversation},async update(e){let t=await n.request(p,{input:e});if(!t.updateConversation.success||!t.updateConversation.conversation)throw new b$1("conversations.update: server returned empty conversation","UPDATE_CONVERSATION_FAILED");return t.updateConversation.conversation},async delete(e){return (await n.request(l,{id:e})).deleteConversation.success},messages:{async list(e,t){return (await n.request(g,{conversationId:e,first:t?.first,after:t?.after,before:t?.before,filter:t?.filter})).messages},async send(e){let t=await n.request(S,{input:e});if(!t.sendMessage.success||!t.sendMessage.message)throw new b$1("conversations.messages.send: server returned empty message","SEND_MESSAGE_FAILED");return t.sendMessage.message}},settings:{async get(e){let t=await n.request(f,{conversationId:e});return t.conversation?E(e,t.conversation.settings):null},async set(e){let t={id:e.conversationId,settings:{notificationsEnabled:e.notificationsEnabled,muted:e.muted,pinned:e.pinned,metadata:e.metadata}},a=await n.request(I,{input:t});if(!a.updateConversation.success||!a.updateConversation.conversation)throw new b$1("conversations.settings.set: server returned empty conversation","UPDATE_CONVERSATION_SETTINGS_FAILED");return E(e.conversationId,a.updateConversation.conversation.settings)??{conversationId:e.conversationId,notificationsEnabled:e.notificationsEnabled??null,muted:e.muted??null,pinned:e.pinned??null,metadata:e.metadata??null}}}}}var A={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth"],attach(s){return m(s)}},b=A;export{b as default};
|