@dyrected/core 2.12.0 → 2.13.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/access-P6Z2XAFS.js +10 -0
- package/dist/ai-X3M2SE5A.js +17 -0
- package/dist/ai-tools-UPKJY3TX.js +14 -0
- package/dist/{app-config-C6hYM8WO.d.cts → app-D_ODsBWA.d.cts} +470 -2
- package/dist/{app-config-C6hYM8WO.d.ts → app-D_ODsBWA.d.ts} +470 -2
- package/dist/chunk-254THFDS.js +202 -0
- package/dist/chunk-27YRIGK5.js +1758 -0
- package/dist/chunk-4RAQJVJM.js +18 -0
- package/dist/{chunk-VOE2LOLF.js → chunk-DZMBVIMN.js} +265 -1760
- package/dist/chunk-HRRJ3RYT.js +70 -0
- package/dist/chunk-W7GKJM2X.js +1136 -0
- package/dist/chunk-ZYYDTHF3.js +635 -0
- package/dist/index.cjs +501 -525
- package/dist/index.d.cts +80 -4
- package/dist/index.d.ts +80 -4
- package/dist/index.js +41 -2
- package/dist/rag.service-YDGEYTXS.js +11 -0
- package/dist/server.cjs +4971 -1388
- package/dist/server.d.cts +358 -328
- package/dist/server.d.ts +358 -328
- package/dist/server.js +2035 -262
- package/package.json +12 -9
- package/LICENSE.md +0 -50
- package/dist/chunk-FRSJJO27.js +0 -519
- package/dist/observability-HQF4EUSV.js +0 -35
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as
|
|
2
|
-
export {
|
|
1
|
+
import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as DyrectedContext, K as AIConfig, M as AIPIIConfig, N as ArrayField, O as BlocksField, Q as BooleanField, R as AuthConfig, S as AccessPolicyResolver, T as DateField, U as DateTimeField, V as EmailField, X as IconField, Y as ImageField, Z as JoinField, _ as JsonField, $ as MultiSelectField, a0 as NumberField, a1 as ObjectField, a2 as RadioField, a3 as RelationshipField, a4 as RichTextField, a5 as RowField, a6 as SelectField, a7 as TextField, a8 as TextareaField, a9 as TimeField, aa as UrlField } from './app-D_ODsBWA.cjs';
|
|
2
|
+
export { ab as AIAction, ac as AIActionStatus, ad as AIActionType, ae as AIAuditActionType, af as AIAuditRecord, ag as AIChunk, ah as AIMessage, ai as AIPIIPattern, aj as AIRateLimitResult, ak as AIRateLimitStore, al as AIThread, am as AIToolContext, an as AIToolDefinition, ao as AI_ACTIONS_COLLECTION, ap as AI_AUDIT_COLLECTION, aq as AI_CHUNKS_COLLECTION, ar as AI_MESSAGES_COLLECTION, as as AI_THREADS_COLLECTION, at as AccessConfig, au as AccessFunction, av as AccessFunctionArgs, aw as AccessResult, ax as AccessRule, ay as ActionConfig, az as ActionContext, aA as ActionType, aB as AdminAuthAccessResolution, aC as AdminAuthClaimMapping, aD as AdminAuthMember, aE as AdminAuthProvider, aF as AdminAuthProviderMembersConfig, aG as AdminAuthProvisioningMode, aH as AdminAuthResolveAccessArgs, aI as AdminAuthResolvedIdentity, aJ as AdminConfig, aK as AdminDashboardComponentSlots, aL as AdminIconName, aM as AggregateArgs, aN as AggregateCastType, aO as AggregateCollectionResult, aP as AggregateInput, aQ as AggregateOperation, aR as AggregateResult, aS as BaseAdminAuthProvider, aT as BaseFieldAdmin, aU as BlockVariant, aV as BooleanFieldAdmin, aW as BooleanFormat, aX as CharacterLimitFieldAdmin, aY as CharacterLimitFieldConfig, aZ as CollectionAfterChangeHook, a_ as CollectionAfterDeleteHook, a$ as CollectionAfterReadHook, b0 as CollectionAfterReadHookEntry, b1 as CollectionAfterTransitionHook, b2 as CollectionBeforeChangeHook, b3 as CollectionBeforeChangeHookEntry, b4 as CollectionBeforeDeleteHook, b5 as CollectionBeforeReadHook, b6 as CollectionBeforeReadHookEntry, b7 as CollectionBeforeTransitionHook, b8 as CollectionListComponentSlots, b9 as CollectionRAGConfig, ba as CollectionSchemaResult, bb as CollectionSummaryResult, bc as CollectionViewComponentSlots, bd as CountOperation, be as CustomAdminAuthProvider, bf as DatabaseAdapter, bg as DateFieldAdmin, bh as DateFormat, bi as DefineActionOptions, bj as DefineViewOptions, bk as DetailSpan, bl as DisplayTone, bm as DisplayVariant, bn as DistinctCountOperation, bo as DistinctValuesOperation, bp as DynamicOptionItem, bq as DynamicOptionsConfig, br as DynamicOptionsResolver, bs as DynamicOptionsResolverArgs, bt as DyrectedAIContext, bu as DyrectedLoggerConfig, bv as DyrectedObservabilityConfig, bw as EmailFieldAdmin, bx as FieldAdminHooks, by as FieldAdminOnChangeHook, bz as FieldAdminOnChangeHookArgs, bA as FieldAdminOptionsHook, bB as FieldAdminOptionsHookArgs, bC as FieldAdminOptionsHookResult, bD as FieldAfterReadHook, bE as FieldAfterReadHookArgs, bF as FieldBase, bG as FieldBeforeChangeHook, bH as FieldBeforeChangeHookArgs, bI as FieldHook, bJ as FieldHooks, bK as FieldType, bL as FileData, bM as GetDocumentResult, bN as GlobalAfterChangeHook, bO as GlobalAfterReadHook, bP as GlobalAfterReadHookEntry, bQ as GlobalBeforeChangeHook, bR as GlobalBeforeChangeHookEntry, bS as GlobalBeforeReadHook, bT as GlobalBeforeReadHookEntry, bU as GlobalRAGConfig, bV as GlobalSchemaResult, bW as GlobalSummaryResult, bX as HeadingLevel, bY as HookFunction, bZ as IconFieldAdmin, b_ as ImageService, b$ as ImageTransformOptions, c0 as InferAggregateResult, c1 as JoinFieldAdmin, c2 as JsonFieldAdmin, c3 as JsonFormat, c4 as LIFECYCLE_EVENT_NAMES, c5 as LifecycleEventHandler, c6 as LinkFormat, c7 as MetricColor, c8 as MultiSelectFieldAdmin, c9 as NamedAccessPolicy, ca as NumberFieldAdmin, cb as NumberFormat, cc as NumberLimitFieldAdmin, cd as NumberLimitFieldConfig, ce as NumericOperation, cf as OIDCAdminAuthProvider, cg as OptionFormat, ch as PaginatedResult, ci as PublicAdminAuthProvider, cj as QueryCollectionResult, ck as RAGSearchResult, cl as RadioFieldAdmin, cm as RateLimitConfig, cn as ReadonlyDatabaseAdapter, co as RichTextFeature, cp as RichTextFieldConfig, cq as SelectFieldAdmin, cr as SqlWhereResult, cs as StorageAdapter, ct as TextFieldAdmin, cu as TextFormat, cv as TextareaFieldAdmin, cw as TrustProxyConfig, cx as TypedField, cy as UploadConfig, cz as UrlFieldAdmin, cA as UrlLinkValue, cB as ViewActionFeatures, cC as ViewComponentSlots, cD as ViewConfig, cE as ViewLayout, cF as ViewMetric, cG as ViewSubMetric, cH as WhereClause, cI as WhereOperator, cJ as WhereOperatorName, cK as WordLimitFieldAdmin, cL as WordLimitFieldConfig, cM as WorkflowMetadata, cN as WorkflowRole, cO as WorkflowState, cP as WorkflowTransitionContext, cQ as defineAction, cR as defineView, cS as isAICollection, cT as parseMongoWhere, cU as parseSqlWhere } from './app-D_ODsBWA.cjs';
|
|
3
3
|
import jexl from 'jexl';
|
|
4
|
-
import '
|
|
4
|
+
import { Context } from 'hono';
|
|
5
|
+
export { z } from 'zod';
|
|
6
|
+
import 'hono/types';
|
|
5
7
|
import 'pino';
|
|
8
|
+
import 'lucide-react';
|
|
9
|
+
import 'jose';
|
|
10
|
+
import '@opentelemetry/api';
|
|
11
|
+
import '@opentelemetry/exporter-prometheus';
|
|
6
12
|
|
|
7
13
|
type Prettify<T> = {
|
|
8
14
|
[K in keyof T]: T[K];
|
|
@@ -75,6 +81,21 @@ type UploadDocFields = {
|
|
|
75
81
|
}>;
|
|
76
82
|
};
|
|
77
83
|
|
|
84
|
+
type AIErrorCode = 'AI_UNCONFIGURED' | 'AI_RATE_LIMITED' | 'AI_QUOTA_EXHAUSTED' | 'AI_TIMEOUT' | 'AI_TOOL_VALIDATION_ERROR' | 'AI_PERMISSION_DENIED' | 'AI_TENANT_VIOLATION' | 'AI_ACTION_EXPIRED' | 'AI_ACTION_ALREADY_EXECUTED' | 'AI_INTERNAL_ERROR';
|
|
85
|
+
declare class DyrectedAIError extends Error {
|
|
86
|
+
readonly code: AIErrorCode;
|
|
87
|
+
readonly status: number;
|
|
88
|
+
readonly details?: Record<string, unknown>;
|
|
89
|
+
constructor(code: AIErrorCode, message: string, status?: number, details?: Record<string, unknown>);
|
|
90
|
+
toJSON(): {
|
|
91
|
+
error: boolean;
|
|
92
|
+
code: AIErrorCode;
|
|
93
|
+
message: string;
|
|
94
|
+
status: number;
|
|
95
|
+
details: Record<string, unknown> | undefined;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
/**
|
|
79
100
|
* Normalizes the Dyrected configuration by injecting system fields
|
|
80
101
|
* (createdAt, updatedAt, createdBy, updatedBy) into every collection and
|
|
@@ -1143,6 +1164,61 @@ declare const expr: ExprFunction;
|
|
|
1143
1164
|
*/
|
|
1144
1165
|
declare const when: ExprFunction;
|
|
1145
1166
|
|
|
1167
|
+
/**
|
|
1168
|
+
* Extracts the list of allowed site IDs for a given authenticated user or token payload.
|
|
1169
|
+
* Checks common tenant membership properties: `allowedSites`, `siteIds`, `siteAccess`, and singular `siteId`.
|
|
1170
|
+
*/
|
|
1171
|
+
declare function getAllowedSitesForUser(user?: Record<string, unknown> | null, payload?: Record<string, unknown> | null): string[] | undefined;
|
|
1172
|
+
/**
|
|
1173
|
+
* Checks whether an authenticated user is permitted to access a given site ID.
|
|
1174
|
+
* If the user has no tenant restrictions configured, access is unrestricted (returns true).
|
|
1175
|
+
*/
|
|
1176
|
+
declare function isSiteAuthorized(user: Record<string, unknown> | null | undefined, payload: Record<string, unknown> | null | undefined, requestedSiteId: string | undefined): boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* Resolves the authorized site ID for the current request.
|
|
1179
|
+
* Prioritizes `c.get("siteId")` (set upstream) and `X-Site-Id` header.
|
|
1180
|
+
* Enforces that restricted users cannot spoof or access unauthorized site IDs.
|
|
1181
|
+
*
|
|
1182
|
+
* @throws HTTPException(403) if the user is not authorized for the requested site.
|
|
1183
|
+
*/
|
|
1184
|
+
declare function resolveAuthorizedSiteId(c: Context<DyrectedContext>): string;
|
|
1185
|
+
|
|
1186
|
+
declare const NON_NEGOTIABLE_CREDENTIAL_FIELDS: Set<string>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Masks an email address to protect privacy (e.g. "john.doe@example.com" -> "j***@example.com").
|
|
1189
|
+
*/
|
|
1190
|
+
declare function maskEmail(email: string, strategy?: "mask" | "token"): string;
|
|
1191
|
+
/**
|
|
1192
|
+
* Masks a phone number (e.g. "+1 555-234-5678" -> "+1 ***-***-5678").
|
|
1193
|
+
*/
|
|
1194
|
+
declare function maskPhone(phone: string, strategy?: "mask" | "token"): string;
|
|
1195
|
+
/**
|
|
1196
|
+
* High-performance regex patterns for common PII.
|
|
1197
|
+
*/
|
|
1198
|
+
declare const PII_REGEX_PATTERNS: Record<string, RegExp>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Scrubs unstructured free text using configured regex patterns and custom scrubbers.
|
|
1201
|
+
*/
|
|
1202
|
+
declare function maskTextPII(text: string, piiConfig?: AIPIIConfig): string;
|
|
1203
|
+
interface SanitizeDocForAIOptions {
|
|
1204
|
+
doc: Record<string, unknown>;
|
|
1205
|
+
collectionConfig?: CollectionConfig;
|
|
1206
|
+
globalAIConfig?: AIConfig;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Deterministically sanitizes a CMS document before sending it to an AI assistant or RAG pipeline:
|
|
1210
|
+
* 1. Non-negotiably strips passwords, secrets, hashes, and session tokens.
|
|
1211
|
+
* 2. Strips collection-level `excludeFields`.
|
|
1212
|
+
* 3. Applies field-level definitions:
|
|
1213
|
+
* - Automatically masks `email` and `phone` by default (opt-out privacy) unless `ai: { allowRaw: true }`.
|
|
1214
|
+
* - Strips fields configured with `ai: { exclude: true }`.
|
|
1215
|
+
* - Masks fields configured with `ai: { redact: true }`.
|
|
1216
|
+
* 4. Applies collection-level `redactFields`.
|
|
1217
|
+
* 5. Calls custom programmatic `collectionConfig.ai.sanitizeDoc` hook if provided.
|
|
1218
|
+
* 6. Scrubs unstructured text across string fields if `config.ai.pii.enabled === true`.
|
|
1219
|
+
*/
|
|
1220
|
+
declare function sanitizeDocForAI(options: SanitizeDocForAIOptions): Record<string, unknown>;
|
|
1221
|
+
|
|
1146
1222
|
type TopLevelFieldName<TFields extends readonly Field[]> = Extract<TFields[number], {
|
|
1147
1223
|
name: string;
|
|
1148
1224
|
}>["name"];
|
|
@@ -1562,4 +1638,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
|
|
|
1562
1638
|
fields: T;
|
|
1563
1639
|
}): T;
|
|
1564
1640
|
|
|
1565
|
-
export { type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedConfig, EmailField, type ExprFunction, Field, FieldConditionBuilder, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, expr, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };
|
|
1641
|
+
export { AIConfig, type AIErrorCode, AIPIIConfig, type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedAIError, DyrectedConfig, EmailField, type ExprFunction, Field, FieldConditionBuilder, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NON_NEGOTIABLE_CREDENTIAL_FIELDS, NumberField, ObjectField, PII_REGEX_PATTERNS, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, type SanitizeDocForAIOptions, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, expr, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getAllowedSitesForUser, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, isSiteAuthorized, join, last, length, lower, maskEmail, maskPhone, maskTextPII, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, resolveAuthorizedSiteId, round, runCollectionHooks, sanitizeDocForAI, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as
|
|
2
|
-
export {
|
|
1
|
+
import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as DyrectedContext, K as AIConfig, M as AIPIIConfig, N as ArrayField, O as BlocksField, Q as BooleanField, R as AuthConfig, S as AccessPolicyResolver, T as DateField, U as DateTimeField, V as EmailField, X as IconField, Y as ImageField, Z as JoinField, _ as JsonField, $ as MultiSelectField, a0 as NumberField, a1 as ObjectField, a2 as RadioField, a3 as RelationshipField, a4 as RichTextField, a5 as RowField, a6 as SelectField, a7 as TextField, a8 as TextareaField, a9 as TimeField, aa as UrlField } from './app-D_ODsBWA.js';
|
|
2
|
+
export { ab as AIAction, ac as AIActionStatus, ad as AIActionType, ae as AIAuditActionType, af as AIAuditRecord, ag as AIChunk, ah as AIMessage, ai as AIPIIPattern, aj as AIRateLimitResult, ak as AIRateLimitStore, al as AIThread, am as AIToolContext, an as AIToolDefinition, ao as AI_ACTIONS_COLLECTION, ap as AI_AUDIT_COLLECTION, aq as AI_CHUNKS_COLLECTION, ar as AI_MESSAGES_COLLECTION, as as AI_THREADS_COLLECTION, at as AccessConfig, au as AccessFunction, av as AccessFunctionArgs, aw as AccessResult, ax as AccessRule, ay as ActionConfig, az as ActionContext, aA as ActionType, aB as AdminAuthAccessResolution, aC as AdminAuthClaimMapping, aD as AdminAuthMember, aE as AdminAuthProvider, aF as AdminAuthProviderMembersConfig, aG as AdminAuthProvisioningMode, aH as AdminAuthResolveAccessArgs, aI as AdminAuthResolvedIdentity, aJ as AdminConfig, aK as AdminDashboardComponentSlots, aL as AdminIconName, aM as AggregateArgs, aN as AggregateCastType, aO as AggregateCollectionResult, aP as AggregateInput, aQ as AggregateOperation, aR as AggregateResult, aS as BaseAdminAuthProvider, aT as BaseFieldAdmin, aU as BlockVariant, aV as BooleanFieldAdmin, aW as BooleanFormat, aX as CharacterLimitFieldAdmin, aY as CharacterLimitFieldConfig, aZ as CollectionAfterChangeHook, a_ as CollectionAfterDeleteHook, a$ as CollectionAfterReadHook, b0 as CollectionAfterReadHookEntry, b1 as CollectionAfterTransitionHook, b2 as CollectionBeforeChangeHook, b3 as CollectionBeforeChangeHookEntry, b4 as CollectionBeforeDeleteHook, b5 as CollectionBeforeReadHook, b6 as CollectionBeforeReadHookEntry, b7 as CollectionBeforeTransitionHook, b8 as CollectionListComponentSlots, b9 as CollectionRAGConfig, ba as CollectionSchemaResult, bb as CollectionSummaryResult, bc as CollectionViewComponentSlots, bd as CountOperation, be as CustomAdminAuthProvider, bf as DatabaseAdapter, bg as DateFieldAdmin, bh as DateFormat, bi as DefineActionOptions, bj as DefineViewOptions, bk as DetailSpan, bl as DisplayTone, bm as DisplayVariant, bn as DistinctCountOperation, bo as DistinctValuesOperation, bp as DynamicOptionItem, bq as DynamicOptionsConfig, br as DynamicOptionsResolver, bs as DynamicOptionsResolverArgs, bt as DyrectedAIContext, bu as DyrectedLoggerConfig, bv as DyrectedObservabilityConfig, bw as EmailFieldAdmin, bx as FieldAdminHooks, by as FieldAdminOnChangeHook, bz as FieldAdminOnChangeHookArgs, bA as FieldAdminOptionsHook, bB as FieldAdminOptionsHookArgs, bC as FieldAdminOptionsHookResult, bD as FieldAfterReadHook, bE as FieldAfterReadHookArgs, bF as FieldBase, bG as FieldBeforeChangeHook, bH as FieldBeforeChangeHookArgs, bI as FieldHook, bJ as FieldHooks, bK as FieldType, bL as FileData, bM as GetDocumentResult, bN as GlobalAfterChangeHook, bO as GlobalAfterReadHook, bP as GlobalAfterReadHookEntry, bQ as GlobalBeforeChangeHook, bR as GlobalBeforeChangeHookEntry, bS as GlobalBeforeReadHook, bT as GlobalBeforeReadHookEntry, bU as GlobalRAGConfig, bV as GlobalSchemaResult, bW as GlobalSummaryResult, bX as HeadingLevel, bY as HookFunction, bZ as IconFieldAdmin, b_ as ImageService, b$ as ImageTransformOptions, c0 as InferAggregateResult, c1 as JoinFieldAdmin, c2 as JsonFieldAdmin, c3 as JsonFormat, c4 as LIFECYCLE_EVENT_NAMES, c5 as LifecycleEventHandler, c6 as LinkFormat, c7 as MetricColor, c8 as MultiSelectFieldAdmin, c9 as NamedAccessPolicy, ca as NumberFieldAdmin, cb as NumberFormat, cc as NumberLimitFieldAdmin, cd as NumberLimitFieldConfig, ce as NumericOperation, cf as OIDCAdminAuthProvider, cg as OptionFormat, ch as PaginatedResult, ci as PublicAdminAuthProvider, cj as QueryCollectionResult, ck as RAGSearchResult, cl as RadioFieldAdmin, cm as RateLimitConfig, cn as ReadonlyDatabaseAdapter, co as RichTextFeature, cp as RichTextFieldConfig, cq as SelectFieldAdmin, cr as SqlWhereResult, cs as StorageAdapter, ct as TextFieldAdmin, cu as TextFormat, cv as TextareaFieldAdmin, cw as TrustProxyConfig, cx as TypedField, cy as UploadConfig, cz as UrlFieldAdmin, cA as UrlLinkValue, cB as ViewActionFeatures, cC as ViewComponentSlots, cD as ViewConfig, cE as ViewLayout, cF as ViewMetric, cG as ViewSubMetric, cH as WhereClause, cI as WhereOperator, cJ as WhereOperatorName, cK as WordLimitFieldAdmin, cL as WordLimitFieldConfig, cM as WorkflowMetadata, cN as WorkflowRole, cO as WorkflowState, cP as WorkflowTransitionContext, cQ as defineAction, cR as defineView, cS as isAICollection, cT as parseMongoWhere, cU as parseSqlWhere } from './app-D_ODsBWA.js';
|
|
3
3
|
import jexl from 'jexl';
|
|
4
|
-
import '
|
|
4
|
+
import { Context } from 'hono';
|
|
5
|
+
export { z } from 'zod';
|
|
6
|
+
import 'hono/types';
|
|
5
7
|
import 'pino';
|
|
8
|
+
import 'lucide-react';
|
|
9
|
+
import 'jose';
|
|
10
|
+
import '@opentelemetry/api';
|
|
11
|
+
import '@opentelemetry/exporter-prometheus';
|
|
6
12
|
|
|
7
13
|
type Prettify<T> = {
|
|
8
14
|
[K in keyof T]: T[K];
|
|
@@ -75,6 +81,21 @@ type UploadDocFields = {
|
|
|
75
81
|
}>;
|
|
76
82
|
};
|
|
77
83
|
|
|
84
|
+
type AIErrorCode = 'AI_UNCONFIGURED' | 'AI_RATE_LIMITED' | 'AI_QUOTA_EXHAUSTED' | 'AI_TIMEOUT' | 'AI_TOOL_VALIDATION_ERROR' | 'AI_PERMISSION_DENIED' | 'AI_TENANT_VIOLATION' | 'AI_ACTION_EXPIRED' | 'AI_ACTION_ALREADY_EXECUTED' | 'AI_INTERNAL_ERROR';
|
|
85
|
+
declare class DyrectedAIError extends Error {
|
|
86
|
+
readonly code: AIErrorCode;
|
|
87
|
+
readonly status: number;
|
|
88
|
+
readonly details?: Record<string, unknown>;
|
|
89
|
+
constructor(code: AIErrorCode, message: string, status?: number, details?: Record<string, unknown>);
|
|
90
|
+
toJSON(): {
|
|
91
|
+
error: boolean;
|
|
92
|
+
code: AIErrorCode;
|
|
93
|
+
message: string;
|
|
94
|
+
status: number;
|
|
95
|
+
details: Record<string, unknown> | undefined;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
/**
|
|
79
100
|
* Normalizes the Dyrected configuration by injecting system fields
|
|
80
101
|
* (createdAt, updatedAt, createdBy, updatedBy) into every collection and
|
|
@@ -1143,6 +1164,61 @@ declare const expr: ExprFunction;
|
|
|
1143
1164
|
*/
|
|
1144
1165
|
declare const when: ExprFunction;
|
|
1145
1166
|
|
|
1167
|
+
/**
|
|
1168
|
+
* Extracts the list of allowed site IDs for a given authenticated user or token payload.
|
|
1169
|
+
* Checks common tenant membership properties: `allowedSites`, `siteIds`, `siteAccess`, and singular `siteId`.
|
|
1170
|
+
*/
|
|
1171
|
+
declare function getAllowedSitesForUser(user?: Record<string, unknown> | null, payload?: Record<string, unknown> | null): string[] | undefined;
|
|
1172
|
+
/**
|
|
1173
|
+
* Checks whether an authenticated user is permitted to access a given site ID.
|
|
1174
|
+
* If the user has no tenant restrictions configured, access is unrestricted (returns true).
|
|
1175
|
+
*/
|
|
1176
|
+
declare function isSiteAuthorized(user: Record<string, unknown> | null | undefined, payload: Record<string, unknown> | null | undefined, requestedSiteId: string | undefined): boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* Resolves the authorized site ID for the current request.
|
|
1179
|
+
* Prioritizes `c.get("siteId")` (set upstream) and `X-Site-Id` header.
|
|
1180
|
+
* Enforces that restricted users cannot spoof or access unauthorized site IDs.
|
|
1181
|
+
*
|
|
1182
|
+
* @throws HTTPException(403) if the user is not authorized for the requested site.
|
|
1183
|
+
*/
|
|
1184
|
+
declare function resolveAuthorizedSiteId(c: Context<DyrectedContext>): string;
|
|
1185
|
+
|
|
1186
|
+
declare const NON_NEGOTIABLE_CREDENTIAL_FIELDS: Set<string>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Masks an email address to protect privacy (e.g. "john.doe@example.com" -> "j***@example.com").
|
|
1189
|
+
*/
|
|
1190
|
+
declare function maskEmail(email: string, strategy?: "mask" | "token"): string;
|
|
1191
|
+
/**
|
|
1192
|
+
* Masks a phone number (e.g. "+1 555-234-5678" -> "+1 ***-***-5678").
|
|
1193
|
+
*/
|
|
1194
|
+
declare function maskPhone(phone: string, strategy?: "mask" | "token"): string;
|
|
1195
|
+
/**
|
|
1196
|
+
* High-performance regex patterns for common PII.
|
|
1197
|
+
*/
|
|
1198
|
+
declare const PII_REGEX_PATTERNS: Record<string, RegExp>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Scrubs unstructured free text using configured regex patterns and custom scrubbers.
|
|
1201
|
+
*/
|
|
1202
|
+
declare function maskTextPII(text: string, piiConfig?: AIPIIConfig): string;
|
|
1203
|
+
interface SanitizeDocForAIOptions {
|
|
1204
|
+
doc: Record<string, unknown>;
|
|
1205
|
+
collectionConfig?: CollectionConfig;
|
|
1206
|
+
globalAIConfig?: AIConfig;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Deterministically sanitizes a CMS document before sending it to an AI assistant or RAG pipeline:
|
|
1210
|
+
* 1. Non-negotiably strips passwords, secrets, hashes, and session tokens.
|
|
1211
|
+
* 2. Strips collection-level `excludeFields`.
|
|
1212
|
+
* 3. Applies field-level definitions:
|
|
1213
|
+
* - Automatically masks `email` and `phone` by default (opt-out privacy) unless `ai: { allowRaw: true }`.
|
|
1214
|
+
* - Strips fields configured with `ai: { exclude: true }`.
|
|
1215
|
+
* - Masks fields configured with `ai: { redact: true }`.
|
|
1216
|
+
* 4. Applies collection-level `redactFields`.
|
|
1217
|
+
* 5. Calls custom programmatic `collectionConfig.ai.sanitizeDoc` hook if provided.
|
|
1218
|
+
* 6. Scrubs unstructured text across string fields if `config.ai.pii.enabled === true`.
|
|
1219
|
+
*/
|
|
1220
|
+
declare function sanitizeDocForAI(options: SanitizeDocForAIOptions): Record<string, unknown>;
|
|
1221
|
+
|
|
1146
1222
|
type TopLevelFieldName<TFields extends readonly Field[]> = Extract<TFields[number], {
|
|
1147
1223
|
name: string;
|
|
1148
1224
|
}>["name"];
|
|
@@ -1562,4 +1638,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
|
|
|
1562
1638
|
fields: T;
|
|
1563
1639
|
}): T;
|
|
1564
1640
|
|
|
1565
|
-
export { type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedConfig, EmailField, type ExprFunction, Field, FieldConditionBuilder, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, expr, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };
|
|
1641
|
+
export { AIConfig, type AIErrorCode, AIPIIConfig, type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedAIError, DyrectedConfig, EmailField, type ExprFunction, Field, FieldConditionBuilder, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NON_NEGOTIABLE_CREDENTIAL_FIELDS, NumberField, ObjectField, PII_REGEX_PATTERNS, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, type SanitizeDocForAIOptions, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, expr, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getAllowedSitesForUser, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, isSiteAuthorized, join, last, length, lower, maskEmail, maskPhone, maskTextPII, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, resolveAuthorizedSiteId, round, runCollectionHooks, sanitizeDocForAI, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BUILTIN_JEXL_HELPERS,
|
|
3
3
|
ConfigValidationError,
|
|
4
|
+
DyrectedAIError,
|
|
4
5
|
LIFECYCLE_EVENTS_COLLECTION,
|
|
5
6
|
WORKFLOW_HISTORY_COLLECTION,
|
|
6
7
|
abs,
|
|
@@ -56,6 +57,7 @@ import {
|
|
|
56
57
|
generateOpenApi,
|
|
57
58
|
get,
|
|
58
59
|
getAdminAuthCollection,
|
|
60
|
+
getAllowedSitesForUser,
|
|
59
61
|
getPublicAdminAuthConfig,
|
|
60
62
|
includes,
|
|
61
63
|
initializeWorkflowDocument,
|
|
@@ -64,6 +66,7 @@ import {
|
|
|
64
66
|
isEmpty,
|
|
65
67
|
isFuture,
|
|
66
68
|
isPast,
|
|
69
|
+
isSiteAuthorized,
|
|
67
70
|
join,
|
|
68
71
|
last,
|
|
69
72
|
length,
|
|
@@ -81,6 +84,7 @@ import {
|
|
|
81
84
|
registerJexlHelpers,
|
|
82
85
|
replace,
|
|
83
86
|
resolveAdminAuthCollection,
|
|
87
|
+
resolveAuthorizedSiteId,
|
|
84
88
|
round,
|
|
85
89
|
runCollectionHooks,
|
|
86
90
|
saveWorkflowDraft,
|
|
@@ -101,7 +105,24 @@ import {
|
|
|
101
105
|
validatePreviewUrlExpression,
|
|
102
106
|
wordCount,
|
|
103
107
|
workflowCapabilities
|
|
104
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-DZMBVIMN.js";
|
|
109
|
+
import {
|
|
110
|
+
NON_NEGOTIABLE_CREDENTIAL_FIELDS,
|
|
111
|
+
PII_REGEX_PATTERNS,
|
|
112
|
+
maskEmail,
|
|
113
|
+
maskPhone,
|
|
114
|
+
maskTextPII,
|
|
115
|
+
sanitizeDocForAI
|
|
116
|
+
} from "./chunk-254THFDS.js";
|
|
117
|
+
import {
|
|
118
|
+
AI_ACTIONS_COLLECTION,
|
|
119
|
+
AI_AUDIT_COLLECTION,
|
|
120
|
+
AI_CHUNKS_COLLECTION,
|
|
121
|
+
AI_MESSAGES_COLLECTION,
|
|
122
|
+
AI_THREADS_COLLECTION,
|
|
123
|
+
isAICollection
|
|
124
|
+
} from "./chunk-4RAQJVJM.js";
|
|
125
|
+
import "./chunk-27YRIGK5.js";
|
|
105
126
|
import "./chunk-JSBRDJBE.js";
|
|
106
127
|
|
|
107
128
|
// src/types/workflows.ts
|
|
@@ -778,6 +799,7 @@ var expr = createExpr();
|
|
|
778
799
|
var when = expr;
|
|
779
800
|
|
|
780
801
|
// src/index.ts
|
|
802
|
+
import { z } from "zod";
|
|
781
803
|
function defineCollection(config) {
|
|
782
804
|
return config;
|
|
783
805
|
}
|
|
@@ -825,12 +847,20 @@ function defineTab(args) {
|
|
|
825
847
|
}));
|
|
826
848
|
}
|
|
827
849
|
export {
|
|
850
|
+
AI_ACTIONS_COLLECTION,
|
|
851
|
+
AI_AUDIT_COLLECTION,
|
|
852
|
+
AI_CHUNKS_COLLECTION,
|
|
853
|
+
AI_MESSAGES_COLLECTION,
|
|
854
|
+
AI_THREADS_COLLECTION,
|
|
828
855
|
BUILTIN_JEXL_HELPERS,
|
|
829
856
|
ConfigValidationError,
|
|
857
|
+
DyrectedAIError,
|
|
830
858
|
FieldConditionBuilder,
|
|
831
859
|
LIFECYCLE_EVENTS_COLLECTION,
|
|
832
860
|
LIFECYCLE_EVENT_NAMES,
|
|
833
861
|
MatchBuilder,
|
|
862
|
+
NON_NEGOTIABLE_CREDENTIAL_FIELDS,
|
|
863
|
+
PII_REGEX_PATTERNS,
|
|
834
864
|
WORKFLOW_HISTORY_COLLECTION,
|
|
835
865
|
abs,
|
|
836
866
|
addDays,
|
|
@@ -918,18 +948,24 @@ export {
|
|
|
918
948
|
generateOpenApi,
|
|
919
949
|
get,
|
|
920
950
|
getAdminAuthCollection,
|
|
951
|
+
getAllowedSitesForUser,
|
|
921
952
|
getPublicAdminAuthConfig,
|
|
922
953
|
includes,
|
|
923
954
|
initializeWorkflowDocument,
|
|
955
|
+
isAICollection,
|
|
924
956
|
isConfigValidationError,
|
|
925
957
|
isDetailItemVisible,
|
|
926
958
|
isEmpty,
|
|
927
959
|
isFuture,
|
|
928
960
|
isPast,
|
|
961
|
+
isSiteAuthorized,
|
|
929
962
|
join,
|
|
930
963
|
last,
|
|
931
964
|
length,
|
|
932
965
|
lower,
|
|
966
|
+
maskEmail,
|
|
967
|
+
maskPhone,
|
|
968
|
+
maskTextPII,
|
|
933
969
|
materializeWorkflowDocument,
|
|
934
970
|
max,
|
|
935
971
|
min,
|
|
@@ -947,8 +983,10 @@ export {
|
|
|
947
983
|
registerJexlHelpers,
|
|
948
984
|
replace,
|
|
949
985
|
resolveAdminAuthCollection,
|
|
986
|
+
resolveAuthorizedSiteId,
|
|
950
987
|
round,
|
|
951
988
|
runCollectionHooks,
|
|
989
|
+
sanitizeDocForAI,
|
|
952
990
|
saveWorkflowDraft,
|
|
953
991
|
simplePublishingWorkflow,
|
|
954
992
|
slugify,
|
|
@@ -967,5 +1005,6 @@ export {
|
|
|
967
1005
|
validatePreviewUrlExpression,
|
|
968
1006
|
when,
|
|
969
1007
|
wordCount,
|
|
970
|
-
workflowCapabilities
|
|
1008
|
+
workflowCapabilities,
|
|
1009
|
+
z
|
|
971
1010
|
};
|