@stndrds/schema 0.1.0-alpha.56 → 0.1.0-alpha.58
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-XBF4EUC4.js → chunk-2OS63USQ.js} +1550 -1250
- package/dist/{chunk-LOOGQL6M.mjs → chunk-JRY236AO.mjs} +1307 -1007
- package/dist/chunk-NEVERCM3.js +41 -0
- package/dist/chunk-SV4BCGQU.mjs +617 -0
- package/dist/chunk-U4AB53AM.js +617 -0
- package/dist/chunk-V2RPPE2Y.mjs +41 -0
- package/dist/index.d.mts +942 -55
- package/dist/index.d.ts +942 -55
- package/dist/index.js +922 -69
- package/dist/index.mjs +988 -135
- package/dist/{runtime-D5MuaVQs.d.mts → runtime-C4vB_EcQ.d.ts} +759 -1779
- package/dist/{runtime-D5MuaVQs.d.ts → runtime-SCsDOQi0.d.mts} +759 -1779
- package/dist/runtime.d.mts +3 -1
- package/dist/runtime.d.ts +3 -1
- package/dist/runtime.js +26 -2
- package/dist/runtime.mjs +25 -1
- package/dist/utils.d.mts +154 -0
- package/dist/utils.d.ts +154 -0
- package/dist/utils.js +19 -0
- package/dist/utils.mjs +19 -0
- package/dist/validation/validators.d.mts +4 -0
- package/dist/validation/validators.d.ts +4 -0
- package/dist/validation/validators.js +121 -0
- package/dist/validation/validators.mjs +121 -0
- package/dist/validators-BgmWgr-G.d.mts +1488 -0
- package/dist/validators-miARInAq.d.ts +1488 -0
- package/package.json +12 -2
package/dist/runtime.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { fV as AIConversationsRepository, fW as AIUsageMetricsRepository, fX as AIUserMemoryRepository, gj as AddAttributeInput, fJ as AttributeChange, fY as AttributesRepository, fZ as AuditRepository, hv as AuditService, gf as BaseRepository, ge as BaseService, e7 as CacheAdapter, e5 as CacheKeyType, e8 as CacheOptions, fa as ConditionExecutor, gi as CreateCustomObjectInput, ir as CreateDBAttribute, im as CreateDBObject, iB as CreateDBView, iF as CreateDBViewOverlay, iI as CreateDBWorkflow, iR as CreateDBWorkflowAccessGrant, iL as CreateDBWorkflowInstance, iO as CreateDBWorkflowInvitation, h9 as CreateGrantResult, iu as CreateObjectRecord, hK as CreateRecordDocumentInput, hL as CreateRecordDocumentResult, hU as CreateViewInput, hm as CreateWorkflowInput, iq as DBAttribute, il as DBObject, iA as DBView, iE as DBViewOverlay, iH as DBWorkflow, iQ as DBWorkflowAccessGrant, iK as DBWorkflowInstance, iN as DBWorkflowInvitation, ib as DEFAULT_LABEL_FALLBACK, d_ as DatabaseAdapter, fb as DocumentExecutor, hy as DocumentGenerationNotConfiguredError, hz as DocumentGenerationService, f_ as DocumentGenerationTemplateListOptions, hx as DocumentGenerationTemplateNotFoundError, f$ as DocumentGenerationTemplatesRepository, g0 as DocumentJobsRepository, hA as DocumentProcessingConfig, h3 as DocumentProcessingHook, h2 as DocumentProcessingHookOptions, hB as DocumentProcessingService, hF as DocumentRenderError, hD as DocumentRendererOptions, hH as DocumentRendererService, hN as DocumentService, hM as DocumentServiceOptions, g1 as DocumentSlotsRepository, hI as DocumentTemplateService, g3 as DocumentTemplatesRepository, g2 as DocumentsRepository, fc as EndExecutor, eu as EvaluationResult, ev as EvaluationTrace, e_ as ExecutorCompleteResult, e$ as ExecutorContext, f0 as ExecutorErrorResult, f7 as ExecutorRegistry, f1 as ExecutorResult, f2 as ExecutorSuccessResult, f3 as ExecutorWaitResult, eI as FeatureFlagsContext, eA as FeatureFlagsContextError, ed as FetchResult, hZ as FileContent, iz as FileListOptions, hP as FileService, hO as FileServiceOptions, g4 as FilesRepository, fd as FormExecutor, ee as FormattedRecord, gG as FormulaResolverService, gF as FormulaResolverServiceOptions, fr as FormulaResult, i9 as FullSyncOptions, i8 as FullSyncResult, bA as GeocodingAdapter, bx as GeocodingAutocompleteParams, bz as GeocodingParams, hQ as GeocodingService, bw as GeocodingSuggestion, gy as GetRelationOptionsParams, hX as GetViewOptions, hW as GetViewsOptions, ix as GlobalSearchOptions, iy as GlobalSearchResultItem, hR as GlobalSearchService, h5 as GrantExpiredError, h4 as GrantNotFoundError, h6 as GrantRevokedError, h8 as GrantServiceConfig, ef as GroupedFetchResult, fK as HookContext, fL as HookDefinition, fM as HookHandler, fP as HookRegistry, fN as HookType, eg as InsertOptions, fv as InvalidPathError, hi as InvitationAlreadyAcceptedError, hh as InvitationExpiredError, hg as InvitationNotFoundError, hj as InvitationRevokedError, hf as InvitationServiceConfig, e0 as JwtVerificationResult, gV as LabelResolver, iv as ListOptions, e1 as MagicLinkPayload, fw as MaxDepthExceededError, fR as MockStores, f4 as NodeExecutor, ec as NoopCacheAdapter, bB as NoopGeocodingAdapter, fO as NoopHookRegistry, g5 as ObjectRecordsRepository, gm as ObjectSchemaService, gl as ObjectSchemaServiceOptions, g6 as ObjectsRepository, iT as OperationResult, fA as PathCardinality, fB as PathSegment, fC as PathSegmentType, hT as PermissionService, hS as PermissionServiceOptions, g7 as PermissionsRepository, c8 as PolicyContext, fT as PolicyRegistry, ca as PolicyViolationError, es as QueryBuilder, et as QueryBuilderOptions, eh as QueryBuilderState, eo as QueryMultipleResultsError, ep as QueryNoResultError, gq as QueryOptions, gs as QueryResult, hJ as RecordDocumentsResult, c9 as RecordPolicy, gt as RecordQueryService, gp as RecordQueryServiceOptions, gD as RecordResolverService, go as RecordService, gn as RecordServiceOptions, ei as RegistryMap, ej as RegistryObjectNames, ij as RelationLabelResolver, gw as RelationOption, gx as RelationOptionsResponse, gC as RelationService, gz as RelationServiceOptions, gv as RelationValidationError, gu as RelationValidationResult, hC as RenderDocumentInput, hE as RenderDocumentResult, gA as ResolveIdsBatchRequest, gB as ResolveIdsBatchResponse, gE as ResolvedRelations, hc as ResumeWorkflowInput, by as ReverseGeocodingParams, h1 as RollupCascadeContext, gH as RollupResult, gL as RollupScheduler, gK as RollupSchedulerOptions, gJ as RollupService, gI as RollupServiceOptions, eq as SHORTCUT_TO_FILTER_OPERATOR, eQ as SchemaContext, gg as SchemaContextAware, gh as SchemaContextAwareRepository, fD as SchemaResolver, iw as SearchOptions, gr as SearchQueryOptions, ek as ShortcutOperator, i0 as SignedUrlOptions, fe as StartExecutor, hb as StartWorkflowInput, i1 as StorageAdapter, hG as StorageDownloadNotSupportedError, h_ as StorageUploadInput, h$ as StorageUploadResult, i4 as SyncOptions, i3 as SyncResult, eX as TenantContext, ez as TenantContextError, h7 as TokenRevokedError, fH as TraversalOptions, fI as TraversalResult, is as UpdateDBAttribute, io as UpdateDBObject, iC as UpdateDBView, iG as UpdateDBViewOverlay, iJ as UpdateDBWorkflow, iS as UpdateDBWorkflowAccessGrant, iM as UpdateDBWorkflowInstance, iP as UpdateDBWorkflowInvitation, gk as UpdateObjectInput, hV as UpdateViewInput, hn as UpdateWorkflowInput, i2 as UploadFileInput, it as UpsertDBAttribute, ip as UpsertDBObject, iD as UpsertDBView, hu as UserProfileService, ht as UserProfileServiceOptions, g8 as UserProfilesRepository, hs as UserService, hr as UserValidationError, hq as UserValidationResult, dZ as ViewOverlaysRepository, hY as ViewService, iV as ViewSyncLogger, iW as ViewSyncOptions, iU as ViewSyncResult, g9 as ViewsRepository, ha as WorkflowAccessGrantService, ga as WorkflowAccessGrantsRepository, e2 as WorkflowAccessPayload, he as WorkflowInstanceService, hd as WorkflowInstanceServiceOptions, gb as WorkflowInstancesRepository, hk as WorkflowInvitationService, gc as WorkflowInvitationsRepository, e3 as WorkflowJwtConfig, e4 as WorkflowJwtPayload, d$ as WorkflowJwtService, hl as WorkflowRelationService, hp as WorkflowService, ho as WorkflowServiceOptions, gd as WorkflowsRepository, eJ as addSchemaToContext, gM as applyDefaultValues, hw as buildAuditChanges, gP as buildPolicyContext, e9 as cacheKeys, ea as cacheTtl, gN as checkPermission, gQ as checkRecordAccess, gS as checkRecordDeleteOrThrow, gR as checkRecordModifyOrThrow, gT as checkSharedObjectWriteAccess, f5 as complete, gU as computeLabel, ik as computeLabelWithRelations, gY as createContextForCreate, g_ as createContextForDelete, g$ as createContextForRestore, gZ as createContextForUpdate, eY as createDefaultExecutorRegistry, el as createDefaultState, fQ as createMockAdapter, er as createQueryBuilder, fS as defaultPolicyRegistry, eb as defaultTtl, gX as enrichRecordsWithFormulas, ig as enrichValuesForDisplay, ih as enrichValuesWithSelectLabels, gW as enrichWithFormulas, f6 as error, ex as evaluate, ew as evaluateCondition, ff as evaluateFormula, fg as evaluateFormulaAttribute, fh as evaluateFormulaAttributeWithRelations, fi as evaluateFormulaWithRelations, fj as evaluateFormulaWithResult, ey as evaluateWithTrace, ie as extractAttributeNames, fk as extractFormulaVariables, ii as extractRelationIds, fl as extractRelationNames, fm as extractRelationReferences, fn as flattenRelationsForEval, fo as formatFormulaResult, em as formatRecord, en as formatRecords, eR as getContext, eZ as getDefaultExecutorRegistry, eB as getFeatureFlags, eC as getFeatureValue, fs as getPathDepth, gO as getPolicy, ft as getRelationPath, eK as getSchemaByNameFromContext, eL as getSchemaContext, eM as getSchemaFromContext, i7 as getSyncPreview, fu as getTargetAttributeName, eS as getTenantId, eT as getUserId, i$ as getViewSeedPreview, j0 as getViewSyncPreview, eU as hasContext, eD as hasFeatureFlagsContext, fp as hasRelationReferences, eN as hasSchemaContext, e6 as hashOptions, eE as isFeatureEnabled, id as isLabelExpression, fU as notesPolicy, fx as parsePath, fy as pathHasManyCardinality, h0 as recalculateParentRollups, ic as renderLabelExpression, fE as resolveMultiplePaths, fF as resolveSingleValue, eV as runWithContext, eF as runWithFeatureFlags, eO as runWithMergedSchemaContext, eP as runWithSchemaContext, iX as seedRegistryViews, f8 as success, ia as syncAll, i5 as syncNativeObjects, iY as syncNativeViews, fG as traversePath, eG as tryGetFeatureValue, fq as validateFormulaExpression, fz as validatePath, i6 as verifyNativeObjectsSync, i_ as verifyNativeViewsSync, iZ as verifyRegistryViewsSeeded, f9 as wait, eH as withFeatureFlags, eW as withTenantContext } from './runtime-SCsDOQi0.mjs';
|
|
2
|
+
export { a3 as CompletionStatus } from './validators-BgmWgr-G.mjs';
|
|
2
3
|
import '@stndrds/constants';
|
|
4
|
+
import './utils.mjs';
|
|
3
5
|
import 'jose';
|
|
4
6
|
import 'zod';
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { fV as AIConversationsRepository, fW as AIUsageMetricsRepository, fX as AIUserMemoryRepository, gj as AddAttributeInput, fJ as AttributeChange, fY as AttributesRepository, fZ as AuditRepository, hv as AuditService, gf as BaseRepository, ge as BaseService, e7 as CacheAdapter, e5 as CacheKeyType, e8 as CacheOptions, fa as ConditionExecutor, gi as CreateCustomObjectInput, ir as CreateDBAttribute, im as CreateDBObject, iB as CreateDBView, iF as CreateDBViewOverlay, iI as CreateDBWorkflow, iR as CreateDBWorkflowAccessGrant, iL as CreateDBWorkflowInstance, iO as CreateDBWorkflowInvitation, h9 as CreateGrantResult, iu as CreateObjectRecord, hK as CreateRecordDocumentInput, hL as CreateRecordDocumentResult, hU as CreateViewInput, hm as CreateWorkflowInput, iq as DBAttribute, il as DBObject, iA as DBView, iE as DBViewOverlay, iH as DBWorkflow, iQ as DBWorkflowAccessGrant, iK as DBWorkflowInstance, iN as DBWorkflowInvitation, ib as DEFAULT_LABEL_FALLBACK, d_ as DatabaseAdapter, fb as DocumentExecutor, hy as DocumentGenerationNotConfiguredError, hz as DocumentGenerationService, f_ as DocumentGenerationTemplateListOptions, hx as DocumentGenerationTemplateNotFoundError, f$ as DocumentGenerationTemplatesRepository, g0 as DocumentJobsRepository, hA as DocumentProcessingConfig, h3 as DocumentProcessingHook, h2 as DocumentProcessingHookOptions, hB as DocumentProcessingService, hF as DocumentRenderError, hD as DocumentRendererOptions, hH as DocumentRendererService, hN as DocumentService, hM as DocumentServiceOptions, g1 as DocumentSlotsRepository, hI as DocumentTemplateService, g3 as DocumentTemplatesRepository, g2 as DocumentsRepository, fc as EndExecutor, eu as EvaluationResult, ev as EvaluationTrace, e_ as ExecutorCompleteResult, e$ as ExecutorContext, f0 as ExecutorErrorResult, f7 as ExecutorRegistry, f1 as ExecutorResult, f2 as ExecutorSuccessResult, f3 as ExecutorWaitResult, eI as FeatureFlagsContext, eA as FeatureFlagsContextError, ed as FetchResult, hZ as FileContent, iz as FileListOptions, hP as FileService, hO as FileServiceOptions, g4 as FilesRepository, fd as FormExecutor, ee as FormattedRecord, gG as FormulaResolverService, gF as FormulaResolverServiceOptions, fr as FormulaResult, i9 as FullSyncOptions, i8 as FullSyncResult, bA as GeocodingAdapter, bx as GeocodingAutocompleteParams, bz as GeocodingParams, hQ as GeocodingService, bw as GeocodingSuggestion, gy as GetRelationOptionsParams, hX as GetViewOptions, hW as GetViewsOptions, ix as GlobalSearchOptions, iy as GlobalSearchResultItem, hR as GlobalSearchService, h5 as GrantExpiredError, h4 as GrantNotFoundError, h6 as GrantRevokedError, h8 as GrantServiceConfig, ef as GroupedFetchResult, fK as HookContext, fL as HookDefinition, fM as HookHandler, fP as HookRegistry, fN as HookType, eg as InsertOptions, fv as InvalidPathError, hi as InvitationAlreadyAcceptedError, hh as InvitationExpiredError, hg as InvitationNotFoundError, hj as InvitationRevokedError, hf as InvitationServiceConfig, e0 as JwtVerificationResult, gV as LabelResolver, iv as ListOptions, e1 as MagicLinkPayload, fw as MaxDepthExceededError, fR as MockStores, f4 as NodeExecutor, ec as NoopCacheAdapter, bB as NoopGeocodingAdapter, fO as NoopHookRegistry, g5 as ObjectRecordsRepository, gm as ObjectSchemaService, gl as ObjectSchemaServiceOptions, g6 as ObjectsRepository, iT as OperationResult, fA as PathCardinality, fB as PathSegment, fC as PathSegmentType, hT as PermissionService, hS as PermissionServiceOptions, g7 as PermissionsRepository, c8 as PolicyContext, fT as PolicyRegistry, ca as PolicyViolationError, es as QueryBuilder, et as QueryBuilderOptions, eh as QueryBuilderState, eo as QueryMultipleResultsError, ep as QueryNoResultError, gq as QueryOptions, gs as QueryResult, hJ as RecordDocumentsResult, c9 as RecordPolicy, gt as RecordQueryService, gp as RecordQueryServiceOptions, gD as RecordResolverService, go as RecordService, gn as RecordServiceOptions, ei as RegistryMap, ej as RegistryObjectNames, ij as RelationLabelResolver, gw as RelationOption, gx as RelationOptionsResponse, gC as RelationService, gz as RelationServiceOptions, gv as RelationValidationError, gu as RelationValidationResult, hC as RenderDocumentInput, hE as RenderDocumentResult, gA as ResolveIdsBatchRequest, gB as ResolveIdsBatchResponse, gE as ResolvedRelations, hc as ResumeWorkflowInput, by as ReverseGeocodingParams, h1 as RollupCascadeContext, gH as RollupResult, gL as RollupScheduler, gK as RollupSchedulerOptions, gJ as RollupService, gI as RollupServiceOptions, eq as SHORTCUT_TO_FILTER_OPERATOR, eQ as SchemaContext, gg as SchemaContextAware, gh as SchemaContextAwareRepository, fD as SchemaResolver, iw as SearchOptions, gr as SearchQueryOptions, ek as ShortcutOperator, i0 as SignedUrlOptions, fe as StartExecutor, hb as StartWorkflowInput, i1 as StorageAdapter, hG as StorageDownloadNotSupportedError, h_ as StorageUploadInput, h$ as StorageUploadResult, i4 as SyncOptions, i3 as SyncResult, eX as TenantContext, ez as TenantContextError, h7 as TokenRevokedError, fH as TraversalOptions, fI as TraversalResult, is as UpdateDBAttribute, io as UpdateDBObject, iC as UpdateDBView, iG as UpdateDBViewOverlay, iJ as UpdateDBWorkflow, iS as UpdateDBWorkflowAccessGrant, iM as UpdateDBWorkflowInstance, iP as UpdateDBWorkflowInvitation, gk as UpdateObjectInput, hV as UpdateViewInput, hn as UpdateWorkflowInput, i2 as UploadFileInput, it as UpsertDBAttribute, ip as UpsertDBObject, iD as UpsertDBView, hu as UserProfileService, ht as UserProfileServiceOptions, g8 as UserProfilesRepository, hs as UserService, hr as UserValidationError, hq as UserValidationResult, dZ as ViewOverlaysRepository, hY as ViewService, iV as ViewSyncLogger, iW as ViewSyncOptions, iU as ViewSyncResult, g9 as ViewsRepository, ha as WorkflowAccessGrantService, ga as WorkflowAccessGrantsRepository, e2 as WorkflowAccessPayload, he as WorkflowInstanceService, hd as WorkflowInstanceServiceOptions, gb as WorkflowInstancesRepository, hk as WorkflowInvitationService, gc as WorkflowInvitationsRepository, e3 as WorkflowJwtConfig, e4 as WorkflowJwtPayload, d$ as WorkflowJwtService, hl as WorkflowRelationService, hp as WorkflowService, ho as WorkflowServiceOptions, gd as WorkflowsRepository, eJ as addSchemaToContext, gM as applyDefaultValues, hw as buildAuditChanges, gP as buildPolicyContext, e9 as cacheKeys, ea as cacheTtl, gN as checkPermission, gQ as checkRecordAccess, gS as checkRecordDeleteOrThrow, gR as checkRecordModifyOrThrow, gT as checkSharedObjectWriteAccess, f5 as complete, gU as computeLabel, ik as computeLabelWithRelations, gY as createContextForCreate, g_ as createContextForDelete, g$ as createContextForRestore, gZ as createContextForUpdate, eY as createDefaultExecutorRegistry, el as createDefaultState, fQ as createMockAdapter, er as createQueryBuilder, fS as defaultPolicyRegistry, eb as defaultTtl, gX as enrichRecordsWithFormulas, ig as enrichValuesForDisplay, ih as enrichValuesWithSelectLabels, gW as enrichWithFormulas, f6 as error, ex as evaluate, ew as evaluateCondition, ff as evaluateFormula, fg as evaluateFormulaAttribute, fh as evaluateFormulaAttributeWithRelations, fi as evaluateFormulaWithRelations, fj as evaluateFormulaWithResult, ey as evaluateWithTrace, ie as extractAttributeNames, fk as extractFormulaVariables, ii as extractRelationIds, fl as extractRelationNames, fm as extractRelationReferences, fn as flattenRelationsForEval, fo as formatFormulaResult, em as formatRecord, en as formatRecords, eR as getContext, eZ as getDefaultExecutorRegistry, eB as getFeatureFlags, eC as getFeatureValue, fs as getPathDepth, gO as getPolicy, ft as getRelationPath, eK as getSchemaByNameFromContext, eL as getSchemaContext, eM as getSchemaFromContext, i7 as getSyncPreview, fu as getTargetAttributeName, eS as getTenantId, eT as getUserId, i$ as getViewSeedPreview, j0 as getViewSyncPreview, eU as hasContext, eD as hasFeatureFlagsContext, fp as hasRelationReferences, eN as hasSchemaContext, e6 as hashOptions, eE as isFeatureEnabled, id as isLabelExpression, fU as notesPolicy, fx as parsePath, fy as pathHasManyCardinality, h0 as recalculateParentRollups, ic as renderLabelExpression, fE as resolveMultiplePaths, fF as resolveSingleValue, eV as runWithContext, eF as runWithFeatureFlags, eO as runWithMergedSchemaContext, eP as runWithSchemaContext, iX as seedRegistryViews, f8 as success, ia as syncAll, i5 as syncNativeObjects, iY as syncNativeViews, fG as traversePath, eG as tryGetFeatureValue, fq as validateFormulaExpression, fz as validatePath, i6 as verifyNativeObjectsSync, i_ as verifyNativeViewsSync, iZ as verifyRegistryViewsSeeded, f9 as wait, eH as withFeatureFlags, eW as withTenantContext } from './runtime-C4vB_EcQ.js';
|
|
2
|
+
export { a3 as CompletionStatus } from './validators-miARInAq.js';
|
|
2
3
|
import '@stndrds/constants';
|
|
4
|
+
import './utils.js';
|
|
3
5
|
import 'jose';
|
|
4
6
|
import 'zod';
|
package/dist/runtime.js
CHANGED
|
@@ -146,7 +146,20 @@
|
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
var _chunk2OS63USQjs = require('./chunk-2OS63USQ.js');
|
|
161
|
+
require('./chunk-NEVERCM3.js');
|
|
162
|
+
require('./chunk-U4AB53AM.js');
|
|
150
163
|
require('./chunk-3RG5ZIWI.js');
|
|
151
164
|
|
|
152
165
|
|
|
@@ -296,4 +309,15 @@ require('./chunk-3RG5ZIWI.js');
|
|
|
296
309
|
|
|
297
310
|
|
|
298
311
|
|
|
299
|
-
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
exports.AuditService = _chunk2OS63USQjs.AuditService; exports.BaseRepository = _chunk2OS63USQjs.BaseRepository; exports.BaseService = _chunk2OS63USQjs.BaseService; exports.ConditionExecutor = _chunk2OS63USQjs.ConditionExecutor; exports.DEFAULT_LABEL_FALLBACK = _chunk2OS63USQjs.DEFAULT_LABEL_FALLBACK; exports.DocumentExecutor = _chunk2OS63USQjs.DocumentExecutor; exports.DocumentGenerationNotConfiguredError = _chunk2OS63USQjs.DocumentGenerationNotConfiguredError; exports.DocumentGenerationService = _chunk2OS63USQjs.DocumentGenerationService; exports.DocumentGenerationTemplateNotFoundError = _chunk2OS63USQjs.DocumentGenerationTemplateNotFoundError; exports.DocumentProcessingHook = _chunk2OS63USQjs.DocumentProcessingHook; exports.DocumentProcessingService = _chunk2OS63USQjs.DocumentProcessingService; exports.DocumentRenderError = _chunk2OS63USQjs.DocumentRenderError; exports.DocumentRendererService = _chunk2OS63USQjs.DocumentRendererService; exports.DocumentService = _chunk2OS63USQjs.DocumentService; exports.DocumentTemplateService = _chunk2OS63USQjs.DocumentTemplateService; exports.EndExecutor = _chunk2OS63USQjs.EndExecutor; exports.ExecutorRegistry = _chunk2OS63USQjs.ExecutorRegistry; exports.FeatureFlagsContextError = _chunk2OS63USQjs.FeatureFlagsContextError; exports.FileService = _chunk2OS63USQjs.FileService; exports.FormExecutor = _chunk2OS63USQjs.FormExecutor; exports.FormulaResolverService = _chunk2OS63USQjs.FormulaResolverService; exports.GeocodingService = _chunk2OS63USQjs.GeocodingService; exports.GlobalSearchService = _chunk2OS63USQjs.GlobalSearchService; exports.GrantExpiredError = _chunk2OS63USQjs.GrantExpiredError; exports.GrantNotFoundError = _chunk2OS63USQjs.GrantNotFoundError; exports.GrantRevokedError = _chunk2OS63USQjs.GrantRevokedError; exports.InvalidPathError = _chunk2OS63USQjs.InvalidPathError; exports.InvitationAlreadyAcceptedError = _chunk2OS63USQjs.InvitationAlreadyAcceptedError; exports.InvitationExpiredError = _chunk2OS63USQjs.InvitationExpiredError; exports.InvitationNotFoundError = _chunk2OS63USQjs.InvitationNotFoundError; exports.InvitationRevokedError = _chunk2OS63USQjs.InvitationRevokedError; exports.MaxDepthExceededError = _chunk2OS63USQjs.MaxDepthExceededError; exports.NoopCacheAdapter = _chunk2OS63USQjs.NoopCacheAdapter; exports.NoopGeocodingAdapter = _chunk2OS63USQjs.NoopGeocodingAdapter; exports.NoopHookRegistry = _chunk2OS63USQjs.NoopHookRegistry; exports.ObjectSchemaService = _chunk2OS63USQjs.ObjectSchemaService; exports.PermissionService = _chunk2OS63USQjs.PermissionService; exports.PolicyRegistry = _chunk2OS63USQjs.PolicyRegistry; exports.PolicyViolationError = _chunk2OS63USQjs.PolicyViolationError; exports.QueryBuilder = _chunk2OS63USQjs.QueryBuilder; exports.QueryMultipleResultsError = _chunk2OS63USQjs.QueryMultipleResultsError; exports.QueryNoResultError = _chunk2OS63USQjs.QueryNoResultError; exports.RecordQueryService = _chunk2OS63USQjs.RecordQueryService; exports.RecordResolverService = _chunk2OS63USQjs.RecordResolverService; exports.RecordService = _chunk2OS63USQjs.RecordService; exports.RelationService = _chunk2OS63USQjs.RelationService; exports.RollupScheduler = _chunk2OS63USQjs.RollupScheduler; exports.RollupService = _chunk2OS63USQjs.RollupService; exports.SHORTCUT_TO_FILTER_OPERATOR = _chunk2OS63USQjs.SHORTCUT_TO_FILTER_OPERATOR; exports.SchemaContextAwareRepository = _chunk2OS63USQjs.SchemaContextAwareRepository; exports.StartExecutor = _chunk2OS63USQjs.StartExecutor; exports.StorageDownloadNotSupportedError = _chunk2OS63USQjs.StorageDownloadNotSupportedError; exports.TenantContextError = _chunk2OS63USQjs.TenantContextError; exports.TokenRevokedError = _chunk2OS63USQjs.TokenRevokedError; exports.UserProfileService = _chunk2OS63USQjs.UserProfileService; exports.UserService = _chunk2OS63USQjs.UserService; exports.ViewService = _chunk2OS63USQjs.ViewService; exports.WorkflowAccessGrantService = _chunk2OS63USQjs.WorkflowAccessGrantService; exports.WorkflowInstanceService = _chunk2OS63USQjs.WorkflowInstanceService; exports.WorkflowInvitationService = _chunk2OS63USQjs.WorkflowInvitationService; exports.WorkflowJwtService = _chunk2OS63USQjs.WorkflowJwtService; exports.WorkflowRelationService = _chunk2OS63USQjs.WorkflowRelationService; exports.WorkflowService = _chunk2OS63USQjs.WorkflowService; exports.addSchemaToContext = _chunk2OS63USQjs.addSchemaToContext; exports.applyDefaultValues = _chunk2OS63USQjs.applyDefaultValues; exports.buildAuditChanges = _chunk2OS63USQjs.buildAuditChanges; exports.buildPolicyContext = _chunk2OS63USQjs.buildPolicyContext; exports.cacheKeys = _chunk2OS63USQjs.cacheKeys; exports.cacheTtl = _chunk2OS63USQjs.cacheTtl; exports.checkPermission = _chunk2OS63USQjs.checkPermission; exports.checkRecordAccess = _chunk2OS63USQjs.checkRecordAccess; exports.checkRecordDeleteOrThrow = _chunk2OS63USQjs.checkRecordDeleteOrThrow; exports.checkRecordModifyOrThrow = _chunk2OS63USQjs.checkRecordModifyOrThrow; exports.checkSharedObjectWriteAccess = _chunk2OS63USQjs.checkSharedObjectWriteAccess; exports.complete = _chunk2OS63USQjs.complete; exports.computeLabel = _chunk2OS63USQjs.computeLabel; exports.computeLabelWithRelations = _chunk2OS63USQjs.computeLabelWithRelations; exports.createContextForCreate = _chunk2OS63USQjs.createContextForCreate; exports.createContextForDelete = _chunk2OS63USQjs.createContextForDelete; exports.createContextForRestore = _chunk2OS63USQjs.createContextForRestore; exports.createContextForUpdate = _chunk2OS63USQjs.createContextForUpdate; exports.createDefaultExecutorRegistry = _chunk2OS63USQjs.createDefaultExecutorRegistry; exports.createDefaultState = _chunk2OS63USQjs.createDefaultState; exports.createMockAdapter = _chunk2OS63USQjs.createMockAdapter; exports.createQueryBuilder = _chunk2OS63USQjs.createQueryBuilder; exports.defaultPolicyRegistry = _chunk2OS63USQjs.defaultPolicyRegistry; exports.defaultTtl = _chunk2OS63USQjs.defaultTtl; exports.enrichRecordsWithFormulas = _chunk2OS63USQjs.enrichRecordsWithFormulas; exports.enrichValuesForDisplay = _chunk2OS63USQjs.enrichValuesForDisplay; exports.enrichValuesWithSelectLabels = _chunk2OS63USQjs.enrichValuesWithSelectLabels; exports.enrichWithFormulas = _chunk2OS63USQjs.enrichWithFormulas; exports.error = _chunk2OS63USQjs.error; exports.evaluate = _chunk2OS63USQjs.evaluate; exports.evaluateCondition = _chunk2OS63USQjs.evaluateCondition; exports.evaluateFormula = _chunk2OS63USQjs.evaluateFormula; exports.evaluateFormulaAttribute = _chunk2OS63USQjs.evaluateFormulaAttribute; exports.evaluateFormulaAttributeWithRelations = _chunk2OS63USQjs.evaluateFormulaAttributeWithRelations; exports.evaluateFormulaWithRelations = _chunk2OS63USQjs.evaluateFormulaWithRelations; exports.evaluateFormulaWithResult = _chunk2OS63USQjs.evaluateFormulaWithResult; exports.evaluateWithTrace = _chunk2OS63USQjs.evaluateWithTrace; exports.extractAttributeNames = _chunk2OS63USQjs.extractAttributeNames; exports.extractFormulaVariables = _chunk2OS63USQjs.extractFormulaVariables; exports.extractRelationIds = _chunk2OS63USQjs.extractRelationIds; exports.extractRelationNames = _chunk2OS63USQjs.extractRelationNames; exports.extractRelationReferences = _chunk2OS63USQjs.extractRelationReferences; exports.flattenRelationsForEval = _chunk2OS63USQjs.flattenRelationsForEval; exports.formatFormulaResult = _chunk2OS63USQjs.formatFormulaResult; exports.formatRecord = _chunk2OS63USQjs.formatRecord; exports.formatRecords = _chunk2OS63USQjs.formatRecords; exports.getContext = _chunk2OS63USQjs.getContext; exports.getDefaultExecutorRegistry = _chunk2OS63USQjs.getDefaultExecutorRegistry; exports.getFeatureFlags = _chunk2OS63USQjs.getFeatureFlags; exports.getFeatureValue = _chunk2OS63USQjs.getFeatureValue; exports.getPathDepth = _chunk2OS63USQjs.getPathDepth; exports.getPolicy = _chunk2OS63USQjs.getPolicy; exports.getRelationPath = _chunk2OS63USQjs.getRelationPath; exports.getSchemaByNameFromContext = _chunk2OS63USQjs.getSchemaByNameFromContext; exports.getSchemaContext = _chunk2OS63USQjs.getSchemaContext; exports.getSchemaFromContext = _chunk2OS63USQjs.getSchemaFromContext; exports.getSyncPreview = _chunk2OS63USQjs.getSyncPreview; exports.getTargetAttributeName = _chunk2OS63USQjs.getTargetAttributeName; exports.getTenantId = _chunk2OS63USQjs.getTenantId; exports.getUserId = _chunk2OS63USQjs.getUserId; exports.getViewSeedPreview = _chunk2OS63USQjs.getViewSeedPreview; exports.getViewSyncPreview = _chunk2OS63USQjs.getViewSyncPreview; exports.hasContext = _chunk2OS63USQjs.hasContext; exports.hasFeatureFlagsContext = _chunk2OS63USQjs.hasFeatureFlagsContext; exports.hasRelationReferences = _chunk2OS63USQjs.hasRelationReferences; exports.hasSchemaContext = _chunk2OS63USQjs.hasSchemaContext; exports.hashOptions = _chunk2OS63USQjs.hashOptions; exports.isFeatureEnabled = _chunk2OS63USQjs.isFeatureEnabled; exports.isLabelExpression = _chunk2OS63USQjs.isLabelExpression; exports.notesPolicy = _chunk2OS63USQjs.notesPolicy; exports.parsePath = _chunk2OS63USQjs.parsePath; exports.pathHasManyCardinality = _chunk2OS63USQjs.pathHasManyCardinality; exports.recalculateParentRollups = _chunk2OS63USQjs.recalculateParentRollups; exports.renderLabelExpression = _chunk2OS63USQjs.renderLabelExpression; exports.resolveMultiplePaths = _chunk2OS63USQjs.resolveMultiplePaths; exports.resolveSingleValue = _chunk2OS63USQjs.resolveSingleValue; exports.runWithContext = _chunk2OS63USQjs.runWithContext; exports.runWithFeatureFlags = _chunk2OS63USQjs.runWithFeatureFlags; exports.runWithMergedSchemaContext = _chunk2OS63USQjs.runWithMergedSchemaContext; exports.runWithSchemaContext = _chunk2OS63USQjs.runWithSchemaContext; exports.seedRegistryViews = _chunk2OS63USQjs.seedRegistryViews; exports.success = _chunk2OS63USQjs.success; exports.syncAll = _chunk2OS63USQjs.syncAll; exports.syncNativeObjects = _chunk2OS63USQjs.syncNativeObjects; exports.syncNativeViews = _chunk2OS63USQjs.syncNativeViews; exports.traversePath = _chunk2OS63USQjs.traversePath; exports.tryGetFeatureValue = _chunk2OS63USQjs.tryGetFeatureValue; exports.validateFormulaExpression = _chunk2OS63USQjs.validateFormulaExpression; exports.validatePath = _chunk2OS63USQjs.validatePath; exports.verifyNativeObjectsSync = _chunk2OS63USQjs.verifyNativeObjectsSync; exports.verifyNativeViewsSync = _chunk2OS63USQjs.verifyNativeViewsSync; exports.verifyRegistryViewsSeeded = _chunk2OS63USQjs.verifyRegistryViewsSeeded; exports.wait = _chunk2OS63USQjs.wait; exports.withFeatureFlags = _chunk2OS63USQjs.withFeatureFlags; exports.withTenantContext = _chunk2OS63USQjs.withTenantContext;
|
package/dist/runtime.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
DocumentTemplateService,
|
|
17
17
|
EndExecutor,
|
|
18
18
|
ExecutorRegistry,
|
|
19
|
+
FeatureFlagsContextError,
|
|
19
20
|
FileService,
|
|
20
21
|
FormExecutor,
|
|
21
22
|
FormulaResolverService,
|
|
@@ -109,6 +110,8 @@ import {
|
|
|
109
110
|
formatRecords,
|
|
110
111
|
getContext,
|
|
111
112
|
getDefaultExecutorRegistry,
|
|
113
|
+
getFeatureFlags,
|
|
114
|
+
getFeatureValue,
|
|
112
115
|
getPathDepth,
|
|
113
116
|
getPolicy,
|
|
114
117
|
getRelationPath,
|
|
@@ -119,11 +122,14 @@ import {
|
|
|
119
122
|
getTargetAttributeName,
|
|
120
123
|
getTenantId,
|
|
121
124
|
getUserId,
|
|
125
|
+
getViewSeedPreview,
|
|
122
126
|
getViewSyncPreview,
|
|
123
127
|
hasContext,
|
|
128
|
+
hasFeatureFlagsContext,
|
|
124
129
|
hasRelationReferences,
|
|
125
130
|
hasSchemaContext,
|
|
126
131
|
hashOptions,
|
|
132
|
+
isFeatureEnabled,
|
|
127
133
|
isLabelExpression,
|
|
128
134
|
notesPolicy,
|
|
129
135
|
parsePath,
|
|
@@ -133,20 +139,27 @@ import {
|
|
|
133
139
|
resolveMultiplePaths,
|
|
134
140
|
resolveSingleValue,
|
|
135
141
|
runWithContext,
|
|
142
|
+
runWithFeatureFlags,
|
|
136
143
|
runWithMergedSchemaContext,
|
|
137
144
|
runWithSchemaContext,
|
|
145
|
+
seedRegistryViews,
|
|
138
146
|
success,
|
|
139
147
|
syncAll,
|
|
140
148
|
syncNativeObjects,
|
|
141
149
|
syncNativeViews,
|
|
142
150
|
traversePath,
|
|
151
|
+
tryGetFeatureValue,
|
|
143
152
|
validateFormulaExpression,
|
|
144
153
|
validatePath,
|
|
145
154
|
verifyNativeObjectsSync,
|
|
146
155
|
verifyNativeViewsSync,
|
|
156
|
+
verifyRegistryViewsSeeded,
|
|
147
157
|
wait,
|
|
158
|
+
withFeatureFlags,
|
|
148
159
|
withTenantContext
|
|
149
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-JRY236AO.mjs";
|
|
161
|
+
import "./chunk-V2RPPE2Y.mjs";
|
|
162
|
+
import "./chunk-SV4BCGQU.mjs";
|
|
150
163
|
import "./chunk-Y6FXYEAI.mjs";
|
|
151
164
|
export {
|
|
152
165
|
AuditService,
|
|
@@ -166,6 +179,7 @@ export {
|
|
|
166
179
|
DocumentTemplateService,
|
|
167
180
|
EndExecutor,
|
|
168
181
|
ExecutorRegistry,
|
|
182
|
+
FeatureFlagsContextError,
|
|
169
183
|
FileService,
|
|
170
184
|
FormExecutor,
|
|
171
185
|
FormulaResolverService,
|
|
@@ -259,6 +273,8 @@ export {
|
|
|
259
273
|
formatRecords,
|
|
260
274
|
getContext,
|
|
261
275
|
getDefaultExecutorRegistry,
|
|
276
|
+
getFeatureFlags,
|
|
277
|
+
getFeatureValue,
|
|
262
278
|
getPathDepth,
|
|
263
279
|
getPolicy,
|
|
264
280
|
getRelationPath,
|
|
@@ -269,11 +285,14 @@ export {
|
|
|
269
285
|
getTargetAttributeName,
|
|
270
286
|
getTenantId,
|
|
271
287
|
getUserId,
|
|
288
|
+
getViewSeedPreview,
|
|
272
289
|
getViewSyncPreview,
|
|
273
290
|
hasContext,
|
|
291
|
+
hasFeatureFlagsContext,
|
|
274
292
|
hasRelationReferences,
|
|
275
293
|
hasSchemaContext,
|
|
276
294
|
hashOptions,
|
|
295
|
+
isFeatureEnabled,
|
|
277
296
|
isLabelExpression,
|
|
278
297
|
notesPolicy,
|
|
279
298
|
parsePath,
|
|
@@ -283,17 +302,22 @@ export {
|
|
|
283
302
|
resolveMultiplePaths,
|
|
284
303
|
resolveSingleValue,
|
|
285
304
|
runWithContext,
|
|
305
|
+
runWithFeatureFlags,
|
|
286
306
|
runWithMergedSchemaContext,
|
|
287
307
|
runWithSchemaContext,
|
|
308
|
+
seedRegistryViews,
|
|
288
309
|
success,
|
|
289
310
|
syncAll,
|
|
290
311
|
syncNativeObjects,
|
|
291
312
|
syncNativeViews,
|
|
292
313
|
traversePath,
|
|
314
|
+
tryGetFeatureValue,
|
|
293
315
|
validateFormulaExpression,
|
|
294
316
|
validatePath,
|
|
295
317
|
verifyNativeObjectsSync,
|
|
296
318
|
verifyNativeViewsSync,
|
|
319
|
+
verifyRegistryViewsSeeded,
|
|
297
320
|
wait,
|
|
321
|
+
withFeatureFlags,
|
|
298
322
|
withTenantContext
|
|
299
323
|
};
|
package/dist/utils.d.mts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand symbol for nominal typing.
|
|
3
|
+
* This ensures type-safety by making IDs non-interchangeable.
|
|
4
|
+
*/
|
|
5
|
+
declare const __brand: unique symbol;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a branded type from a base type.
|
|
8
|
+
* Branded types are structurally identical but nominally different.
|
|
9
|
+
*/
|
|
10
|
+
type Brand<T, B> = T & {
|
|
11
|
+
readonly [__brand]: B;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* UUID string type for all identifiers
|
|
15
|
+
*/
|
|
16
|
+
type Uuid = string;
|
|
17
|
+
/**
|
|
18
|
+
* Tenant identifier for multi-tenant isolation.
|
|
19
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const tenantId: TenantId = asTenantId('tenant-123');
|
|
24
|
+
* const userId: UserId = asUserId('user-456');
|
|
25
|
+
*
|
|
26
|
+
* // Type error: cannot assign UserId to TenantId
|
|
27
|
+
* const wrong: TenantId = userId;
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
type TenantId = Brand<string, "TenantId">;
|
|
31
|
+
/**
|
|
32
|
+
* User identifier for audit trails and permissions.
|
|
33
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
34
|
+
*/
|
|
35
|
+
type UserId = Brand<string, "UserId">;
|
|
36
|
+
/**
|
|
37
|
+
* Convert a string to a TenantId.
|
|
38
|
+
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
39
|
+
*
|
|
40
|
+
* @param id - The string to convert
|
|
41
|
+
* @returns A branded TenantId
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function asTenantId(id: string): TenantId;
|
|
49
|
+
/**
|
|
50
|
+
* Convert a string to a UserId.
|
|
51
|
+
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
52
|
+
*
|
|
53
|
+
* @param id - The string to convert
|
|
54
|
+
* @returns A branded UserId
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const userId = asUserId(jwtPayload.sub);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare function asUserId(id: string): UserId;
|
|
62
|
+
/**
|
|
63
|
+
* Generate a unique UUID v4
|
|
64
|
+
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
65
|
+
* Falls back to a manual implementation for older environments
|
|
66
|
+
*
|
|
67
|
+
* @returns A UUID v4 string
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const id = generateId();
|
|
72
|
+
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare function generateId(): Uuid;
|
|
76
|
+
/**
|
|
77
|
+
* Generate a prefixed ID for better debugging and readability
|
|
78
|
+
*
|
|
79
|
+
* @param prefix - Prefix for the ID (e.g., "obj", "attr", "rec")
|
|
80
|
+
* @returns A prefixed UUID string
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const objectId = generatePrefixedId("obj");
|
|
85
|
+
* // "obj_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
86
|
+
*
|
|
87
|
+
* const attrId = generatePrefixedId("attr");
|
|
88
|
+
* // "attr_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function generatePrefixedId(prefix: string): Uuid;
|
|
92
|
+
/**
|
|
93
|
+
* Convert a string to a valid kebab-case slug.
|
|
94
|
+
* Removes accents, special chars, and normalizes spaces.
|
|
95
|
+
*
|
|
96
|
+
* @param input - The string to slugify
|
|
97
|
+
* @returns A kebab-case slug matching pattern ^[a-z][a-z0-9-]*$
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* slugify("Contrat de Vente");
|
|
102
|
+
* // "contrat-de-vente"
|
|
103
|
+
*
|
|
104
|
+
* slugify("Éléphant café");
|
|
105
|
+
* // "elephant-cafe"
|
|
106
|
+
*
|
|
107
|
+
* slugify(" Multiple Spaces ");
|
|
108
|
+
* // "multiple-spaces"
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare function slugify(input: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* Generate a unique template name from a label.
|
|
114
|
+
* Format: {slugified-label}-{8-char-suffix}
|
|
115
|
+
* Matches DB constraint: ^[a-z][a-z0-9_-]*$
|
|
116
|
+
*
|
|
117
|
+
* @param label - The label to generate a name from
|
|
118
|
+
* @returns A unique kebab-case name
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* generateTemplateName("Contrat de Vente");
|
|
123
|
+
* // "contrat-de-vente-a1b2c3d4"
|
|
124
|
+
*
|
|
125
|
+
* generateTemplateName("");
|
|
126
|
+
* // "template-a1b2c3d4"
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
declare function generateTemplateName(label: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* Create a Map indexed by a key extracted from each item.
|
|
132
|
+
* This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
|
|
133
|
+
*
|
|
134
|
+
* Time complexity: O(n)
|
|
135
|
+
* Space complexity: O(n)
|
|
136
|
+
*
|
|
137
|
+
* @param items - Array of items to index
|
|
138
|
+
* @param keyFn - Function to extract the key from each item
|
|
139
|
+
* @returns Map indexed by the extracted key
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const attributes = [{ name: "title", type: "text" }, { name: "status", type: "select" }];
|
|
144
|
+
*
|
|
145
|
+
* // Before:
|
|
146
|
+
* const attrMap = new Map(attributes.map(a => [a.name, a]));
|
|
147
|
+
*
|
|
148
|
+
* // After:
|
|
149
|
+
* const attrMap = indexBy(attributes, a => a.name);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
153
|
+
|
|
154
|
+
export { type TenantId, type UserId, type Uuid, asTenantId, asUserId, generateId, generatePrefixedId, generateTemplateName, indexBy, slugify };
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand symbol for nominal typing.
|
|
3
|
+
* This ensures type-safety by making IDs non-interchangeable.
|
|
4
|
+
*/
|
|
5
|
+
declare const __brand: unique symbol;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a branded type from a base type.
|
|
8
|
+
* Branded types are structurally identical but nominally different.
|
|
9
|
+
*/
|
|
10
|
+
type Brand<T, B> = T & {
|
|
11
|
+
readonly [__brand]: B;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* UUID string type for all identifiers
|
|
15
|
+
*/
|
|
16
|
+
type Uuid = string;
|
|
17
|
+
/**
|
|
18
|
+
* Tenant identifier for multi-tenant isolation.
|
|
19
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const tenantId: TenantId = asTenantId('tenant-123');
|
|
24
|
+
* const userId: UserId = asUserId('user-456');
|
|
25
|
+
*
|
|
26
|
+
* // Type error: cannot assign UserId to TenantId
|
|
27
|
+
* const wrong: TenantId = userId;
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
type TenantId = Brand<string, "TenantId">;
|
|
31
|
+
/**
|
|
32
|
+
* User identifier for audit trails and permissions.
|
|
33
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
34
|
+
*/
|
|
35
|
+
type UserId = Brand<string, "UserId">;
|
|
36
|
+
/**
|
|
37
|
+
* Convert a string to a TenantId.
|
|
38
|
+
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
39
|
+
*
|
|
40
|
+
* @param id - The string to convert
|
|
41
|
+
* @returns A branded TenantId
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function asTenantId(id: string): TenantId;
|
|
49
|
+
/**
|
|
50
|
+
* Convert a string to a UserId.
|
|
51
|
+
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
52
|
+
*
|
|
53
|
+
* @param id - The string to convert
|
|
54
|
+
* @returns A branded UserId
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const userId = asUserId(jwtPayload.sub);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare function asUserId(id: string): UserId;
|
|
62
|
+
/**
|
|
63
|
+
* Generate a unique UUID v4
|
|
64
|
+
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
65
|
+
* Falls back to a manual implementation for older environments
|
|
66
|
+
*
|
|
67
|
+
* @returns A UUID v4 string
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const id = generateId();
|
|
72
|
+
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare function generateId(): Uuid;
|
|
76
|
+
/**
|
|
77
|
+
* Generate a prefixed ID for better debugging and readability
|
|
78
|
+
*
|
|
79
|
+
* @param prefix - Prefix for the ID (e.g., "obj", "attr", "rec")
|
|
80
|
+
* @returns A prefixed UUID string
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const objectId = generatePrefixedId("obj");
|
|
85
|
+
* // "obj_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
86
|
+
*
|
|
87
|
+
* const attrId = generatePrefixedId("attr");
|
|
88
|
+
* // "attr_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function generatePrefixedId(prefix: string): Uuid;
|
|
92
|
+
/**
|
|
93
|
+
* Convert a string to a valid kebab-case slug.
|
|
94
|
+
* Removes accents, special chars, and normalizes spaces.
|
|
95
|
+
*
|
|
96
|
+
* @param input - The string to slugify
|
|
97
|
+
* @returns A kebab-case slug matching pattern ^[a-z][a-z0-9-]*$
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* slugify("Contrat de Vente");
|
|
102
|
+
* // "contrat-de-vente"
|
|
103
|
+
*
|
|
104
|
+
* slugify("Éléphant café");
|
|
105
|
+
* // "elephant-cafe"
|
|
106
|
+
*
|
|
107
|
+
* slugify(" Multiple Spaces ");
|
|
108
|
+
* // "multiple-spaces"
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare function slugify(input: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* Generate a unique template name from a label.
|
|
114
|
+
* Format: {slugified-label}-{8-char-suffix}
|
|
115
|
+
* Matches DB constraint: ^[a-z][a-z0-9_-]*$
|
|
116
|
+
*
|
|
117
|
+
* @param label - The label to generate a name from
|
|
118
|
+
* @returns A unique kebab-case name
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* generateTemplateName("Contrat de Vente");
|
|
123
|
+
* // "contrat-de-vente-a1b2c3d4"
|
|
124
|
+
*
|
|
125
|
+
* generateTemplateName("");
|
|
126
|
+
* // "template-a1b2c3d4"
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
declare function generateTemplateName(label: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* Create a Map indexed by a key extracted from each item.
|
|
132
|
+
* This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
|
|
133
|
+
*
|
|
134
|
+
* Time complexity: O(n)
|
|
135
|
+
* Space complexity: O(n)
|
|
136
|
+
*
|
|
137
|
+
* @param items - Array of items to index
|
|
138
|
+
* @param keyFn - Function to extract the key from each item
|
|
139
|
+
* @returns Map indexed by the extracted key
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const attributes = [{ name: "title", type: "text" }, { name: "status", type: "select" }];
|
|
144
|
+
*
|
|
145
|
+
* // Before:
|
|
146
|
+
* const attrMap = new Map(attributes.map(a => [a.name, a]));
|
|
147
|
+
*
|
|
148
|
+
* // After:
|
|
149
|
+
* const attrMap = indexBy(attributes, a => a.name);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
153
|
+
|
|
154
|
+
export { type TenantId, type UserId, type Uuid, asTenantId, asUserId, generateId, generatePrefixedId, generateTemplateName, indexBy, slugify };
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkNEVERCM3js = require('./chunk-NEVERCM3.js');
|
|
10
|
+
require('./chunk-3RG5ZIWI.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.asTenantId = _chunkNEVERCM3js.asTenantId; exports.asUserId = _chunkNEVERCM3js.asUserId; exports.generateId = _chunkNEVERCM3js.generateId; exports.generatePrefixedId = _chunkNEVERCM3js.generatePrefixedId; exports.generateTemplateName = _chunkNEVERCM3js.generateTemplateName; exports.indexBy = _chunkNEVERCM3js.indexBy; exports.slugify = _chunkNEVERCM3js.slugify;
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asTenantId,
|
|
3
|
+
asUserId,
|
|
4
|
+
generateId,
|
|
5
|
+
generatePrefixedId,
|
|
6
|
+
generateTemplateName,
|
|
7
|
+
indexBy,
|
|
8
|
+
slugify
|
|
9
|
+
} from "./chunk-V2RPPE2Y.mjs";
|
|
10
|
+
import "./chunk-Y6FXYEAI.mjs";
|
|
11
|
+
export {
|
|
12
|
+
asTenantId,
|
|
13
|
+
asUserId,
|
|
14
|
+
generateId,
|
|
15
|
+
generatePrefixedId,
|
|
16
|
+
generateTemplateName,
|
|
17
|
+
indexBy,
|
|
18
|
+
slugify
|
|
19
|
+
};
|