@baasix/types 1.0.8 → 1.0.10

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 CHANGED
@@ -404,6 +404,19 @@ interface IndexDefinition {
404
404
  nullsNotDistinct?: boolean;
405
405
  type?: "btree" | "hash" | "gin" | "gist";
406
406
  }
407
+ /**
408
+ * Partitioning options
409
+ */
410
+ interface PartitioningOptions {
411
+ /** Partitioning strategy: LIST by tenant, RANGE by time, or composite */
412
+ strategy: "tenant" | "time" | "tenant+time";
413
+ /** DateTime field used for RANGE partitioning (default "createdAt") */
414
+ timeField?: string;
415
+ /** Time partition width (default "year") */
416
+ interval?: "month" | "quarter" | "year";
417
+ /** Future periods to pre-create (default 1) */
418
+ premake?: number;
419
+ }
407
420
  /**
408
421
  * Schema definition
409
422
  */
@@ -419,6 +432,8 @@ interface SchemaDefinition {
419
432
  * - undefined: use default runtime behavior
420
433
  */
421
434
  tenantScoped?: boolean;
435
+ /** Partitioning configuration for this collection */
436
+ partitioning?: PartitioningOptions;
422
437
  /**
423
438
  * Track user who created/updated records (adds createdBy_Id, updatedBy_Id)
424
439
  */
@@ -1387,6 +1402,21 @@ type AnyRecord = Record<string, unknown>;
1387
1402
  interface Settings {
1388
1403
  [key: string]: unknown;
1389
1404
  }
1405
+ /**
1406
+ * Session type limits
1407
+ */
1408
+ interface SessionTypeLimits {
1409
+ /** -1 = unlimited, 0 = disabled, positive n = max concurrent sessions */
1410
+ web?: number;
1411
+ mobile?: number;
1412
+ }
1413
+ /**
1414
+ * Session limits by role and type
1415
+ */
1416
+ interface SessionLimits {
1417
+ default?: SessionTypeLimits;
1418
+ roles?: Record<string, SessionTypeLimits>;
1419
+ }
1390
1420
  /**
1391
1421
  * Tenant settings
1392
1422
  */
@@ -1416,6 +1446,7 @@ interface TenantSettings {
1416
1446
  email_icon?: any;
1417
1447
  metadata?: Record<string, any>;
1418
1448
  modules?: Record<string, any>;
1449
+ session_limits?: SessionLimits | null;
1419
1450
  [key: string]: any;
1420
1451
  }
1421
1452
  /**
@@ -2105,4 +2136,4 @@ interface ExpressPluginContext extends PluginRouteContext {
2105
2136
  getPluginService: (pluginName: string, serviceName: string) => any;
2106
2137
  }
2107
2138
 
2108
- export type { Accountability, Aggregate, AggregateConfig, AggregateFunction, AggregateMapping, AnyRecord, AssetQuery, AssetTransformOptions, AssociationDefinition, AssociationType, AuthMode, AuthProviderType, AuthResponse, AuthState, AuthStateEvent, AuthTokens, BaasixPlugin, BackgroundTask, BaseItem, BulkResponse, CacheConfig, CacheEntry, CacheSetOptions, CacheStrategy, CollectionItem, CreatePermissionData, DatePart, DateTruncPrecision, DeepPartial, DefaultValueType, DeleteResponse, ErrorResponse, ExportOptions, ExportResult, Express, ExpressApp, ExpressNextFunction, ExpressPluginContext, ExpressPluginMiddleware, ExpressPluginRoute, ExpressPluginRouteHandler, ExpressRequest, ExpressResponse, ExpressRouter, FieldDefinition, FieldInfo, FieldType, FieldValidation, FieldValidationRules, FieldValues, FileData, FileMetadata, Filter, FilterCondition, FilterObject, FilterOperator, FilterValue, FlattenedField, GeoJSONGeometry, GeoJSONLineString, GeoJSONPoint, GeoJSONPolygon, Hook, HookContext, HookEvent, HookFunction, HookHandler, HttpMethod, IAssetsService, ICacheAdapter, ICacheService, IFilesService, IHooksManager, IItemsService, IMailService, IMigrationService, INotificationService, IPermissionService, IRealtimeService, IReportService, ISettingsService, ISocketService, IStatsService, IStorageService, ITasksService, IWorkflowService, ImportOptions, ImportResult, IncludeConfig, IndexDefinition, InternalUploadedFile, JWTPayload, KeysOfType, LoadedPlugin, LogicalFilter, LoginCredentials, MagicLinkOptions, MailOptions, MutationResponse, NextFunction, Notification, NotificationOptions, NotificationType, OAuth2Config, OAuth2Tokens, OAuth2UserInfo, OperatorName, PaginatedResponse, PaginationMetadata, PaginationOptions, PasswordResetOptions, Permission, PermissionAction, PermissionData, PluginApp, PluginAuthProvider, PluginContext, PluginDefinition, PluginFactory, PluginHook, PluginHookContext, PluginHookEvent, PluginHookHandler, PluginManagerOptions, PluginMeta, PluginMiddleware, PluginNextFunction, PluginRequest, PluginResponse, PluginRoute, PluginRouteContext, PluginRouteHandler, PluginRouter, PluginSchedule, PluginSchemaDefinition, PluginService, PluginServiceFactory, PluginType, ProcessedImage, ProcessedInclude, QueryContext, QueryOptions, QueryParams, ReadResult, RegisterData, RelationshipDefinition, RelationshipType, ReportConfig, ReportQuery, ReportResult, Request, Response, Role, Router, SchemaDefinition, SchemaInfo, SchemaValidation, SeedData, SeedResult, SendNotificationData, SenderConfig, ServiceOptions, Session, Settings, SingleResponse, SoftDeletableItem, Sort, SortDirection, SortItem, SortObject, StartServerOptions, StatsQuery, StatsResult, StorageAdapter, StorageProvider, Tenant, TenantSettings, TimestampedItem, UploadOptions, UploadedFile, User, UserWithPassword, UserWithRolesAndPermissions, ValidationResult, WithOptional, WithRequired, Workflow, WorkflowEdge, WorkflowExecution, WorkflowExecutionLog, WorkflowExecutionStatus, WorkflowFlowData, WorkflowNode, WorkflowNodeData, WorkflowStatus, WorkflowTrigger, WorkflowTriggerType };
2139
+ export type { Accountability, Aggregate, AggregateConfig, AggregateFunction, AggregateMapping, AnyRecord, AssetQuery, AssetTransformOptions, AssociationDefinition, AssociationType, AuthMode, AuthProviderType, AuthResponse, AuthState, AuthStateEvent, AuthTokens, BaasixPlugin, BackgroundTask, BaseItem, BulkResponse, CacheConfig, CacheEntry, CacheSetOptions, CacheStrategy, CollectionItem, CreatePermissionData, DatePart, DateTruncPrecision, DeepPartial, DefaultValueType, DeleteResponse, ErrorResponse, ExportOptions, ExportResult, Express, ExpressApp, ExpressNextFunction, ExpressPluginContext, ExpressPluginMiddleware, ExpressPluginRoute, ExpressPluginRouteHandler, ExpressRequest, ExpressResponse, ExpressRouter, FieldDefinition, FieldInfo, FieldType, FieldValidation, FieldValidationRules, FieldValues, FileData, FileMetadata, Filter, FilterCondition, FilterObject, FilterOperator, FilterValue, FlattenedField, GeoJSONGeometry, GeoJSONLineString, GeoJSONPoint, GeoJSONPolygon, Hook, HookContext, HookEvent, HookFunction, HookHandler, HttpMethod, IAssetsService, ICacheAdapter, ICacheService, IFilesService, IHooksManager, IItemsService, IMailService, IMigrationService, INotificationService, IPermissionService, IRealtimeService, IReportService, ISettingsService, ISocketService, IStatsService, IStorageService, ITasksService, IWorkflowService, ImportOptions, ImportResult, IncludeConfig, IndexDefinition, InternalUploadedFile, JWTPayload, KeysOfType, LoadedPlugin, LogicalFilter, LoginCredentials, MagicLinkOptions, MailOptions, MutationResponse, NextFunction, Notification, NotificationOptions, NotificationType, OAuth2Config, OAuth2Tokens, OAuth2UserInfo, OperatorName, PaginatedResponse, PaginationMetadata, PaginationOptions, PasswordResetOptions, Permission, PermissionAction, PermissionData, PluginApp, PluginAuthProvider, PluginContext, PluginDefinition, PluginFactory, PluginHook, PluginHookContext, PluginHookEvent, PluginHookHandler, PluginManagerOptions, PluginMeta, PluginMiddleware, PluginNextFunction, PluginRequest, PluginResponse, PluginRoute, PluginRouteContext, PluginRouteHandler, PluginRouter, PluginSchedule, PluginSchemaDefinition, PluginService, PluginServiceFactory, PluginType, ProcessedImage, ProcessedInclude, QueryContext, QueryOptions, QueryParams, ReadResult, RegisterData, RelationshipDefinition, RelationshipType, ReportConfig, ReportQuery, ReportResult, Request, Response, Role, Router, SchemaDefinition, SchemaInfo, SchemaValidation, SeedData, SeedResult, SendNotificationData, SenderConfig, ServiceOptions, Session, SessionLimits, SessionTypeLimits, Settings, SingleResponse, SoftDeletableItem, Sort, SortDirection, SortItem, SortObject, StartServerOptions, StatsQuery, StatsResult, StorageAdapter, StorageProvider, Tenant, TenantSettings, TimestampedItem, UploadOptions, UploadedFile, User, UserWithPassword, UserWithRolesAndPermissions, ValidationResult, WithOptional, WithRequired, Workflow, WorkflowEdge, WorkflowExecution, WorkflowExecutionLog, WorkflowExecutionStatus, WorkflowFlowData, WorkflowNode, WorkflowNodeData, WorkflowStatus, WorkflowTrigger, WorkflowTriggerType };
package/dist/index.d.ts CHANGED
@@ -404,6 +404,19 @@ interface IndexDefinition {
404
404
  nullsNotDistinct?: boolean;
405
405
  type?: "btree" | "hash" | "gin" | "gist";
406
406
  }
407
+ /**
408
+ * Partitioning options
409
+ */
410
+ interface PartitioningOptions {
411
+ /** Partitioning strategy: LIST by tenant, RANGE by time, or composite */
412
+ strategy: "tenant" | "time" | "tenant+time";
413
+ /** DateTime field used for RANGE partitioning (default "createdAt") */
414
+ timeField?: string;
415
+ /** Time partition width (default "year") */
416
+ interval?: "month" | "quarter" | "year";
417
+ /** Future periods to pre-create (default 1) */
418
+ premake?: number;
419
+ }
407
420
  /**
408
421
  * Schema definition
409
422
  */
@@ -419,6 +432,8 @@ interface SchemaDefinition {
419
432
  * - undefined: use default runtime behavior
420
433
  */
421
434
  tenantScoped?: boolean;
435
+ /** Partitioning configuration for this collection */
436
+ partitioning?: PartitioningOptions;
422
437
  /**
423
438
  * Track user who created/updated records (adds createdBy_Id, updatedBy_Id)
424
439
  */
@@ -1387,6 +1402,21 @@ type AnyRecord = Record<string, unknown>;
1387
1402
  interface Settings {
1388
1403
  [key: string]: unknown;
1389
1404
  }
1405
+ /**
1406
+ * Session type limits
1407
+ */
1408
+ interface SessionTypeLimits {
1409
+ /** -1 = unlimited, 0 = disabled, positive n = max concurrent sessions */
1410
+ web?: number;
1411
+ mobile?: number;
1412
+ }
1413
+ /**
1414
+ * Session limits by role and type
1415
+ */
1416
+ interface SessionLimits {
1417
+ default?: SessionTypeLimits;
1418
+ roles?: Record<string, SessionTypeLimits>;
1419
+ }
1390
1420
  /**
1391
1421
  * Tenant settings
1392
1422
  */
@@ -1416,6 +1446,7 @@ interface TenantSettings {
1416
1446
  email_icon?: any;
1417
1447
  metadata?: Record<string, any>;
1418
1448
  modules?: Record<string, any>;
1449
+ session_limits?: SessionLimits | null;
1419
1450
  [key: string]: any;
1420
1451
  }
1421
1452
  /**
@@ -2105,4 +2136,4 @@ interface ExpressPluginContext extends PluginRouteContext {
2105
2136
  getPluginService: (pluginName: string, serviceName: string) => any;
2106
2137
  }
2107
2138
 
2108
- export type { Accountability, Aggregate, AggregateConfig, AggregateFunction, AggregateMapping, AnyRecord, AssetQuery, AssetTransformOptions, AssociationDefinition, AssociationType, AuthMode, AuthProviderType, AuthResponse, AuthState, AuthStateEvent, AuthTokens, BaasixPlugin, BackgroundTask, BaseItem, BulkResponse, CacheConfig, CacheEntry, CacheSetOptions, CacheStrategy, CollectionItem, CreatePermissionData, DatePart, DateTruncPrecision, DeepPartial, DefaultValueType, DeleteResponse, ErrorResponse, ExportOptions, ExportResult, Express, ExpressApp, ExpressNextFunction, ExpressPluginContext, ExpressPluginMiddleware, ExpressPluginRoute, ExpressPluginRouteHandler, ExpressRequest, ExpressResponse, ExpressRouter, FieldDefinition, FieldInfo, FieldType, FieldValidation, FieldValidationRules, FieldValues, FileData, FileMetadata, Filter, FilterCondition, FilterObject, FilterOperator, FilterValue, FlattenedField, GeoJSONGeometry, GeoJSONLineString, GeoJSONPoint, GeoJSONPolygon, Hook, HookContext, HookEvent, HookFunction, HookHandler, HttpMethod, IAssetsService, ICacheAdapter, ICacheService, IFilesService, IHooksManager, IItemsService, IMailService, IMigrationService, INotificationService, IPermissionService, IRealtimeService, IReportService, ISettingsService, ISocketService, IStatsService, IStorageService, ITasksService, IWorkflowService, ImportOptions, ImportResult, IncludeConfig, IndexDefinition, InternalUploadedFile, JWTPayload, KeysOfType, LoadedPlugin, LogicalFilter, LoginCredentials, MagicLinkOptions, MailOptions, MutationResponse, NextFunction, Notification, NotificationOptions, NotificationType, OAuth2Config, OAuth2Tokens, OAuth2UserInfo, OperatorName, PaginatedResponse, PaginationMetadata, PaginationOptions, PasswordResetOptions, Permission, PermissionAction, PermissionData, PluginApp, PluginAuthProvider, PluginContext, PluginDefinition, PluginFactory, PluginHook, PluginHookContext, PluginHookEvent, PluginHookHandler, PluginManagerOptions, PluginMeta, PluginMiddleware, PluginNextFunction, PluginRequest, PluginResponse, PluginRoute, PluginRouteContext, PluginRouteHandler, PluginRouter, PluginSchedule, PluginSchemaDefinition, PluginService, PluginServiceFactory, PluginType, ProcessedImage, ProcessedInclude, QueryContext, QueryOptions, QueryParams, ReadResult, RegisterData, RelationshipDefinition, RelationshipType, ReportConfig, ReportQuery, ReportResult, Request, Response, Role, Router, SchemaDefinition, SchemaInfo, SchemaValidation, SeedData, SeedResult, SendNotificationData, SenderConfig, ServiceOptions, Session, Settings, SingleResponse, SoftDeletableItem, Sort, SortDirection, SortItem, SortObject, StartServerOptions, StatsQuery, StatsResult, StorageAdapter, StorageProvider, Tenant, TenantSettings, TimestampedItem, UploadOptions, UploadedFile, User, UserWithPassword, UserWithRolesAndPermissions, ValidationResult, WithOptional, WithRequired, Workflow, WorkflowEdge, WorkflowExecution, WorkflowExecutionLog, WorkflowExecutionStatus, WorkflowFlowData, WorkflowNode, WorkflowNodeData, WorkflowStatus, WorkflowTrigger, WorkflowTriggerType };
2139
+ export type { Accountability, Aggregate, AggregateConfig, AggregateFunction, AggregateMapping, AnyRecord, AssetQuery, AssetTransformOptions, AssociationDefinition, AssociationType, AuthMode, AuthProviderType, AuthResponse, AuthState, AuthStateEvent, AuthTokens, BaasixPlugin, BackgroundTask, BaseItem, BulkResponse, CacheConfig, CacheEntry, CacheSetOptions, CacheStrategy, CollectionItem, CreatePermissionData, DatePart, DateTruncPrecision, DeepPartial, DefaultValueType, DeleteResponse, ErrorResponse, ExportOptions, ExportResult, Express, ExpressApp, ExpressNextFunction, ExpressPluginContext, ExpressPluginMiddleware, ExpressPluginRoute, ExpressPluginRouteHandler, ExpressRequest, ExpressResponse, ExpressRouter, FieldDefinition, FieldInfo, FieldType, FieldValidation, FieldValidationRules, FieldValues, FileData, FileMetadata, Filter, FilterCondition, FilterObject, FilterOperator, FilterValue, FlattenedField, GeoJSONGeometry, GeoJSONLineString, GeoJSONPoint, GeoJSONPolygon, Hook, HookContext, HookEvent, HookFunction, HookHandler, HttpMethod, IAssetsService, ICacheAdapter, ICacheService, IFilesService, IHooksManager, IItemsService, IMailService, IMigrationService, INotificationService, IPermissionService, IRealtimeService, IReportService, ISettingsService, ISocketService, IStatsService, IStorageService, ITasksService, IWorkflowService, ImportOptions, ImportResult, IncludeConfig, IndexDefinition, InternalUploadedFile, JWTPayload, KeysOfType, LoadedPlugin, LogicalFilter, LoginCredentials, MagicLinkOptions, MailOptions, MutationResponse, NextFunction, Notification, NotificationOptions, NotificationType, OAuth2Config, OAuth2Tokens, OAuth2UserInfo, OperatorName, PaginatedResponse, PaginationMetadata, PaginationOptions, PasswordResetOptions, Permission, PermissionAction, PermissionData, PluginApp, PluginAuthProvider, PluginContext, PluginDefinition, PluginFactory, PluginHook, PluginHookContext, PluginHookEvent, PluginHookHandler, PluginManagerOptions, PluginMeta, PluginMiddleware, PluginNextFunction, PluginRequest, PluginResponse, PluginRoute, PluginRouteContext, PluginRouteHandler, PluginRouter, PluginSchedule, PluginSchemaDefinition, PluginService, PluginServiceFactory, PluginType, ProcessedImage, ProcessedInclude, QueryContext, QueryOptions, QueryParams, ReadResult, RegisterData, RelationshipDefinition, RelationshipType, ReportConfig, ReportQuery, ReportResult, Request, Response, Role, Router, SchemaDefinition, SchemaInfo, SchemaValidation, SeedData, SeedResult, SendNotificationData, SenderConfig, ServiceOptions, Session, SessionLimits, SessionTypeLimits, Settings, SingleResponse, SoftDeletableItem, Sort, SortDirection, SortItem, SortObject, StartServerOptions, StatsQuery, StatsResult, StorageAdapter, StorageProvider, Tenant, TenantSettings, TimestampedItem, UploadOptions, UploadedFile, User, UserWithPassword, UserWithRolesAndPermissions, ValidationResult, WithOptional, WithRequired, Workflow, WorkflowEdge, WorkflowExecution, WorkflowExecutionLog, WorkflowExecutionStatus, WorkflowFlowData, WorkflowNode, WorkflowNodeData, WorkflowStatus, WorkflowTrigger, WorkflowTriggerType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baasix/types",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Shared TypeScript types for Baasix packages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/common.ts CHANGED
@@ -80,6 +80,23 @@ export interface Settings {
80
80
  [key: string]: unknown;
81
81
  }
82
82
 
83
+ /**
84
+ * Session type limits
85
+ */
86
+ export interface SessionTypeLimits {
87
+ /** -1 = unlimited, 0 = disabled, positive n = max concurrent sessions */
88
+ web?: number;
89
+ mobile?: number;
90
+ }
91
+
92
+ /**
93
+ * Session limits by role and type
94
+ */
95
+ export interface SessionLimits {
96
+ default?: SessionTypeLimits;
97
+ roles?: Record<string, SessionTypeLimits>;
98
+ }
99
+
83
100
  /**
84
101
  * Tenant settings
85
102
  */
@@ -109,6 +126,7 @@ export interface TenantSettings {
109
126
  email_icon?: any;
110
127
  metadata?: Record<string, any>;
111
128
  modules?: Record<string, any>;
129
+ session_limits?: SessionLimits | null;
112
130
  [key: string]: any;
113
131
  }
114
132