@droz-js/sdk 0.1.2
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/README.md +44 -0
- package/package.json +32 -0
- package/src/client/config.d.ts +19 -0
- package/src/client/config.js +68 -0
- package/src/client/http.d.ts +4 -0
- package/src/client/http.js +67 -0
- package/src/client/ws.d.ts +4 -0
- package/src/client/ws.js +72 -0
- package/src/drozbot.d.ts +20 -0
- package/src/drozbot.js +23 -0
- package/src/drozchat-ws.d.ts +18 -0
- package/src/drozchat-ws.js +21 -0
- package/src/drozchat.d.ts +20 -0
- package/src/drozchat.js +23 -0
- package/src/droznexo.d.ts +18 -0
- package/src/droznexo.js +21 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -0
- package/src/nucleus.d.ts +68 -0
- package/src/nucleus.js +21 -0
- package/src/reclameaqui.d.ts +20 -0
- package/src/reclameaqui.js +23 -0
- package/src/sdks/drozbot.d.ts +190 -0
- package/src/sdks/drozbot.js +76 -0
- package/src/sdks/drozchat.d.ts +524 -0
- package/src/sdks/drozchat.js +383 -0
- package/src/sdks/droznexo.d.ts +218 -0
- package/src/sdks/droznexo.js +109 -0
- package/src/sdks/nucleus.d.ts +658 -0
- package/src/sdks/nucleus.js +330 -0
- package/src/sdks/reclameaqui.d.ts +188 -0
- package/src/sdks/reclameaqui.js +75 -0
- package/src/sdks/zendesk.d.ts +205 -0
- package/src/sdks/zendesk.js +76 -0
- package/src/zendesk.d.ts +20 -0
- package/src/zendesk.js +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @droz-js/sdk
|
|
2
|
+
|
|
3
|
+
## Setup (required)
|
|
4
|
+
|
|
5
|
+
To set up the sdk you need to tell the tenant and the authentication method, the tenant is required. You must run this
|
|
6
|
+
first before making any sdk calls. The sdk will fail if you don't set up the tenant.
|
|
7
|
+
|
|
8
|
+
```typescript
|
|
9
|
+
import { DrozSdk } from '@droz-js/sdk';
|
|
10
|
+
|
|
11
|
+
DrozSdk.forTenant('dev').withAuthentication('Basic', 'username', 'password');
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
You can also split the setup in two steps
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { DrozSdk } from '@droz-js/sdk';
|
|
18
|
+
|
|
19
|
+
// first step (required)
|
|
20
|
+
DrozSdk.forTenant('dev');
|
|
21
|
+
|
|
22
|
+
// (optional) later when you have the authentication token you can set it and it will automatically be used in the new requests
|
|
23
|
+
DrozSdk.withAuthentication('Basic', 'username', 'password');
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Sample Sdks
|
|
27
|
+
|
|
28
|
+
### Droz Nexo
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { DrozNexo } from '@droz-js/sdk/droznexo';
|
|
32
|
+
|
|
33
|
+
const nexo = new DrozNexo();
|
|
34
|
+
const res = await nexo.getAgent({ id: 'agentId' });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Droz Chat
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { DrozChat } from '@droz-js/sdk/drozchat';
|
|
41
|
+
|
|
42
|
+
const chat = new DrozChat();
|
|
43
|
+
const res = await chat.listTicketsMine();
|
|
44
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@droz-js/sdk",
|
|
3
|
+
"description": "Droz SDK",
|
|
4
|
+
"version": "0.1.2",
|
|
5
|
+
"private": false,
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.js",
|
|
8
|
+
"./*": "./src/*.js",
|
|
9
|
+
"./server": "./src/index.ts",
|
|
10
|
+
"./server/*": "./src/*.ts"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"clean": "npx rimraf src/*.js src/*.d.ts src/**/*.js src/**/*.d.ts",
|
|
14
|
+
"prebuild": "npm run clean",
|
|
15
|
+
"build": "tsc --project tsconfig-build.json",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"cross-fetch": "^3.1.8",
|
|
20
|
+
"graphql": "^16.8.1",
|
|
21
|
+
"graphql-tag": "^2.12.6",
|
|
22
|
+
"graphql-ws": "^5.14.1",
|
|
23
|
+
"inbatches": "^0.0.10",
|
|
24
|
+
"zen-observable": "^0.10.0"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"package.json",
|
|
28
|
+
"src/**/*.js",
|
|
29
|
+
"src/**/*.d.ts",
|
|
30
|
+
"README.md"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare class DrozSdkConfig {
|
|
2
|
+
authentication?: string;
|
|
3
|
+
tenant?: string;
|
|
4
|
+
private initialized;
|
|
5
|
+
private instances;
|
|
6
|
+
setTenant(tenant: string): void;
|
|
7
|
+
setAuthentication(type?: string, ...values: string[]): void;
|
|
8
|
+
get(): Promise<this>;
|
|
9
|
+
getEndpoint(serviceName: string, type?: 'http' | 'ws'): string;
|
|
10
|
+
private reset;
|
|
11
|
+
private initialize;
|
|
12
|
+
}
|
|
13
|
+
export declare class DrozSdk {
|
|
14
|
+
private static readonly singleton;
|
|
15
|
+
static forTenant(tenant: string): typeof DrozSdk;
|
|
16
|
+
static withAuthentication(type?: string, ...values: string[]): void;
|
|
17
|
+
static config(): Promise<DrozSdkConfig>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DrozSdk = void 0;
|
|
4
|
+
const discoveryEndpoint = `https://th3xrek4rane2scfwwfoo7wemq0tvuzm.lambda-url.sa-east-1.on.aws`;
|
|
5
|
+
class DrozSdkConfig {
|
|
6
|
+
authentication;
|
|
7
|
+
tenant;
|
|
8
|
+
// internal state
|
|
9
|
+
initialized = false;
|
|
10
|
+
instances = [];
|
|
11
|
+
setTenant(tenant) {
|
|
12
|
+
this.tenant = tenant;
|
|
13
|
+
this.reset();
|
|
14
|
+
}
|
|
15
|
+
setAuthentication(type, ...values) {
|
|
16
|
+
if (!['Bearer', 'Basic'].includes(type)) {
|
|
17
|
+
throw new Error(`Invalid authentication type ${type}`);
|
|
18
|
+
}
|
|
19
|
+
if (values.length && values.every(Boolean)) {
|
|
20
|
+
if (type == 'Basic')
|
|
21
|
+
this.authentication = `Basic ${Buffer.from(values.join(':')).toString('base64')}`;
|
|
22
|
+
if (type == 'Bearer')
|
|
23
|
+
this.authentication = `Bearer ${values[0]}`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.authentication = undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async get() {
|
|
30
|
+
if (this.initialized)
|
|
31
|
+
return this;
|
|
32
|
+
return await this.initialize();
|
|
33
|
+
}
|
|
34
|
+
getEndpoint(serviceName, type = 'http') {
|
|
35
|
+
const serviceId = serviceName.replace('@droz/', '');
|
|
36
|
+
const instance = this.instances.find(instance => {
|
|
37
|
+
return instance.serviceId == serviceId && instance.type == type;
|
|
38
|
+
});
|
|
39
|
+
if (instance)
|
|
40
|
+
return instance.endpoint;
|
|
41
|
+
throw new Error(`Endpoint for ${serviceId} and type ${type} not found`);
|
|
42
|
+
}
|
|
43
|
+
reset() {
|
|
44
|
+
this.initialized = false;
|
|
45
|
+
this.instances = [];
|
|
46
|
+
}
|
|
47
|
+
async initialize() {
|
|
48
|
+
this.initialized = true;
|
|
49
|
+
const data = await fetch(`${discoveryEndpoint}/discover/${this.tenant}`);
|
|
50
|
+
const json = await data.json();
|
|
51
|
+
this.instances = json.instances;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class DrozSdk {
|
|
56
|
+
static singleton = new DrozSdkConfig();
|
|
57
|
+
static forTenant(tenant) {
|
|
58
|
+
this.singleton.setTenant(tenant);
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
static withAuthentication(type, ...values) {
|
|
62
|
+
this.singleton.setAuthentication(type, ...values);
|
|
63
|
+
}
|
|
64
|
+
static async config() {
|
|
65
|
+
return await this.singleton.get();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.DrozSdk = DrozSdk;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Observable from 'zen-observable';
|
|
2
|
+
type Requester<C = {}, E = unknown> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | Observable<R>;
|
|
3
|
+
export declare function HttpClientBuilder<Sdk>(serviceName: string, getSdk: (requester: Requester<Sdk, any>) => Sdk): new () => Sdk;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpClientBuilder = void 0;
|
|
4
|
+
const zen_observable_1 = require("zen-observable");
|
|
5
|
+
const config_1 = require("./config");
|
|
6
|
+
function buildRequestInfo(req) {
|
|
7
|
+
const operationNames = Array.isArray(req) ? req.map(r => r.operationName) : [req.operationName];
|
|
8
|
+
return [...new Set(operationNames)].join(',');
|
|
9
|
+
}
|
|
10
|
+
function onResponse(response) {
|
|
11
|
+
if (response && 'stack' in response && 'message' in response)
|
|
12
|
+
throw response;
|
|
13
|
+
function intercept(r) {
|
|
14
|
+
if (r.errors)
|
|
15
|
+
console.error(JSON.stringify(r.errors));
|
|
16
|
+
return r.data;
|
|
17
|
+
}
|
|
18
|
+
if (Array.isArray(response))
|
|
19
|
+
return response.map(intercept);
|
|
20
|
+
return intercept(response);
|
|
21
|
+
}
|
|
22
|
+
class HttpSdkRequesterBuilder {
|
|
23
|
+
serviceName;
|
|
24
|
+
constructor(serviceName) {
|
|
25
|
+
this.serviceName = serviceName;
|
|
26
|
+
}
|
|
27
|
+
build() {
|
|
28
|
+
return this.requester.bind(this);
|
|
29
|
+
}
|
|
30
|
+
requester(query, variables) {
|
|
31
|
+
// subscriptions are not executable with the http sdk
|
|
32
|
+
if (query.match(/subscription .*{/))
|
|
33
|
+
return zen_observable_1.default.of();
|
|
34
|
+
// extract operation name and enqueue the request to be executed in batches
|
|
35
|
+
const operationName = /(?:query|mutation) ([^({ ]*)/.exec(query)?.[1];
|
|
36
|
+
return this.inbatches({ query, variables, operationName }).then(onResponse);
|
|
37
|
+
}
|
|
38
|
+
// @InBatches({ maxBatchSize: 12 })
|
|
39
|
+
async inbatches(request) {
|
|
40
|
+
const config = await config_1.DrozSdk.config();
|
|
41
|
+
const endpoint = config.getEndpoint(this.serviceName, 'http');
|
|
42
|
+
const body = JSON.stringify(request);
|
|
43
|
+
const args = buildRequestInfo(request);
|
|
44
|
+
const headers = new Headers();
|
|
45
|
+
headers.set('Authorization', config.authentication);
|
|
46
|
+
headers.set('Content-Type', 'application/json');
|
|
47
|
+
// make POST request
|
|
48
|
+
const response = await fetch(`${endpoint}?${args}`, {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers: Object.fromEntries(headers.entries()),
|
|
51
|
+
body
|
|
52
|
+
});
|
|
53
|
+
// treat the response
|
|
54
|
+
return await response.json();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function HttpClientBuilder(serviceName, getSdk) {
|
|
58
|
+
class Client {
|
|
59
|
+
constructor() {
|
|
60
|
+
const http = new HttpSdkRequesterBuilder(serviceName);
|
|
61
|
+
const sdk = getSdk(http.build());
|
|
62
|
+
Object.assign(this, sdk);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return Client;
|
|
66
|
+
}
|
|
67
|
+
exports.HttpClientBuilder = HttpClientBuilder;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Observable from 'zen-observable';
|
|
2
|
+
type Requester<C = {}, E = unknown> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | Observable<R>;
|
|
3
|
+
export declare function WsClientBuilder<Sdk>(serviceName: string, getSdk: (requester: Requester<Sdk, any>) => Sdk): new () => Sdk;
|
|
4
|
+
export {};
|
package/src/client/ws.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsClientBuilder = void 0;
|
|
4
|
+
const graphql_ws_1 = require("graphql-ws");
|
|
5
|
+
const zen_observable_1 = require("zen-observable");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
class WsSdkRequesterBuilder {
|
|
8
|
+
serviceName;
|
|
9
|
+
_client;
|
|
10
|
+
constructor(serviceName) {
|
|
11
|
+
this.serviceName = serviceName;
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
return this.requester.bind(this);
|
|
15
|
+
}
|
|
16
|
+
async requester(query, variables) {
|
|
17
|
+
const client = await this.getClient();
|
|
18
|
+
const isSubscription = query.trim().startsWith('subscription ');
|
|
19
|
+
const operation = { query, variables };
|
|
20
|
+
if (isSubscription) {
|
|
21
|
+
return new zen_observable_1.default((observer) => {
|
|
22
|
+
return client.subscribe(operation, {
|
|
23
|
+
next: response => {
|
|
24
|
+
if (response.errors)
|
|
25
|
+
console.error(response.errors);
|
|
26
|
+
observer.next(response.data);
|
|
27
|
+
},
|
|
28
|
+
error: error => observer.error(error),
|
|
29
|
+
complete: () => observer.complete()
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
client.subscribe(operation, {
|
|
35
|
+
next: response => {
|
|
36
|
+
if (response.errors)
|
|
37
|
+
console.error(response.errors);
|
|
38
|
+
resolve(response.data);
|
|
39
|
+
},
|
|
40
|
+
error: error => reject(error),
|
|
41
|
+
complete: () => void 0
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async getClient() {
|
|
46
|
+
if (this._client)
|
|
47
|
+
return this._client;
|
|
48
|
+
const config = await config_1.DrozSdk.config();
|
|
49
|
+
const endpoint = config.getEndpoint(this.serviceName, 'ws');
|
|
50
|
+
this._client = (0, graphql_ws_1.createClient)({
|
|
51
|
+
url: endpoint,
|
|
52
|
+
lazy: true,
|
|
53
|
+
retryAttempts: 128,
|
|
54
|
+
keepAlive: 25000,
|
|
55
|
+
connectionParams: {
|
|
56
|
+
authorization: config.authentication
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return this._client;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function WsClientBuilder(serviceName, getSdk) {
|
|
63
|
+
class Client {
|
|
64
|
+
constructor() {
|
|
65
|
+
const http = new WsSdkRequesterBuilder(serviceName);
|
|
66
|
+
const sdk = getSdk(http.build());
|
|
67
|
+
Object.assign(this, sdk);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return Client;
|
|
71
|
+
}
|
|
72
|
+
exports.WsClientBuilder = WsClientBuilder;
|
package/src/drozbot.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './sdks/drozbot';
|
|
2
|
+
declare const DrozBot_base: new () => {
|
|
3
|
+
getDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
4
|
+
id: string;
|
|
5
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").GetDrozBotInstanceQuery>;
|
|
6
|
+
listDrozBotInstances(variables?: import("./sdks/drozbot").Exact<{
|
|
7
|
+
[key: string]: never;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").ListDrozBotInstancesQuery>;
|
|
9
|
+
createDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
10
|
+
input: import("./sdks/drozbot").CreateDrozBotInstanceInput;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").CreateDrozBotInstanceMutation>;
|
|
12
|
+
updateDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
13
|
+
input: import("./sdks/drozbot").UpdateDrozBotInstanceInput;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").UpdateDrozBotInstanceMutation>;
|
|
15
|
+
removeDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
16
|
+
input: import("./sdks/drozbot").RemoveDrozBotInstanceInput;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").RemoveDrozBotInstanceMutation>;
|
|
18
|
+
};
|
|
19
|
+
export declare class DrozBot extends DrozBot_base {
|
|
20
|
+
}
|
package/src/drozbot.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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.DrozBot = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const drozbot_1 = require("./sdks/drozbot");
|
|
20
|
+
__exportStar(require("./sdks/drozbot"), exports);
|
|
21
|
+
class DrozBot extends (0, http_1.HttpClientBuilder)(drozbot_1.serviceName, drozbot_1.getSdk) {
|
|
22
|
+
}
|
|
23
|
+
exports.DrozBot = DrozBot;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './sdks/drozchat';
|
|
2
|
+
export declare const DrozChatWs: new () => {
|
|
3
|
+
getDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
4
|
+
id: string;
|
|
5
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").GetDrozBotInstanceQuery>;
|
|
6
|
+
listDrozBotInstances(variables?: import("./sdks/drozbot").Exact<{
|
|
7
|
+
[key: string]: never;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").ListDrozBotInstancesQuery>;
|
|
9
|
+
createDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
10
|
+
input: import("./sdks/drozbot").CreateDrozBotInstanceInput;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").CreateDrozBotInstanceMutation>;
|
|
12
|
+
updateDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
13
|
+
input: import("./sdks/drozbot").UpdateDrozBotInstanceInput;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").UpdateDrozBotInstanceMutation>;
|
|
15
|
+
removeDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
16
|
+
input: import("./sdks/drozbot").RemoveDrozBotInstanceInput;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").RemoveDrozBotInstanceMutation>;
|
|
18
|
+
};
|
|
@@ -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.DrozChatWs = void 0;
|
|
18
|
+
const ws_1 = require("./client/ws");
|
|
19
|
+
const drozbot_1 = require("./sdks/drozbot");
|
|
20
|
+
__exportStar(require("./sdks/drozchat"), exports);
|
|
21
|
+
exports.DrozChatWs = (0, ws_1.WsClientBuilder)(drozbot_1.serviceName, drozbot_1.getSdk);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './sdks/drozchat';
|
|
2
|
+
declare const DrozChat_base: new () => {
|
|
3
|
+
getDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
4
|
+
id: string;
|
|
5
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").GetDrozBotInstanceQuery>;
|
|
6
|
+
listDrozBotInstances(variables?: import("./sdks/drozbot").Exact<{
|
|
7
|
+
[key: string]: never;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").ListDrozBotInstancesQuery>;
|
|
9
|
+
createDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
10
|
+
input: import("./sdks/drozbot").CreateDrozBotInstanceInput;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").CreateDrozBotInstanceMutation>;
|
|
12
|
+
updateDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
13
|
+
input: import("./sdks/drozbot").UpdateDrozBotInstanceInput;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").UpdateDrozBotInstanceMutation>;
|
|
15
|
+
removeDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
|
|
16
|
+
input: import("./sdks/drozbot").RemoveDrozBotInstanceInput;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/drozbot").RemoveDrozBotInstanceMutation>;
|
|
18
|
+
};
|
|
19
|
+
export declare class DrozChat extends DrozChat_base {
|
|
20
|
+
}
|
package/src/drozchat.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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.DrozChat = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const drozbot_1 = require("./sdks/drozbot");
|
|
20
|
+
__exportStar(require("./sdks/drozchat"), exports);
|
|
21
|
+
class DrozChat extends (0, http_1.HttpClientBuilder)(drozbot_1.serviceName, drozbot_1.getSdk) {
|
|
22
|
+
}
|
|
23
|
+
exports.DrozChat = DrozChat;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './sdks/droznexo';
|
|
2
|
+
export declare const DrozNexo: new () => {
|
|
3
|
+
createAgent(variables: import("./sdks/droznexo").Exact<{
|
|
4
|
+
input: import("./sdks/droznexo").CreateAgentInput;
|
|
5
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").CreateAgentMutation>;
|
|
6
|
+
listAgents(variables?: import("./sdks/droznexo").Exact<{
|
|
7
|
+
next?: object;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").ListAgentsQuery>;
|
|
9
|
+
getAgent(variables: import("./sdks/droznexo").Exact<{
|
|
10
|
+
id: string;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").GetAgentQuery>;
|
|
12
|
+
createAgentGroup(variables: import("./sdks/droznexo").Exact<{
|
|
13
|
+
input: import("./sdks/droznexo").CreateAgentGroupInput;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").CreateAgentGroupMutation>;
|
|
15
|
+
listAgentGroups(variables?: import("./sdks/droznexo").Exact<{
|
|
16
|
+
next?: object;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/droznexo").ListAgentGroupsQuery>;
|
|
18
|
+
};
|
package/src/droznexo.js
ADDED
|
@@ -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.DrozNexo = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const droznexo_1 = require("./sdks/droznexo");
|
|
20
|
+
__exportStar(require("./sdks/droznexo"), exports);
|
|
21
|
+
exports.DrozNexo = (0, http_1.HttpClientBuilder)(droznexo_1.serviceName, droznexo_1.getSdk);
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DrozSdk } from './client/config';
|
package/src/index.js
ADDED
package/src/nucleus.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export * from './sdks/nucleus';
|
|
2
|
+
export declare const Nucleus: new () => {
|
|
3
|
+
getApp(variables: import("./sdks/nucleus").Exact<{
|
|
4
|
+
appId: string;
|
|
5
|
+
withInstances?: boolean;
|
|
6
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetAppQuery>;
|
|
7
|
+
getApps(variables?: import("./sdks/nucleus").Exact<{
|
|
8
|
+
type?: import("./sdks/nucleus").AppType;
|
|
9
|
+
withInstances?: boolean;
|
|
10
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetAppsQuery>;
|
|
11
|
+
listAppInstances(variables?: import("./sdks/nucleus").Exact<{
|
|
12
|
+
appId?: string;
|
|
13
|
+
appType?: import("./sdks/nucleus").AppType;
|
|
14
|
+
withApp?: boolean;
|
|
15
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").ListAppInstancesQuery>;
|
|
16
|
+
getCredentials(variables: import("./sdks/nucleus").Exact<{
|
|
17
|
+
id: string;
|
|
18
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetCredentialsQuery>;
|
|
19
|
+
getCredentialsSecret(variables: import("./sdks/nucleus").Exact<{
|
|
20
|
+
id: string;
|
|
21
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetCredentialsSecretQuery>;
|
|
22
|
+
listCredentials(variables?: import("./sdks/nucleus").Exact<{
|
|
23
|
+
type?: import("./sdks/nucleus").CredentialsType;
|
|
24
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").ListCredentialsQuery>;
|
|
25
|
+
createCredentials(variables: import("./sdks/nucleus").Exact<{
|
|
26
|
+
input: import("./sdks/nucleus").CreateCredentialsInput;
|
|
27
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").CreateCredentialsMutation>;
|
|
28
|
+
updateCredentials(variables: import("./sdks/nucleus").Exact<{
|
|
29
|
+
input: import("./sdks/nucleus").UpdateCredentialsInput;
|
|
30
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").UpdateCredentialsMutation>;
|
|
31
|
+
removeCredentials(variables: import("./sdks/nucleus").Exact<{
|
|
32
|
+
input: import("./sdks/nucleus").RemoveCredentialsInput;
|
|
33
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").RemoveCredentialsMutation>;
|
|
34
|
+
getCronJob(variables: import("./sdks/nucleus").Exact<{
|
|
35
|
+
id: string;
|
|
36
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetCronJobQuery>;
|
|
37
|
+
listCronJobs(variables?: import("./sdks/nucleus").Exact<{
|
|
38
|
+
[key: string]: never;
|
|
39
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").ListCronJobsQuery>;
|
|
40
|
+
createCronJob(variables: import("./sdks/nucleus").Exact<{
|
|
41
|
+
input: import("./sdks/nucleus").CreateCronJobInput;
|
|
42
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").CreateCronJobMutation>;
|
|
43
|
+
updateCronJob(variables: import("./sdks/nucleus").Exact<{
|
|
44
|
+
input: import("./sdks/nucleus").UpdateCronJobInput;
|
|
45
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").UpdateCronJobMutation>;
|
|
46
|
+
removeCronJob(variables: import("./sdks/nucleus").Exact<{
|
|
47
|
+
input: import("./sdks/nucleus").RemoveCronJobInput;
|
|
48
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").RemoveCronJobMutation>;
|
|
49
|
+
resolveSession(variables: import("./sdks/nucleus").Exact<{
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
userId?: string;
|
|
52
|
+
triggerDrn: string;
|
|
53
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").ResolveSessionQuery>;
|
|
54
|
+
getSessionData(variables: import("./sdks/nucleus").Exact<{
|
|
55
|
+
sessionId: string;
|
|
56
|
+
namespace?: string;
|
|
57
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetSessionDataQuery>;
|
|
58
|
+
setSessionData(variables: import("./sdks/nucleus").Exact<{
|
|
59
|
+
input: import("./sdks/nucleus").SetSessionDataInput;
|
|
60
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").SetSessionDataMutation>;
|
|
61
|
+
patchSessionData(variables: import("./sdks/nucleus").Exact<{
|
|
62
|
+
input: import("./sdks/nucleus").PatchSessionDataInput;
|
|
63
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").PatchSessionDataMutation>;
|
|
64
|
+
getStateMachine(variables: import("./sdks/nucleus").Exact<{
|
|
65
|
+
id: string;
|
|
66
|
+
versionId: string;
|
|
67
|
+
}>, options?: unknown): Promise<import("./sdks/nucleus").GetStateMachineQuery>;
|
|
68
|
+
};
|
package/src/nucleus.js
ADDED
|
@@ -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.Nucleus = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const nucleus_1 = require("./sdks/nucleus");
|
|
20
|
+
__exportStar(require("./sdks/nucleus"), exports);
|
|
21
|
+
exports.Nucleus = (0, http_1.HttpClientBuilder)(nucleus_1.serviceName, nucleus_1.getSdk);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './sdks/reclameaqui';
|
|
2
|
+
declare const Reclameaqui_base: new () => {
|
|
3
|
+
getReclameAquiInstance(variables: import("./sdks/reclameaqui").Exact<{
|
|
4
|
+
id: string;
|
|
5
|
+
}>, options?: unknown): Promise<import("./sdks/reclameaqui").GetReclameAquiInstanceQuery>;
|
|
6
|
+
listReclameAquiInstances(variables?: import("./sdks/reclameaqui").Exact<{
|
|
7
|
+
[key: string]: never;
|
|
8
|
+
}>, options?: unknown): Promise<import("./sdks/reclameaqui").ListReclameAquiInstancesQuery>;
|
|
9
|
+
createReclameAquiInstance(variables: import("./sdks/reclameaqui").Exact<{
|
|
10
|
+
input: import("./sdks/reclameaqui").CreateReclameAquiInstanceInput;
|
|
11
|
+
}>, options?: unknown): Promise<import("./sdks/reclameaqui").CreateReclameAquiInstanceMutation>;
|
|
12
|
+
updateReclameAquiInstance(variables: import("./sdks/reclameaqui").Exact<{
|
|
13
|
+
input: import("./sdks/reclameaqui").UpdateReclameAquiInstanceInput;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/reclameaqui").UpdateReclameAquiInstanceMutation>;
|
|
15
|
+
removeReclameAquiInstance(variables: import("./sdks/reclameaqui").Exact<{
|
|
16
|
+
input: import("./sdks/reclameaqui").RemoveReclameAquiInstanceInput;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/reclameaqui").RemoveReclameAquiInstanceMutation>;
|
|
18
|
+
};
|
|
19
|
+
export declare class Reclameaqui extends Reclameaqui_base {
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.Reclameaqui = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const reclameaqui_1 = require("./sdks/reclameaqui");
|
|
20
|
+
__exportStar(require("./sdks/reclameaqui"), exports);
|
|
21
|
+
class Reclameaqui extends (0, http_1.HttpClientBuilder)(reclameaqui_1.serviceName, reclameaqui_1.getSdk) {
|
|
22
|
+
}
|
|
23
|
+
exports.Reclameaqui = Reclameaqui;
|