@stndrds/schema 0.1.0-alpha.21 → 0.1.0-alpha.23
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/chunk-7GLSGSUP.mjs +9456 -0
- package/dist/chunk-AZTBTKHP.mjs +9861 -0
- package/dist/chunk-B74KNXDP.mjs +9457 -0
- package/dist/chunk-CVFKFFCX.mjs +9912 -0
- package/dist/chunk-DXVIUNQT.mjs +9881 -0
- package/dist/chunk-EJB2V42F.mjs +9778 -0
- package/dist/chunk-GP2BONBI.mjs +9493 -0
- package/dist/chunk-H2KOC7F5.mjs +9549 -0
- package/dist/chunk-HXLOIN36.mjs +9893 -0
- package/dist/chunk-HYW67ZP6.mjs +9500 -0
- package/dist/chunk-IKUIWNHZ.mjs +9460 -0
- package/dist/chunk-JAWKNHY6.mjs +9553 -0
- package/dist/chunk-KT4UPBZR.mjs +9892 -0
- package/dist/chunk-NBCCRCJB.mjs +9547 -0
- package/dist/chunk-NN7Y3B3A.mjs +9859 -0
- package/dist/chunk-SBEZDUNH.mjs +9549 -0
- package/dist/chunk-TTZ3TWYP.mjs +9583 -0
- package/dist/chunk-UTZTDUIK.mjs +9818 -0
- package/dist/index.d.mts +172 -17
- package/dist/index.d.ts +172 -17
- package/dist/index.js +977 -512
- package/dist/index.mjs +71 -23
- package/dist/runtime-BFOdkIqK.d.mts +7644 -0
- package/dist/runtime-BFOdkIqK.d.ts +7644 -0
- package/dist/runtime-BI_wXiVl.d.mts +8043 -0
- package/dist/runtime-BI_wXiVl.d.ts +8043 -0
- package/dist/runtime-BZZRu7A1.d.mts +7083 -0
- package/dist/runtime-BZZRu7A1.d.ts +7083 -0
- package/dist/runtime-BlcFbbeG.d.mts +8035 -0
- package/dist/runtime-BlcFbbeG.d.ts +8035 -0
- package/dist/runtime-BleOubTG.d.mts +7236 -0
- package/dist/runtime-BleOubTG.d.ts +7236 -0
- package/dist/runtime-CC4VRtUK.d.mts +7422 -0
- package/dist/runtime-CC4VRtUK.d.ts +7422 -0
- package/dist/runtime-CKLGO3Jk.d.mts +7632 -0
- package/dist/runtime-CKLGO3Jk.d.ts +7632 -0
- package/dist/runtime-CjhnsVyg.d.mts +7668 -0
- package/dist/runtime-CjhnsVyg.d.ts +7668 -0
- package/dist/runtime-CmYcicVr.d.mts +7083 -0
- package/dist/runtime-CmYcicVr.d.ts +7083 -0
- package/dist/runtime-D01tNFxT.d.mts +7418 -0
- package/dist/runtime-D01tNFxT.d.ts +7418 -0
- package/dist/runtime-DWCd3xCL.d.mts +7632 -0
- package/dist/runtime-DWCd3xCL.d.ts +7632 -0
- package/dist/runtime-DbryZGqb.d.mts +8037 -0
- package/dist/runtime-DbryZGqb.d.ts +8037 -0
- package/dist/runtime-DdkNFkKd.d.mts +7185 -0
- package/dist/runtime-DdkNFkKd.d.ts +7185 -0
- package/dist/runtime-DnnW72ZF.d.mts +7451 -0
- package/dist/runtime-DnnW72ZF.d.ts +7451 -0
- package/dist/runtime-DrrCWvBr.d.mts +7451 -0
- package/dist/runtime-DrrCWvBr.d.ts +7451 -0
- package/dist/runtime-UYkiPdud.d.mts +8047 -0
- package/dist/runtime-UYkiPdud.d.ts +8047 -0
- package/dist/runtime-g7XZnqGw.d.mts +7452 -0
- package/dist/runtime-g7XZnqGw.d.ts +7452 -0
- package/dist/runtime-jnV5WCS6.d.mts +8047 -0
- package/dist/runtime-jnV5WCS6.d.ts +8047 -0
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +855 -466
- package/dist/runtime.mjs +29 -3
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DateAttribute, U as UserAttribute, A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute, R as RichtextAttribute, c as RichtextFeature, N as NumberAttribute, C as CheckboxAttribute, P as PhoneAttribute, d as CurrencyAttribute, e as Option, f as StatusAttribute, g as SelectAttribute, M as MultiselectAttribute, L as LocationAttribute, F as FileAttribute, h as SingleRelationAttribute, i as MultiRelationAttribute, j as RelationTarget, k as RatingAttribute, l as FormulaAttribute, m as FormulaReturnType, n as RollupAttribute, o as RollupFunction, p as FlowDefinition, q as FlowPage, r as FlowRow, I as InferAttributeValue, s as ObjectDefinition, t as Field, u as AttributeGroupField, G as Group, V as ViewDefinition, v as Tab, B as BlockNoteContent } from './runtime-UYkiPdud.mjs';
|
|
2
|
+
export { bV as ActivityTab, bb as AddAttribute, eo as AddAttributeInput, aK as AdvancedFilterState, bI as AssignRoleInput, dU as AttributeChange, y as AttributeGroup, ba as AttributeMap, b6 as AttributeSchema, w as AttributeType, e4 as AttributesRepository, ah as AuditAction, ai as AuditActorType, aj as AuditChange, am as AuditListOptions, ak as AuditLogEntry, ea as AuditRepository, ag as AuditResourceType, ed as AuditService, an as AuditServiceOptions, z as BaseAttribute, $ as BlockNoteBlock, a0 as BlockNoteCustomInlineContent, a1 as BlockNoteDefaultProps, a2 as BlockNoteInlineContent, a3 as BlockNoteLink, a4 as BlockNoteStyledText, a5 as BlockNoteStyles, a6 as BlockNoteTableCell, a7 as BlockNoteTableCellProps, a8 as BlockNoteTableContent, av as CheckboxFilterOperator, bw as CompletionStatus, al as CreateAuditLogInput, en as CreateCustomObjectInput, fc as CreateDBAttribute, fq as CreateDBFlow, f8 as CreateDBObject, fm as CreateDBView, ar as CreateFile, ei as CreateFlowInput, ff as CreateObjectRecord, bH as CreatePermissionInput, bF as CreateRoleInput, bP as CreateUserProfile, eN as CreateViewInput, Q as Currency, aC as CurrencyFilterValue, bf as CustomAttributeValue, bU as CustomTab, fb as DBAttribute, fp as DBFlow, f7 as DBObject, fl as DBView, f2 as DEFAULT_LABEL_FALLBACK, d0 as DatabaseAdapter, aw as DateFilterOperator, H as DateFormat, J as DateValue, bC as EffectivePermissions, aG as ExtendedFilterRule, bp as ExtractAttributes, bj as ExtractRecord, bl as ExtractRecordInput, bm as ExtractRecordInputStrict, bk as ExtractRecordStrict, bn as ExtractRecordUpdate, bo as ExtractRecordUpdateStrict, d1 as FetchResult, aq as File, eQ as FileContent, fk as FileListOptions, eh as FileService, eg as FileServiceOptions, ap as FileVisibility, e6 as FilesRepository, aH as FilterCombinator, aJ as FilterGroup, aA as FilterOperator, aF as FilterRule, aI as FilterState, aE as FilterValue, aX as FlowRelation, aW as FlowRowField, ek as FlowService, aV as FlowSlot, aY as FlowStatus, e9 as FlowsRepository, bS as FormTab, d2 as FormattedRecord, dC as FormulaResult, f0 as FullSyncOptions, e$ as FullSyncResult, b4 as GeocodingAdapter, b1 as GeocodingAutocompleteParams, b3 as GeocodingParams, el as GeocodingService, b0 as GeocodingSuggestion, eA as GetRelationOptionsParams, fi as GlobalSearchOptions, fj as GlobalSearchResultItem, em as GlobalSearchService, d3 as GroupedFetchResult, dV as HookContext, dW as HookDefinition, dX as HookHandler, d_ as HookRegistry, dY as HookType, bc as InferRecord, b7 as InferRecordFromSchema, bd as InferRecordInput, be as InferRecordUpdate, b8 as InferRecordWithRequirements, d4 as InsertOptions, dG as InvalidPathError, fg as ListOptions, W as Location, X as LocationGranularity, dH as MaxDepthExceededError, ay as MultiselectFilterOperator, aT as NO_VALUE_OPERATORS, aS as NoValueOperator, b5 as NoopGeocodingAdapter, dZ as NoopHookRegistry, bW as NotesTab, au as NumberFilterOperator, E as NumberUnit, aR as OPERATORS_BY_TYPE, bv as ObjectAttribute, bD as ObjectPermissions, bx as ObjectRecord, e7 as ObjectRecordsRepository, er as ObjectSchemaService, eq as ObjectSchemaServiceOptions, e3 as ObjectsRepository, fs as OperationResult, a9 as PartialBlockNoteBlock, aa as PartialBlockNoteContent, ab as PartialBlockNoteInlineContent, ac as PartialBlockNoteLink, ad as PartialBlockNoteStyledText, ae as PartialBlockNoteTableCell, af as PartialBlockNoteTableContent, dL as PathCardinality, dM as PathSegment, dN as PathSegmentType, bA as Permission, by as PermissionScope, et as PermissionService, es as PermissionServiceOptions, eb as PermissionsRepository, K as Phone, aD as PhoneFilterValue, bJ as PolicyContext, e1 as PolicyRegistry, bL as PolicyViolationError, dg as QueryBuilder, d5 as QueryBuilderState, dc as QueryMultipleResultsError, dd as QueryNoResultError, aQ as QueryState, Y as RELATION_TARGET_ANY, bq as RESERVED_ATTRIBUTE_NAMES, bh as RecordMetadata, bK as RecordPolicy, ev as RecordService, eu as RecordServiceOptions, d6 as RegistryMap, d7 as RegistryObjectNames, Z as RelationAttribute, az as RelationFilterOperator, ey as RelationOption, ez as RelationOptionsResponse, eD as RelationResolverService, eB as RelationService, ex as RelationValidationError, ew as RelationValidationResult, aB as RelativeDateValue, bs as ReservedAttributeName, eC as ResolvedRelations, b2 as ReverseGeocodingParams, bz as Role, eE as RollupResult, eH as RollupScheduler, eG as RollupSchedulerOptions, eF as RollupService, de as SHORTCUT_TO_FILTER_OPERATOR, br as SYSTEM_FIELD_NAMES, dO as SchemaResolver, fh as SearchOptions, ax as SelectFilterOperator, d8 as ShortcutOperator, eT as SignedUrlOptions, aO as SortDirection, aP as SortRule, x as StatusGroup, eU as StorageAdapter, ao as StorageProvider, eR as StorageUploadInput, eS as StorageUploadResult, eX as SyncOptions, eW as SyncResult, bt as SystemFieldName, bi as SystemFields, bE as SystemPermissions, bR as TabType, bT as TableTab, ef as TenantAwareRepository, ee as TenantAwareService, dp as TenantContext, dh as TenantContextError, c1 as TenantId, at as TextFilterOperator, bu as Timestamps, dS as TraversalOptions, dT as TraversalResult, b9 as TypedAttribute, fd as UpdateDBAttribute, fr as UpdateDBFlow, f9 as UpdateDBObject, fn as UpdateDBView, as as UpdateFile, ej as UpdateFlowInput, ep as UpdateObjectInput, bG as UpdateRoleInput, bQ as UpdateUserProfile, eO as UpdateViewInput, eV as UploadFileInput, fe as UpsertDBAttribute, fa as UpsertDBObject, fo as UpsertDBView, c2 as UserId, bO as UserProfile, eJ as UserProfileService, eI as UserProfileServiceOptions, e5 as UserProfilesRepository, bM as UserRole, bB as UserRoleAssignment, eM as UserService, bN as UserStatus, eL as UserValidationError, eK as UserValidationResult, c0 as Uuid, cS as ValidationResult, eP as ViewService, fu as ViewSyncOptions, ft as ViewSyncResult, e8 as ViewsRepository, bg as WithCustomAttributes, c3 as asTenantId, c4 as asUserId, cr as attributeConfigSchemas, ec as buildAuditChanges, cd as checkboxConfigSchema, c$ as computeRecordStatus, cQ as createAttributeValidator, cy as createCheckboxValidator, cB as createCurrencyValidator, cz as createDateValidator, d9 as createDefaultState, cW as createDraftValidator, cG as createFileValidator, cM as createFormulaValidator, cF as createLocationValidator, d$ as createMockAdapter, cJ as createMultiRelationValidator, cE as createMultiselectValidator, cx as createNumberValidator, cR as createObjectValidator, cA as createPhoneValidator, df as createQueryBuilder, cL as createRatingValidator, cK as createRelationValidator, cP as createRichtextValidator, cN as createRollupValidator, cD as createSelectValidator, cI as createSingleRelationValidator, cC as createStatusValidator, cO as createTextAreaValidator, cw as createTextValidator, cH as createUserValidator, cg as currencyConfigSchema, ce as dateConfigSchema, e0 as defaultPolicyRegistry, f6 as enrichValuesWithSelectLabels, dq as evaluateFormula, dr as evaluateFormulaAttribute, ds as evaluateFormulaAttributeWithRelations, dt as evaluateFormulaWithRelations, du as evaluateFormulaWithResult, f5 as extractAttributeNames, dv as extractFormulaVariables, dw as extractRelationNames, dx as extractRelationReferences, cl as fileConfigSchema, dy as flattenRelationsForEval, dz as formatFormulaResult, da as formatRecord, db as formatRecords, cp as formulaConfigSchema, c5 as generateId, c6 as generatePrefixedId, cs as getAttributeConfigSchema, di as getContext, cZ as getMissingRequiredAttributes, dD as getPathDepth, dE as getRelationPath, e_ as getSyncPreview, dF as getTargetAttributeName, dj as getTenantId, dk as getUserId, fx as getViewSyncPreview, dl as hasContext, dA as hasRelationReferences, b_ as isActivityTab, aL as isAdvancedFilterState, bZ as isCustomTab, aZ as isFlowDefinition, a_ as isFlowPublished, bX as isFormTab, f4 as isLabelExpression, aU as isNoValueOperator, b$ as isNotesTab, c_ as isRecordComplete, a$ as isSystemFlow, bY as isTableTab, _ as isUniversalRelation, ci as locationConfigSchema, ck as multiselectConfigSchema, e2 as notesPolicy, cc as numberConfigSchema, cu as parseAttributeConfig, dI as parsePath, dJ as pathHasManyCardinality, cf as phoneConfigSchema, co as ratingConfigSchema, c7 as registry, cn as relationConfigSchema, f3 as renderLabelExpression, dP as resolveMultiplePaths, dQ as resolveSingleValue, cb as richtextConfigSchema, cq as rollupConfigSchema, dm as runWithContext, cv as safeParseAttributeConfig, cj as selectConfigSchema, ch as statusConfigSchema, f1 as syncAll, eY as syncNativeObjects, fv as syncNativeViews, c9 as textConfigSchema, ca as textareaConfigSchema, aM as toAdvancedFilterState, aN as toSimpleFilterState, dR as traversePath, cm as userConfigSchema, cT as validateAttribute, ct as validateAttributeConfig, cX as validateDraft, cY as validateDraftOrThrow, dB as validateFormulaExpression, cU as validateObject, cV as validateObjectOrThrow, dK as validatePath, eZ as verifyNativeObjectsSync, fw as verifyNativeViewsSync, c8 as viewRegistry, dn as withTenantContext } from './runtime-UYkiPdud.mjs';
|
|
3
3
|
import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
@@ -107,6 +107,49 @@ declare class ObjectReferencedError extends Error {
|
|
|
107
107
|
constructor(objectName: string, referencingObjects: string[]);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* System attribute union type
|
|
112
|
+
*/
|
|
113
|
+
type SystemAttribute = DateAttribute | UserAttribute;
|
|
114
|
+
/**
|
|
115
|
+
* System attributes available on all records.
|
|
116
|
+
* These are managed automatically by the system and cannot be edited by users.
|
|
117
|
+
*
|
|
118
|
+
* They use the same types as regular attributes so they work seamlessly
|
|
119
|
+
* with the UI (mapAttributeToCellOpts, DataGrid columns, etc.).
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* import { SYSTEM_ATTRIBUTES, getSystemAttributeList } from "@stndrds/schema";
|
|
124
|
+
*
|
|
125
|
+
* // Get all attributes including system ones
|
|
126
|
+
* const allAttributes = [
|
|
127
|
+
* ...object.attributes,
|
|
128
|
+
* ...getSystemAttributeList(),
|
|
129
|
+
* ];
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare const SYSTEM_ATTRIBUTES: Record<string, SystemAttribute>;
|
|
133
|
+
/**
|
|
134
|
+
* Get all system attributes as an array
|
|
135
|
+
* Use this to append system attributes to an object's attribute list
|
|
136
|
+
*/
|
|
137
|
+
declare function getSystemAttributeList(): SystemAttribute[];
|
|
138
|
+
/**
|
|
139
|
+
* System attribute names as a union type
|
|
140
|
+
*/
|
|
141
|
+
type SystemAttributeName = keyof typeof SYSTEM_ATTRIBUTES;
|
|
142
|
+
/**
|
|
143
|
+
* Check if an attribute name is a system attribute
|
|
144
|
+
*/
|
|
145
|
+
declare function isSystemAttribute(name: string): name is SystemAttributeName;
|
|
146
|
+
/**
|
|
147
|
+
* Check if an attribute is a system attribute by its properties
|
|
148
|
+
*/
|
|
149
|
+
declare function isSystemAttributeObject(attr: {
|
|
150
|
+
system?: boolean;
|
|
151
|
+
}): boolean;
|
|
152
|
+
|
|
110
153
|
/**
|
|
111
154
|
* Default empty value placeholder
|
|
112
155
|
*/
|
|
@@ -463,6 +506,56 @@ declare class TextAreaAttributeBuilder<TName extends string, TRequired extends b
|
|
|
463
506
|
optional(): TextAreaAttributeBuilder<TName, false>;
|
|
464
507
|
}
|
|
465
508
|
declare function textarea<TName extends string>(config: TypedBuilderConfig<TName>): TextAreaAttributeBuilder<TName, false>;
|
|
509
|
+
/**
|
|
510
|
+
* Builder for richtext attributes (Tiptap editor)
|
|
511
|
+
*/
|
|
512
|
+
declare class RichtextAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<RichtextAttribute> {
|
|
513
|
+
readonly _types: {
|
|
514
|
+
name: TName;
|
|
515
|
+
attribute: RichtextAttribute;
|
|
516
|
+
required: TRequired;
|
|
517
|
+
};
|
|
518
|
+
constructor(name: TName, label: string);
|
|
519
|
+
/**
|
|
520
|
+
* Set enabled features for the richtext editor
|
|
521
|
+
* If not called, all features are enabled by default
|
|
522
|
+
*
|
|
523
|
+
* @param list - Array of features to enable
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* ```typescript
|
|
527
|
+
* richtext({ name: "content", label: "Content" })
|
|
528
|
+
* .features(["headings", "bold", "italic", "lists", "links"])
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
features(list: RichtextFeature[]): this;
|
|
532
|
+
required(): RichtextAttributeBuilder<TName, true>;
|
|
533
|
+
optional(): RichtextAttributeBuilder<TName, false>;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Create a richtext attribute builder for Tiptap-based rich text content
|
|
537
|
+
*
|
|
538
|
+
* @example Basic usage
|
|
539
|
+
* ```typescript
|
|
540
|
+
* richtext({ name: "content", label: "Content" })
|
|
541
|
+
* .required()
|
|
542
|
+
* ```
|
|
543
|
+
*
|
|
544
|
+
* @example With specific features
|
|
545
|
+
* ```typescript
|
|
546
|
+
* richtext({ name: "description", label: "Description" })
|
|
547
|
+
* .features(["headings", "bold", "italic", "lists", "links"])
|
|
548
|
+
* .placeholder("Write something...")
|
|
549
|
+
* ```
|
|
550
|
+
*
|
|
551
|
+
* @example Full-featured (notes, articles)
|
|
552
|
+
* ```typescript
|
|
553
|
+
* richtext({ name: "body", label: "Body" })
|
|
554
|
+
* .features(["headings", "bold", "italic", "lists", "links", "images", "codeBlocks", "tables"])
|
|
555
|
+
* .required()
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
declare function richtext<TName extends string>(config: TypedBuilderConfig<TName>): RichtextAttributeBuilder<TName, false>;
|
|
466
559
|
declare class NumberAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<NumberAttribute> {
|
|
467
560
|
readonly _types: {
|
|
468
561
|
name: TName;
|
|
@@ -600,18 +693,6 @@ declare class LocationAttributeBuilder<TName extends string, TRequired extends b
|
|
|
600
693
|
optional(): LocationAttributeBuilder<TName, false>;
|
|
601
694
|
}
|
|
602
695
|
declare function location<TName extends string>(config: TypedBuilderConfig<TName>): LocationAttributeBuilder<TName, false>;
|
|
603
|
-
declare class TimestampAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<TimestampAttribute> {
|
|
604
|
-
readonly _types: {
|
|
605
|
-
name: TName;
|
|
606
|
-
attribute: TimestampAttribute;
|
|
607
|
-
required: TRequired;
|
|
608
|
-
};
|
|
609
|
-
constructor(name: TName, label: string);
|
|
610
|
-
autoUpdate(): this;
|
|
611
|
-
required(): TimestampAttributeBuilder<TName, true>;
|
|
612
|
-
optional(): TimestampAttributeBuilder<TName, false>;
|
|
613
|
-
}
|
|
614
|
-
declare function timestamp<TName extends string>(config: TypedBuilderConfig<TName>): TimestampAttributeBuilder<TName, false>;
|
|
615
696
|
declare class FileAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<FileAttribute> {
|
|
616
697
|
readonly _types: {
|
|
617
698
|
name: TName;
|
|
@@ -622,7 +703,6 @@ declare class FileAttributeBuilder<TName extends string, TRequired extends boole
|
|
|
622
703
|
maxFiles(value: number): this;
|
|
623
704
|
maxSize(bytes: number): this;
|
|
624
705
|
allowedTypes(types: MimeType[] | readonly MimeType[]): this;
|
|
625
|
-
verification(config: FileAttribute["verification"]): this;
|
|
626
706
|
/**
|
|
627
707
|
* Allow multiple files to be uploaded
|
|
628
708
|
*/
|
|
@@ -679,6 +759,18 @@ declare class SingleRelationAttributeBuilder<TName extends string, TRequired ext
|
|
|
679
759
|
* @param options - Display template and filter options
|
|
680
760
|
*/
|
|
681
761
|
to(objectName: string, options?: RelationTargetOptions): this;
|
|
762
|
+
/**
|
|
763
|
+
* Allow linking to any object in the tenant (universal polymorphic)
|
|
764
|
+
* Creates a relation with `targets: [{ object: "*" }]`
|
|
765
|
+
*
|
|
766
|
+
* @example
|
|
767
|
+
* ```typescript
|
|
768
|
+
* relation({ name: "linkedTo", label: "Linked To" })
|
|
769
|
+
* .toAny()
|
|
770
|
+
* .hidden()
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
toAny(): this;
|
|
682
774
|
/**
|
|
683
775
|
* Convert to a multi-relation (cardinality: "many")
|
|
684
776
|
*/
|
|
@@ -702,6 +794,18 @@ declare class MultiRelationAttributeBuilder<TName extends string, TRequired exte
|
|
|
702
794
|
* @param options - Display template and filter options
|
|
703
795
|
*/
|
|
704
796
|
to(objectName: string, options?: RelationTargetOptions): this;
|
|
797
|
+
/**
|
|
798
|
+
* Allow linking to any object in the tenant (universal polymorphic)
|
|
799
|
+
* Creates a relation with `targets: [{ object: "*" }]`
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```typescript
|
|
803
|
+
* relation({ name: "linkedItems", label: "Linked Items" })
|
|
804
|
+
* .toAny()
|
|
805
|
+
* .many()
|
|
806
|
+
* ```
|
|
807
|
+
*/
|
|
808
|
+
toAny(): this;
|
|
705
809
|
/**
|
|
706
810
|
* Set minimum number of relations required
|
|
707
811
|
*/
|
|
@@ -868,7 +972,7 @@ declare function rollup<TName extends string>(config: TypedBuilderConfig<TName>)
|
|
|
868
972
|
/**
|
|
869
973
|
* Union of all attribute builder types
|
|
870
974
|
*/
|
|
871
|
-
type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> |
|
|
975
|
+
type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | RichtextAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean> | FormulaAttributeBuilder<string> | RollupAttributeBuilder<string>;
|
|
872
976
|
/**
|
|
873
977
|
* Extract the attribute name from a builder
|
|
874
978
|
*/
|
|
@@ -1591,4 +1695,55 @@ declare function view(name: string, label: string): ViewBuilder;
|
|
|
1591
1695
|
*/
|
|
1592
1696
|
declare function group(id: string, label: string): GroupBuilder;
|
|
1593
1697
|
|
|
1594
|
-
|
|
1698
|
+
/**
|
|
1699
|
+
* Native Notes Object
|
|
1700
|
+
*
|
|
1701
|
+
* A Notion-like notes system that can be attached to any record or used globally.
|
|
1702
|
+
* Notes support rich text content via Tiptap editor.
|
|
1703
|
+
*
|
|
1704
|
+
* Features:
|
|
1705
|
+
* - Polymorphic linking to any object/record via `linkedTo` relation
|
|
1706
|
+
* - Private (createdBy-only) or shared (tenant-wide) visibility
|
|
1707
|
+
* - Rich text content with BlockNote
|
|
1708
|
+
* - Extensible via custom attributes
|
|
1709
|
+
*
|
|
1710
|
+
* The author of a note is determined by the system field `createdBy`,
|
|
1711
|
+
* which is automatically set when a record is created.
|
|
1712
|
+
*
|
|
1713
|
+
* Access control is enforced by NotesPolicy:
|
|
1714
|
+
* - Private notes: only visible/editable by createdBy
|
|
1715
|
+
* - Shared notes: visible/editable by all tenant members
|
|
1716
|
+
* - Delete: only createdBy can delete any note
|
|
1717
|
+
*
|
|
1718
|
+
* @example Linked to a record
|
|
1719
|
+
* ```typescript
|
|
1720
|
+
* const note = {
|
|
1721
|
+
* title: "Meeting notes",
|
|
1722
|
+
* content: { type: "doc", content: [...] },
|
|
1723
|
+
* visibility: "shared",
|
|
1724
|
+
* linkedTo: "rec-456" // Can be any record from any object
|
|
1725
|
+
* };
|
|
1726
|
+
* // createdBy is set automatically by RecordService
|
|
1727
|
+
* ```
|
|
1728
|
+
*
|
|
1729
|
+
* @example Global note (not linked)
|
|
1730
|
+
* ```typescript
|
|
1731
|
+
* const note = {
|
|
1732
|
+
* title: "My private thoughts",
|
|
1733
|
+
* content: { type: "doc", content: [...] },
|
|
1734
|
+
* visibility: "private",
|
|
1735
|
+
* linkedTo: null
|
|
1736
|
+
* };
|
|
1737
|
+
* ```
|
|
1738
|
+
*/
|
|
1739
|
+
/**
|
|
1740
|
+
* Notes object definition
|
|
1741
|
+
*/
|
|
1742
|
+
declare const NOTES: ObjectBuilder<{
|
|
1743
|
+
visibility: "private" | "shared";
|
|
1744
|
+
title: string;
|
|
1745
|
+
content: BlockNoteContent;
|
|
1746
|
+
linkedTo?: string | undefined;
|
|
1747
|
+
}>;
|
|
1748
|
+
|
|
1749
|
+
export { ALL_SYSTEM_RESOURCES, type AnyAttributeBuilder, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, type AttributeUsage, BlockNoteContent, type BuilderConfig, CheckboxAttribute, CurrencyAttribute, CustomTabConfig, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type ExtractAttributeName, type ExtractAttributeRequired, Field, FileAttribute, FileNotFoundError, FlowBuilder, FlowDefinition, FlowPage, FlowPageBuilder, FlowRow, FlowRowBuilder, ForbiddenError, FormulaAttribute, FormulaReturnType, Group, GroupBuilder, InferAttributeValue, LocationAttribute, MultiRelationAttribute, MultiselectAttribute, NOTES, NotFoundError, NotSystemObjectError, NumberAttribute, ObjectAction, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, ObjectReferencedError, Option, PhoneAttribute, ProtectedResourceError, ProtectedRoleError, RatingAttribute, RecordNotFoundError, type RecordReference, RecordReferencedError, RelationTarget, RichtextAttribute, RichtextFeature, RoleNotFoundError, RollupAttribute, RollupFunction, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, SelectAttribute, SingleRelationAttribute, StatusAttribute, SyncError, SystemAction, type SystemAttribute, type SystemAttributeName, SystemResource, Tab, TabBuilder, TableTabConfig, TextAreaAttribute, TextAttribute, type TypedBuilderConfig, UserAttribute, UserProfileNotFoundError, ValidationError, type ValidationErrorDetail, ViewBuilder, ViewDefinition, checkbox, currency, date, file, flow, formatAttributeValue, formula, getSystemAttributeList, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isSystemAttribute, isSystemAttributeObject, isValidationError, location, multiselect, number, object, phone, rating, relation, richtext, rollup, select, status, text, textarea, user, view };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DateAttribute, U as UserAttribute, A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute, R as RichtextAttribute, c as RichtextFeature, N as NumberAttribute, C as CheckboxAttribute, P as PhoneAttribute, d as CurrencyAttribute, e as Option, f as StatusAttribute, g as SelectAttribute, M as MultiselectAttribute, L as LocationAttribute, F as FileAttribute, h as SingleRelationAttribute, i as MultiRelationAttribute, j as RelationTarget, k as RatingAttribute, l as FormulaAttribute, m as FormulaReturnType, n as RollupAttribute, o as RollupFunction, p as FlowDefinition, q as FlowPage, r as FlowRow, I as InferAttributeValue, s as ObjectDefinition, t as Field, u as AttributeGroupField, G as Group, V as ViewDefinition, v as Tab, B as BlockNoteContent } from './runtime-UYkiPdud.js';
|
|
2
|
+
export { bV as ActivityTab, bb as AddAttribute, eo as AddAttributeInput, aK as AdvancedFilterState, bI as AssignRoleInput, dU as AttributeChange, y as AttributeGroup, ba as AttributeMap, b6 as AttributeSchema, w as AttributeType, e4 as AttributesRepository, ah as AuditAction, ai as AuditActorType, aj as AuditChange, am as AuditListOptions, ak as AuditLogEntry, ea as AuditRepository, ag as AuditResourceType, ed as AuditService, an as AuditServiceOptions, z as BaseAttribute, $ as BlockNoteBlock, a0 as BlockNoteCustomInlineContent, a1 as BlockNoteDefaultProps, a2 as BlockNoteInlineContent, a3 as BlockNoteLink, a4 as BlockNoteStyledText, a5 as BlockNoteStyles, a6 as BlockNoteTableCell, a7 as BlockNoteTableCellProps, a8 as BlockNoteTableContent, av as CheckboxFilterOperator, bw as CompletionStatus, al as CreateAuditLogInput, en as CreateCustomObjectInput, fc as CreateDBAttribute, fq as CreateDBFlow, f8 as CreateDBObject, fm as CreateDBView, ar as CreateFile, ei as CreateFlowInput, ff as CreateObjectRecord, bH as CreatePermissionInput, bF as CreateRoleInput, bP as CreateUserProfile, eN as CreateViewInput, Q as Currency, aC as CurrencyFilterValue, bf as CustomAttributeValue, bU as CustomTab, fb as DBAttribute, fp as DBFlow, f7 as DBObject, fl as DBView, f2 as DEFAULT_LABEL_FALLBACK, d0 as DatabaseAdapter, aw as DateFilterOperator, H as DateFormat, J as DateValue, bC as EffectivePermissions, aG as ExtendedFilterRule, bp as ExtractAttributes, bj as ExtractRecord, bl as ExtractRecordInput, bm as ExtractRecordInputStrict, bk as ExtractRecordStrict, bn as ExtractRecordUpdate, bo as ExtractRecordUpdateStrict, d1 as FetchResult, aq as File, eQ as FileContent, fk as FileListOptions, eh as FileService, eg as FileServiceOptions, ap as FileVisibility, e6 as FilesRepository, aH as FilterCombinator, aJ as FilterGroup, aA as FilterOperator, aF as FilterRule, aI as FilterState, aE as FilterValue, aX as FlowRelation, aW as FlowRowField, ek as FlowService, aV as FlowSlot, aY as FlowStatus, e9 as FlowsRepository, bS as FormTab, d2 as FormattedRecord, dC as FormulaResult, f0 as FullSyncOptions, e$ as FullSyncResult, b4 as GeocodingAdapter, b1 as GeocodingAutocompleteParams, b3 as GeocodingParams, el as GeocodingService, b0 as GeocodingSuggestion, eA as GetRelationOptionsParams, fi as GlobalSearchOptions, fj as GlobalSearchResultItem, em as GlobalSearchService, d3 as GroupedFetchResult, dV as HookContext, dW as HookDefinition, dX as HookHandler, d_ as HookRegistry, dY as HookType, bc as InferRecord, b7 as InferRecordFromSchema, bd as InferRecordInput, be as InferRecordUpdate, b8 as InferRecordWithRequirements, d4 as InsertOptions, dG as InvalidPathError, fg as ListOptions, W as Location, X as LocationGranularity, dH as MaxDepthExceededError, ay as MultiselectFilterOperator, aT as NO_VALUE_OPERATORS, aS as NoValueOperator, b5 as NoopGeocodingAdapter, dZ as NoopHookRegistry, bW as NotesTab, au as NumberFilterOperator, E as NumberUnit, aR as OPERATORS_BY_TYPE, bv as ObjectAttribute, bD as ObjectPermissions, bx as ObjectRecord, e7 as ObjectRecordsRepository, er as ObjectSchemaService, eq as ObjectSchemaServiceOptions, e3 as ObjectsRepository, fs as OperationResult, a9 as PartialBlockNoteBlock, aa as PartialBlockNoteContent, ab as PartialBlockNoteInlineContent, ac as PartialBlockNoteLink, ad as PartialBlockNoteStyledText, ae as PartialBlockNoteTableCell, af as PartialBlockNoteTableContent, dL as PathCardinality, dM as PathSegment, dN as PathSegmentType, bA as Permission, by as PermissionScope, et as PermissionService, es as PermissionServiceOptions, eb as PermissionsRepository, K as Phone, aD as PhoneFilterValue, bJ as PolicyContext, e1 as PolicyRegistry, bL as PolicyViolationError, dg as QueryBuilder, d5 as QueryBuilderState, dc as QueryMultipleResultsError, dd as QueryNoResultError, aQ as QueryState, Y as RELATION_TARGET_ANY, bq as RESERVED_ATTRIBUTE_NAMES, bh as RecordMetadata, bK as RecordPolicy, ev as RecordService, eu as RecordServiceOptions, d6 as RegistryMap, d7 as RegistryObjectNames, Z as RelationAttribute, az as RelationFilterOperator, ey as RelationOption, ez as RelationOptionsResponse, eD as RelationResolverService, eB as RelationService, ex as RelationValidationError, ew as RelationValidationResult, aB as RelativeDateValue, bs as ReservedAttributeName, eC as ResolvedRelations, b2 as ReverseGeocodingParams, bz as Role, eE as RollupResult, eH as RollupScheduler, eG as RollupSchedulerOptions, eF as RollupService, de as SHORTCUT_TO_FILTER_OPERATOR, br as SYSTEM_FIELD_NAMES, dO as SchemaResolver, fh as SearchOptions, ax as SelectFilterOperator, d8 as ShortcutOperator, eT as SignedUrlOptions, aO as SortDirection, aP as SortRule, x as StatusGroup, eU as StorageAdapter, ao as StorageProvider, eR as StorageUploadInput, eS as StorageUploadResult, eX as SyncOptions, eW as SyncResult, bt as SystemFieldName, bi as SystemFields, bE as SystemPermissions, bR as TabType, bT as TableTab, ef as TenantAwareRepository, ee as TenantAwareService, dp as TenantContext, dh as TenantContextError, c1 as TenantId, at as TextFilterOperator, bu as Timestamps, dS as TraversalOptions, dT as TraversalResult, b9 as TypedAttribute, fd as UpdateDBAttribute, fr as UpdateDBFlow, f9 as UpdateDBObject, fn as UpdateDBView, as as UpdateFile, ej as UpdateFlowInput, ep as UpdateObjectInput, bG as UpdateRoleInput, bQ as UpdateUserProfile, eO as UpdateViewInput, eV as UploadFileInput, fe as UpsertDBAttribute, fa as UpsertDBObject, fo as UpsertDBView, c2 as UserId, bO as UserProfile, eJ as UserProfileService, eI as UserProfileServiceOptions, e5 as UserProfilesRepository, bM as UserRole, bB as UserRoleAssignment, eM as UserService, bN as UserStatus, eL as UserValidationError, eK as UserValidationResult, c0 as Uuid, cS as ValidationResult, eP as ViewService, fu as ViewSyncOptions, ft as ViewSyncResult, e8 as ViewsRepository, bg as WithCustomAttributes, c3 as asTenantId, c4 as asUserId, cr as attributeConfigSchemas, ec as buildAuditChanges, cd as checkboxConfigSchema, c$ as computeRecordStatus, cQ as createAttributeValidator, cy as createCheckboxValidator, cB as createCurrencyValidator, cz as createDateValidator, d9 as createDefaultState, cW as createDraftValidator, cG as createFileValidator, cM as createFormulaValidator, cF as createLocationValidator, d$ as createMockAdapter, cJ as createMultiRelationValidator, cE as createMultiselectValidator, cx as createNumberValidator, cR as createObjectValidator, cA as createPhoneValidator, df as createQueryBuilder, cL as createRatingValidator, cK as createRelationValidator, cP as createRichtextValidator, cN as createRollupValidator, cD as createSelectValidator, cI as createSingleRelationValidator, cC as createStatusValidator, cO as createTextAreaValidator, cw as createTextValidator, cH as createUserValidator, cg as currencyConfigSchema, ce as dateConfigSchema, e0 as defaultPolicyRegistry, f6 as enrichValuesWithSelectLabels, dq as evaluateFormula, dr as evaluateFormulaAttribute, ds as evaluateFormulaAttributeWithRelations, dt as evaluateFormulaWithRelations, du as evaluateFormulaWithResult, f5 as extractAttributeNames, dv as extractFormulaVariables, dw as extractRelationNames, dx as extractRelationReferences, cl as fileConfigSchema, dy as flattenRelationsForEval, dz as formatFormulaResult, da as formatRecord, db as formatRecords, cp as formulaConfigSchema, c5 as generateId, c6 as generatePrefixedId, cs as getAttributeConfigSchema, di as getContext, cZ as getMissingRequiredAttributes, dD as getPathDepth, dE as getRelationPath, e_ as getSyncPreview, dF as getTargetAttributeName, dj as getTenantId, dk as getUserId, fx as getViewSyncPreview, dl as hasContext, dA as hasRelationReferences, b_ as isActivityTab, aL as isAdvancedFilterState, bZ as isCustomTab, aZ as isFlowDefinition, a_ as isFlowPublished, bX as isFormTab, f4 as isLabelExpression, aU as isNoValueOperator, b$ as isNotesTab, c_ as isRecordComplete, a$ as isSystemFlow, bY as isTableTab, _ as isUniversalRelation, ci as locationConfigSchema, ck as multiselectConfigSchema, e2 as notesPolicy, cc as numberConfigSchema, cu as parseAttributeConfig, dI as parsePath, dJ as pathHasManyCardinality, cf as phoneConfigSchema, co as ratingConfigSchema, c7 as registry, cn as relationConfigSchema, f3 as renderLabelExpression, dP as resolveMultiplePaths, dQ as resolveSingleValue, cb as richtextConfigSchema, cq as rollupConfigSchema, dm as runWithContext, cv as safeParseAttributeConfig, cj as selectConfigSchema, ch as statusConfigSchema, f1 as syncAll, eY as syncNativeObjects, fv as syncNativeViews, c9 as textConfigSchema, ca as textareaConfigSchema, aM as toAdvancedFilterState, aN as toSimpleFilterState, dR as traversePath, cm as userConfigSchema, cT as validateAttribute, ct as validateAttributeConfig, cX as validateDraft, cY as validateDraftOrThrow, dB as validateFormulaExpression, cU as validateObject, cV as validateObjectOrThrow, dK as validatePath, eZ as verifyNativeObjectsSync, fw as verifyNativeViewsSync, c8 as viewRegistry, dn as withTenantContext } from './runtime-UYkiPdud.js';
|
|
3
3
|
import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
@@ -107,6 +107,49 @@ declare class ObjectReferencedError extends Error {
|
|
|
107
107
|
constructor(objectName: string, referencingObjects: string[]);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* System attribute union type
|
|
112
|
+
*/
|
|
113
|
+
type SystemAttribute = DateAttribute | UserAttribute;
|
|
114
|
+
/**
|
|
115
|
+
* System attributes available on all records.
|
|
116
|
+
* These are managed automatically by the system and cannot be edited by users.
|
|
117
|
+
*
|
|
118
|
+
* They use the same types as regular attributes so they work seamlessly
|
|
119
|
+
* with the UI (mapAttributeToCellOpts, DataGrid columns, etc.).
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* import { SYSTEM_ATTRIBUTES, getSystemAttributeList } from "@stndrds/schema";
|
|
124
|
+
*
|
|
125
|
+
* // Get all attributes including system ones
|
|
126
|
+
* const allAttributes = [
|
|
127
|
+
* ...object.attributes,
|
|
128
|
+
* ...getSystemAttributeList(),
|
|
129
|
+
* ];
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare const SYSTEM_ATTRIBUTES: Record<string, SystemAttribute>;
|
|
133
|
+
/**
|
|
134
|
+
* Get all system attributes as an array
|
|
135
|
+
* Use this to append system attributes to an object's attribute list
|
|
136
|
+
*/
|
|
137
|
+
declare function getSystemAttributeList(): SystemAttribute[];
|
|
138
|
+
/**
|
|
139
|
+
* System attribute names as a union type
|
|
140
|
+
*/
|
|
141
|
+
type SystemAttributeName = keyof typeof SYSTEM_ATTRIBUTES;
|
|
142
|
+
/**
|
|
143
|
+
* Check if an attribute name is a system attribute
|
|
144
|
+
*/
|
|
145
|
+
declare function isSystemAttribute(name: string): name is SystemAttributeName;
|
|
146
|
+
/**
|
|
147
|
+
* Check if an attribute is a system attribute by its properties
|
|
148
|
+
*/
|
|
149
|
+
declare function isSystemAttributeObject(attr: {
|
|
150
|
+
system?: boolean;
|
|
151
|
+
}): boolean;
|
|
152
|
+
|
|
110
153
|
/**
|
|
111
154
|
* Default empty value placeholder
|
|
112
155
|
*/
|
|
@@ -463,6 +506,56 @@ declare class TextAreaAttributeBuilder<TName extends string, TRequired extends b
|
|
|
463
506
|
optional(): TextAreaAttributeBuilder<TName, false>;
|
|
464
507
|
}
|
|
465
508
|
declare function textarea<TName extends string>(config: TypedBuilderConfig<TName>): TextAreaAttributeBuilder<TName, false>;
|
|
509
|
+
/**
|
|
510
|
+
* Builder for richtext attributes (Tiptap editor)
|
|
511
|
+
*/
|
|
512
|
+
declare class RichtextAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<RichtextAttribute> {
|
|
513
|
+
readonly _types: {
|
|
514
|
+
name: TName;
|
|
515
|
+
attribute: RichtextAttribute;
|
|
516
|
+
required: TRequired;
|
|
517
|
+
};
|
|
518
|
+
constructor(name: TName, label: string);
|
|
519
|
+
/**
|
|
520
|
+
* Set enabled features for the richtext editor
|
|
521
|
+
* If not called, all features are enabled by default
|
|
522
|
+
*
|
|
523
|
+
* @param list - Array of features to enable
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* ```typescript
|
|
527
|
+
* richtext({ name: "content", label: "Content" })
|
|
528
|
+
* .features(["headings", "bold", "italic", "lists", "links"])
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
features(list: RichtextFeature[]): this;
|
|
532
|
+
required(): RichtextAttributeBuilder<TName, true>;
|
|
533
|
+
optional(): RichtextAttributeBuilder<TName, false>;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Create a richtext attribute builder for Tiptap-based rich text content
|
|
537
|
+
*
|
|
538
|
+
* @example Basic usage
|
|
539
|
+
* ```typescript
|
|
540
|
+
* richtext({ name: "content", label: "Content" })
|
|
541
|
+
* .required()
|
|
542
|
+
* ```
|
|
543
|
+
*
|
|
544
|
+
* @example With specific features
|
|
545
|
+
* ```typescript
|
|
546
|
+
* richtext({ name: "description", label: "Description" })
|
|
547
|
+
* .features(["headings", "bold", "italic", "lists", "links"])
|
|
548
|
+
* .placeholder("Write something...")
|
|
549
|
+
* ```
|
|
550
|
+
*
|
|
551
|
+
* @example Full-featured (notes, articles)
|
|
552
|
+
* ```typescript
|
|
553
|
+
* richtext({ name: "body", label: "Body" })
|
|
554
|
+
* .features(["headings", "bold", "italic", "lists", "links", "images", "codeBlocks", "tables"])
|
|
555
|
+
* .required()
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
declare function richtext<TName extends string>(config: TypedBuilderConfig<TName>): RichtextAttributeBuilder<TName, false>;
|
|
466
559
|
declare class NumberAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<NumberAttribute> {
|
|
467
560
|
readonly _types: {
|
|
468
561
|
name: TName;
|
|
@@ -600,18 +693,6 @@ declare class LocationAttributeBuilder<TName extends string, TRequired extends b
|
|
|
600
693
|
optional(): LocationAttributeBuilder<TName, false>;
|
|
601
694
|
}
|
|
602
695
|
declare function location<TName extends string>(config: TypedBuilderConfig<TName>): LocationAttributeBuilder<TName, false>;
|
|
603
|
-
declare class TimestampAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<TimestampAttribute> {
|
|
604
|
-
readonly _types: {
|
|
605
|
-
name: TName;
|
|
606
|
-
attribute: TimestampAttribute;
|
|
607
|
-
required: TRequired;
|
|
608
|
-
};
|
|
609
|
-
constructor(name: TName, label: string);
|
|
610
|
-
autoUpdate(): this;
|
|
611
|
-
required(): TimestampAttributeBuilder<TName, true>;
|
|
612
|
-
optional(): TimestampAttributeBuilder<TName, false>;
|
|
613
|
-
}
|
|
614
|
-
declare function timestamp<TName extends string>(config: TypedBuilderConfig<TName>): TimestampAttributeBuilder<TName, false>;
|
|
615
696
|
declare class FileAttributeBuilder<TName extends string, TRequired extends boolean = false> extends BaseAttributeBuilder<FileAttribute> {
|
|
616
697
|
readonly _types: {
|
|
617
698
|
name: TName;
|
|
@@ -622,7 +703,6 @@ declare class FileAttributeBuilder<TName extends string, TRequired extends boole
|
|
|
622
703
|
maxFiles(value: number): this;
|
|
623
704
|
maxSize(bytes: number): this;
|
|
624
705
|
allowedTypes(types: MimeType[] | readonly MimeType[]): this;
|
|
625
|
-
verification(config: FileAttribute["verification"]): this;
|
|
626
706
|
/**
|
|
627
707
|
* Allow multiple files to be uploaded
|
|
628
708
|
*/
|
|
@@ -679,6 +759,18 @@ declare class SingleRelationAttributeBuilder<TName extends string, TRequired ext
|
|
|
679
759
|
* @param options - Display template and filter options
|
|
680
760
|
*/
|
|
681
761
|
to(objectName: string, options?: RelationTargetOptions): this;
|
|
762
|
+
/**
|
|
763
|
+
* Allow linking to any object in the tenant (universal polymorphic)
|
|
764
|
+
* Creates a relation with `targets: [{ object: "*" }]`
|
|
765
|
+
*
|
|
766
|
+
* @example
|
|
767
|
+
* ```typescript
|
|
768
|
+
* relation({ name: "linkedTo", label: "Linked To" })
|
|
769
|
+
* .toAny()
|
|
770
|
+
* .hidden()
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
toAny(): this;
|
|
682
774
|
/**
|
|
683
775
|
* Convert to a multi-relation (cardinality: "many")
|
|
684
776
|
*/
|
|
@@ -702,6 +794,18 @@ declare class MultiRelationAttributeBuilder<TName extends string, TRequired exte
|
|
|
702
794
|
* @param options - Display template and filter options
|
|
703
795
|
*/
|
|
704
796
|
to(objectName: string, options?: RelationTargetOptions): this;
|
|
797
|
+
/**
|
|
798
|
+
* Allow linking to any object in the tenant (universal polymorphic)
|
|
799
|
+
* Creates a relation with `targets: [{ object: "*" }]`
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```typescript
|
|
803
|
+
* relation({ name: "linkedItems", label: "Linked Items" })
|
|
804
|
+
* .toAny()
|
|
805
|
+
* .many()
|
|
806
|
+
* ```
|
|
807
|
+
*/
|
|
808
|
+
toAny(): this;
|
|
705
809
|
/**
|
|
706
810
|
* Set minimum number of relations required
|
|
707
811
|
*/
|
|
@@ -868,7 +972,7 @@ declare function rollup<TName extends string>(config: TypedBuilderConfig<TName>)
|
|
|
868
972
|
/**
|
|
869
973
|
* Union of all attribute builder types
|
|
870
974
|
*/
|
|
871
|
-
type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> |
|
|
975
|
+
type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | RichtextAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean> | FormulaAttributeBuilder<string> | RollupAttributeBuilder<string>;
|
|
872
976
|
/**
|
|
873
977
|
* Extract the attribute name from a builder
|
|
874
978
|
*/
|
|
@@ -1591,4 +1695,55 @@ declare function view(name: string, label: string): ViewBuilder;
|
|
|
1591
1695
|
*/
|
|
1592
1696
|
declare function group(id: string, label: string): GroupBuilder;
|
|
1593
1697
|
|
|
1594
|
-
|
|
1698
|
+
/**
|
|
1699
|
+
* Native Notes Object
|
|
1700
|
+
*
|
|
1701
|
+
* A Notion-like notes system that can be attached to any record or used globally.
|
|
1702
|
+
* Notes support rich text content via Tiptap editor.
|
|
1703
|
+
*
|
|
1704
|
+
* Features:
|
|
1705
|
+
* - Polymorphic linking to any object/record via `linkedTo` relation
|
|
1706
|
+
* - Private (createdBy-only) or shared (tenant-wide) visibility
|
|
1707
|
+
* - Rich text content with BlockNote
|
|
1708
|
+
* - Extensible via custom attributes
|
|
1709
|
+
*
|
|
1710
|
+
* The author of a note is determined by the system field `createdBy`,
|
|
1711
|
+
* which is automatically set when a record is created.
|
|
1712
|
+
*
|
|
1713
|
+
* Access control is enforced by NotesPolicy:
|
|
1714
|
+
* - Private notes: only visible/editable by createdBy
|
|
1715
|
+
* - Shared notes: visible/editable by all tenant members
|
|
1716
|
+
* - Delete: only createdBy can delete any note
|
|
1717
|
+
*
|
|
1718
|
+
* @example Linked to a record
|
|
1719
|
+
* ```typescript
|
|
1720
|
+
* const note = {
|
|
1721
|
+
* title: "Meeting notes",
|
|
1722
|
+
* content: { type: "doc", content: [...] },
|
|
1723
|
+
* visibility: "shared",
|
|
1724
|
+
* linkedTo: "rec-456" // Can be any record from any object
|
|
1725
|
+
* };
|
|
1726
|
+
* // createdBy is set automatically by RecordService
|
|
1727
|
+
* ```
|
|
1728
|
+
*
|
|
1729
|
+
* @example Global note (not linked)
|
|
1730
|
+
* ```typescript
|
|
1731
|
+
* const note = {
|
|
1732
|
+
* title: "My private thoughts",
|
|
1733
|
+
* content: { type: "doc", content: [...] },
|
|
1734
|
+
* visibility: "private",
|
|
1735
|
+
* linkedTo: null
|
|
1736
|
+
* };
|
|
1737
|
+
* ```
|
|
1738
|
+
*/
|
|
1739
|
+
/**
|
|
1740
|
+
* Notes object definition
|
|
1741
|
+
*/
|
|
1742
|
+
declare const NOTES: ObjectBuilder<{
|
|
1743
|
+
visibility: "private" | "shared";
|
|
1744
|
+
title: string;
|
|
1745
|
+
content: BlockNoteContent;
|
|
1746
|
+
linkedTo?: string | undefined;
|
|
1747
|
+
}>;
|
|
1748
|
+
|
|
1749
|
+
export { ALL_SYSTEM_RESOURCES, type AnyAttributeBuilder, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, type AttributeUsage, BlockNoteContent, type BuilderConfig, CheckboxAttribute, CurrencyAttribute, CustomTabConfig, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type ExtractAttributeName, type ExtractAttributeRequired, Field, FileAttribute, FileNotFoundError, FlowBuilder, FlowDefinition, FlowPage, FlowPageBuilder, FlowRow, FlowRowBuilder, ForbiddenError, FormulaAttribute, FormulaReturnType, Group, GroupBuilder, InferAttributeValue, LocationAttribute, MultiRelationAttribute, MultiselectAttribute, NOTES, NotFoundError, NotSystemObjectError, NumberAttribute, ObjectAction, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, ObjectReferencedError, Option, PhoneAttribute, ProtectedResourceError, ProtectedRoleError, RatingAttribute, RecordNotFoundError, type RecordReference, RecordReferencedError, RelationTarget, RichtextAttribute, RichtextFeature, RoleNotFoundError, RollupAttribute, RollupFunction, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, SelectAttribute, SingleRelationAttribute, StatusAttribute, SyncError, SystemAction, type SystemAttribute, type SystemAttributeName, SystemResource, Tab, TabBuilder, TableTabConfig, TextAreaAttribute, TextAttribute, type TypedBuilderConfig, UserAttribute, UserProfileNotFoundError, ValidationError, type ValidationErrorDetail, ViewBuilder, ViewDefinition, checkbox, currency, date, file, flow, formatAttributeValue, formula, getSystemAttributeList, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isSystemAttribute, isSystemAttributeObject, isValidationError, location, multiselect, number, object, phone, rating, relation, richtext, rollup, select, status, text, textarea, user, view };
|