@push.rocks/smartdb 2.9.0 → 2.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartdb",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "private": false,
5
5
  "description": "A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartdb',
6
- version: '2.9.0',
6
+ version: '2.10.0',
7
7
  description: 'A MongoDB-compatible embedded database server with wire protocol support, backed by a high-performance Rust engine.'
8
8
  }
@@ -21,6 +21,10 @@ export type {
21
21
  ICollectionInfo,
22
22
  IDocumentsResult,
23
23
  ISmartDbMetrics,
24
+ } from './rust-db-bridge.js';
25
+
26
+ // Export service API types
27
+ export type {
24
28
  ISmartDbHealth,
25
29
  ISmartDbDatabaseTenantInput,
26
30
  ISmartDbDeleteDatabaseTenantInput,
@@ -31,4 +35,4 @@ export type {
31
35
  ISmartDbDatabaseExport,
32
36
  ISmartDbImportDatabaseInput,
33
37
  ISmartDbImportDatabaseResult,
34
- } from './rust-db-bridge.js';
38
+ } from './service-types.js';
@@ -2,6 +2,30 @@ import * as plugins from './plugins.js';
2
2
  import * as path from 'path';
3
3
  import * as url from 'url';
4
4
  import { EventEmitter } from 'events';
5
+ import type {
6
+ ISmartDbHealth,
7
+ ISmartDbDatabaseTenantInput,
8
+ ISmartDbDeleteDatabaseTenantInput,
9
+ ISmartDbRotateDatabaseTenantPasswordInput,
10
+ ISmartDbDatabaseTenantDescriptor,
11
+ ISmartDbDeleteDatabaseTenantResult,
12
+ ISmartDbDatabaseExport,
13
+ ISmartDbImportDatabaseInput,
14
+ ISmartDbImportDatabaseResult,
15
+ } from './service-types.js';
16
+
17
+ export type {
18
+ ISmartDbHealth,
19
+ ISmartDbDatabaseTenantInput,
20
+ ISmartDbDeleteDatabaseTenantInput,
21
+ ISmartDbRotateDatabaseTenantPasswordInput,
22
+ ISmartDbDatabaseTenantDescriptor,
23
+ ISmartDbDeleteDatabaseTenantResult,
24
+ ISmartDbDatabaseExportCollection,
25
+ ISmartDbDatabaseExport,
26
+ ISmartDbImportDatabaseInput,
27
+ ISmartDbImportDatabaseResult,
28
+ } from './service-types.js';
5
29
 
6
30
  /**
7
31
  * A single oplog entry returned from the Rust engine.
@@ -83,73 +107,6 @@ export interface ISmartDbMetrics {
83
107
  uptimeSeconds: number;
84
108
  }
85
109
 
86
- export interface ISmartDbHealth {
87
- running: boolean;
88
- storage?: 'memory' | 'file';
89
- storagePath?: string;
90
- authEnabled?: boolean;
91
- authUsers?: number;
92
- usersPathConfigured?: boolean;
93
- databaseCount: number;
94
- collectionCount: number;
95
- uptimeSeconds?: number;
96
- }
97
-
98
- export interface ISmartDbDatabaseTenantInput {
99
- databaseName: string;
100
- username: string;
101
- password: string;
102
- roles?: string[];
103
- }
104
-
105
- export interface ISmartDbDeleteDatabaseTenantInput {
106
- databaseName: string;
107
- username?: string;
108
- }
109
-
110
- export interface ISmartDbRotateDatabaseTenantPasswordInput {
111
- username: string;
112
- password: string;
113
- }
114
-
115
- export interface ISmartDbDatabaseTenantDescriptor {
116
- databaseName: string;
117
- username: string;
118
- roles: string[];
119
- authSource: string;
120
- mongodbUri?: string;
121
- }
122
-
123
- export interface ISmartDbDeleteDatabaseTenantResult {
124
- databaseName: string;
125
- deletedUsers: number;
126
- databaseDropped: boolean;
127
- }
128
-
129
- export interface ISmartDbDatabaseExportCollection {
130
- name: string;
131
- documents: Record<string, any>[];
132
- indexes: Record<string, any>[];
133
- }
134
-
135
- export interface ISmartDbDatabaseExport {
136
- format: 'smartdb.database.export.v1';
137
- databaseName: string;
138
- exportedAtMs: number;
139
- collections: ISmartDbDatabaseExportCollection[];
140
- }
141
-
142
- export interface ISmartDbImportDatabaseInput {
143
- databaseName: string;
144
- source: ISmartDbDatabaseExport;
145
- }
146
-
147
- export interface ISmartDbImportDatabaseResult {
148
- databaseName: string;
149
- collections: number;
150
- documents: number;
151
- }
152
-
153
110
  /**
154
111
  * Type-safe command definitions for the RustDb IPC protocol.
155
112
  */
@@ -8,6 +8,8 @@ import type {
8
8
  ICollectionInfo,
9
9
  IDocumentsResult,
10
10
  ISmartDbMetrics,
11
+ } from '../rust-db-bridge.js';
12
+ import type {
11
13
  ISmartDbHealth,
12
14
  ISmartDbDatabaseTenantInput,
13
15
  ISmartDbDeleteDatabaseTenantInput,
@@ -17,7 +19,7 @@ import type {
17
19
  ISmartDbDatabaseExport,
18
20
  ISmartDbImportDatabaseInput,
19
21
  ISmartDbImportDatabaseResult,
20
- } from '../rust-db-bridge.js';
22
+ } from '../service-types.js';
21
23
 
22
24
  /**
23
25
  * Server configuration options
@@ -0,0 +1,66 @@
1
+ export interface ISmartDbHealth {
2
+ running: boolean;
3
+ storage?: 'memory' | 'file';
4
+ storagePath?: string;
5
+ authEnabled?: boolean;
6
+ authUsers?: number;
7
+ usersPathConfigured?: boolean;
8
+ databaseCount: number;
9
+ collectionCount: number;
10
+ uptimeSeconds?: number;
11
+ }
12
+
13
+ export interface ISmartDbDatabaseTenantInput {
14
+ databaseName: string;
15
+ username: string;
16
+ password: string;
17
+ roles?: string[];
18
+ }
19
+
20
+ export interface ISmartDbDeleteDatabaseTenantInput {
21
+ databaseName: string;
22
+ username?: string;
23
+ }
24
+
25
+ export interface ISmartDbRotateDatabaseTenantPasswordInput {
26
+ username: string;
27
+ password: string;
28
+ }
29
+
30
+ export interface ISmartDbDatabaseTenantDescriptor {
31
+ databaseName: string;
32
+ username: string;
33
+ roles: string[];
34
+ authSource: string;
35
+ mongodbUri?: string;
36
+ }
37
+
38
+ export interface ISmartDbDeleteDatabaseTenantResult {
39
+ databaseName: string;
40
+ deletedUsers: number;
41
+ databaseDropped: boolean;
42
+ }
43
+
44
+ export interface ISmartDbDatabaseExportCollection {
45
+ name: string;
46
+ documents: Record<string, any>[];
47
+ indexes: Record<string, any>[];
48
+ }
49
+
50
+ export interface ISmartDbDatabaseExport {
51
+ format: 'smartdb.database.export.v1';
52
+ databaseName: string;
53
+ exportedAtMs: number;
54
+ collections: ISmartDbDatabaseExportCollection[];
55
+ }
56
+
57
+ export interface ISmartDbImportDatabaseInput {
58
+ databaseName: string;
59
+ source: ISmartDbDatabaseExport;
60
+ }
61
+
62
+ export interface ISmartDbImportDatabaseResult {
63
+ databaseName: string;
64
+ collections: number;
65
+ documents: number;
66
+ }