@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 CHANGED
@@ -20,16 +20,63 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ACTIVITY_ACTION_CATEGORY: () => ACTIVITY_ACTION_CATEGORY,
24
+ ACTIVITY_EXCLUDED_ACTIONS: () => ACTIVITY_EXCLUDED_ACTIONS,
25
+ ACTIVITY_FEED_ACTIONS: () => ACTIVITY_FEED_ACTIONS,
26
+ COMPLIANCE_SCOPES: () => COMPLIANCE_SCOPES,
27
+ DATA_CLASSIFICATIONS: () => DATA_CLASSIFICATIONS,
28
+ DEFAULT_AI_GUARDRAILS: () => DEFAULT_AI_GUARDRAILS,
29
+ DEFAULT_AUTOMATION_THRESHOLDS: () => DEFAULT_AUTOMATION_THRESHOLDS,
30
+ DEFAULT_WORKFLOW: () => DEFAULT_WORKFLOW,
31
+ EXTENSION_PRECEDENCE: () => EXTENSION_PRECEDENCE,
32
+ GovernanceViolationError: () => GovernanceViolationError,
33
+ LEGAL_HOLD_KINDS: () => LEGAL_HOLD_KINDS,
34
+ RESERVED_EXTENSION_PLUGIN_NAMES: () => RESERVED_EXTENSION_PLUGIN_NAMES,
23
35
  SchemaValidationError: () => SchemaValidationError,
36
+ TRANSLATION_STATUSES: () => TRANSLATION_STATUSES,
37
+ classifyPluginSource: () => classifyPluginSource,
24
38
  defineAdminMiddleware: () => defineAdminMiddleware,
25
39
  defineContentMiddleware: () => defineContentMiddleware,
40
+ definePlugin: () => definePlugin,
41
+ definePluginFactory: () => definePluginFactory,
26
42
  defineSystemMiddleware: () => defineSystemMiddleware,
43
+ defineTheme: () => defineTheme,
27
44
  exampleBlockComponent: () => exampleBlockComponent,
28
45
  exampleComponentSchema: () => exampleComponentSchema,
29
46
  exampleSchema: () => exampleSchema
30
47
  });
31
48
  module.exports = __toCommonJS(index_exports);
32
49
 
50
+ // src/plugin.ts
51
+ function definePlugin(definition) {
52
+ return definition;
53
+ }
54
+ function definePluginFactory(factory) {
55
+ return factory;
56
+ }
57
+
58
+ // src/plugin-extensions.ts
59
+ var RESERVED_EXTENSION_PLUGIN_NAMES = {
60
+ core: "@notty/core",
61
+ appLocal: "@notty/app-local"
62
+ };
63
+ var EXTENSION_PRECEDENCE = {
64
+ core: 0,
65
+ plugin: 1,
66
+ "app-local": 2
67
+ };
68
+ function classifyPluginSource(pluginName, hints) {
69
+ if (hints?.declaredSource) return hints.declaredSource;
70
+ if (pluginName === RESERVED_EXTENSION_PLUGIN_NAMES.core) return "core";
71
+ if (pluginName === RESERVED_EXTENSION_PLUGIN_NAMES.appLocal) return "app-local";
72
+ return "plugin";
73
+ }
74
+
75
+ // src/theme.ts
76
+ function defineTheme(definition) {
77
+ return definition;
78
+ }
79
+
33
80
  // src/notty-schema.ts
34
81
  var exampleComponentSchema = {
35
82
  uid: "shared.seo-meta",
@@ -202,12 +249,177 @@ function defineSystemMiddleware(definition) {
202
249
  ...definition
203
250
  };
204
251
  }
252
+
253
+ // src/activity.ts
254
+ var ACTIVITY_ACTION_CATEGORY = {
255
+ "content.create": "content",
256
+ "content.update": "content",
257
+ "content.delete": "content",
258
+ "content.publish": "content",
259
+ "content.unpublish": "content",
260
+ "content.bulk_update": "content",
261
+ "content.bulk_delete": "content",
262
+ "schema.create": "schema",
263
+ "schema.update": "schema",
264
+ "schema.delete": "schema",
265
+ "media.upload": "media",
266
+ "media.update": "media",
267
+ "media.delete": "media",
268
+ "settings.update": "settings",
269
+ "admin.login": "auth",
270
+ "admin.logout": "auth",
271
+ "auth.login": "auth",
272
+ "auth.logout": "auth",
273
+ "auth.register": "auth",
274
+ "comment.create": "collaboration",
275
+ "comment.update": "collaboration",
276
+ "comment.delete": "collaboration",
277
+ "comment.resolve": "collaboration",
278
+ "comment.reopen": "collaboration",
279
+ "assignment.create": "collaboration",
280
+ "assignment.update": "collaboration",
281
+ "assignment.complete": "collaboration",
282
+ "assignment.cancel": "collaboration"
283
+ };
284
+ var ACTIVITY_EXCLUDED_ACTIONS = [
285
+ "auth.token_refresh",
286
+ "admin.token_refresh",
287
+ "auth.login_failed",
288
+ "admin.login_failed",
289
+ "auth.password_reset",
290
+ "policy.denied"
291
+ ];
292
+ var ACTIVITY_FEED_ACTIONS = [
293
+ "content.create",
294
+ "content.update",
295
+ "content.delete",
296
+ "content.publish",
297
+ "content.unpublish",
298
+ "content.bulk_update",
299
+ "content.bulk_delete",
300
+ "schema.create",
301
+ "schema.update",
302
+ "schema.delete",
303
+ "media.upload",
304
+ "media.update",
305
+ "media.delete",
306
+ "settings.update",
307
+ "admin.login",
308
+ "admin.logout",
309
+ "auth.login",
310
+ "auth.logout",
311
+ "auth.register",
312
+ "comment.create",
313
+ "comment.update",
314
+ "comment.delete",
315
+ "comment.resolve",
316
+ "comment.reopen",
317
+ "assignment.create",
318
+ "assignment.update",
319
+ "assignment.complete",
320
+ "assignment.cancel"
321
+ ];
322
+
323
+ // src/workflow.ts
324
+ var DEFAULT_WORKFLOW = {
325
+ enabled: true,
326
+ initialState: "draft",
327
+ states: [
328
+ { name: "draft", label: "Draft", color: "#6b7280" },
329
+ { name: "review", label: "In Review", color: "#f59e0b" },
330
+ { name: "approved", label: "Approved", color: "#3b82f6" },
331
+ { name: "published", label: "Published", color: "#10b981", publishable: true }
332
+ ],
333
+ transitions: [
334
+ { from: "draft", to: "review", label: "Submit for Review" },
335
+ { from: "review", to: "draft", label: "Return to Draft" },
336
+ { from: "review", to: "approved", label: "Approve", roles: ["super-admin", "admin", "editor"] },
337
+ { from: "approved", to: "published", label: "Publish", roles: ["super-admin", "admin"] },
338
+ { from: "published", to: "draft", label: "Unpublish" },
339
+ { from: "approved", to: "draft", label: "Return to Draft" }
340
+ ]
341
+ };
342
+
343
+ // src/translations.ts
344
+ var TRANSLATION_STATUSES = [
345
+ "draft",
346
+ "in_review",
347
+ "approved",
348
+ "published",
349
+ "outdated"
350
+ ];
351
+
352
+ // src/compliance.ts
353
+ var COMPLIANCE_SCOPES = [
354
+ "audit_log",
355
+ "jobs",
356
+ "webhook_logs",
357
+ "operational_alerts",
358
+ "sso_login_states"
359
+ ];
360
+ var LEGAL_HOLD_KINDS = [
361
+ "scope",
362
+ "tenant",
363
+ "content_type",
364
+ "entity",
365
+ "subject"
366
+ ];
367
+ var DATA_CLASSIFICATIONS = [
368
+ "public",
369
+ "internal",
370
+ "confidential",
371
+ "restricted"
372
+ ];
373
+ var GovernanceViolationError = class extends Error {
374
+ constructor(message, tenantId, rule, details) {
375
+ super(message);
376
+ this.tenantId = tenantId;
377
+ this.rule = rule;
378
+ this.details = details;
379
+ this.name = "GovernanceViolationError";
380
+ }
381
+ };
382
+
383
+ // src/ai-automation-advisor.ts
384
+ var DEFAULT_AUTOMATION_THRESHOLDS = {
385
+ abandonedDraftDays: 30,
386
+ staleContentDays: 365,
387
+ workflowStuckDays: 7,
388
+ orphanMediaDays: 30,
389
+ bulkRecommendationMinCount: 5
390
+ };
391
+
392
+ // src/ai-guardrails.ts
393
+ var DEFAULT_AI_GUARDRAILS = {
394
+ perActorMaxCalls: 30,
395
+ windowSeconds: 60,
396
+ maxBodyBytes: 64 * 1024,
397
+ auditEveryCall: true,
398
+ ledgerTtlSeconds: 7 * 24 * 60 * 60
399
+ };
205
400
  // Annotate the CommonJS export names for ESM import in node:
206
401
  0 && (module.exports = {
402
+ ACTIVITY_ACTION_CATEGORY,
403
+ ACTIVITY_EXCLUDED_ACTIONS,
404
+ ACTIVITY_FEED_ACTIONS,
405
+ COMPLIANCE_SCOPES,
406
+ DATA_CLASSIFICATIONS,
407
+ DEFAULT_AI_GUARDRAILS,
408
+ DEFAULT_AUTOMATION_THRESHOLDS,
409
+ DEFAULT_WORKFLOW,
410
+ EXTENSION_PRECEDENCE,
411
+ GovernanceViolationError,
412
+ LEGAL_HOLD_KINDS,
413
+ RESERVED_EXTENSION_PLUGIN_NAMES,
207
414
  SchemaValidationError,
415
+ TRANSLATION_STATUSES,
416
+ classifyPluginSource,
208
417
  defineAdminMiddleware,
209
418
  defineContentMiddleware,
419
+ definePlugin,
420
+ definePluginFactory,
210
421
  defineSystemMiddleware,
422
+ defineTheme,
211
423
  exampleBlockComponent,
212
424
  exampleComponentSchema,
213
425
  exampleSchema