@opens/gateways 1.5.1 → 1.7.0

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.
Files changed (37) hide show
  1. package/dist/assets/contracts/index.d.mts +33 -0
  2. package/dist/assets/contracts/index.d.ts +33 -0
  3. package/dist/assets/contracts/index.js +19 -0
  4. package/dist/assets/contracts/index.js.map +1 -0
  5. package/dist/assets/contracts/index.mjs +1 -0
  6. package/dist/assets/contracts/index.mjs.map +1 -0
  7. package/dist/campaigns/contracts/index.d.mts +248 -0
  8. package/dist/campaigns/contracts/index.d.ts +248 -0
  9. package/dist/campaigns/contracts/index.js +19 -0
  10. package/dist/campaigns/contracts/index.js.map +1 -0
  11. package/dist/campaigns/contracts/index.mjs +1 -0
  12. package/dist/campaigns/contracts/index.mjs.map +1 -0
  13. package/dist/chat-adapter/contracts/index.d.mts +67 -0
  14. package/dist/chat-adapter/contracts/index.d.ts +67 -0
  15. package/dist/chat-adapter/contracts/index.js +19 -0
  16. package/dist/chat-adapter/contracts/index.js.map +1 -0
  17. package/dist/chat-adapter/contracts/index.mjs +1 -0
  18. package/dist/chat-adapter/contracts/index.mjs.map +1 -0
  19. package/dist/chat-config/contracts/index.d.mts +201 -0
  20. package/dist/chat-config/contracts/index.d.ts +201 -0
  21. package/dist/chat-config/contracts/index.js +19 -0
  22. package/dist/chat-config/contracts/index.js.map +1 -0
  23. package/dist/chat-config/contracts/index.mjs +1 -0
  24. package/dist/chat-config/contracts/index.mjs.map +1 -0
  25. package/dist/customer-service/contracts/index.d.mts +95 -0
  26. package/dist/customer-service/contracts/index.d.ts +95 -0
  27. package/dist/customer-service/contracts/index.js +19 -0
  28. package/dist/customer-service/contracts/index.js.map +1 -0
  29. package/dist/customer-service/contracts/index.mjs +1 -0
  30. package/dist/customer-service/contracts/index.mjs.map +1 -0
  31. package/dist/index.d.mts +15 -615
  32. package/dist/index.d.ts +15 -615
  33. package/dist/index.js +15 -4
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +15 -4
  36. package/dist/index.mjs.map +1 -1
  37. package/package.json +8 -2
@@ -0,0 +1,67 @@
1
+ /** Parameters for retrieving configuration templates. */
2
+ interface GetConfigTemplatesParams {
3
+ /** Optional template name filter. */
4
+ templateName?: string;
5
+ /** Optional maximum number of templates to return. */
6
+ limit?: number;
7
+ /** Optional status filter (e.g. 'APPROVED', 'REJECTED', 'PENDING'). */
8
+ status?: string;
9
+ /** Optional category filter (e.g. 'UTILITY', 'MARKETING', 'AUTHENTICATION'). */
10
+ category?: string;
11
+ /** Optional pagination cursor token/URL. */
12
+ next?: string;
13
+ /** Optional pagination cursor 'after' parameter. */
14
+ after?: string;
15
+ }
16
+ /** Component of a message template. */
17
+ interface MessageTemplateComponent {
18
+ /** Type of the component (e.g. 'HEADER', 'BODY', 'FOOTER', 'BUTTONS'). */
19
+ type: string;
20
+ /** Format of the component (e.g. 'TEXT', 'IMAGE', 'DOCUMENT', 'VIDEO'). */
21
+ format?: string;
22
+ /** Text content of the component. */
23
+ text?: string;
24
+ /** List of buttons in the component if type is 'BUTTONS'. */
25
+ buttons?: Array<{
26
+ type: string;
27
+ text: string;
28
+ url?: string;
29
+ phoneNumber?: string;
30
+ }>;
31
+ }
32
+ /** Details of a message template. */
33
+ interface MessageTemplate {
34
+ /** Name of the message template. */
35
+ name: string;
36
+ /** Status of the template (e.g. 'APPROVED', 'REJECTED', 'PENDING'). */
37
+ status: string;
38
+ /** Category of the template (e.g. 'UTILITY', 'MARKETING', 'AUTHENTICATION'). */
39
+ category: string;
40
+ /** Language locale of the template (e.g. 'pt_BR', 'en_US'). */
41
+ language: string;
42
+ /** Components that build up the template content. */
43
+ components: MessageTemplateComponent[];
44
+ /** Unique identifier of the template. */
45
+ id: string;
46
+ }
47
+ /** Pagination information for the template query response. */
48
+ interface ConfigTemplatesPaging {
49
+ /** Cursors used to paginate results. */
50
+ cursors?: {
51
+ /** Cursor pointing to the start of the current range. */
52
+ before?: string;
53
+ /** Cursor pointing to the end of the current range. */
54
+ after?: string;
55
+ };
56
+ /** URL for the next page of results. */
57
+ next?: string;
58
+ }
59
+ /** Response containing the list of message templates configured. */
60
+ interface GetConfigTemplatesResponse {
61
+ /** List of message templates. */
62
+ data: MessageTemplate[];
63
+ /** Pagination information. */
64
+ paging?: ConfigTemplatesPaging;
65
+ }
66
+
67
+ export type { ConfigTemplatesPaging, GetConfigTemplatesParams, GetConfigTemplatesResponse, MessageTemplate, MessageTemplateComponent };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/chat-adapter/contracts/index.ts
17
+ var contracts_exports = {};
18
+ module.exports = __toCommonJS(contracts_exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/chat-adapter/contracts/index.ts"],"sourcesContent":["export * from './chat-adapter';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,201 @@
1
+ /** A provider entity returned by the Chat Config API. */
2
+ interface Provider {
3
+ id: string;
4
+ name: string;
5
+ configurationsSchema: Record<string, unknown> | null;
6
+ defaultSession: number;
7
+ type: string;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ }
11
+ /** Response returned by the Chat Config API when listing providers. */
12
+ type ProviderListResponse = Provider[];
13
+
14
+ /** A provider entity nested within a configuration response. */
15
+ interface ConfigProvider {
16
+ id: string;
17
+ name: string;
18
+ type: string;
19
+ defaultSession: number;
20
+ configurationsSchema: Record<string, unknown> | null;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ }
24
+ /** A configuration entity returned by the Chat Config API. */
25
+ interface Config {
26
+ id: string;
27
+ isAssistanceEnabled: boolean;
28
+ rewind: number | null;
29
+ companyId: string;
30
+ active: boolean;
31
+ configurations: Record<string, unknown>;
32
+ priority: number | null;
33
+ inbound: boolean;
34
+ outbound: boolean;
35
+ deletedAt: string | null;
36
+ providers: ConfigProvider;
37
+ }
38
+ /** Response returned by the Chat Config API when listing configurations by provider. */
39
+ interface ConfigListByProviderResponse {
40
+ configurations: Config[];
41
+ }
42
+ /** Query parameters for filtering configurations by provider. */
43
+ interface GetConfigsByProviderParams {
44
+ isAssistanceEnabled?: boolean;
45
+ rewind?: number;
46
+ active?: boolean;
47
+ priority?: number;
48
+ inbound?: boolean;
49
+ outbound?: boolean;
50
+ providerType?: string;
51
+ providerName?: string;
52
+ }
53
+
54
+ interface QueueMember {
55
+ id: string;
56
+ memberId: string;
57
+ priority: number;
58
+ permission: string;
59
+ lastAttendance: string;
60
+ lastInvite: string;
61
+ paused: boolean;
62
+ activeChat: number;
63
+ online: boolean;
64
+ companyId: string;
65
+ avatar: string;
66
+ username: string;
67
+ createdAt: string;
68
+ updatedAt: string;
69
+ queueId: string;
70
+ }
71
+ type DistributionType = {
72
+ id: string;
73
+ alias: string;
74
+ description: string;
75
+ createdAt: string;
76
+ updatedAt: string;
77
+ };
78
+ interface Queue {
79
+ id: string;
80
+ distributionTypeId: string;
81
+ companyId: string;
82
+ name: string;
83
+ strategy: 'leastrecent' | 'roundrobin' | 'random';
84
+ defaultQueue: boolean;
85
+ unlimitedService: boolean;
86
+ serviceLimit: number;
87
+ timeLimit: number;
88
+ skipOncallUsers: boolean;
89
+ csat: boolean;
90
+ csatAnswer: string;
91
+ csatTTL: number;
92
+ outsideBusinessHourMessage: string;
93
+ createCallbackOnExpired: boolean;
94
+ createCallbackOnOutsideBusinessHours: boolean;
95
+ archived: boolean;
96
+ isPrivate: boolean;
97
+ createdAt: string;
98
+ updatedAt: string;
99
+ members: QueueMember[];
100
+ distributionType: DistributionType;
101
+ }
102
+ /** Response returned when listing queues. */
103
+ interface QueueListResponse {
104
+ queues: Queue[];
105
+ }
106
+
107
+ /** Representation of a button in a Meta template. */
108
+ interface MetaTemplateButton {
109
+ /** Unique identifier of the button. */
110
+ id: string;
111
+ /** Type of the button (e.g. 'URL', 'PHONE_NUMBER', 'QUICK_REPLY'). */
112
+ type: string;
113
+ /** Text displayed on the button. */
114
+ text: string;
115
+ /** Value of the button (e.g. URL or phone number). */
116
+ value?: string | null;
117
+ /** Dynamic variable of the button. */
118
+ variable?: string | null;
119
+ /** ID of the template configuration to which the button belongs. */
120
+ templateConfigId: string;
121
+ /** Creation date of the record. */
122
+ createdAt?: string;
123
+ /** Update date of the record. */
124
+ updatedAt?: string;
125
+ }
126
+ /** Detailed configuration of a Meta template. */
127
+ interface MetaTemplateConfigResponse {
128
+ /** Unique identifier of the template configuration. */
129
+ id: string;
130
+ /** Name of the template in Meta. */
131
+ name: string;
132
+ /** Identifier of the template in Meta. */
133
+ templateId: string;
134
+ /** Company identifier in Meta. */
135
+ companyId: string;
136
+ /** Format of the template (e.g. TEXT, IMAGE, VIDEO). */
137
+ format?: string | null;
138
+ /** Content of the template header. */
139
+ headerContent?: string | null;
140
+ /** Defines if the header has dynamic content (parameters). */
141
+ isDynamicHeader: boolean;
142
+ /** Type of the header (e.g. TEXT, IMAGE, DOCUMENT, VIDEO). */
143
+ headerType?: string | null;
144
+ /** Content of the template body. */
145
+ bodyContent?: string | null;
146
+ /** Type of the body (e.g. TEXT). */
147
+ bodyType?: string | null;
148
+ /** Content of the template footer. */
149
+ footerContent?: string | null;
150
+ /** Type of the footer (e.g. TEXT). */
151
+ footerType?: string | null;
152
+ /** ID of the configuration associated with the template. */
153
+ configId?: string | null;
154
+ /** ID of the provider associated with the template. */
155
+ providerId?: string | null;
156
+ /** Creation date of the record. */
157
+ createdAt?: string;
158
+ /** Update date of the record. */
159
+ updatedAt?: string;
160
+ /** List of buttons in the template. */
161
+ buttons?: MetaTemplateButton[];
162
+ }
163
+ /** Response containing the list of template configurations associated with a configuration. */
164
+ interface MetaTemplateConfigsResponse {
165
+ /** List of Meta template configurations. */
166
+ templatesConfig: MetaTemplateConfigResponse[];
167
+ }
168
+
169
+ /** Request payload for finding or creating a queue rule. */
170
+ interface FindOrCreateQueueRuleRequest {
171
+ companyId: string;
172
+ queueId: string;
173
+ configId: string;
174
+ }
175
+ /** Response returned when finding or creating a queue rule. */
176
+ interface QueueRule {
177
+ id: string;
178
+ companyId: string;
179
+ name: string;
180
+ action: string;
181
+ message?: string;
182
+ automaticMessage?: Record<string, unknown>;
183
+ callOnQueue?: Record<string, unknown>;
184
+ uraDescription: string;
185
+ interactiveMessageId: string | null;
186
+ configId?: string;
187
+ queueId?: string;
188
+ redirectQueue: Record<string, unknown> | null;
189
+ redirectRuleId?: string;
190
+ questionnaire?: Record<string, unknown>;
191
+ webhook?: Record<string, unknown>;
192
+ isRoot: boolean;
193
+ redirectDefault: boolean;
194
+ redirectTimeout?: number;
195
+ delay?: number;
196
+ createdAt: string;
197
+ updatedAt: string;
198
+ flow?: Record<string, unknown>[];
199
+ }
200
+
201
+ export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderListResponse, Queue, QueueListResponse, QueueMember, QueueRule };
@@ -0,0 +1,201 @@
1
+ /** A provider entity returned by the Chat Config API. */
2
+ interface Provider {
3
+ id: string;
4
+ name: string;
5
+ configurationsSchema: Record<string, unknown> | null;
6
+ defaultSession: number;
7
+ type: string;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ }
11
+ /** Response returned by the Chat Config API when listing providers. */
12
+ type ProviderListResponse = Provider[];
13
+
14
+ /** A provider entity nested within a configuration response. */
15
+ interface ConfigProvider {
16
+ id: string;
17
+ name: string;
18
+ type: string;
19
+ defaultSession: number;
20
+ configurationsSchema: Record<string, unknown> | null;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ }
24
+ /** A configuration entity returned by the Chat Config API. */
25
+ interface Config {
26
+ id: string;
27
+ isAssistanceEnabled: boolean;
28
+ rewind: number | null;
29
+ companyId: string;
30
+ active: boolean;
31
+ configurations: Record<string, unknown>;
32
+ priority: number | null;
33
+ inbound: boolean;
34
+ outbound: boolean;
35
+ deletedAt: string | null;
36
+ providers: ConfigProvider;
37
+ }
38
+ /** Response returned by the Chat Config API when listing configurations by provider. */
39
+ interface ConfigListByProviderResponse {
40
+ configurations: Config[];
41
+ }
42
+ /** Query parameters for filtering configurations by provider. */
43
+ interface GetConfigsByProviderParams {
44
+ isAssistanceEnabled?: boolean;
45
+ rewind?: number;
46
+ active?: boolean;
47
+ priority?: number;
48
+ inbound?: boolean;
49
+ outbound?: boolean;
50
+ providerType?: string;
51
+ providerName?: string;
52
+ }
53
+
54
+ interface QueueMember {
55
+ id: string;
56
+ memberId: string;
57
+ priority: number;
58
+ permission: string;
59
+ lastAttendance: string;
60
+ lastInvite: string;
61
+ paused: boolean;
62
+ activeChat: number;
63
+ online: boolean;
64
+ companyId: string;
65
+ avatar: string;
66
+ username: string;
67
+ createdAt: string;
68
+ updatedAt: string;
69
+ queueId: string;
70
+ }
71
+ type DistributionType = {
72
+ id: string;
73
+ alias: string;
74
+ description: string;
75
+ createdAt: string;
76
+ updatedAt: string;
77
+ };
78
+ interface Queue {
79
+ id: string;
80
+ distributionTypeId: string;
81
+ companyId: string;
82
+ name: string;
83
+ strategy: 'leastrecent' | 'roundrobin' | 'random';
84
+ defaultQueue: boolean;
85
+ unlimitedService: boolean;
86
+ serviceLimit: number;
87
+ timeLimit: number;
88
+ skipOncallUsers: boolean;
89
+ csat: boolean;
90
+ csatAnswer: string;
91
+ csatTTL: number;
92
+ outsideBusinessHourMessage: string;
93
+ createCallbackOnExpired: boolean;
94
+ createCallbackOnOutsideBusinessHours: boolean;
95
+ archived: boolean;
96
+ isPrivate: boolean;
97
+ createdAt: string;
98
+ updatedAt: string;
99
+ members: QueueMember[];
100
+ distributionType: DistributionType;
101
+ }
102
+ /** Response returned when listing queues. */
103
+ interface QueueListResponse {
104
+ queues: Queue[];
105
+ }
106
+
107
+ /** Representation of a button in a Meta template. */
108
+ interface MetaTemplateButton {
109
+ /** Unique identifier of the button. */
110
+ id: string;
111
+ /** Type of the button (e.g. 'URL', 'PHONE_NUMBER', 'QUICK_REPLY'). */
112
+ type: string;
113
+ /** Text displayed on the button. */
114
+ text: string;
115
+ /** Value of the button (e.g. URL or phone number). */
116
+ value?: string | null;
117
+ /** Dynamic variable of the button. */
118
+ variable?: string | null;
119
+ /** ID of the template configuration to which the button belongs. */
120
+ templateConfigId: string;
121
+ /** Creation date of the record. */
122
+ createdAt?: string;
123
+ /** Update date of the record. */
124
+ updatedAt?: string;
125
+ }
126
+ /** Detailed configuration of a Meta template. */
127
+ interface MetaTemplateConfigResponse {
128
+ /** Unique identifier of the template configuration. */
129
+ id: string;
130
+ /** Name of the template in Meta. */
131
+ name: string;
132
+ /** Identifier of the template in Meta. */
133
+ templateId: string;
134
+ /** Company identifier in Meta. */
135
+ companyId: string;
136
+ /** Format of the template (e.g. TEXT, IMAGE, VIDEO). */
137
+ format?: string | null;
138
+ /** Content of the template header. */
139
+ headerContent?: string | null;
140
+ /** Defines if the header has dynamic content (parameters). */
141
+ isDynamicHeader: boolean;
142
+ /** Type of the header (e.g. TEXT, IMAGE, DOCUMENT, VIDEO). */
143
+ headerType?: string | null;
144
+ /** Content of the template body. */
145
+ bodyContent?: string | null;
146
+ /** Type of the body (e.g. TEXT). */
147
+ bodyType?: string | null;
148
+ /** Content of the template footer. */
149
+ footerContent?: string | null;
150
+ /** Type of the footer (e.g. TEXT). */
151
+ footerType?: string | null;
152
+ /** ID of the configuration associated with the template. */
153
+ configId?: string | null;
154
+ /** ID of the provider associated with the template. */
155
+ providerId?: string | null;
156
+ /** Creation date of the record. */
157
+ createdAt?: string;
158
+ /** Update date of the record. */
159
+ updatedAt?: string;
160
+ /** List of buttons in the template. */
161
+ buttons?: MetaTemplateButton[];
162
+ }
163
+ /** Response containing the list of template configurations associated with a configuration. */
164
+ interface MetaTemplateConfigsResponse {
165
+ /** List of Meta template configurations. */
166
+ templatesConfig: MetaTemplateConfigResponse[];
167
+ }
168
+
169
+ /** Request payload for finding or creating a queue rule. */
170
+ interface FindOrCreateQueueRuleRequest {
171
+ companyId: string;
172
+ queueId: string;
173
+ configId: string;
174
+ }
175
+ /** Response returned when finding or creating a queue rule. */
176
+ interface QueueRule {
177
+ id: string;
178
+ companyId: string;
179
+ name: string;
180
+ action: string;
181
+ message?: string;
182
+ automaticMessage?: Record<string, unknown>;
183
+ callOnQueue?: Record<string, unknown>;
184
+ uraDescription: string;
185
+ interactiveMessageId: string | null;
186
+ configId?: string;
187
+ queueId?: string;
188
+ redirectQueue: Record<string, unknown> | null;
189
+ redirectRuleId?: string;
190
+ questionnaire?: Record<string, unknown>;
191
+ webhook?: Record<string, unknown>;
192
+ isRoot: boolean;
193
+ redirectDefault: boolean;
194
+ redirectTimeout?: number;
195
+ delay?: number;
196
+ createdAt: string;
197
+ updatedAt: string;
198
+ flow?: Record<string, unknown>[];
199
+ }
200
+
201
+ export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderListResponse, Queue, QueueListResponse, QueueMember, QueueRule };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/chat-config/contracts/index.ts
17
+ var contracts_exports = {};
18
+ module.exports = __toCommonJS(contracts_exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/chat-config/contracts/index.ts"],"sourcesContent":["export * from './config';\nexport * from './provider';\nexport * from './queues';\nexport * from './meta-template';\nexport * from './rule';"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,95 @@
1
+ /** Shared company data fields returned by the Customer Service API. */
2
+ interface CompanyData {
3
+ id: string;
4
+ name: string;
5
+ hostname: string;
6
+ crm_code: string;
7
+ token: string;
8
+ status: string;
9
+ timezone: string;
10
+ utc: string;
11
+ check_bad_password: boolean;
12
+ limit_bad_password: number;
13
+ watching: boolean;
14
+ trial: boolean;
15
+ support_widget_id: string;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ }
19
+ /** Response returned by the Customer Service API when fetching a company. */
20
+ interface CompanyResponse {
21
+ company: CompanyData;
22
+ }
23
+
24
+ /** A work group entity nested within {@link WorkGroupListResponse} and {@link WorkGroupResponse}. */
25
+ interface WorkGroup {
26
+ id: string;
27
+ name: string;
28
+ description: string | null;
29
+ type: 'default' | 'user';
30
+ company_id: string;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ }
34
+ /** Response returned by the Customer Service API when fetching the work groups list. */
35
+ interface WorkGroupListResponse extends CompanyData {
36
+ workgroups: WorkGroup[];
37
+ }
38
+ /** A user membership entity nested within {@link WorkGroupResponse}. */
39
+ interface WorkGroupMember {
40
+ id: string;
41
+ username: string;
42
+ email: string;
43
+ profile: 'p_admin' | 'p_manager' | 'p_corporative' | 'p_agent';
44
+ status: 'new' | 'activated' | 'disabled';
45
+ avatar: string | null;
46
+ createdAt: string;
47
+ updatedAt: string;
48
+ }
49
+ /** Response returned by the Customer Service API when fetching a single work group. */
50
+ interface WorkGroupResponse {
51
+ id: string;
52
+ name: string;
53
+ description: string | null;
54
+ type: 'default' | 'user';
55
+ company_id: string;
56
+ createdAt: string;
57
+ updatedAt: string;
58
+ workgroups_users: WorkGroupMember[];
59
+ }
60
+ /** Response returned by the Customer Service API when fetching members of a work group. */
61
+ type WorkGroupMembersResponse = WorkGroupMember[];
62
+
63
+ interface User {
64
+ id: string;
65
+ username: string;
66
+ email: string;
67
+ profile: 'p_admin' | 'p_manager' | 'p_corporative' | 'p_agent';
68
+ status: 'new' | 'activated' | 'disabled';
69
+ avatar: string | null;
70
+ type: string;
71
+ companyId: string;
72
+ createdAt: string;
73
+ updatedAt: string;
74
+ }
75
+ interface GetAllUsersParams {
76
+ status?: string;
77
+ includeWorkGroups?: boolean;
78
+ withoutOpensUsers?: boolean;
79
+ }
80
+ interface GetAllUsersResponse {
81
+ users: User[];
82
+ }
83
+ interface ManagedUser {
84
+ id: string;
85
+ username: string;
86
+ email: string;
87
+ profile: string;
88
+ status: string;
89
+ companyId: string;
90
+ createdAt: string;
91
+ updatedAt: string;
92
+ }
93
+ type GetManagedUsersResponse = ManagedUser[];
94
+
95
+ export type { CompanyData, CompanyResponse, GetAllUsersParams, GetAllUsersResponse, GetManagedUsersResponse, ManagedUser, User, WorkGroup, WorkGroupListResponse, WorkGroupMember, WorkGroupMembersResponse, WorkGroupResponse };