@ductape/sdk 0.0.4-v42 → 0.0.4-v44
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/apps/services/app.service.d.ts +10 -0
- package/dist/apps/services/app.service.js +38 -69
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +2 -15
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +2 -14
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
- package/dist/database/adapters/base.adapter.d.ts +176 -0
- package/dist/database/adapters/base.adapter.js +31 -0
- package/dist/database/adapters/base.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +91 -0
- package/dist/database/adapters/dynamodb.adapter.js +1469 -0
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
- package/dist/database/adapters/mongodb.adapter.d.ts +71 -0
- package/dist/database/adapters/mongodb.adapter.js +882 -0
- package/dist/database/adapters/mongodb.adapter.js.map +1 -0
- package/dist/database/adapters/mysql.adapter.d.ts +146 -0
- package/dist/database/adapters/mysql.adapter.js +1417 -0
- package/dist/database/adapters/mysql.adapter.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.d.ts +147 -0
- package/dist/database/adapters/postgresql.adapter.js +1472 -0
- package/dist/database/adapters/postgresql.adapter.js.map +1 -0
- package/dist/database/database.service.d.ts +195 -0
- package/dist/database/database.service.js +502 -0
- package/dist/database/database.service.js.map +1 -0
- package/dist/database/index.d.ts +18 -0
- package/dist/database/index.js +98 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/types/aggregation.types.d.ts +202 -0
- package/dist/database/types/aggregation.types.js +21 -0
- package/dist/database/types/aggregation.types.js.map +1 -0
- package/dist/database/types/connection.types.d.ts +132 -0
- package/dist/database/types/connection.types.js +6 -0
- package/dist/database/types/connection.types.js.map +1 -0
- package/dist/database/types/database.types.d.ts +174 -0
- package/dist/database/types/database.types.js +74 -0
- package/dist/database/types/database.types.js.map +1 -0
- package/dist/database/types/index.d.ts +12 -0
- package/dist/database/types/index.js +37 -0
- package/dist/database/types/index.js.map +1 -0
- package/dist/database/types/index.types.d.ts +220 -0
- package/dist/database/types/index.types.js +27 -0
- package/dist/database/types/index.types.js.map +1 -0
- package/dist/database/types/migration.types.d.ts +205 -0
- package/dist/database/types/migration.types.js +44 -0
- package/dist/database/types/migration.types.js.map +1 -0
- package/dist/database/types/query.types.d.ts +305 -0
- package/dist/database/types/query.types.js +57 -0
- package/dist/database/types/query.types.js.map +1 -0
- package/dist/database/types/result.types.d.ts +218 -0
- package/dist/database/types/result.types.js +6 -0
- package/dist/database/types/result.types.js.map +1 -0
- package/dist/database/types/schema.types.d.ts +190 -0
- package/dist/database/types/schema.types.js +69 -0
- package/dist/database/types/schema.types.js.map +1 -0
- package/dist/database/utils/helpers.d.ts +66 -0
- package/dist/database/utils/helpers.js +501 -0
- package/dist/database/utils/helpers.js.map +1 -0
- package/dist/database/utils/migration.utils.d.ts +151 -0
- package/dist/database/utils/migration.utils.js +476 -0
- package/dist/database/utils/migration.utils.js.map +1 -0
- package/dist/database/utils/transaction.d.ts +64 -0
- package/dist/database/utils/transaction.js +130 -0
- package/dist/database/utils/transaction.js.map +1 -0
- package/dist/database/validators/connection.validator.d.ts +20 -0
- package/dist/database/validators/connection.validator.js +267 -0
- package/dist/database/validators/connection.validator.js.map +1 -0
- package/dist/database/validators/query.validator.d.ts +31 -0
- package/dist/database/validators/query.validator.js +305 -0
- package/dist/database/validators/query.validator.js.map +1 -0
- package/dist/database/validators/schema.validator.d.ts +31 -0
- package/dist/database/validators/schema.validator.js +334 -0
- package/dist/database/validators/schema.validator.js.map +1 -0
- package/dist/index.d.ts +194 -146
- package/dist/index.js +232 -173
- package/dist/index.js.map +1 -1
- package/dist/processor/services/processor.service.js +61 -43
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/test/test.processor.js +1 -3
- package/dist/test/test.processor.js.map +1 -1
- package/dist/types/appBuilder.types.d.ts +1 -1
- package/dist/types/processor.types.d.ts +2 -2
- package/package.json +3 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index type definitions for database indexes
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Index type
|
|
6
|
+
*/
|
|
7
|
+
export declare enum IndexType {
|
|
8
|
+
/** B-Tree index (default for most databases) */
|
|
9
|
+
BTREE = "btree",
|
|
10
|
+
/** Hash index */
|
|
11
|
+
HASH = "hash",
|
|
12
|
+
/** GIN (Generalized Inverted Index) - PostgreSQL */
|
|
13
|
+
GIN = "gin",
|
|
14
|
+
/** GiST (Generalized Search Tree) - PostgreSQL */
|
|
15
|
+
GIST = "gist",
|
|
16
|
+
/** Full-text index */
|
|
17
|
+
FULLTEXT = "fulltext",
|
|
18
|
+
/** Spatial index */
|
|
19
|
+
SPATIAL = "spatial",
|
|
20
|
+
/** Unique index */
|
|
21
|
+
UNIQUE = "unique"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Index column definition
|
|
25
|
+
*/
|
|
26
|
+
export interface IIndexColumn {
|
|
27
|
+
/** Column name */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Sort order */
|
|
30
|
+
order?: 'ASC' | 'DESC';
|
|
31
|
+
/** Length (for partial indexes on string columns) */
|
|
32
|
+
length?: number;
|
|
33
|
+
/** Expression (for expression-based indexes) */
|
|
34
|
+
expression?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Index definition
|
|
38
|
+
*/
|
|
39
|
+
export interface IIndexDefinition {
|
|
40
|
+
/** Index name */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Table name */
|
|
43
|
+
table: string;
|
|
44
|
+
/** Columns in the index */
|
|
45
|
+
columns: IIndexColumn[];
|
|
46
|
+
/** Index type */
|
|
47
|
+
type?: IndexType;
|
|
48
|
+
/** Is unique index */
|
|
49
|
+
unique?: boolean;
|
|
50
|
+
/** Partial index condition (WHERE clause) */
|
|
51
|
+
where?: string;
|
|
52
|
+
/** Index method (database-specific) */
|
|
53
|
+
method?: string;
|
|
54
|
+
/** Include columns (PostgreSQL covering indexes) */
|
|
55
|
+
include?: string[];
|
|
56
|
+
/** Comment */
|
|
57
|
+
comment?: string;
|
|
58
|
+
/** Storage parameters */
|
|
59
|
+
storageParams?: Record<string, any>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create index options
|
|
63
|
+
*/
|
|
64
|
+
export interface ICreateIndexOptions {
|
|
65
|
+
/** Table name */
|
|
66
|
+
table: string;
|
|
67
|
+
/** Environment slug (optional if connection is already established) */
|
|
68
|
+
env?: string;
|
|
69
|
+
/** Product tag (optional if connection is already established) */
|
|
70
|
+
product?: string;
|
|
71
|
+
/** Database tag (optional if connection is already established) */
|
|
72
|
+
database?: string;
|
|
73
|
+
/** Index definition */
|
|
74
|
+
index: IIndexDefinition;
|
|
75
|
+
/** Create if not exists */
|
|
76
|
+
ifNotExists?: boolean;
|
|
77
|
+
/** Create concurrently (PostgreSQL - doesn't lock table) */
|
|
78
|
+
concurrent?: boolean;
|
|
79
|
+
/** Generate migration */
|
|
80
|
+
generateMigration?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Drop index options
|
|
84
|
+
*/
|
|
85
|
+
export interface IDropIndexOptions {
|
|
86
|
+
/** Index name */
|
|
87
|
+
indexName: string;
|
|
88
|
+
/** Table name */
|
|
89
|
+
table: string;
|
|
90
|
+
/** Environment slug (optional if connection is already established) */
|
|
91
|
+
env?: string;
|
|
92
|
+
/** Product tag (optional if connection is already established) */
|
|
93
|
+
product?: string;
|
|
94
|
+
/** Database tag (optional if connection is already established) */
|
|
95
|
+
database?: string;
|
|
96
|
+
/** Drop if exists */
|
|
97
|
+
ifExists?: boolean;
|
|
98
|
+
/** Drop concurrently (PostgreSQL) */
|
|
99
|
+
concurrent?: boolean;
|
|
100
|
+
/** Cascade drop (also drop dependent objects) */
|
|
101
|
+
cascade?: boolean;
|
|
102
|
+
/** Generate migration */
|
|
103
|
+
generateMigration?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* List indexes options
|
|
107
|
+
*/
|
|
108
|
+
export interface IListIndexesOptions {
|
|
109
|
+
/** Table name */
|
|
110
|
+
table: string;
|
|
111
|
+
/** Environment slug (optional if connection is already established) */
|
|
112
|
+
env?: string;
|
|
113
|
+
/** Product tag (optional if connection is already established) */
|
|
114
|
+
product?: string;
|
|
115
|
+
/** Database tag (optional if connection is already established) */
|
|
116
|
+
database?: string;
|
|
117
|
+
/** Include system indexes */
|
|
118
|
+
includeSystem?: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Index info (returned when listing indexes)
|
|
122
|
+
*/
|
|
123
|
+
export interface IIndexInfo {
|
|
124
|
+
/** Index name */
|
|
125
|
+
name: string;
|
|
126
|
+
/** Table name */
|
|
127
|
+
table: string;
|
|
128
|
+
/** Column names */
|
|
129
|
+
columns: string[];
|
|
130
|
+
/** Column definitions with details */
|
|
131
|
+
columnDetails: IIndexColumn[];
|
|
132
|
+
/** Is unique */
|
|
133
|
+
unique: boolean;
|
|
134
|
+
/** Is primary key */
|
|
135
|
+
primaryKey: boolean;
|
|
136
|
+
/** Index type */
|
|
137
|
+
type: string;
|
|
138
|
+
/** Index size (in bytes, if available) */
|
|
139
|
+
size?: number;
|
|
140
|
+
/** Number of rows in index */
|
|
141
|
+
rowCount?: number;
|
|
142
|
+
/** Partial index condition */
|
|
143
|
+
where?: string;
|
|
144
|
+
/** Comment */
|
|
145
|
+
comment?: string;
|
|
146
|
+
/** Additional metadata */
|
|
147
|
+
metadata?: Record<string, any>;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Index statistics
|
|
151
|
+
*/
|
|
152
|
+
export interface IIndexStatistics {
|
|
153
|
+
/** Index name */
|
|
154
|
+
indexName: string;
|
|
155
|
+
/** Table name */
|
|
156
|
+
table: string;
|
|
157
|
+
/** Number of index scans */
|
|
158
|
+
scans?: number;
|
|
159
|
+
/** Number of tuples/rows read */
|
|
160
|
+
tuplesRead?: number;
|
|
161
|
+
/** Number of tuples fetched */
|
|
162
|
+
tuplesFetched?: number;
|
|
163
|
+
/** Index size in bytes */
|
|
164
|
+
size: number;
|
|
165
|
+
/** Index size (human-readable) */
|
|
166
|
+
sizeFormatted?: string;
|
|
167
|
+
/** Last used timestamp */
|
|
168
|
+
lastUsed?: Date | string;
|
|
169
|
+
/** Is index bloated */
|
|
170
|
+
bloated?: boolean;
|
|
171
|
+
/** Bloat percentage */
|
|
172
|
+
bloatPercentage?: number;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Analyze index options
|
|
176
|
+
*/
|
|
177
|
+
export interface IAnalyzeIndexOptions {
|
|
178
|
+
/** Index name */
|
|
179
|
+
indexName?: string;
|
|
180
|
+
/** Table name */
|
|
181
|
+
table: string;
|
|
182
|
+
/** Environment slug (optional if connection is already established) */
|
|
183
|
+
env?: string;
|
|
184
|
+
/** Product tag (optional if connection is already established) */
|
|
185
|
+
product?: string;
|
|
186
|
+
/** Database tag (optional if connection is already established) */
|
|
187
|
+
database?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Rebuild index options
|
|
191
|
+
*/
|
|
192
|
+
export interface IRebuildIndexOptions {
|
|
193
|
+
/** Index name */
|
|
194
|
+
indexName: string;
|
|
195
|
+
/** Table name */
|
|
196
|
+
table: string;
|
|
197
|
+
/** Environment slug (optional if connection is already established) */
|
|
198
|
+
env?: string;
|
|
199
|
+
/** Product tag (optional if connection is already established) */
|
|
200
|
+
product?: string;
|
|
201
|
+
/** Database tag (optional if connection is already established) */
|
|
202
|
+
database?: string;
|
|
203
|
+
/** Rebuild concurrently (PostgreSQL) */
|
|
204
|
+
concurrent?: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Index recommendation
|
|
208
|
+
*/
|
|
209
|
+
export interface IIndexRecommendation {
|
|
210
|
+
/** Recommended index definition */
|
|
211
|
+
index: IIndexDefinition;
|
|
212
|
+
/** Reason for recommendation */
|
|
213
|
+
reason: string;
|
|
214
|
+
/** Estimated performance impact */
|
|
215
|
+
impact: 'high' | 'medium' | 'low';
|
|
216
|
+
/** Query patterns that would benefit */
|
|
217
|
+
affectedQueries?: string[];
|
|
218
|
+
/** Estimated index size */
|
|
219
|
+
estimatedSize?: number;
|
|
220
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Index type definitions for database indexes
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IndexType = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Index type
|
|
9
|
+
*/
|
|
10
|
+
var IndexType;
|
|
11
|
+
(function (IndexType) {
|
|
12
|
+
/** B-Tree index (default for most databases) */
|
|
13
|
+
IndexType["BTREE"] = "btree";
|
|
14
|
+
/** Hash index */
|
|
15
|
+
IndexType["HASH"] = "hash";
|
|
16
|
+
/** GIN (Generalized Inverted Index) - PostgreSQL */
|
|
17
|
+
IndexType["GIN"] = "gin";
|
|
18
|
+
/** GiST (Generalized Search Tree) - PostgreSQL */
|
|
19
|
+
IndexType["GIST"] = "gist";
|
|
20
|
+
/** Full-text index */
|
|
21
|
+
IndexType["FULLTEXT"] = "fulltext";
|
|
22
|
+
/** Spatial index */
|
|
23
|
+
IndexType["SPATIAL"] = "spatial";
|
|
24
|
+
/** Unique index */
|
|
25
|
+
IndexType["UNIQUE"] = "unique";
|
|
26
|
+
})(IndexType || (exports.IndexType = IndexType = {}));
|
|
27
|
+
//# sourceMappingURL=index.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../../src/database/types/index.types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACH,IAAY,SAeX;AAfD,WAAY,SAAS;IACnB,gDAAgD;IAChD,4BAAe,CAAA;IACf,iBAAiB;IACjB,0BAAa,CAAA;IACb,oDAAoD;IACpD,wBAAW,CAAA;IACX,kDAAkD;IAClD,0BAAa,CAAA;IACb,sBAAsB;IACtB,kCAAqB,CAAA;IACrB,oBAAoB;IACpB,gCAAmB,CAAA;IACnB,mBAAmB;IACnB,8BAAiB,CAAA;AACnB,CAAC,EAfW,SAAS,yBAAT,SAAS,QAepB"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration type definitions for database schema versioning
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Migration status
|
|
6
|
+
*/
|
|
7
|
+
export declare enum MigrationStatus {
|
|
8
|
+
PENDING = "pending",
|
|
9
|
+
RUNNING = "running",
|
|
10
|
+
COMPLETED = "completed",
|
|
11
|
+
FAILED = "failed",
|
|
12
|
+
ROLLED_BACK = "rolled_back"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Migration direction
|
|
16
|
+
*/
|
|
17
|
+
export declare enum MigrationDirection {
|
|
18
|
+
UP = "up",
|
|
19
|
+
DOWN = "down"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Migration operation type
|
|
23
|
+
*/
|
|
24
|
+
export declare enum MigrationOperationType {
|
|
25
|
+
CREATE_TABLE = "create_table",
|
|
26
|
+
DROP_TABLE = "drop_table",
|
|
27
|
+
ALTER_TABLE = "alter_table",
|
|
28
|
+
ADD_COLUMN = "add_column",
|
|
29
|
+
DROP_COLUMN = "drop_column",
|
|
30
|
+
MODIFY_COLUMN = "modify_column",
|
|
31
|
+
RENAME_COLUMN = "rename_column",
|
|
32
|
+
ADD_INDEX = "add_index",
|
|
33
|
+
DROP_INDEX = "drop_index",
|
|
34
|
+
ADD_CONSTRAINT = "add_constraint",
|
|
35
|
+
DROP_CONSTRAINT = "drop_constraint",
|
|
36
|
+
RAW_SQL = "raw_sql"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Migration operation
|
|
40
|
+
*/
|
|
41
|
+
export interface IMigrationOperation {
|
|
42
|
+
/** Operation type */
|
|
43
|
+
type: MigrationOperationType;
|
|
44
|
+
/** Table name */
|
|
45
|
+
table?: string;
|
|
46
|
+
/** Raw SQL (for RAW_SQL type) */
|
|
47
|
+
sql?: string;
|
|
48
|
+
/** Operation parameters */
|
|
49
|
+
params?: Record<string, any>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Migration definition
|
|
53
|
+
*/
|
|
54
|
+
export interface IMigrationDefinition {
|
|
55
|
+
/** Migration name */
|
|
56
|
+
name: string;
|
|
57
|
+
/** Migration description */
|
|
58
|
+
description?: string;
|
|
59
|
+
/** Migration tag/identifier */
|
|
60
|
+
tag: string;
|
|
61
|
+
/** Up operations */
|
|
62
|
+
up: IMigrationOperation[];
|
|
63
|
+
/** Down operations (rollback) */
|
|
64
|
+
down: IMigrationOperation[];
|
|
65
|
+
/** Migration dependencies (tags of migrations that must run first) */
|
|
66
|
+
dependencies?: string[];
|
|
67
|
+
/** Created timestamp */
|
|
68
|
+
createdAt?: Date | string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Migration execution result
|
|
72
|
+
*/
|
|
73
|
+
export interface IMigrationResult {
|
|
74
|
+
/** Migration tag */
|
|
75
|
+
tag: string;
|
|
76
|
+
/** Execution status */
|
|
77
|
+
status: MigrationStatus;
|
|
78
|
+
/** Direction executed */
|
|
79
|
+
direction: MigrationDirection;
|
|
80
|
+
/** Executed at timestamp */
|
|
81
|
+
executedAt: Date | string;
|
|
82
|
+
/** Duration in milliseconds */
|
|
83
|
+
duration?: number;
|
|
84
|
+
/** Error message (if failed) */
|
|
85
|
+
error?: string;
|
|
86
|
+
/** SQL statements executed */
|
|
87
|
+
statements?: string[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Migration history entry
|
|
91
|
+
*/
|
|
92
|
+
export interface IMigrationHistory {
|
|
93
|
+
/** Migration tag */
|
|
94
|
+
tag: string;
|
|
95
|
+
/** Migration name */
|
|
96
|
+
name: string;
|
|
97
|
+
/** Environment slug (optional if connection is already established) */
|
|
98
|
+
env?: string;
|
|
99
|
+
/** Product tag (optional if connection is already established) */
|
|
100
|
+
product?: string;
|
|
101
|
+
/** Database tag (optional if connection is already established) */
|
|
102
|
+
database?: string;
|
|
103
|
+
/** Status */
|
|
104
|
+
status: MigrationStatus;
|
|
105
|
+
/** Last direction executed */
|
|
106
|
+
direction: MigrationDirection;
|
|
107
|
+
/** Applied at timestamp */
|
|
108
|
+
appliedAt: Date | string;
|
|
109
|
+
/** Duration in milliseconds */
|
|
110
|
+
duration?: number;
|
|
111
|
+
/** Error details (if failed) */
|
|
112
|
+
error?: {
|
|
113
|
+
message: string;
|
|
114
|
+
stack?: string;
|
|
115
|
+
};
|
|
116
|
+
/** Batch number (for grouping migrations) */
|
|
117
|
+
batch?: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Migration generation options
|
|
121
|
+
*/
|
|
122
|
+
export interface IMigrationGenerationOptions {
|
|
123
|
+
/** Migration name */
|
|
124
|
+
name: string;
|
|
125
|
+
/** Table name (if applicable) */
|
|
126
|
+
table?: string;
|
|
127
|
+
/** Description */
|
|
128
|
+
description?: string;
|
|
129
|
+
/** Auto-generate based on schema changes */
|
|
130
|
+
autoGenerate?: boolean;
|
|
131
|
+
/** Include timestamp in filename */
|
|
132
|
+
timestamp?: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Migration execution options
|
|
136
|
+
*/
|
|
137
|
+
export interface IMigrationExecutionOptions {
|
|
138
|
+
/** Environment slug (optional if connection is already established) */
|
|
139
|
+
env?: string;
|
|
140
|
+
/** Product tag (optional if connection is already established) */
|
|
141
|
+
product?: string;
|
|
142
|
+
/** Database tag (optional if connection is already established) */
|
|
143
|
+
database?: string;
|
|
144
|
+
/** Run specific migration tag */
|
|
145
|
+
tag?: string;
|
|
146
|
+
/** Run up to specific migration */
|
|
147
|
+
to?: string;
|
|
148
|
+
/** Batch mode */
|
|
149
|
+
batch?: boolean;
|
|
150
|
+
/** Dry run (don't execute, just show what would run) */
|
|
151
|
+
dryRun?: boolean;
|
|
152
|
+
/** Force execution even if migration already ran */
|
|
153
|
+
force?: boolean;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Migration rollback options
|
|
157
|
+
*/
|
|
158
|
+
export interface IMigrationRollbackOptions {
|
|
159
|
+
/** Environment slug (optional if connection is already established) */
|
|
160
|
+
env?: string;
|
|
161
|
+
/** Product tag (optional if connection is already established) */
|
|
162
|
+
product?: string;
|
|
163
|
+
/** Database tag (optional if connection is already established) */
|
|
164
|
+
database?: string;
|
|
165
|
+
/** Rollback specific migration */
|
|
166
|
+
tag?: string;
|
|
167
|
+
/** Rollback last N migrations */
|
|
168
|
+
steps?: number;
|
|
169
|
+
/** Rollback last batch */
|
|
170
|
+
batch?: boolean;
|
|
171
|
+
/** Dry run */
|
|
172
|
+
dryRun?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Pending migration info
|
|
176
|
+
*/
|
|
177
|
+
export interface IPendingMigration {
|
|
178
|
+
/** Migration tag */
|
|
179
|
+
tag: string;
|
|
180
|
+
/** Migration name */
|
|
181
|
+
name: string;
|
|
182
|
+
/** Description */
|
|
183
|
+
description?: string;
|
|
184
|
+
/** Created at */
|
|
185
|
+
createdAt: Date | string;
|
|
186
|
+
/** Dependencies */
|
|
187
|
+
dependencies?: string[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Migration status summary
|
|
191
|
+
*/
|
|
192
|
+
export interface IMigrationStatus {
|
|
193
|
+
/** Total migrations */
|
|
194
|
+
total: number;
|
|
195
|
+
/** Completed migrations */
|
|
196
|
+
completed: number;
|
|
197
|
+
/** Pending migrations */
|
|
198
|
+
pending: number;
|
|
199
|
+
/** Failed migrations */
|
|
200
|
+
failed: number;
|
|
201
|
+
/** Last migration applied */
|
|
202
|
+
lastApplied?: IMigrationHistory;
|
|
203
|
+
/** Pending migrations list */
|
|
204
|
+
pendingMigrations: IPendingMigration[];
|
|
205
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Migration type definitions for database schema versioning
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MigrationOperationType = exports.MigrationDirection = exports.MigrationStatus = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Migration status
|
|
9
|
+
*/
|
|
10
|
+
var MigrationStatus;
|
|
11
|
+
(function (MigrationStatus) {
|
|
12
|
+
MigrationStatus["PENDING"] = "pending";
|
|
13
|
+
MigrationStatus["RUNNING"] = "running";
|
|
14
|
+
MigrationStatus["COMPLETED"] = "completed";
|
|
15
|
+
MigrationStatus["FAILED"] = "failed";
|
|
16
|
+
MigrationStatus["ROLLED_BACK"] = "rolled_back";
|
|
17
|
+
})(MigrationStatus || (exports.MigrationStatus = MigrationStatus = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Migration direction
|
|
20
|
+
*/
|
|
21
|
+
var MigrationDirection;
|
|
22
|
+
(function (MigrationDirection) {
|
|
23
|
+
MigrationDirection["UP"] = "up";
|
|
24
|
+
MigrationDirection["DOWN"] = "down";
|
|
25
|
+
})(MigrationDirection || (exports.MigrationDirection = MigrationDirection = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Migration operation type
|
|
28
|
+
*/
|
|
29
|
+
var MigrationOperationType;
|
|
30
|
+
(function (MigrationOperationType) {
|
|
31
|
+
MigrationOperationType["CREATE_TABLE"] = "create_table";
|
|
32
|
+
MigrationOperationType["DROP_TABLE"] = "drop_table";
|
|
33
|
+
MigrationOperationType["ALTER_TABLE"] = "alter_table";
|
|
34
|
+
MigrationOperationType["ADD_COLUMN"] = "add_column";
|
|
35
|
+
MigrationOperationType["DROP_COLUMN"] = "drop_column";
|
|
36
|
+
MigrationOperationType["MODIFY_COLUMN"] = "modify_column";
|
|
37
|
+
MigrationOperationType["RENAME_COLUMN"] = "rename_column";
|
|
38
|
+
MigrationOperationType["ADD_INDEX"] = "add_index";
|
|
39
|
+
MigrationOperationType["DROP_INDEX"] = "drop_index";
|
|
40
|
+
MigrationOperationType["ADD_CONSTRAINT"] = "add_constraint";
|
|
41
|
+
MigrationOperationType["DROP_CONSTRAINT"] = "drop_constraint";
|
|
42
|
+
MigrationOperationType["RAW_SQL"] = "raw_sql";
|
|
43
|
+
})(MigrationOperationType || (exports.MigrationOperationType = MigrationOperationType = {}));
|
|
44
|
+
//# sourceMappingURL=migration.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.types.js","sourceRoot":"","sources":["../../../src/database/types/migration.types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACH,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,8CAA2B,CAAA;AAC7B,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED;;GAEG;AACH,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+BAAS,CAAA;IACT,mCAAa,CAAA;AACf,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED;;GAEG;AACH,IAAY,sBAaX;AAbD,WAAY,sBAAsB;IAChC,uDAA6B,CAAA;IAC7B,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAC3B,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAC3B,yDAA+B,CAAA;IAC/B,yDAA+B,CAAA;IAC/B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,2DAAiC,CAAA;IACjC,6DAAmC,CAAA;IACnC,6CAAmB,CAAA;AACrB,CAAC,EAbW,sBAAsB,sCAAtB,sBAAsB,QAajC"}
|