@clxmedia/types 1.0.76 → 1.0.78

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.
@@ -1,27 +1,52 @@
1
- type ConditionalEnterpriseEvent<T = {}> = T extends {
2
- event_item_id: any;
3
- } ? {
4
- application_source: string;
5
- event_item_type: string;
6
- } : T extends {
7
- event_item_type: any;
8
- } ? {
9
- application_source: string;
10
- } : {};
11
- export type EnterpriseEventApplicationSource = 'mediahub' | 'gbpa' | 'ad-broker' | 'clx-forms' | string;
12
- export type EnterpriseEventAction = 'client-review-approval' | 'updated-proof' | 'published' | 'publish-failed-error' | 'created-proof' | 'update-live-post' | 'update-live-post-failed' | 'deleted-proof' | 'concession-update' | 'unarchive' | 'create_internal_label' | 'creation' | 'pause' | 'proofing' | 'share-form' | string;
13
- export type EnterpriseEventItemType = 'asset' | 'proof' | 'concession-automation' | 'onboarding' | string;
14
- export type EnterpriseEvent = {
1
+ export type OtherEnterpriseEventApplicationSource = 'dashboard' | 'odoo' | 'crmhub' | 'emailhub';
2
+ export type BaseEnterpriseEventAction = 'created' | 'updated' | 'archived' | 'unarchived' | 'deleted' | 'info' | 'warning' | 'error';
3
+ export type EnterpriseEventBase = {
15
4
  user_email: string;
16
5
  description: string;
17
- application_source: EnterpriseEventApplicationSource;
18
- event_action: EnterpriseEventAction;
19
- event_unix_time_ms: number;
20
6
  master_id?: number;
21
- event_item_id?: string;
22
- event_item_type?: EnterpriseEventItemType;
7
+ event_unix_time_ms: number;
8
+ event_action: BaseEnterpriseEventAction;
9
+ };
10
+ export type MediaHubEnterpriseEventAction = BaseEnterpriseEventAction;
11
+ export type MediaHubItemTypes = 'asset' | 'asset_tag' | 'asset_internal_label' | 'asset_label' | 'video' | 'video_internal_label';
12
+ export type EnterpriseEventMediaHub = EnterpriseEventBase & {
13
+ application_source: 'mediahub';
14
+ event_item_type: MediaHubItemTypes;
15
+ event_item_id: string;
16
+ event_item_name: string;
17
+ event_action: MediaHubEnterpriseEventAction;
18
+ };
19
+ export type MediaHubEnterpriseEventSlugs = `mediahub_${MediaHubItemTypes}_${MediaHubEnterpriseEventAction}`;
20
+ export type CoreEnterpriseEventAction = BaseEnterpriseEventAction | 'shared' | 'submitted' | 'reviewed';
21
+ export type CoreItemTypes = 'form' | 'project' | 'task';
22
+ export type EnterpriseEventCore = EnterpriseEventBase & {
23
+ application_source: 'core';
24
+ event_item_type: CoreItemTypes;
25
+ event_item_id: string;
23
26
  event_item_name?: string;
24
- } & ConditionalEnterpriseEvent;
27
+ event_action: CoreEnterpriseEventAction;
28
+ };
29
+ export type CoreEnterpriseEventSlugs = `core_${CoreItemTypes}_${CoreEnterpriseEventAction}`;
30
+ export type AdsEnterpriseEventAction = BaseEnterpriseEventAction | 'reviewed' | 'paused' | 'unpaused' | 'published';
31
+ export type AdsItemTypes = 'proof_gbpa' | 'proof_mac' | 'proof_social' | 'proof_display' | 'proof_video' | 'none';
32
+ export type EnterpriseEventAds = EnterpriseEventBase & {
33
+ application_source: 'ads';
34
+ event_item_type?: AdsItemTypes;
35
+ event_item_id: string;
36
+ event_item_name?: string;
37
+ event_action: AdsEnterpriseEventAction;
38
+ };
39
+ export type AdsEnterpriseEventSlugs = `ads_${AdsItemTypes}_${AdsEnterpriseEventAction}`;
40
+ export type EnterpriseEventOther = EnterpriseEventBase & {
41
+ application_source: 'dashboard' | 'odoo' | 'crmhub' | 'emailhub';
42
+ event_item_type?: string;
43
+ event_item_id: string;
44
+ event_item_name?: string;
45
+ event_action: BaseEnterpriseEventAction;
46
+ };
47
+ export type OtherEnterpriseEventSlugs = `${OtherEnterpriseEventApplicationSource}_${BaseEnterpriseEventAction}`;
48
+ export type EnterpriseEvent = EnterpriseEventMediaHub | EnterpriseEventCore | EnterpriseEventAds | EnterpriseEventOther;
49
+ export type EnterpriseEventSlugs = MediaHubEnterpriseEventSlugs | CoreEnterpriseEventSlugs | AdsEnterpriseEventSlugs | OtherEnterpriseEventSlugs;
25
50
  export type ServiceKeys = 'accessToken' | 'jwtConfig';
26
51
  export type AccessConfigs = {
27
52
  accessToken?: string;
@@ -43,4 +68,3 @@ export type XperienceGCPConfig = {
43
68
  project: string;
44
69
  location: string;
45
70
  };
46
- export {};
@@ -1,11 +1,12 @@
1
1
  import type { CLXFormRuleSet } from "../clxforms";
2
+ import type { EnterpriseEventSlugs } from "../events";
2
3
  import type { CLXTask } from "../tasks";
3
- export type CLXProjectStepStatus = "pending" | "open" | "complete";
4
+ export type CLXProjectStepStatus = "pending" | "open" | "complete" | "alert";
4
5
  export type CLXProjectStepSlug = string;
5
6
  export type CLXProjectTaskTemplate = {
6
- slug: string;
7
- default_required?: boolean;
8
- requires_verification?: boolean;
7
+ slug: EnterpriseEventSlugs;
8
+ required: boolean;
9
+ verify: boolean;
9
10
  };
10
11
  export type CLXProjectStepTemplate = {
11
12
  name: string;
@@ -28,7 +29,6 @@ export type CLXProjectTaskInstance = {
28
29
  is_required: boolean;
29
30
  conditions: CLXFormRuleSet | any;
30
31
  project_step_id: number;
31
- task_id: number;
32
32
  created_at: Date;
33
33
  updated_at: Date;
34
34
  task: CLXTask;
@@ -1,3 +1,4 @@
1
+ import type { EnterpriseEventSlugs } from "../events";
1
2
  export type CLXSortDirection = 'asc' | 'desc';
2
3
  export type CLXTaskFilter = {
3
4
  assigned_to_user_id?: number;
@@ -17,30 +18,27 @@ export type PagedResult<T> = {
17
18
  skip: number;
18
19
  };
19
20
  export type CLXTaskActionType = 'create' | 'assign' | 'comment' | 'start' | 'complete' | 'verify' | 'close';
20
- export type CLXTaskTargetType = 'none' | 'snapshot' | 'access_request';
21
21
  export type CLXTaskTargetNone = {
22
22
  type: 'none';
23
23
  };
24
24
  export type CLXTaskTarget = {
25
- type: Omit<CLXTaskTargetType, 'none'>;
25
+ type: 'snapshot' | 'access_request';
26
26
  id: number;
27
27
  };
28
28
  export type CLXTask = {
29
29
  id: number;
30
30
  requires_verification: boolean;
31
- slug: string;
31
+ slug: EnterpriseEventSlugs;
32
32
  instructions?: string;
33
- assigned_to_user_id: number;
34
33
  created_at: Date;
35
- closed_at: Date;
34
+ closed_at: Date | null;
36
35
  master_id: number;
37
- entity: {
38
- name: string;
39
- };
40
- assigned_to_user: {
36
+ entity_name: string;
37
+ assigned_to_user?: {
38
+ id: number;
41
39
  email: string;
42
40
  };
43
- target: CLXTaskTarget | CLXTaskTargetNone;
41
+ target: CLXTaskTargetNone | CLXTaskTarget;
44
42
  };
45
43
  export type CLXTaskHistoryEntry = {
46
44
  id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.0.76",
3
+ "version": "1.0.78",
4
4
  "description": "Conversion Logix TypeScript type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",