@droz-js/sdk 0.2.9 → 0.2.11
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 +30 -0
- package/src/chatwidget-ws.js +21 -0
- package/src/chatwidget.d.ts +31 -0
- package/src/chatwidget.js +21 -0
- package/src/client/helpers.js +1 -1
- package/src/client/http.d.ts +6 -3
- package/src/client/http.js +15 -4
- package/src/client/ws.js +2 -1
- package/src/drozbot.d.ts +9 -3
- package/src/drozchat-ws.d.ts +9 -0
- package/src/drozchat.d.ts +12 -3
- package/src/droznexo.d.ts +15 -15
- package/src/mercadolivre.d.ts +3 -3
- package/src/nucleus.d.ts +24 -3
- package/src/reclameaqui.d.ts +3 -3
- package/src/sdks/chatwidget.d.ts +248 -0
- package/src/sdks/chatwidget.js +118 -0
- package/src/sdks/drozbot.d.ts +49 -0
- package/src/sdks/drozbot.js +23 -1
- package/src/sdks/drozchat.d.ts +79 -23
- package/src/sdks/drozchat.js +47 -6
- package/src/sdks/droznexo.d.ts +70 -63
- package/src/sdks/droznexo.js +48 -46
- package/src/sdks/nucleus.d.ts +156 -32
- package/src/sdks/nucleus.js +101 -1
- package/src/zendesk.d.ts +3 -3
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './sdks/chatwidget';
|
|
2
|
+
export declare const ChatwidgetWs: new () => {
|
|
3
|
+
readonly ws: any;
|
|
4
|
+
connect(): Promise<void>;
|
|
5
|
+
} & {
|
|
6
|
+
getChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
7
|
+
id: string;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").GetChatWidgetQuery>;
|
|
9
|
+
listChatWidgets(variables?: import("./sdks/chatwidget").Exact<{
|
|
10
|
+
[key: string]: never;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").ListChatWidgetsQuery>;
|
|
12
|
+
createChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
13
|
+
input: import("./sdks/chatwidget").CreateChatWidgetInput;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").CreateChatWidgetMutation>;
|
|
15
|
+
updateChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
16
|
+
input: import("./sdks/chatwidget").UpdateChatWidgetInput;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").UpdateChatWidgetMutation>;
|
|
18
|
+
removeChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
19
|
+
input: import("./sdks/chatwidget").RemoveChatWidgetInput;
|
|
20
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").RemoveChatWidgetMutation>;
|
|
21
|
+
startChatWidgetSession(variables: import("./sdks/chatwidget").Exact<{
|
|
22
|
+
input: import("./sdks/chatwidget").StartChatWidgetSessionInput;
|
|
23
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").StartChatWidgetSessionMutation>;
|
|
24
|
+
sendMessageToChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
25
|
+
input: import("./sdks/chatwidget").SendMessageToChatWidgetInput;
|
|
26
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").SendMessageToChatWidgetMutation>;
|
|
27
|
+
onChatWidgetMessage(variables: import("./sdks/chatwidget").Exact<{
|
|
28
|
+
sessionId: string;
|
|
29
|
+
}>, options?: unknown): AsyncIterableIterator<import("./sdks/chatwidget").OnChatWidgetMessageSubscription>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ChatwidgetWs = void 0;
|
|
18
|
+
const ws_1 = require("./client/ws");
|
|
19
|
+
const chatwidget_1 = require("./sdks/chatwidget");
|
|
20
|
+
__exportStar(require("./sdks/chatwidget"), exports);
|
|
21
|
+
exports.ChatwidgetWs = (0, ws_1.WsClientBuilder)(chatwidget_1.serviceName, chatwidget_1.getSdk);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './sdks/chatwidget';
|
|
2
|
+
export declare const ChatWidget: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
|
+
readonly http: any;
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
|
+
} & {
|
|
7
|
+
getChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
8
|
+
id: string;
|
|
9
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").GetChatWidgetQuery>;
|
|
10
|
+
listChatWidgets(variables?: import("./sdks/chatwidget").Exact<{
|
|
11
|
+
[key: string]: never;
|
|
12
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").ListChatWidgetsQuery>;
|
|
13
|
+
createChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
14
|
+
input: import("./sdks/chatwidget").CreateChatWidgetInput;
|
|
15
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").CreateChatWidgetMutation>;
|
|
16
|
+
updateChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
17
|
+
input: import("./sdks/chatwidget").UpdateChatWidgetInput;
|
|
18
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").UpdateChatWidgetMutation>;
|
|
19
|
+
removeChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
20
|
+
input: import("./sdks/chatwidget").RemoveChatWidgetInput;
|
|
21
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").RemoveChatWidgetMutation>;
|
|
22
|
+
startChatWidgetSession(variables: import("./sdks/chatwidget").Exact<{
|
|
23
|
+
input: import("./sdks/chatwidget").StartChatWidgetSessionInput;
|
|
24
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").StartChatWidgetSessionMutation>;
|
|
25
|
+
sendMessageToChatWidget(variables: import("./sdks/chatwidget").Exact<{
|
|
26
|
+
input: import("./sdks/chatwidget").SendMessageToChatWidgetInput;
|
|
27
|
+
}>, options?: unknown): Promise<import("./sdks/chatwidget").SendMessageToChatWidgetMutation>;
|
|
28
|
+
onChatWidgetMessage(variables: import("./sdks/chatwidget").Exact<{
|
|
29
|
+
sessionId: string;
|
|
30
|
+
}>, options?: unknown): AsyncIterableIterator<import("./sdks/chatwidget").OnChatWidgetMessageSubscription>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ChatWidget = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const chatwidget_1 = require("./sdks/chatwidget");
|
|
20
|
+
__exportStar(require("./sdks/chatwidget"), exports);
|
|
21
|
+
exports.ChatWidget = (0, http_1.HttpClientBuilder)(chatwidget_1.serviceName, chatwidget_1.getSdk);
|
package/src/client/helpers.js
CHANGED
|
@@ -35,7 +35,7 @@ function mapGraphqlResponse(response) {
|
|
|
35
35
|
if (response && 'stack' in response && 'message' in response)
|
|
36
36
|
throw response;
|
|
37
37
|
if ('errors' in response)
|
|
38
|
-
|
|
38
|
+
throw new Error(response.errors.map(e => e.message).join('\n'));
|
|
39
39
|
if ('data' in response)
|
|
40
40
|
return response.data;
|
|
41
41
|
}
|
package/src/client/http.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AuthorizationProvider, GetSdk } from './helpers';
|
|
2
|
-
export
|
|
2
|
+
export interface HttpClientOptions {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function HttpClientBuilder<Sdk>(serviceName: string, getSdk: GetSdk<Sdk>): new (options?: HttpClientOptions) => {
|
|
3
6
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: AuthorizationProvider):
|
|
7
|
+
forTenant(tenant: string): any;
|
|
8
|
+
withAuthorization(authorization: AuthorizationProvider): any;
|
|
6
9
|
} & Sdk;
|
package/src/client/http.js
CHANGED
|
@@ -31,10 +31,12 @@ function buildArgs(req) {
|
|
|
31
31
|
}
|
|
32
32
|
class HttpRequester {
|
|
33
33
|
serviceName;
|
|
34
|
+
options;
|
|
34
35
|
tenant;
|
|
35
36
|
authorization;
|
|
36
|
-
constructor(serviceName) {
|
|
37
|
+
constructor(serviceName, options) {
|
|
37
38
|
this.serviceName = serviceName;
|
|
39
|
+
this.options = options;
|
|
38
40
|
}
|
|
39
41
|
forTenant(tenant) {
|
|
40
42
|
this.tenant = tenant;
|
|
@@ -46,6 +48,9 @@ class HttpRequester {
|
|
|
46
48
|
return this.requester.bind(this);
|
|
47
49
|
}
|
|
48
50
|
requester(query, variables) {
|
|
51
|
+
if (this.options?.debug) {
|
|
52
|
+
console.log('[Droz SDK]:request', { query, variables });
|
|
53
|
+
}
|
|
49
54
|
// subscriptions are not executable with the http sdk
|
|
50
55
|
if (query.match(/subscription .*{/))
|
|
51
56
|
return emptyAsyncIterator();
|
|
@@ -60,7 +65,8 @@ class HttpRequester {
|
|
|
60
65
|
]);
|
|
61
66
|
const endpoint = tenant.getEndpoint(this.serviceName);
|
|
62
67
|
const heads = new Headers();
|
|
63
|
-
|
|
68
|
+
if (authorization)
|
|
69
|
+
heads.set('Authorization', authorization);
|
|
64
70
|
heads.set('Content-Type', 'application/json');
|
|
65
71
|
heads.set('Accept', 'application/json');
|
|
66
72
|
const headers = Object.fromEntries(heads.entries());
|
|
@@ -70,6 +76,9 @@ class HttpRequester {
|
|
|
70
76
|
const { endpoint, headers } = await this.buildRequest();
|
|
71
77
|
const body = JSON.stringify(request);
|
|
72
78
|
const args = buildArgs(request);
|
|
79
|
+
if (this.options?.debug) {
|
|
80
|
+
console.log('[Droz SDK]:batch', { args, endpoint, headers, body });
|
|
81
|
+
}
|
|
73
82
|
// make POST request
|
|
74
83
|
const response = await fetch(`${endpoint}?${args}`, {
|
|
75
84
|
method: 'POST',
|
|
@@ -88,16 +97,18 @@ __decorate([
|
|
|
88
97
|
function HttpClientBuilder(serviceName, getSdk) {
|
|
89
98
|
class Client {
|
|
90
99
|
http; // cannot type as HttpSdkRequesterBuilder because it is an anonymous class
|
|
91
|
-
constructor() {
|
|
92
|
-
this.http = new HttpRequester(serviceName);
|
|
100
|
+
constructor(options) {
|
|
101
|
+
this.http = new HttpRequester(serviceName, options);
|
|
93
102
|
const sdk = getSdk(this.http.build());
|
|
94
103
|
Object.assign(this, sdk);
|
|
95
104
|
}
|
|
96
105
|
forTenant(tenant) {
|
|
97
106
|
this.http.forTenant(tenant);
|
|
107
|
+
return this;
|
|
98
108
|
}
|
|
99
109
|
withAuthorization(authorization) {
|
|
100
110
|
this.http.withAuthorization(authorization);
|
|
111
|
+
return this;
|
|
101
112
|
}
|
|
102
113
|
}
|
|
103
114
|
return Client;
|
package/src/client/ws.js
CHANGED
|
@@ -18,12 +18,13 @@ class WsRequester {
|
|
|
18
18
|
config_1.DrozSdk.getAuthorization()
|
|
19
19
|
]);
|
|
20
20
|
const endpoint = tenant.getEndpoint(this.serviceName, 'ws');
|
|
21
|
+
const connectionParams = authorization ? { authorization } : {};
|
|
21
22
|
this.client = (0, graphql_ws_1.createClient)({
|
|
22
23
|
url: endpoint,
|
|
23
24
|
lazy: true,
|
|
24
25
|
retryAttempts: 128,
|
|
25
26
|
keepAlive: 25000,
|
|
26
|
-
connectionParams
|
|
27
|
+
connectionParams
|
|
27
28
|
});
|
|
28
29
|
return this.client;
|
|
29
30
|
}
|
package/src/drozbot.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './sdks/drozbot';
|
|
2
|
-
export declare const DrozBot: new () => {
|
|
2
|
+
export declare const DrozBot: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
3
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider):
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
6
|
} & {
|
|
7
7
|
getDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
8
8
|
id: string;
|
|
@@ -19,4 +19,10 @@ export declare const DrozBot: new () => {
|
|
|
19
19
|
removeDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
20
20
|
input: import("./sdks/drozbot").RemoveDrozBotInstanceInput;
|
|
21
21
|
}>, options?: unknown): Promise<import("./sdks/drozbot").RemoveDrozBotInstanceMutation>;
|
|
22
|
+
createDrozBotTicket(variables: import("./sdks/drozbot").Exact<{
|
|
23
|
+
input: import("./sdks/drozbot").CreateDrozBotTicketInput;
|
|
24
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").CreateDrozBotTicketMutation>;
|
|
25
|
+
createDrozBotTicketComment(variables: import("./sdks/drozbot").Exact<{
|
|
26
|
+
input: import("./sdks/drozbot").CreateDrozBotTicketCommentInput;
|
|
27
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").CreateDrozBotTicketCommentMutation>;
|
|
22
28
|
};
|
package/src/drozchat-ws.d.ts
CHANGED
|
@@ -3,6 +3,15 @@ export declare const DrozChatWs: new () => {
|
|
|
3
3
|
readonly ws: any;
|
|
4
4
|
connect(): Promise<void>;
|
|
5
5
|
} & {
|
|
6
|
+
createDrozChatAgent(variables: import("./sdks/drozchat").Exact<{
|
|
7
|
+
input: import("./sdks/drozchat").CreateDrozChatAgentInput;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/drozchat").CreateDrozChatAgentMutation>;
|
|
9
|
+
listDrozChatAgents(variables?: import("./sdks/drozchat").Exact<{
|
|
10
|
+
next?: object;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/drozchat").ListDrozChatAgentsQuery>;
|
|
12
|
+
getDrozChatAgent(variables: import("./sdks/drozchat").Exact<{
|
|
13
|
+
id: string;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/drozchat").GetDrozChatAgentQuery>;
|
|
6
15
|
createCustomer(variables: import("./sdks/drozchat").Exact<{
|
|
7
16
|
input: import("./sdks/drozchat").CreateCustomerInput;
|
|
8
17
|
}>, options?: unknown): Promise<import("./sdks/drozchat").CreateCustomerMutation>;
|
package/src/drozchat.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
export * from './sdks/drozchat';
|
|
2
|
-
export declare const DrozChat: new () => {
|
|
2
|
+
export declare const DrozChat: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
3
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider):
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
6
|
} & {
|
|
7
|
+
createDrozChatAgent(variables: import("./sdks/drozchat").Exact<{
|
|
8
|
+
input: import("./sdks/drozchat").CreateDrozChatAgentInput;
|
|
9
|
+
}>, options?: unknown): Promise<import("./sdks/drozchat").CreateDrozChatAgentMutation>;
|
|
10
|
+
listDrozChatAgents(variables?: import("./sdks/drozchat").Exact<{
|
|
11
|
+
next?: object;
|
|
12
|
+
}>, options?: unknown): Promise<import("./sdks/drozchat").ListDrozChatAgentsQuery>;
|
|
13
|
+
getDrozChatAgent(variables: import("./sdks/drozchat").Exact<{
|
|
14
|
+
id: string;
|
|
15
|
+
}>, options?: unknown): Promise<import("./sdks/drozchat").GetDrozChatAgentQuery>;
|
|
7
16
|
createCustomer(variables: import("./sdks/drozchat").Exact<{
|
|
8
17
|
input: import("./sdks/drozchat").CreateCustomerInput;
|
|
9
18
|
}>, options?: unknown): Promise<import("./sdks/drozchat").CreateCustomerMutation>;
|
package/src/droznexo.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export * from './sdks/droznexo';
|
|
2
|
-
export declare const DrozNexo: new () => {
|
|
2
|
+
export declare const DrozNexo: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
3
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider):
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
6
|
} & {
|
|
7
|
-
|
|
8
|
-
input: import("./sdks/droznexo").
|
|
9
|
-
}>, options?: unknown): Promise<import("./sdks/droznexo").
|
|
10
|
-
|
|
7
|
+
createDrozNexoAgent(variables: import("./sdks/droznexo").Exact<{
|
|
8
|
+
input: import("./sdks/droznexo").CreateDrozNexoAgentInput;
|
|
9
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").CreateDrozNexoAgentMutation>;
|
|
10
|
+
listDrozNexoAgents(variables?: import("./sdks/droznexo").Exact<{
|
|
11
11
|
next?: object;
|
|
12
|
-
}>, options?: unknown): Promise<import("./sdks/droznexo").
|
|
13
|
-
|
|
12
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").ListDrozNexoAgentsQuery>;
|
|
13
|
+
getDrozNexoAgent(variables: import("./sdks/droznexo").Exact<{
|
|
14
14
|
id: string;
|
|
15
|
-
}>, options?: unknown): Promise<import("./sdks/droznexo").
|
|
16
|
-
|
|
17
|
-
input: import("./sdks/droznexo").
|
|
18
|
-
}>, options?: unknown): Promise<import("./sdks/droznexo").
|
|
19
|
-
|
|
15
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").GetDrozNexoAgentQuery>;
|
|
16
|
+
createDrozNexoAgentGroup(variables: import("./sdks/droznexo").Exact<{
|
|
17
|
+
input: import("./sdks/droznexo").CreateDrozNexoAgentGroupInput;
|
|
18
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").CreateDrozNexoAgentGroupMutation>;
|
|
19
|
+
listDrozNexoAgentGroups(variables?: import("./sdks/droznexo").Exact<{
|
|
20
20
|
next?: object;
|
|
21
|
-
}>, options?: unknown): Promise<import("./sdks/droznexo").
|
|
21
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").ListDrozNexoAgentGroupsQuery>;
|
|
22
22
|
};
|
package/src/mercadolivre.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './sdks/mercadolivre';
|
|
2
|
-
export declare const MercadoLivre: new () => {
|
|
2
|
+
export declare const MercadoLivre: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
3
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider):
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
6
|
} & {
|
|
7
7
|
getMercadoLivreInstance(variables: import("./sdks/mercadolivre").Exact<{
|
|
8
8
|
id: string;
|
package/src/nucleus.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
export * from './sdks/nucleus';
|
|
2
|
-
export declare const Nucleus: new () => {
|
|
2
|
+
export declare const Nucleus: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
3
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider):
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
6
|
} & {
|
|
7
|
+
getAgent(variables: import("./sdks/nucleus").Exact<{
|
|
8
|
+
id: string;
|
|
9
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetAgentQuery>;
|
|
10
|
+
listAgents(variables?: import("./sdks/nucleus").Exact<{
|
|
11
|
+
next?: object;
|
|
12
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").ListAgentsQuery>;
|
|
13
|
+
createAgent(variables: import("./sdks/nucleus").Exact<{
|
|
14
|
+
input: import("./sdks/nucleus").CreateAgentInput;
|
|
15
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").CreateAgentMutation>;
|
|
16
|
+
updateAgent(variables: import("./sdks/nucleus").Exact<{
|
|
17
|
+
input: import("./sdks/nucleus").UpdateAgentInput;
|
|
18
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").UpdateAgentMutation>;
|
|
19
|
+
removeAgent(variables: import("./sdks/nucleus").Exact<{
|
|
20
|
+
input: import("./sdks/nucleus").RemoveAgentInput;
|
|
21
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").RemoveAgentMutation>;
|
|
7
22
|
getApp(variables: import("./sdks/nucleus").Exact<{
|
|
8
23
|
appId: string;
|
|
9
24
|
withInstances?: boolean;
|
|
@@ -17,6 +32,12 @@ export declare const Nucleus: new () => {
|
|
|
17
32
|
appType?: import("./sdks/nucleus").AppType;
|
|
18
33
|
withApp?: boolean;
|
|
19
34
|
}>, options?: unknown): Promise<import("./sdks/nucleus").ListAppInstancesQuery>;
|
|
35
|
+
getAmplifyConfig(variables?: import("./sdks/nucleus").Exact<{
|
|
36
|
+
[key: string]: never;
|
|
37
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetAmplifyConfigQuery>;
|
|
38
|
+
getAuthInfo(variables?: import("./sdks/nucleus").Exact<{
|
|
39
|
+
[key: string]: never;
|
|
40
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetAuthInfoQuery>;
|
|
20
41
|
getCredentials(variables: import("./sdks/nucleus").Exact<{
|
|
21
42
|
id: string;
|
|
22
43
|
}>, options?: unknown): Promise<import("./sdks/nucleus").GetCredentialsQuery>;
|
package/src/reclameaqui.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './sdks/reclameaqui';
|
|
2
|
-
export declare const Reclameaqui: new () => {
|
|
2
|
+
export declare const Reclameaqui: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
3
|
readonly http: any;
|
|
4
|
-
forTenant(tenant: string):
|
|
5
|
-
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider):
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
6
|
} & {
|
|
7
7
|
getReclameAquiInstance(variables: import("./sdks/reclameaqui").Exact<{
|
|
8
8
|
id: string;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
export type Maybe<T> = T;
|
|
2
|
+
export type InputMaybe<T> = T;
|
|
3
|
+
export type Exact<T extends {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}> = {
|
|
6
|
+
[K in keyof T]: T[K];
|
|
7
|
+
};
|
|
8
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
9
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
10
|
+
};
|
|
11
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
12
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
13
|
+
};
|
|
14
|
+
export type MakeEmpty<T extends {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}, K extends keyof T> = {
|
|
17
|
+
[_ in K]?: never;
|
|
18
|
+
};
|
|
19
|
+
export type Incremental<T> = T | {
|
|
20
|
+
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
|
|
21
|
+
};
|
|
22
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
23
|
+
export type Scalars = {
|
|
24
|
+
ID: {
|
|
25
|
+
input: string;
|
|
26
|
+
output: string;
|
|
27
|
+
};
|
|
28
|
+
String: {
|
|
29
|
+
input: string;
|
|
30
|
+
output: string;
|
|
31
|
+
};
|
|
32
|
+
Boolean: {
|
|
33
|
+
input: boolean;
|
|
34
|
+
output: boolean;
|
|
35
|
+
};
|
|
36
|
+
Int: {
|
|
37
|
+
input: number;
|
|
38
|
+
output: number;
|
|
39
|
+
};
|
|
40
|
+
Float: {
|
|
41
|
+
input: number;
|
|
42
|
+
output: number;
|
|
43
|
+
};
|
|
44
|
+
Base64: {
|
|
45
|
+
input: object;
|
|
46
|
+
output: string;
|
|
47
|
+
};
|
|
48
|
+
DRN: {
|
|
49
|
+
input: string;
|
|
50
|
+
output: string;
|
|
51
|
+
};
|
|
52
|
+
Date: {
|
|
53
|
+
input: Date;
|
|
54
|
+
output: Date;
|
|
55
|
+
};
|
|
56
|
+
DateTime: {
|
|
57
|
+
input: Date;
|
|
58
|
+
output: Date;
|
|
59
|
+
};
|
|
60
|
+
EmailAddress: {
|
|
61
|
+
input: string;
|
|
62
|
+
output: string;
|
|
63
|
+
};
|
|
64
|
+
JSON: {
|
|
65
|
+
input: any;
|
|
66
|
+
output: any;
|
|
67
|
+
};
|
|
68
|
+
JSONObject: {
|
|
69
|
+
input: any;
|
|
70
|
+
output: any;
|
|
71
|
+
};
|
|
72
|
+
Set: {
|
|
73
|
+
input: Set<any>;
|
|
74
|
+
output: any[];
|
|
75
|
+
};
|
|
76
|
+
URL: {
|
|
77
|
+
input: string;
|
|
78
|
+
output: string;
|
|
79
|
+
};
|
|
80
|
+
Void: {
|
|
81
|
+
input: void;
|
|
82
|
+
output: void;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export type ChatWidget = {
|
|
86
|
+
id: Scalars['ID']['output'];
|
|
87
|
+
name: Scalars['String']['output'];
|
|
88
|
+
};
|
|
89
|
+
export type ChatWidgetMessage = {
|
|
90
|
+
id: Scalars['ID']['output'];
|
|
91
|
+
payload: Array<ChatWidgetMessagePayload>;
|
|
92
|
+
};
|
|
93
|
+
export type ChatWidgetMessagePayload = {
|
|
94
|
+
content: Scalars['String']['output'];
|
|
95
|
+
contentType: Scalars['String']['output'];
|
|
96
|
+
filename?: Maybe<Scalars['String']['output']>;
|
|
97
|
+
};
|
|
98
|
+
export type ChatWidgetSession = {
|
|
99
|
+
id: Scalars['ID']['output'];
|
|
100
|
+
};
|
|
101
|
+
export type CreateChatWidgetInput = {
|
|
102
|
+
name: Scalars['String']['input'];
|
|
103
|
+
};
|
|
104
|
+
export type Mutation = {
|
|
105
|
+
createChatWidget?: Maybe<ChatWidget>;
|
|
106
|
+
removeChatWidget?: Maybe<ChatWidget>;
|
|
107
|
+
sendMessageToChatWidget?: Maybe<Scalars['Void']['output']>;
|
|
108
|
+
startChatWidgetSession?: Maybe<ChatWidgetSession>;
|
|
109
|
+
updateChatWidget?: Maybe<ChatWidget>;
|
|
110
|
+
version?: Maybe<Scalars['String']['output']>;
|
|
111
|
+
};
|
|
112
|
+
export type MutationCreateChatWidgetArgs = {
|
|
113
|
+
input: CreateChatWidgetInput;
|
|
114
|
+
};
|
|
115
|
+
export type MutationRemoveChatWidgetArgs = {
|
|
116
|
+
input: RemoveChatWidgetInput;
|
|
117
|
+
};
|
|
118
|
+
export type MutationSendMessageToChatWidgetArgs = {
|
|
119
|
+
input: SendMessageToChatWidgetInput;
|
|
120
|
+
};
|
|
121
|
+
export type MutationStartChatWidgetSessionArgs = {
|
|
122
|
+
input: StartChatWidgetSessionInput;
|
|
123
|
+
};
|
|
124
|
+
export type MutationUpdateChatWidgetArgs = {
|
|
125
|
+
input: UpdateChatWidgetInput;
|
|
126
|
+
};
|
|
127
|
+
export type PageInfo = {
|
|
128
|
+
hasNext: Scalars['Boolean']['output'];
|
|
129
|
+
next?: Maybe<Scalars['Base64']['output']>;
|
|
130
|
+
};
|
|
131
|
+
export type Query = {
|
|
132
|
+
app?: Maybe<Scalars['DRN']['output']>;
|
|
133
|
+
getChatWidget?: Maybe<ChatWidget>;
|
|
134
|
+
getHttpEndpoint?: Maybe<Scalars['String']['output']>;
|
|
135
|
+
getWsEndpoint?: Maybe<Scalars['String']['output']>;
|
|
136
|
+
listChatWidgets: Array<ChatWidget>;
|
|
137
|
+
version?: Maybe<Scalars['String']['output']>;
|
|
138
|
+
};
|
|
139
|
+
export type QueryGetChatWidgetArgs = {
|
|
140
|
+
id: Scalars['ID']['input'];
|
|
141
|
+
};
|
|
142
|
+
export type RemoveChatWidgetInput = {
|
|
143
|
+
id: Scalars['ID']['input'];
|
|
144
|
+
};
|
|
145
|
+
export type SendMessageToChatWidgetInput = {
|
|
146
|
+
content: Scalars['String']['input'];
|
|
147
|
+
contentType: Scalars['String']['input'];
|
|
148
|
+
sessionId: Scalars['ID']['input'];
|
|
149
|
+
};
|
|
150
|
+
export type StartChatWidgetSessionInput = {
|
|
151
|
+
chatId: Scalars['ID']['input'];
|
|
152
|
+
};
|
|
153
|
+
export type Subscription = {
|
|
154
|
+
onChatWidgetMessage: ChatWidgetMessage;
|
|
155
|
+
version?: Maybe<Scalars['String']['output']>;
|
|
156
|
+
};
|
|
157
|
+
export type SubscriptionOnChatWidgetMessageArgs = {
|
|
158
|
+
sessionId: Scalars['ID']['input'];
|
|
159
|
+
};
|
|
160
|
+
export declare enum SubscriptionAction {
|
|
161
|
+
Created = "CREATED",
|
|
162
|
+
Removed = "REMOVED",
|
|
163
|
+
Updated = "UPDATED"
|
|
164
|
+
}
|
|
165
|
+
export declare enum Typenames {
|
|
166
|
+
Any = "Any",
|
|
167
|
+
ChatWidgetSessions = "ChatWidgetSessions",
|
|
168
|
+
ChatWidgets = "ChatWidgets",
|
|
169
|
+
GraphqlConnections = "GraphqlConnections",
|
|
170
|
+
GraphqlSubscriptions = "GraphqlSubscriptions"
|
|
171
|
+
}
|
|
172
|
+
export type UpdateChatWidgetInput = {
|
|
173
|
+
id: Scalars['ID']['input'];
|
|
174
|
+
name: Scalars['String']['input'];
|
|
175
|
+
};
|
|
176
|
+
export type ChatWidgetFragment = Pick<ChatWidget, 'id' | 'name'>;
|
|
177
|
+
export type ChatWidgetMessageFragment = (Pick<ChatWidgetMessage, 'id'> & {
|
|
178
|
+
payload: Array<Pick<ChatWidgetMessagePayload, 'contentType' | 'content' | 'filename'>>;
|
|
179
|
+
});
|
|
180
|
+
export type GetChatWidgetQueryVariables = Exact<{
|
|
181
|
+
id: Scalars['ID']['input'];
|
|
182
|
+
}>;
|
|
183
|
+
export type GetChatWidgetQuery = {
|
|
184
|
+
getChatWidget?: Maybe<ChatWidgetFragment>;
|
|
185
|
+
};
|
|
186
|
+
export type ListChatWidgetsQueryVariables = Exact<{
|
|
187
|
+
[key: string]: never;
|
|
188
|
+
}>;
|
|
189
|
+
export type ListChatWidgetsQuery = {
|
|
190
|
+
listChatWidgets: Array<ChatWidgetFragment>;
|
|
191
|
+
};
|
|
192
|
+
export type CreateChatWidgetMutationVariables = Exact<{
|
|
193
|
+
input: CreateChatWidgetInput;
|
|
194
|
+
}>;
|
|
195
|
+
export type CreateChatWidgetMutation = {
|
|
196
|
+
createChatWidget?: Maybe<ChatWidgetFragment>;
|
|
197
|
+
};
|
|
198
|
+
export type UpdateChatWidgetMutationVariables = Exact<{
|
|
199
|
+
input: UpdateChatWidgetInput;
|
|
200
|
+
}>;
|
|
201
|
+
export type UpdateChatWidgetMutation = {
|
|
202
|
+
updateChatWidget?: Maybe<ChatWidgetFragment>;
|
|
203
|
+
};
|
|
204
|
+
export type RemoveChatWidgetMutationVariables = Exact<{
|
|
205
|
+
input: RemoveChatWidgetInput;
|
|
206
|
+
}>;
|
|
207
|
+
export type RemoveChatWidgetMutation = {
|
|
208
|
+
removeChatWidget?: Maybe<ChatWidgetFragment>;
|
|
209
|
+
};
|
|
210
|
+
export type StartChatWidgetSessionMutationVariables = Exact<{
|
|
211
|
+
input: StartChatWidgetSessionInput;
|
|
212
|
+
}>;
|
|
213
|
+
export type StartChatWidgetSessionMutation = {
|
|
214
|
+
startChatWidgetSession?: Maybe<Pick<ChatWidgetSession, 'id'>>;
|
|
215
|
+
};
|
|
216
|
+
export type SendMessageToChatWidgetMutationVariables = Exact<{
|
|
217
|
+
input: SendMessageToChatWidgetInput;
|
|
218
|
+
}>;
|
|
219
|
+
export type SendMessageToChatWidgetMutation = Pick<Mutation, 'sendMessageToChatWidget'>;
|
|
220
|
+
export type OnChatWidgetMessageSubscriptionVariables = Exact<{
|
|
221
|
+
sessionId: Scalars['ID']['input'];
|
|
222
|
+
}>;
|
|
223
|
+
export type OnChatWidgetMessageSubscription = {
|
|
224
|
+
onChatWidgetMessage: ChatWidgetMessageFragment;
|
|
225
|
+
};
|
|
226
|
+
export declare const ChatWidgetFragmentDoc = "\n fragment chatWidget on ChatWidget {\n id\n name\n}\n ";
|
|
227
|
+
export declare const ChatWidgetMessageFragmentDoc = "\n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n payload {\n contentType\n content\n filename\n }\n}\n ";
|
|
228
|
+
export declare const GetChatWidgetDocument = "\n query getChatWidget($id: ID!) {\n getChatWidget(id: $id) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n}\n ";
|
|
229
|
+
export declare const ListChatWidgetsDocument = "\n query listChatWidgets {\n listChatWidgets {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n}\n ";
|
|
230
|
+
export declare const CreateChatWidgetDocument = "\n mutation createChatWidget($input: CreateChatWidgetInput!) {\n createChatWidget(input: $input) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n}\n ";
|
|
231
|
+
export declare const UpdateChatWidgetDocument = "\n mutation updateChatWidget($input: UpdateChatWidgetInput!) {\n updateChatWidget(input: $input) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n}\n ";
|
|
232
|
+
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}\n ";
|
|
233
|
+
export declare const StartChatWidgetSessionDocument = "\n mutation startChatWidgetSession($input: StartChatWidgetSessionInput!) {\n startChatWidgetSession(input: $input) {\n id\n }\n}\n ";
|
|
234
|
+
export declare const SendMessageToChatWidgetDocument = "\n mutation sendMessageToChatWidget($input: SendMessageToChatWidgetInput!) {\n sendMessageToChatWidget(input: $input)\n}\n ";
|
|
235
|
+
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}\n ";
|
|
236
|
+
export type Requester<C = {}, E = unknown> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
|
|
237
|
+
export declare function getSdk<C, E>(requester: Requester<C, E>): {
|
|
238
|
+
getChatWidget(variables: GetChatWidgetQueryVariables, options?: C): Promise<GetChatWidgetQuery>;
|
|
239
|
+
listChatWidgets(variables?: ListChatWidgetsQueryVariables, options?: C): Promise<ListChatWidgetsQuery>;
|
|
240
|
+
createChatWidget(variables: CreateChatWidgetMutationVariables, options?: C): Promise<CreateChatWidgetMutation>;
|
|
241
|
+
updateChatWidget(variables: UpdateChatWidgetMutationVariables, options?: C): Promise<UpdateChatWidgetMutation>;
|
|
242
|
+
removeChatWidget(variables: RemoveChatWidgetMutationVariables, options?: C): Promise<RemoveChatWidgetMutation>;
|
|
243
|
+
startChatWidgetSession(variables: StartChatWidgetSessionMutationVariables, options?: C): Promise<StartChatWidgetSessionMutation>;
|
|
244
|
+
sendMessageToChatWidget(variables: SendMessageToChatWidgetMutationVariables, options?: C): Promise<SendMessageToChatWidgetMutation>;
|
|
245
|
+
onChatWidgetMessage(variables: OnChatWidgetMessageSubscriptionVariables, options?: C): AsyncIterableIterator<OnChatWidgetMessageSubscription>;
|
|
246
|
+
};
|
|
247
|
+
export type Sdk = ReturnType<typeof getSdk>;
|
|
248
|
+
export declare const serviceName = "@droz/chatwidget";
|