@droz-js/sdk 0.3.10 → 0.3.12

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 CHANGED
@@ -23,6 +23,26 @@ DrozSdk.forTenant('dev');
23
23
  DrozSdk.withAuthorization('Basic', 'username', 'password');
24
24
  ```
25
25
 
26
+ ## Global Error Handling
27
+
28
+ The sdk will throw an error on every request that fails, but you can also catch the error globally by using the `on`
29
+ method.
30
+
31
+ ```typescript
32
+ import { DrozSdk } from '@droz-js/sdk';
33
+
34
+ DrozSdk.on('error', (error) => {
35
+ console.log(error);
36
+ });
37
+ ```
38
+
39
+ Every error sent is of type `SdkError` and contains the following properties:
40
+
41
+ - `message`: the original error message sent from the server;
42
+ - `statusCode`: similar to the http status codes and indicates the class of the error, 400 bad request, 403 forbidden,
43
+ 404 not found...;
44
+ - `errorCode`: a unique identifier for the error, this is useful to for i18n friendly messages;
45
+
26
46
  ## Websocket
27
47
 
28
48
  For websockets we use `graphql-ws` protocol with `AsyncIterator` to handle the subscriptions. The sdk will automatically
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@droz-js/sdk",
3
3
  "description": "Droz SDK",
4
- "version": "0.3.10",
4
+ "version": "0.3.12",
5
5
  "private": false,
6
6
  "exports": {
7
7
  ".": "./src/index.js",
@@ -18,6 +18,7 @@ export declare class DrozSdk {
18
18
  private static defaultTenant?;
19
19
  private static defaultAuthorizationProvider?;
20
20
  private static readonly tenantConfigs;
21
+ private static readonly listeners;
21
22
  static forTenant(tenant: string): typeof DrozSdk;
22
23
  static withAuthorization(type?: string, ...values: string[]): void;
23
24
  static withAuthorizationProvider(provider: () => Promise<string>): void;
@@ -25,5 +26,10 @@ export declare class DrozSdk {
25
26
  static getTenantConfig(customTenant?: string): Promise<TenantConfig>;
26
27
  private static getOrDiscoverTenantConfig;
27
28
  private static discoverTenantConfig;
29
+ static on<T>(event: string, listener: (e: T) => void): void;
30
+ static off<T>(event: string, listener: (e: T) => void): void;
31
+ static emit(event: string, data: any): void;
32
+ private static addEventListener;
33
+ private static removeEventListener;
28
34
  }
29
35
  export {};
@@ -32,6 +32,7 @@ class DrozSdk {
32
32
  static defaultTenant;
33
33
  static defaultAuthorizationProvider;
34
34
  static tenantConfigs = new Map();
35
+ static listeners = new Map();
35
36
  static forTenant(tenant) {
36
37
  this.defaultTenant = tenant;
37
38
  this.tenantConfigs.delete(tenant);
@@ -81,5 +82,36 @@ class DrozSdk {
81
82
  this.tenantConfigs.set(tenant, promise());
82
83
  return this.tenantConfigs.get(tenant);
83
84
  }
85
+ static on(event, listener) {
86
+ this.addEventListener(event, listener);
87
+ }
88
+ static off(event, listener) {
89
+ this.removeEventListener(event, listener);
90
+ }
91
+ static emit(event, data) {
92
+ if (this.listeners.has(event)) {
93
+ const listeners = this.listeners.get(event);
94
+ listeners.forEach(listener => listener(data));
95
+ }
96
+ }
97
+ static addEventListener(event, listener) {
98
+ if (!this.listeners.has(event)) {
99
+ this.listeners.set(event, []);
100
+ }
101
+ const listeners = this.listeners.get(event);
102
+ const index = listeners.indexOf(listener);
103
+ if (index == -1) {
104
+ listeners.push(listener);
105
+ }
106
+ }
107
+ static removeEventListener(event, listener) {
108
+ if (this.listeners.has(event)) {
109
+ const listeners = this.listeners.get(event);
110
+ const index = listeners.indexOf(listener);
111
+ if (index > -1) {
112
+ listeners.splice(index, 1);
113
+ }
114
+ }
115
+ }
84
116
  }
85
117
  exports.DrozSdk = DrozSdk;
@@ -6,8 +6,8 @@ export type GetSdk<Sdk> = (requester: Requester<Sdk>) => Sdk;
6
6
  export declare class SdkError extends Error {
7
7
  statusCode?: number;
8
8
  errorCode?: string;
9
- errors?: ReadonlyArray<GraphQLError>;
10
- constructor(errors: ReadonlyArray<GraphQLError>);
9
+ errors?: ReadonlyArray<Partial<GraphQLError>>;
10
+ constructor(errors: ReadonlyArray<Partial<GraphQLError>>);
11
11
  }
12
12
  export declare class SdkConfigurationError extends Error {
13
13
  constructor(message: string);
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapAsyncIterableGraphqlResponse = exports.mapGraphqlResponse = exports.resolveAuthorization = exports.toAuthorizationProvider = exports.SdkConfigurationError = exports.SdkError = exports.serviceDiscoveryEndpoint = void 0;
4
+ const config_1 = require("./config");
4
5
  exports.serviceDiscoveryEndpoint = 'https://root.droz.services';
5
6
  class SdkError extends Error {
6
7
  statusCode;
7
8
  errorCode;
8
9
  errors;
9
10
  constructor(errors) {
10
- const { message, extensions } = errors?.[0] ?? {};
11
- super(message ?? 'Unknown Error');
11
+ const { message, extensions, originalError } = errors?.[0] ?? {};
12
+ super(message ?? 'Unknown Error', {
13
+ cause: originalError
14
+ });
12
15
  this.errors = errors;
13
16
  this.statusCode = extensions?.statusCode;
14
17
  this.errorCode = extensions?.errorCode;
@@ -47,12 +50,25 @@ async function resolveAuthorization(provider) {
47
50
  exports.resolveAuthorization = resolveAuthorization;
48
51
  function mapGraphqlResponse(response) {
49
52
  if (response) {
50
- if (response && 'stack' in response && 'message' in response)
51
- throw response;
52
- if ('errors' in response)
53
- throw new SdkError(response.errors);
54
- if ('data' in response)
53
+ if (response && 'stack' in response && 'message' in response) {
54
+ const error = new SdkError([
55
+ {
56
+ message: response.message,
57
+ originalError: response,
58
+ extensions: { errorCode: '500-unknown-error', statusCode: 500 }
59
+ }
60
+ ]);
61
+ config_1.DrozSdk.emit('error', error);
62
+ throw error;
63
+ }
64
+ if ('errors' in response) {
65
+ const error = new SdkError(response.errors);
66
+ config_1.DrozSdk.emit('error', error);
67
+ throw error;
68
+ }
69
+ if ('data' in response) {
55
70
  return response.data;
71
+ }
56
72
  }
57
73
  }
58
74
  exports.mapGraphqlResponse = mapGraphqlResponse;
@@ -60,7 +60,9 @@ class HttpRequester {
60
60
  return emptyAsyncIterator();
61
61
  // extract operation name and enqueue the request to be executed in batches
62
62
  const operationName = /(?:query|mutation) ([^({ ]*)/.exec(query)?.[1];
63
- return this.inbatches({ query, variables, operationName }).then(helpers_1.mapGraphqlResponse);
63
+ return this.inbatches({ query, variables, operationName })
64
+ .catch(error => (0, helpers_1.mapGraphqlResponse)(error))
65
+ .then(data => (0, helpers_1.mapGraphqlResponse)(data));
64
66
  }
65
67
  async buildRequest() {
66
68
  const [authorization, tenant] = await Promise.all([
@@ -94,7 +96,11 @@ class HttpRequester {
94
96
  headers,
95
97
  body
96
98
  });
97
- return await response.json();
99
+ if (response.status === 200) {
100
+ return await response.json();
101
+ }
102
+ const error = await response.text();
103
+ return [].concat(request).map(() => new Error(error)); // one error per request
98
104
  }
99
105
  }
100
106
  __decorate([
@@ -112,8 +112,9 @@ export type CreateTicketInput = {
112
112
  export type CreateTicketMessageInput = {
113
113
  content: Scalars['String']['input'];
114
114
  contentType: Scalars['String']['input'];
115
+ from: TicketMessageRecipient;
115
116
  ticketId: Scalars['ID']['input'];
116
- type: TicketMessageType;
117
+ to: TicketMessageRecipient;
117
118
  };
118
119
  export type DrozChatAgent = {
119
120
  createdAt: Scalars['String']['output'];
@@ -270,22 +271,22 @@ export type TicketMessage = {
270
271
  content: Scalars['String']['output'];
271
272
  contentType: Scalars['String']['output'];
272
273
  createdAt: Scalars['DateTime']['output'];
274
+ from: TicketMessageRecipient;
273
275
  id: Scalars['ID']['output'];
274
- sentBy?: Maybe<Scalars['String']['output']>;
275
276
  ticketId: Scalars['ID']['output'];
276
- type: TicketMessageType;
277
+ to: TicketMessageRecipient;
277
278
  updatedAt: Scalars['DateTime']['output'];
278
279
  };
279
- export type TicketMessageSubscription = {
280
- action: SubscriptionAction;
281
- message: TicketMessage;
282
- };
283
- export declare enum TicketMessageType {
280
+ export declare enum TicketMessageRecipient {
284
281
  Agent = "AGENT",
285
282
  Marketplace = "MARKETPLACE",
286
283
  System = "SYSTEM",
287
284
  User = "USER"
288
285
  }
286
+ export type TicketMessageSubscription = {
287
+ action: SubscriptionAction;
288
+ message: TicketMessage;
289
+ };
289
290
  export type TicketMessagesConnection = {
290
291
  nodes: Array<TicketMessage>;
291
292
  pageInfo: PageInfo;
@@ -377,7 +378,7 @@ export type TicketFragment = (Pick<Ticket, 'channelId' | 'id' | 'state' | 'statu
377
378
  customer: CustomerFragment;
378
379
  triggerApp?: Maybe<TicketTriggerAppFragment>;
379
380
  });
380
- export type TicketMessageFragment = Pick<TicketMessage, 'id' | 'ticketId' | 'sentBy' | 'type' | 'contentType' | 'content' | 'createdAt' | 'updatedAt'>;
381
+ export type TicketMessageFragment = Pick<TicketMessage, 'id' | 'ticketId' | 'from' | 'to' | 'contentType' | 'content' | 'createdAt' | 'updatedAt'>;
381
382
  export type GetTicketQueryVariables = Exact<{
382
383
  id: Scalars['ID']['input'];
383
384
  }>;
@@ -509,7 +510,7 @@ export declare const DrozChatAgentFragmentDoc = "\n fragment drozChatAgent on
509
510
  export declare const CustomerFragmentDoc = "\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n ";
510
511
  export declare const TicketTriggerAppFragmentDoc = "\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
511
512
  export declare const TicketFragmentDoc = "\n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
512
- export declare const TicketMessageFragmentDoc = "\n fragment ticketMessage on TicketMessage {\n id\n ticketId\n sentBy\n type\n contentType\n content\n createdAt\n updatedAt\n}\n ";
513
+ export declare const TicketMessageFragmentDoc = "\n fragment ticketMessage on TicketMessage {\n id\n ticketId\n from\n to\n contentType\n content\n createdAt\n updatedAt\n}\n ";
513
514
  export declare const GetDrozChatChannelDocument = "\n query getDrozChatChannel($id: ID!) {\n getDrozChatChannel(id: $id) {\n ...drozChatChannel\n }\n}\n \n fragment drozChatChannel on DrozChatChannel {\n id\n name\n createdAt\n updatedAt\n}\n ";
514
515
  export declare const ListDrozChatChannelsDocument = "\n query listDrozChatChannels {\n listDrozChatChannels {\n ...drozChatChannel\n }\n}\n \n fragment drozChatChannel on DrozChatChannel {\n id\n name\n createdAt\n updatedAt\n}\n ";
515
516
  export declare const CreateDrozChatChannelDocument = "\n mutation createDrozChatChannel($input: CreateDrozChatChannelInput!) {\n createDrozChatChannel(input: $input) {\n ...drozChatChannel\n }\n}\n \n fragment drozChatChannel on DrozChatChannel {\n id\n name\n createdAt\n updatedAt\n}\n ";
@@ -520,10 +521,10 @@ export declare const ListTicketsDocument = "\n query listTickets($state: Tick
520
521
  export declare const ListTicketsInQueueDocument = "\n query listTicketsInQueue($next: Base64) {\n listTicketsInQueue(next: $next) {\n nodes {\n ...ticket\n }\n pageInfo {\n hasNext\n next\n }\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
521
522
  export declare const ListTicketsInProgressMineDocument = "\n query listTicketsInProgressMine($next: Base64) {\n listTicketsInProgressMine(next: $next) {\n nodes {\n ...ticket\n }\n pageInfo {\n hasNext\n next\n }\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
522
523
  export declare const ListTicketsClosedDocument = "\n query listTicketsClosed($next: Base64) {\n listTicketsClosed(next: $next) {\n nodes {\n ...ticket\n }\n pageInfo {\n hasNext\n next\n }\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
523
- export declare const ListTicketMessagesDocument = "\n query listTicketMessages($ticketId: ID!, $next: Base64) {\n listTicketMessages(ticketId: $ticketId, next: $next) {\n pageInfo {\n hasNext\n next\n }\n nodes {\n ...ticketMessage\n }\n }\n}\n \n fragment ticketMessage on TicketMessage {\n id\n ticketId\n sentBy\n type\n contentType\n content\n createdAt\n updatedAt\n}\n ";
524
+ export declare const ListTicketMessagesDocument = "\n query listTicketMessages($ticketId: ID!, $next: Base64) {\n listTicketMessages(ticketId: $ticketId, next: $next) {\n pageInfo {\n hasNext\n next\n }\n nodes {\n ...ticketMessage\n }\n }\n}\n \n fragment ticketMessage on TicketMessage {\n id\n ticketId\n from\n to\n contentType\n content\n createdAt\n updatedAt\n}\n ";
524
525
  export declare const CreateTicketDocument = "\n mutation createTicket($input: CreateTicketInput!) {\n createTicket(input: $input) {\n ...ticket\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
525
526
  export declare const MarkTicketMessagesAsReadDocument = "\n mutation markTicketMessagesAsRead($input: MarkTicketMessagesAsReadInput!) {\n markTicketMessagesAsRead(input: $input)\n}\n ";
526
- export declare const CreateTicketMessageDocument = "\n mutation createTicketMessage($input: CreateTicketMessageInput!) {\n createTicketMessage(input: $input) {\n ...ticketMessage\n }\n}\n \n fragment ticketMessage on TicketMessage {\n id\n ticketId\n sentBy\n type\n contentType\n content\n createdAt\n updatedAt\n}\n ";
527
+ export declare const CreateTicketMessageDocument = "\n mutation createTicketMessage($input: CreateTicketMessageInput!) {\n createTicketMessage(input: $input) {\n ...ticketMessage\n }\n}\n \n fragment ticketMessage on TicketMessage {\n id\n ticketId\n from\n to\n contentType\n content\n createdAt\n updatedAt\n}\n ";
527
528
  export declare const AssignTicketDocument = "\n mutation assignTicket($input: AssignTicketInput!) {\n assignTicket(input: $input) {\n ...ticket\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
528
529
  export declare const AssignTicketMyselfDocument = "\n mutation assignTicketMyself($input: AssignTicketMyselfInput!) {\n assignTicketMyself(input: $input) {\n ...ticket\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
529
530
  export declare const UnassignTicketDocument = "\n mutation unassignTicket($input: UnassignTicketInput!) {\n unassignTicket(input: $input) {\n ...ticket\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
@@ -531,7 +532,7 @@ export declare const CloseTicketDocument = "\n mutation closeTicket($input: C
531
532
  export declare const OnTicketInQueueDocument = "\n subscription onTicketInQueue {\n onTicketInQueue {\n ticket {\n ...ticket\n }\n action\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
532
533
  export declare const OnTicketInProgressMineDocument = "\n subscription onTicketInProgressMine {\n onTicketInProgressMine {\n ticket {\n ...ticket\n }\n action\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
533
534
  export declare const OnTicketClosedDocument = "\n subscription onTicketClosed {\n onTicketClosed {\n ticket {\n ...ticket\n }\n action\n }\n}\n \n fragment ticket on Ticket {\n channelId\n id\n state\n status\n priority\n assignee {\n ...drozChatAgent\n }\n customer {\n ...customer\n }\n triggerApp {\n ...ticketTriggerApp\n }\n messagesCount\n lastMessage\n lastMessageAt\n unreadMessagesCount\n createdAt\n updatedAt\n}\n \n fragment drozChatAgent on DrozChatAgent {\n id\n name\n}\n \n\n fragment customer on DrozChatCustomer {\n id\n name\n email\n phone\n createdAt\n updatedAt\n}\n \n\n fragment ticketTriggerApp on TicketTriggerApp {\n drn\n name\n appId\n appName\n}\n ";
534
- export declare const OnTicketMessageDocument = "\n subscription onTicketMessage($ticketId: ID!) {\n onTicketMessage(ticketId: $ticketId) {\n message {\n ...ticketMessage\n }\n action\n }\n}\n \n fragment ticketMessage on TicketMessage {\n id\n ticketId\n sentBy\n type\n contentType\n content\n createdAt\n updatedAt\n}\n ";
535
+ export declare const OnTicketMessageDocument = "\n subscription onTicketMessage($ticketId: ID!) {\n onTicketMessage(ticketId: $ticketId) {\n message {\n ...ticketMessage\n }\n action\n }\n}\n \n fragment ticketMessage on TicketMessage {\n id\n ticketId\n from\n to\n contentType\n content\n createdAt\n updatedAt\n}\n ";
535
536
  export type Requester<C = {}, E = unknown> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
536
537
  export declare function getSdk<C, E>(requester: Requester<C, E>): {
537
538
  getDrozChatChannel(variables: GetDrozChatChannelQueryVariables, options?: C): Promise<GetDrozChatChannelQuery>;
@@ -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.OnTicketMessageDocument = exports.OnTicketClosedDocument = exports.OnTicketInProgressMineDocument = exports.OnTicketInQueueDocument = exports.CloseTicketDocument = exports.UnassignTicketDocument = exports.AssignTicketMyselfDocument = exports.AssignTicketDocument = exports.CreateTicketMessageDocument = exports.MarkTicketMessagesAsReadDocument = exports.CreateTicketDocument = exports.ListTicketMessagesDocument = exports.ListTicketsClosedDocument = exports.ListTicketsInProgressMineDocument = exports.ListTicketsInQueueDocument = exports.ListTicketsDocument = exports.GetTicketDocument = exports.RemoveDrozChatChannelDocument = exports.UpdateDrozChatChannelDocument = exports.CreateDrozChatChannelDocument = exports.ListDrozChatChannelsDocument = exports.GetDrozChatChannelDocument = exports.TicketMessageFragmentDoc = exports.TicketFragmentDoc = exports.TicketTriggerAppFragmentDoc = exports.CustomerFragmentDoc = exports.DrozChatAgentFragmentDoc = exports.DrozChatChannelFragmentDoc = exports.Typenames = exports.TicketStatus = exports.TicketState = exports.TicketPriority = exports.TicketMessageType = exports.SubscriptionAction = exports.AppInstanceStatus = void 0;
4
+ exports.serviceName = exports.getSdk = exports.OnTicketMessageDocument = exports.OnTicketClosedDocument = exports.OnTicketInProgressMineDocument = exports.OnTicketInQueueDocument = exports.CloseTicketDocument = exports.UnassignTicketDocument = exports.AssignTicketMyselfDocument = exports.AssignTicketDocument = exports.CreateTicketMessageDocument = exports.MarkTicketMessagesAsReadDocument = exports.CreateTicketDocument = exports.ListTicketMessagesDocument = exports.ListTicketsClosedDocument = exports.ListTicketsInProgressMineDocument = exports.ListTicketsInQueueDocument = exports.ListTicketsDocument = exports.GetTicketDocument = exports.RemoveDrozChatChannelDocument = exports.UpdateDrozChatChannelDocument = exports.CreateDrozChatChannelDocument = exports.ListDrozChatChannelsDocument = exports.GetDrozChatChannelDocument = exports.TicketMessageFragmentDoc = exports.TicketFragmentDoc = exports.TicketTriggerAppFragmentDoc = exports.CustomerFragmentDoc = exports.DrozChatAgentFragmentDoc = exports.DrozChatChannelFragmentDoc = exports.Typenames = exports.TicketStatus = exports.TicketState = exports.TicketPriority = exports.TicketMessageRecipient = exports.SubscriptionAction = exports.AppInstanceStatus = void 0;
5
5
  var AppInstanceStatus;
6
6
  (function (AppInstanceStatus) {
7
7
  AppInstanceStatus["Active"] = "Active";
@@ -14,13 +14,13 @@ var SubscriptionAction;
14
14
  SubscriptionAction["Removed"] = "REMOVED";
15
15
  SubscriptionAction["Updated"] = "UPDATED";
16
16
  })(SubscriptionAction || (exports.SubscriptionAction = SubscriptionAction = {}));
17
- var TicketMessageType;
18
- (function (TicketMessageType) {
19
- TicketMessageType["Agent"] = "AGENT";
20
- TicketMessageType["Marketplace"] = "MARKETPLACE";
21
- TicketMessageType["System"] = "SYSTEM";
22
- TicketMessageType["User"] = "USER";
23
- })(TicketMessageType || (exports.TicketMessageType = TicketMessageType = {}));
17
+ var TicketMessageRecipient;
18
+ (function (TicketMessageRecipient) {
19
+ TicketMessageRecipient["Agent"] = "AGENT";
20
+ TicketMessageRecipient["Marketplace"] = "MARKETPLACE";
21
+ TicketMessageRecipient["System"] = "SYSTEM";
22
+ TicketMessageRecipient["User"] = "USER";
23
+ })(TicketMessageRecipient || (exports.TicketMessageRecipient = TicketMessageRecipient = {}));
24
24
  var TicketPriority;
25
25
  (function (TicketPriority) {
26
26
  TicketPriority["High"] = "HIGH";
@@ -114,8 +114,8 @@ exports.TicketMessageFragmentDoc = `
114
114
  fragment ticketMessage on TicketMessage {
115
115
  id
116
116
  ticketId
117
- sentBy
118
- type
117
+ from
118
+ to
119
119
  contentType
120
120
  content
121
121
  createdAt
@@ -128,6 +128,7 @@ export type DrozNexoConnectionConnection = {
128
128
  };
129
129
  export type DrozNexoConnectionSuggestion = {
130
130
  destination: DrozNexoAppAndAppInstance;
131
+ title: Scalars['String']['output'];
131
132
  trigger: DrozNexoAppAndAppInstance;
132
133
  };
133
134
  export type DrozNexoUsageStatistics = {
@@ -174,10 +175,10 @@ export type DrozNexoAppInstanceFragment = {
174
175
  app: Pick<DrozNexoApp, 'id' | 'name' | 'description'>;
175
176
  appInstance: Pick<DrozNexoAppInstance, 'drn' | 'name' | 'createdAt' | 'updatedAt'>;
176
177
  };
177
- export type DrozNexoSuggestionFragment = {
178
+ export type DrozNexoSuggestionFragment = (Pick<DrozNexoConnectionSuggestion, 'title'> & {
178
179
  trigger: DrozNexoAppInstanceFragment;
179
180
  destination: DrozNexoAppInstanceFragment;
180
- };
181
+ });
181
182
  export type DrozNexoConnectionFragment = (Pick<DrozNexoConnection, 'id' | 'versionId' | 'title' | 'description' | 'createdAt' | 'updatedAt'> & {
182
183
  trigger: DrozNexoAppInstanceFragment;
183
184
  destination: DrozNexoAppInstanceFragment;
@@ -216,9 +217,9 @@ export type RemoveDrozNexoConnectionMutation = {
216
217
  removeDrozNexoConnection: DrozNexoConnectionFragment;
217
218
  };
218
219
  export declare const DrozNexoAppInstanceFragmentDoc = "\n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
219
- export declare const DrozNexoSuggestionFragmentDoc = "\n fragment drozNexoSuggestion on DrozNexoConnectionSuggestion {\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
220
+ export declare const DrozNexoSuggestionFragmentDoc = "\n fragment drozNexoSuggestion on DrozNexoConnectionSuggestion {\n title\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
220
221
  export declare const DrozNexoConnectionFragmentDoc = "\n fragment drozNexoConnection on DrozNexoConnection {\n id\n versionId\n title\n description\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n createdAt\n updatedAt\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
221
- export declare const ListDrozNexoSuggestionsDocument = "\n query listDrozNexoSuggestions {\n listDrozNexoSuggestions {\n ...drozNexoSuggestion\n }\n}\n \n fragment drozNexoSuggestion on DrozNexoConnectionSuggestion {\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
222
+ export declare const ListDrozNexoSuggestionsDocument = "\n query listDrozNexoSuggestions {\n listDrozNexoSuggestions {\n ...drozNexoSuggestion\n }\n}\n \n fragment drozNexoSuggestion on DrozNexoConnectionSuggestion {\n title\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
222
223
  export declare const ListDrozNexoConnectionsDocument = "\n query listDrozNexoConnections($next: Base64) {\n listDrozNexoConnections(next: $next) {\n nodes {\n ...drozNexoConnection\n }\n pageInfo {\n next\n hasNext\n }\n }\n}\n \n fragment drozNexoConnection on DrozNexoConnection {\n id\n versionId\n title\n description\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n createdAt\n updatedAt\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
223
224
  export declare const GetUsageStatisticsDocument = "\n query getUsageStatistics {\n getUsageStatistics {\n totalSecrets\n totalAppInstances\n totalConnections\n }\n}\n ";
224
225
  export declare const CreateDrozNexoConnectionDocument = "\n mutation createDrozNexoConnection($input: CreateDrozNexoConnectionInput!) {\n createDrozNexoConnection(input: $input) {\n ...drozNexoConnection\n }\n}\n \n fragment drozNexoConnection on DrozNexoConnection {\n id\n versionId\n title\n description\n trigger {\n ...drozNexoAppInstance\n }\n destination {\n ...drozNexoAppInstance\n }\n createdAt\n updatedAt\n}\n \n fragment drozNexoAppInstance on DrozNexoAppAndAppInstance {\n app {\n id\n name\n description\n }\n appInstance {\n drn\n name\n createdAt\n updatedAt\n }\n}\n ";
@@ -31,6 +31,7 @@ exports.DrozNexoAppInstanceFragmentDoc = `
31
31
  `;
32
32
  exports.DrozNexoSuggestionFragmentDoc = `
33
33
  fragment drozNexoSuggestion on DrozNexoConnectionSuggestion {
34
+ title
34
35
  trigger {
35
36
  ...drozNexoAppInstance
36
37
  }