@clxmedia/types 1.0.139 → 1.0.141

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.
@@ -4,4 +4,3 @@ export * as eventlog from './eventlog';
4
4
  export * as events from './events';
5
5
  export * as auth from './auth';
6
6
  export * as tasks from './tasks';
7
- export * as projects from './projects';
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.projects = exports.tasks = exports.auth = exports.events = exports.eventlog = exports.clxforms = exports.credstore = void 0;
3
+ exports.tasks = exports.auth = exports.events = exports.eventlog = exports.clxforms = exports.credstore = void 0;
4
4
  exports.credstore = require("./credstore");
5
5
  exports.clxforms = require("./clxforms");
6
6
  exports.eventlog = require("./eventlog");
7
7
  exports.events = require("./events");
8
8
  exports.auth = require("./auth");
9
9
  exports.tasks = require("./tasks");
10
- exports.projects = require("./projects");
@@ -34,6 +34,34 @@ export type PagedResult<T> = {
34
34
  take: number;
35
35
  skip: number;
36
36
  };
37
+ export type CLXProjectActionType = "activate" | "complete" | "create" | "notify" | "archive";
38
+ export type CLXProjectStepInstance = {
39
+ id: number;
40
+ project_id: number;
41
+ name: string;
42
+ status: CLXTaskStatus;
43
+ project_tasks: CLXTaskWithStatus[];
44
+ };
45
+ export type CLXUserInstance = {
46
+ id: number;
47
+ email: string;
48
+ name: string;
49
+ };
50
+ export type CLXProjectDetails = {
51
+ implementation_specialist?: CLXUserInstance;
52
+ client_service_analyst?: CLXUserInstance;
53
+ };
54
+ export type CLXProjectInstance = {
55
+ id: number;
56
+ master_id: number;
57
+ name: string;
58
+ slug: string;
59
+ details?: CLXProjectDetails;
60
+ created_at: Date;
61
+ updated_at: Date;
62
+ archived_at: Date | null;
63
+ steps: CLXProjectStepInstance[];
64
+ };
37
65
  export type CLXTaskActionType = 'create' | 'activate' | 'assign' | 'comment' | 'notify' | 'start' | 'reject' | 'skip' | 'complete' | 'verify' | 'close';
38
66
  export type CLXTaskTargetNone = {
39
67
  type: 'none';
@@ -47,27 +75,157 @@ export type TimeDelay = {
47
75
  value: number;
48
76
  } | 'immediately';
49
77
  export type CLXTaskNotificationType = 'default' | 'initial_notify' | 'first_reminder' | 'second_reminder' | 'third_reminder' | 'final_reminder' | 'alert';
50
- export type CLXTaskReminderScheduleEntry = {
78
+ export type ProjectReminderScheduleEntry = {
79
+ reminder_type: string;
51
80
  delay: TimeDelay;
52
- type: 'start' | 'complete' | 'verify';
53
- notificationSlug: string;
54
- notificationType: CLXTaskNotificationType;
55
- recipient: CLXTaskAssignment | 'current_assignee';
56
- };
57
- export type CLXTaskNotificationDefinition = {
58
- on_action: CLXTaskActionType;
59
- recipient: CLXTaskAssignment;
60
- notificationSlug: string;
81
+ recipients: ProjectReminderRecipients;
82
+ };
83
+ export type Origin = {
84
+ type: 'task' | 'project_step' | 'project';
85
+ id: number;
86
+ name: string;
87
+ entity: {
88
+ master_id: number;
89
+ name: string;
90
+ };
91
+ resource?: {
92
+ label: string;
93
+ path: string;
94
+ };
95
+ };
96
+ export type ProjectNotificationRecipients = {
97
+ to: ProjectNotificationRecipientLocator;
98
+ cc?: ProjectNotificationRecipientLocator;
99
+ bcc?: ProjectNotificationRecipientLocator;
100
+ };
101
+ export type TaskNotificationRecipients = {
102
+ to: TaskNotificationRecipientLocator;
103
+ cc?: TaskNotificationRecipientLocator;
104
+ bcc?: TaskNotificationRecipientLocator;
105
+ };
106
+ export type NotificationRecipientType = 'user' | 'group' | 'right';
107
+ export type NotificationRecipientLocator = {
108
+ recipientType: NotificationRecipientType;
109
+ recipient: string | null;
110
+ };
111
+ export type ProjectNotificationRecipientType = 'user' | 'group' | 'right' | 'role';
112
+ export type TaskNotificationRecipientType = 'user' | 'group' | 'right' | 'role' | 'current_assignee';
113
+ export type TaskNotificationRecipientLocator = {
114
+ recipientType: TaskNotificationRecipientType;
115
+ recipient: string;
116
+ };
117
+ export type ProjectNotificationRecipientLocator = {
118
+ recipientType: ProjectNotificationRecipientType;
119
+ recipient: string;
120
+ };
121
+ export type TaskNotificationConfig = {
122
+ onAction: CLXTaskActionType;
123
+ templateSlug: string;
124
+ recipients: TaskNotificationRecipients;
125
+ repeatable: boolean;
126
+ };
127
+ export type ProjectNotificationConfig = {
128
+ onAction: CLXProjectActionType;
129
+ templateSlug: string;
130
+ recipients: ProjectNotificationRecipients;
61
131
  repeatable: boolean;
62
132
  };
133
+ export type ProjectNotificationConfigs = {
134
+ configs: ProjectNotificationConfig[];
135
+ };
136
+ export type ProjectReminderRecipients = {
137
+ to: ProjectNotificationRecipientLocator;
138
+ cc?: ProjectNotificationRecipientLocator;
139
+ bcc?: ProjectNotificationRecipientLocator;
140
+ };
141
+ export type TaskReminderRecipients = {
142
+ to: TaskNotificationRecipientLocator;
143
+ cc?: TaskNotificationRecipientLocator;
144
+ bcc?: TaskNotificationRecipientLocator;
145
+ };
146
+ export type ReminderRecipients = TaskReminderRecipients | ProjectReminderRecipients;
147
+ type OriginLocatorBase = {
148
+ type?: string;
149
+ origin_time: number;
150
+ id: number;
151
+ };
152
+ export type TaskOriginLocator = OriginLocatorBase & {
153
+ type: 'task';
154
+ };
155
+ export type ProjectOriginLocator = OriginLocatorBase & {
156
+ type: 'project_step' | 'project';
157
+ };
158
+ export type OriginLocator = TaskOriginLocator | ProjectOriginLocator;
159
+ export type TaskReminderScheduleEntry = {
160
+ reminder_type: CLXTaskNotificationType;
161
+ delay: TimeDelay;
162
+ recipients: TaskReminderRecipients;
163
+ };
164
+ export type ReminderScheduleEntry = TaskReminderScheduleEntry | ProjectReminderScheduleEntry;
165
+ export type TaskReminderConfig = {
166
+ origin_status: CLXTaskActionType;
167
+ template_slug: string;
168
+ schedule: TaskReminderScheduleEntry[];
169
+ };
170
+ export type TaskActivateReminderConfig = TaskReminderConfig & {
171
+ target_status: 'activate';
172
+ origin_status: 'create';
173
+ };
174
+ export type TaskStartReminderConfig = TaskReminderConfig & {
175
+ target_status: 'start';
176
+ origin_status: 'activate';
177
+ };
178
+ export type TaskCompleteReminderConfig = TaskReminderConfig & {
179
+ target_status: 'complete';
180
+ origin_status: 'start';
181
+ };
182
+ export type TaskVerifyReminderConfig = TaskReminderConfig & {
183
+ target_status: 'verify';
184
+ origin_status: 'complete';
185
+ };
186
+ export type TaskCloseReminderConfig = TaskReminderConfig & {
187
+ target_status: 'close';
188
+ origin_status: 'verify';
189
+ };
190
+ export type TaskReminderScheduleConfig = {
191
+ activate?: TaskActivateReminderConfig;
192
+ start?: TaskStartReminderConfig;
193
+ complete?: TaskCompleteReminderConfig;
194
+ verify?: TaskVerifyReminderConfig;
195
+ close?: TaskCloseReminderConfig;
196
+ };
197
+ export type TaskReminderConfigTypes = TaskActivateReminderConfig | TaskStartReminderConfig | TaskCompleteReminderConfig | TaskVerifyReminderConfig | TaskCloseReminderConfig;
198
+ export type ProjectReminderConfigTypes = ProjectActivateReminderConfig | ProjectCompleteReminderConfig | ProjectArchiveReminderConfig;
199
+ export type ProjectActivateReminderConfig = ProjectReminderConfig & {
200
+ target_status: 'activate';
201
+ origin_status: 'create';
202
+ };
203
+ export type ProjectCompleteReminderConfig = ProjectReminderConfig & {
204
+ target_status: 'complete';
205
+ origin_status: 'activate';
206
+ };
207
+ export type ProjectArchiveReminderConfig = ProjectReminderConfig & {
208
+ target_status: 'archive';
209
+ origin_status: 'complete';
210
+ };
211
+ export type ProjectReminderScheduleConfig = {
212
+ activate?: ProjectActivateReminderConfig;
213
+ complete?: ProjectCompleteReminderConfig;
214
+ archive?: ProjectArchiveReminderConfig;
215
+ };
216
+ export type ProjectReminderConfig = {
217
+ origin_status: CLXProjectActionType;
218
+ template_slug: string;
219
+ schedule: ProjectReminderScheduleEntry[];
220
+ };
63
221
  export type CLXTaskMetaData = {
64
222
  verifier: CLXTaskAssignment | null;
65
223
  resource?: {
66
224
  path: string;
67
225
  label: string;
68
226
  };
69
- reminder_schedule?: CLXTaskReminderScheduleEntry[];
70
- notifications?: CLXTaskNotificationDefinition[];
227
+ reminders?: TaskReminderScheduleConfig;
228
+ notifications?: TaskNotificationConfig[];
71
229
  };
72
230
  export type CLXTaskTriggerConstraint = 'event_user_to_onboarding_recipient_match' | 'project_id_match';
73
231
  export type CLXTaskTriggerConfig = {
@@ -82,6 +240,12 @@ export type CLXTaskTrigger = {
82
240
  created_at: Date;
83
241
  fired_at: Date | null;
84
242
  };
243
+ export type CLXTaskRuleTrigger = {
244
+ id: number;
245
+ action_type: CLXTaskTriggerAction;
246
+ conditions: CLXFormRuleSet;
247
+ created_at: Date;
248
+ };
85
249
  export type CLXTaskBase = {
86
250
  id: number;
87
251
  name: string;
@@ -132,3 +296,26 @@ export type CLXTaskWithHistory = CLXTaskWithStatus & {
132
296
  history: CLXTaskHistoryEntry[];
133
297
  triggers: CLXTaskTrigger[];
134
298
  };
299
+ export type TaskHistoryArchive = {
300
+ id: number;
301
+ action_type: CLXTaskActionType;
302
+ action_by_user: string;
303
+ description?: string;
304
+ action_slug?: string;
305
+ created_at: Date;
306
+ };
307
+ export type TaskArchive = {
308
+ id: number;
309
+ slug: string;
310
+ master_id: number;
311
+ name: string;
312
+ created_at: Date;
313
+ is_required: boolean;
314
+ requires_verification: boolean;
315
+ activated_at: Date;
316
+ completed_at: Date;
317
+ closed_at: Date;
318
+ resolution: string;
319
+ history: TaskHistoryArchive[];
320
+ };
321
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.0.139",
3
+ "version": "1.0.141",
4
4
  "description": "Conversion Logix TypeScript type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,10 +25,6 @@
25
25
  "types": "./dist/core/tasks/index.d.ts",
26
26
  "default": "./dist/core/tasks/index.js"
27
27
  },
28
- "./core/projects": {
29
- "types": "./dist/core/projects/index.d.ts",
30
- "default": "./dist/core/projects/index.js"
31
- },
32
28
  "./core/clxforms": {
33
29
  "types": "./dist/core/clxforms/index.d.ts",
34
30
  "default": "./dist/core/clxforms/index.js"
@@ -65,9 +61,6 @@
65
61
  "core/tasks": [
66
62
  "dist/core/tasks/index.d.ts"
67
63
  ],
68
- "core/projects": [
69
- "dist/core/projects/index.d.ts"
70
- ],
71
64
  "core/clxforms": [
72
65
  "dist/core/clxforms/index.d.ts"
73
66
  ],
@@ -1,39 +0,0 @@
1
- import type { EnterpriseEventSlugs } from "../events";
2
- import type { CLXTaskAssignment, CLXTaskStatus, CLXTaskWithStatus } from "../tasks";
3
- export type CLXProjectStepInstance = {
4
- id: number;
5
- project_id: number;
6
- name: string;
7
- status: CLXTaskStatus;
8
- project_tasks: CLXTaskWithStatus[];
9
- };
10
- export type CLXUserInstance = {
11
- id: number;
12
- email: string;
13
- name: string;
14
- };
15
- export type CLXProjectDetails = {
16
- implementation_specialist?: CLXUserInstance;
17
- client_service_analyst?: CLXUserInstance;
18
- };
19
- export type CLXProjectNotificationDefinition = {
20
- id: number;
21
- on_event_slug: EnterpriseEventSlugs;
22
- recipient: CLXTaskAssignment;
23
- notificationSlug: string;
24
- repeatable: boolean;
25
- created_at: Date;
26
- sent_at: Date | null;
27
- }[];
28
- export type CLXProjectInstance = {
29
- id: number;
30
- master_id: number;
31
- name: string;
32
- slug: string;
33
- notifications?: CLXProjectNotificationDefinition[];
34
- details?: CLXProjectDetails;
35
- created_at: Date;
36
- updated_at: Date;
37
- archived_at: Date | null;
38
- steps: CLXProjectStepInstance[];
39
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });