@opens/gateways 1.16.16 → 1.16.18

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.
@@ -77,6 +77,53 @@ interface CaseFeedByActionItem {
77
77
  protocol: string | null;
78
78
  }
79
79
 
80
+ /** Colors offered by the UI when creating or updating a case status. */
81
+ type CaseStatusColor = 'blue' | 'yellow' | 'green' | 'purple' | 'red' | 'cyan' | 'orange' | 'gray';
82
+ /** Id of a fixed workflow stage. Stages are global, not per-company. */
83
+ type CaseStageId = 'OPEN' | 'IN_PROGRESS' | 'CLOSED';
84
+ /** A fixed workflow stage (Aberto / Em andamento / Fechado). */
85
+ interface CaseStage {
86
+ id: CaseStageId;
87
+ label: string;
88
+ }
89
+ /** A company-scoped case status, linked to a fixed stage. */
90
+ interface CaseStatus {
91
+ id: number;
92
+ name: string | null;
93
+ companyId: string;
94
+ caseStageId: CaseStageId;
95
+ /** Any color stored by the API; the UI palette is `CaseStatusColor`. */
96
+ color: string;
97
+ /** Hex of the color when it belongs to the color catalog (list only). */
98
+ colorHex?: string | null;
99
+ isDefault: boolean;
100
+ isCustomStatus: boolean;
101
+ isActive: boolean;
102
+ createdAt: string;
103
+ updatedAt: string;
104
+ deletedAt: string | null;
105
+ /** Present when the API includes the related stage (e.g. list). */
106
+ stage?: CaseStage;
107
+ }
108
+ /** Request payload for creating a case status. */
109
+ interface CreateCaseStatusRequest {
110
+ name: string;
111
+ caseStageId: CaseStageId;
112
+ color: CaseStatusColor;
113
+ }
114
+ /** Request payload for updating a case status. All fields besides `statusId` are optional. */
115
+ interface UpdateCaseStatusRequest {
116
+ statusId: number;
117
+ name?: string;
118
+ caseStageId?: CaseStageId;
119
+ color?: CaseStatusColor;
120
+ isActive?: boolean;
121
+ }
122
+ /** Request parameters for listing case statuses. */
123
+ interface ListCaseStatusesRequest {
124
+ activeOnly?: boolean;
125
+ }
126
+
80
127
  /** A case item as returned by the cases listing endpoint. */
81
128
  interface CaseListItem {
82
129
  id: number;
@@ -92,9 +139,7 @@ interface CaseListItem {
92
139
  dueDate: string | null;
93
140
  createdAt: string;
94
141
  updatedAt: string;
95
- status?: {
96
- name: string;
97
- };
142
+ status?: CaseStatus;
98
143
  categories?: {
99
144
  id: string;
100
145
  name: string;
@@ -208,4 +253,4 @@ interface ClonedCase extends Omit<CaseListItem, 'status' | 'categories'> {
208
253
  estimatedTimeMinutes: number | null;
209
254
  }
210
255
 
211
- export type { CaseFeedByActionItem, CaseListItem, CasePermissions, CasePermissionsValue, CaseTimeEntry, CloneCaseRequest, ClonedCase, CommentHistoryChangeType, CommentHistoryCursor, CommentHistoryEntry, CommentHistoryPage, CreateTimeEntryRequest, DeleteTimeEntryRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, ListCasesCursor, ListCasesRequest, ListCasesResponse, ListTimeEntriesPage, ListTimeEntriesRequest, TimeEntryCursor, UpdateCasePermissionsRequest, UpdateTimeEntryRequest };
256
+ export type { CaseFeedByActionItem, CaseListItem, CasePermissions, CasePermissionsValue, CaseStage, CaseStageId, CaseStatus, CaseStatusColor, CaseTimeEntry, CloneCaseRequest, ClonedCase, CommentHistoryChangeType, CommentHistoryCursor, CommentHistoryEntry, CommentHistoryPage, CreateCaseStatusRequest, CreateTimeEntryRequest, DeleteTimeEntryRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, ListCaseStatusesRequest, ListCasesCursor, ListCasesRequest, ListCasesResponse, ListTimeEntriesPage, ListTimeEntriesRequest, TimeEntryCursor, UpdateCasePermissionsRequest, UpdateCaseStatusRequest, UpdateTimeEntryRequest };
@@ -77,6 +77,53 @@ interface CaseFeedByActionItem {
77
77
  protocol: string | null;
78
78
  }
79
79
 
80
+ /** Colors offered by the UI when creating or updating a case status. */
81
+ type CaseStatusColor = 'blue' | 'yellow' | 'green' | 'purple' | 'red' | 'cyan' | 'orange' | 'gray';
82
+ /** Id of a fixed workflow stage. Stages are global, not per-company. */
83
+ type CaseStageId = 'OPEN' | 'IN_PROGRESS' | 'CLOSED';
84
+ /** A fixed workflow stage (Aberto / Em andamento / Fechado). */
85
+ interface CaseStage {
86
+ id: CaseStageId;
87
+ label: string;
88
+ }
89
+ /** A company-scoped case status, linked to a fixed stage. */
90
+ interface CaseStatus {
91
+ id: number;
92
+ name: string | null;
93
+ companyId: string;
94
+ caseStageId: CaseStageId;
95
+ /** Any color stored by the API; the UI palette is `CaseStatusColor`. */
96
+ color: string;
97
+ /** Hex of the color when it belongs to the color catalog (list only). */
98
+ colorHex?: string | null;
99
+ isDefault: boolean;
100
+ isCustomStatus: boolean;
101
+ isActive: boolean;
102
+ createdAt: string;
103
+ updatedAt: string;
104
+ deletedAt: string | null;
105
+ /** Present when the API includes the related stage (e.g. list). */
106
+ stage?: CaseStage;
107
+ }
108
+ /** Request payload for creating a case status. */
109
+ interface CreateCaseStatusRequest {
110
+ name: string;
111
+ caseStageId: CaseStageId;
112
+ color: CaseStatusColor;
113
+ }
114
+ /** Request payload for updating a case status. All fields besides `statusId` are optional. */
115
+ interface UpdateCaseStatusRequest {
116
+ statusId: number;
117
+ name?: string;
118
+ caseStageId?: CaseStageId;
119
+ color?: CaseStatusColor;
120
+ isActive?: boolean;
121
+ }
122
+ /** Request parameters for listing case statuses. */
123
+ interface ListCaseStatusesRequest {
124
+ activeOnly?: boolean;
125
+ }
126
+
80
127
  /** A case item as returned by the cases listing endpoint. */
81
128
  interface CaseListItem {
82
129
  id: number;
@@ -92,9 +139,7 @@ interface CaseListItem {
92
139
  dueDate: string | null;
93
140
  createdAt: string;
94
141
  updatedAt: string;
95
- status?: {
96
- name: string;
97
- };
142
+ status?: CaseStatus;
98
143
  categories?: {
99
144
  id: string;
100
145
  name: string;
@@ -208,4 +253,4 @@ interface ClonedCase extends Omit<CaseListItem, 'status' | 'categories'> {
208
253
  estimatedTimeMinutes: number | null;
209
254
  }
210
255
 
211
- export type { CaseFeedByActionItem, CaseListItem, CasePermissions, CasePermissionsValue, CaseTimeEntry, CloneCaseRequest, ClonedCase, CommentHistoryChangeType, CommentHistoryCursor, CommentHistoryEntry, CommentHistoryPage, CreateTimeEntryRequest, DeleteTimeEntryRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, ListCasesCursor, ListCasesRequest, ListCasesResponse, ListTimeEntriesPage, ListTimeEntriesRequest, TimeEntryCursor, UpdateCasePermissionsRequest, UpdateTimeEntryRequest };
256
+ export type { CaseFeedByActionItem, CaseListItem, CasePermissions, CasePermissionsValue, CaseStage, CaseStageId, CaseStatus, CaseStatusColor, CaseTimeEntry, CloneCaseRequest, ClonedCase, CommentHistoryChangeType, CommentHistoryCursor, CommentHistoryEntry, CommentHistoryPage, CreateCaseStatusRequest, CreateTimeEntryRequest, DeleteTimeEntryRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, ListCaseStatusesRequest, ListCasesCursor, ListCasesRequest, ListCasesResponse, ListTimeEntriesPage, ListTimeEntriesRequest, TimeEntryCursor, UpdateCasePermissionsRequest, UpdateCaseStatusRequest, UpdateTimeEntryRequest };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cases/contracts/index.ts"],"sourcesContent":["export * from './comment-history';\nexport * from './case-permissions';\nexport * from './case-feed-by-actions';\nexport * from './list-cases';\nexport * from './time-entry';\nexport * from './clone-case';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/cases/contracts/index.ts"],"sourcesContent":["export * from './comment-history';\nexport * from './case-permissions';\nexport * from './case-feed-by-actions';\nexport * from './list-cases';\nexport * from './time-entry';\nexport * from './case-status';\nexport * from './clone-case';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -334,48 +334,76 @@ interface FindOrCreateQueueRuleRequest {
334
334
  }
335
335
  /** Response returned when finding or creating a queue rule. */
336
336
  interface QueueRule extends Rule {
337
- flow?: Record<string, unknown>[];
337
+ flow?: Rule[];
338
338
  }
339
+ /** Known rule action values used by the Chat Config API. */
340
+ type RuleAction = 'queue' | 'interactiveMessage' | 'message' | 'automaticMessage' | 'callOnQueue' | 'ura' | 'webhook' | 'questionnaire' | 'flow' | 'csat';
341
+ /** Archive filter for listing rules. Matches `GET /rules/paginated` query validation. */
342
+ type RuleArchiveStatus = 'archived' | 'unarchived' | 'all';
343
+ /** Associations that can be eager-loaded when listing paginated rules. */
344
+ type RuleAssociation = 'flow';
345
+ /** Request query parameters for listing root rules. */
339
346
  type GetRootRulesRequest = {
340
347
  companyId: string;
341
348
  offset: number;
342
349
  limit: number;
343
350
  name?: string;
344
351
  };
352
+ /**
353
+ * Request query parameters for listing paginated rules (`GET /rules/paginated`).
354
+ * `offset` defaults to `0` and `limit` defaults to `50` (max `100`) on the API.
355
+ */
356
+ type GetRulesRequest = {
357
+ companyId: string;
358
+ offset?: number;
359
+ limit?: number;
360
+ name?: string;
361
+ isRoot?: boolean;
362
+ action?: RuleAction[];
363
+ archiveStatus?: RuleArchiveStatus;
364
+ associations?: RuleAssociation[];
365
+ };
366
+ /** Automatic message payload stored on a rule. */
367
+ interface RuleAutomaticMessage {
368
+ messageBody: string;
369
+ caption: string | null;
370
+ messageType: string;
371
+ }
372
+ /** Rule entity returned by the Chat Config API. */
345
373
  interface Rule {
346
374
  id: string;
347
375
  companyId: string;
348
376
  name: string;
349
377
  action: string;
350
- message: string;
351
- automaticMessage: {
352
- messageBody: string;
353
- caption: string | null;
354
- messageType: string;
355
- } | null;
378
+ message: string | null;
379
+ automaticMessage: RuleAutomaticMessage | null;
356
380
  callOnQueue: Record<string, unknown> | null;
357
- uraDescription: string;
381
+ uraDescription: string | null;
358
382
  interactiveMessageId: string | null;
359
383
  configId: string | null;
360
384
  queueId: string | null;
361
- redirectQueue: Record<string, unknown> | null;
385
+ redirectQueue: string | null;
362
386
  redirectRuleId: string | null;
363
- questionnaire: Record<string, unknown>;
387
+ questionnaire: Record<string, unknown> | null;
364
388
  webhook: Record<string, unknown> | null;
365
389
  isRoot: boolean;
366
390
  redirectDefault: boolean;
367
391
  redirectTimeout: number;
368
392
  delay: number | null;
369
393
  disableTyping: boolean;
394
+ settings: Record<string, unknown> | null;
370
395
  archivedAt: string | null;
371
396
  autoTagEnabled: boolean;
372
- autoTagIds: string[];
397
+ autoTagIds: number[];
373
398
  createdAt: string;
374
399
  updatedAt: string;
400
+ flow?: Rule[];
375
401
  }
376
- /** Response returned by the Chat Config API when listing root rules. */
377
- type RootRulesResponse = {
402
+ /** Response returned by the Chat Config API when listing paginated rules. */
403
+ type RulesResponse = {
378
404
  data: Rule[];
379
405
  };
406
+ /** Response returned by the Chat Config API when listing root rules. */
407
+ type RootRulesResponse = RulesResponse;
380
408
 
381
- export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, GetMemberQueuesRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRootRulesRequest, GetServiceGroupsParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderConfiguration, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, ProviderName, Queue, QueueListResponse, QueueMember, QueueRule, RootRulesResponse, Rule, ServiceGroup, ServiceGroupsResponse, WhatsAppProviderSettings, WidgetProviderSettings };
409
+ export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, GetMemberQueuesRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRootRulesRequest, GetRulesRequest, GetServiceGroupsParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderConfiguration, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, ProviderName, Queue, QueueListResponse, QueueMember, QueueRule, RootRulesResponse, Rule, RuleAction, RuleArchiveStatus, RuleAssociation, RuleAutomaticMessage, RulesResponse, ServiceGroup, ServiceGroupsResponse, WhatsAppProviderSettings, WidgetProviderSettings };
@@ -334,48 +334,76 @@ interface FindOrCreateQueueRuleRequest {
334
334
  }
335
335
  /** Response returned when finding or creating a queue rule. */
336
336
  interface QueueRule extends Rule {
337
- flow?: Record<string, unknown>[];
337
+ flow?: Rule[];
338
338
  }
339
+ /** Known rule action values used by the Chat Config API. */
340
+ type RuleAction = 'queue' | 'interactiveMessage' | 'message' | 'automaticMessage' | 'callOnQueue' | 'ura' | 'webhook' | 'questionnaire' | 'flow' | 'csat';
341
+ /** Archive filter for listing rules. Matches `GET /rules/paginated` query validation. */
342
+ type RuleArchiveStatus = 'archived' | 'unarchived' | 'all';
343
+ /** Associations that can be eager-loaded when listing paginated rules. */
344
+ type RuleAssociation = 'flow';
345
+ /** Request query parameters for listing root rules. */
339
346
  type GetRootRulesRequest = {
340
347
  companyId: string;
341
348
  offset: number;
342
349
  limit: number;
343
350
  name?: string;
344
351
  };
352
+ /**
353
+ * Request query parameters for listing paginated rules (`GET /rules/paginated`).
354
+ * `offset` defaults to `0` and `limit` defaults to `50` (max `100`) on the API.
355
+ */
356
+ type GetRulesRequest = {
357
+ companyId: string;
358
+ offset?: number;
359
+ limit?: number;
360
+ name?: string;
361
+ isRoot?: boolean;
362
+ action?: RuleAction[];
363
+ archiveStatus?: RuleArchiveStatus;
364
+ associations?: RuleAssociation[];
365
+ };
366
+ /** Automatic message payload stored on a rule. */
367
+ interface RuleAutomaticMessage {
368
+ messageBody: string;
369
+ caption: string | null;
370
+ messageType: string;
371
+ }
372
+ /** Rule entity returned by the Chat Config API. */
345
373
  interface Rule {
346
374
  id: string;
347
375
  companyId: string;
348
376
  name: string;
349
377
  action: string;
350
- message: string;
351
- automaticMessage: {
352
- messageBody: string;
353
- caption: string | null;
354
- messageType: string;
355
- } | null;
378
+ message: string | null;
379
+ automaticMessage: RuleAutomaticMessage | null;
356
380
  callOnQueue: Record<string, unknown> | null;
357
- uraDescription: string;
381
+ uraDescription: string | null;
358
382
  interactiveMessageId: string | null;
359
383
  configId: string | null;
360
384
  queueId: string | null;
361
- redirectQueue: Record<string, unknown> | null;
385
+ redirectQueue: string | null;
362
386
  redirectRuleId: string | null;
363
- questionnaire: Record<string, unknown>;
387
+ questionnaire: Record<string, unknown> | null;
364
388
  webhook: Record<string, unknown> | null;
365
389
  isRoot: boolean;
366
390
  redirectDefault: boolean;
367
391
  redirectTimeout: number;
368
392
  delay: number | null;
369
393
  disableTyping: boolean;
394
+ settings: Record<string, unknown> | null;
370
395
  archivedAt: string | null;
371
396
  autoTagEnabled: boolean;
372
- autoTagIds: string[];
397
+ autoTagIds: number[];
373
398
  createdAt: string;
374
399
  updatedAt: string;
400
+ flow?: Rule[];
375
401
  }
376
- /** Response returned by the Chat Config API when listing root rules. */
377
- type RootRulesResponse = {
402
+ /** Response returned by the Chat Config API when listing paginated rules. */
403
+ type RulesResponse = {
378
404
  data: Rule[];
379
405
  };
406
+ /** Response returned by the Chat Config API when listing root rules. */
407
+ type RootRulesResponse = RulesResponse;
380
408
 
381
- export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, GetMemberQueuesRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRootRulesRequest, GetServiceGroupsParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderConfiguration, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, ProviderName, Queue, QueueListResponse, QueueMember, QueueRule, RootRulesResponse, Rule, ServiceGroup, ServiceGroupsResponse, WhatsAppProviderSettings, WidgetProviderSettings };
409
+ export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, GetMemberQueuesRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRootRulesRequest, GetRulesRequest, GetServiceGroupsParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderConfiguration, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, ProviderName, Queue, QueueListResponse, QueueMember, QueueRule, RootRulesResponse, Rule, RuleAction, RuleArchiveStatus, RuleAssociation, RuleAutomaticMessage, RulesResponse, ServiceGroup, ServiceGroupsResponse, WhatsAppProviderSettings, WidgetProviderSettings };