@dyrected/core 2.6.4 → 2.7.1
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/app-config-ChsrBB7p.d.cts +2100 -0
- package/dist/app-config-ChsrBB7p.d.ts +2100 -0
- package/dist/chunk-2UXLA4YN.js +3139 -0
- package/dist/chunk-5U2WRCNH.js +3140 -0
- package/dist/chunk-AKYYGMFS.js +3365 -0
- package/dist/chunk-EJG6AMYB.js +3537 -0
- package/dist/chunk-FRSJJO27.js +519 -0
- package/dist/chunk-G43REXPX.js +3147 -0
- package/dist/chunk-GFKBPBJJ.js +3637 -0
- package/dist/chunk-LFGSRQLX.js +3568 -0
- package/dist/chunk-NNZRYF3U.js +3537 -0
- package/dist/chunk-PYE2JSY4.js +3568 -0
- package/dist/chunk-QCXLDKZO.js +3272 -0
- package/dist/chunk-UKUEKTAO.js +513 -0
- package/dist/chunk-VM43G3IG.js +506 -0
- package/dist/chunk-VWJKFZQU.js +3139 -0
- package/dist/chunk-YSSHLGQ6.js +3139 -0
- package/dist/chunk-Z7CFUYVP.js +3653 -0
- package/dist/index.cjs +984 -82
- package/dist/index.d.cts +199 -3
- package/dist/index.d.ts +199 -3
- package/dist/index.js +67 -1
- package/dist/observability-CNM4QFE4.js +34 -0
- package/dist/observability-KCMTV7GO.js +34 -0
- package/dist/observability-L5BORBB2.js +34 -0
- package/dist/server.cjs +1268 -888
- package/dist/server.d.cts +28 -3
- package/dist/server.d.ts +28 -3
- package/dist/server.js +38 -33
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 ArrayField, g as BlocksField, h as BooleanField, i as AuthConfig, j as AccessPolicyResolver, k as DateField, l as DateTimeField, E as EmailField, I as IconField, m as ImageField, J as JoinField, n as JsonField, M as MultiSelectField, N as NumberField, O as ObjectField, R as RadioField, o as RelationshipField, p as RichTextField, q as RowField, S as SelectField, T as TextField, r as TextareaField, s as TimeField, U as UrlField } from './app-config-
|
|
2
|
-
export { t as AccessFunction, u as AccessFunctionArgs, v as AccessResult, w as AccessRule, x as AdminAuthAccessResolution, y as AdminAuthClaimMapping, z as AdminAuthMember, K as AdminAuthProvider, Q as AdminAuthProviderMembersConfig, V as AdminAuthProvisioningMode, X as AdminAuthResolveAccessArgs, Y as AdminAuthResolvedIdentity, Z as AdminConfig, _ as AdminDashboardComponentSlots, $ as AdminIconName, a0 as BaseAdminAuthProvider, a1 as BaseFieldAdmin, a2 as BlockVariant, a3 as BooleanFieldAdmin, a4 as BooleanFormat, a5 as CharacterLimitFieldAdmin, a6 as CharacterLimitFieldConfig, a7 as CollectionAfterChangeHook, a8 as CollectionAfterDeleteHook, a9 as CollectionAfterReadHook, aa as CollectionAfterReadHookEntry, ab as CollectionAfterTransitionHook, ac as CollectionBeforeChangeHook, ad as CollectionBeforeChangeHookEntry, ae as CollectionBeforeDeleteHook, af as CollectionBeforeReadHook, ag as CollectionBeforeReadHookEntry, ah as CollectionBeforeTransitionHook, ai as CollectionListComponentSlots, aj as CustomAdminAuthProvider, ak as DatabaseAdapter, al as DateFieldAdmin, am as DateFormat, an as DisplayTone, ao as DynamicOptionItem, ap as DynamicOptionsConfig, aq as DynamicOptionsResolver, ar as DynamicOptionsResolverArgs, as as DyrectedLoggerConfig, at as DyrectedObservabilityConfig, au as EmailFieldAdmin, av as FieldAdminHooks, aw as FieldAdminOnChangeHook, ax as FieldAdminOnChangeHookArgs, ay as FieldAdminOptionsHook, az as FieldAdminOptionsHookArgs, aA as FieldAdminOptionsHookResult, aB as FieldAfterReadHook, aC as FieldAfterReadHookArgs, aD as FieldBase, aE as FieldBeforeChangeHook, aF as FieldBeforeChangeHookArgs, aG as FieldHook, aH as FieldHooks, aI as FieldType, aJ as FileData, aK as GlobalAfterChangeHook, aL as GlobalAfterReadHook, aM as GlobalAfterReadHookEntry, aN as GlobalBeforeChangeHook, aO as GlobalBeforeChangeHookEntry, aP as GlobalBeforeReadHook, aQ as GlobalBeforeReadHookEntry, aR as HeadingLevel, aS as HookFunction, aT as IconFieldAdmin, aU as ImageService, aV as JoinFieldAdmin, aW as JsonFieldAdmin, aX as JsonFormat, aY as LIFECYCLE_EVENT_NAMES, aZ as LifecycleEventHandler, a_ as LinkFormat, a$ as MultiSelectFieldAdmin, b0 as NamedAccessPolicy, b1 as NumberFieldAdmin, b2 as NumberFormat, b3 as NumberLimitFieldAdmin, b4 as NumberLimitFieldConfig, b5 as OIDCAdminAuthProvider, b6 as OptionFormat, b7 as PaginatedResult, b8 as PublicAdminAuthProvider, b9 as RadioFieldAdmin, ba as RateLimitConfig, bb as ReadonlyDatabaseAdapter, bc as RichTextFeature, bd as RichTextFieldConfig, be as SelectFieldAdmin, bf as StorageAdapter, bg as TextFieldAdmin, bh as TextFormat, bi as TextareaFieldAdmin, bj as TrustProxyConfig, bk as TypedField, bl as UploadConfig, bm as UrlFieldAdmin, bn as UrlLinkValue, bo as WordLimitFieldAdmin, bp as WordLimitFieldConfig, bq as WorkflowMetadata, br as WorkflowRole, bs as WorkflowState, bt as WorkflowTransitionContext } from './app-config-
|
|
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 ArrayField, g as BlocksField, h as BooleanField, i as AuthConfig, j as AccessPolicyResolver, k as DateField, l as DateTimeField, E as EmailField, I as IconField, m as ImageField, J as JoinField, n as JsonField, M as MultiSelectField, N as NumberField, O as ObjectField, R as RadioField, o as RelationshipField, p as RichTextField, q as RowField, S as SelectField, T as TextField, r as TextareaField, s as TimeField, U as UrlField } from './app-config-ChsrBB7p.cjs';
|
|
2
|
+
export { t as AccessFunction, u as AccessFunctionArgs, v as AccessResult, w as AccessRule, x as AdminAuthAccessResolution, y as AdminAuthClaimMapping, z as AdminAuthMember, K as AdminAuthProvider, Q as AdminAuthProviderMembersConfig, V as AdminAuthProvisioningMode, X as AdminAuthResolveAccessArgs, Y as AdminAuthResolvedIdentity, Z as AdminConfig, _ as AdminDashboardComponentSlots, $ as AdminIconName, a0 as BaseAdminAuthProvider, a1 as BaseFieldAdmin, a2 as BlockVariant, a3 as BooleanFieldAdmin, a4 as BooleanFormat, a5 as CharacterLimitFieldAdmin, a6 as CharacterLimitFieldConfig, a7 as CollectionAfterChangeHook, a8 as CollectionAfterDeleteHook, a9 as CollectionAfterReadHook, aa as CollectionAfterReadHookEntry, ab as CollectionAfterTransitionHook, ac as CollectionBeforeChangeHook, ad as CollectionBeforeChangeHookEntry, ae as CollectionBeforeDeleteHook, af as CollectionBeforeReadHook, ag as CollectionBeforeReadHookEntry, ah as CollectionBeforeTransitionHook, ai as CollectionListComponentSlots, aj as CustomAdminAuthProvider, ak as DatabaseAdapter, al as DateFieldAdmin, am as DateFormat, an as DisplayTone, ao as DynamicOptionItem, ap as DynamicOptionsConfig, aq as DynamicOptionsResolver, ar as DynamicOptionsResolverArgs, as as DyrectedLoggerConfig, at as DyrectedObservabilityConfig, au as EmailFieldAdmin, av as FieldAdminHooks, aw as FieldAdminOnChangeHook, ax as FieldAdminOnChangeHookArgs, ay as FieldAdminOptionsHook, az as FieldAdminOptionsHookArgs, aA as FieldAdminOptionsHookResult, aB as FieldAfterReadHook, aC as FieldAfterReadHookArgs, aD as FieldBase, aE as FieldBeforeChangeHook, aF as FieldBeforeChangeHookArgs, aG as FieldHook, aH as FieldHooks, aI as FieldType, aJ as FileData, aK as GlobalAfterChangeHook, aL as GlobalAfterReadHook, aM as GlobalAfterReadHookEntry, aN as GlobalBeforeChangeHook, aO as GlobalBeforeChangeHookEntry, aP as GlobalBeforeReadHook, aQ as GlobalBeforeReadHookEntry, aR as HeadingLevel, aS as HookFunction, aT as IconFieldAdmin, aU as ImageService, aV as JoinFieldAdmin, aW as JsonFieldAdmin, aX as JsonFormat, aY as LIFECYCLE_EVENT_NAMES, aZ as LifecycleEventHandler, a_ as LinkFormat, a$ as MultiSelectFieldAdmin, b0 as NamedAccessPolicy, b1 as NumberFieldAdmin, b2 as NumberFormat, b3 as NumberLimitFieldAdmin, b4 as NumberLimitFieldConfig, b5 as OIDCAdminAuthProvider, b6 as OptionFormat, b7 as PaginatedResult, b8 as PublicAdminAuthProvider, b9 as RadioFieldAdmin, ba as RateLimitConfig, bb as ReadonlyDatabaseAdapter, bc as RichTextFeature, bd as RichTextFieldConfig, be as SelectFieldAdmin, bf as StorageAdapter, bg as TextFieldAdmin, bh as TextFormat, bi as TextareaFieldAdmin, bj as TrustProxyConfig, bk as TypedField, bl as UploadConfig, bm as UrlFieldAdmin, bn as UrlLinkValue, bo as WordLimitFieldAdmin, bp as WordLimitFieldConfig, bq as WorkflowMetadata, br as WorkflowRole, bs as WorkflowState, bt as WorkflowTransitionContext } from './app-config-ChsrBB7p.cjs';
|
|
3
|
+
import jexl from 'jexl';
|
|
3
4
|
import 'lucide-react';
|
|
4
5
|
import 'pino';
|
|
5
6
|
|
|
@@ -264,6 +265,201 @@ declare function isConfigValidationError(error: unknown): error is ConfigValidat
|
|
|
264
265
|
declare function assertValidDeclarativeHooksInConfig(config: DeclarativeValidationConfig, source?: string): void;
|
|
265
266
|
declare function assertValidDeclarativeAccessInConfig(config: DeclarativeValidationConfig, source?: string): void;
|
|
266
267
|
|
|
268
|
+
/**
|
|
269
|
+
* Transforms a string into a clean, URL-safe slug.
|
|
270
|
+
* Strips accents, lowercases, removes non-alphanumeric characters, and hyphens whitespace.
|
|
271
|
+
*
|
|
272
|
+
* @example `slugify("Hello World!")` => `"hello-world"`
|
|
273
|
+
*/
|
|
274
|
+
declare function slugify(val: unknown): string;
|
|
275
|
+
/**
|
|
276
|
+
* Converts a string value to lowercase.
|
|
277
|
+
*
|
|
278
|
+
* @example `lower("Dyrected")` => `"dyrected"`
|
|
279
|
+
*/
|
|
280
|
+
declare function lower(val: unknown): string;
|
|
281
|
+
/**
|
|
282
|
+
* Converts a string value to uppercase.
|
|
283
|
+
*
|
|
284
|
+
* @example `upper("dyrected")` => `"DYRECTED"`
|
|
285
|
+
*/
|
|
286
|
+
declare function upper(val: unknown): string;
|
|
287
|
+
/**
|
|
288
|
+
* Trims leading and trailing whitespace from a string.
|
|
289
|
+
*
|
|
290
|
+
* @example `trim(" hello ")` => `"hello"`
|
|
291
|
+
*/
|
|
292
|
+
declare function trim(val: unknown): string;
|
|
293
|
+
/**
|
|
294
|
+
* Capitalizes the first letter of a string and lowercases the rest.
|
|
295
|
+
*
|
|
296
|
+
* @example `capitalize("hELLO")` => `"Hello"`
|
|
297
|
+
*/
|
|
298
|
+
declare function capitalize(val: unknown): string;
|
|
299
|
+
/**
|
|
300
|
+
* Truncates a string to a maximum length and appends an ellipsis.
|
|
301
|
+
*
|
|
302
|
+
* @example `truncate("Long article text...", 10)` => `"Long artic..."`
|
|
303
|
+
*/
|
|
304
|
+
declare function truncate(val: unknown, length: unknown, ellipsis?: string): string;
|
|
305
|
+
/**
|
|
306
|
+
* Calculates estimated reading time in minutes based on word count.
|
|
307
|
+
*
|
|
308
|
+
* @example `readingTime(articleText)` => `3`
|
|
309
|
+
*/
|
|
310
|
+
declare function readingTime(val: unknown, wpm?: number): number;
|
|
311
|
+
/**
|
|
312
|
+
* Returns the word count of a text string.
|
|
313
|
+
*
|
|
314
|
+
* @example `wordCount("Quick brown fox")` => `3`
|
|
315
|
+
*/
|
|
316
|
+
declare function wordCount(val: unknown): number;
|
|
317
|
+
/**
|
|
318
|
+
* Replaces occurrences of a substring or pattern with a replacement string.
|
|
319
|
+
*
|
|
320
|
+
* @example `replace("hello world", "world", "there")` => `"hello there"`
|
|
321
|
+
*/
|
|
322
|
+
declare function replace(val: unknown, search: unknown, replacement: unknown): string;
|
|
323
|
+
/**
|
|
324
|
+
* Checks if a string starts with a given prefix.
|
|
325
|
+
*
|
|
326
|
+
* @example `startsWith("dyrected.com", "dyrected")` => `true`
|
|
327
|
+
*/
|
|
328
|
+
declare function startsWith(str: unknown, prefix: unknown): boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Checks if a string ends with a given suffix.
|
|
331
|
+
*
|
|
332
|
+
* @example `endsWith("image.png", ".png")` => `true`
|
|
333
|
+
*/
|
|
334
|
+
declare function endsWith(str: unknown, suffix: unknown): boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Returns the current date and time as an ISO 8601 string.
|
|
337
|
+
*
|
|
338
|
+
* @example `now()` => `"2026-07-27T00:00:00.000Z"`
|
|
339
|
+
*/
|
|
340
|
+
declare function now(): string;
|
|
341
|
+
/**
|
|
342
|
+
* Returns the current date as a YYYY-MM-DD string.
|
|
343
|
+
*
|
|
344
|
+
* @example `today()` => `"2026-07-27"`
|
|
345
|
+
*/
|
|
346
|
+
declare function today(): string;
|
|
347
|
+
/**
|
|
348
|
+
* Formats a date string, number, or Date instance into a formatted string.
|
|
349
|
+
*
|
|
350
|
+
* @param style `'short'` (default), `'iso'`, `'date'`, `'datetime'`, or `'full'`
|
|
351
|
+
* @example `formatDate("2026-07-27T12:00:00Z", "short")` => `"Jul 27, 2026"`
|
|
352
|
+
*/
|
|
353
|
+
declare function formatDate(val: unknown, style?: unknown): string;
|
|
354
|
+
/**
|
|
355
|
+
* Adds or subtracts a specified number of days to a date.
|
|
356
|
+
*
|
|
357
|
+
* @example `addDays(now(), 7)` => `"2026-08-03T00:00:00.000Z"`
|
|
358
|
+
*/
|
|
359
|
+
declare function addDays(val: unknown, days: unknown): string;
|
|
360
|
+
/**
|
|
361
|
+
* Calculates the integer difference in days between two dates.
|
|
362
|
+
*
|
|
363
|
+
* @example `diffDays("2026-07-27", "2026-07-20")` => `7`
|
|
364
|
+
*/
|
|
365
|
+
declare function diffDays(dateA: unknown, dateB: unknown): number;
|
|
366
|
+
/**
|
|
367
|
+
* Checks if a date is in the past relative to the current timestamp.
|
|
368
|
+
*
|
|
369
|
+
* @example `isPast("2020-01-01")` => `true`
|
|
370
|
+
*/
|
|
371
|
+
declare function isPast(val: unknown): boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Checks if a date is in the future relative to the current timestamp.
|
|
374
|
+
*
|
|
375
|
+
* @example `isFuture("2030-01-01")` => `true`
|
|
376
|
+
*/
|
|
377
|
+
declare function isFuture(val: unknown): boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Checks if an item exists within an array or if a substring exists within a string.
|
|
380
|
+
*
|
|
381
|
+
* @example `includes(["admin", "editor"], "admin")` => `true`
|
|
382
|
+
*/
|
|
383
|
+
declare function includes(arrOrStr: unknown, item: unknown): boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Joins array elements into a string separated by a delimiter.
|
|
386
|
+
*
|
|
387
|
+
* @example `join(["Apple", "Banana"], ", ")` => `"Apple, Banana"`
|
|
388
|
+
*/
|
|
389
|
+
declare function join(arr: unknown, separator?: string): string;
|
|
390
|
+
/**
|
|
391
|
+
* Returns the first item in an array.
|
|
392
|
+
*
|
|
393
|
+
* @example `first(["a", "b", "c"])` => `"a"`
|
|
394
|
+
*/
|
|
395
|
+
declare function first(arr: unknown): unknown;
|
|
396
|
+
/**
|
|
397
|
+
* Returns the last item in an array.
|
|
398
|
+
*
|
|
399
|
+
* @example `last(["a", "b", "c"])` => `"c"`
|
|
400
|
+
*/
|
|
401
|
+
declare function last(arr: unknown): unknown;
|
|
402
|
+
/**
|
|
403
|
+
* Removes null, undefined, and empty string elements from an array.
|
|
404
|
+
*
|
|
405
|
+
* @example `compact(["a", null, "b", ""])` => `["a", "b"]`
|
|
406
|
+
*/
|
|
407
|
+
declare function compact(arr: unknown): unknown[];
|
|
408
|
+
/**
|
|
409
|
+
* Removes duplicate items from an array.
|
|
410
|
+
*
|
|
411
|
+
* @example `unique(["a", "b", "a"])` => `["a", "b"]`
|
|
412
|
+
*/
|
|
413
|
+
declare function unique(arr: unknown): unknown[];
|
|
414
|
+
/**
|
|
415
|
+
* Returns the length of an array, string, or object.
|
|
416
|
+
*
|
|
417
|
+
* @example `length("hello")` => `5`
|
|
418
|
+
*/
|
|
419
|
+
declare function length(val: unknown): number;
|
|
420
|
+
/**
|
|
421
|
+
* Rounds a number to a specified number of decimal places.
|
|
422
|
+
*
|
|
423
|
+
* @example `round(3.14159, 2)` => `3.14`
|
|
424
|
+
*/
|
|
425
|
+
declare function round(val: unknown, decimals?: number): number;
|
|
426
|
+
/**
|
|
427
|
+
* Clamps a number between a minimum and maximum threshold.
|
|
428
|
+
*
|
|
429
|
+
* @example `clamp(150, 0, 100)` => `100`
|
|
430
|
+
*/
|
|
431
|
+
declare function clamp(val: unknown, minVal: unknown, maxVal: unknown): number;
|
|
432
|
+
/**
|
|
433
|
+
* Returns a fallback value if the target value is undefined, null, or an empty string.
|
|
434
|
+
*
|
|
435
|
+
* @example `default(siblingData.title, "Untitled")` => `"Untitled"`
|
|
436
|
+
*/
|
|
437
|
+
declare function defaultValue(val: unknown, fallback: unknown): unknown;
|
|
438
|
+
/**
|
|
439
|
+
* Returns the first non-empty value among the arguments provided.
|
|
440
|
+
*
|
|
441
|
+
* @example `coalesce(null, "", "Fallback")` => `"Fallback"`
|
|
442
|
+
*/
|
|
443
|
+
declare function coalesce(...args: unknown[]): unknown;
|
|
444
|
+
/**
|
|
445
|
+
* Checks if a value is empty (undefined, null, empty string, empty array, or empty object).
|
|
446
|
+
*
|
|
447
|
+
* @example `isEmpty([])` => `true`
|
|
448
|
+
*/
|
|
449
|
+
declare function isEmpty(val: unknown): boolean;
|
|
450
|
+
/**
|
|
451
|
+
* Safely accesses a nested object property by a dot-separated key path.
|
|
452
|
+
*
|
|
453
|
+
* @example `get(siblingData, "author.name", "Guest")` => `"John"`
|
|
454
|
+
*/
|
|
455
|
+
declare function get(obj: unknown, path: unknown, fallback?: unknown): unknown;
|
|
456
|
+
/**
|
|
457
|
+
* Registers all Dyrected built-in helper functions onto a Jexl evaluation instance.
|
|
458
|
+
*/
|
|
459
|
+
declare function registerJexlHelpers(jexlInstance?: typeof jexl): void;
|
|
460
|
+
/** List of all built-in Jexl helper function names for AST validation. */
|
|
461
|
+
declare const BUILTIN_JEXL_HELPERS: readonly ["slugify", "lower", "upper", "trim", "capitalize", "truncate", "readingTime", "wordCount", "replace", "startsWith", "endsWith", "now", "today", "formatDate", "addDays", "diffDays", "isPast", "isFuture", "includes", "join", "first", "last", "compact", "unique", "length", "round", "clamp", "default", "coalesce", "isEmpty", "get"];
|
|
462
|
+
|
|
267
463
|
type AnyHookFn = (args: any) => any;
|
|
268
464
|
type AnyHook = AnyHookFn | DeclarativeHookExpression;
|
|
269
465
|
/**
|
|
@@ -815,4 +1011,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
|
|
|
815
1011
|
fields: T;
|
|
816
1012
|
}): T;
|
|
817
1013
|
|
|
818
|
-
export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, createLifecycleEvent, createWorkflowDocument, 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, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, executeFieldAfterRead, executeFieldBeforeChange, formatConfigDiagnostics, generateOpenApi, getAdminAuthCollection, getPublicAdminAuthConfig, initializeWorkflowDocument, isConfigValidationError, materializeWorkflowDocument, normalizeConfig, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, publishedStateName, publishingWorkflow, resolveAdminAuthCollection, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, transitionWorkflow, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, workflowCapabilities };
|
|
1014
|
+
export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, 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, endsWith, executeFieldAfterRead, executeFieldBeforeChange, first, formatConfigDiagnostics, formatDate, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, normalizeConfig, now, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, startsWith, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, wordCount, workflowCapabilities };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 ArrayField, g as BlocksField, h as BooleanField, i as AuthConfig, j as AccessPolicyResolver, k as DateField, l as DateTimeField, E as EmailField, I as IconField, m as ImageField, J as JoinField, n as JsonField, M as MultiSelectField, N as NumberField, O as ObjectField, R as RadioField, o as RelationshipField, p as RichTextField, q as RowField, S as SelectField, T as TextField, r as TextareaField, s as TimeField, U as UrlField } from './app-config-
|
|
2
|
-
export { t as AccessFunction, u as AccessFunctionArgs, v as AccessResult, w as AccessRule, x as AdminAuthAccessResolution, y as AdminAuthClaimMapping, z as AdminAuthMember, K as AdminAuthProvider, Q as AdminAuthProviderMembersConfig, V as AdminAuthProvisioningMode, X as AdminAuthResolveAccessArgs, Y as AdminAuthResolvedIdentity, Z as AdminConfig, _ as AdminDashboardComponentSlots, $ as AdminIconName, a0 as BaseAdminAuthProvider, a1 as BaseFieldAdmin, a2 as BlockVariant, a3 as BooleanFieldAdmin, a4 as BooleanFormat, a5 as CharacterLimitFieldAdmin, a6 as CharacterLimitFieldConfig, a7 as CollectionAfterChangeHook, a8 as CollectionAfterDeleteHook, a9 as CollectionAfterReadHook, aa as CollectionAfterReadHookEntry, ab as CollectionAfterTransitionHook, ac as CollectionBeforeChangeHook, ad as CollectionBeforeChangeHookEntry, ae as CollectionBeforeDeleteHook, af as CollectionBeforeReadHook, ag as CollectionBeforeReadHookEntry, ah as CollectionBeforeTransitionHook, ai as CollectionListComponentSlots, aj as CustomAdminAuthProvider, ak as DatabaseAdapter, al as DateFieldAdmin, am as DateFormat, an as DisplayTone, ao as DynamicOptionItem, ap as DynamicOptionsConfig, aq as DynamicOptionsResolver, ar as DynamicOptionsResolverArgs, as as DyrectedLoggerConfig, at as DyrectedObservabilityConfig, au as EmailFieldAdmin, av as FieldAdminHooks, aw as FieldAdminOnChangeHook, ax as FieldAdminOnChangeHookArgs, ay as FieldAdminOptionsHook, az as FieldAdminOptionsHookArgs, aA as FieldAdminOptionsHookResult, aB as FieldAfterReadHook, aC as FieldAfterReadHookArgs, aD as FieldBase, aE as FieldBeforeChangeHook, aF as FieldBeforeChangeHookArgs, aG as FieldHook, aH as FieldHooks, aI as FieldType, aJ as FileData, aK as GlobalAfterChangeHook, aL as GlobalAfterReadHook, aM as GlobalAfterReadHookEntry, aN as GlobalBeforeChangeHook, aO as GlobalBeforeChangeHookEntry, aP as GlobalBeforeReadHook, aQ as GlobalBeforeReadHookEntry, aR as HeadingLevel, aS as HookFunction, aT as IconFieldAdmin, aU as ImageService, aV as JoinFieldAdmin, aW as JsonFieldAdmin, aX as JsonFormat, aY as LIFECYCLE_EVENT_NAMES, aZ as LifecycleEventHandler, a_ as LinkFormat, a$ as MultiSelectFieldAdmin, b0 as NamedAccessPolicy, b1 as NumberFieldAdmin, b2 as NumberFormat, b3 as NumberLimitFieldAdmin, b4 as NumberLimitFieldConfig, b5 as OIDCAdminAuthProvider, b6 as OptionFormat, b7 as PaginatedResult, b8 as PublicAdminAuthProvider, b9 as RadioFieldAdmin, ba as RateLimitConfig, bb as ReadonlyDatabaseAdapter, bc as RichTextFeature, bd as RichTextFieldConfig, be as SelectFieldAdmin, bf as StorageAdapter, bg as TextFieldAdmin, bh as TextFormat, bi as TextareaFieldAdmin, bj as TrustProxyConfig, bk as TypedField, bl as UploadConfig, bm as UrlFieldAdmin, bn as UrlLinkValue, bo as WordLimitFieldAdmin, bp as WordLimitFieldConfig, bq as WorkflowMetadata, br as WorkflowRole, bs as WorkflowState, bt as WorkflowTransitionContext } from './app-config-
|
|
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 ArrayField, g as BlocksField, h as BooleanField, i as AuthConfig, j as AccessPolicyResolver, k as DateField, l as DateTimeField, E as EmailField, I as IconField, m as ImageField, J as JoinField, n as JsonField, M as MultiSelectField, N as NumberField, O as ObjectField, R as RadioField, o as RelationshipField, p as RichTextField, q as RowField, S as SelectField, T as TextField, r as TextareaField, s as TimeField, U as UrlField } from './app-config-ChsrBB7p.js';
|
|
2
|
+
export { t as AccessFunction, u as AccessFunctionArgs, v as AccessResult, w as AccessRule, x as AdminAuthAccessResolution, y as AdminAuthClaimMapping, z as AdminAuthMember, K as AdminAuthProvider, Q as AdminAuthProviderMembersConfig, V as AdminAuthProvisioningMode, X as AdminAuthResolveAccessArgs, Y as AdminAuthResolvedIdentity, Z as AdminConfig, _ as AdminDashboardComponentSlots, $ as AdminIconName, a0 as BaseAdminAuthProvider, a1 as BaseFieldAdmin, a2 as BlockVariant, a3 as BooleanFieldAdmin, a4 as BooleanFormat, a5 as CharacterLimitFieldAdmin, a6 as CharacterLimitFieldConfig, a7 as CollectionAfterChangeHook, a8 as CollectionAfterDeleteHook, a9 as CollectionAfterReadHook, aa as CollectionAfterReadHookEntry, ab as CollectionAfterTransitionHook, ac as CollectionBeforeChangeHook, ad as CollectionBeforeChangeHookEntry, ae as CollectionBeforeDeleteHook, af as CollectionBeforeReadHook, ag as CollectionBeforeReadHookEntry, ah as CollectionBeforeTransitionHook, ai as CollectionListComponentSlots, aj as CustomAdminAuthProvider, ak as DatabaseAdapter, al as DateFieldAdmin, am as DateFormat, an as DisplayTone, ao as DynamicOptionItem, ap as DynamicOptionsConfig, aq as DynamicOptionsResolver, ar as DynamicOptionsResolverArgs, as as DyrectedLoggerConfig, at as DyrectedObservabilityConfig, au as EmailFieldAdmin, av as FieldAdminHooks, aw as FieldAdminOnChangeHook, ax as FieldAdminOnChangeHookArgs, ay as FieldAdminOptionsHook, az as FieldAdminOptionsHookArgs, aA as FieldAdminOptionsHookResult, aB as FieldAfterReadHook, aC as FieldAfterReadHookArgs, aD as FieldBase, aE as FieldBeforeChangeHook, aF as FieldBeforeChangeHookArgs, aG as FieldHook, aH as FieldHooks, aI as FieldType, aJ as FileData, aK as GlobalAfterChangeHook, aL as GlobalAfterReadHook, aM as GlobalAfterReadHookEntry, aN as GlobalBeforeChangeHook, aO as GlobalBeforeChangeHookEntry, aP as GlobalBeforeReadHook, aQ as GlobalBeforeReadHookEntry, aR as HeadingLevel, aS as HookFunction, aT as IconFieldAdmin, aU as ImageService, aV as JoinFieldAdmin, aW as JsonFieldAdmin, aX as JsonFormat, aY as LIFECYCLE_EVENT_NAMES, aZ as LifecycleEventHandler, a_ as LinkFormat, a$ as MultiSelectFieldAdmin, b0 as NamedAccessPolicy, b1 as NumberFieldAdmin, b2 as NumberFormat, b3 as NumberLimitFieldAdmin, b4 as NumberLimitFieldConfig, b5 as OIDCAdminAuthProvider, b6 as OptionFormat, b7 as PaginatedResult, b8 as PublicAdminAuthProvider, b9 as RadioFieldAdmin, ba as RateLimitConfig, bb as ReadonlyDatabaseAdapter, bc as RichTextFeature, bd as RichTextFieldConfig, be as SelectFieldAdmin, bf as StorageAdapter, bg as TextFieldAdmin, bh as TextFormat, bi as TextareaFieldAdmin, bj as TrustProxyConfig, bk as TypedField, bl as UploadConfig, bm as UrlFieldAdmin, bn as UrlLinkValue, bo as WordLimitFieldAdmin, bp as WordLimitFieldConfig, bq as WorkflowMetadata, br as WorkflowRole, bs as WorkflowState, bt as WorkflowTransitionContext } from './app-config-ChsrBB7p.js';
|
|
3
|
+
import jexl from 'jexl';
|
|
3
4
|
import 'lucide-react';
|
|
4
5
|
import 'pino';
|
|
5
6
|
|
|
@@ -264,6 +265,201 @@ declare function isConfigValidationError(error: unknown): error is ConfigValidat
|
|
|
264
265
|
declare function assertValidDeclarativeHooksInConfig(config: DeclarativeValidationConfig, source?: string): void;
|
|
265
266
|
declare function assertValidDeclarativeAccessInConfig(config: DeclarativeValidationConfig, source?: string): void;
|
|
266
267
|
|
|
268
|
+
/**
|
|
269
|
+
* Transforms a string into a clean, URL-safe slug.
|
|
270
|
+
* Strips accents, lowercases, removes non-alphanumeric characters, and hyphens whitespace.
|
|
271
|
+
*
|
|
272
|
+
* @example `slugify("Hello World!")` => `"hello-world"`
|
|
273
|
+
*/
|
|
274
|
+
declare function slugify(val: unknown): string;
|
|
275
|
+
/**
|
|
276
|
+
* Converts a string value to lowercase.
|
|
277
|
+
*
|
|
278
|
+
* @example `lower("Dyrected")` => `"dyrected"`
|
|
279
|
+
*/
|
|
280
|
+
declare function lower(val: unknown): string;
|
|
281
|
+
/**
|
|
282
|
+
* Converts a string value to uppercase.
|
|
283
|
+
*
|
|
284
|
+
* @example `upper("dyrected")` => `"DYRECTED"`
|
|
285
|
+
*/
|
|
286
|
+
declare function upper(val: unknown): string;
|
|
287
|
+
/**
|
|
288
|
+
* Trims leading and trailing whitespace from a string.
|
|
289
|
+
*
|
|
290
|
+
* @example `trim(" hello ")` => `"hello"`
|
|
291
|
+
*/
|
|
292
|
+
declare function trim(val: unknown): string;
|
|
293
|
+
/**
|
|
294
|
+
* Capitalizes the first letter of a string and lowercases the rest.
|
|
295
|
+
*
|
|
296
|
+
* @example `capitalize("hELLO")` => `"Hello"`
|
|
297
|
+
*/
|
|
298
|
+
declare function capitalize(val: unknown): string;
|
|
299
|
+
/**
|
|
300
|
+
* Truncates a string to a maximum length and appends an ellipsis.
|
|
301
|
+
*
|
|
302
|
+
* @example `truncate("Long article text...", 10)` => `"Long artic..."`
|
|
303
|
+
*/
|
|
304
|
+
declare function truncate(val: unknown, length: unknown, ellipsis?: string): string;
|
|
305
|
+
/**
|
|
306
|
+
* Calculates estimated reading time in minutes based on word count.
|
|
307
|
+
*
|
|
308
|
+
* @example `readingTime(articleText)` => `3`
|
|
309
|
+
*/
|
|
310
|
+
declare function readingTime(val: unknown, wpm?: number): number;
|
|
311
|
+
/**
|
|
312
|
+
* Returns the word count of a text string.
|
|
313
|
+
*
|
|
314
|
+
* @example `wordCount("Quick brown fox")` => `3`
|
|
315
|
+
*/
|
|
316
|
+
declare function wordCount(val: unknown): number;
|
|
317
|
+
/**
|
|
318
|
+
* Replaces occurrences of a substring or pattern with a replacement string.
|
|
319
|
+
*
|
|
320
|
+
* @example `replace("hello world", "world", "there")` => `"hello there"`
|
|
321
|
+
*/
|
|
322
|
+
declare function replace(val: unknown, search: unknown, replacement: unknown): string;
|
|
323
|
+
/**
|
|
324
|
+
* Checks if a string starts with a given prefix.
|
|
325
|
+
*
|
|
326
|
+
* @example `startsWith("dyrected.com", "dyrected")` => `true`
|
|
327
|
+
*/
|
|
328
|
+
declare function startsWith(str: unknown, prefix: unknown): boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Checks if a string ends with a given suffix.
|
|
331
|
+
*
|
|
332
|
+
* @example `endsWith("image.png", ".png")` => `true`
|
|
333
|
+
*/
|
|
334
|
+
declare function endsWith(str: unknown, suffix: unknown): boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Returns the current date and time as an ISO 8601 string.
|
|
337
|
+
*
|
|
338
|
+
* @example `now()` => `"2026-07-27T00:00:00.000Z"`
|
|
339
|
+
*/
|
|
340
|
+
declare function now(): string;
|
|
341
|
+
/**
|
|
342
|
+
* Returns the current date as a YYYY-MM-DD string.
|
|
343
|
+
*
|
|
344
|
+
* @example `today()` => `"2026-07-27"`
|
|
345
|
+
*/
|
|
346
|
+
declare function today(): string;
|
|
347
|
+
/**
|
|
348
|
+
* Formats a date string, number, or Date instance into a formatted string.
|
|
349
|
+
*
|
|
350
|
+
* @param style `'short'` (default), `'iso'`, `'date'`, `'datetime'`, or `'full'`
|
|
351
|
+
* @example `formatDate("2026-07-27T12:00:00Z", "short")` => `"Jul 27, 2026"`
|
|
352
|
+
*/
|
|
353
|
+
declare function formatDate(val: unknown, style?: unknown): string;
|
|
354
|
+
/**
|
|
355
|
+
* Adds or subtracts a specified number of days to a date.
|
|
356
|
+
*
|
|
357
|
+
* @example `addDays(now(), 7)` => `"2026-08-03T00:00:00.000Z"`
|
|
358
|
+
*/
|
|
359
|
+
declare function addDays(val: unknown, days: unknown): string;
|
|
360
|
+
/**
|
|
361
|
+
* Calculates the integer difference in days between two dates.
|
|
362
|
+
*
|
|
363
|
+
* @example `diffDays("2026-07-27", "2026-07-20")` => `7`
|
|
364
|
+
*/
|
|
365
|
+
declare function diffDays(dateA: unknown, dateB: unknown): number;
|
|
366
|
+
/**
|
|
367
|
+
* Checks if a date is in the past relative to the current timestamp.
|
|
368
|
+
*
|
|
369
|
+
* @example `isPast("2020-01-01")` => `true`
|
|
370
|
+
*/
|
|
371
|
+
declare function isPast(val: unknown): boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Checks if a date is in the future relative to the current timestamp.
|
|
374
|
+
*
|
|
375
|
+
* @example `isFuture("2030-01-01")` => `true`
|
|
376
|
+
*/
|
|
377
|
+
declare function isFuture(val: unknown): boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Checks if an item exists within an array or if a substring exists within a string.
|
|
380
|
+
*
|
|
381
|
+
* @example `includes(["admin", "editor"], "admin")` => `true`
|
|
382
|
+
*/
|
|
383
|
+
declare function includes(arrOrStr: unknown, item: unknown): boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Joins array elements into a string separated by a delimiter.
|
|
386
|
+
*
|
|
387
|
+
* @example `join(["Apple", "Banana"], ", ")` => `"Apple, Banana"`
|
|
388
|
+
*/
|
|
389
|
+
declare function join(arr: unknown, separator?: string): string;
|
|
390
|
+
/**
|
|
391
|
+
* Returns the first item in an array.
|
|
392
|
+
*
|
|
393
|
+
* @example `first(["a", "b", "c"])` => `"a"`
|
|
394
|
+
*/
|
|
395
|
+
declare function first(arr: unknown): unknown;
|
|
396
|
+
/**
|
|
397
|
+
* Returns the last item in an array.
|
|
398
|
+
*
|
|
399
|
+
* @example `last(["a", "b", "c"])` => `"c"`
|
|
400
|
+
*/
|
|
401
|
+
declare function last(arr: unknown): unknown;
|
|
402
|
+
/**
|
|
403
|
+
* Removes null, undefined, and empty string elements from an array.
|
|
404
|
+
*
|
|
405
|
+
* @example `compact(["a", null, "b", ""])` => `["a", "b"]`
|
|
406
|
+
*/
|
|
407
|
+
declare function compact(arr: unknown): unknown[];
|
|
408
|
+
/**
|
|
409
|
+
* Removes duplicate items from an array.
|
|
410
|
+
*
|
|
411
|
+
* @example `unique(["a", "b", "a"])` => `["a", "b"]`
|
|
412
|
+
*/
|
|
413
|
+
declare function unique(arr: unknown): unknown[];
|
|
414
|
+
/**
|
|
415
|
+
* Returns the length of an array, string, or object.
|
|
416
|
+
*
|
|
417
|
+
* @example `length("hello")` => `5`
|
|
418
|
+
*/
|
|
419
|
+
declare function length(val: unknown): number;
|
|
420
|
+
/**
|
|
421
|
+
* Rounds a number to a specified number of decimal places.
|
|
422
|
+
*
|
|
423
|
+
* @example `round(3.14159, 2)` => `3.14`
|
|
424
|
+
*/
|
|
425
|
+
declare function round(val: unknown, decimals?: number): number;
|
|
426
|
+
/**
|
|
427
|
+
* Clamps a number between a minimum and maximum threshold.
|
|
428
|
+
*
|
|
429
|
+
* @example `clamp(150, 0, 100)` => `100`
|
|
430
|
+
*/
|
|
431
|
+
declare function clamp(val: unknown, minVal: unknown, maxVal: unknown): number;
|
|
432
|
+
/**
|
|
433
|
+
* Returns a fallback value if the target value is undefined, null, or an empty string.
|
|
434
|
+
*
|
|
435
|
+
* @example `default(siblingData.title, "Untitled")` => `"Untitled"`
|
|
436
|
+
*/
|
|
437
|
+
declare function defaultValue(val: unknown, fallback: unknown): unknown;
|
|
438
|
+
/**
|
|
439
|
+
* Returns the first non-empty value among the arguments provided.
|
|
440
|
+
*
|
|
441
|
+
* @example `coalesce(null, "", "Fallback")` => `"Fallback"`
|
|
442
|
+
*/
|
|
443
|
+
declare function coalesce(...args: unknown[]): unknown;
|
|
444
|
+
/**
|
|
445
|
+
* Checks if a value is empty (undefined, null, empty string, empty array, or empty object).
|
|
446
|
+
*
|
|
447
|
+
* @example `isEmpty([])` => `true`
|
|
448
|
+
*/
|
|
449
|
+
declare function isEmpty(val: unknown): boolean;
|
|
450
|
+
/**
|
|
451
|
+
* Safely accesses a nested object property by a dot-separated key path.
|
|
452
|
+
*
|
|
453
|
+
* @example `get(siblingData, "author.name", "Guest")` => `"John"`
|
|
454
|
+
*/
|
|
455
|
+
declare function get(obj: unknown, path: unknown, fallback?: unknown): unknown;
|
|
456
|
+
/**
|
|
457
|
+
* Registers all Dyrected built-in helper functions onto a Jexl evaluation instance.
|
|
458
|
+
*/
|
|
459
|
+
declare function registerJexlHelpers(jexlInstance?: typeof jexl): void;
|
|
460
|
+
/** List of all built-in Jexl helper function names for AST validation. */
|
|
461
|
+
declare const BUILTIN_JEXL_HELPERS: readonly ["slugify", "lower", "upper", "trim", "capitalize", "truncate", "readingTime", "wordCount", "replace", "startsWith", "endsWith", "now", "today", "formatDate", "addDays", "diffDays", "isPast", "isFuture", "includes", "join", "first", "last", "compact", "unique", "length", "round", "clamp", "default", "coalesce", "isEmpty", "get"];
|
|
462
|
+
|
|
267
463
|
type AnyHookFn = (args: any) => any;
|
|
268
464
|
type AnyHook = AnyHookFn | DeclarativeHookExpression;
|
|
269
465
|
/**
|
|
@@ -815,4 +1011,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
|
|
|
815
1011
|
fields: T;
|
|
816
1012
|
}): T;
|
|
817
1013
|
|
|
818
|
-
export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, createLifecycleEvent, createWorkflowDocument, 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, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, executeFieldAfterRead, executeFieldBeforeChange, formatConfigDiagnostics, generateOpenApi, getAdminAuthCollection, getPublicAdminAuthConfig, initializeWorkflowDocument, isConfigValidationError, materializeWorkflowDocument, normalizeConfig, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, publishedStateName, publishingWorkflow, resolveAdminAuthCollection, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, transitionWorkflow, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, workflowCapabilities };
|
|
1014
|
+
export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, 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, endsWith, executeFieldAfterRead, executeFieldBeforeChange, first, formatConfigDiagnostics, formatDate, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, normalizeConfig, now, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, startsWith, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, wordCount, workflowCapabilities };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BUILTIN_JEXL_HELPERS,
|
|
2
3
|
ConfigValidationError,
|
|
3
4
|
LIFECYCLE_EVENTS_COLLECTION,
|
|
4
5
|
WORKFLOW_HISTORY_COLLECTION,
|
|
6
|
+
addDays,
|
|
5
7
|
assertValidAdminConditionsInConfig,
|
|
6
8
|
assertValidDeclarativeAccessInConfig,
|
|
7
9
|
assertValidDeclarativeHookExpression,
|
|
@@ -10,39 +12,70 @@ import {
|
|
|
10
12
|
assertValidPreviewUrlsInConfig,
|
|
11
13
|
availableWorkflowTransitions,
|
|
12
14
|
canViewWorkflowDraft,
|
|
15
|
+
capitalize,
|
|
16
|
+
clamp,
|
|
17
|
+
coalesce,
|
|
13
18
|
collectAdminConditionValidationIssues,
|
|
14
19
|
collectConfigDiagnostics,
|
|
15
20
|
collectDeclarativeAccessValidationIssues,
|
|
16
21
|
collectDeclarativeHookValidationIssues,
|
|
17
22
|
collectPreviewUrlValidationIssues,
|
|
23
|
+
compact,
|
|
18
24
|
createLifecycleEvent,
|
|
19
25
|
createWorkflowDocument,
|
|
26
|
+
defaultValue,
|
|
20
27
|
definePublishingWorkflow,
|
|
28
|
+
diffDays,
|
|
21
29
|
dispatchLifecycleEvent,
|
|
22
30
|
dispatchPendingLifecycleEvents,
|
|
31
|
+
endsWith,
|
|
23
32
|
executeFieldAfterRead,
|
|
24
33
|
executeFieldBeforeChange,
|
|
34
|
+
first,
|
|
25
35
|
formatConfigDiagnostics,
|
|
36
|
+
formatDate,
|
|
26
37
|
generateOpenApi,
|
|
38
|
+
get,
|
|
27
39
|
getAdminAuthCollection,
|
|
28
40
|
getPublicAdminAuthConfig,
|
|
41
|
+
includes,
|
|
29
42
|
initializeWorkflowDocument,
|
|
30
43
|
isConfigValidationError,
|
|
44
|
+
isEmpty,
|
|
45
|
+
isFuture,
|
|
46
|
+
isPast,
|
|
47
|
+
join,
|
|
48
|
+
last,
|
|
49
|
+
length,
|
|
50
|
+
lower,
|
|
31
51
|
materializeWorkflowDocument,
|
|
32
52
|
normalizeConfig,
|
|
53
|
+
now,
|
|
33
54
|
publishedStateName,
|
|
34
55
|
publishingWorkflow,
|
|
56
|
+
readingTime,
|
|
57
|
+
registerJexlHelpers,
|
|
58
|
+
replace,
|
|
35
59
|
resolveAdminAuthCollection,
|
|
60
|
+
round,
|
|
36
61
|
runCollectionHooks,
|
|
37
62
|
saveWorkflowDraft,
|
|
38
63
|
simplePublishingWorkflow,
|
|
64
|
+
slugify,
|
|
65
|
+
startsWith,
|
|
66
|
+
today,
|
|
39
67
|
transitionWorkflow,
|
|
68
|
+
trim,
|
|
69
|
+
truncate,
|
|
70
|
+
unique,
|
|
71
|
+
upper,
|
|
40
72
|
validateAdminConditionExpression,
|
|
41
73
|
validateDeclarativeAccessExpression,
|
|
42
74
|
validateDeclarativeHookExpression,
|
|
43
75
|
validatePreviewUrlExpression,
|
|
76
|
+
wordCount,
|
|
44
77
|
workflowCapabilities
|
|
45
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-YSSHLGQ6.js";
|
|
46
79
|
|
|
47
80
|
// src/types/workflows.ts
|
|
48
81
|
var LIFECYCLE_EVENT_NAMES = [
|
|
@@ -302,10 +335,12 @@ function defineTab(args) {
|
|
|
302
335
|
}));
|
|
303
336
|
}
|
|
304
337
|
export {
|
|
338
|
+
BUILTIN_JEXL_HELPERS,
|
|
305
339
|
ConfigValidationError,
|
|
306
340
|
LIFECYCLE_EVENTS_COLLECTION,
|
|
307
341
|
LIFECYCLE_EVENT_NAMES,
|
|
308
342
|
WORKFLOW_HISTORY_COLLECTION,
|
|
343
|
+
addDays,
|
|
309
344
|
assertValidAdminConditionsInConfig,
|
|
310
345
|
assertValidDeclarativeAccessInConfig,
|
|
311
346
|
assertValidDeclarativeHookExpression,
|
|
@@ -315,13 +350,18 @@ export {
|
|
|
315
350
|
availableWorkflowTransitions,
|
|
316
351
|
buildSqlOrderBy,
|
|
317
352
|
canViewWorkflowDraft,
|
|
353
|
+
capitalize,
|
|
354
|
+
clamp,
|
|
355
|
+
coalesce,
|
|
318
356
|
collectAdminConditionValidationIssues,
|
|
319
357
|
collectConfigDiagnostics,
|
|
320
358
|
collectDeclarativeAccessValidationIssues,
|
|
321
359
|
collectDeclarativeHookValidationIssues,
|
|
322
360
|
collectPreviewUrlValidationIssues,
|
|
361
|
+
compact,
|
|
323
362
|
createLifecycleEvent,
|
|
324
363
|
createWorkflowDocument,
|
|
364
|
+
defaultValue,
|
|
325
365
|
defineArrayField,
|
|
326
366
|
defineBlock,
|
|
327
367
|
defineBlocksField,
|
|
@@ -351,32 +391,58 @@ export {
|
|
|
351
391
|
defineTextareaField,
|
|
352
392
|
defineTimeField,
|
|
353
393
|
defineUrlField,
|
|
394
|
+
diffDays,
|
|
354
395
|
dispatchLifecycleEvent,
|
|
355
396
|
dispatchPendingLifecycleEvents,
|
|
397
|
+
endsWith,
|
|
356
398
|
executeFieldAfterRead,
|
|
357
399
|
executeFieldBeforeChange,
|
|
400
|
+
first,
|
|
358
401
|
formatConfigDiagnostics,
|
|
402
|
+
formatDate,
|
|
359
403
|
generateOpenApi,
|
|
404
|
+
get,
|
|
360
405
|
getAdminAuthCollection,
|
|
361
406
|
getPublicAdminAuthConfig,
|
|
407
|
+
includes,
|
|
362
408
|
initializeWorkflowDocument,
|
|
363
409
|
isConfigValidationError,
|
|
410
|
+
isEmpty,
|
|
411
|
+
isFuture,
|
|
412
|
+
isPast,
|
|
413
|
+
join,
|
|
414
|
+
last,
|
|
415
|
+
length,
|
|
416
|
+
lower,
|
|
364
417
|
materializeWorkflowDocument,
|
|
365
418
|
normalizeConfig,
|
|
419
|
+
now,
|
|
366
420
|
numericFieldNames,
|
|
367
421
|
parseMongoWhere,
|
|
368
422
|
parseSort,
|
|
369
423
|
parseSqlWhere,
|
|
370
424
|
publishedStateName,
|
|
371
425
|
publishingWorkflow,
|
|
426
|
+
readingTime,
|
|
427
|
+
registerJexlHelpers,
|
|
428
|
+
replace,
|
|
372
429
|
resolveAdminAuthCollection,
|
|
430
|
+
round,
|
|
373
431
|
runCollectionHooks,
|
|
374
432
|
saveWorkflowDraft,
|
|
375
433
|
simplePublishingWorkflow,
|
|
434
|
+
slugify,
|
|
435
|
+
startsWith,
|
|
436
|
+
today,
|
|
376
437
|
transitionWorkflow,
|
|
438
|
+
trim,
|
|
439
|
+
truncate,
|
|
440
|
+
unique,
|
|
441
|
+
upper,
|
|
377
442
|
validateAdminConditionExpression,
|
|
378
443
|
validateDeclarativeAccessExpression,
|
|
379
444
|
validateDeclarativeHookExpression,
|
|
380
445
|
validatePreviewUrlExpression,
|
|
446
|
+
wordCount,
|
|
381
447
|
workflowCapabilities
|
|
382
448
|
};
|