@stndrds/schema 1.0.0-alpha.105 → 1.0.0-alpha.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +58 -4
- package/dist/index.mjs +58 -5
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1463,6 +1463,7 @@ interface AgentSession {
|
|
|
1463
1463
|
updatedAt: Date;
|
|
1464
1464
|
completedAt?: Date;
|
|
1465
1465
|
expiresAt?: Date;
|
|
1466
|
+
archivedAt?: Date;
|
|
1466
1467
|
}
|
|
1467
1468
|
/**
|
|
1468
1469
|
* Persisted message in an agent session.
|
|
@@ -1978,6 +1979,7 @@ interface FormFreeFieldRef {
|
|
|
1978
1979
|
label?: string;
|
|
1979
1980
|
tooltip?: string;
|
|
1980
1981
|
required?: boolean;
|
|
1982
|
+
prefillExpression?: string;
|
|
1981
1983
|
}
|
|
1982
1984
|
type FormFieldRef = FormSlotFieldRef | FormFreeFieldRef;
|
|
1983
1985
|
declare function isFormSlotFieldRef(f: FormFieldRef): f is FormSlotFieldRef;
|
|
@@ -2064,6 +2066,7 @@ interface FormSubmission {
|
|
|
2064
2066
|
tenantId?: string;
|
|
2065
2067
|
createdAt?: Date;
|
|
2066
2068
|
updatedAt?: Date;
|
|
2069
|
+
archivedAt?: Date;
|
|
2067
2070
|
}
|
|
2068
2071
|
|
|
2069
2072
|
interface DBForm {
|
|
@@ -2120,6 +2123,7 @@ interface DBFormSubmission {
|
|
|
2120
2123
|
submitted_at?: string;
|
|
2121
2124
|
created_at?: string;
|
|
2122
2125
|
updated_at?: string;
|
|
2126
|
+
archived_at?: string;
|
|
2123
2127
|
}
|
|
2124
2128
|
interface CreateDBFormSubmission {
|
|
2125
2129
|
tenant_id: string;
|
|
@@ -2138,6 +2142,7 @@ interface UpdateDBFormSubmission {
|
|
|
2138
2142
|
created_record_ids?: unknown;
|
|
2139
2143
|
submitted_at?: string;
|
|
2140
2144
|
updated_at?: string;
|
|
2145
|
+
archived_at?: string | null;
|
|
2141
2146
|
}
|
|
2142
2147
|
|
|
2143
2148
|
/**
|
|
@@ -2844,6 +2849,15 @@ declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
|
|
|
2844
2849
|
*/
|
|
2845
2850
|
declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
|
|
2846
2851
|
|
|
2852
|
+
/**
|
|
2853
|
+
* Apply a sequence of pipes to a string value.
|
|
2854
|
+
* Reusable utility for any template-like system that needs pipe processing.
|
|
2855
|
+
*
|
|
2856
|
+
* @param value - The string to transform
|
|
2857
|
+
* @param pipes - Array of pipe expressions (e.g., ["UPPER", 'prefix:", "'])
|
|
2858
|
+
* @returns The transformed string
|
|
2859
|
+
*/
|
|
2860
|
+
declare function applyPipes(value: string, pipes: string[]): string;
|
|
2847
2861
|
/**
|
|
2848
2862
|
* Render a label expression template with values
|
|
2849
2863
|
*
|
|
@@ -3885,10 +3899,12 @@ declare class FormRowBuilder {
|
|
|
3885
3899
|
field(slotId: string, attribute: string, options?: {
|
|
3886
3900
|
label?: string;
|
|
3887
3901
|
required?: boolean;
|
|
3902
|
+
tooltip?: string;
|
|
3888
3903
|
}): this;
|
|
3889
3904
|
freeField(builder: AnyAttributeBuilder, options?: {
|
|
3890
3905
|
label?: string;
|
|
3891
3906
|
required?: boolean;
|
|
3907
|
+
prefillExpression?: string;
|
|
3892
3908
|
}): this;
|
|
3893
3909
|
row(id: string): FormRowBuilder;
|
|
3894
3910
|
heading(content: string, level?: 1 | 2 | 3): FormStepBuilder;
|
|
@@ -3905,10 +3921,12 @@ declare class FormStepBuilder {
|
|
|
3905
3921
|
field(slotId: string, attribute: string, options?: {
|
|
3906
3922
|
label?: string;
|
|
3907
3923
|
required?: boolean;
|
|
3924
|
+
tooltip?: string;
|
|
3908
3925
|
}): this;
|
|
3909
3926
|
freeField(builder: AnyAttributeBuilder, options?: {
|
|
3910
3927
|
label?: string;
|
|
3911
3928
|
required?: boolean;
|
|
3929
|
+
prefillExpression?: string;
|
|
3912
3930
|
}): this;
|
|
3913
3931
|
row(id: string): FormRowBuilder;
|
|
3914
3932
|
heading(content: string, level?: 1 | 2 | 3): this;
|
|
@@ -3938,6 +3956,7 @@ declare class FormBuilder {
|
|
|
3938
3956
|
private validateName;
|
|
3939
3957
|
private validateRequiredData;
|
|
3940
3958
|
private validateSlotReferences;
|
|
3959
|
+
private validatePrefillExpressions;
|
|
3941
3960
|
private validateFreeFields;
|
|
3942
3961
|
}
|
|
3943
3962
|
declare function form(name: string, label: string): FormBuilder;
|
|
@@ -5975,4 +5994,4 @@ declare class FormRegistry {
|
|
|
5975
5994
|
|
|
5976
5995
|
declare const formRegistry: FormRegistry;
|
|
5977
5996
|
|
|
5978
|
-
export { type AIAvailableModel, type AIBatchQuestion, type AIBatchQuestionAnswer, type AIBatchQuestionOption, type AIChatMessage, type AIChatMessagePart, type AIChatMessagePartType, type AICompactionSummary, type AIMemoryEntry, type AIMemoryType, type AIMessageRole, type AIProviderMetrics, type AIQuestion, type AIQuestionAnswer, type AIQuestionOption, type AIQuestionType, type AITodoItem, type AITodoList, type AITodoStatus, type AIToolCall, type AIToolCallStatus, type AIUsageMetrics, ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, type AccessLevel, type Action, ActivityTabConfig, type AgentConfig, type AgentContextEntry, type AgentDashboard, type AgentDefinition, type AgentEvent, type AgentExecutionConfig, type AgentMessageAttachment, type AgentQuestion, type AgentRun, type AgentRunStatus, type AgentSchedule, type AgentSession, type AgentSessionMessage, type AgentSessionMode, type AgentSessionStatus, type AgentToolCall, type AgentTrigger, type AgentTriggerDefinition, type AgentTriggerType, type ApiKey, type ApiKeyAuthContext, type ApiKeyPermission, type ApiKeyWithSecret, type AssignRoleInput, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, AttributeType, type AttributeUsage, type AuditAction, type AuditActorType, type AuditChange, type AuditListOptions, type AuditLogEntry, type AuditResourceType, type AuditServiceOptions, type AuditSortField, BEHAVIOR_PROPERTIES, BilateralConfig, type BoundingBox, type BuilderConfig, CheckboxAttribute, CompletionStatus, ConcurrentModificationError, ConfigOverrides, type CreateApiKeyInput, type CreateAuditLogInput, type CreateDBAttribute, type CreateDBForm, type CreateDBFormSubmission, type CreateDBObject, type CreateDBView, type CreateDBViewOverlay, type CreateDocument, type CreateDocumentSlot, type CreateFile, CreateMode, type CreateObjectRecord, type CreatePermissionInput, type CreateProcessingJob, type CreateRoleInput, type CreateSandboxExecution, type CreateUserProfile, type CriticConfig, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, type DBAttribute, type DBForm, type DBFormSubmission, type DBObject, type DBView, type DBViewOverlay, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, DetailViewBuilder, DetailViewConfig, DetailViewDefinition, DetailViewLayout, type Document, DocumentAttribute, type DocumentListOptions, type DocumentSlot, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type EffectivePermissions, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FeatureFlagDefinition, FeatureFlagsRepository, FeatureGate, Field, FieldGroup, type File, FileAttribute, type FileListOptions, type FileVisibility, FilterState, FlagLevel, FlagRegistry, FlagService, FlagValueType, ForbiddenError, FormBuilder, type FormDefinition, type FormFieldRef, type FormFieldsRow, type FormFreeFieldRef, type FormHeadingRow, FormRegistry, type FormRow, FormRowBuilder, type FormSeparatorRow, type FormSlot, type FormSlotFieldRef, type FormStatus, type FormStep, FormStepBuilder, type FormSubmission, type FormSubmissionStatus, type FormSubmittedAgentEvent, type FormSubmittedAgentTrigger, type FormTextRow, FormulaAttribute, FormulaReturnType, type GeocodingAdapter, type GeocodingAutocompleteParams, type GeocodingParams, type GeocodingSuggestion, type GlobalSearchGroupedOptions, type GlobalSearchGroupedResult, type GlobalSearchOptions, type GlobalSearchResultItem, Group, GroupBuilder, IDENTITY_PROPERTIES, type InferAttributeValue, type InviteUserInput, type ListOptions, ListViewBuilder, ListViewConfig, ListViewDefinition, ListViewTab, ListViewTabConfigBuilder, Location, LocationAttribute, LocationGranularity, MemoryNotFoundError, type MentionEntityType, type MentionReference, type MentionedContext, type MentionedEntityContext, MigrationDefinition, type ModelDefinition, MultiRelationAttribute, MultiselectAttribute, NoopGeocodingAdapter, NotFoundError, NotImplementedError, NumberAttribute, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, type ObjectPermissions, ObjectRecord, ObjectReferencedError, type OcrAdapter, type OcrInput, type OcrOptions, type OcrPage, type OcrResult, type OcrTextBlock, type OperationResult, Option, PRESENTATION_PROPERTIES, type Permission, type PermissionScope, Phone, PhoneAttribute, type PolicyContext, PolicyViolationError, type ProcessingJob, type ProcessingJobStatus, type ProcessingJobType, type ProcessingStatus, ProtectedResourceError, ProtectedRoleError, type ProviderName, type QuestionResponse, type QuestionStatus, RatingAttribute, type ReasoningPartData, type RecordAgentEvent, type RecordAgentTrigger, type RecordMetadata, RecordNotFoundError, type RecordPolicy, type RecordReference, RecordReferencedError, RelationAttribute, RelationGroup, RelationGroupBuilder, RelationTarget, RepositoryError, type RepositoryOperation, ResolvedFlag, type RetryPolicy, type ReverseGeocodingParams, RichtextAttribute, RichtextFeature, RichtextTabConfig, type Role, RoleNotFoundError, RollupAttribute, RollupFunction, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, type SandboxExecution, type SandboxExecutionInput, type SandboxExecutionResult, type SandboxExecutionStatus, type SandboxMode, type SandboxTrigger, SchemaError, SchemaErrorCode, type SearchOptions, SelectAttribute, SidePanelConfig, SingleRelationAttribute, type SlotMode, type SlotStatus, SortRule, type StandardSchemaIssue, type StandardSchemaResult, StaticFlagDefault, StatusAttribute, StorageError, type StorageOperation, type StorageProvider, SyncError, type SystemAttribute, type SystemFields, type SystemPermissions, type SystemResource, Tab, TabBuilder, TableTab, TableTabConfig, TenantId, TextAreaAttribute, TextAttribute, type TextPartData, type ThinkingPartData, type TimeoutPolicy, Timestamps, type ToolPartData, type TriggerEventType, USER_STATUSES, type UpdateDBAttribute, type UpdateDBForm, type UpdateDBFormSubmission, type UpdateDBObject, type UpdateDBView, type UpdateDBViewOverlay, type UpdateDocument, type UpdateDocumentSlot, type UpdateFile, type UpdateProcessingJob, type UpdateRoleInput, type UpdateUserProfile, type UpsertDBAttribute, type UpsertDBObject, type UpsertDBView, UserAttribute, type UserProfile, type UserRoleAssignment, type UserStatus, Uuid, ValidationError, type ValidationErrorDetail, ViewConfig, ViewDefinition, ViewType, type WithCustomAttributes$1 as WithCustomAttributes, accessLevelToActions, actionsToAccessLevel, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getSystemAttributeList, group, isAttributeInUseError, isDefaultRole, isEmptyObject, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isStandardSchema, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };
|
|
5997
|
+
export { type AIAvailableModel, type AIBatchQuestion, type AIBatchQuestionAnswer, type AIBatchQuestionOption, type AIChatMessage, type AIChatMessagePart, type AIChatMessagePartType, type AICompactionSummary, type AIMemoryEntry, type AIMemoryType, type AIMessageRole, type AIProviderMetrics, type AIQuestion, type AIQuestionAnswer, type AIQuestionOption, type AIQuestionType, type AITodoItem, type AITodoList, type AITodoStatus, type AIToolCall, type AIToolCallStatus, type AIUsageMetrics, ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, type AccessLevel, type Action, ActivityTabConfig, type AgentConfig, type AgentContextEntry, type AgentDashboard, type AgentDefinition, type AgentEvent, type AgentExecutionConfig, type AgentMessageAttachment, type AgentQuestion, type AgentRun, type AgentRunStatus, type AgentSchedule, type AgentSession, type AgentSessionMessage, type AgentSessionMode, type AgentSessionStatus, type AgentToolCall, type AgentTrigger, type AgentTriggerDefinition, type AgentTriggerType, type ApiKey, type ApiKeyAuthContext, type ApiKeyPermission, type ApiKeyWithSecret, type AssignRoleInput, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, AttributeType, type AttributeUsage, type AuditAction, type AuditActorType, type AuditChange, type AuditListOptions, type AuditLogEntry, type AuditResourceType, type AuditServiceOptions, type AuditSortField, BEHAVIOR_PROPERTIES, BilateralConfig, type BoundingBox, type BuilderConfig, CheckboxAttribute, CompletionStatus, ConcurrentModificationError, ConfigOverrides, type CreateApiKeyInput, type CreateAuditLogInput, type CreateDBAttribute, type CreateDBForm, type CreateDBFormSubmission, type CreateDBObject, type CreateDBView, type CreateDBViewOverlay, type CreateDocument, type CreateDocumentSlot, type CreateFile, CreateMode, type CreateObjectRecord, type CreatePermissionInput, type CreateProcessingJob, type CreateRoleInput, type CreateSandboxExecution, type CreateUserProfile, type CriticConfig, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, type DBAttribute, type DBForm, type DBFormSubmission, type DBObject, type DBView, type DBViewOverlay, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, DetailViewBuilder, DetailViewConfig, DetailViewDefinition, DetailViewLayout, type Document, DocumentAttribute, type DocumentListOptions, type DocumentSlot, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type EffectivePermissions, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FeatureFlagDefinition, FeatureFlagsRepository, FeatureGate, Field, FieldGroup, type File, FileAttribute, type FileListOptions, type FileVisibility, FilterState, FlagLevel, FlagRegistry, FlagService, FlagValueType, ForbiddenError, FormBuilder, type FormDefinition, type FormFieldRef, type FormFieldsRow, type FormFreeFieldRef, type FormHeadingRow, FormRegistry, type FormRow, FormRowBuilder, type FormSeparatorRow, type FormSlot, type FormSlotFieldRef, type FormStatus, type FormStep, FormStepBuilder, type FormSubmission, type FormSubmissionStatus, type FormSubmittedAgentEvent, type FormSubmittedAgentTrigger, type FormTextRow, FormulaAttribute, FormulaReturnType, type GeocodingAdapter, type GeocodingAutocompleteParams, type GeocodingParams, type GeocodingSuggestion, type GlobalSearchGroupedOptions, type GlobalSearchGroupedResult, type GlobalSearchOptions, type GlobalSearchResultItem, Group, GroupBuilder, IDENTITY_PROPERTIES, type InferAttributeValue, type InviteUserInput, type ListOptions, ListViewBuilder, ListViewConfig, ListViewDefinition, ListViewTab, ListViewTabConfigBuilder, Location, LocationAttribute, LocationGranularity, MemoryNotFoundError, type MentionEntityType, type MentionReference, type MentionedContext, type MentionedEntityContext, MigrationDefinition, type ModelDefinition, MultiRelationAttribute, MultiselectAttribute, NoopGeocodingAdapter, NotFoundError, NotImplementedError, NumberAttribute, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, type ObjectPermissions, ObjectRecord, ObjectReferencedError, type OcrAdapter, type OcrInput, type OcrOptions, type OcrPage, type OcrResult, type OcrTextBlock, type OperationResult, Option, PRESENTATION_PROPERTIES, type Permission, type PermissionScope, Phone, PhoneAttribute, type PolicyContext, PolicyViolationError, type ProcessingJob, type ProcessingJobStatus, type ProcessingJobType, type ProcessingStatus, ProtectedResourceError, ProtectedRoleError, type ProviderName, type QuestionResponse, type QuestionStatus, RatingAttribute, type ReasoningPartData, type RecordAgentEvent, type RecordAgentTrigger, type RecordMetadata, RecordNotFoundError, type RecordPolicy, type RecordReference, RecordReferencedError, RelationAttribute, RelationGroup, RelationGroupBuilder, RelationTarget, RepositoryError, type RepositoryOperation, ResolvedFlag, type RetryPolicy, type ReverseGeocodingParams, RichtextAttribute, RichtextFeature, RichtextTabConfig, type Role, RoleNotFoundError, RollupAttribute, RollupFunction, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, type SandboxExecution, type SandboxExecutionInput, type SandboxExecutionResult, type SandboxExecutionStatus, type SandboxMode, type SandboxTrigger, SchemaError, SchemaErrorCode, type SearchOptions, SelectAttribute, SidePanelConfig, SingleRelationAttribute, type SlotMode, type SlotStatus, SortRule, type StandardSchemaIssue, type StandardSchemaResult, StaticFlagDefault, StatusAttribute, StorageError, type StorageOperation, type StorageProvider, SyncError, type SystemAttribute, type SystemFields, type SystemPermissions, type SystemResource, Tab, TabBuilder, TableTab, TableTabConfig, TenantId, TextAreaAttribute, TextAttribute, type TextPartData, type ThinkingPartData, type TimeoutPolicy, Timestamps, type ToolPartData, type TriggerEventType, USER_STATUSES, type UpdateDBAttribute, type UpdateDBForm, type UpdateDBFormSubmission, type UpdateDBObject, type UpdateDBView, type UpdateDBViewOverlay, type UpdateDocument, type UpdateDocumentSlot, type UpdateFile, type UpdateProcessingJob, type UpdateRoleInput, type UpdateUserProfile, type UpsertDBAttribute, type UpsertDBObject, type UpsertDBView, UserAttribute, type UserProfile, type UserRoleAssignment, type UserStatus, Uuid, ValidationError, type ValidationErrorDetail, ViewConfig, ViewDefinition, ViewType, type WithCustomAttributes$1 as WithCustomAttributes, accessLevelToActions, actionsToAccessLevel, applyPipes, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getSystemAttributeList, group, isAttributeInUseError, isDefaultRole, isEmptyObject, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isStandardSchema, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };
|
package/dist/index.d.ts
CHANGED
|
@@ -1463,6 +1463,7 @@ interface AgentSession {
|
|
|
1463
1463
|
updatedAt: Date;
|
|
1464
1464
|
completedAt?: Date;
|
|
1465
1465
|
expiresAt?: Date;
|
|
1466
|
+
archivedAt?: Date;
|
|
1466
1467
|
}
|
|
1467
1468
|
/**
|
|
1468
1469
|
* Persisted message in an agent session.
|
|
@@ -1978,6 +1979,7 @@ interface FormFreeFieldRef {
|
|
|
1978
1979
|
label?: string;
|
|
1979
1980
|
tooltip?: string;
|
|
1980
1981
|
required?: boolean;
|
|
1982
|
+
prefillExpression?: string;
|
|
1981
1983
|
}
|
|
1982
1984
|
type FormFieldRef = FormSlotFieldRef | FormFreeFieldRef;
|
|
1983
1985
|
declare function isFormSlotFieldRef(f: FormFieldRef): f is FormSlotFieldRef;
|
|
@@ -2064,6 +2066,7 @@ interface FormSubmission {
|
|
|
2064
2066
|
tenantId?: string;
|
|
2065
2067
|
createdAt?: Date;
|
|
2066
2068
|
updatedAt?: Date;
|
|
2069
|
+
archivedAt?: Date;
|
|
2067
2070
|
}
|
|
2068
2071
|
|
|
2069
2072
|
interface DBForm {
|
|
@@ -2120,6 +2123,7 @@ interface DBFormSubmission {
|
|
|
2120
2123
|
submitted_at?: string;
|
|
2121
2124
|
created_at?: string;
|
|
2122
2125
|
updated_at?: string;
|
|
2126
|
+
archived_at?: string;
|
|
2123
2127
|
}
|
|
2124
2128
|
interface CreateDBFormSubmission {
|
|
2125
2129
|
tenant_id: string;
|
|
@@ -2138,6 +2142,7 @@ interface UpdateDBFormSubmission {
|
|
|
2138
2142
|
created_record_ids?: unknown;
|
|
2139
2143
|
submitted_at?: string;
|
|
2140
2144
|
updated_at?: string;
|
|
2145
|
+
archived_at?: string | null;
|
|
2141
2146
|
}
|
|
2142
2147
|
|
|
2143
2148
|
/**
|
|
@@ -2844,6 +2849,15 @@ declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
|
|
|
2844
2849
|
*/
|
|
2845
2850
|
declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
|
|
2846
2851
|
|
|
2852
|
+
/**
|
|
2853
|
+
* Apply a sequence of pipes to a string value.
|
|
2854
|
+
* Reusable utility for any template-like system that needs pipe processing.
|
|
2855
|
+
*
|
|
2856
|
+
* @param value - The string to transform
|
|
2857
|
+
* @param pipes - Array of pipe expressions (e.g., ["UPPER", 'prefix:", "'])
|
|
2858
|
+
* @returns The transformed string
|
|
2859
|
+
*/
|
|
2860
|
+
declare function applyPipes(value: string, pipes: string[]): string;
|
|
2847
2861
|
/**
|
|
2848
2862
|
* Render a label expression template with values
|
|
2849
2863
|
*
|
|
@@ -3885,10 +3899,12 @@ declare class FormRowBuilder {
|
|
|
3885
3899
|
field(slotId: string, attribute: string, options?: {
|
|
3886
3900
|
label?: string;
|
|
3887
3901
|
required?: boolean;
|
|
3902
|
+
tooltip?: string;
|
|
3888
3903
|
}): this;
|
|
3889
3904
|
freeField(builder: AnyAttributeBuilder, options?: {
|
|
3890
3905
|
label?: string;
|
|
3891
3906
|
required?: boolean;
|
|
3907
|
+
prefillExpression?: string;
|
|
3892
3908
|
}): this;
|
|
3893
3909
|
row(id: string): FormRowBuilder;
|
|
3894
3910
|
heading(content: string, level?: 1 | 2 | 3): FormStepBuilder;
|
|
@@ -3905,10 +3921,12 @@ declare class FormStepBuilder {
|
|
|
3905
3921
|
field(slotId: string, attribute: string, options?: {
|
|
3906
3922
|
label?: string;
|
|
3907
3923
|
required?: boolean;
|
|
3924
|
+
tooltip?: string;
|
|
3908
3925
|
}): this;
|
|
3909
3926
|
freeField(builder: AnyAttributeBuilder, options?: {
|
|
3910
3927
|
label?: string;
|
|
3911
3928
|
required?: boolean;
|
|
3929
|
+
prefillExpression?: string;
|
|
3912
3930
|
}): this;
|
|
3913
3931
|
row(id: string): FormRowBuilder;
|
|
3914
3932
|
heading(content: string, level?: 1 | 2 | 3): this;
|
|
@@ -3938,6 +3956,7 @@ declare class FormBuilder {
|
|
|
3938
3956
|
private validateName;
|
|
3939
3957
|
private validateRequiredData;
|
|
3940
3958
|
private validateSlotReferences;
|
|
3959
|
+
private validatePrefillExpressions;
|
|
3941
3960
|
private validateFreeFields;
|
|
3942
3961
|
}
|
|
3943
3962
|
declare function form(name: string, label: string): FormBuilder;
|
|
@@ -5975,4 +5994,4 @@ declare class FormRegistry {
|
|
|
5975
5994
|
|
|
5976
5995
|
declare const formRegistry: FormRegistry;
|
|
5977
5996
|
|
|
5978
|
-
export { type AIAvailableModel, type AIBatchQuestion, type AIBatchQuestionAnswer, type AIBatchQuestionOption, type AIChatMessage, type AIChatMessagePart, type AIChatMessagePartType, type AICompactionSummary, type AIMemoryEntry, type AIMemoryType, type AIMessageRole, type AIProviderMetrics, type AIQuestion, type AIQuestionAnswer, type AIQuestionOption, type AIQuestionType, type AITodoItem, type AITodoList, type AITodoStatus, type AIToolCall, type AIToolCallStatus, type AIUsageMetrics, ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, type AccessLevel, type Action, ActivityTabConfig, type AgentConfig, type AgentContextEntry, type AgentDashboard, type AgentDefinition, type AgentEvent, type AgentExecutionConfig, type AgentMessageAttachment, type AgentQuestion, type AgentRun, type AgentRunStatus, type AgentSchedule, type AgentSession, type AgentSessionMessage, type AgentSessionMode, type AgentSessionStatus, type AgentToolCall, type AgentTrigger, type AgentTriggerDefinition, type AgentTriggerType, type ApiKey, type ApiKeyAuthContext, type ApiKeyPermission, type ApiKeyWithSecret, type AssignRoleInput, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, AttributeType, type AttributeUsage, type AuditAction, type AuditActorType, type AuditChange, type AuditListOptions, type AuditLogEntry, type AuditResourceType, type AuditServiceOptions, type AuditSortField, BEHAVIOR_PROPERTIES, BilateralConfig, type BoundingBox, type BuilderConfig, CheckboxAttribute, CompletionStatus, ConcurrentModificationError, ConfigOverrides, type CreateApiKeyInput, type CreateAuditLogInput, type CreateDBAttribute, type CreateDBForm, type CreateDBFormSubmission, type CreateDBObject, type CreateDBView, type CreateDBViewOverlay, type CreateDocument, type CreateDocumentSlot, type CreateFile, CreateMode, type CreateObjectRecord, type CreatePermissionInput, type CreateProcessingJob, type CreateRoleInput, type CreateSandboxExecution, type CreateUserProfile, type CriticConfig, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, type DBAttribute, type DBForm, type DBFormSubmission, type DBObject, type DBView, type DBViewOverlay, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, DetailViewBuilder, DetailViewConfig, DetailViewDefinition, DetailViewLayout, type Document, DocumentAttribute, type DocumentListOptions, type DocumentSlot, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type EffectivePermissions, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FeatureFlagDefinition, FeatureFlagsRepository, FeatureGate, Field, FieldGroup, type File, FileAttribute, type FileListOptions, type FileVisibility, FilterState, FlagLevel, FlagRegistry, FlagService, FlagValueType, ForbiddenError, FormBuilder, type FormDefinition, type FormFieldRef, type FormFieldsRow, type FormFreeFieldRef, type FormHeadingRow, FormRegistry, type FormRow, FormRowBuilder, type FormSeparatorRow, type FormSlot, type FormSlotFieldRef, type FormStatus, type FormStep, FormStepBuilder, type FormSubmission, type FormSubmissionStatus, type FormSubmittedAgentEvent, type FormSubmittedAgentTrigger, type FormTextRow, FormulaAttribute, FormulaReturnType, type GeocodingAdapter, type GeocodingAutocompleteParams, type GeocodingParams, type GeocodingSuggestion, type GlobalSearchGroupedOptions, type GlobalSearchGroupedResult, type GlobalSearchOptions, type GlobalSearchResultItem, Group, GroupBuilder, IDENTITY_PROPERTIES, type InferAttributeValue, type InviteUserInput, type ListOptions, ListViewBuilder, ListViewConfig, ListViewDefinition, ListViewTab, ListViewTabConfigBuilder, Location, LocationAttribute, LocationGranularity, MemoryNotFoundError, type MentionEntityType, type MentionReference, type MentionedContext, type MentionedEntityContext, MigrationDefinition, type ModelDefinition, MultiRelationAttribute, MultiselectAttribute, NoopGeocodingAdapter, NotFoundError, NotImplementedError, NumberAttribute, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, type ObjectPermissions, ObjectRecord, ObjectReferencedError, type OcrAdapter, type OcrInput, type OcrOptions, type OcrPage, type OcrResult, type OcrTextBlock, type OperationResult, Option, PRESENTATION_PROPERTIES, type Permission, type PermissionScope, Phone, PhoneAttribute, type PolicyContext, PolicyViolationError, type ProcessingJob, type ProcessingJobStatus, type ProcessingJobType, type ProcessingStatus, ProtectedResourceError, ProtectedRoleError, type ProviderName, type QuestionResponse, type QuestionStatus, RatingAttribute, type ReasoningPartData, type RecordAgentEvent, type RecordAgentTrigger, type RecordMetadata, RecordNotFoundError, type RecordPolicy, type RecordReference, RecordReferencedError, RelationAttribute, RelationGroup, RelationGroupBuilder, RelationTarget, RepositoryError, type RepositoryOperation, ResolvedFlag, type RetryPolicy, type ReverseGeocodingParams, RichtextAttribute, RichtextFeature, RichtextTabConfig, type Role, RoleNotFoundError, RollupAttribute, RollupFunction, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, type SandboxExecution, type SandboxExecutionInput, type SandboxExecutionResult, type SandboxExecutionStatus, type SandboxMode, type SandboxTrigger, SchemaError, SchemaErrorCode, type SearchOptions, SelectAttribute, SidePanelConfig, SingleRelationAttribute, type SlotMode, type SlotStatus, SortRule, type StandardSchemaIssue, type StandardSchemaResult, StaticFlagDefault, StatusAttribute, StorageError, type StorageOperation, type StorageProvider, SyncError, type SystemAttribute, type SystemFields, type SystemPermissions, type SystemResource, Tab, TabBuilder, TableTab, TableTabConfig, TenantId, TextAreaAttribute, TextAttribute, type TextPartData, type ThinkingPartData, type TimeoutPolicy, Timestamps, type ToolPartData, type TriggerEventType, USER_STATUSES, type UpdateDBAttribute, type UpdateDBForm, type UpdateDBFormSubmission, type UpdateDBObject, type UpdateDBView, type UpdateDBViewOverlay, type UpdateDocument, type UpdateDocumentSlot, type UpdateFile, type UpdateProcessingJob, type UpdateRoleInput, type UpdateUserProfile, type UpsertDBAttribute, type UpsertDBObject, type UpsertDBView, UserAttribute, type UserProfile, type UserRoleAssignment, type UserStatus, Uuid, ValidationError, type ValidationErrorDetail, ViewConfig, ViewDefinition, ViewType, type WithCustomAttributes$1 as WithCustomAttributes, accessLevelToActions, actionsToAccessLevel, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getSystemAttributeList, group, isAttributeInUseError, isDefaultRole, isEmptyObject, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isStandardSchema, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };
|
|
5997
|
+
export { type AIAvailableModel, type AIBatchQuestion, type AIBatchQuestionAnswer, type AIBatchQuestionOption, type AIChatMessage, type AIChatMessagePart, type AIChatMessagePartType, type AICompactionSummary, type AIMemoryEntry, type AIMemoryType, type AIMessageRole, type AIProviderMetrics, type AIQuestion, type AIQuestionAnswer, type AIQuestionOption, type AIQuestionType, type AITodoItem, type AITodoList, type AITodoStatus, type AIToolCall, type AIToolCallStatus, type AIUsageMetrics, ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, type AccessLevel, type Action, ActivityTabConfig, type AgentConfig, type AgentContextEntry, type AgentDashboard, type AgentDefinition, type AgentEvent, type AgentExecutionConfig, type AgentMessageAttachment, type AgentQuestion, type AgentRun, type AgentRunStatus, type AgentSchedule, type AgentSession, type AgentSessionMessage, type AgentSessionMode, type AgentSessionStatus, type AgentToolCall, type AgentTrigger, type AgentTriggerDefinition, type AgentTriggerType, type ApiKey, type ApiKeyAuthContext, type ApiKeyPermission, type ApiKeyWithSecret, type AssignRoleInput, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, AttributeType, type AttributeUsage, type AuditAction, type AuditActorType, type AuditChange, type AuditListOptions, type AuditLogEntry, type AuditResourceType, type AuditServiceOptions, type AuditSortField, BEHAVIOR_PROPERTIES, BilateralConfig, type BoundingBox, type BuilderConfig, CheckboxAttribute, CompletionStatus, ConcurrentModificationError, ConfigOverrides, type CreateApiKeyInput, type CreateAuditLogInput, type CreateDBAttribute, type CreateDBForm, type CreateDBFormSubmission, type CreateDBObject, type CreateDBView, type CreateDBViewOverlay, type CreateDocument, type CreateDocumentSlot, type CreateFile, CreateMode, type CreateObjectRecord, type CreatePermissionInput, type CreateProcessingJob, type CreateRoleInput, type CreateSandboxExecution, type CreateUserProfile, type CriticConfig, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, type DBAttribute, type DBForm, type DBFormSubmission, type DBObject, type DBView, type DBViewOverlay, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, DetailViewBuilder, DetailViewConfig, DetailViewDefinition, DetailViewLayout, type Document, DocumentAttribute, type DocumentListOptions, type DocumentSlot, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type EffectivePermissions, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FeatureFlagDefinition, FeatureFlagsRepository, FeatureGate, Field, FieldGroup, type File, FileAttribute, type FileListOptions, type FileVisibility, FilterState, FlagLevel, FlagRegistry, FlagService, FlagValueType, ForbiddenError, FormBuilder, type FormDefinition, type FormFieldRef, type FormFieldsRow, type FormFreeFieldRef, type FormHeadingRow, FormRegistry, type FormRow, FormRowBuilder, type FormSeparatorRow, type FormSlot, type FormSlotFieldRef, type FormStatus, type FormStep, FormStepBuilder, type FormSubmission, type FormSubmissionStatus, type FormSubmittedAgentEvent, type FormSubmittedAgentTrigger, type FormTextRow, FormulaAttribute, FormulaReturnType, type GeocodingAdapter, type GeocodingAutocompleteParams, type GeocodingParams, type GeocodingSuggestion, type GlobalSearchGroupedOptions, type GlobalSearchGroupedResult, type GlobalSearchOptions, type GlobalSearchResultItem, Group, GroupBuilder, IDENTITY_PROPERTIES, type InferAttributeValue, type InviteUserInput, type ListOptions, ListViewBuilder, ListViewConfig, ListViewDefinition, ListViewTab, ListViewTabConfigBuilder, Location, LocationAttribute, LocationGranularity, MemoryNotFoundError, type MentionEntityType, type MentionReference, type MentionedContext, type MentionedEntityContext, MigrationDefinition, type ModelDefinition, MultiRelationAttribute, MultiselectAttribute, NoopGeocodingAdapter, NotFoundError, NotImplementedError, NumberAttribute, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, type ObjectPermissions, ObjectRecord, ObjectReferencedError, type OcrAdapter, type OcrInput, type OcrOptions, type OcrPage, type OcrResult, type OcrTextBlock, type OperationResult, Option, PRESENTATION_PROPERTIES, type Permission, type PermissionScope, Phone, PhoneAttribute, type PolicyContext, PolicyViolationError, type ProcessingJob, type ProcessingJobStatus, type ProcessingJobType, type ProcessingStatus, ProtectedResourceError, ProtectedRoleError, type ProviderName, type QuestionResponse, type QuestionStatus, RatingAttribute, type ReasoningPartData, type RecordAgentEvent, type RecordAgentTrigger, type RecordMetadata, RecordNotFoundError, type RecordPolicy, type RecordReference, RecordReferencedError, RelationAttribute, RelationGroup, RelationGroupBuilder, RelationTarget, RepositoryError, type RepositoryOperation, ResolvedFlag, type RetryPolicy, type ReverseGeocodingParams, RichtextAttribute, RichtextFeature, RichtextTabConfig, type Role, RoleNotFoundError, RollupAttribute, RollupFunction, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, type SandboxExecution, type SandboxExecutionInput, type SandboxExecutionResult, type SandboxExecutionStatus, type SandboxMode, type SandboxTrigger, SchemaError, SchemaErrorCode, type SearchOptions, SelectAttribute, SidePanelConfig, SingleRelationAttribute, type SlotMode, type SlotStatus, SortRule, type StandardSchemaIssue, type StandardSchemaResult, StaticFlagDefault, StatusAttribute, StorageError, type StorageOperation, type StorageProvider, SyncError, type SystemAttribute, type SystemFields, type SystemPermissions, type SystemResource, Tab, TabBuilder, TableTab, TableTabConfig, TenantId, TextAreaAttribute, TextAttribute, type TextPartData, type ThinkingPartData, type TimeoutPolicy, Timestamps, type ToolPartData, type TriggerEventType, USER_STATUSES, type UpdateDBAttribute, type UpdateDBForm, type UpdateDBFormSubmission, type UpdateDBObject, type UpdateDBView, type UpdateDBViewOverlay, type UpdateDocument, type UpdateDocumentSlot, type UpdateFile, type UpdateProcessingJob, type UpdateRoleInput, type UpdateUserProfile, type UpsertDBAttribute, type UpsertDBObject, type UpsertDBView, UserAttribute, type UserProfile, type UserRoleAssignment, type UserStatus, Uuid, ValidationError, type ValidationErrorDetail, ViewConfig, ViewDefinition, ViewType, type WithCustomAttributes$1 as WithCustomAttributes, accessLevelToActions, actionsToAccessLevel, applyPipes, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getSystemAttributeList, group, isAttributeInUseError, isDefaultRole, isEmptyObject, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isStandardSchema, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };
|
package/dist/index.js
CHANGED
|
@@ -891,6 +891,24 @@ var pipesWithArgs = {
|
|
|
891
891
|
/** Show default value if empty */
|
|
892
892
|
default: (v, def = "") => v || def
|
|
893
893
|
};
|
|
894
|
+
function applyPipes(value, pipes) {
|
|
895
|
+
let result = value;
|
|
896
|
+
for (const pipeExpr of pipes) {
|
|
897
|
+
const { name: pipeName, args } = parsePipeExpression(pipeExpr);
|
|
898
|
+
const simpleFn = simplePipes[pipeName];
|
|
899
|
+
if (simpleFn) {
|
|
900
|
+
if (result !== "") {
|
|
901
|
+
result = simpleFn(result);
|
|
902
|
+
}
|
|
903
|
+
} else {
|
|
904
|
+
const argFn = pipesWithArgs[pipeName];
|
|
905
|
+
if (argFn) {
|
|
906
|
+
result = argFn(result, ...args);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return result;
|
|
911
|
+
}
|
|
894
912
|
function getValue(obj, path) {
|
|
895
913
|
return path.split(".").reduce((acc, key) => {
|
|
896
914
|
if (acc == null || typeof acc !== "object") return void 0;
|
|
@@ -2094,7 +2112,8 @@ var FormRowBuilder = class {
|
|
|
2094
2112
|
slotId,
|
|
2095
2113
|
attribute,
|
|
2096
2114
|
label: options?.label,
|
|
2097
|
-
required: options?.required
|
|
2115
|
+
required: options?.required,
|
|
2116
|
+
tooltip: options?.tooltip
|
|
2098
2117
|
};
|
|
2099
2118
|
this.rowData.fields.push(ref);
|
|
2100
2119
|
return this;
|
|
@@ -2105,7 +2124,8 @@ var FormRowBuilder = class {
|
|
|
2105
2124
|
type: "free",
|
|
2106
2125
|
attribute,
|
|
2107
2126
|
label: options?.label,
|
|
2108
|
-
required: options?.required
|
|
2127
|
+
required: options?.required,
|
|
2128
|
+
prefillExpression: options?.prefillExpression
|
|
2109
2129
|
};
|
|
2110
2130
|
this.rowData.fields.push(ref);
|
|
2111
2131
|
return this;
|
|
@@ -2150,7 +2170,8 @@ var FormStepBuilder = class {
|
|
|
2150
2170
|
slotId,
|
|
2151
2171
|
attribute,
|
|
2152
2172
|
label: options?.label,
|
|
2153
|
-
required: options?.required
|
|
2173
|
+
required: options?.required,
|
|
2174
|
+
tooltip: options?.tooltip
|
|
2154
2175
|
};
|
|
2155
2176
|
const row = { id: rowId, order: this.rowOrder, type: "fields", fields: [ref] };
|
|
2156
2177
|
this.stepData.rows.push(row);
|
|
@@ -2164,7 +2185,8 @@ var FormStepBuilder = class {
|
|
|
2164
2185
|
type: "free",
|
|
2165
2186
|
attribute,
|
|
2166
2187
|
label: options?.label,
|
|
2167
|
-
required: options?.required
|
|
2188
|
+
required: options?.required,
|
|
2189
|
+
prefillExpression: options?.prefillExpression
|
|
2168
2190
|
};
|
|
2169
2191
|
const row = { id: rowId, order: this.rowOrder, type: "fields", fields: [ref] };
|
|
2170
2192
|
this.stepData.rows.push(row);
|
|
@@ -2276,6 +2298,7 @@ var FormBuilder = class {
|
|
|
2276
2298
|
this.validateRequiredData();
|
|
2277
2299
|
this.validateSlotReferences();
|
|
2278
2300
|
this.validateFreeFields();
|
|
2301
|
+
this.validatePrefillExpressions();
|
|
2279
2302
|
return this.data;
|
|
2280
2303
|
}
|
|
2281
2304
|
_finalizeStep(step) {
|
|
@@ -2319,6 +2342,36 @@ var FormBuilder = class {
|
|
|
2319
2342
|
}
|
|
2320
2343
|
}
|
|
2321
2344
|
}
|
|
2345
|
+
validatePrefillExpressions() {
|
|
2346
|
+
const VALID_PREFILL_PIPES = [...ALL_PIPES, "join"];
|
|
2347
|
+
for (const step of this.data.steps) {
|
|
2348
|
+
for (const row of step.rows) {
|
|
2349
|
+
if (!isFormFieldsRow(row)) continue;
|
|
2350
|
+
for (const field of row.fields) {
|
|
2351
|
+
if (!isFormFreeFieldRef(field)) continue;
|
|
2352
|
+
if (!field.prefillExpression) continue;
|
|
2353
|
+
const expr = field.prefillExpression;
|
|
2354
|
+
const fieldRef = `prefillExpression on free field "${field.attribute.name}" in step "${step.id}"`;
|
|
2355
|
+
if (!isLabelExpression(expr)) {
|
|
2356
|
+
throw new Error(
|
|
2357
|
+
`[FormBuilder] ${fieldRef} must contain at least one {{ attribute }} interpolation.`
|
|
2358
|
+
);
|
|
2359
|
+
}
|
|
2360
|
+
if (/\{\{\s*\}\}/.test(expr)) {
|
|
2361
|
+
throw new Error(`[FormBuilder] ${fieldRef} contains empty {{ }} interpolation.`);
|
|
2362
|
+
}
|
|
2363
|
+
for (const match of expr.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g)) {
|
|
2364
|
+
const pipeName = match[1];
|
|
2365
|
+
if (!VALID_PREFILL_PIPES.includes(pipeName)) {
|
|
2366
|
+
throw new Error(
|
|
2367
|
+
`[FormBuilder] ${fieldRef} uses invalid pipe "${pipeName}". Valid pipes: ${VALID_PREFILL_PIPES.join(", ")}`
|
|
2368
|
+
);
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2322
2375
|
validateFreeFields() {
|
|
2323
2376
|
const forbidden = new Set(FORM_FORBIDDEN_ATTRIBUTE_TYPES);
|
|
2324
2377
|
for (const step of this.data.steps) {
|
|
@@ -4908,6 +4961,7 @@ exports.USER_STATUSES = USER_STATUSES;
|
|
|
4908
4961
|
exports.ValidationError = ValidationError;
|
|
4909
4962
|
exports.accessLevelToActions = accessLevelToActions;
|
|
4910
4963
|
exports.actionsToAccessLevel = actionsToAccessLevel;
|
|
4964
|
+
exports.applyPipes = applyPipes;
|
|
4911
4965
|
exports.booleanFlag = booleanFlag;
|
|
4912
4966
|
exports.checkbox = checkbox;
|
|
4913
4967
|
exports.createFlagRegistry = createFlagRegistry;
|
package/dist/index.mjs
CHANGED
|
@@ -887,6 +887,24 @@ var pipesWithArgs = {
|
|
|
887
887
|
/** Show default value if empty */
|
|
888
888
|
default: (v, def = "") => v || def
|
|
889
889
|
};
|
|
890
|
+
function applyPipes(value, pipes) {
|
|
891
|
+
let result = value;
|
|
892
|
+
for (const pipeExpr of pipes) {
|
|
893
|
+
const { name: pipeName, args } = parsePipeExpression(pipeExpr);
|
|
894
|
+
const simpleFn = simplePipes[pipeName];
|
|
895
|
+
if (simpleFn) {
|
|
896
|
+
if (result !== "") {
|
|
897
|
+
result = simpleFn(result);
|
|
898
|
+
}
|
|
899
|
+
} else {
|
|
900
|
+
const argFn = pipesWithArgs[pipeName];
|
|
901
|
+
if (argFn) {
|
|
902
|
+
result = argFn(result, ...args);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return result;
|
|
907
|
+
}
|
|
890
908
|
function getValue(obj, path) {
|
|
891
909
|
return path.split(".").reduce((acc, key) => {
|
|
892
910
|
if (acc == null || typeof acc !== "object") return void 0;
|
|
@@ -2090,7 +2108,8 @@ var FormRowBuilder = class {
|
|
|
2090
2108
|
slotId,
|
|
2091
2109
|
attribute,
|
|
2092
2110
|
label: options?.label,
|
|
2093
|
-
required: options?.required
|
|
2111
|
+
required: options?.required,
|
|
2112
|
+
tooltip: options?.tooltip
|
|
2094
2113
|
};
|
|
2095
2114
|
this.rowData.fields.push(ref);
|
|
2096
2115
|
return this;
|
|
@@ -2101,7 +2120,8 @@ var FormRowBuilder = class {
|
|
|
2101
2120
|
type: "free",
|
|
2102
2121
|
attribute,
|
|
2103
2122
|
label: options?.label,
|
|
2104
|
-
required: options?.required
|
|
2123
|
+
required: options?.required,
|
|
2124
|
+
prefillExpression: options?.prefillExpression
|
|
2105
2125
|
};
|
|
2106
2126
|
this.rowData.fields.push(ref);
|
|
2107
2127
|
return this;
|
|
@@ -2146,7 +2166,8 @@ var FormStepBuilder = class {
|
|
|
2146
2166
|
slotId,
|
|
2147
2167
|
attribute,
|
|
2148
2168
|
label: options?.label,
|
|
2149
|
-
required: options?.required
|
|
2169
|
+
required: options?.required,
|
|
2170
|
+
tooltip: options?.tooltip
|
|
2150
2171
|
};
|
|
2151
2172
|
const row = { id: rowId, order: this.rowOrder, type: "fields", fields: [ref] };
|
|
2152
2173
|
this.stepData.rows.push(row);
|
|
@@ -2160,7 +2181,8 @@ var FormStepBuilder = class {
|
|
|
2160
2181
|
type: "free",
|
|
2161
2182
|
attribute,
|
|
2162
2183
|
label: options?.label,
|
|
2163
|
-
required: options?.required
|
|
2184
|
+
required: options?.required,
|
|
2185
|
+
prefillExpression: options?.prefillExpression
|
|
2164
2186
|
};
|
|
2165
2187
|
const row = { id: rowId, order: this.rowOrder, type: "fields", fields: [ref] };
|
|
2166
2188
|
this.stepData.rows.push(row);
|
|
@@ -2272,6 +2294,7 @@ var FormBuilder = class {
|
|
|
2272
2294
|
this.validateRequiredData();
|
|
2273
2295
|
this.validateSlotReferences();
|
|
2274
2296
|
this.validateFreeFields();
|
|
2297
|
+
this.validatePrefillExpressions();
|
|
2275
2298
|
return this.data;
|
|
2276
2299
|
}
|
|
2277
2300
|
_finalizeStep(step) {
|
|
@@ -2315,6 +2338,36 @@ var FormBuilder = class {
|
|
|
2315
2338
|
}
|
|
2316
2339
|
}
|
|
2317
2340
|
}
|
|
2341
|
+
validatePrefillExpressions() {
|
|
2342
|
+
const VALID_PREFILL_PIPES = [...ALL_PIPES, "join"];
|
|
2343
|
+
for (const step of this.data.steps) {
|
|
2344
|
+
for (const row of step.rows) {
|
|
2345
|
+
if (!isFormFieldsRow(row)) continue;
|
|
2346
|
+
for (const field of row.fields) {
|
|
2347
|
+
if (!isFormFreeFieldRef(field)) continue;
|
|
2348
|
+
if (!field.prefillExpression) continue;
|
|
2349
|
+
const expr = field.prefillExpression;
|
|
2350
|
+
const fieldRef = `prefillExpression on free field "${field.attribute.name}" in step "${step.id}"`;
|
|
2351
|
+
if (!isLabelExpression(expr)) {
|
|
2352
|
+
throw new Error(
|
|
2353
|
+
`[FormBuilder] ${fieldRef} must contain at least one {{ attribute }} interpolation.`
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
if (/\{\{\s*\}\}/.test(expr)) {
|
|
2357
|
+
throw new Error(`[FormBuilder] ${fieldRef} contains empty {{ }} interpolation.`);
|
|
2358
|
+
}
|
|
2359
|
+
for (const match of expr.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g)) {
|
|
2360
|
+
const pipeName = match[1];
|
|
2361
|
+
if (!VALID_PREFILL_PIPES.includes(pipeName)) {
|
|
2362
|
+
throw new Error(
|
|
2363
|
+
`[FormBuilder] ${fieldRef} uses invalid pipe "${pipeName}". Valid pipes: ${VALID_PREFILL_PIPES.join(", ")}`
|
|
2364
|
+
);
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2318
2371
|
validateFreeFields() {
|
|
2319
2372
|
const forbidden = new Set(FORM_FORBIDDEN_ATTRIBUTE_TYPES);
|
|
2320
2373
|
for (const step of this.data.steps) {
|
|
@@ -4786,4 +4839,4 @@ var FormRegistry = class {
|
|
|
4786
4839
|
};
|
|
4787
4840
|
var formRegistry = new FormRegistry();
|
|
4788
4841
|
|
|
4789
|
-
export { ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, ActivityTabConfig, AttributeInUseError, AttributeNotFoundError, BEHAVIOR_PROPERTIES, ConcurrentModificationError, CustomTabConfig, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DetailViewBuilder, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FlagRegistry, FlagService, ForbiddenError, FormBuilder, FormRegistry, FormRowBuilder, FormStepBuilder, GroupBuilder, IDENTITY_PROPERTIES, ListViewBuilder, ListViewTabConfigBuilder, MemoryNotFoundError, NO_VALUE_OPERATORS, NoopGeocodingAdapter, NotFoundError, NotImplementedError, OPERATORS_BY_TYPE, ObjectBuilder, ObjectNotFoundError, ObjectReferencedError, PRESENTATION_PROPERTIES, PolicyViolationError, ProtectedResourceError, ProtectedRoleError, RELATION_TARGET_ANY, RESERVED_ATTRIBUTE_NAMES, RecordNotFoundError, RecordReferencedError, RelationGroupBuilder, RepositoryError, RichtextTabConfig, RoleNotFoundError, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_FIELD_NAMES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, StorageError, SyncError, TabBuilder, TableTabConfig, USER_STATUSES, ValidationError, accessLevelToActions, actionsToAccessLevel, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getRollupFilterOperators, getSystemAttributeList, group, hasOptions, inferInverseCardinality, isAttributeInUseError, isAttributeSortable, isBilateralRelation, isDefaultRole, isDetailView, isEmptyObject, isFieldGroup, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isListView, isNoValueOperator, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isRelationGroup, isSchemaError, isStandardSchema, isUniversalRelation, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };
|
|
4842
|
+
export { ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, ActivityTabConfig, AttributeInUseError, AttributeNotFoundError, BEHAVIOR_PROPERTIES, ConcurrentModificationError, CustomTabConfig, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DetailViewBuilder, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FlagRegistry, FlagService, ForbiddenError, FormBuilder, FormRegistry, FormRowBuilder, FormStepBuilder, GroupBuilder, IDENTITY_PROPERTIES, ListViewBuilder, ListViewTabConfigBuilder, MemoryNotFoundError, NO_VALUE_OPERATORS, NoopGeocodingAdapter, NotFoundError, NotImplementedError, OPERATORS_BY_TYPE, ObjectBuilder, ObjectNotFoundError, ObjectReferencedError, PRESENTATION_PROPERTIES, PolicyViolationError, ProtectedResourceError, ProtectedRoleError, RELATION_TARGET_ANY, RESERVED_ATTRIBUTE_NAMES, RecordNotFoundError, RecordReferencedError, RelationGroupBuilder, RepositoryError, RichtextTabConfig, RoleNotFoundError, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_FIELD_NAMES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, StorageError, SyncError, TabBuilder, TableTabConfig, USER_STATUSES, ValidationError, accessLevelToActions, actionsToAccessLevel, applyPipes, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getRollupFilterOperators, getSystemAttributeList, group, hasOptions, inferInverseCardinality, isAttributeInUseError, isAttributeSortable, isBilateralRelation, isDefaultRole, isDetailView, isEmptyObject, isFieldGroup, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isListView, isNoValueOperator, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isRelationGroup, isSchemaError, isStandardSchema, isUniversalRelation, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stndrds/schema",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.108",
|
|
4
4
|
"description": "Standard schema definitions and utilities",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@standard-schema/spec": "^1.1.0",
|
|
131
131
|
"libphonenumber-js": "^1.12.31",
|
|
132
132
|
"zod": "^4.2.1",
|
|
133
|
-
"@stndrds/constants": "1.0.0-alpha.
|
|
133
|
+
"@stndrds/constants": "1.0.0-alpha.108"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@types/node": "^25.0.3",
|