@droz-js/sdk 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@droz-js/sdk",
3
3
  "description": "Droz SDK",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "private": false,
6
6
  "exports": {
7
7
  ".": "./src/index.js",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DrozSdk = void 0;
4
- const discoveryEndpoint = `https://th3xrek4rane2scfwwfoo7wemq0tvuzm.lambda-url.sa-east-1.on.aws`;
4
+ const discoveryEndpoint = 'https://th3xrek4rane2scfwwfoo7wemq0tvuzm.lambda-url.sa-east-1.on.aws';
5
5
  class DrozSdkConfig {
6
6
  authentication;
7
7
  tenant;
@@ -36,8 +36,14 @@ class DrozSdkConfig {
36
36
  const instance = this.instances.find(instance => {
37
37
  return instance.serviceId == serviceId && instance.type == type;
38
38
  });
39
- if (instance)
39
+ if (instance) {
40
+ if (type === 'http') {
41
+ const endpoint = new URL(instance.endpoint);
42
+ endpoint.pathname = '/graphql';
43
+ return endpoint.toString();
44
+ }
40
45
  return instance.endpoint;
46
+ }
41
47
  throw new Error(`Endpoint for ${serviceId} and type ${type} not found`);
42
48
  }
43
49
  reset() {
@@ -1,4 +1,4 @@
1
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;
2
+ type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | Observable<R>;
3
+ export declare function HttpClientBuilder<Sdk>(serviceName: string, getSdk: (requester: Requester<Sdk>) => Sdk): new () => Sdk;
4
4
  export {};
@@ -1,4 +1,4 @@
1
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;
2
+ type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | Observable<R>;
3
+ export declare function WsClientBuilder<Sdk>(serviceName: string, getSdk: (requester: Requester<Sdk>) => Sdk): new () => Sdk;
4
4
  export {};
package/src/drozbot.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './sdks/drozbot';
2
- declare const DrozBot_base: new () => {
2
+ export declare const DrozBot: new () => {
3
3
  getDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
4
4
  id: string;
5
5
  }>, options?: unknown): Promise<import("./sdks/drozbot").GetDrozBotInstanceQuery>;
@@ -16,5 +16,3 @@ declare const DrozBot_base: new () => {
16
16
  input: import("./sdks/drozbot").RemoveDrozBotInstanceInput;
17
17
  }>, options?: unknown): Promise<import("./sdks/drozbot").RemoveDrozBotInstanceMutation>;
18
18
  };
19
- export declare class DrozBot extends DrozBot_base {
20
- }
package/src/drozbot.js CHANGED
@@ -18,6 +18,4 @@ exports.DrozBot = void 0;
18
18
  const http_1 = require("./client/http");
19
19
  const drozbot_1 = require("./sdks/drozbot");
20
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;
21
+ exports.DrozBot = (0, http_1.HttpClientBuilder)(drozbot_1.serviceName, drozbot_1.getSdk);
package/src/drozchat.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './sdks/drozchat';
2
- declare const DrozChat_base: new () => {
2
+ export declare const DrozChat: new () => {
3
3
  getDrozBotInstance(variables: import("./sdks/drozbot").Exact<{
4
4
  id: string;
5
5
  }>, options?: unknown): Promise<import("./sdks/drozbot").GetDrozBotInstanceQuery>;
@@ -16,5 +16,3 @@ declare const DrozChat_base: new () => {
16
16
  input: import("./sdks/drozbot").RemoveDrozBotInstanceInput;
17
17
  }>, options?: unknown): Promise<import("./sdks/drozbot").RemoveDrozBotInstanceMutation>;
18
18
  };
19
- export declare class DrozChat extends DrozChat_base {
20
- }
package/src/drozchat.js CHANGED
@@ -18,6 +18,4 @@ exports.DrozChat = void 0;
18
18
  const http_1 = require("./client/http");
19
19
  const drozbot_1 = require("./sdks/drozbot");
20
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;
21
+ exports.DrozChat = (0, http_1.HttpClientBuilder)(drozbot_1.serviceName, drozbot_1.getSdk);
@@ -1,5 +1,5 @@
1
1
  export * from './sdks/reclameaqui';
2
- declare const Reclameaqui_base: new () => {
2
+ export declare const Reclameaqui: new () => {
3
3
  getReclameAquiInstance(variables: import("./sdks/reclameaqui").Exact<{
4
4
  id: string;
5
5
  }>, options?: unknown): Promise<import("./sdks/reclameaqui").GetReclameAquiInstanceQuery>;
@@ -16,5 +16,3 @@ declare const Reclameaqui_base: new () => {
16
16
  input: import("./sdks/reclameaqui").RemoveReclameAquiInstanceInput;
17
17
  }>, options?: unknown): Promise<import("./sdks/reclameaqui").RemoveReclameAquiInstanceMutation>;
18
18
  };
19
- export declare class Reclameaqui extends Reclameaqui_base {
20
- }
@@ -18,6 +18,4 @@ exports.Reclameaqui = void 0;
18
18
  const http_1 = require("./client/http");
19
19
  const reclameaqui_1 = require("./sdks/reclameaqui");
20
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;
21
+ exports.Reclameaqui = (0, http_1.HttpClientBuilder)(reclameaqui_1.serviceName, reclameaqui_1.getSdk);
package/src/zendesk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './sdks/zendesk';
2
- declare const Zendesk_base: new () => {
2
+ export declare const Zendesk: new () => {
3
3
  getZendeskInstance(variables: import("./sdks/zendesk").Exact<{
4
4
  id: string;
5
5
  }>, options?: unknown): Promise<import("./sdks/zendesk").GetZendeskInstanceQuery>;
@@ -16,5 +16,3 @@ declare const Zendesk_base: new () => {
16
16
  input: import("./sdks/zendesk").RemoveZendeskInstanceInput;
17
17
  }>, options?: unknown): Promise<import("./sdks/zendesk").RemoveZendeskInstanceMutation>;
18
18
  };
19
- export declare class Zendesk extends Zendesk_base {
20
- }
package/src/zendesk.js CHANGED
@@ -18,6 +18,4 @@ exports.Zendesk = void 0;
18
18
  const http_1 = require("./client/http");
19
19
  const zendesk_1 = require("./sdks/zendesk");
20
20
  __exportStar(require("./sdks/zendesk"), exports);
21
- class Zendesk extends (0, http_1.HttpClientBuilder)(zendesk_1.serviceName, zendesk_1.getSdk) {
22
- }
23
- exports.Zendesk = Zendesk;
21
+ exports.Zendesk = (0, http_1.HttpClientBuilder)(zendesk_1.serviceName, zendesk_1.getSdk);