@droz-js/sdk 0.18.9 → 0.19.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@droz-js/sdk",
3
3
  "description": "Droz SDK",
4
- "version": "0.18.9",
4
+ "version": "0.19.1",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
package/src/client/ws.js CHANGED
@@ -11,6 +11,7 @@ const helpers_1 = require("./helpers");
11
11
  class WsRequester {
12
12
  serviceName;
13
13
  client;
14
+ lastAuthorization;
14
15
  constructor(serviceName) {
15
16
  this.serviceName = serviceName;
16
17
  }
@@ -19,18 +20,30 @@ class WsRequester {
19
20
  return this.client;
20
21
  const tenant = config_1.DrozSdk.getTenantConfig();
21
22
  const endpoint = tenant.getEndpoint(this.serviceName, 'ws');
22
- const authorization = await config_1.DrozSdk.getAuthorization();
23
- const connectionParams = authorization ? { authorization } : {};
24
23
  this.client = (0, graphql_ws_1.createClient)({
25
24
  url: endpoint,
26
25
  lazy: true,
27
26
  retryAttempts: 128,
28
27
  keepAlive: 10_000,
29
28
  webSocketImpl: isomorphic_ws_1.default,
30
- connectionParams
29
+ connectionParams: async () => {
30
+ const authorization = await this.resolveAuthorization();
31
+ return authorization ? { authorization } : {};
32
+ }
31
33
  });
32
34
  return this.client;
33
35
  }
36
+ async resolveAuthorization() {
37
+ try {
38
+ this.lastAuthorization = await config_1.DrozSdk.getAuthorization();
39
+ return this.lastAuthorization;
40
+ }
41
+ catch (error) {
42
+ if (this.lastAuthorization)
43
+ return this.lastAuthorization;
44
+ throw error;
45
+ }
46
+ }
34
47
  build() {
35
48
  return this.requester.bind(this);
36
49
  }
@@ -68,13 +68,13 @@ declare const Drozanalytics_base: new (options?: import("./client/http").HttpCli
68
68
  type: import("./sdks/drozanalytics").AnalyticsType;
69
69
  }>, options?: unknown): Promise<import("./sdks/drozanalytics").GetTicketsReviewsSurveyRatingVolumeQuery>;
70
70
  getAgentsDailySummary(variables: import("./sdks/drozanalytics").Exact<{
71
- startDate: import("./sdks/drozanalytics").Scalars["Date"]["input"];
72
- endDate: import("./sdks/drozanalytics").Scalars["Date"]["input"];
71
+ startDate: import("./sdks/drozanalytics").Scalars["DateTime"]["input"];
72
+ endDate: import("./sdks/drozanalytics").Scalars["DateTime"]["input"];
73
73
  type?: import("./sdks/drozanalytics").InputMaybe<import("./sdks/drozanalytics").AnalyticsType>;
74
74
  }>, options?: unknown): Promise<import("./sdks/drozanalytics").GetAgentsDailySummaryQuery>;
75
75
  getClosedCountByChannel(variables: import("./sdks/drozanalytics").Exact<{
76
- startDate: import("./sdks/drozanalytics").Scalars["Date"]["input"];
77
- endDate: import("./sdks/drozanalytics").Scalars["Date"]["input"];
76
+ startDate: import("./sdks/drozanalytics").Scalars["DateTime"]["input"];
77
+ endDate: import("./sdks/drozanalytics").Scalars["DateTime"]["input"];
78
78
  }>, options?: unknown): Promise<import("./sdks/drozanalytics").GetClosedCountByChannelQuery>;
79
79
  };
80
80
  export declare class Drozanalytics extends Drozanalytics_base {
@@ -287,8 +287,8 @@ export type Query = {
287
287
  version?: Maybe<Scalars['String']['output']>;
288
288
  };
289
289
  export type QueryGetAgentsDailySummaryArgs = {
290
- endDate: Scalars['Date']['input'];
291
- startDate: Scalars['Date']['input'];
290
+ endDate: Scalars['DateTime']['input'];
291
+ startDate: Scalars['DateTime']['input'];
292
292
  type?: InputMaybe<AnalyticsType>;
293
293
  };
294
294
  export type QueryGetAttendanceTimeArgs = {
@@ -297,8 +297,8 @@ export type QueryGetAttendanceTimeArgs = {
297
297
  startDate: Scalars['Date']['input'];
298
298
  };
299
299
  export type QueryGetClosedCountByChannelArgs = {
300
- endDate: Scalars['Date']['input'];
301
- startDate: Scalars['Date']['input'];
300
+ endDate: Scalars['DateTime']['input'];
301
+ startDate: Scalars['DateTime']['input'];
302
302
  };
303
303
  export type QueryGetFacetsArgs = {
304
304
  endDate: Scalars['Date']['input'];
@@ -535,16 +535,16 @@ export type GetTicketsReviewsSurveyRatingVolumeQuery = {
535
535
  getTicketsReviewsSurveyRatingVolume?: Maybe<Array<Maybe<Pick<Grouped, 'name' | 'value'>>>>;
536
536
  };
537
537
  export type GetAgentsDailySummaryQueryVariables = Exact<{
538
- startDate: Scalars['Date']['input'];
539
- endDate: Scalars['Date']['input'];
538
+ startDate: Scalars['DateTime']['input'];
539
+ endDate: Scalars['DateTime']['input'];
540
540
  type?: InputMaybe<AnalyticsType>;
541
541
  }>;
542
542
  export type GetAgentsDailySummaryQuery = {
543
543
  getAgentsDailySummary: Array<Pick<AgentDailySummary, 'agentId' | 'closed' | 'reviewType' | 'reviewAverage' | 'reviewCount' | 'firstResponseAvgMs'>>;
544
544
  };
545
545
  export type GetClosedCountByChannelQueryVariables = Exact<{
546
- startDate: Scalars['Date']['input'];
547
- endDate: Scalars['Date']['input'];
546
+ startDate: Scalars['DateTime']['input'];
547
+ endDate: Scalars['DateTime']['input'];
548
548
  }>;
549
549
  export type GetClosedCountByChannelQuery = {
550
550
  getClosedCountByChannel: Array<Pick<ChannelClosedCount, 'channelId' | 'count'>>;
@@ -569,8 +569,8 @@ export declare const GetTicketsByTriggerAppDocument = "\n query getTicketsByT
569
569
  export declare const GetTicketsReviewsDocument = "\n query getTicketsReviews($startDate: Date!, $endDate: Date!, $filters: [TicketAnalyticsFilterInput!], $type: AnalyticsType!) {\n getTicketsReviews(\n startDate: $startDate\n endDate: $endDate\n filters: $filters\n type: $type\n ) {\n ...average\n }\n}\n \n fragment average on AnalyticsAverage {\n delta\n current\n previous\n}\n ";
570
570
  export declare const GetFacetsDocument = "\n query getFacets($startDate: Date!, $endDate: Date!, $filters: [TicketAnalyticsFilterInput!]) {\n getFacets(startDate: $startDate, endDate: $endDate, filters: $filters) {\n ...queryFacets\n }\n}\n \n fragment queryFacets on AnalyticsFacets {\n channelId {\n ...facetValue\n }\n customerId {\n ...facetValue\n }\n assigneeId {\n ...facetValue\n }\n status {\n ...facetValue\n }\n tags {\n ...facetValue\n }\n triggerApp {\n ...facetValue\n }\n}\n \n\n fragment facetValue on AnalyticsFacetValue {\n value\n display\n count\n}\n ";
571
571
  export declare const GetTicketsReviewsSurveyRatingVolumeDocument = "\n query getTicketsReviewsSurveyRatingVolume($startDate: Date!, $endDate: Date!, $filters: [TicketAnalyticsFilterInput!], $type: AnalyticsType!) {\n getTicketsReviewsSurveyRatingVolume(\n startDate: $startDate\n endDate: $endDate\n filters: $filters\n type: $type\n ) {\n name\n value\n }\n}\n ";
572
- export declare const GetAgentsDailySummaryDocument = "\n query getAgentsDailySummary($startDate: Date!, $endDate: Date!, $type: AnalyticsType) {\n getAgentsDailySummary(startDate: $startDate, endDate: $endDate, type: $type) {\n agentId\n closed\n reviewType\n reviewAverage\n reviewCount\n firstResponseAvgMs\n }\n}\n ";
573
- export declare const GetClosedCountByChannelDocument = "\n query getClosedCountByChannel($startDate: Date!, $endDate: Date!) {\n getClosedCountByChannel(startDate: $startDate, endDate: $endDate) {\n channelId\n count\n }\n}\n ";
572
+ export declare const GetAgentsDailySummaryDocument = "\n query getAgentsDailySummary($startDate: DateTime!, $endDate: DateTime!, $type: AnalyticsType) {\n getAgentsDailySummary(startDate: $startDate, endDate: $endDate, type: $type) {\n agentId\n closed\n reviewType\n reviewAverage\n reviewCount\n firstResponseAvgMs\n }\n}\n ";
573
+ export declare const GetClosedCountByChannelDocument = "\n query getClosedCountByChannel($startDate: DateTime!, $endDate: DateTime!) {\n getClosedCountByChannel(startDate: $startDate, endDate: $endDate) {\n channelId\n count\n }\n}\n ";
574
574
  export type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
575
575
  export declare function getSdk<C>(requester: Requester<C>): {
576
576
  listFlowTaxonomy(variables: ListFlowTaxonomyQueryVariables, options?: C): Promise<ListFlowTaxonomyQuery>;
@@ -243,7 +243,7 @@ exports.GetTicketsReviewsSurveyRatingVolumeDocument = `
243
243
  }
244
244
  `;
245
245
  exports.GetAgentsDailySummaryDocument = `
246
- query getAgentsDailySummary($startDate: Date!, $endDate: Date!, $type: AnalyticsType) {
246
+ query getAgentsDailySummary($startDate: DateTime!, $endDate: DateTime!, $type: AnalyticsType) {
247
247
  getAgentsDailySummary(startDate: $startDate, endDate: $endDate, type: $type) {
248
248
  agentId
249
249
  closed
@@ -255,7 +255,7 @@ exports.GetAgentsDailySummaryDocument = `
255
255
  }
256
256
  `;
257
257
  exports.GetClosedCountByChannelDocument = `
258
- query getClosedCountByChannel($startDate: Date!, $endDate: Date!) {
258
+ query getClosedCountByChannel($startDate: DateTime!, $endDate: DateTime!) {
259
259
  getClosedCountByChannel(startDate: $startDate, endDate: $endDate) {
260
260
  channelId
261
261
  count
@@ -136,6 +136,7 @@ export type ActiveDispatchEmailInput = {
136
136
  };
137
137
  export type ActiveDispatchInput = {
138
138
  connector: ActiveDispatchConnector;
139
+ dispatchId?: InputMaybe<Scalars['ID']['input']>;
139
140
  email?: InputMaybe<ActiveDispatchEmailInput>;
140
141
  sessionId?: InputMaybe<Scalars['ID']['input']>;
141
142
  whatsapp?: InputMaybe<ActiveDispatchWhatsAppInput>;
@@ -323,6 +323,7 @@ export declare enum Typenames {
323
323
  Any = "Any",
324
324
  GraphqlConnections = "GraphqlConnections",
325
325
  GraphqlSubscriptions = "GraphqlSubscriptions",
326
+ IntegrationError = "IntegrationError",
326
327
  ZendeskInstance = "ZendeskInstance",
327
328
  ZendeskSyncData = "ZendeskSyncData"
328
329
  }
@@ -21,6 +21,7 @@ var Typenames;
21
21
  Typenames["Any"] = "Any";
22
22
  Typenames["GraphqlConnections"] = "GraphqlConnections";
23
23
  Typenames["GraphqlSubscriptions"] = "GraphqlSubscriptions";
24
+ Typenames["IntegrationError"] = "IntegrationError";
24
25
  Typenames["ZendeskInstance"] = "ZendeskInstance";
25
26
  Typenames["ZendeskSyncData"] = "ZendeskSyncData";
26
27
  })(Typenames || (exports.Typenames = Typenames = {}));