@notty/types 0.14.0 → 1.0.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/dist/index.cjs +212 -0
- package/dist/index.d.cts +5444 -316
- package/dist/index.d.ts +5444 -316
- package/dist/index.js +195 -0
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
// src/plugin.ts
|
|
2
|
+
function definePlugin(definition) {
|
|
3
|
+
return definition;
|
|
4
|
+
}
|
|
5
|
+
function definePluginFactory(factory) {
|
|
6
|
+
return factory;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/plugin-extensions.ts
|
|
10
|
+
var RESERVED_EXTENSION_PLUGIN_NAMES = {
|
|
11
|
+
core: "@notty/core",
|
|
12
|
+
appLocal: "@notty/app-local"
|
|
13
|
+
};
|
|
14
|
+
var EXTENSION_PRECEDENCE = {
|
|
15
|
+
core: 0,
|
|
16
|
+
plugin: 1,
|
|
17
|
+
"app-local": 2
|
|
18
|
+
};
|
|
19
|
+
function classifyPluginSource(pluginName, hints) {
|
|
20
|
+
if (hints?.declaredSource) return hints.declaredSource;
|
|
21
|
+
if (pluginName === RESERVED_EXTENSION_PLUGIN_NAMES.core) return "core";
|
|
22
|
+
if (pluginName === RESERVED_EXTENSION_PLUGIN_NAMES.appLocal) return "app-local";
|
|
23
|
+
return "plugin";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/theme.ts
|
|
27
|
+
function defineTheme(definition) {
|
|
28
|
+
return definition;
|
|
29
|
+
}
|
|
30
|
+
|
|
1
31
|
// src/notty-schema.ts
|
|
2
32
|
var exampleComponentSchema = {
|
|
3
33
|
uid: "shared.seo-meta",
|
|
@@ -170,11 +200,176 @@ function defineSystemMiddleware(definition) {
|
|
|
170
200
|
...definition
|
|
171
201
|
};
|
|
172
202
|
}
|
|
203
|
+
|
|
204
|
+
// src/activity.ts
|
|
205
|
+
var ACTIVITY_ACTION_CATEGORY = {
|
|
206
|
+
"content.create": "content",
|
|
207
|
+
"content.update": "content",
|
|
208
|
+
"content.delete": "content",
|
|
209
|
+
"content.publish": "content",
|
|
210
|
+
"content.unpublish": "content",
|
|
211
|
+
"content.bulk_update": "content",
|
|
212
|
+
"content.bulk_delete": "content",
|
|
213
|
+
"schema.create": "schema",
|
|
214
|
+
"schema.update": "schema",
|
|
215
|
+
"schema.delete": "schema",
|
|
216
|
+
"media.upload": "media",
|
|
217
|
+
"media.update": "media",
|
|
218
|
+
"media.delete": "media",
|
|
219
|
+
"settings.update": "settings",
|
|
220
|
+
"admin.login": "auth",
|
|
221
|
+
"admin.logout": "auth",
|
|
222
|
+
"auth.login": "auth",
|
|
223
|
+
"auth.logout": "auth",
|
|
224
|
+
"auth.register": "auth",
|
|
225
|
+
"comment.create": "collaboration",
|
|
226
|
+
"comment.update": "collaboration",
|
|
227
|
+
"comment.delete": "collaboration",
|
|
228
|
+
"comment.resolve": "collaboration",
|
|
229
|
+
"comment.reopen": "collaboration",
|
|
230
|
+
"assignment.create": "collaboration",
|
|
231
|
+
"assignment.update": "collaboration",
|
|
232
|
+
"assignment.complete": "collaboration",
|
|
233
|
+
"assignment.cancel": "collaboration"
|
|
234
|
+
};
|
|
235
|
+
var ACTIVITY_EXCLUDED_ACTIONS = [
|
|
236
|
+
"auth.token_refresh",
|
|
237
|
+
"admin.token_refresh",
|
|
238
|
+
"auth.login_failed",
|
|
239
|
+
"admin.login_failed",
|
|
240
|
+
"auth.password_reset",
|
|
241
|
+
"policy.denied"
|
|
242
|
+
];
|
|
243
|
+
var ACTIVITY_FEED_ACTIONS = [
|
|
244
|
+
"content.create",
|
|
245
|
+
"content.update",
|
|
246
|
+
"content.delete",
|
|
247
|
+
"content.publish",
|
|
248
|
+
"content.unpublish",
|
|
249
|
+
"content.bulk_update",
|
|
250
|
+
"content.bulk_delete",
|
|
251
|
+
"schema.create",
|
|
252
|
+
"schema.update",
|
|
253
|
+
"schema.delete",
|
|
254
|
+
"media.upload",
|
|
255
|
+
"media.update",
|
|
256
|
+
"media.delete",
|
|
257
|
+
"settings.update",
|
|
258
|
+
"admin.login",
|
|
259
|
+
"admin.logout",
|
|
260
|
+
"auth.login",
|
|
261
|
+
"auth.logout",
|
|
262
|
+
"auth.register",
|
|
263
|
+
"comment.create",
|
|
264
|
+
"comment.update",
|
|
265
|
+
"comment.delete",
|
|
266
|
+
"comment.resolve",
|
|
267
|
+
"comment.reopen",
|
|
268
|
+
"assignment.create",
|
|
269
|
+
"assignment.update",
|
|
270
|
+
"assignment.complete",
|
|
271
|
+
"assignment.cancel"
|
|
272
|
+
];
|
|
273
|
+
|
|
274
|
+
// src/workflow.ts
|
|
275
|
+
var DEFAULT_WORKFLOW = {
|
|
276
|
+
enabled: true,
|
|
277
|
+
initialState: "draft",
|
|
278
|
+
states: [
|
|
279
|
+
{ name: "draft", label: "Draft", color: "#6b7280" },
|
|
280
|
+
{ name: "review", label: "In Review", color: "#f59e0b" },
|
|
281
|
+
{ name: "approved", label: "Approved", color: "#3b82f6" },
|
|
282
|
+
{ name: "published", label: "Published", color: "#10b981", publishable: true }
|
|
283
|
+
],
|
|
284
|
+
transitions: [
|
|
285
|
+
{ from: "draft", to: "review", label: "Submit for Review" },
|
|
286
|
+
{ from: "review", to: "draft", label: "Return to Draft" },
|
|
287
|
+
{ from: "review", to: "approved", label: "Approve", roles: ["super-admin", "admin", "editor"] },
|
|
288
|
+
{ from: "approved", to: "published", label: "Publish", roles: ["super-admin", "admin"] },
|
|
289
|
+
{ from: "published", to: "draft", label: "Unpublish" },
|
|
290
|
+
{ from: "approved", to: "draft", label: "Return to Draft" }
|
|
291
|
+
]
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// src/translations.ts
|
|
295
|
+
var TRANSLATION_STATUSES = [
|
|
296
|
+
"draft",
|
|
297
|
+
"in_review",
|
|
298
|
+
"approved",
|
|
299
|
+
"published",
|
|
300
|
+
"outdated"
|
|
301
|
+
];
|
|
302
|
+
|
|
303
|
+
// src/compliance.ts
|
|
304
|
+
var COMPLIANCE_SCOPES = [
|
|
305
|
+
"audit_log",
|
|
306
|
+
"jobs",
|
|
307
|
+
"webhook_logs",
|
|
308
|
+
"operational_alerts",
|
|
309
|
+
"sso_login_states"
|
|
310
|
+
];
|
|
311
|
+
var LEGAL_HOLD_KINDS = [
|
|
312
|
+
"scope",
|
|
313
|
+
"tenant",
|
|
314
|
+
"content_type",
|
|
315
|
+
"entity",
|
|
316
|
+
"subject"
|
|
317
|
+
];
|
|
318
|
+
var DATA_CLASSIFICATIONS = [
|
|
319
|
+
"public",
|
|
320
|
+
"internal",
|
|
321
|
+
"confidential",
|
|
322
|
+
"restricted"
|
|
323
|
+
];
|
|
324
|
+
var GovernanceViolationError = class extends Error {
|
|
325
|
+
constructor(message, tenantId, rule, details) {
|
|
326
|
+
super(message);
|
|
327
|
+
this.tenantId = tenantId;
|
|
328
|
+
this.rule = rule;
|
|
329
|
+
this.details = details;
|
|
330
|
+
this.name = "GovernanceViolationError";
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
// src/ai-automation-advisor.ts
|
|
335
|
+
var DEFAULT_AUTOMATION_THRESHOLDS = {
|
|
336
|
+
abandonedDraftDays: 30,
|
|
337
|
+
staleContentDays: 365,
|
|
338
|
+
workflowStuckDays: 7,
|
|
339
|
+
orphanMediaDays: 30,
|
|
340
|
+
bulkRecommendationMinCount: 5
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
// src/ai-guardrails.ts
|
|
344
|
+
var DEFAULT_AI_GUARDRAILS = {
|
|
345
|
+
perActorMaxCalls: 30,
|
|
346
|
+
windowSeconds: 60,
|
|
347
|
+
maxBodyBytes: 64 * 1024,
|
|
348
|
+
auditEveryCall: true,
|
|
349
|
+
ledgerTtlSeconds: 7 * 24 * 60 * 60
|
|
350
|
+
};
|
|
173
351
|
export {
|
|
352
|
+
ACTIVITY_ACTION_CATEGORY,
|
|
353
|
+
ACTIVITY_EXCLUDED_ACTIONS,
|
|
354
|
+
ACTIVITY_FEED_ACTIONS,
|
|
355
|
+
COMPLIANCE_SCOPES,
|
|
356
|
+
DATA_CLASSIFICATIONS,
|
|
357
|
+
DEFAULT_AI_GUARDRAILS,
|
|
358
|
+
DEFAULT_AUTOMATION_THRESHOLDS,
|
|
359
|
+
DEFAULT_WORKFLOW,
|
|
360
|
+
EXTENSION_PRECEDENCE,
|
|
361
|
+
GovernanceViolationError,
|
|
362
|
+
LEGAL_HOLD_KINDS,
|
|
363
|
+
RESERVED_EXTENSION_PLUGIN_NAMES,
|
|
174
364
|
SchemaValidationError,
|
|
365
|
+
TRANSLATION_STATUSES,
|
|
366
|
+
classifyPluginSource,
|
|
175
367
|
defineAdminMiddleware,
|
|
176
368
|
defineContentMiddleware,
|
|
369
|
+
definePlugin,
|
|
370
|
+
definePluginFactory,
|
|
177
371
|
defineSystemMiddleware,
|
|
372
|
+
defineTheme,
|
|
178
373
|
exampleBlockComponent,
|
|
179
374
|
exampleComponentSchema,
|
|
180
375
|
exampleSchema
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notty/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Shared TypeScript types for Notty CMS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -17,11 +17,7 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"publishConfig": {
|
|
20
|
-
"access": "
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"tsup": "^8.3.0",
|
|
24
|
-
"typescript": "^5.6.3"
|
|
20
|
+
"access": "public"
|
|
25
21
|
},
|
|
26
22
|
"scripts": {
|
|
27
23
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
@@ -30,5 +26,9 @@
|
|
|
30
26
|
"lint": "eslint src",
|
|
31
27
|
"type-check": "tsc --noEmit",
|
|
32
28
|
"clean": "rm -rf dist"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"tsup": "^8.3.0",
|
|
32
|
+
"typescript": "^5.6.3"
|
|
33
33
|
}
|
|
34
34
|
}
|