@baasix/baasix 0.1.4 → 0.1.5
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/app/404/index.html +1 -1
- package/dist/app/404.html +1 -1
- package/dist/app/activity-log/all-activity/index.html +1 -1
- package/dist/app/activity-log/all-activity/index.txt +1 -1
- package/dist/app/activity-log/email-log/index.html +1 -1
- package/dist/app/activity-log/email-log/index.txt +1 -1
- package/dist/app/activity-log/index.html +1 -1
- package/dist/app/activity-log/index.txt +1 -1
- package/dist/app/activity-log/notifications/index.html +1 -1
- package/dist/app/activity-log/notifications/index.txt +1 -1
- package/dist/app/activity-log/sessions/index.html +1 -1
- package/dist/app/activity-log/sessions/index.txt +1 -1
- package/dist/app/activity-log/workflow-executions/index.html +1 -1
- package/dist/app/activity-log/workflow-executions/index.txt +1 -1
- package/dist/app/activity-log/workflow-logs/index.html +1 -1
- package/dist/app/activity-log/workflow-logs/index.txt +1 -1
- package/dist/app/change-password/index.html +1 -1
- package/dist/app/change-password/index.txt +1 -1
- package/dist/app/dashboard/index.html +1 -1
- package/dist/app/dashboard/index.txt +1 -1
- package/dist/app/data-browser/index.html +1 -1
- package/dist/app/data-browser/index.txt +1 -1
- package/dist/app/file-manager/index.html +1 -1
- package/dist/app/file-manager/index.txt +1 -1
- package/dist/app/forgot-password/index.html +1 -1
- package/dist/app/forgot-password/index.txt +1 -1
- package/dist/app/index.html +1 -1
- package/dist/app/index.txt +1 -1
- package/dist/app/login/index.html +1 -1
- package/dist/app/login/index.txt +1 -1
- package/dist/app/register/index.html +1 -1
- package/dist/app/register/index.txt +1 -1
- package/dist/app/settings/migrations/index.html +1 -1
- package/dist/app/settings/migrations/index.txt +1 -1
- package/dist/app/settings/permissions/index.html +1 -1
- package/dist/app/settings/permissions/index.txt +1 -1
- package/dist/app/settings/project/index.html +1 -1
- package/dist/app/settings/project/index.txt +1 -1
- package/dist/app/settings/roles/index.html +1 -1
- package/dist/app/settings/roles/index.txt +1 -1
- package/dist/app/settings/schema/index.html +1 -1
- package/dist/app/settings/schema/index.txt +1 -1
- package/dist/app/settings/tasks/index.html +1 -1
- package/dist/app/settings/tasks/index.txt +1 -1
- package/dist/app/settings/templates/edit/index.html +1 -1
- package/dist/app/settings/templates/edit/index.txt +1 -1
- package/dist/app/settings/templates/index.html +1 -1
- package/dist/app/settings/templates/index.txt +1 -1
- package/dist/app/settings/tenants/index.html +1 -1
- package/dist/app/settings/tenants/index.txt +1 -1
- package/dist/app/users/index.html +1 -1
- package/dist/app/users/index.txt +1 -1
- package/dist/app/users/invites/index.html +1 -1
- package/dist/app/users/invites/index.txt +1 -1
- package/dist/app/users/list/index.html +1 -1
- package/dist/app/users/list/index.txt +1 -1
- package/dist/app/users/preferences/index.html +1 -1
- package/dist/app/users/preferences/index.txt +1 -1
- package/dist/app/users/user-roles/index.html +1 -1
- package/dist/app/users/user-roles/index.txt +1 -1
- package/dist/app/workflows/detail/index.html +1 -1
- package/dist/app/workflows/detail/index.txt +1 -1
- package/dist/app/workflows/edit/index.html +1 -1
- package/dist/app/workflows/edit/index.txt +1 -1
- package/dist/app/workflows/execution/index.html +1 -1
- package/dist/app/workflows/execution/index.txt +1 -1
- package/dist/app/workflows/index.html +1 -1
- package/dist/app/workflows/index.txt +1 -1
- package/dist/auth/routes.d.ts +1 -1
- package/dist/auth/routes.d.ts.map +1 -1
- package/dist/routes/auth.route.d.ts +1 -1
- package/dist/routes/auth.route.d.ts.map +1 -1
- package/dist/routes/file.route.d.ts +1 -1
- package/dist/routes/file.route.d.ts.map +1 -1
- package/dist/routes/items.route.d.ts +1 -1
- package/dist/routes/items.route.d.ts.map +1 -1
- package/dist/routes/mcp.route.d.ts +1 -1
- package/dist/routes/mcp.route.d.ts.map +1 -1
- package/dist/routes/migration.route.d.ts +1 -1
- package/dist/routes/migration.route.d.ts.map +1 -1
- package/dist/routes/notification.route.d.ts +1 -1
- package/dist/routes/notification.route.d.ts.map +1 -1
- package/dist/routes/openapi.route.d.ts +1 -1
- package/dist/routes/openapi.route.d.ts.map +1 -1
- package/dist/routes/permission.route.d.ts +1 -1
- package/dist/routes/permission.route.d.ts.map +1 -1
- package/dist/routes/realtime.route.d.ts +1 -1
- package/dist/routes/realtime.route.d.ts.map +1 -1
- package/dist/routes/reports.route.d.ts +1 -1
- package/dist/routes/reports.route.d.ts.map +1 -1
- package/dist/routes/schema.route.d.ts +1 -1
- package/dist/routes/schema.route.d.ts.map +1 -1
- package/dist/routes/settings.route.d.ts +1 -1
- package/dist/routes/settings.route.d.ts.map +1 -1
- package/dist/routes/templates.route.d.ts +1 -1
- package/dist/routes/templates.route.d.ts.map +1 -1
- package/dist/routes/utils.route.d.ts +1 -1
- package/dist/routes/utils.route.d.ts.map +1 -1
- package/dist/routes/workflow.route.d.ts +1 -1
- package/dist/routes/workflow.route.d.ts.map +1 -1
- package/dist/services/PluginManager.d.ts +3 -4
- package/dist/services/PluginManager.d.ts.map +1 -1
- package/dist/services/PluginManager.js.map +1 -1
- package/dist/services/TasksService.d.ts +2 -2
- package/dist/services/TasksService.d.ts.map +1 -1
- package/dist/types/drizzle.d.ts +22 -0
- package/dist/types/drizzle.d.ts.map +1 -0
- package/dist/types/drizzle.js +6 -0
- package/dist/types/drizzle.js.map +1 -0
- package/dist/types/external.d.ts +69 -0
- package/dist/types/external.d.ts.map +1 -0
- package/dist/types/external.js +6 -0
- package/dist/types/external.js.map +1 -0
- package/dist/types/files.d.ts +2 -2
- package/dist/types/index.d.ts +28 -23
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +22 -50
- package/dist/types/index.js.map +1 -1
- package/dist/types/internal.d.ts +57 -0
- package/dist/types/internal.d.ts.map +1 -0
- package/dist/types/internal.js +6 -0
- package/dist/types/internal.js.map +1 -0
- package/dist/types/plugin.d.ts +6 -344
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/plugin.js +2 -2
- package/dist/types/query.d.ts +5 -30
- package/dist/types/query.d.ts.map +1 -1
- package/dist/types/query.js +3 -1
- package/dist/types/query.js.map +1 -1
- package/dist/types/relations.d.ts +1 -1
- package/dist/types/relations.d.ts.map +1 -1
- package/dist/types/services.d.ts +13 -29
- package/dist/types/services.d.ts.map +1 -1
- package/dist/types/services.js +1 -0
- package/dist/types/services.js.map +1 -1
- package/dist/utils/db.d.ts +1 -1
- package/dist/utils/fieldUtils.d.ts +2 -2
- package/dist/utils/fieldUtils.d.ts.map +1 -1
- package/dist/utils/router.d.ts +1 -1
- package/dist/utils/router.d.ts.map +1 -1
- package/dist/utils/schemaManager.d.ts +27 -3
- package/dist/utils/schemaManager.d.ts.map +1 -1
- package/dist/utils/schemaManager.js +1 -0
- package/dist/utils/schemaManager.js.map +1 -1
- package/dist/utils/sortUtils.d.ts +1 -1
- package/dist/utils/sortUtils.d.ts.map +1 -1
- package/dist/utils/typeMapper.d.ts +2 -1
- package/dist/utils/typeMapper.d.ts.map +1 -1
- package/dist/utils/typeMapper.js.map +1 -1
- package/package.json +2 -1
- package/dist/types/aggregation.d.ts +0 -40
- package/dist/types/aggregation.d.ts.map +0 -1
- package/dist/types/aggregation.js +0 -6
- package/dist/types/aggregation.js.map +0 -1
- package/dist/types/assets.d.ts +0 -32
- package/dist/types/assets.d.ts.map +0 -1
- package/dist/types/assets.js +0 -6
- package/dist/types/assets.js.map +0 -1
- package/dist/types/auth.d.ts +0 -50
- package/dist/types/auth.d.ts.map +0 -1
- package/dist/types/auth.js +0 -6
- package/dist/types/auth.js.map +0 -1
- package/dist/types/cache.d.ts +0 -47
- package/dist/types/cache.d.ts.map +0 -1
- package/dist/types/cache.js +0 -6
- package/dist/types/cache.js.map +0 -1
- package/dist/types/database.d.ts +0 -16
- package/dist/types/database.d.ts.map +0 -1
- package/dist/types/database.js +0 -6
- package/dist/types/database.js.map +0 -1
- package/dist/types/fields.d.ts +0 -71
- package/dist/types/fields.d.ts.map +0 -1
- package/dist/types/fields.js +0 -6
- package/dist/types/fields.js.map +0 -1
- package/dist/types/import-export.d.ts +0 -62
- package/dist/types/import-export.d.ts.map +0 -1
- package/dist/types/import-export.js +0 -6
- package/dist/types/import-export.js.map +0 -1
- package/dist/types/mail.d.ts +0 -34
- package/dist/types/mail.d.ts.map +0 -1
- package/dist/types/mail.js +0 -6
- package/dist/types/mail.js.map +0 -1
- package/dist/types/notifications.d.ts +0 -16
- package/dist/types/notifications.d.ts.map +0 -1
- package/dist/types/notifications.js +0 -6
- package/dist/types/notifications.js.map +0 -1
- package/dist/types/reports.d.ts +0 -17
- package/dist/types/reports.d.ts.map +0 -1
- package/dist/types/reports.js +0 -6
- package/dist/types/reports.js.map +0 -1
- package/dist/types/schema.d.ts +0 -26
- package/dist/types/schema.d.ts.map +0 -1
- package/dist/types/schema.js +0 -6
- package/dist/types/schema.js.map +0 -1
- package/dist/types/seed.d.ts +0 -27
- package/dist/types/seed.d.ts.map +0 -1
- package/dist/types/seed.js +0 -6
- package/dist/types/seed.js.map +0 -1
- package/dist/types/settings.d.ts +0 -36
- package/dist/types/settings.d.ts.map +0 -1
- package/dist/types/settings.js +0 -6
- package/dist/types/settings.js.map +0 -1
- package/dist/types/sockets.d.ts +0 -26
- package/dist/types/sockets.d.ts.map +0 -1
- package/dist/types/sockets.js +0 -6
- package/dist/types/sockets.js.map +0 -1
- package/dist/types/sort.d.ts +0 -25
- package/dist/types/sort.d.ts.map +0 -1
- package/dist/types/sort.js +0 -6
- package/dist/types/sort.js.map +0 -1
- package/dist/types/spatial.d.ts +0 -19
- package/dist/types/spatial.d.ts.map +0 -1
- package/dist/types/spatial.js +0 -6
- package/dist/types/spatial.js.map +0 -1
- package/dist/types/stats.d.ts +0 -21
- package/dist/types/stats.d.ts.map +0 -1
- package/dist/types/stats.js +0 -6
- package/dist/types/stats.js.map +0 -1
- package/dist/types/storage.d.ts +0 -19
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js +0 -6
- package/dist/types/storage.js.map +0 -1
- package/dist/types/tasks.d.ts +0 -14
- package/dist/types/tasks.d.ts.map +0 -1
- package/dist/types/tasks.js +0 -6
- package/dist/types/tasks.js.map +0 -1
- package/dist/types/utils.d.ts +0 -54
- package/dist/types/utils.d.ts.map +0 -1
- package/dist/types/utils.js +0 -6
- package/dist/types/utils.js.map +0 -1
- package/dist/types/workflow.d.ts +0 -17
- package/dist/types/workflow.d.ts.map +0 -1
- package/dist/types/workflow.js +0 -6
- package/dist/types/workflow.js.map +0 -1
- /package/dist/app/_next/static/{ZFTLSdIpaRn3r1OwNmuIZ → FlPSV3QluMHtyypp36AiX}/_buildManifest.js +0 -0
- /package/dist/app/_next/static/{ZFTLSdIpaRn3r1OwNmuIZ → FlPSV3QluMHtyypp36AiX}/_ssgManifest.js +0 -0
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,351 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Baasix Plugin System Type Definitions
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file re-exports all plugin types from @baasix/types.
|
|
5
|
+
* Core package files should import types from here for consistency.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
import type { HooksManager } from "../services/HooksManager.js";
|
|
7
|
+
export type { Request, Response, NextFunction, Express, Router, ExpressRequest, ExpressResponse, ExpressNextFunction, ExpressApp, ExpressRouter, PluginRequest, PluginResponse, PluginNextFunction, PluginApp, PluginRouter, HttpMethod, ServiceOptions, IItemsService, IPermissionService, IMailService, IStorageService, ISettingsService, ISocketService, IRealtimeService, ITasksService, IWorkflowService, IMigrationService, IHooksManager, HookFunction, ICacheService, IFilesService, IAssetsService, INotificationService, IReportService, IStatsService, PluginType, PluginMeta, PluginSchemaDefinition, PluginRouteContext, PluginRouteHandler, PluginRoute, PluginHookEvent, PluginHookContext, PluginHookHandler, PluginHook, PluginContext, PluginServiceFactory, PluginService, AuthProviderType, OAuth2Config, PluginAuthProvider, PluginMiddleware, PluginSchedule, PluginDefinition, PluginFactory, BaasixPlugin, LoadedPlugin, PluginManagerOptions, StartServerOptions, ExpressPluginRouteHandler, ExpressPluginRoute, ExpressPluginMiddleware, ExpressPluginContext, } from "@baasix/types";
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* Start server options with plugin support (legacy alias)
|
|
10
|
+
* @deprecated Use StartServerOptions from @baasix/types instead
|
|
11
11
|
*/
|
|
12
|
-
export type
|
|
13
|
-
/**
|
|
14
|
-
* Plugin metadata - information about the plugin
|
|
15
|
-
*/
|
|
16
|
-
export interface PluginMeta {
|
|
17
|
-
/** Unique plugin name (used as identifier) */
|
|
18
|
-
name: string;
|
|
19
|
-
/** Plugin version (semver) */
|
|
20
|
-
version: string;
|
|
21
|
-
/** Plugin type/category */
|
|
22
|
-
type: PluginType;
|
|
23
|
-
/** Human-readable description */
|
|
24
|
-
description?: string;
|
|
25
|
-
/** Plugin author */
|
|
26
|
-
author?: string;
|
|
27
|
-
/** Plugin dependencies (names of other plugins that must be loaded first) */
|
|
28
|
-
dependencies?: string[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Schema definition for plugin collections
|
|
32
|
-
* Matches the existing Baasix schema format
|
|
33
|
-
*/
|
|
34
|
-
export interface PluginSchemaDefinition {
|
|
35
|
-
collectionName: string;
|
|
36
|
-
schema: {
|
|
37
|
-
name: string;
|
|
38
|
-
timestamps?: boolean;
|
|
39
|
-
paranoid?: boolean;
|
|
40
|
-
usertrack?: boolean;
|
|
41
|
-
fields: Record<string, any>;
|
|
42
|
-
indexes?: Array<{
|
|
43
|
-
fields: string[];
|
|
44
|
-
unique?: boolean;
|
|
45
|
-
name?: string;
|
|
46
|
-
}>;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* HTTP methods for plugin routes
|
|
51
|
-
*/
|
|
52
|
-
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
53
|
-
/**
|
|
54
|
-
* Plugin route handler context
|
|
55
|
-
*/
|
|
56
|
-
export interface PluginRouteContext {
|
|
57
|
-
/** Database connection */
|
|
58
|
-
db: any;
|
|
59
|
-
/** ItemsService class for CRUD operations */
|
|
60
|
-
ItemsService: any;
|
|
61
|
-
/** Registered plugin services */
|
|
62
|
-
services: Record<string, any>;
|
|
63
|
-
/** Permission service (singleton) - role-based access control */
|
|
64
|
-
permissionService?: any;
|
|
65
|
-
/** Mail service (singleton) - email sending via SMTP */
|
|
66
|
-
mailService?: any;
|
|
67
|
-
/** Storage service (singleton) - file storage (LOCAL/S3) */
|
|
68
|
-
storageService?: any;
|
|
69
|
-
/** Settings service (singleton) - application settings management */
|
|
70
|
-
settingsService?: any;
|
|
71
|
-
/** Socket service (singleton) - WebSocket/Socket.IO management */
|
|
72
|
-
socketService?: any;
|
|
73
|
-
/** Realtime service (singleton) - PostgreSQL WAL-based change data capture */
|
|
74
|
-
realtimeService?: any;
|
|
75
|
-
/** Tasks service (singleton) - scheduled task execution */
|
|
76
|
-
tasksService?: any;
|
|
77
|
-
/** Workflow service (singleton) - workflow engine */
|
|
78
|
-
workflowService?: any;
|
|
79
|
-
/** Migration service (singleton) - database migrations */
|
|
80
|
-
migrationService?: any;
|
|
81
|
-
/** Cache service - get cache instance for caching operations */
|
|
82
|
-
getCacheService?: () => any;
|
|
83
|
-
/** FilesService class - file upload/download operations */
|
|
84
|
-
FilesService?: any;
|
|
85
|
-
/** AssetsService class - image/asset processing with transformations */
|
|
86
|
-
AssetsService?: any;
|
|
87
|
-
/** NotificationService class - in-app notifications */
|
|
88
|
-
NotificationService?: any;
|
|
89
|
-
/** ReportService class - report generation with aggregation */
|
|
90
|
-
ReportService?: any;
|
|
91
|
-
/** StatsService class - statistics generation from multiple collections */
|
|
92
|
-
StatsService?: any;
|
|
93
|
-
/** Plugin configuration */
|
|
94
|
-
config: Record<string, any>;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Plugin route handler function
|
|
98
|
-
*/
|
|
99
|
-
export type PluginRouteHandler = (req: Request, res: Response, context: PluginRouteContext) => Promise<any> | any;
|
|
100
|
-
/**
|
|
101
|
-
* Plugin route definition
|
|
102
|
-
*/
|
|
103
|
-
export interface PluginRoute {
|
|
104
|
-
/** Route path (e.g., '/payments/stripe/checkout') */
|
|
105
|
-
path: string;
|
|
106
|
-
/** HTTP method */
|
|
107
|
-
method: HttpMethod;
|
|
108
|
-
/** Route handler */
|
|
109
|
-
handler: PluginRouteHandler;
|
|
110
|
-
/** Whether authentication is required */
|
|
111
|
-
requireAuth?: boolean;
|
|
112
|
-
/** Whether to parse raw body (for webhooks) */
|
|
113
|
-
rawBody?: boolean;
|
|
114
|
-
/** Custom middleware for this route */
|
|
115
|
-
middleware?: Array<(req: Request, res: Response, next: NextFunction) => void>;
|
|
116
|
-
/** Route description for documentation */
|
|
117
|
-
description?: string;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Plugin hook event types
|
|
121
|
-
*/
|
|
122
|
-
export type PluginHookEvent = "items.create" | "items.read" | "items.update" | "items.delete" | "items.create.after" | "items.read.after" | "items.update.after" | "items.delete.after";
|
|
123
|
-
/**
|
|
124
|
-
* Plugin hook context
|
|
125
|
-
*/
|
|
126
|
-
export interface PluginHookContext {
|
|
127
|
-
collection: string;
|
|
128
|
-
accountability: any;
|
|
129
|
-
db: any;
|
|
130
|
-
data?: any;
|
|
131
|
-
id?: string;
|
|
132
|
-
query?: any;
|
|
133
|
-
schema?: any;
|
|
134
|
-
[key: string]: any;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Plugin hook handler function
|
|
138
|
-
*/
|
|
139
|
-
export type PluginHookHandler = (context: PluginHookContext) => Promise<PluginHookContext> | PluginHookContext;
|
|
140
|
-
/**
|
|
141
|
-
* Plugin hook definition
|
|
142
|
-
*/
|
|
143
|
-
export interface PluginHook {
|
|
144
|
-
/** Collection name (use '*' for all collections) */
|
|
145
|
-
collection: string;
|
|
146
|
-
/** Hook event */
|
|
147
|
-
event: PluginHookEvent;
|
|
148
|
-
/** Hook handler */
|
|
149
|
-
handler: PluginHookHandler;
|
|
150
|
-
/** Hook priority (lower runs first) */
|
|
151
|
-
priority?: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Plugin service factory function
|
|
155
|
-
*/
|
|
156
|
-
export type PluginServiceFactory = (context: PluginContext) => any;
|
|
157
|
-
/**
|
|
158
|
-
* Plugin service definition
|
|
159
|
-
*/
|
|
160
|
-
export interface PluginService {
|
|
161
|
-
/** Service name (used to access via context.services.name) */
|
|
162
|
-
name: string;
|
|
163
|
-
/** Service factory function */
|
|
164
|
-
factory: PluginServiceFactory;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Plugin auth provider type
|
|
168
|
-
*/
|
|
169
|
-
export type AuthProviderType = "oauth2" | "otp" | "passkey" | "custom";
|
|
170
|
-
/**
|
|
171
|
-
* Plugin auth provider definition
|
|
172
|
-
*/
|
|
173
|
-
export interface PluginAuthProvider {
|
|
174
|
-
/** Provider identifier (e.g., 'github', 'otp') */
|
|
175
|
-
id: string;
|
|
176
|
-
/** Display name */
|
|
177
|
-
name: string;
|
|
178
|
-
/** Provider type */
|
|
179
|
-
type: AuthProviderType;
|
|
180
|
-
/** OAuth2 configuration (for oauth2 type) */
|
|
181
|
-
oauth2Config?: {
|
|
182
|
-
authorizationUrl: string;
|
|
183
|
-
tokenUrl: string;
|
|
184
|
-
userInfoUrl: string;
|
|
185
|
-
clientId: string;
|
|
186
|
-
clientSecret: string;
|
|
187
|
-
scope?: string[];
|
|
188
|
-
};
|
|
189
|
-
/** Custom authentication handler */
|
|
190
|
-
authenticate?: (credentials: Record<string, any>, context: PluginContext) => Promise<{
|
|
191
|
-
user: any;
|
|
192
|
-
account?: any;
|
|
193
|
-
} | null>;
|
|
194
|
-
/** Custom routes for this provider */
|
|
195
|
-
routes?: PluginRoute[];
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Plugin middleware definition
|
|
199
|
-
*/
|
|
200
|
-
export interface PluginMiddleware {
|
|
201
|
-
/** Middleware name (for debugging) */
|
|
202
|
-
name: string;
|
|
203
|
-
/** Path pattern (optional, defaults to all routes) */
|
|
204
|
-
path?: string;
|
|
205
|
-
/** Middleware handler */
|
|
206
|
-
handler: (req: Request, res: Response, next: NextFunction) => void;
|
|
207
|
-
/** Priority (lower runs first) */
|
|
208
|
-
priority?: number;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Plugin schedule definition
|
|
212
|
-
*/
|
|
213
|
-
export interface PluginSchedule {
|
|
214
|
-
/** Schedule name */
|
|
215
|
-
name: string;
|
|
216
|
-
/** Cron expression */
|
|
217
|
-
cron: string;
|
|
218
|
-
/** Schedule handler */
|
|
219
|
-
handler: (context: PluginContext) => Promise<void> | void;
|
|
220
|
-
/** Whether to run immediately on startup */
|
|
221
|
-
runOnStart?: boolean;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Plugin context - passed to lifecycle hooks and service factories
|
|
225
|
-
*/
|
|
226
|
-
export interface PluginContext {
|
|
227
|
-
/** Database connection (Drizzle ORM instance) */
|
|
228
|
-
db: any;
|
|
229
|
-
/** ItemsService class for CRUD operations on collections */
|
|
230
|
-
ItemsService: any;
|
|
231
|
-
/** Registered plugin services (your plugin's services and other plugins) */
|
|
232
|
-
services: Record<string, any>;
|
|
233
|
-
/** Permission service (singleton) - role-based access control, field-level security */
|
|
234
|
-
permissionService?: any;
|
|
235
|
-
/** Mail service (singleton) - email sending via SMTP with Liquid templates */
|
|
236
|
-
mailService?: any;
|
|
237
|
-
/** Storage service (singleton) - file storage abstraction (LOCAL/S3 drivers) */
|
|
238
|
-
storageService?: any;
|
|
239
|
-
/** Settings service (singleton) - global and tenant-specific application settings */
|
|
240
|
-
settingsService?: any;
|
|
241
|
-
/** Socket service (singleton) - WebSocket/Socket.IO management, rooms, custom handlers */
|
|
242
|
-
socketService?: any;
|
|
243
|
-
/** Realtime service (singleton) - PostgreSQL WAL-based realtime change data capture */
|
|
244
|
-
realtimeService?: any;
|
|
245
|
-
/** Tasks service (singleton) - scheduled task execution with Redis distributed locking */
|
|
246
|
-
tasksService?: any;
|
|
247
|
-
/** Workflow service (singleton) - comprehensive workflow engine with multiple node types */
|
|
248
|
-
workflowService?: any;
|
|
249
|
-
/** Migration service (singleton) - database migration execution and tracking */
|
|
250
|
-
migrationService?: any;
|
|
251
|
-
/** Hooks manager (singleton) - lifecycle hooks for collections */
|
|
252
|
-
hooksManager?: HooksManager;
|
|
253
|
-
/** Get cache service instance for caching operations */
|
|
254
|
-
getCacheService?: () => any;
|
|
255
|
-
/** Invalidate cache for a collection */
|
|
256
|
-
invalidateCache?: (collection?: string) => Promise<void>;
|
|
257
|
-
/** FilesService class - file upload/download with metadata extraction */
|
|
258
|
-
FilesService?: any;
|
|
259
|
-
/** AssetsService class - image processing with transformation (resize, crop, format) */
|
|
260
|
-
AssetsService?: any;
|
|
261
|
-
/** NotificationService class - in-app notifications to multiple users */
|
|
262
|
-
NotificationService?: any;
|
|
263
|
-
/** ReportService class - report generation with grouping and aggregation */
|
|
264
|
-
ReportService?: any;
|
|
265
|
-
/** StatsService class - statistics generation from multiple collections */
|
|
266
|
-
StatsService?: any;
|
|
267
|
-
/** Express app instance */
|
|
268
|
-
app?: Express;
|
|
269
|
-
/** Plugin's own configuration (passed when registering the plugin) */
|
|
270
|
-
config: Record<string, any>;
|
|
271
|
-
/** Get another plugin's service for cross-plugin communication */
|
|
272
|
-
getPluginService: (pluginName: string, serviceName: string) => any;
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Plugin definition - what a plugin provides
|
|
276
|
-
*/
|
|
277
|
-
export interface PluginDefinition {
|
|
278
|
-
/** Plugin metadata */
|
|
279
|
-
meta: PluginMeta;
|
|
280
|
-
/** Schema extensions - new collections/tables */
|
|
281
|
-
schemas?: PluginSchemaDefinition[];
|
|
282
|
-
/** Route extensions - new API endpoints */
|
|
283
|
-
routes?: PluginRoute[];
|
|
284
|
-
/** Hook extensions - lifecycle hooks */
|
|
285
|
-
hooks?: PluginHook[];
|
|
286
|
-
/** Service extensions - new services */
|
|
287
|
-
services?: PluginService[];
|
|
288
|
-
/** Auth provider extensions */
|
|
289
|
-
authProviders?: PluginAuthProvider[];
|
|
290
|
-
/** Middleware extensions */
|
|
291
|
-
middleware?: PluginMiddleware[];
|
|
292
|
-
/** Scheduled tasks */
|
|
293
|
-
schedules?: PluginSchedule[];
|
|
294
|
-
/**
|
|
295
|
-
* Called when the plugin is initialized (before routes are registered)
|
|
296
|
-
* Use this for setup that doesn't depend on other plugins
|
|
297
|
-
*/
|
|
298
|
-
onInit?: (context: PluginContext) => Promise<void>;
|
|
299
|
-
/**
|
|
300
|
-
* Called when all plugins are loaded and server is ready
|
|
301
|
-
* Use this for setup that may depend on other plugins
|
|
302
|
-
*/
|
|
303
|
-
onReady?: (context: PluginContext) => Promise<void>;
|
|
304
|
-
/**
|
|
305
|
-
* Called when the server is shutting down
|
|
306
|
-
* Use this for cleanup
|
|
307
|
-
*/
|
|
308
|
-
onShutdown?: (context: PluginContext) => Promise<void>;
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Plugin factory function - creates a plugin with configuration
|
|
312
|
-
*/
|
|
313
|
-
export type PluginFactory<TConfig = Record<string, any>> = (config: TConfig) => PluginDefinition;
|
|
314
|
-
/**
|
|
315
|
-
* Baasix plugin - either a definition or a factory result
|
|
316
|
-
*/
|
|
317
|
-
export type BaasixPlugin = PluginDefinition;
|
|
318
|
-
/**
|
|
319
|
-
* Loaded plugin - plugin with runtime state
|
|
320
|
-
*/
|
|
321
|
-
export interface LoadedPlugin {
|
|
322
|
-
/** Plugin definition */
|
|
323
|
-
definition: PluginDefinition;
|
|
324
|
-
/** Plugin configuration */
|
|
325
|
-
config: Record<string, any>;
|
|
326
|
-
/** Plugin services (instantiated) */
|
|
327
|
-
services: Record<string, any>;
|
|
328
|
-
/** Whether the plugin has been initialized */
|
|
329
|
-
initialized: boolean;
|
|
330
|
-
/** Whether the plugin is ready */
|
|
331
|
-
ready: boolean;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Plugin manager options
|
|
335
|
-
*/
|
|
336
|
-
export interface PluginManagerOptions {
|
|
337
|
-
/** Whether to log plugin loading */
|
|
338
|
-
verbose?: boolean;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Start server options with plugin support
|
|
342
|
-
*/
|
|
343
|
-
export interface StartServerOptionsWithPlugins {
|
|
344
|
-
/** Server port */
|
|
345
|
-
port?: number;
|
|
346
|
-
/** Plugins to load */
|
|
347
|
-
plugins?: BaasixPlugin[];
|
|
348
|
-
/** Plugin manager options */
|
|
349
|
-
pluginOptions?: PluginManagerOptions;
|
|
350
|
-
}
|
|
12
|
+
export type StartServerOptionsWithPlugins = import("@baasix/types").StartServerOptions;
|
|
351
13
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../baasix/types/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../baasix/types/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAEV,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,MAAM,EAEN,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,aAAa,EAEb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,YAAY,EAEZ,UAAU,EAEV,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,aAAa,EAEb,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAElB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,eAAe,EAAE,kBAAkB,CAAC"}
|
package/dist/types/plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Baasix Plugin System Type Definitions
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file re-exports all plugin types from @baasix/types.
|
|
5
|
+
* Core package files should import types from here for consistency.
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=plugin.js.map
|
package/dist/types/query.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Query, Filter, and Pagination Types
|
|
3
|
-
*
|
|
3
|
+
* Core-specific query-building type definitions
|
|
4
|
+
* Note: PaginationOptions, PaginationMetadata, FilterOperator, OperatorName are exported from index.ts via @baasix/types
|
|
4
5
|
*/
|
|
5
6
|
import type { PgTable, PgColumn } from 'drizzle-orm/pg-core';
|
|
6
7
|
import type { JoinDefinition } from './relations.js';
|
|
7
8
|
/**
|
|
8
|
-
* Filter object structure (Sequelize-style)
|
|
9
|
+
* Filter object structure (Sequelize-style) - core-specific with Drizzle support
|
|
9
10
|
*/
|
|
10
11
|
export interface FilterObject {
|
|
11
12
|
[key: string]: any;
|
|
@@ -14,7 +15,7 @@ export interface FilterObject {
|
|
|
14
15
|
cast?: string;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
* Query context for building where conditions
|
|
18
|
+
* Query context for building where conditions (core-specific with Drizzle types)
|
|
18
19
|
*/
|
|
19
20
|
export interface QueryContext {
|
|
20
21
|
table?: PgTable;
|
|
@@ -34,7 +35,7 @@ export type ColumnReference = string;
|
|
|
34
35
|
*/
|
|
35
36
|
export type FilterValue = string | number | boolean | null | Date | any[] | Record<string, any> | ColumnReference;
|
|
36
37
|
/**
|
|
37
|
-
* Interface for operator context
|
|
38
|
+
* Interface for operator context (core-specific with Drizzle types)
|
|
38
39
|
*/
|
|
39
40
|
export interface OperatorContext {
|
|
40
41
|
column: PgColumn;
|
|
@@ -42,30 +43,4 @@ export interface OperatorContext {
|
|
|
42
43
|
fieldName: string;
|
|
43
44
|
tableName?: string;
|
|
44
45
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Operator name type (keys of OPERATOR_MAP)
|
|
47
|
-
* Note: This should match the keys of OPERATOR_MAP in filterOperators.ts
|
|
48
|
-
* Full type definition is generated there.
|
|
49
|
-
*/
|
|
50
|
-
export type OperatorName = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'notLike' | 'iLike' | 'notILike' | 'startsWith' | 'startsWiths' | 'endsWith' | 'endsWiths' | 'nstartsWith' | 'nstartsWiths' | 'nendsWith' | 'nendsWiths' | 'in' | 'notIn' | 'not' | 'is' | 'between' | 'notBetween' | 'isNull' | 'isNotNull' | 'arraycontains' | 'arraycontained' | 'jsonbContains' | 'jsonbContainedBy' | 'jsonbHasKey' | 'jsonbHasAnyKeys' | 'jsonbHasAllKeys' | 'jsonbPathExists' | 'jsonbPathMatch' | 'jsonbNotContains' | 'jsonbKeyEquals' | 'jsonbKeyNotEquals' | 'jsonbKeyGt' | 'jsonbKeyGte' | 'jsonbKeyLt' | 'jsonbKeyLte' | 'jsonbKeyIn' | 'jsonbKeyNotIn' | 'jsonbKeyLike' | 'jsonbKeyIsNull' | 'jsonbKeyIsNotNull' | 'jsonbArrayLength' | 'jsonbTypeOf' | 'jsonbDeepValue' | 'within' | 'containsGEO' | 'intersects' | 'nIntersects' | 'dwithin';
|
|
51
|
-
/**
|
|
52
|
-
* Pagination options
|
|
53
|
-
*/
|
|
54
|
-
export interface PaginationOptions {
|
|
55
|
-
limit?: number;
|
|
56
|
-
offset?: number;
|
|
57
|
-
page?: number;
|
|
58
|
-
pageSize?: number;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Pagination metadata
|
|
62
|
-
*/
|
|
63
|
-
export interface PaginationMetadata {
|
|
64
|
-
total: number;
|
|
65
|
-
page: number;
|
|
66
|
-
pageSize: number;
|
|
67
|
-
pageCount: number;
|
|
68
|
-
hasNextPage: boolean;
|
|
69
|
-
hasPreviousPage: boolean;
|
|
70
|
-
}
|
|
71
46
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../baasix/types/query.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../baasix/types/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC;IACrB,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,CAAC;AAElH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/types/query.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Query, Filter, and Pagination Types
|
|
3
|
-
*
|
|
3
|
+
* Core-specific query-building type definitions
|
|
4
|
+
* Note: PaginationOptions, PaginationMetadata, FilterOperator, OperatorName are exported from index.ts via @baasix/types
|
|
4
5
|
*/
|
|
5
6
|
export {};
|
|
7
|
+
// OperatorName is now imported from @baasix/types (see re-export at top of file)
|
|
6
8
|
//# sourceMappingURL=query.js.map
|
package/dist/types/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../baasix/types/query.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../baasix/types/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAkDH,iFAAiF"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { SQL } from 'drizzle-orm';
|
|
6
6
|
import type { PgTable, PgColumn } from 'drizzle-orm/pg-core';
|
|
7
|
+
import type { SortObject } from '@baasix/types';
|
|
7
8
|
import type { FilterObject } from './query.js';
|
|
8
|
-
import type { SortObject } from './sort.js';
|
|
9
9
|
/**
|
|
10
10
|
* Association types matching Sequelize conventions
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../baasix/types/relations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../baasix/types/relations.ts"],"names":[],"mappings":"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"}
|
package/dist/types/services.d.ts
CHANGED
|
@@ -2,29 +2,26 @@
|
|
|
2
2
|
* Service Types
|
|
3
3
|
* Centralized service-related type definitions
|
|
4
4
|
*/
|
|
5
|
+
import type { QueryParams, AggregateMapping, Accountability, PluginHookContext } from '@baasix/types';
|
|
5
6
|
import type { FilterObject } from './query.js';
|
|
6
|
-
import type { AggregateMapping } from './aggregation.js';
|
|
7
7
|
import type { IncludeConfig } from './relations.js';
|
|
8
|
-
import type {
|
|
9
|
-
|
|
8
|
+
import type { Transaction } from './internal.js';
|
|
9
|
+
export type { ReadResult } from '@baasix/types';
|
|
10
10
|
/**
|
|
11
|
-
* Query options for read operations
|
|
11
|
+
* Query options for read operations (extends shared QueryParams)
|
|
12
|
+
* Core-specific with FilterObject and IncludeConfig support
|
|
12
13
|
*/
|
|
13
|
-
export interface QueryOptions {
|
|
14
|
-
|
|
14
|
+
export interface QueryOptions extends Omit<QueryParams, 'filter' | 'relConditions' | 'sort' | 'aggregate'> {
|
|
15
|
+
/** Filter conditions using core's FilterObject format */
|
|
15
16
|
filter?: FilterObject;
|
|
17
|
+
/** Sorting configuration - core uses simpler format */
|
|
16
18
|
sort?: string[] | Record<string, 'asc' | 'desc'>;
|
|
17
|
-
|
|
18
|
-
page?: number;
|
|
19
|
-
offset?: number;
|
|
19
|
+
/** Aggregate configuration using core's AggregateMapping */
|
|
20
20
|
aggregate?: AggregateMapping;
|
|
21
|
-
|
|
22
|
-
search?: string;
|
|
23
|
-
searchFields?: string[];
|
|
24
|
-
sortByRelevance?: boolean;
|
|
21
|
+
/** Relations to include/load */
|
|
25
22
|
include?: IncludeConfig[];
|
|
23
|
+
/** Filter conditions for related items using core's FilterObject */
|
|
26
24
|
relConditions?: Record<string, FilterObject>;
|
|
27
|
-
paranoid?: boolean;
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* Service options passed during construction
|
|
@@ -41,13 +38,6 @@ export interface OperationOptions {
|
|
|
41
38
|
transaction?: Transaction;
|
|
42
39
|
force?: boolean;
|
|
43
40
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Result for read operations
|
|
46
|
-
*/
|
|
47
|
-
export interface ReadResult {
|
|
48
|
-
data: any[];
|
|
49
|
-
totalCount: number;
|
|
50
|
-
}
|
|
51
41
|
/**
|
|
52
42
|
* Permission filter interface
|
|
53
43
|
*/
|
|
@@ -56,13 +46,7 @@ export interface PermissionFilter {
|
|
|
56
46
|
relConditions?: Record<string, any>;
|
|
57
47
|
}
|
|
58
48
|
/**
|
|
59
|
-
* Hook context interface
|
|
60
|
-
*/
|
|
61
|
-
export interface HookContext {
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Hook function type
|
|
49
|
+
* Hook context interface - alias for PluginHookContext from @baasix/types
|
|
66
50
|
*/
|
|
67
|
-
export type
|
|
51
|
+
export type HookContext = PluginHookContext;
|
|
68
52
|
//# sourceMappingURL=services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../baasix/types/services.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../baasix/types/services.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,WAAW,CAAC;IACxG,yDAAyD;IACzD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC;IACjD,4DAA4D;IAC5D,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,gCAAgC;IAChC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC"}
|
package/dist/types/services.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../baasix/types/services.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../baasix/types/services.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AA0DH,iFAAiF"}
|
package/dist/utils/db.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { drizzle, PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
7
7
|
import postgres from 'postgres';
|
|
8
|
-
import type { Transaction as TransactionType } from '../types/
|
|
8
|
+
import type { Transaction as TransactionType } from '../types/internal.js';
|
|
9
9
|
declare global {
|
|
10
10
|
var __baasix_db: ReturnType<typeof drizzle> | null;
|
|
11
11
|
var __baasix_sql: ReturnType<typeof postgres> | null;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Consolidated utilities for field validation, processing, and manipulation.
|
|
5
5
|
* Brings together scattered field-related functions into a single module.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
export type {
|
|
7
|
+
import type { FlattenedField } from '../types/index.js';
|
|
8
|
+
export type { FlattenedField };
|
|
9
9
|
/**
|
|
10
10
|
* Field utilities object
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldUtils.d.ts","sourceRoot":"","sources":["../../baasix/utils/fieldUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"fieldUtils.d.ts","sourceRoot":"","sources":["../../baasix/utils/fieldUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;GAEG;AACH,QAAA,MAAM,UAAU;IACd;;;;;;;;;;;;;;;;;OAiBG;uCAEe,MAAM,WACd,MAAM,YACL,GAAG,CAAC,MAAM,CAAC,GACnB,cAAc,EAAE;IAgEnB;;;;;;;;;;;;OAYG;gCACyB,MAAM,aAAa,MAAM,GAAG,OAAO;IAyB/D;;;;;OAKG;iCAC0B,MAAM,aAAa,MAAM,GAAG,MAAM,GAAG,IAAI;IAqCtE;;;;;;;;;;;;OAYG;6CAEe,MAAM,cACV,MAAM,EAAE,mBACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACnC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;IA8B1C;;;;OAIG;sCAC+B,MAAM,GAAG,MAAM,EAAE;IAiBnD;;;;OAIG;oCAC6B,MAAM,GAAG,MAAM,EAAE;IAiBjD;;;;;;;;;;;;OAYG;iBACU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAClC,CAAC,iBACQ,MAAM,EAAE,GACtB,OAAO,CAAC,CAAC,CAAC;IAYb;;;;;OAKG;kBACW,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QACnC,CAAC,iBACQ,MAAM,EAAE,GACtB,OAAO,CAAC,CAAC,CAAC;IAUb;;;;;OAKG;2CAEe,MAAM,QAChB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;IAgB1C;;;;OAIG;qCAC8B,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAiB7D;;;;;OAKG;kCAC2B,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAarF;;;;OAIG;oCAC6B,MAAM,GAAG,MAAM,EAAE;IAWjD;;;;OAIG;kCAC2B,MAAM,GAAG,MAAM,EAAE;IAU/C;;;;OAIG;iCAC0B,MAAM,GAAG,MAAM;IAK5C;;;;OAIG;8BACuB,MAAM,GAAG,MAAM,EAAE;IAI3C;;;;OAIG;0BACmB,MAAM,EAAE,GAAG,MAAM;IAIvC;;;;;OAKG;oCAC6B,MAAM,GAAG,MAAM,EAAE;IAejD;;;;;OAKG;sBACe,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,kBAC7B,MAAM,UACd,CAAC,GACR,CAAC;IAaJ;;;;;OAKG;iCAC0B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,kBACxC,MAAM,WACb,CAAC,EAAE,GACX,CAAC,EAAE;CAcP,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/utils/router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Express } from "
|
|
1
|
+
import type { Express } from "../types/index.js";
|
|
2
2
|
import type { RouteContext } from '../types/index.js';
|
|
3
3
|
export declare const loadRoutes: (app: Express, context: RouteContext) => Promise<void>;
|
|
4
4
|
export declare const loadSystemRoutes: (app: Express, context: RouteContext) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../baasix/utils/router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../baasix/utils/router.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,UAAU,GAAU,KAAK,OAAO,EAAE,SAAS,YAAY,KAAG,OAAO,CAAC,IAAI,CAgClF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,OAAO,EAAE,SAAS,YAAY,KAAG,OAAO,CAAC,IAAI,CAsCxF,CAAC;AAGF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA2B/E,CAAC"}
|