@clxmedia/types 1.0.138 → 1.0.140

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;
61
125
  repeatable: boolean;
62
126
  };
127
+ export type ProjectNotificationConfig = {
128
+ onAction: CLXProjectActionType;
129
+ templateSlug: string;
130
+ recipients: ProjectNotificationRecipients;
131
+ repeatable: boolean;
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 = {
@@ -132,3 +290,26 @@ export type CLXTaskWithHistory = CLXTaskWithStatus & {
132
290
  history: CLXTaskHistoryEntry[];
133
291
  triggers: CLXTaskTrigger[];
134
292
  };
293
+ export type TaskHistoryArchive = {
294
+ id: number;
295
+ action_type: CLXTaskActionType;
296
+ action_by_user: string;
297
+ description?: string;
298
+ action_slug?: string;
299
+ created_at: Date;
300
+ };
301
+ export type TaskArchive = {
302
+ id: number;
303
+ slug: string;
304
+ master_id: number;
305
+ name: string;
306
+ created_at: Date;
307
+ is_required: boolean;
308
+ requires_verification: boolean;
309
+ activated_at: Date;
310
+ completed_at: Date;
311
+ closed_at: Date;
312
+ resolution: string;
313
+ history: TaskHistoryArchive[];
314
+ };
315
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.0.138",
3
+ "version": "1.0.140",
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,38 +0,0 @@
1
- import type { EnterpriseEventSlugs } from "../events";
2
- import type { CLXTaskAssignment, CLXTaskWithStatus } from "../tasks";
3
- export type CLXProjectStepInstance = {
4
- id: number;
5
- project_id: number;
6
- name: string;
7
- project_tasks: CLXTaskWithStatus[];
8
- };
9
- export type CLXUserInstance = {
10
- id: number;
11
- email: string;
12
- name: string;
13
- };
14
- export type CLXProjectDetails = {
15
- implementation_specialist?: CLXUserInstance;
16
- client_service_analyst?: CLXUserInstance;
17
- };
18
- export type CLXProjectNotificationDefinition = {
19
- id: number;
20
- on_event_slug: EnterpriseEventSlugs;
21
- recipient: CLXTaskAssignment;
22
- notificationSlug: string;
23
- repeatable: boolean;
24
- created_at: Date;
25
- sent_at: Date | null;
26
- }[];
27
- export type CLXProjectInstance = {
28
- id: number;
29
- master_id: number;
30
- name: string;
31
- slug: string;
32
- notifications?: CLXProjectNotificationDefinition[];
33
- details?: CLXProjectDetails;
34
- created_at: Date;
35
- updated_at: Date;
36
- archived_at: Date | null;
37
- steps: CLXProjectStepInstance[];
38
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });