@droz-js/sdk 0.7.3 → 0.7.4
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/package.json +1 -1
- package/src/chatwidget-ws.d.ts +3 -0
- package/src/chatwidget.d.ts +3 -0
- package/src/sdks/chatwidget.d.ts +13 -0
- package/src/sdks/chatwidget.js +9 -1
package/package.json
CHANGED
package/src/chatwidget-ws.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ declare const ChatWidgetWs_base: new () => {
|
|
|
24
24
|
sendMessageToChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
25
25
|
input: import("./sdks/chatwidget").SendMessageToChatWidgetInput;
|
|
26
26
|
}>, options?: unknown): Promise<import("./sdks/chatwidget").SendMessageToChatWidgetMutation>;
|
|
27
|
+
closeChatWidgetSession(variables: import("./sdks/chatwidget").Exact<{
|
|
28
|
+
input: import("./sdks/chatwidget").CloseChatWidgetSessionInput;
|
|
29
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").CloseChatWidgetSessionMutation>;
|
|
27
30
|
onChatWidgetMessage(variables: import("./sdks/chatwidget").Exact<{
|
|
28
31
|
sessionId: string;
|
|
29
32
|
}>, options?: unknown): AsyncIterableIterator<import("./sdks/chatwidget").OnChatWidgetMessageSubscription>;
|
package/src/chatwidget.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ declare const ChatWidget_base: new (options?: import("./client/http").HttpClient
|
|
|
27
27
|
sendMessageToChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
28
28
|
input: import("./sdks/chatwidget").SendMessageToChatWidgetInput;
|
|
29
29
|
}>, options?: unknown): Promise<import("./sdks/chatwidget").SendMessageToChatWidgetMutation>;
|
|
30
|
+
closeChatWidgetSession(variables: import("./sdks/chatwidget").Exact<{
|
|
31
|
+
input: import("./sdks/chatwidget").CloseChatWidgetSessionInput;
|
|
32
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").CloseChatWidgetSessionMutation>;
|
|
30
33
|
onChatWidgetMessage(variables: import("./sdks/chatwidget").Exact<{
|
|
31
34
|
sessionId: string;
|
|
32
35
|
}>, options?: unknown): AsyncIterableIterator<import("./sdks/chatwidget").OnChatWidgetMessageSubscription>;
|
package/src/sdks/chatwidget.d.ts
CHANGED
|
@@ -170,6 +170,9 @@ export type ChatWidgetMessagePayload = {
|
|
|
170
170
|
export type ChatWidgetSession = {
|
|
171
171
|
id: Scalars['ID']['output'];
|
|
172
172
|
};
|
|
173
|
+
export type CloseChatWidgetSessionInput = {
|
|
174
|
+
sessionId: Scalars['ID']['input'];
|
|
175
|
+
};
|
|
173
176
|
export type CreateChatWidgetInput = {
|
|
174
177
|
name: Scalars['String']['input'];
|
|
175
178
|
};
|
|
@@ -182,6 +185,7 @@ export type I18nTextInput = {
|
|
|
182
185
|
value: Scalars['String']['input'];
|
|
183
186
|
};
|
|
184
187
|
export type Mutation = {
|
|
188
|
+
closeChatWidgetSession?: Maybe<Scalars['Void']['output']>;
|
|
185
189
|
createChatWidget?: Maybe<ChatWidget>;
|
|
186
190
|
removeChatWidget?: Maybe<ChatWidget>;
|
|
187
191
|
sendMessageToChatWidget?: Maybe<Scalars['Void']['output']>;
|
|
@@ -189,6 +193,9 @@ export type Mutation = {
|
|
|
189
193
|
updateChatWidget?: Maybe<ChatWidget>;
|
|
190
194
|
version?: Maybe<Scalars['String']['output']>;
|
|
191
195
|
};
|
|
196
|
+
export type MutationCloseChatWidgetSessionArgs = {
|
|
197
|
+
input: CloseChatWidgetSessionInput;
|
|
198
|
+
};
|
|
192
199
|
export type MutationCreateChatWidgetArgs = {
|
|
193
200
|
input: CreateChatWidgetInput;
|
|
194
201
|
};
|
|
@@ -364,6 +371,10 @@ export type SendMessageToChatWidgetMutationVariables = Exact<{
|
|
|
364
371
|
input: SendMessageToChatWidgetInput;
|
|
365
372
|
}>;
|
|
366
373
|
export type SendMessageToChatWidgetMutation = Pick<Mutation, 'sendMessageToChatWidget'>;
|
|
374
|
+
export type CloseChatWidgetSessionMutationVariables = Exact<{
|
|
375
|
+
input: CloseChatWidgetSessionInput;
|
|
376
|
+
}>;
|
|
377
|
+
export type CloseChatWidgetSessionMutation = Pick<Mutation, 'closeChatWidgetSession'>;
|
|
367
378
|
export type OnChatWidgetMessageSubscriptionVariables = Exact<{
|
|
368
379
|
sessionId: Scalars['ID']['input'];
|
|
369
380
|
}>;
|
|
@@ -379,6 +390,7 @@ export declare const UpdateChatWidgetDocument = "\n mutation updateChatWidget
|
|
|
379
390
|
export declare const RemoveChatWidgetDocument = "\n mutation removeChatWidget($input: RemoveChatWidgetInput!) {\n removeChatWidget(input: $input) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n createdAt\n updatedAt\n}\n ";
|
|
380
391
|
export declare const StartChatWidgetSessionDocument = "\n mutation startChatWidgetSession($input: StartChatWidgetSessionInput!) {\n startChatWidgetSession(input: $input) {\n id\n }\n}\n ";
|
|
381
392
|
export declare const SendMessageToChatWidgetDocument = "\n mutation sendMessageToChatWidget($input: SendMessageToChatWidgetInput!) {\n sendMessageToChatWidget(input: $input)\n}\n ";
|
|
393
|
+
export declare const CloseChatWidgetSessionDocument = "\n mutation closeChatWidgetSession($input: CloseChatWidgetSessionInput!) {\n closeChatWidgetSession(input: $input)\n}\n ";
|
|
382
394
|
export declare const OnChatWidgetMessageDocument = "\n subscription onChatWidgetMessage($sessionId: ID!) {\n onChatWidgetMessage(sessionId: $sessionId) {\n ...chatWidgetMessage\n }\n}\n \n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n payload {\n contentType\n content\n filename\n }\n sessionClosed\n}\n ";
|
|
383
395
|
export type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
|
|
384
396
|
export declare function getSdk<C>(requester: Requester<C>): {
|
|
@@ -389,6 +401,7 @@ export declare function getSdk<C>(requester: Requester<C>): {
|
|
|
389
401
|
removeChatWidget(variables: RemoveChatWidgetMutationVariables, options?: C): Promise<RemoveChatWidgetMutation>;
|
|
390
402
|
startChatWidgetSession(variables: StartChatWidgetSessionMutationVariables, options?: C): Promise<StartChatWidgetSessionMutation>;
|
|
391
403
|
sendMessageToChatWidget(variables: SendMessageToChatWidgetMutationVariables, options?: C): Promise<SendMessageToChatWidgetMutation>;
|
|
404
|
+
closeChatWidgetSession(variables: CloseChatWidgetSessionMutationVariables, options?: C): Promise<CloseChatWidgetSessionMutation>;
|
|
392
405
|
onChatWidgetMessage(variables: OnChatWidgetMessageSubscriptionVariables, options?: C): AsyncIterableIterator<OnChatWidgetMessageSubscription>;
|
|
393
406
|
};
|
|
394
407
|
export type Sdk = ReturnType<typeof getSdk>;
|
package/src/sdks/chatwidget.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* istanbul ignore file */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.serviceName = exports.getSdk = exports.OnChatWidgetMessageDocument = exports.SendMessageToChatWidgetDocument = exports.StartChatWidgetSessionDocument = exports.RemoveChatWidgetDocument = exports.UpdateChatWidgetDocument = exports.CreateChatWidgetDocument = exports.ListChatWidgetsDocument = exports.GetChatWidgetDocument = exports.ChatWidgetMessageFragmentDoc = exports.ChatWidgetFragmentDoc = exports.Typenames = exports.SubscriptionAction = exports.Can = exports.AppInstanceStatus = void 0;
|
|
4
|
+
exports.serviceName = exports.getSdk = exports.OnChatWidgetMessageDocument = exports.CloseChatWidgetSessionDocument = exports.SendMessageToChatWidgetDocument = exports.StartChatWidgetSessionDocument = exports.RemoveChatWidgetDocument = exports.UpdateChatWidgetDocument = exports.CreateChatWidgetDocument = exports.ListChatWidgetsDocument = exports.GetChatWidgetDocument = exports.ChatWidgetMessageFragmentDoc = exports.ChatWidgetFragmentDoc = exports.Typenames = exports.SubscriptionAction = exports.Can = exports.AppInstanceStatus = void 0;
|
|
5
5
|
var AppInstanceStatus;
|
|
6
6
|
(function (AppInstanceStatus) {
|
|
7
7
|
AppInstanceStatus["Active"] = "Active";
|
|
@@ -95,6 +95,11 @@ exports.SendMessageToChatWidgetDocument = `
|
|
|
95
95
|
sendMessageToChatWidget(input: $input)
|
|
96
96
|
}
|
|
97
97
|
`;
|
|
98
|
+
exports.CloseChatWidgetSessionDocument = `
|
|
99
|
+
mutation closeChatWidgetSession($input: CloseChatWidgetSessionInput!) {
|
|
100
|
+
closeChatWidgetSession(input: $input)
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
98
103
|
exports.OnChatWidgetMessageDocument = `
|
|
99
104
|
subscription onChatWidgetMessage($sessionId: ID!) {
|
|
100
105
|
onChatWidgetMessage(sessionId: $sessionId) {
|
|
@@ -125,6 +130,9 @@ function getSdk(requester) {
|
|
|
125
130
|
sendMessageToChatWidget(variables, options) {
|
|
126
131
|
return requester(exports.SendMessageToChatWidgetDocument, variables, options);
|
|
127
132
|
},
|
|
133
|
+
closeChatWidgetSession(variables, options) {
|
|
134
|
+
return requester(exports.CloseChatWidgetSessionDocument, variables, options);
|
|
135
|
+
},
|
|
128
136
|
onChatWidgetMessage(variables, options) {
|
|
129
137
|
return requester(exports.OnChatWidgetMessageDocument, variables, options);
|
|
130
138
|
}
|