@stndrds/schema 0.1.0-alpha.21 → 0.1.0-alpha.22

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.
@@ -1,3 +1,3 @@
1
- export { dJ as AddAttributeInput, dh as AttributeChange, dr as AttributesRepository, dx as AuditRepository, dA as AuditService, bb as CompletionStatus, dI as CreateCustomObjectInput, ex as CreateDBAttribute, eL as CreateDBFlow, et as CreateDBObject, eH as CreateDBView, dD as CreateFlowInput, eA as CreateObjectRecord, e6 as CreateViewInput, ew as DBAttribute, eK as DBFlow, es as DBObject, eG as DBView, en as DEFAULT_LABEL_FALLBACK, cy as DatabaseAdapter, cz as FetchResult, e9 as FileContent, eF as FileListOptions, dC as FileService, dB as FileServiceOptions, dt as FilesRepository, dF as FlowService, dw as FlowsRepository, cA as FormattedRecord, c$ as FormulaResult, el as FullSyncOptions, ek as FullSyncResult, aO as GeocodingAdapter, aL as GeocodingAutocompleteParams, aN as GeocodingParams, dG as GeocodingService, aK as GeocodingSuggestion, dV as GetRelationOptionsParams, eD as GlobalSearchOptions, eE as GlobalSearchResultItem, dH as GlobalSearchService, cB as GroupedFetchResult, di as HookContext, dj as HookDefinition, dk as HookHandler, dn as HookRegistry, dl as HookType, cC as InsertOptions, d3 as InvalidPathError, eB as ListOptions, d4 as MaxDepthExceededError, aP as NoopGeocodingAdapter, dm as NoopHookRegistry, du as ObjectRecordsRepository, dM as ObjectSchemaService, dL as ObjectSchemaServiceOptions, dq as ObjectsRepository, eN as OperationResult, d8 as PathCardinality, d9 as PathSegment, da as PathSegmentType, dO as PermissionService, dN as PermissionServiceOptions, dy as PermissionsRepository, cO as QueryBuilder, cD as QueryBuilderState, cK as QueryMultipleResultsError, cL as QueryNoResultError, dQ as RecordService, dP as RecordServiceOptions, cE as RegistryMap, cF as RegistryObjectNames, dT as RelationOption, dU as RelationOptionsResponse, dY as RelationResolverService, dW as RelationService, dS as RelationValidationError, dR as RelationValidationResult, dX as ResolvedRelations, aM as ReverseGeocodingParams, dZ as RollupResult, e0 as RollupScheduler, d$ as RollupSchedulerOptions, d_ as RollupService, cM as SHORTCUT_TO_FILTER_OPERATOR, db as SchemaResolver, eC as SearchOptions, cG as ShortcutOperator, ec as SignedUrlOptions, ed as StorageAdapter, ea as StorageUploadInput, eb as StorageUploadResult, eg as SyncOptions, ef as SyncResult, df as TraversalOptions, dg as TraversalResult, ey as UpdateDBAttribute, eM as UpdateDBFlow, eu as UpdateDBObject, eI as UpdateDBView, dE as UpdateFlowInput, dK as UpdateObjectInput, e7 as UpdateViewInput, ee as UploadFileInput, ez as UpsertDBAttribute, ev as UpsertDBObject, eJ as UpsertDBView, e2 as UserProfileService, e1 as UserProfileServiceOptions, ds as UserProfilesRepository, e5 as UserService, e4 as UserValidationError, e3 as UserValidationResult, e8 as ViewService, eP as ViewSyncOptions, eO as ViewSyncResult, dv as ViewsRepository, dz as buildAuditChanges, cH as createDefaultState, dp as createMockAdapter, cN as createQueryBuilder, er as enrichValuesWithSelectLabels, cP as evaluateFormula, cQ as evaluateFormulaAttribute, cR as evaluateFormulaAttributeWithRelations, cS as evaluateFormulaWithRelations, cT as evaluateFormulaWithResult, eq as extractAttributeNames, cU as extractFormulaVariables, cV as extractRelationNames, cW as extractRelationReferences, cX as flattenRelationsForEval, cY as formatFormulaResult, cI as formatRecord, cJ as formatRecords, d0 as getPathDepth, d1 as getRelationPath, ej as getSyncPreview, d2 as getTargetAttributeName, eS as getViewSyncPreview, cZ as hasRelationReferences, ep as isLabelExpression, d5 as parsePath, d6 as pathHasManyCardinality, eo as renderLabelExpression, dc as resolveMultiplePaths, dd as resolveSingleValue, em as syncAll, eh as syncNativeObjects, eQ as syncNativeViews, de as traversePath, c_ as validateFormulaExpression, d7 as validatePath, ei as verifyNativeObjectsSync, eR as verifyNativeViewsSync } from './runtime-0gaIqXql.mjs';
1
+ export { dJ as AddAttributeInput, dh as AttributeChange, dr as AttributesRepository, dx as AuditRepository, dA as AuditService, bb as CompletionStatus, dI as CreateCustomObjectInput, ex as CreateDBAttribute, eL as CreateDBFlow, et as CreateDBObject, eH as CreateDBView, dD as CreateFlowInput, eA as CreateObjectRecord, e6 as CreateViewInput, ew as DBAttribute, eK as DBFlow, es as DBObject, eG as DBView, en as DEFAULT_LABEL_FALLBACK, cy as DatabaseAdapter, cz as FetchResult, e9 as FileContent, eF as FileListOptions, dC as FileService, dB as FileServiceOptions, dt as FilesRepository, dF as FlowService, dw as FlowsRepository, cA as FormattedRecord, c$ as FormulaResult, el as FullSyncOptions, ek as FullSyncResult, aO as GeocodingAdapter, aL as GeocodingAutocompleteParams, aN as GeocodingParams, dG as GeocodingService, aK as GeocodingSuggestion, dV as GetRelationOptionsParams, eD as GlobalSearchOptions, eE as GlobalSearchResultItem, dH as GlobalSearchService, cB as GroupedFetchResult, di as HookContext, dj as HookDefinition, dk as HookHandler, dn as HookRegistry, dl as HookType, cC as InsertOptions, d3 as InvalidPathError, eB as ListOptions, d4 as MaxDepthExceededError, aP as NoopGeocodingAdapter, dm as NoopHookRegistry, du as ObjectRecordsRepository, dM as ObjectSchemaService, dL as ObjectSchemaServiceOptions, dq as ObjectsRepository, eN as OperationResult, d8 as PathCardinality, d9 as PathSegment, da as PathSegmentType, dO as PermissionService, dN as PermissionServiceOptions, dy as PermissionsRepository, cO as QueryBuilder, cD as QueryBuilderState, cK as QueryMultipleResultsError, cL as QueryNoResultError, dQ as RecordService, dP as RecordServiceOptions, cE as RegistryMap, cF as RegistryObjectNames, dT as RelationOption, dU as RelationOptionsResponse, dY as RelationResolverService, dW as RelationService, dS as RelationValidationError, dR as RelationValidationResult, dX as ResolvedRelations, aM as ReverseGeocodingParams, dZ as RollupResult, e0 as RollupScheduler, d$ as RollupSchedulerOptions, d_ as RollupService, cM as SHORTCUT_TO_FILTER_OPERATOR, db as SchemaResolver, eC as SearchOptions, cG as ShortcutOperator, ec as SignedUrlOptions, ed as StorageAdapter, ea as StorageUploadInput, eb as StorageUploadResult, eg as SyncOptions, ef as SyncResult, df as TraversalOptions, dg as TraversalResult, ey as UpdateDBAttribute, eM as UpdateDBFlow, eu as UpdateDBObject, eI as UpdateDBView, dE as UpdateFlowInput, dK as UpdateObjectInput, e7 as UpdateViewInput, ee as UploadFileInput, ez as UpsertDBAttribute, ev as UpsertDBObject, eJ as UpsertDBView, e2 as UserProfileService, e1 as UserProfileServiceOptions, ds as UserProfilesRepository, e5 as UserService, e4 as UserValidationError, e3 as UserValidationResult, e8 as ViewService, eP as ViewSyncOptions, eO as ViewSyncResult, dv as ViewsRepository, dz as buildAuditChanges, cH as createDefaultState, dp as createMockAdapter, cN as createQueryBuilder, er as enrichValuesWithSelectLabels, cP as evaluateFormula, cQ as evaluateFormulaAttribute, cR as evaluateFormulaAttributeWithRelations, cS as evaluateFormulaWithRelations, cT as evaluateFormulaWithResult, eq as extractAttributeNames, cU as extractFormulaVariables, cV as extractRelationNames, cW as extractRelationReferences, cX as flattenRelationsForEval, cY as formatFormulaResult, cI as formatRecord, cJ as formatRecords, d0 as getPathDepth, d1 as getRelationPath, ej as getSyncPreview, d2 as getTargetAttributeName, eS as getViewSyncPreview, cZ as hasRelationReferences, ep as isLabelExpression, d5 as parsePath, d6 as pathHasManyCardinality, eo as renderLabelExpression, dc as resolveMultiplePaths, dd as resolveSingleValue, em as syncAll, eh as syncNativeObjects, eQ as syncNativeViews, de as traversePath, c_ as validateFormulaExpression, d7 as validatePath, ei as verifyNativeObjectsSync, eR as verifyNativeViewsSync } from './runtime-BZZRu7A1.mjs';
2
2
  import '@stndrds/constants';
3
3
  import 'zod';
package/dist/runtime.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { dJ as AddAttributeInput, dh as AttributeChange, dr as AttributesRepository, dx as AuditRepository, dA as AuditService, bb as CompletionStatus, dI as CreateCustomObjectInput, ex as CreateDBAttribute, eL as CreateDBFlow, et as CreateDBObject, eH as CreateDBView, dD as CreateFlowInput, eA as CreateObjectRecord, e6 as CreateViewInput, ew as DBAttribute, eK as DBFlow, es as DBObject, eG as DBView, en as DEFAULT_LABEL_FALLBACK, cy as DatabaseAdapter, cz as FetchResult, e9 as FileContent, eF as FileListOptions, dC as FileService, dB as FileServiceOptions, dt as FilesRepository, dF as FlowService, dw as FlowsRepository, cA as FormattedRecord, c$ as FormulaResult, el as FullSyncOptions, ek as FullSyncResult, aO as GeocodingAdapter, aL as GeocodingAutocompleteParams, aN as GeocodingParams, dG as GeocodingService, aK as GeocodingSuggestion, dV as GetRelationOptionsParams, eD as GlobalSearchOptions, eE as GlobalSearchResultItem, dH as GlobalSearchService, cB as GroupedFetchResult, di as HookContext, dj as HookDefinition, dk as HookHandler, dn as HookRegistry, dl as HookType, cC as InsertOptions, d3 as InvalidPathError, eB as ListOptions, d4 as MaxDepthExceededError, aP as NoopGeocodingAdapter, dm as NoopHookRegistry, du as ObjectRecordsRepository, dM as ObjectSchemaService, dL as ObjectSchemaServiceOptions, dq as ObjectsRepository, eN as OperationResult, d8 as PathCardinality, d9 as PathSegment, da as PathSegmentType, dO as PermissionService, dN as PermissionServiceOptions, dy as PermissionsRepository, cO as QueryBuilder, cD as QueryBuilderState, cK as QueryMultipleResultsError, cL as QueryNoResultError, dQ as RecordService, dP as RecordServiceOptions, cE as RegistryMap, cF as RegistryObjectNames, dT as RelationOption, dU as RelationOptionsResponse, dY as RelationResolverService, dW as RelationService, dS as RelationValidationError, dR as RelationValidationResult, dX as ResolvedRelations, aM as ReverseGeocodingParams, dZ as RollupResult, e0 as RollupScheduler, d$ as RollupSchedulerOptions, d_ as RollupService, cM as SHORTCUT_TO_FILTER_OPERATOR, db as SchemaResolver, eC as SearchOptions, cG as ShortcutOperator, ec as SignedUrlOptions, ed as StorageAdapter, ea as StorageUploadInput, eb as StorageUploadResult, eg as SyncOptions, ef as SyncResult, df as TraversalOptions, dg as TraversalResult, ey as UpdateDBAttribute, eM as UpdateDBFlow, eu as UpdateDBObject, eI as UpdateDBView, dE as UpdateFlowInput, dK as UpdateObjectInput, e7 as UpdateViewInput, ee as UploadFileInput, ez as UpsertDBAttribute, ev as UpsertDBObject, eJ as UpsertDBView, e2 as UserProfileService, e1 as UserProfileServiceOptions, ds as UserProfilesRepository, e5 as UserService, e4 as UserValidationError, e3 as UserValidationResult, e8 as ViewService, eP as ViewSyncOptions, eO as ViewSyncResult, dv as ViewsRepository, dz as buildAuditChanges, cH as createDefaultState, dp as createMockAdapter, cN as createQueryBuilder, er as enrichValuesWithSelectLabels, cP as evaluateFormula, cQ as evaluateFormulaAttribute, cR as evaluateFormulaAttributeWithRelations, cS as evaluateFormulaWithRelations, cT as evaluateFormulaWithResult, eq as extractAttributeNames, cU as extractFormulaVariables, cV as extractRelationNames, cW as extractRelationReferences, cX as flattenRelationsForEval, cY as formatFormulaResult, cI as formatRecord, cJ as formatRecords, d0 as getPathDepth, d1 as getRelationPath, ej as getSyncPreview, d2 as getTargetAttributeName, eS as getViewSyncPreview, cZ as hasRelationReferences, ep as isLabelExpression, d5 as parsePath, d6 as pathHasManyCardinality, eo as renderLabelExpression, dc as resolveMultiplePaths, dd as resolveSingleValue, em as syncAll, eh as syncNativeObjects, eQ as syncNativeViews, de as traversePath, c_ as validateFormulaExpression, d7 as validatePath, ei as verifyNativeObjectsSync, eR as verifyNativeViewsSync } from './runtime-0gaIqXql.js';
1
+ export { dJ as AddAttributeInput, dh as AttributeChange, dr as AttributesRepository, dx as AuditRepository, dA as AuditService, bb as CompletionStatus, dI as CreateCustomObjectInput, ex as CreateDBAttribute, eL as CreateDBFlow, et as CreateDBObject, eH as CreateDBView, dD as CreateFlowInput, eA as CreateObjectRecord, e6 as CreateViewInput, ew as DBAttribute, eK as DBFlow, es as DBObject, eG as DBView, en as DEFAULT_LABEL_FALLBACK, cy as DatabaseAdapter, cz as FetchResult, e9 as FileContent, eF as FileListOptions, dC as FileService, dB as FileServiceOptions, dt as FilesRepository, dF as FlowService, dw as FlowsRepository, cA as FormattedRecord, c$ as FormulaResult, el as FullSyncOptions, ek as FullSyncResult, aO as GeocodingAdapter, aL as GeocodingAutocompleteParams, aN as GeocodingParams, dG as GeocodingService, aK as GeocodingSuggestion, dV as GetRelationOptionsParams, eD as GlobalSearchOptions, eE as GlobalSearchResultItem, dH as GlobalSearchService, cB as GroupedFetchResult, di as HookContext, dj as HookDefinition, dk as HookHandler, dn as HookRegistry, dl as HookType, cC as InsertOptions, d3 as InvalidPathError, eB as ListOptions, d4 as MaxDepthExceededError, aP as NoopGeocodingAdapter, dm as NoopHookRegistry, du as ObjectRecordsRepository, dM as ObjectSchemaService, dL as ObjectSchemaServiceOptions, dq as ObjectsRepository, eN as OperationResult, d8 as PathCardinality, d9 as PathSegment, da as PathSegmentType, dO as PermissionService, dN as PermissionServiceOptions, dy as PermissionsRepository, cO as QueryBuilder, cD as QueryBuilderState, cK as QueryMultipleResultsError, cL as QueryNoResultError, dQ as RecordService, dP as RecordServiceOptions, cE as RegistryMap, cF as RegistryObjectNames, dT as RelationOption, dU as RelationOptionsResponse, dY as RelationResolverService, dW as RelationService, dS as RelationValidationError, dR as RelationValidationResult, dX as ResolvedRelations, aM as ReverseGeocodingParams, dZ as RollupResult, e0 as RollupScheduler, d$ as RollupSchedulerOptions, d_ as RollupService, cM as SHORTCUT_TO_FILTER_OPERATOR, db as SchemaResolver, eC as SearchOptions, cG as ShortcutOperator, ec as SignedUrlOptions, ed as StorageAdapter, ea as StorageUploadInput, eb as StorageUploadResult, eg as SyncOptions, ef as SyncResult, df as TraversalOptions, dg as TraversalResult, ey as UpdateDBAttribute, eM as UpdateDBFlow, eu as UpdateDBObject, eI as UpdateDBView, dE as UpdateFlowInput, dK as UpdateObjectInput, e7 as UpdateViewInput, ee as UploadFileInput, ez as UpsertDBAttribute, ev as UpsertDBObject, eJ as UpsertDBView, e2 as UserProfileService, e1 as UserProfileServiceOptions, ds as UserProfilesRepository, e5 as UserService, e4 as UserValidationError, e3 as UserValidationResult, e8 as ViewService, eP as ViewSyncOptions, eO as ViewSyncResult, dv as ViewsRepository, dz as buildAuditChanges, cH as createDefaultState, dp as createMockAdapter, cN as createQueryBuilder, er as enrichValuesWithSelectLabels, cP as evaluateFormula, cQ as evaluateFormulaAttribute, cR as evaluateFormulaAttributeWithRelations, cS as evaluateFormulaWithRelations, cT as evaluateFormulaWithResult, eq as extractAttributeNames, cU as extractFormulaVariables, cV as extractRelationNames, cW as extractRelationReferences, cX as flattenRelationsForEval, cY as formatFormulaResult, cI as formatRecord, cJ as formatRecords, d0 as getPathDepth, d1 as getRelationPath, ej as getSyncPreview, d2 as getTargetAttributeName, eS as getViewSyncPreview, cZ as hasRelationReferences, ep as isLabelExpression, d5 as parsePath, d6 as pathHasManyCardinality, eo as renderLabelExpression, dc as resolveMultiplePaths, dd as resolveSingleValue, em as syncAll, eh as syncNativeObjects, eQ as syncNativeViews, de as traversePath, c_ as validateFormulaExpression, d7 as validatePath, ei as verifyNativeObjectsSync, eR as verifyNativeViewsSync } from './runtime-BZZRu7A1.js';
2
2
  import '@stndrds/constants';
3
3
  import 'zod';
package/dist/runtime.js CHANGED
@@ -588,10 +588,10 @@ var QueryBuilder = class _QueryBuilder {
588
588
  * .eq('id', 'rec-123')
589
589
  * .update({ price: 899 });
590
590
  *
591
- * // Update with metadata (replaces existing metadata)
591
+ * // Update with metadata (merged with existing, set undefined to remove)
592
592
  * const withMeta = await schema.from('products')
593
593
  * .eq('id', 'rec-123')
594
- * .update({ price: 899 }, { metadata: { synced: true } });
594
+ * .update({ price: 899 }, { metadata: { synced: true, oldKey: undefined } });
595
595
  * ```
596
596
  */
597
597
  async update(data, options) {
@@ -5804,6 +5804,9 @@ var RollupService = class {
5804
5804
  * Extract and aggregate values from related records
5805
5805
  */
5806
5806
  aggregateValues(relatedRecords, rollupAttr) {
5807
+ if (rollupAttr.function === "count") {
5808
+ return { value: relatedRecords.length, recordCount: relatedRecords.length };
5809
+ }
5807
5810
  const values = relatedRecords.map((r) => r.values[rollupAttr.targetAttribute]).filter((v) => v !== void 0 && v !== null);
5808
5811
  const aggregated = this.aggregate(values, rollupAttr.function);
5809
5812
  const result = typeof aggregated === "number" && rollupAttr.decimals !== void 0 ? Number(aggregated.toFixed(rollupAttr.decimals)) : aggregated;
@@ -6421,7 +6424,12 @@ var RecordService = class {
6421
6424
  __label: label
6422
6425
  };
6423
6426
  if (options?.metadata !== void 0) {
6424
- updatePayload.__metadata = options.metadata;
6427
+ const existingMetadata = existing.metadata ?? {};
6428
+ const mergedMetadata = { ...existingMetadata, ...options.metadata };
6429
+ const cleanedMetadata = Object.fromEntries(
6430
+ Object.entries(mergedMetadata).filter(([, value]) => value !== void 0)
6431
+ );
6432
+ updatePayload.__metadata = cleanedMetadata;
6425
6433
  }
6426
6434
  const updated = await this.adapter.objectRecords.update(recordId, updatePayload);
6427
6435
  if (!options?.skipHooks) {
package/dist/runtime.mjs CHANGED
@@ -61,7 +61,7 @@ import {
61
61
  validatePath,
62
62
  verifyNativeObjectsSync,
63
63
  verifyNativeViewsSync
64
- } from "./chunk-F27AKBTL.mjs";
64
+ } from "./chunk-IKUIWNHZ.mjs";
65
65
  export {
66
66
  AuditService,
67
67
  DEFAULT_LABEL_FALLBACK,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stndrds/schema",
3
- "version": "0.1.0-alpha.21",
3
+ "version": "0.1.0-alpha.22",
4
4
  "description": "Standard schema definitions and utilities",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "expr-eval": "^2.0.2",
25
25
  "zod": "^4.2.1",
26
- "@stndrds/constants": "0.1.0-alpha.21"
26
+ "@stndrds/constants": "0.1.0-alpha.22"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@vitest/coverage-v8": "^2.1.9",