@automateinc/fleet-types 1.0.81-dev.08bae97 → 1.0.81-dev.afb87fa

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,16 +1,72 @@
1
+ import { IModel } from "./models";
2
+
1
3
  export type StructuredContentTextVariant = "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "PARAGRAPH" | "TEXT";
2
4
  export type StructuredContentLinkVariant = "BUTTON" | "LINK";
3
- export type StructuredContentTableColumnType = "BOOLEAN" | "DATE" | "DATETIME" | "LINK" | "NUMBER" | "TEXT" | "TIME";
5
+ export type StructuredContentTableColumnType = "BOOLEAN" | "DATE" | "DATETIME" | "LINK" | "NUMBER" | "TAG" | "TEXT" | "TIME";
6
+ export type StructuredContentTableSortType = "date" | "number" | "string";
7
+ export type StructuredContentTableToolbarFilterType = "DATE_RANGE" | "SELECT";
8
+ export type StructuredContentLayoutWidth = "auto" | "full" | "half" | "third";
9
+ export type StructuredContentLayoutAlign = "center" | "end" | "start";
10
+ export type StructuredContentLayoutSpacing = "lg" | "md" | "none" | "sm";
11
+ export type StructuredContentTagTone = "danger" | "default" | "info" | "success" | "warning";
12
+
13
+ export interface IStructuredContentTagValue {
14
+ label: string;
15
+ tone?: StructuredContentTagTone;
16
+ }
17
+
18
+ export interface IStructuredContentNodeLayout {
19
+ align?: StructuredContentLayoutAlign;
20
+ gap?: StructuredContentLayoutSpacing;
21
+ hidden?: boolean;
22
+ marginBottom?: StructuredContentLayoutSpacing;
23
+ marginTop?: StructuredContentLayoutSpacing;
24
+ paddingX?: StructuredContentLayoutSpacing;
25
+ paddingY?: StructuredContentLayoutSpacing;
26
+ width?: StructuredContentLayoutWidth;
27
+ }
28
+
29
+ export interface IStructuredContentTableToolbarFilter {
30
+ columnKey: string;
31
+ type?: StructuredContentTableToolbarFilterType;
32
+ }
33
+
34
+ export interface IStructuredContentTableToolbar {
35
+ filters?: IStructuredContentTableToolbarFilter[];
36
+ search?: boolean;
37
+ }
38
+
39
+ export interface IStructuredContentTablePagination {
40
+ pageSize?: number;
41
+ }
4
42
 
5
43
  export interface IStructuredContentTableColumn {
6
44
  id: string;
7
45
  name: string;
46
+ sortType?: StructuredContentTableSortType;
47
+ sortable?: boolean;
8
48
  type: StructuredContentTableColumnType;
9
49
  }
10
50
 
11
51
  export interface IStructuredContentNodeBase {
12
52
  id: string;
13
- type: "LINK" | "SPACE" | "TABLE" | "TEXT";
53
+ layout?: IStructuredContentNodeLayout;
54
+ type: "COLLAPSE" | "FILES" | "LINK" | "SPACE" | "TABLE" | "TAG" | "TEXT";
55
+ }
56
+
57
+ export interface IStructuredContentCollapseNode extends IStructuredContentNodeBase {
58
+ children?: IStructuredContentNode[];
59
+ config?: {
60
+ title?: string;
61
+ };
62
+ type: "COLLAPSE";
63
+ }
64
+
65
+ export interface IStructuredContentFilesNode extends IStructuredContentNodeBase {
66
+ config?: {
67
+ source?: "HISTORY";
68
+ };
69
+ type: "FILES";
14
70
  }
15
71
 
16
72
  export interface IStructuredContentSpaceNode extends IStructuredContentNodeBase {
@@ -25,6 +81,13 @@ export interface IStructuredContentTextNode extends IStructuredContentNodeBase {
25
81
  type: "TEXT";
26
82
  }
27
83
 
84
+ export interface IStructuredContentTagNode extends IStructuredContentNodeBase {
85
+ config?: {
86
+ tone?: StructuredContentTagTone;
87
+ };
88
+ type: "TAG";
89
+ }
90
+
28
91
  export interface IStructuredContentLinkNode extends IStructuredContentNodeBase {
29
92
  config?: {
30
93
  variant?: StructuredContentLinkVariant;
@@ -35,13 +98,18 @@ export interface IStructuredContentLinkNode extends IStructuredContentNodeBase {
35
98
  export interface IStructuredContentTableNode extends IStructuredContentNodeBase {
36
99
  config?: {
37
100
  columns?: IStructuredContentTableColumn[];
101
+ pagination?: IStructuredContentTablePagination;
102
+ toolbar?: IStructuredContentTableToolbar;
38
103
  };
39
104
  type: "TABLE";
40
105
  }
41
106
 
42
107
  export type IStructuredContentNode =
108
+ | IStructuredContentCollapseNode
109
+ | IStructuredContentFilesNode
43
110
  | IStructuredContentLinkNode
44
111
  | IStructuredContentSpaceNode
112
+ | IStructuredContentTagNode
45
113
  | IStructuredContentTableNode
46
114
  | IStructuredContentTextNode;
47
115
 
@@ -52,9 +120,11 @@ export interface IStructuredContentLinkValue {
52
120
  }
53
121
 
54
122
  export type StructuredContentPrimitiveValue = boolean | number | string | null;
55
- export type IStructuredContentTableRow = Record<string, IStructuredContentLinkValue | StructuredContentPrimitiveValue>;
123
+ export type StructuredContentTaggableValue = IStructuredContentTagValue | StructuredContentPrimitiveValue;
124
+ export type IStructuredContentTableRow = Record<string, IStructuredContentLinkValue | StructuredContentTaggableValue>;
56
125
  export type StructuredContentDataValue =
57
126
  | IStructuredContentLinkValue
127
+ | IStructuredContentTagValue
58
128
  | IStructuredContentTableRow[]
59
129
  | StructuredContentPrimitiveValue;
60
130
  export type IStructuredContentData = Record<string, StructuredContentDataValue>;
@@ -63,9 +133,11 @@ export interface IStructuredContent {
63
133
  createdAt: string;
64
134
  data: IStructuredContentData;
65
135
  id: string;
136
+ key: string;
66
137
  metadata?: unknown;
67
- relation: string;
68
- relationId: number | string;
138
+ rawData: unknown;
139
+ relation: IModel;
140
+ relationId: string;
69
141
  structure: IStructuredContentNode[];
70
142
  updatedAt?: string;
71
143
  }
package/package.json CHANGED
@@ -52,5 +52,5 @@
52
52
  "test": "echo \"Error: no test specified\" && exit 1"
53
53
  },
54
54
  "types": "dist/types/index.d.ts",
55
- "version": "1.0.81-dev.08bae97"
55
+ "version": "1.0.81-dev.afb87fa"
56
56
  }