@dyrected/core 2.14.0 → 2.16.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/{app-Cp8RudRI.d.cts → app-KSDgfXsw.d.cts} +143 -7
- package/dist/{app-Cp8RudRI.d.ts → app-KSDgfXsw.d.ts} +143 -7
- package/dist/index.cjs +246 -1
- package/dist/index.d.cts +129 -3
- package/dist/index.d.ts +129 -3
- package/dist/index.js +229 -1
- package/dist/server.cjs +218 -18
- package/dist/server.d.cts +10 -3
- package/dist/server.d.ts +10 -3
- package/dist/server.js +217 -18
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1789,15 +1789,24 @@ __export(index_exports, {
|
|
|
1789
1789
|
AI_CHUNKS_COLLECTION: () => AI_CHUNKS_COLLECTION,
|
|
1790
1790
|
AI_MESSAGES_COLLECTION: () => AI_MESSAGES_COLLECTION,
|
|
1791
1791
|
AI_THREADS_COLLECTION: () => AI_THREADS_COLLECTION,
|
|
1792
|
+
BASE62_ALPHABET: () => BASE62_ALPHABET,
|
|
1792
1793
|
BUILTIN_JEXL_HELPERS: () => BUILTIN_JEXL_HELPERS,
|
|
1794
|
+
CROCKFORD_BASE32: () => CROCKFORD_BASE32,
|
|
1793
1795
|
ConfigValidationError: () => ConfigValidationError,
|
|
1796
|
+
ConflictError: () => ConflictError,
|
|
1797
|
+
DuplicateKeyError: () => DuplicateKeyError,
|
|
1794
1798
|
DyrectedAIError: () => DyrectedAIError,
|
|
1799
|
+
DyrectedError: () => DyrectedError,
|
|
1795
1800
|
FieldConditionBuilder: () => FieldConditionBuilder,
|
|
1801
|
+
ForbiddenError: () => ForbiddenError,
|
|
1796
1802
|
LIFECYCLE_EVENTS_COLLECTION: () => LIFECYCLE_EVENTS_COLLECTION,
|
|
1797
1803
|
LIFECYCLE_EVENT_NAMES: () => LIFECYCLE_EVENT_NAMES,
|
|
1798
1804
|
MatchBuilder: () => MatchBuilder,
|
|
1805
|
+
NANOID_ALPHABET: () => NANOID_ALPHABET,
|
|
1799
1806
|
NON_NEGOTIABLE_CREDENTIAL_FIELDS: () => NON_NEGOTIABLE_CREDENTIAL_FIELDS,
|
|
1807
|
+
NotFoundError: () => NotFoundError,
|
|
1800
1808
|
PII_REGEX_PATTERNS: () => PII_REGEX_PATTERNS,
|
|
1809
|
+
ValidationError: () => ValidationError,
|
|
1801
1810
|
WORKFLOW_HISTORY_COLLECTION: () => WORKFLOW_HISTORY_COLLECTION,
|
|
1802
1811
|
abs: () => abs,
|
|
1803
1812
|
addDays: () => addDays,
|
|
@@ -1864,6 +1873,7 @@ __export(index_exports, {
|
|
|
1864
1873
|
diffDays: () => diffDays,
|
|
1865
1874
|
dispatchLifecycleEvent: () => dispatchLifecycleEvent,
|
|
1866
1875
|
dispatchPendingLifecycleEvents: () => dispatchPendingLifecycleEvents,
|
|
1876
|
+
displayAction: () => displayAction,
|
|
1867
1877
|
displayComputed: () => displayComputed,
|
|
1868
1878
|
displayCustom: () => displayCustom,
|
|
1869
1879
|
displayCustomComponent: () => displayCustomComponent,
|
|
@@ -1888,6 +1898,8 @@ __export(index_exports, {
|
|
|
1888
1898
|
formatDate: () => formatDate,
|
|
1889
1899
|
formatJexlValue: () => formatJexlValue,
|
|
1890
1900
|
generateDefaultDetailSchema: () => generateDefaultDetailSchema,
|
|
1901
|
+
generateDocumentId: () => generateDocumentId,
|
|
1902
|
+
generateId: () => generateId,
|
|
1891
1903
|
generateOpenApi: () => generateOpenApi,
|
|
1892
1904
|
get: () => get,
|
|
1893
1905
|
getAdminAuthCollection: () => getAdminAuthCollection,
|
|
@@ -1914,6 +1926,7 @@ __export(index_exports, {
|
|
|
1914
1926
|
materializeWorkflowDocument: () => materializeWorkflowDocument,
|
|
1915
1927
|
max: () => max,
|
|
1916
1928
|
min: () => min,
|
|
1929
|
+
nanoid: () => nanoid,
|
|
1917
1930
|
normalizeConfig: () => normalizeConfig,
|
|
1918
1931
|
normalizeDetailItem: () => normalizeDetailItem,
|
|
1919
1932
|
now: () => now,
|
|
@@ -1922,6 +1935,7 @@ __export(index_exports, {
|
|
|
1922
1935
|
parseSort: () => parseSort,
|
|
1923
1936
|
parseSqlWhere: () => parseSqlWhere,
|
|
1924
1937
|
pow: () => pow,
|
|
1938
|
+
prefixedId: () => prefixedId,
|
|
1925
1939
|
publishedStateName: () => publishedStateName,
|
|
1926
1940
|
publishingWorkflow: () => publishingWorkflow,
|
|
1927
1941
|
readingTime: () => readingTime,
|
|
@@ -1929,6 +1943,7 @@ __export(index_exports, {
|
|
|
1929
1943
|
replace: () => replace,
|
|
1930
1944
|
resolveAdminAuthCollection: () => resolveAdminAuthCollection,
|
|
1931
1945
|
resolveAuthorizedSiteId: () => resolveAuthorizedSiteId,
|
|
1946
|
+
resolvePrefix: () => resolvePrefix,
|
|
1932
1947
|
round: () => round,
|
|
1933
1948
|
runCollectionHooks: () => runCollectionHooks,
|
|
1934
1949
|
sanitizeDocForAI: () => sanitizeDocForAI,
|
|
@@ -1942,8 +1957,10 @@ __export(index_exports, {
|
|
|
1942
1957
|
transitionWorkflow: () => transitionWorkflow,
|
|
1943
1958
|
trim: () => trim,
|
|
1944
1959
|
truncate: () => truncate,
|
|
1960
|
+
ulid: () => ulid,
|
|
1945
1961
|
unique: () => unique,
|
|
1946
1962
|
upper: () => upper,
|
|
1963
|
+
uuid: () => uuid,
|
|
1947
1964
|
validateAdminConditionExpression: () => validateAdminConditionExpression,
|
|
1948
1965
|
validateDeclarativeAccessExpression: () => validateDeclarativeAccessExpression,
|
|
1949
1966
|
validateDeclarativeHookExpression: () => validateDeclarativeHookExpression,
|
|
@@ -3543,6 +3560,134 @@ function assertValidDeclarativeAccessInConfig(config, source = "config") {
|
|
|
3543
3560
|
throw new ConfigValidationError(source, diagnostics);
|
|
3544
3561
|
}
|
|
3545
3562
|
|
|
3563
|
+
// src/utils/id.ts
|
|
3564
|
+
var import_node_crypto = require("crypto");
|
|
3565
|
+
var NANOID_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
|
|
3566
|
+
var BASE62_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
3567
|
+
var CROCKFORD_BASE32 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
3568
|
+
var COMMON_SLUG_PREFIXES = {
|
|
3569
|
+
users: "usr",
|
|
3570
|
+
members: "mem",
|
|
3571
|
+
accounts: "acc",
|
|
3572
|
+
applications: "app",
|
|
3573
|
+
customers: "cus",
|
|
3574
|
+
products: "prd",
|
|
3575
|
+
orders: "ord",
|
|
3576
|
+
reports: "rpt",
|
|
3577
|
+
sessions: "ses",
|
|
3578
|
+
transactions: "txn",
|
|
3579
|
+
wallets: "wal",
|
|
3580
|
+
media: "med",
|
|
3581
|
+
files: "fil",
|
|
3582
|
+
posts: "post",
|
|
3583
|
+
pages: "page",
|
|
3584
|
+
tags: "tag",
|
|
3585
|
+
categories: "cat",
|
|
3586
|
+
comments: "com"
|
|
3587
|
+
};
|
|
3588
|
+
function nanoid(size = 21, alphabet = NANOID_ALPHABET) {
|
|
3589
|
+
const mask = (2 << 31 - Math.clz32(alphabet.length - 1 | 1)) - 1;
|
|
3590
|
+
const step = Math.ceil(1.6 * mask * size / alphabet.length);
|
|
3591
|
+
let id = "";
|
|
3592
|
+
while (true) {
|
|
3593
|
+
const bytes = (0, import_node_crypto.randomBytes)(step);
|
|
3594
|
+
for (let i = 0; i < step; i++) {
|
|
3595
|
+
const byte = bytes[i] & mask;
|
|
3596
|
+
if (alphabet[byte]) {
|
|
3597
|
+
id += alphabet[byte];
|
|
3598
|
+
if (id.length === size) return id;
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
function encodeUlidTime(now2, len = 10) {
|
|
3604
|
+
let str = "";
|
|
3605
|
+
let time = Math.floor(now2);
|
|
3606
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
3607
|
+
const mod = time % 32;
|
|
3608
|
+
str = CROCKFORD_BASE32[mod] + str;
|
|
3609
|
+
time = (time - mod) / 32;
|
|
3610
|
+
}
|
|
3611
|
+
return str;
|
|
3612
|
+
}
|
|
3613
|
+
function encodeUlidRandom(bytes) {
|
|
3614
|
+
let str = "";
|
|
3615
|
+
let bitBuffer = 0;
|
|
3616
|
+
let bitsInBuffer = 0;
|
|
3617
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
3618
|
+
bitBuffer = bitBuffer << 8 | bytes[i];
|
|
3619
|
+
bitsInBuffer += 8;
|
|
3620
|
+
while (bitsInBuffer >= 5) {
|
|
3621
|
+
bitsInBuffer -= 5;
|
|
3622
|
+
const index = bitBuffer >> bitsInBuffer & 31;
|
|
3623
|
+
str += CROCKFORD_BASE32[index];
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
return str;
|
|
3627
|
+
}
|
|
3628
|
+
function ulid(seedTime = Date.now()) {
|
|
3629
|
+
const timePart = encodeUlidTime(seedTime);
|
|
3630
|
+
const randPart = encodeUlidRandom((0, import_node_crypto.randomBytes)(10));
|
|
3631
|
+
return timePart + randPart;
|
|
3632
|
+
}
|
|
3633
|
+
function uuid() {
|
|
3634
|
+
return (0, import_node_crypto.randomUUID)();
|
|
3635
|
+
}
|
|
3636
|
+
function resolvePrefix(slug, explicitPrefix) {
|
|
3637
|
+
if (explicitPrefix && typeof explicitPrefix === "string" && explicitPrefix.trim().length > 0) {
|
|
3638
|
+
const cleaned = explicitPrefix.trim().toLowerCase().replace(/[^a-z0-9_]/g, "");
|
|
3639
|
+
if (cleaned.length > 0) return cleaned;
|
|
3640
|
+
}
|
|
3641
|
+
if (!slug || typeof slug !== "string") return "col";
|
|
3642
|
+
const s = slug.trim().toLowerCase();
|
|
3643
|
+
if (COMMON_SLUG_PREFIXES[s]) return COMMON_SLUG_PREFIXES[s];
|
|
3644
|
+
const pieces = s.split(/[-_]/).filter(Boolean);
|
|
3645
|
+
if (pieces.length > 1 && pieces[0].length >= 2) {
|
|
3646
|
+
const first2 = pieces[0].replace(/[^a-z0-9]/g, "");
|
|
3647
|
+
if (first2.length >= 2) return first2.slice(0, 4);
|
|
3648
|
+
}
|
|
3649
|
+
const cleanWord = s.replace(/[^a-z0-9]/g, "");
|
|
3650
|
+
if (cleanWord.length <= 4) return cleanWord || "col";
|
|
3651
|
+
return cleanWord.slice(0, 3) || "col";
|
|
3652
|
+
}
|
|
3653
|
+
function prefixedId(prefix = "col", size = 16) {
|
|
3654
|
+
const cleanPrefix = (prefix || "col").toLowerCase().replace(/[^a-z0-9_]/g, "") || "col";
|
|
3655
|
+
return `${cleanPrefix}_${nanoid(size, BASE62_ALPHABET)}`;
|
|
3656
|
+
}
|
|
3657
|
+
function generateId(options) {
|
|
3658
|
+
if (typeof options === "string") {
|
|
3659
|
+
return prefixedId(resolvePrefix(options));
|
|
3660
|
+
}
|
|
3661
|
+
const opts = options || {};
|
|
3662
|
+
const type = opts.type || "prefixed-nanoid";
|
|
3663
|
+
switch (type) {
|
|
3664
|
+
case "uuid":
|
|
3665
|
+
return uuid();
|
|
3666
|
+
case "ulid":
|
|
3667
|
+
return ulid();
|
|
3668
|
+
case "nanoid":
|
|
3669
|
+
return nanoid(opts.size || 21);
|
|
3670
|
+
case "prefixed-nanoid":
|
|
3671
|
+
default:
|
|
3672
|
+
return prefixedId(opts.prefix || "col", opts.size || 16);
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
function generateDocumentId(collectionOrSlug) {
|
|
3676
|
+
if (!collectionOrSlug) {
|
|
3677
|
+
return prefixedId("col");
|
|
3678
|
+
}
|
|
3679
|
+
if (typeof collectionOrSlug === "string") {
|
|
3680
|
+
const prefix2 = resolvePrefix(collectionOrSlug);
|
|
3681
|
+
return prefixedId(prefix2);
|
|
3682
|
+
}
|
|
3683
|
+
if (typeof collectionOrSlug.idGenerator === "function") {
|
|
3684
|
+
return collectionOrSlug.idGenerator(collectionOrSlug.slug);
|
|
3685
|
+
}
|
|
3686
|
+
const type = collectionOrSlug.idType || "prefixed-nanoid";
|
|
3687
|
+
const prefix = resolvePrefix(collectionOrSlug.slug, collectionOrSlug.idPrefix);
|
|
3688
|
+
return generateId({ prefix, type });
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3546
3691
|
// src/utils/config.ts
|
|
3547
3692
|
var AUDIT_COLLECTION_SLUG = "__audit";
|
|
3548
3693
|
var SYSTEM_FIELDS = [
|
|
@@ -3864,11 +4009,31 @@ function normalizeConfig(config) {
|
|
|
3864
4009
|
}
|
|
3865
4010
|
const updatedFieldNames = new Set(fields.map((f) => f.name));
|
|
3866
4011
|
const fieldsToInject = SYSTEM_FIELDS.filter((f) => !updatedFieldNames.has(f.name));
|
|
4012
|
+
const indexedFieldNames = /* @__PURE__ */ new Set();
|
|
4013
|
+
if (col.indexes) {
|
|
4014
|
+
for (const idx of col.indexes) {
|
|
4015
|
+
if (Array.isArray(idx.fields)) {
|
|
4016
|
+
for (const f of idx.fields) {
|
|
4017
|
+
indexedFieldNames.add(f);
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
const allFields = [...fields, ...fieldsToInject].map((field) => {
|
|
4023
|
+
if (field.unique || field.name && indexedFieldNames.has(field.name)) {
|
|
4024
|
+
return { ...field, promoted: true };
|
|
4025
|
+
}
|
|
4026
|
+
return field;
|
|
4027
|
+
});
|
|
3867
4028
|
const workflow = col.workflow || (col.drafts ? simplePublishingWorkflow() : void 0);
|
|
4029
|
+
const idPrefix = col.idPrefix || resolvePrefix(col.slug);
|
|
4030
|
+
const idType = col.idType || "prefixed-nanoid";
|
|
3868
4031
|
return {
|
|
3869
4032
|
...col,
|
|
4033
|
+
idPrefix,
|
|
4034
|
+
idType,
|
|
3870
4035
|
workflow,
|
|
3871
|
-
fields:
|
|
4036
|
+
fields: allFields
|
|
3872
4037
|
};
|
|
3873
4038
|
});
|
|
3874
4039
|
const hasAuditCollection = normalizedCollections.some((col) => col.slug === AUDIT_COLLECTION_SLUG);
|
|
@@ -3890,6 +4055,56 @@ function normalizeConfig(config) {
|
|
|
3890
4055
|
};
|
|
3891
4056
|
}
|
|
3892
4057
|
|
|
4058
|
+
// src/utils/errors.ts
|
|
4059
|
+
var DyrectedError = class _DyrectedError extends Error {
|
|
4060
|
+
statusCode;
|
|
4061
|
+
constructor(message, statusCode = 500) {
|
|
4062
|
+
super(message);
|
|
4063
|
+
this.name = "DyrectedError";
|
|
4064
|
+
this.statusCode = statusCode;
|
|
4065
|
+
Object.setPrototypeOf(this, _DyrectedError.prototype);
|
|
4066
|
+
}
|
|
4067
|
+
};
|
|
4068
|
+
var ValidationError = class _ValidationError extends DyrectedError {
|
|
4069
|
+
constructor(message) {
|
|
4070
|
+
super(message, 400);
|
|
4071
|
+
this.name = "ValidationError";
|
|
4072
|
+
Object.setPrototypeOf(this, _ValidationError.prototype);
|
|
4073
|
+
}
|
|
4074
|
+
};
|
|
4075
|
+
var ForbiddenError = class _ForbiddenError extends DyrectedError {
|
|
4076
|
+
constructor(message) {
|
|
4077
|
+
super(message, 403);
|
|
4078
|
+
this.name = "ForbiddenError";
|
|
4079
|
+
Object.setPrototypeOf(this, _ForbiddenError.prototype);
|
|
4080
|
+
}
|
|
4081
|
+
};
|
|
4082
|
+
var NotFoundError = class _NotFoundError extends DyrectedError {
|
|
4083
|
+
constructor(message) {
|
|
4084
|
+
super(message, 404);
|
|
4085
|
+
this.name = "NotFoundError";
|
|
4086
|
+
Object.setPrototypeOf(this, _NotFoundError.prototype);
|
|
4087
|
+
}
|
|
4088
|
+
};
|
|
4089
|
+
var ConflictError = class _ConflictError extends DyrectedError {
|
|
4090
|
+
constructor(message) {
|
|
4091
|
+
super(message, 409);
|
|
4092
|
+
this.name = "ConflictError";
|
|
4093
|
+
Object.setPrototypeOf(this, _ConflictError.prototype);
|
|
4094
|
+
}
|
|
4095
|
+
};
|
|
4096
|
+
var DuplicateKeyError = class _DuplicateKeyError extends ConflictError {
|
|
4097
|
+
field;
|
|
4098
|
+
value;
|
|
4099
|
+
constructor(message, options) {
|
|
4100
|
+
super(message);
|
|
4101
|
+
this.name = "DuplicateKeyError";
|
|
4102
|
+
this.field = options?.field;
|
|
4103
|
+
this.value = options?.value;
|
|
4104
|
+
Object.setPrototypeOf(this, _DuplicateKeyError.prototype);
|
|
4105
|
+
}
|
|
4106
|
+
};
|
|
4107
|
+
|
|
3893
4108
|
// src/utils/parse-where.ts
|
|
3894
4109
|
function assertNever(op, context) {
|
|
3895
4110
|
throw new Error(`[dyrected/core] Unhandled where operator "${op}" in ${context}`);
|
|
@@ -5749,6 +5964,13 @@ function displayCustom(name, options) {
|
|
|
5749
5964
|
function displayCustomComponent(name, options) {
|
|
5750
5965
|
return displayCustom(name, options);
|
|
5751
5966
|
}
|
|
5967
|
+
function displayAction(name, options) {
|
|
5968
|
+
return {
|
|
5969
|
+
type: "action",
|
|
5970
|
+
name,
|
|
5971
|
+
options
|
|
5972
|
+
};
|
|
5973
|
+
}
|
|
5752
5974
|
async function evaluateDetailComputed(detail, doc, user, db) {
|
|
5753
5975
|
if (!doc || !detail || !Array.isArray(detail)) {
|
|
5754
5976
|
return doc;
|
|
@@ -5821,6 +6043,12 @@ function generateDefaultDetailSchema(schema) {
|
|
|
5821
6043
|
if (SENSITIVE_DETAIL_FIELDS.has(field.name)) continue;
|
|
5822
6044
|
if (field.hidden) continue;
|
|
5823
6045
|
if (field.admin?.hidden) continue;
|
|
6046
|
+
if (field.type === "join") {
|
|
6047
|
+
const joinColumns = field.admin?.columns;
|
|
6048
|
+
const repeatItems = Array.isArray(joinColumns) && joinColumns.length > 0 ? joinColumns.map((col) => displayField(col, { span: 12 })) : [displayComputed("Item", "doc.title || doc.name || doc.label || doc.slug || doc.id")];
|
|
6049
|
+
mainFields.push(displayRepeat(field.name, repeatItems, { span: 12, layout: "table" }));
|
|
6050
|
+
continue;
|
|
6051
|
+
}
|
|
5824
6052
|
const isSidebar = sidebarFieldTypes.has(field.type) && field.type !== "relationship" && !field.hasMany;
|
|
5825
6053
|
if (isSidebar && sidebarFields.length < 5) {
|
|
5826
6054
|
sidebarFields.push(
|
|
@@ -6561,15 +6789,24 @@ function defineTab(args) {
|
|
|
6561
6789
|
AI_CHUNKS_COLLECTION,
|
|
6562
6790
|
AI_MESSAGES_COLLECTION,
|
|
6563
6791
|
AI_THREADS_COLLECTION,
|
|
6792
|
+
BASE62_ALPHABET,
|
|
6564
6793
|
BUILTIN_JEXL_HELPERS,
|
|
6794
|
+
CROCKFORD_BASE32,
|
|
6565
6795
|
ConfigValidationError,
|
|
6796
|
+
ConflictError,
|
|
6797
|
+
DuplicateKeyError,
|
|
6566
6798
|
DyrectedAIError,
|
|
6799
|
+
DyrectedError,
|
|
6567
6800
|
FieldConditionBuilder,
|
|
6801
|
+
ForbiddenError,
|
|
6568
6802
|
LIFECYCLE_EVENTS_COLLECTION,
|
|
6569
6803
|
LIFECYCLE_EVENT_NAMES,
|
|
6570
6804
|
MatchBuilder,
|
|
6805
|
+
NANOID_ALPHABET,
|
|
6571
6806
|
NON_NEGOTIABLE_CREDENTIAL_FIELDS,
|
|
6807
|
+
NotFoundError,
|
|
6572
6808
|
PII_REGEX_PATTERNS,
|
|
6809
|
+
ValidationError,
|
|
6573
6810
|
WORKFLOW_HISTORY_COLLECTION,
|
|
6574
6811
|
abs,
|
|
6575
6812
|
addDays,
|
|
@@ -6636,6 +6873,7 @@ function defineTab(args) {
|
|
|
6636
6873
|
diffDays,
|
|
6637
6874
|
dispatchLifecycleEvent,
|
|
6638
6875
|
dispatchPendingLifecycleEvents,
|
|
6876
|
+
displayAction,
|
|
6639
6877
|
displayComputed,
|
|
6640
6878
|
displayCustom,
|
|
6641
6879
|
displayCustomComponent,
|
|
@@ -6660,6 +6898,8 @@ function defineTab(args) {
|
|
|
6660
6898
|
formatDate,
|
|
6661
6899
|
formatJexlValue,
|
|
6662
6900
|
generateDefaultDetailSchema,
|
|
6901
|
+
generateDocumentId,
|
|
6902
|
+
generateId,
|
|
6663
6903
|
generateOpenApi,
|
|
6664
6904
|
get,
|
|
6665
6905
|
getAdminAuthCollection,
|
|
@@ -6686,6 +6926,7 @@ function defineTab(args) {
|
|
|
6686
6926
|
materializeWorkflowDocument,
|
|
6687
6927
|
max,
|
|
6688
6928
|
min,
|
|
6929
|
+
nanoid,
|
|
6689
6930
|
normalizeConfig,
|
|
6690
6931
|
normalizeDetailItem,
|
|
6691
6932
|
now,
|
|
@@ -6694,6 +6935,7 @@ function defineTab(args) {
|
|
|
6694
6935
|
parseSort,
|
|
6695
6936
|
parseSqlWhere,
|
|
6696
6937
|
pow,
|
|
6938
|
+
prefixedId,
|
|
6697
6939
|
publishedStateName,
|
|
6698
6940
|
publishingWorkflow,
|
|
6699
6941
|
readingTime,
|
|
@@ -6701,6 +6943,7 @@ function defineTab(args) {
|
|
|
6701
6943
|
replace,
|
|
6702
6944
|
resolveAdminAuthCollection,
|
|
6703
6945
|
resolveAuthorizedSiteId,
|
|
6946
|
+
resolvePrefix,
|
|
6704
6947
|
round,
|
|
6705
6948
|
runCollectionHooks,
|
|
6706
6949
|
sanitizeDocForAI,
|
|
@@ -6714,8 +6957,10 @@ function defineTab(args) {
|
|
|
6714
6957
|
transitionWorkflow,
|
|
6715
6958
|
trim,
|
|
6716
6959
|
truncate,
|
|
6960
|
+
ulid,
|
|
6717
6961
|
unique,
|
|
6718
6962
|
upper,
|
|
6963
|
+
uuid,
|
|
6719
6964
|
validateAdminConditionExpression,
|
|
6720
6965
|
validateDeclarativeAccessExpression,
|
|
6721
6966
|
validateDeclarativeHookExpression,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as Field, B as Block, C as CollectionConfig, D as DyrectedConfig, 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
|
|
2
|
-
export {
|
|
1
|
+
import { F as Field, B as Block, C as CollectionConfig, D as DyrectedConfig, 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 DetailActionOptions, g as DetailAction, h as DetailComputedOptions, i as ComputedHandler, j as DetailComputed, k as DetailCustomOptions, l as DetailCustom, m as DetailDividerOptions, n as DetailDivider, o as DisplayFieldOptions, p as DetailField, q as DetailItem, r as DetailGridOptions, s as DetailGrid, t as DetailRepeatOptions, u as DetailRepeat, v as DetailSectionOptions, w as DetailSection, x as DetailTabOptions, y as DetailTab, z as DetailTabsOptions, E as DetailTabs, I as DetailTextOptions, J as DetailText, K as DetailSchema, M as DyrectedContext, N as AIConfig, O as AIPIIConfig, Q as IdStrategy, R as ArrayField, S as FieldType, T as BooleanField, U as AuthConfig, V as AccessPolicyResolver, X as DateField, Y as DateTimeField, Z as EmailField, _ as IconField, $ as ImageField, a0 as JoinField, a1 as JsonField, a2 as MultiSelectField, a3 as NumberField, a4 as ObjectField, a5 as RadioField, a6 as RelationshipField, a7 as RichTextField, a8 as RowField, a9 as SelectField, aa as TextField, ab as TextareaField, ac as TimeField, ad as UrlField } from './app-KSDgfXsw.cjs';
|
|
2
|
+
export { ae as AIAction, af as AIActionStatus, ag as AIActionType, ah as AIAuditActionType, ai as AIAuditRecord, aj as AIChunk, ak as AIMessage, al as AIPIIPattern, am as AIRateLimitResult, an as AIRateLimitStore, ao as AIThread, ap as AIToolContext, aq as AIToolDefinition, ar as AI_ACTIONS_COLLECTION, as as AI_AUDIT_COLLECTION, at as AI_CHUNKS_COLLECTION, au as AI_MESSAGES_COLLECTION, av as AI_THREADS_COLLECTION, aw as AccessConfig, ax as AccessFunction, ay as AccessFunctionArgs, az as AccessResult, aA as AccessRule, aB as ActionConfig, aC as ActionConfigBase, aD as ActionConfigWithHandler, aE as ActionConfigWithMutation, aF as ActionContext, aG as ActionType, aH as AdminAuthAccessResolution, aI as AdminAuthClaimMapping, aJ as AdminAuthMember, aK as AdminAuthProvider, aL as AdminAuthProviderMembersConfig, aM as AdminAuthProvisioningMode, aN as AdminAuthResolveAccessArgs, aO as AdminAuthResolvedIdentity, aP as AdminConfig, aQ as AdminDashboardComponentSlots, aR as AdminIconName, aS as AggregateArgs, aT as AggregateCastType, aU as AggregateCollectionResult, aV as AggregateInput, aW as AggregateOperation, aX as AggregateResult, aY as BaseAdminAuthProvider, aZ as BaseFieldAdmin, a_ as BlockVariant, a$ as BlocksField, b0 as BooleanFieldAdmin, b1 as BooleanFormat, b2 as CharacterLimitFieldAdmin, b3 as CharacterLimitFieldConfig, b4 as CollectionAfterChangeHook, b5 as CollectionAfterDeleteHook, b6 as CollectionAfterReadHook, b7 as CollectionAfterReadHookEntry, b8 as CollectionAfterTransitionHook, b9 as CollectionBeforeChangeHook, ba as CollectionBeforeChangeHookEntry, bb as CollectionBeforeDeleteHook, bc as CollectionBeforeReadHook, bd as CollectionBeforeReadHookEntry, be as CollectionBeforeTransitionHook, bf as CollectionIndex, bg as CollectionListComponentSlots, bh as CollectionRAGConfig, bi as CollectionSchemaResult, bj as CollectionSummaryResult, bk as CollectionViewComponentSlots, bl as CountOperation, bm as CustomAdminAuthProvider, bn as DatabaseAdapter, bo as DateFieldAdmin, bp as DateFormat, bq as DefaultValueContext, br as DefineActionOptions, bs as DefineCalendarViewOptions, bt as DefineCardsViewOptions, bu as DefineGanttViewOptions, bv as DefineKanbanViewOptions, bw as DefineTableViewOptions, bx as DefineViewBaseOptions, by as DefineViewOptions, bz as DetailSpan, bA as DisplayTone, bB as DisplayVariant, bC as DistinctCountOperation, bD as DistinctValuesOperation, bE as DynamicOptionItem, bF as DynamicOptionsConfig, bG as DynamicOptionsResolver, bH as DynamicOptionsResolverArgs, bI as DyrectedAIContext, bJ as DyrectedLoggerConfig, bK as DyrectedObservabilityConfig, bL as EmailFieldAdmin, bM as FieldAdminHooks, bN as FieldAdminOnChangeHook, bO as FieldAdminOnChangeHookArgs, bP as FieldAdminOptionsHook, bQ as FieldAdminOptionsHookArgs, bR as FieldAdminOptionsHookResult, bS as FieldAfterReadHook, bT as FieldAfterReadHookArgs, bU as FieldBase, bV as FieldBeforeChangeHook, bW as FieldBeforeChangeHookArgs, bX as FieldHook, bY as FieldHooks, bZ as FileData, b_ as GetDocumentResult, b$ as GlobalAfterChangeHook, c0 as GlobalAfterReadHook, c1 as GlobalAfterReadHookEntry, c2 as GlobalBeforeChangeHook, c3 as GlobalBeforeChangeHookEntry, c4 as GlobalBeforeReadHook, c5 as GlobalBeforeReadHookEntry, c6 as GlobalRAGConfig, c7 as GlobalSchemaResult, c8 as GlobalSummaryResult, c9 as HeadingLevel, ca as HookFunction, cb as IconFieldAdmin, cc as ImageService, cd as ImageTransformOptions, ce as InferAggregateResult, cf as JoinFieldAdmin, cg as JsonFieldAdmin, ch as JsonFormat, ci as LIFECYCLE_EVENT_NAMES, cj as LifecycleEventHandler, ck as LinkFormat, cl as MetricColor, cm as MultiSelectFieldAdmin, cn as NamedAccessPolicy, co as NumberFieldAdmin, cp as NumberFormat, cq as NumberLimitFieldAdmin, cr as NumberLimitFieldConfig, cs as NumericOperation, ct as NumericUpdateOperator, cu as OIDCAdminAuthProvider, cv as OptionFormat, cw as PaginatedResult, cx as PublicAdminAuthProvider, cy as QueryCollectionResult, cz as RAGSearchResult, cA as RadioFieldAdmin, cB as RateLimitConfig, cC as ReadonlyDatabaseAdapter, cD as RichTextFeature, cE as RichTextFieldConfig, cF as SelectFieldAdmin, cG as SqlWhereResult, cH as StorageAdapter, cI as TextFieldAdmin, cJ as TextFormat, cK as TextareaFieldAdmin, cL as TrustProxyConfig, cM as TypedField, cN as UploadConfig, cO as UrlFieldAdmin, cP as UrlLinkValue, cQ as ViewActionFeatures, cR as ViewComponentSlots, cS as ViewConfig, cT as ViewLayout, cU as ViewMetric, cV as ViewSubMetric, cW as WhereClause, cX as WhereOperator, cY as WhereOperatorName, cZ as WordLimitFieldAdmin, c_ as WordLimitFieldConfig, c$ as WorkflowMetadata, d0 as WorkflowRole, d1 as WorkflowState, d2 as WorkflowTransitionContext, d3 as defineAction, d4 as defineCalendarView, d5 as defineCardsView, d6 as defineGanttView, d7 as defineKanbanView, d8 as defineTableView, d9 as defineView, da as isAICollection, db as parseMongoWhere, dc as parseSqlWhere } from './app-KSDgfXsw.cjs';
|
|
3
3
|
import jexl from 'jexl';
|
|
4
4
|
import { Context } from 'hono';
|
|
5
5
|
export { z } from 'zod';
|
|
@@ -155,6 +155,57 @@ declare function getAdminRoleForCollection(collection?: CollectionConfig | null)
|
|
|
155
155
|
*/
|
|
156
156
|
declare function isUserAdmin(user: any, collection?: CollectionConfig | null): boolean;
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* User-facing errors for self-hosted server code (action handlers, hooks).
|
|
160
|
+
*
|
|
161
|
+
* Throw these instead of hand-rolling `{ statusCode }` onto a plain `Error`.
|
|
162
|
+
* The action pipeline reads `statusCode` for the HTTP status (defaulting to
|
|
163
|
+
* `500` when absent) and `message` for the response body — which is what the
|
|
164
|
+
* SDK surfaces and the admin shows in its failure toast. Write the message
|
|
165
|
+
* for the editor who will read it.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* import { ValidationError } from "@dyrected/core";
|
|
170
|
+
*
|
|
171
|
+
* handler: async ({ input }) => {
|
|
172
|
+
* if (!input.refundReason) {
|
|
173
|
+
* throw new ValidationError("Enter a refund reason so support can follow up.");
|
|
174
|
+
* }
|
|
175
|
+
* return { status: "refunded" };
|
|
176
|
+
* }
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
declare class DyrectedError extends Error {
|
|
180
|
+
readonly statusCode: number;
|
|
181
|
+
constructor(message: string, statusCode?: number);
|
|
182
|
+
}
|
|
183
|
+
/** Bad input the editor can fix and retry. Answered with `400`. */
|
|
184
|
+
declare class ValidationError extends DyrectedError {
|
|
185
|
+
constructor(message: string);
|
|
186
|
+
}
|
|
187
|
+
/** The editor is not allowed to do this. Answered with `403`. */
|
|
188
|
+
declare class ForbiddenError extends DyrectedError {
|
|
189
|
+
constructor(message: string);
|
|
190
|
+
}
|
|
191
|
+
/** A referenced record does not exist. Answered with `404`. */
|
|
192
|
+
declare class NotFoundError extends DyrectedError {
|
|
193
|
+
constructor(message: string);
|
|
194
|
+
}
|
|
195
|
+
/** The current state conflicts with the requested change. Answered with `409`. */
|
|
196
|
+
declare class ConflictError extends DyrectedError {
|
|
197
|
+
constructor(message: string);
|
|
198
|
+
}
|
|
199
|
+
/** A unique constraint or unique index was violated on insert/update. Answered with `409`. */
|
|
200
|
+
declare class DuplicateKeyError extends ConflictError {
|
|
201
|
+
readonly field?: string;
|
|
202
|
+
readonly value?: any;
|
|
203
|
+
constructor(message: string, options?: {
|
|
204
|
+
field?: string;
|
|
205
|
+
value?: any;
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
158
209
|
type SortDirection = 'ASC' | 'DESC';
|
|
159
210
|
interface SortClause {
|
|
160
211
|
field: string;
|
|
@@ -725,6 +776,17 @@ declare function displayCustom<TDoc = any>(name: string, options?: DetailCustomO
|
|
|
725
776
|
* Alias for `displayCustom` to render a custom component in a Detail View layout.
|
|
726
777
|
*/
|
|
727
778
|
declare function displayCustomComponent<TDoc = any>(name: string, options?: DetailCustomOptions<TDoc>): DetailCustom<TDoc>;
|
|
779
|
+
/**
|
|
780
|
+
* Renders a button for a named action (defined in `collection.actions`) at this
|
|
781
|
+
* position in a Detail View — the same action, dialog, and execution as the
|
|
782
|
+
* header toolbar, just placed inline.
|
|
783
|
+
*
|
|
784
|
+
* @example
|
|
785
|
+
* ```ts
|
|
786
|
+
* displayAction('markShipped', { variant: 'default', span: 4 })
|
|
787
|
+
* ```
|
|
788
|
+
*/
|
|
789
|
+
declare function displayAction(name: string, options?: DetailActionOptions): DetailAction;
|
|
728
790
|
/**
|
|
729
791
|
* Evaluates server-side computed functions and JEXL expressions from a detail schema
|
|
730
792
|
* and attaches them to `doc._meta.computed`.
|
|
@@ -1267,6 +1329,70 @@ interface SanitizeDocForAIOptions {
|
|
|
1267
1329
|
*/
|
|
1268
1330
|
declare function sanitizeDocForAI(options: SanitizeDocForAIOptions): Record<string, unknown>;
|
|
1269
1331
|
|
|
1332
|
+
declare const NANOID_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
|
|
1333
|
+
declare const BASE62_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
1334
|
+
declare const CROCKFORD_BASE32 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
1335
|
+
/**
|
|
1336
|
+
* Generates an unbiased cryptographically secure NanoID string.
|
|
1337
|
+
*
|
|
1338
|
+
* @param size Number of characters to generate (default: 21)
|
|
1339
|
+
* @param alphabet Characters to draw from (default: URL-safe Base64 alphanumeric)
|
|
1340
|
+
*/
|
|
1341
|
+
declare function nanoid(size?: number, alphabet?: string): string;
|
|
1342
|
+
/**
|
|
1343
|
+
* Generates a 26-character time-sortable ULID (Universally Unique Lexicographically Sortable Identifier).
|
|
1344
|
+
*
|
|
1345
|
+
* The first 10 characters encode the millisecond timestamp, followed by 16 cryptographically secure
|
|
1346
|
+
* random Crockford Base32 characters. ULIDs sort in chronological order, making them optimal
|
|
1347
|
+
* for B-tree index locality in relational databases.
|
|
1348
|
+
*
|
|
1349
|
+
* @param seedTime Optional millisecond timestamp (default: Date.now())
|
|
1350
|
+
*/
|
|
1351
|
+
declare function ulid(seedTime?: number): string;
|
|
1352
|
+
/**
|
|
1353
|
+
* Standard RFC 4122 UUIDv4 generator wrapper.
|
|
1354
|
+
*/
|
|
1355
|
+
declare function uuid(): string;
|
|
1356
|
+
/**
|
|
1357
|
+
* Resolves a clean 3-4 character prefix for a collection slug or explicit prefix.
|
|
1358
|
+
*
|
|
1359
|
+
* @example
|
|
1360
|
+
* resolvePrefix('cob-daily-reports') // 'cob'
|
|
1361
|
+
* resolvePrefix('ipo-reservations') // 'ipo'
|
|
1362
|
+
* resolvePrefix('users') // 'usr'
|
|
1363
|
+
* resolvePrefix('applications') // 'app'
|
|
1364
|
+
* resolvePrefix('anything', 'custom') // 'custom'
|
|
1365
|
+
*/
|
|
1366
|
+
declare function resolvePrefix(slug?: string, explicitPrefix?: string): string;
|
|
1367
|
+
/**
|
|
1368
|
+
* Generates a Stripe-style prefixed NanoID (e.g. `col_k9pQ2mZwRtx89aB1`).
|
|
1369
|
+
*
|
|
1370
|
+
* Uses Base62 for the random suffix to prevent extra underscores and hyphens in the ID body.
|
|
1371
|
+
*
|
|
1372
|
+
* @param prefix Collection prefix (e.g. 'usr', 'cob', 'app', 'col')
|
|
1373
|
+
* @param size Length of the random suffix (default: 16)
|
|
1374
|
+
*/
|
|
1375
|
+
declare function prefixedId(prefix?: string, size?: number): string;
|
|
1376
|
+
|
|
1377
|
+
interface GenerateIdOptions {
|
|
1378
|
+
prefix?: string;
|
|
1379
|
+
type?: IdStrategy;
|
|
1380
|
+
size?: number;
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Generates an ID according to the specified options. Defaults to Stripe-style prefixed NanoID.
|
|
1384
|
+
*/
|
|
1385
|
+
declare function generateId(options?: GenerateIdOptions | string): string;
|
|
1386
|
+
/**
|
|
1387
|
+
* Generates a document ID based on collection configuration or slug.
|
|
1388
|
+
*/
|
|
1389
|
+
declare function generateDocumentId(collectionOrSlug?: string | {
|
|
1390
|
+
slug: string;
|
|
1391
|
+
idPrefix?: string;
|
|
1392
|
+
idType?: IdStrategy;
|
|
1393
|
+
idGenerator?: (slug: string) => string;
|
|
1394
|
+
}): string;
|
|
1395
|
+
|
|
1270
1396
|
type TopLevelFieldName<TFields extends readonly Field[]> = Extract<TFields[number], {
|
|
1271
1397
|
name: string;
|
|
1272
1398
|
}>["name"];
|
|
@@ -1763,4 +1889,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
|
|
|
1763
1889
|
fields: T;
|
|
1764
1890
|
}): T;
|
|
1765
1891
|
|
|
1766
|
-
export { AIConfig, type AIErrorCode, AIPIIConfig, type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, 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, type ExtractCollectionSlugs, Field, FieldConditionBuilder, FieldType, 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, asCollection, 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, getAdminRoleForCollection, getAllowedSitesForUser, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, isSiteAuthorized, isUserAdmin, 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 };
|
|
1892
|
+
export { AIConfig, type AIErrorCode, AIPIIConfig, type AccessConditions, AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BASE62_ALPHABET, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BooleanField, CROCKFORD_BASE32, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, ConflictError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailAction, DetailActionOptions, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DuplicateKeyError, DyrectedAIError, DyrectedConfig, DyrectedError, EmailField, type ExprFunction, type ExtractCollectionSlugs, Field, FieldConditionBuilder, FieldType, ForbiddenError, type GenerateIdOptions, GlobalConfig, HookRequestContext, IconField, IdStrategy, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MatchBuilder, MultiSelectField, NANOID_ALPHABET, NON_NEGOTIABLE_CREDENTIAL_FIELDS, NotFoundError, 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, ValidationError, WORKFLOW_HISTORY_COLLECTION, type WhenFunction, WorkflowConfig, WorkflowTransition, abs, addDays, asCollection, 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, displayAction, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, expr, first, floor, formatConfigDiagnostics, formatDate, formatJexlValue, generateDefaultDetailSchema, generateDocumentId, generateId, generateOpenApi, get, getAdminAuthCollection, getAdminRoleForCollection, getAllowedSitesForUser, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, isSiteAuthorized, isUserAdmin, join, last, length, lower, maskEmail, maskPhone, maskTextPII, materializeWorkflowDocument, max, min, nanoid, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseSort, pow, prefixedId, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, resolveAuthorizedSiteId, resolvePrefix, round, runCollectionHooks, sanitizeDocForAI, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, ulid, unique, upper, uuid, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, when, wordCount, workflowCapabilities };
|