@automateinc/fleet-types 1.0.80 → 1.0.81-dev.3bc0cf4
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.
- package/AGENTS.md +13 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/structured-content.d.ts +116 -0
- package/package.json +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Repository Agent Instructions (`fleet-types`)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This package defines reusable base Fleet TypeScript types.
|
|
6
|
+
|
|
7
|
+
## Rules
|
|
8
|
+
|
|
9
|
+
1. Base types in `fleet-types` must only include scalar/model-owned fields.
|
|
10
|
+
2. Do not add relation fields to base types.
|
|
11
|
+
3. Do not add nested related model shapes such as `history?: IFile[]` to base types.
|
|
12
|
+
4. If a frontend or endpoint needs enriched relation data, define that as a local response type in the consuming app instead of expanding the shared base type.
|
|
13
|
+
5. Follow the nearest existing declaration pattern in `dist/types` for naming and field shape.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -189,6 +189,7 @@ export * from "./shift";
|
|
|
189
189
|
export * from "./shift-type";
|
|
190
190
|
export * from "./signing-mode";
|
|
191
191
|
export * from "./standard-operating-procedure";
|
|
192
|
+
export * from "./structured-content";
|
|
192
193
|
export * from "./tag";
|
|
193
194
|
export * from "./tag-color";
|
|
194
195
|
export * from "./team";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type StructuredContentTextVariant = "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "PARAGRAPH" | "TEXT";
|
|
2
|
+
export type StructuredContentLinkVariant = "BUTTON" | "LINK";
|
|
3
|
+
export type StructuredContentTableColumnType = "BOOLEAN" | "DATE" | "DATETIME" | "LINK" | "NUMBER" | "TEXT" | "TIME";
|
|
4
|
+
export type StructuredContentTableSortType = "date" | "number" | "string";
|
|
5
|
+
export type StructuredContentLayoutWidth = "auto" | "full" | "half" | "third";
|
|
6
|
+
export type StructuredContentLayoutAlign = "center" | "end" | "start";
|
|
7
|
+
export type StructuredContentLayoutSpacing = "lg" | "md" | "none" | "sm";
|
|
8
|
+
|
|
9
|
+
export interface IStructuredContentNodeLayout {
|
|
10
|
+
align?: StructuredContentLayoutAlign;
|
|
11
|
+
gap?: StructuredContentLayoutSpacing;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
marginBottom?: StructuredContentLayoutSpacing;
|
|
14
|
+
marginTop?: StructuredContentLayoutSpacing;
|
|
15
|
+
paddingX?: StructuredContentLayoutSpacing;
|
|
16
|
+
paddingY?: StructuredContentLayoutSpacing;
|
|
17
|
+
width?: StructuredContentLayoutWidth;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface IStructuredContentTableToolbarFilter {
|
|
21
|
+
columnKey: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IStructuredContentTableToolbar {
|
|
25
|
+
filters?: IStructuredContentTableToolbarFilter[];
|
|
26
|
+
search?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IStructuredContentTableColumn {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
sortType?: StructuredContentTableSortType;
|
|
33
|
+
sortable?: boolean;
|
|
34
|
+
type: StructuredContentTableColumnType;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IStructuredContentNodeBase {
|
|
38
|
+
id: string;
|
|
39
|
+
layout?: IStructuredContentNodeLayout;
|
|
40
|
+
type: "COLLAPSE" | "FILES" | "LINK" | "SPACE" | "TABLE" | "TEXT";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IStructuredContentCollapseNode extends IStructuredContentNodeBase {
|
|
44
|
+
children?: IStructuredContentNode[];
|
|
45
|
+
config?: {
|
|
46
|
+
title?: string;
|
|
47
|
+
};
|
|
48
|
+
type: "COLLAPSE";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface IStructuredContentFilesNode extends IStructuredContentNodeBase {
|
|
52
|
+
config?: {
|
|
53
|
+
source?: "HISTORY";
|
|
54
|
+
};
|
|
55
|
+
type: "FILES";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface IStructuredContentSpaceNode extends IStructuredContentNodeBase {
|
|
59
|
+
children?: IStructuredContentNode[];
|
|
60
|
+
type: "SPACE";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IStructuredContentTextNode extends IStructuredContentNodeBase {
|
|
64
|
+
config?: {
|
|
65
|
+
variant?: StructuredContentTextVariant;
|
|
66
|
+
};
|
|
67
|
+
type: "TEXT";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface IStructuredContentLinkNode extends IStructuredContentNodeBase {
|
|
71
|
+
config?: {
|
|
72
|
+
variant?: StructuredContentLinkVariant;
|
|
73
|
+
};
|
|
74
|
+
type: "LINK";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface IStructuredContentTableNode extends IStructuredContentNodeBase {
|
|
78
|
+
config?: {
|
|
79
|
+
columns?: IStructuredContentTableColumn[];
|
|
80
|
+
toolbar?: IStructuredContentTableToolbar;
|
|
81
|
+
};
|
|
82
|
+
type: "TABLE";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type IStructuredContentNode =
|
|
86
|
+
| IStructuredContentCollapseNode
|
|
87
|
+
| IStructuredContentFilesNode
|
|
88
|
+
| IStructuredContentLinkNode
|
|
89
|
+
| IStructuredContentSpaceNode
|
|
90
|
+
| IStructuredContentTableNode
|
|
91
|
+
| IStructuredContentTextNode;
|
|
92
|
+
|
|
93
|
+
export interface IStructuredContentLinkValue {
|
|
94
|
+
href: string;
|
|
95
|
+
target?: string;
|
|
96
|
+
title: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type StructuredContentPrimitiveValue = boolean | number | string | null;
|
|
100
|
+
export type IStructuredContentTableRow = Record<string, IStructuredContentLinkValue | StructuredContentPrimitiveValue>;
|
|
101
|
+
export type StructuredContentDataValue =
|
|
102
|
+
| IStructuredContentLinkValue
|
|
103
|
+
| IStructuredContentTableRow[]
|
|
104
|
+
| StructuredContentPrimitiveValue;
|
|
105
|
+
export type IStructuredContentData = Record<string, StructuredContentDataValue>;
|
|
106
|
+
|
|
107
|
+
export interface IStructuredContent {
|
|
108
|
+
createdAt: string;
|
|
109
|
+
data: IStructuredContentData;
|
|
110
|
+
id: string;
|
|
111
|
+
metadata?: unknown;
|
|
112
|
+
relation: string;
|
|
113
|
+
relationId: number | string;
|
|
114
|
+
structure: IStructuredContentNode[];
|
|
115
|
+
updatedAt?: string;
|
|
116
|
+
}
|
package/package.json
CHANGED