@isardsat/editorial-common 6.16.0 → 6.18.0
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/CHANGELOG.md +17 -0
- package/dist/schemas.d.ts +65 -0
- package/dist/schemas.js +28 -0
- package/package.json +1 -1
- package/src/schemas.ts +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @isardsat/editorial-common
|
|
2
2
|
|
|
3
|
+
## 6.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- dcbc22f: - Inject Firebase token on each request.
|
|
8
|
+
- Verify Firebase token on the server using Google public keys, requiring no extra configuration on Editorial.
|
|
9
|
+
- Add firebaseAuth middleware to protect routes.
|
|
10
|
+
|
|
11
|
+
## 6.17.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 74f9fff: - Adds /api/v1/diff endpoint that compares preview and production data.
|
|
16
|
+
- Adds an unpublished changes table on dashboard showing all pending changes with color-coded status badge.
|
|
17
|
+
- Highlight modified fields in ItemForm with yellow ring and "(modified)" label.
|
|
18
|
+
- Adds delete confirmation dialog to prevent accidental deletions.
|
|
19
|
+
|
|
3
20
|
## 6.16.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/schemas.d.ts
CHANGED
|
@@ -152,6 +152,71 @@ export declare const EditorialFilesResponseSchema: z.ZodObject<{
|
|
|
152
152
|
totalSize: z.ZodNumber;
|
|
153
153
|
}, z.core.$strip>;
|
|
154
154
|
export declare const EditorialFilesSchema: z.ZodArray<z.ZodType<BaseEditorialFile, unknown, z.core.$ZodTypeInternals<BaseEditorialFile, unknown>>>;
|
|
155
|
+
declare const itemStatus: readonly ["added", "modified", "deleted"];
|
|
156
|
+
export declare const EditorialDiffResponseSchema: z.ZodObject<{
|
|
157
|
+
collections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
158
|
+
added: z.ZodArray<z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
item: z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
isDraft: z.ZodDefault<z.ZodBoolean>;
|
|
163
|
+
createdAt: z.ZodDefault<z.ZodISODateTime>;
|
|
164
|
+
updatedAt: z.ZodDefault<z.ZodISODateTime>;
|
|
165
|
+
}, z.core.$loose>;
|
|
166
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strip>>;
|
|
168
|
+
modified: z.ZodArray<z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
preview: z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
isDraft: z.ZodDefault<z.ZodBoolean>;
|
|
173
|
+
createdAt: z.ZodDefault<z.ZodISODateTime>;
|
|
174
|
+
updatedAt: z.ZodDefault<z.ZodISODateTime>;
|
|
175
|
+
}, z.core.$loose>;
|
|
176
|
+
production: z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
isDraft: z.ZodDefault<z.ZodBoolean>;
|
|
179
|
+
createdAt: z.ZodDefault<z.ZodISODateTime>;
|
|
180
|
+
updatedAt: z.ZodDefault<z.ZodISODateTime>;
|
|
181
|
+
}, z.core.$loose>;
|
|
182
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
183
|
+
changedFields: z.ZodArray<z.ZodString>;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
deleted: z.ZodArray<z.ZodObject<{
|
|
186
|
+
id: z.ZodString;
|
|
187
|
+
item: z.ZodObject<{
|
|
188
|
+
id: z.ZodString;
|
|
189
|
+
isDraft: z.ZodDefault<z.ZodBoolean>;
|
|
190
|
+
createdAt: z.ZodDefault<z.ZodISODateTime>;
|
|
191
|
+
updatedAt: z.ZodDefault<z.ZodISODateTime>;
|
|
192
|
+
}, z.core.$loose>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
singles: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
196
|
+
status: z.ZodEnum<{
|
|
197
|
+
added: "added";
|
|
198
|
+
modified: "modified";
|
|
199
|
+
deleted: "deleted";
|
|
200
|
+
}>;
|
|
201
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
id: z.ZodString;
|
|
203
|
+
isDraft: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
createdAt: z.ZodDefault<z.ZodISODateTime>;
|
|
205
|
+
updatedAt: z.ZodDefault<z.ZodISODateTime>;
|
|
206
|
+
}, z.core.$loose>>;
|
|
207
|
+
production: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
isDraft: z.ZodDefault<z.ZodBoolean>;
|
|
210
|
+
createdAt: z.ZodDefault<z.ZodISODateTime>;
|
|
211
|
+
updatedAt: z.ZodDefault<z.ZodISODateTime>;
|
|
212
|
+
}, z.core.$loose>>;
|
|
213
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
214
|
+
changedFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
155
217
|
export type EditorialFile = z.infer<typeof EditorialFileSchema>;
|
|
156
218
|
export type EditorialFiles = z.infer<typeof EditorialFilesSchema>;
|
|
157
219
|
export type EditorialFilesResponse = z.infer<typeof EditorialFilesResponseSchema>;
|
|
220
|
+
export type EditorialDiffResponse = z.infer<typeof EditorialDiffResponseSchema>;
|
|
221
|
+
export type EditorialDataItemStatus = (typeof itemStatus)[number];
|
|
222
|
+
export {};
|
package/dist/schemas.js
CHANGED
|
@@ -99,3 +99,31 @@ export const EditorialFilesResponseSchema = z.object({
|
|
|
99
99
|
totalSize: z.number(),
|
|
100
100
|
});
|
|
101
101
|
export const EditorialFilesSchema = z.array(EditorialFileSchema);
|
|
102
|
+
const itemStatus = ["added", "modified", "deleted"];
|
|
103
|
+
export const EditorialDiffResponseSchema = z.object({
|
|
104
|
+
collections: z.record(z.string(), z.object({
|
|
105
|
+
added: z.array(z.object({
|
|
106
|
+
id: z.string(),
|
|
107
|
+
item: EditorialDataItemSchema,
|
|
108
|
+
updatedAt: z.string().optional(),
|
|
109
|
+
})),
|
|
110
|
+
modified: z.array(z.object({
|
|
111
|
+
id: z.string(),
|
|
112
|
+
preview: EditorialDataItemSchema,
|
|
113
|
+
production: EditorialDataItemSchema,
|
|
114
|
+
updatedAt: z.string().optional(),
|
|
115
|
+
changedFields: z.array(z.string()),
|
|
116
|
+
})),
|
|
117
|
+
deleted: z.array(z.object({
|
|
118
|
+
id: z.string(),
|
|
119
|
+
item: EditorialDataItemSchema,
|
|
120
|
+
})),
|
|
121
|
+
})),
|
|
122
|
+
singles: z.record(z.string(), z.object({
|
|
123
|
+
status: z.enum(itemStatus),
|
|
124
|
+
preview: EditorialDataItemSchema.optional(),
|
|
125
|
+
production: EditorialDataItemSchema.optional(),
|
|
126
|
+
updatedAt: z.string().optional(),
|
|
127
|
+
changedFields: z.array(z.string()).optional(),
|
|
128
|
+
})),
|
|
129
|
+
});
|
package/package.json
CHANGED
package/src/schemas.ts
CHANGED
|
@@ -133,8 +133,53 @@ export const EditorialFilesResponseSchema = z.object({
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
export const EditorialFilesSchema = z.array(EditorialFileSchema);
|
|
136
|
+
|
|
137
|
+
const itemStatus = ["added", "modified", "deleted"] as const;
|
|
138
|
+
|
|
139
|
+
export const EditorialDiffResponseSchema = z.object({
|
|
140
|
+
collections: z.record(
|
|
141
|
+
z.string(),
|
|
142
|
+
z.object({
|
|
143
|
+
added: z.array(
|
|
144
|
+
z.object({
|
|
145
|
+
id: z.string(),
|
|
146
|
+
item: EditorialDataItemSchema,
|
|
147
|
+
updatedAt: z.string().optional(),
|
|
148
|
+
}),
|
|
149
|
+
),
|
|
150
|
+
modified: z.array(
|
|
151
|
+
z.object({
|
|
152
|
+
id: z.string(),
|
|
153
|
+
preview: EditorialDataItemSchema,
|
|
154
|
+
production: EditorialDataItemSchema,
|
|
155
|
+
updatedAt: z.string().optional(),
|
|
156
|
+
changedFields: z.array(z.string()),
|
|
157
|
+
}),
|
|
158
|
+
),
|
|
159
|
+
deleted: z.array(
|
|
160
|
+
z.object({
|
|
161
|
+
id: z.string(),
|
|
162
|
+
item: EditorialDataItemSchema,
|
|
163
|
+
}),
|
|
164
|
+
),
|
|
165
|
+
}),
|
|
166
|
+
),
|
|
167
|
+
singles: z.record(
|
|
168
|
+
z.string(),
|
|
169
|
+
z.object({
|
|
170
|
+
status: z.enum(itemStatus),
|
|
171
|
+
preview: EditorialDataItemSchema.optional(),
|
|
172
|
+
production: EditorialDataItemSchema.optional(),
|
|
173
|
+
updatedAt: z.string().optional(),
|
|
174
|
+
changedFields: z.array(z.string()).optional(),
|
|
175
|
+
}),
|
|
176
|
+
),
|
|
177
|
+
});
|
|
178
|
+
|
|
136
179
|
export type EditorialFile = z.infer<typeof EditorialFileSchema>;
|
|
137
180
|
export type EditorialFiles = z.infer<typeof EditorialFilesSchema>;
|
|
138
181
|
export type EditorialFilesResponse = z.infer<
|
|
139
182
|
typeof EditorialFilesResponseSchema
|
|
140
183
|
>;
|
|
184
|
+
export type EditorialDiffResponse = z.infer<typeof EditorialDiffResponseSchema>;
|
|
185
|
+
export type EditorialDataItemStatus = (typeof itemStatus)[number];
|