dominus-sdk-nodejs 1.0.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/LLM-GUIDE.md +537 -0
- package/README.md +408 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +129 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.d.ts +32 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/client.js +374 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/config.d.ts +20 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +35 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/errors.d.ts +77 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +134 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/namespaces/auth.d.ts +65 -0
- package/dist/namespaces/auth.d.ts.map +1 -0
- package/dist/namespaces/auth.js +266 -0
- package/dist/namespaces/auth.js.map +1 -0
- package/dist/namespaces/courier.d.ts +67 -0
- package/dist/namespaces/courier.d.ts.map +1 -0
- package/dist/namespaces/courier.js +90 -0
- package/dist/namespaces/courier.js.map +1 -0
- package/dist/namespaces/db.d.ts +117 -0
- package/dist/namespaces/db.d.ts.map +1 -0
- package/dist/namespaces/db.js +149 -0
- package/dist/namespaces/db.js.map +1 -0
- package/dist/namespaces/ddl.d.ts +84 -0
- package/dist/namespaces/ddl.d.ts.map +1 -0
- package/dist/namespaces/ddl.js +211 -0
- package/dist/namespaces/ddl.js.map +1 -0
- package/dist/namespaces/files.d.ts +107 -0
- package/dist/namespaces/files.d.ts.map +1 -0
- package/dist/namespaces/files.js +161 -0
- package/dist/namespaces/files.js.map +1 -0
- package/dist/namespaces/health.d.ts +30 -0
- package/dist/namespaces/health.d.ts.map +1 -0
- package/dist/namespaces/health.js +66 -0
- package/dist/namespaces/health.js.map +1 -0
- package/dist/namespaces/logs.d.ts +97 -0
- package/dist/namespaces/logs.d.ts.map +1 -0
- package/dist/namespaces/logs.js +194 -0
- package/dist/namespaces/logs.js.map +1 -0
- package/dist/namespaces/open.d.ts +27 -0
- package/dist/namespaces/open.d.ts.map +1 -0
- package/dist/namespaces/open.js +46 -0
- package/dist/namespaces/open.js.map +1 -0
- package/dist/namespaces/portal.d.ts +124 -0
- package/dist/namespaces/portal.d.ts.map +1 -0
- package/dist/namespaces/portal.js +270 -0
- package/dist/namespaces/portal.js.map +1 -0
- package/dist/namespaces/redis.d.ts +144 -0
- package/dist/namespaces/redis.d.ts.map +1 -0
- package/dist/namespaces/redis.js +218 -0
- package/dist/namespaces/redis.js.map +1 -0
- package/dist/namespaces/secrets.d.ts +50 -0
- package/dist/namespaces/secrets.d.ts.map +1 -0
- package/dist/namespaces/secrets.js +93 -0
- package/dist/namespaces/secrets.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database Namespace - Scribe data CRUD operations.
|
|
3
|
+
*
|
|
4
|
+
* Provides data operations for all schemas with support for secure table access.
|
|
5
|
+
*/
|
|
6
|
+
export class DbNamespace {
|
|
7
|
+
client;
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* List tables in a schema.
|
|
13
|
+
*
|
|
14
|
+
* @param schema - Schema name (default: "public")
|
|
15
|
+
* @returns List of table metadata
|
|
16
|
+
*/
|
|
17
|
+
async tables(schema = 'public') {
|
|
18
|
+
const result = await this.client.request({
|
|
19
|
+
endpoint: `/api/scribe/data/${schema}/tables`,
|
|
20
|
+
method: 'GET',
|
|
21
|
+
});
|
|
22
|
+
if (Array.isArray(result))
|
|
23
|
+
return result;
|
|
24
|
+
return result.tables || [];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List columns in a table.
|
|
28
|
+
*
|
|
29
|
+
* @param table - Table name
|
|
30
|
+
* @param schema - Schema name (default: "public")
|
|
31
|
+
* @returns List of column metadata
|
|
32
|
+
*/
|
|
33
|
+
async columns(table, schema = 'public') {
|
|
34
|
+
const result = await this.client.request({
|
|
35
|
+
endpoint: `/api/scribe/data/${schema}/${table}/columns`,
|
|
36
|
+
method: 'GET',
|
|
37
|
+
});
|
|
38
|
+
if (Array.isArray(result))
|
|
39
|
+
return result;
|
|
40
|
+
return result.columns || [];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Query table data with filtering, sorting, and pagination.
|
|
44
|
+
*
|
|
45
|
+
* @param table - Table name
|
|
46
|
+
* @param options - Query options
|
|
47
|
+
* @returns Query result with rows and total count
|
|
48
|
+
*/
|
|
49
|
+
async query(table, options = {}) {
|
|
50
|
+
const { schema = 'public', filters, sortBy, sortOrder = 'ASC', limit = 100, offset = 0, reason, actor, } = options;
|
|
51
|
+
const body = {
|
|
52
|
+
filters,
|
|
53
|
+
sort_by: sortBy,
|
|
54
|
+
sort_order: sortOrder,
|
|
55
|
+
limit,
|
|
56
|
+
offset,
|
|
57
|
+
};
|
|
58
|
+
if (reason)
|
|
59
|
+
body.reason = reason;
|
|
60
|
+
if (actor)
|
|
61
|
+
body.actor = actor;
|
|
62
|
+
return this.client.request({
|
|
63
|
+
endpoint: `/api/scribe/data/${schema}/${table}/query`,
|
|
64
|
+
body,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Insert a row into a table.
|
|
69
|
+
*
|
|
70
|
+
* @param table - Table name
|
|
71
|
+
* @param data - Column:value dictionary
|
|
72
|
+
* @param options - Insert options (schema, reason, actor)
|
|
73
|
+
* @returns Inserted row data
|
|
74
|
+
*/
|
|
75
|
+
async insert(table, data, options = {}) {
|
|
76
|
+
const { schema = 'public', reason, actor } = options;
|
|
77
|
+
const body = { data };
|
|
78
|
+
if (reason)
|
|
79
|
+
body.reason = reason;
|
|
80
|
+
if (actor)
|
|
81
|
+
body.actor = actor;
|
|
82
|
+
return this.client.request({
|
|
83
|
+
endpoint: `/api/scribe/data/${schema}/${table}/insert`,
|
|
84
|
+
body,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Update rows matching filters.
|
|
89
|
+
*
|
|
90
|
+
* @param table - Table name
|
|
91
|
+
* @param data - Column:value dictionary of updates
|
|
92
|
+
* @param filters - Column:value dictionary for WHERE clause
|
|
93
|
+
* @param options - Update options (schema, reason, actor)
|
|
94
|
+
* @returns Affected rows count
|
|
95
|
+
*/
|
|
96
|
+
async update(table, data, filters, options = {}) {
|
|
97
|
+
const { schema = 'public', reason, actor } = options;
|
|
98
|
+
const body = { data, filters };
|
|
99
|
+
if (reason)
|
|
100
|
+
body.reason = reason;
|
|
101
|
+
if (actor)
|
|
102
|
+
body.actor = actor;
|
|
103
|
+
return this.client.request({
|
|
104
|
+
endpoint: `/api/scribe/data/${schema}/${table}/update`,
|
|
105
|
+
body,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Delete rows matching filters.
|
|
110
|
+
*
|
|
111
|
+
* @param table - Table name
|
|
112
|
+
* @param filters - Column:value dictionary for WHERE clause
|
|
113
|
+
* @param options - Delete options (schema, reason, actor)
|
|
114
|
+
* @returns Affected rows count
|
|
115
|
+
*/
|
|
116
|
+
async delete(table, filters, options = {}) {
|
|
117
|
+
const { schema = 'public', reason, actor } = options;
|
|
118
|
+
const body = { filters };
|
|
119
|
+
if (reason)
|
|
120
|
+
body.reason = reason;
|
|
121
|
+
if (actor)
|
|
122
|
+
body.actor = actor;
|
|
123
|
+
return this.client.request({
|
|
124
|
+
endpoint: `/api/scribe/data/${schema}/${table}/delete`,
|
|
125
|
+
body,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Insert multiple rows at once.
|
|
130
|
+
*
|
|
131
|
+
* @param table - Table name
|
|
132
|
+
* @param rows - List of column:value dictionaries
|
|
133
|
+
* @param options - Bulk insert options (schema, reason, actor)
|
|
134
|
+
* @returns Insert count and optionally rows
|
|
135
|
+
*/
|
|
136
|
+
async bulkInsert(table, rows, options = {}) {
|
|
137
|
+
const { schema = 'public', reason, actor } = options;
|
|
138
|
+
const body = { rows };
|
|
139
|
+
if (reason)
|
|
140
|
+
body.reason = reason;
|
|
141
|
+
if (actor)
|
|
142
|
+
body.actor = actor;
|
|
143
|
+
return this.client.request({
|
|
144
|
+
endpoint: `/api/scribe/data/${schema}/${table}/bulk-insert`,
|
|
145
|
+
body,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=db.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/namespaces/db.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA+BH,MAAM,OAAO,WAAW;IACF;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,QAAQ;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAyC;YAC/E,QAAQ,EAAE,oBAAoB,MAAM,SAAS;YAC7C,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;QACzC,OAAO,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,MAAM,GAAG,QAAQ;QAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA4C;YAClF,QAAQ,EAAE,oBAAoB,MAAM,IAAI,KAAK,UAAU;YACvD,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YA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I,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAE9B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,oBAAoB,MAAM,IAAI,KAAK,cAAc;YAC3D,IAAI;SACL,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DDL Namespace - Smith schema DDL & migration operations.
|
|
3
|
+
*
|
|
4
|
+
* Provides DDL operations for schema management and Alembic migrations.
|
|
5
|
+
*/
|
|
6
|
+
import type { DominusClient } from '../lib/client.js';
|
|
7
|
+
export interface ColumnDefinition {
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
constraints?: string[];
|
|
11
|
+
default?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class DdlNamespace {
|
|
14
|
+
private client;
|
|
15
|
+
constructor(client: DominusClient);
|
|
16
|
+
/**
|
|
17
|
+
* Create a table in a schema.
|
|
18
|
+
*/
|
|
19
|
+
createTable(tableName: string, columns: ColumnDefinition[], schema?: string): Promise<Record<string, unknown>>;
|
|
20
|
+
/**
|
|
21
|
+
* Drop a table from a schema.
|
|
22
|
+
*/
|
|
23
|
+
dropTable(tableName: string, schema?: string): Promise<Record<string, unknown>>;
|
|
24
|
+
/**
|
|
25
|
+
* Add a column to a table.
|
|
26
|
+
*/
|
|
27
|
+
addColumn(tableName: string, column: ColumnDefinition, schema?: string): Promise<Record<string, unknown>>;
|
|
28
|
+
/**
|
|
29
|
+
* Drop a column from a table.
|
|
30
|
+
*/
|
|
31
|
+
dropColumn(tableName: string, columnName: string, schema?: string): Promise<Record<string, unknown>>;
|
|
32
|
+
/**
|
|
33
|
+
* Alter a column in a table.
|
|
34
|
+
*/
|
|
35
|
+
alterColumn(tableName: string, columnName: string, changes: {
|
|
36
|
+
newType?: string;
|
|
37
|
+
newDefault?: string;
|
|
38
|
+
nullable?: boolean;
|
|
39
|
+
}, schema?: string): Promise<Record<string, unknown>>;
|
|
40
|
+
/**
|
|
41
|
+
* Create an index on a table.
|
|
42
|
+
*/
|
|
43
|
+
createIndex(tableName: string, indexName: string, columns: string[], options?: {
|
|
44
|
+
unique?: boolean;
|
|
45
|
+
schema?: string;
|
|
46
|
+
}): Promise<Record<string, unknown>>;
|
|
47
|
+
/**
|
|
48
|
+
* Drop an index.
|
|
49
|
+
*/
|
|
50
|
+
dropIndex(indexName: string, schema?: string): Promise<Record<string, unknown>>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a table across all schemas in a category.
|
|
53
|
+
*/
|
|
54
|
+
categoryCreateTable(categorySlug: string, tableName: string, columns: ColumnDefinition[]): Promise<Record<string, unknown>>;
|
|
55
|
+
/**
|
|
56
|
+
* Add a column across all schemas in a category.
|
|
57
|
+
*/
|
|
58
|
+
categoryAddColumn(categorySlug: string, tableName: string, column: ColumnDefinition): Promise<Record<string, unknown>>;
|
|
59
|
+
/**
|
|
60
|
+
* List migrations for a schema.
|
|
61
|
+
*/
|
|
62
|
+
listMigrations(schema: string): Promise<Array<Record<string, unknown>>>;
|
|
63
|
+
/**
|
|
64
|
+
* List migrations for a category.
|
|
65
|
+
*/
|
|
66
|
+
listCategoryMigrations(categorySlug: string): Promise<Array<Record<string, unknown>>>;
|
|
67
|
+
/**
|
|
68
|
+
* Apply a specific migration to a schema.
|
|
69
|
+
*/
|
|
70
|
+
applyMigration(schema: string, migrationId: string): Promise<Record<string, unknown>>;
|
|
71
|
+
/**
|
|
72
|
+
* Rollback a migration from a schema.
|
|
73
|
+
*/
|
|
74
|
+
rollbackMigration(schema: string, migrationId: string): Promise<Record<string, unknown>>;
|
|
75
|
+
/**
|
|
76
|
+
* Provision a new tenant schema.
|
|
77
|
+
*/
|
|
78
|
+
provisionTenantSchema(tenantSlug: string, categorySlug?: string): Promise<Record<string, unknown>>;
|
|
79
|
+
/**
|
|
80
|
+
* Provision a tenant from a category template.
|
|
81
|
+
*/
|
|
82
|
+
provisionTenantFromCategory(tenantSlug: string, categorySlug: string): Promise<Record<string, unknown>>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=ddl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ddl.d.ts","sourceRoot":"","sources":["../../src/namespaces/ddl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAMzC;;OAEG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,MAAM,SAAW,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAWnC;;OAEG;IACG,SAAS,CACb,SAAS,EAAE,MAAM,EACjB,MAAM,SAAW,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAUnC;;OAEG;IACG,SAAS,CACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,MAAM,SAAW,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAWnC;;OAEG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,SAAW,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAWnC;;OAEG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QAC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MAAM,EAAE,OAAO,CAAC,CAAC;IAUnC;;OAEG;IACG,iBAAiB,CACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAcnC;;OAEG;IACG,qBAAqB,CACzB,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAUnC;;OAEG;IACG,2BAA2B,CAC/B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CASpC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DDL Namespace - Smith schema DDL & migration operations.
|
|
3
|
+
*
|
|
4
|
+
* Provides DDL operations for schema management and Alembic migrations.
|
|
5
|
+
*/
|
|
6
|
+
export class DdlNamespace {
|
|
7
|
+
client;
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
// ========================================
|
|
12
|
+
// SCHEMA DDL (Direct Operations)
|
|
13
|
+
// ========================================
|
|
14
|
+
/**
|
|
15
|
+
* Create a table in a schema.
|
|
16
|
+
*/
|
|
17
|
+
async createTable(tableName, columns, schema = 'public') {
|
|
18
|
+
return this.client.request({
|
|
19
|
+
endpoint: '/api/smith/schema/create-table',
|
|
20
|
+
body: {
|
|
21
|
+
schema,
|
|
22
|
+
table_name: tableName,
|
|
23
|
+
columns,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Drop a table from a schema.
|
|
29
|
+
*/
|
|
30
|
+
async dropTable(tableName, schema = 'public') {
|
|
31
|
+
return this.client.request({
|
|
32
|
+
endpoint: '/api/smith/schema/drop-table',
|
|
33
|
+
body: {
|
|
34
|
+
schema,
|
|
35
|
+
table_name: tableName,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Add a column to a table.
|
|
41
|
+
*/
|
|
42
|
+
async addColumn(tableName, column, schema = 'public') {
|
|
43
|
+
return this.client.request({
|
|
44
|
+
endpoint: '/api/smith/schema/add-column',
|
|
45
|
+
body: {
|
|
46
|
+
schema,
|
|
47
|
+
table_name: tableName,
|
|
48
|
+
column,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Drop a column from a table.
|
|
54
|
+
*/
|
|
55
|
+
async dropColumn(tableName, columnName, schema = 'public') {
|
|
56
|
+
return this.client.request({
|
|
57
|
+
endpoint: '/api/smith/schema/drop-column',
|
|
58
|
+
body: {
|
|
59
|
+
schema,
|
|
60
|
+
table_name: tableName,
|
|
61
|
+
column_name: columnName,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Alter a column in a table.
|
|
67
|
+
*/
|
|
68
|
+
async alterColumn(tableName, columnName, changes, schema = 'public') {
|
|
69
|
+
return this.client.request({
|
|
70
|
+
endpoint: '/api/smith/schema/alter-column',
|
|
71
|
+
body: {
|
|
72
|
+
schema,
|
|
73
|
+
table_name: tableName,
|
|
74
|
+
column_name: columnName,
|
|
75
|
+
...changes,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create an index on a table.
|
|
81
|
+
*/
|
|
82
|
+
async createIndex(tableName, indexName, columns, options = {}) {
|
|
83
|
+
const { unique = false, schema = 'public' } = options;
|
|
84
|
+
return this.client.request({
|
|
85
|
+
endpoint: '/api/smith/schema/create-index',
|
|
86
|
+
body: {
|
|
87
|
+
schema,
|
|
88
|
+
table_name: tableName,
|
|
89
|
+
index_name: indexName,
|
|
90
|
+
columns,
|
|
91
|
+
unique,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Drop an index.
|
|
97
|
+
*/
|
|
98
|
+
async dropIndex(indexName, schema = 'public') {
|
|
99
|
+
return this.client.request({
|
|
100
|
+
endpoint: '/api/smith/schema/drop-index',
|
|
101
|
+
body: {
|
|
102
|
+
schema,
|
|
103
|
+
index_name: indexName,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// ========================================
|
|
108
|
+
// CATEGORY DDL (Atomic Multi-Schema)
|
|
109
|
+
// ========================================
|
|
110
|
+
/**
|
|
111
|
+
* Create a table across all schemas in a category.
|
|
112
|
+
*/
|
|
113
|
+
async categoryCreateTable(categorySlug, tableName, columns) {
|
|
114
|
+
return this.client.request({
|
|
115
|
+
endpoint: '/api/smith/category/create-table',
|
|
116
|
+
body: {
|
|
117
|
+
category_slug: categorySlug,
|
|
118
|
+
table_name: tableName,
|
|
119
|
+
columns,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Add a column across all schemas in a category.
|
|
125
|
+
*/
|
|
126
|
+
async categoryAddColumn(categorySlug, tableName, column) {
|
|
127
|
+
return this.client.request({
|
|
128
|
+
endpoint: '/api/smith/category/add-column',
|
|
129
|
+
body: {
|
|
130
|
+
category_slug: categorySlug,
|
|
131
|
+
table_name: tableName,
|
|
132
|
+
column,
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// ========================================
|
|
137
|
+
// MIGRATIONS
|
|
138
|
+
// ========================================
|
|
139
|
+
/**
|
|
140
|
+
* List migrations for a schema.
|
|
141
|
+
*/
|
|
142
|
+
async listMigrations(schema) {
|
|
143
|
+
const result = await this.client.request({
|
|
144
|
+
endpoint: `/api/smith/migrations/list/${schema}`,
|
|
145
|
+
method: 'GET',
|
|
146
|
+
});
|
|
147
|
+
return Array.isArray(result) ? result : result.migrations || [];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* List migrations for a category.
|
|
151
|
+
*/
|
|
152
|
+
async listCategoryMigrations(categorySlug) {
|
|
153
|
+
const result = await this.client.request({
|
|
154
|
+
endpoint: `/api/smith/migrations/category/${categorySlug}/list`,
|
|
155
|
+
method: 'GET',
|
|
156
|
+
});
|
|
157
|
+
return Array.isArray(result) ? result : result.migrations || [];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Apply a specific migration to a schema.
|
|
161
|
+
*/
|
|
162
|
+
async applyMigration(schema, migrationId) {
|
|
163
|
+
return this.client.request({
|
|
164
|
+
endpoint: '/api/smith/migrations/apply',
|
|
165
|
+
body: {
|
|
166
|
+
schema,
|
|
167
|
+
migration_id: migrationId,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Rollback a migration from a schema.
|
|
173
|
+
*/
|
|
174
|
+
async rollbackMigration(schema, migrationId) {
|
|
175
|
+
return this.client.request({
|
|
176
|
+
endpoint: '/api/smith/migrations/rollback',
|
|
177
|
+
body: {
|
|
178
|
+
schema,
|
|
179
|
+
migration_id: migrationId,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// ========================================
|
|
184
|
+
// PROVISIONING
|
|
185
|
+
// ========================================
|
|
186
|
+
/**
|
|
187
|
+
* Provision a new tenant schema.
|
|
188
|
+
*/
|
|
189
|
+
async provisionTenantSchema(tenantSlug, categorySlug) {
|
|
190
|
+
return this.client.request({
|
|
191
|
+
endpoint: '/api/smith/provision/tenant-schema',
|
|
192
|
+
body: {
|
|
193
|
+
tenant_slug: tenantSlug,
|
|
194
|
+
category_slug: categorySlug,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Provision a tenant from a category template.
|
|
200
|
+
*/
|
|
201
|
+
async provisionTenantFromCategory(tenantSlug, categorySlug) {
|
|
202
|
+
return this.client.request({
|
|
203
|
+
endpoint: '/api/smith/provision/tenant-from-category',
|
|
204
|
+
body: {
|
|
205
|
+
tenant_slug: tenantSlug,
|
|
206
|
+
category_slug: categorySlug,
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=ddl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ddl.js","sourceRoot":"","sources":["../../src/namespaces/ddl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,2CAA2C;IAC3C,iCAAiC;IACjC,2CAA2C;IAE3C;;OAEG;IACH,KAAK,CAAC,WAAW,CACf,SAAiB,EACjB,OAA2B,EAC3B,MAAM,GAAG,QAAQ;QAEjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,gCAAgC;YAC1C,IAAI,EAAE;gBACJ,MAAM;gBACN,UAAU,EAAE,SAAS;gBACrB,OAAO;aACR;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CACb,SAAiB,EACjB,MAAM,GAAG,QAAQ;QAEjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,8BAA8B;YACxC,IAAI,EAAE;gBACJ,MAAM;gBACN,UAAU,EAAE,SAAS;aACtB;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CACb,SAAiB,EACjB,MAAwB,EACxB,MAAM,GAAG,QAAQ;QAEjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,8BAA8B;YACxC,IAAI,EAAE;gBACJ,MAAM;gBACN,UAAU,EAAE,SAAS;gBACrB,MAAM;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAED;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MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAClB,MAAc,EACd,WAAmB;QAEnB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,6BAA6B;YACvC,IAAI,EAAE;gBACJ,MAAM;gBACN,YAAY,EAAE,WAAW;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CACrB,MAAc,EACd,WAAmB;QAEnB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,gCAAgC;YAC1C,IAAI,EAAE;gBACJ,MAAM;gBACN,YAAY,EAAE,WAAW;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAED,2CAA2C;IAC3C,eAAe;IACf,2CAA2C;IAE3C;;OAEG;IACH,KAAK,CAAC,qBAAqB,CACzB,UAAkB,EAClB,YAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,oCAAoC;YAC9C,IAAI,EAAE;gBACJ,WAAW,EAAE,UAAU;gBACvB,aAAa,EAAE,YAAY;aAC5B;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,2BAA2B,CAC/B,UAAkB,EAClB,YAAoB;QAEpB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,QAAQ,EAAE,2CAA2C;YACrD,IAAI,EAAE;gBACJ,WAAW,EAAE,UAAU;gBACvB,aAAa,EAAE,YAAY;aAC5B;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Files Namespace - Archivist object storage operations.
|
|
3
|
+
*
|
|
4
|
+
* Provides file upload, download, and management via B2 object storage.
|
|
5
|
+
*/
|
|
6
|
+
import type { DominusClient } from '../lib/client.js';
|
|
7
|
+
export interface UploadResult {
|
|
8
|
+
id: string;
|
|
9
|
+
path: string;
|
|
10
|
+
size: number;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface DownloadResult {
|
|
14
|
+
download_url: string;
|
|
15
|
+
expires_at: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface FetchResult {
|
|
19
|
+
data: string;
|
|
20
|
+
filename: string;
|
|
21
|
+
content_type: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ListResult {
|
|
24
|
+
objects: Array<Record<string, unknown>>;
|
|
25
|
+
cursor?: string;
|
|
26
|
+
count: number;
|
|
27
|
+
}
|
|
28
|
+
export interface FileInfo {
|
|
29
|
+
id?: string;
|
|
30
|
+
category?: string;
|
|
31
|
+
path?: string;
|
|
32
|
+
actor?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class FilesNamespace {
|
|
35
|
+
private client;
|
|
36
|
+
constructor(client: DominusClient);
|
|
37
|
+
/**
|
|
38
|
+
* Upload a file to object storage.
|
|
39
|
+
*
|
|
40
|
+
* @param data - File content as Buffer
|
|
41
|
+
* @param filename - Original filename
|
|
42
|
+
* @param options - Upload options
|
|
43
|
+
*/
|
|
44
|
+
upload(data: Buffer, filename: string, options?: {
|
|
45
|
+
contentType?: string;
|
|
46
|
+
category?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
tags?: Record<string, string>;
|
|
49
|
+
compliance?: boolean;
|
|
50
|
+
actor?: string;
|
|
51
|
+
retentionDays?: number;
|
|
52
|
+
}): Promise<UploadResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Get a presigned download URL for a file.
|
|
55
|
+
*
|
|
56
|
+
* @param options - File identifier and options
|
|
57
|
+
*/
|
|
58
|
+
download(options: FileInfo & {
|
|
59
|
+
expiresSeconds?: number;
|
|
60
|
+
}): Promise<DownloadResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Fetch file content directly.
|
|
63
|
+
*
|
|
64
|
+
* @param options - File identifier
|
|
65
|
+
*/
|
|
66
|
+
fetch(options: FileInfo): Promise<FetchResult>;
|
|
67
|
+
/**
|
|
68
|
+
* List files with optional filtering.
|
|
69
|
+
*
|
|
70
|
+
* @param options - List options
|
|
71
|
+
*/
|
|
72
|
+
list(options?: {
|
|
73
|
+
category?: string;
|
|
74
|
+
prefix?: string;
|
|
75
|
+
limit?: number;
|
|
76
|
+
cursor?: string;
|
|
77
|
+
}): Promise<ListResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Delete a file.
|
|
80
|
+
*
|
|
81
|
+
* @param options - File identifier
|
|
82
|
+
*/
|
|
83
|
+
delete(options: FileInfo): Promise<{
|
|
84
|
+
deleted: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Move or rename a file.
|
|
88
|
+
*
|
|
89
|
+
* @param fileId - File UUID
|
|
90
|
+
* @param options - New category and/or path
|
|
91
|
+
*/
|
|
92
|
+
move(fileId: string, options: {
|
|
93
|
+
newCategory?: string;
|
|
94
|
+
newPath?: string;
|
|
95
|
+
}): Promise<Record<string, unknown>>;
|
|
96
|
+
/**
|
|
97
|
+
* Update file metadata.
|
|
98
|
+
*
|
|
99
|
+
* @param fileId - File UUID
|
|
100
|
+
* @param options - New metadata
|
|
101
|
+
*/
|
|
102
|
+
updateMeta(fileId: string, options: {
|
|
103
|
+
tags?: Record<string, string>;
|
|
104
|
+
description?: string;
|
|
105
|
+
}): Promise<Record<string, unknown>>;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/namespaces/files.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IAC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