@communecter/cocolight-api-client 1.0.126 → 1.0.128

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.
@@ -0,0 +1,177 @@
1
+ import type {
2
+ IdObject,
3
+ LinkContributorsRef,
4
+ ParentsMap,
5
+ DateValue,
6
+ } from "./common.js";
7
+ import type EJSONType from "../../EJSONType.js";
8
+
9
+ type ObjectIDCtor = typeof EJSONType["ObjectID"];
10
+ type ObjectID = InstanceType<ObjectIDCtor>;
11
+
12
+ /**
13
+ * Statuts supportés par une action (cf. COSTUM_PROJECT_ACTION_REQUEST_NEW).
14
+ */
15
+ export const ACTION_STATUSES = [
16
+ "todo",
17
+ "done",
18
+ "tracking",
19
+ "discuter",
20
+ "next",
21
+ "totest",
22
+ "disabled",
23
+ "closed"
24
+ ] as const;
25
+
26
+ export type ActionStatus = (typeof ACTION_STATUSES)[number];
27
+
28
+ export interface ActionLinksBlock {
29
+ contributors?: Record<string, LinkContributorsRef>;
30
+ [k: string]: unknown;
31
+ }
32
+
33
+ export interface ActionMilestoneRef {
34
+ milestoneId: string;
35
+ startDate?: DateValue;
36
+ endDate?: DateValue;
37
+ }
38
+
39
+ export interface ActionCounts {
40
+ contributors?: number;
41
+ [k: string]: unknown;
42
+ }
43
+
44
+ /**
45
+ * Historique des changements de statut (alimenté par /set_status côté backend).
46
+ * `update` est un MongoDate (DateValue côté Json, Date côté Normalized).
47
+ */
48
+ export interface ActionUpdateStatusEntryJson {
49
+ status: ActionStatus;
50
+ author: string;
51
+ update: DateValue;
52
+ }
53
+
54
+ export interface ActionUpdateStatusEntryNormalized {
55
+ status: ActionStatus;
56
+ author: string;
57
+ update: Date;
58
+ }
59
+
60
+ /**
61
+ * Sous-tâche d'une action. Stockée dans `tasks[]`.
62
+ */
63
+ export interface ActionTaskJson {
64
+ taskId?: string;
65
+ task?: string;
66
+ checked?: boolean;
67
+ userId?: string;
68
+ contributors?: Record<string, unknown>;
69
+ timeSpent?: number;
70
+ createdAt?: DateValue;
71
+ checkedAt?: DateValue;
72
+ [key: string]: unknown;
73
+ }
74
+
75
+ export interface ActionTaskNormalized {
76
+ taskId?: string;
77
+ task?: string;
78
+ checked?: boolean;
79
+ userId?: string;
80
+ contributors?: Record<string, unknown>;
81
+ timeSpent?: number;
82
+ createdAt?: Date;
83
+ checkedAt?: Date;
84
+ [key: string]: unknown;
85
+ }
86
+
87
+ /**
88
+ * Bloc media : galerie d'images + fichiers attachés (par IDs de documents).
89
+ */
90
+ export interface ActionMedia {
91
+ type?: string;
92
+ countImages?: number;
93
+ images?: string[];
94
+ files?: string[];
95
+ [k: string]: unknown;
96
+ }
97
+
98
+ export interface ActionMediaFile {
99
+ files?: string[];
100
+ [k: string]: unknown;
101
+ }
102
+
103
+ export interface ActionItemJson {
104
+ _id: IdObject;
105
+ collection: "actions";
106
+ name: string;
107
+ description?: string;
108
+ status?: ActionStatus;
109
+ created?: DateValue;
110
+ updated?: DateValue;
111
+ modified?: DateValue;
112
+ startDate?: DateValue;
113
+ endDate?: DateValue;
114
+ parentId: string;
115
+ parentType: string;
116
+ parent?: ParentsMap;
117
+ tags?: string[];
118
+ links?: ActionLinksBlock;
119
+ creator?: string;
120
+ idUserAuthor?: string;
121
+ credits?: string;
122
+ idParentRoom?: string;
123
+ milestone?: ActionMilestoneRef;
124
+ importance?: string;
125
+ counts?: ActionCounts;
126
+ url?: string;
127
+ min?: number;
128
+ max?: number;
129
+ timeSpent?: number;
130
+ tracking?: boolean;
131
+ updateStatus?: ActionUpdateStatusEntryJson[];
132
+ rc?: unknown[];
133
+ tasks?: ActionTaskJson[];
134
+ media?: ActionMedia;
135
+ mediaFile?: ActionMediaFile;
136
+ [key: string]: unknown;
137
+ }
138
+
139
+ export interface ActionItemNormalized {
140
+ id: string;
141
+ _id: ObjectID;
142
+ collection: "actions";
143
+ name: string;
144
+ description?: string;
145
+ status?: ActionStatus;
146
+ created?: Date;
147
+ updated?: Date;
148
+ modified?: Date;
149
+ startDate?: Date;
150
+ endDate?: Date;
151
+ parentId: string;
152
+ parentType: string;
153
+ parent?: ParentsMap;
154
+ tags?: string[];
155
+ links?: ActionLinksBlock;
156
+ creator?: string;
157
+ idUserAuthor?: string;
158
+ credits?: number;
159
+ idParentRoom?: string;
160
+ milestone?: Omit<ActionMilestoneRef, "startDate" | "endDate"> & {
161
+ startDate?: Date;
162
+ endDate?: Date;
163
+ };
164
+ importance?: string;
165
+ counts?: ActionCounts;
166
+ url?: string;
167
+ min?: number;
168
+ max?: number;
169
+ timeSpent?: number;
170
+ tracking?: boolean;
171
+ updateStatus?: ActionUpdateStatusEntryNormalized[];
172
+ rc?: unknown[];
173
+ tasks?: ActionTaskNormalized[];
174
+ media?: ActionMedia;
175
+ mediaFile?: ActionMediaFile;
176
+ [key: string]: unknown;
177
+ }