@ductape/sdk 0.0.4-v43 → 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.
Files changed (39) hide show
  1. package/dist/apps/services/app.service.js +16 -69
  2. package/dist/apps/services/app.service.js.map +1 -1
  3. package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +1 -2
  4. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +2 -15
  5. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
  6. package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +1 -2
  7. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +2 -14
  8. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
  9. package/dist/database/adapters/dynamodb.adapter.d.ts +8 -0
  10. package/dist/database/adapters/dynamodb.adapter.js +243 -11
  11. package/dist/database/adapters/dynamodb.adapter.js.map +1 -1
  12. package/dist/database/adapters/mongodb.adapter.d.ts +1 -0
  13. package/dist/database/adapters/mongodb.adapter.js +170 -5
  14. package/dist/database/adapters/mongodb.adapter.js.map +1 -1
  15. package/dist/database/adapters/mysql.adapter.d.ts +5 -0
  16. package/dist/database/adapters/mysql.adapter.js +215 -19
  17. package/dist/database/adapters/mysql.adapter.js.map +1 -1
  18. package/dist/database/adapters/postgresql.adapter.d.ts +5 -0
  19. package/dist/database/adapters/postgresql.adapter.js +199 -15
  20. package/dist/database/adapters/postgresql.adapter.js.map +1 -1
  21. package/dist/database/database.service.d.ts +5 -0
  22. package/dist/database/database.service.js +45 -95
  23. package/dist/database/database.service.js.map +1 -1
  24. package/dist/database/types/aggregation.types.d.ts +28 -28
  25. package/dist/database/types/database.types.d.ts +2 -1
  26. package/dist/database/types/database.types.js +1 -0
  27. package/dist/database/types/database.types.js.map +1 -1
  28. package/dist/database/types/index.types.d.ts +20 -20
  29. package/dist/database/types/migration.types.d.ts +12 -12
  30. package/dist/database/types/query.types.d.ts +59 -28
  31. package/dist/index.d.ts +169 -142
  32. package/dist/index.js +196 -169
  33. package/dist/index.js.map +1 -1
  34. package/dist/processor/services/processor.service.js +51 -35
  35. package/dist/processor/services/processor.service.js.map +1 -1
  36. package/dist/test/test.processor.js +1 -3
  37. package/dist/test/test.processor.js.map +1 -1
  38. package/dist/types/appBuilder.types.d.ts +1 -1
  39. package/package.json +1 -1
@@ -34,11 +34,11 @@ export interface IAggregationOperation {
34
34
  export interface ICountOptions {
35
35
  /** Table/Collection name */
36
36
  table: string;
37
- /** Environment slug */
38
- env: string;
39
- /** Product tag */
37
+ /** Environment slug (optional if connection is already established) */
38
+ env?: string;
39
+ /** Product tag (optional if connection is already established) */
40
40
  product?: string;
41
- /** Database tag */
41
+ /** Database tag (optional if connection is already established) */
42
42
  database?: string;
43
43
  /** Where clause */
44
44
  where?: WhereClause;
@@ -53,11 +53,11 @@ export interface ICountOptions {
53
53
  export interface ISumOptions {
54
54
  /** Table/Collection name */
55
55
  table: string;
56
- /** Environment slug */
57
- env: string;
58
- /** Product tag */
56
+ /** Environment slug (optional if connection is already established) */
57
+ env?: string;
58
+ /** Product tag (optional if connection is already established) */
59
59
  product?: string;
60
- /** Database tag */
60
+ /** Database tag (optional if connection is already established) */
61
61
  database?: string;
62
62
  /** Column to sum */
63
63
  column: string;
@@ -70,11 +70,11 @@ export interface ISumOptions {
70
70
  export interface IAvgOptions {
71
71
  /** Table/Collection name */
72
72
  table: string;
73
- /** Environment slug */
74
- env: string;
75
- /** Product tag */
73
+ /** Environment slug (optional if connection is already established) */
74
+ env?: string;
75
+ /** Product tag (optional if connection is already established) */
76
76
  product?: string;
77
- /** Database tag */
77
+ /** Database tag (optional if connection is already established) */
78
78
  database?: string;
79
79
  /** Column to average */
80
80
  column: string;
@@ -87,11 +87,11 @@ export interface IAvgOptions {
87
87
  export interface IMinOptions {
88
88
  /** Table/Collection name */
89
89
  table: string;
90
- /** Environment slug */
91
- env: string;
92
- /** Product tag */
90
+ /** Environment slug (optional if connection is already established) */
91
+ env?: string;
92
+ /** Product tag (optional if connection is already established) */
93
93
  product?: string;
94
- /** Database tag */
94
+ /** Database tag (optional if connection is already established) */
95
95
  database?: string;
96
96
  /** Column to find minimum */
97
97
  column: string;
@@ -104,11 +104,11 @@ export interface IMinOptions {
104
104
  export interface IMaxOptions {
105
105
  /** Table/Collection name */
106
106
  table: string;
107
- /** Environment slug */
108
- env: string;
109
- /** Product tag */
107
+ /** Environment slug (optional if connection is already established) */
108
+ env?: string;
109
+ /** Product tag (optional if connection is already established) */
110
110
  product?: string;
111
- /** Database tag */
111
+ /** Database tag (optional if connection is already established) */
112
112
  database?: string;
113
113
  /** Column to find maximum */
114
114
  column: string;
@@ -121,11 +121,11 @@ export interface IMaxOptions {
121
121
  export interface IGroupByOptions {
122
122
  /** Table/Collection name */
123
123
  table: string;
124
- /** Environment slug */
125
- env: string;
126
- /** Product tag */
124
+ /** Environment slug (optional if connection is already established) */
125
+ env?: string;
126
+ /** Product tag (optional if connection is already established) */
127
127
  product?: string;
128
- /** Database tag */
128
+ /** Database tag (optional if connection is already established) */
129
129
  database?: string;
130
130
  /** Columns to group by */
131
131
  groupBy: string[];
@@ -148,11 +148,11 @@ export interface IGroupByOptions {
148
148
  export interface IAggregateOptions {
149
149
  /** Table/Collection name */
150
150
  table: string;
151
- /** Environment slug */
152
- env: string;
153
- /** Product tag */
151
+ /** Environment slug (optional if connection is already established) */
152
+ env?: string;
153
+ /** Product tag (optional if connection is already established) */
154
154
  product?: string;
155
- /** Database tag */
155
+ /** Database tag (optional if connection is already established) */
156
156
  database?: string;
157
157
  /** Aggregation operations */
158
158
  operations: Record<string, IAggregationOperation>;
@@ -84,7 +84,8 @@ export declare enum DatabaseErrorType {
84
84
  VALIDATION_ERROR = "validation_error",
85
85
  MIGRATION_ERROR = "migration_error",
86
86
  SCHEMA_ERROR = "schema_error",
87
- INDEX_ERROR = "index_error"
87
+ INDEX_ERROR = "index_error",
88
+ TRANSACTION_ERROR = "TRANSACTION_ERROR"
88
89
  }
89
90
  /**
90
91
  * Database error class
@@ -37,6 +37,7 @@ var DatabaseErrorType;
37
37
  DatabaseErrorType["MIGRATION_ERROR"] = "migration_error";
38
38
  DatabaseErrorType["SCHEMA_ERROR"] = "schema_error";
39
39
  DatabaseErrorType["INDEX_ERROR"] = "index_error";
40
+ DatabaseErrorType["TRANSACTION_ERROR"] = "TRANSACTION_ERROR";
40
41
  })(DatabaseErrorType || (exports.DatabaseErrorType = DatabaseErrorType = {}));
41
42
  /**
42
43
  * Database error class
@@ -1 +1 @@
1
- {"version":3,"file":"database.types.js","sourceRoot":"","sources":["../../../src/database/types/database.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,6CAAyB,CAAA;IACzB,2CAAuB,CAAA;IACvB,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAiED;;GAEG;AACH,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,gDAA2B,CAAA;IAC3B,0DAAqC,CAAA;IACrC,wDAAmC,CAAA;IACnC,kDAA6B,CAAA;IAC7B,gDAA2B,CAAA;AAC7B,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IACtC,YACS,IAAuB,EAC9B,OAAe,EACR,aAAqB;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAmB;QAEvB,kBAAa,GAAb,aAAa,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AATD,sCASC;AAED;;GAEG;AACH,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,kEAAqC,CAAA;IACrC,8DAAiC,CAAA;IACjC,gEAAmC,CAAA;IACnC,0DAA6B,CAAA;AAC/B,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC;AAED;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,sCAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B"}
1
+ {"version":3,"file":"database.types.js","sourceRoot":"","sources":["../../../src/database/types/database.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,6CAAyB,CAAA;IACzB,2CAAuB,CAAA;IACvB,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAiED;;GAEG;AACH,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,gDAA2B,CAAA;IAC3B,0DAAqC,CAAA;IACrC,wDAAmC,CAAA;IACnC,kDAA6B,CAAA;IAC7B,gDAA2B,CAAA;IAC3B,4DAAuC,CAAA;AACzC,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IACtC,YACS,IAAuB,EAC9B,OAAe,EACR,aAAqB;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAmB;QAEvB,kBAAa,GAAb,aAAa,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AATD,sCASC;AAED;;GAEG;AACH,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,kEAAqC,CAAA;IACrC,8DAAiC,CAAA;IACjC,gEAAmC,CAAA;IACnC,0DAA6B,CAAA;AAC/B,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC;AAED;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,sCAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B"}
@@ -64,11 +64,11 @@ export interface IIndexDefinition {
64
64
  export interface ICreateIndexOptions {
65
65
  /** Table name */
66
66
  table: string;
67
- /** Environment slug */
68
- env: string;
69
- /** Product tag */
67
+ /** Environment slug (optional if connection is already established) */
68
+ env?: string;
69
+ /** Product tag (optional if connection is already established) */
70
70
  product?: string;
71
- /** Database tag */
71
+ /** Database tag (optional if connection is already established) */
72
72
  database?: string;
73
73
  /** Index definition */
74
74
  index: IIndexDefinition;
@@ -87,11 +87,11 @@ export interface IDropIndexOptions {
87
87
  indexName: string;
88
88
  /** Table name */
89
89
  table: string;
90
- /** Environment slug */
91
- env: string;
92
- /** Product tag */
90
+ /** Environment slug (optional if connection is already established) */
91
+ env?: string;
92
+ /** Product tag (optional if connection is already established) */
93
93
  product?: string;
94
- /** Database tag */
94
+ /** Database tag (optional if connection is already established) */
95
95
  database?: string;
96
96
  /** Drop if exists */
97
97
  ifExists?: boolean;
@@ -108,11 +108,11 @@ export interface IDropIndexOptions {
108
108
  export interface IListIndexesOptions {
109
109
  /** Table name */
110
110
  table: string;
111
- /** Environment slug */
112
- env: string;
113
- /** Product tag */
111
+ /** Environment slug (optional if connection is already established) */
112
+ env?: string;
113
+ /** Product tag (optional if connection is already established) */
114
114
  product?: string;
115
- /** Database tag */
115
+ /** Database tag (optional if connection is already established) */
116
116
  database?: string;
117
117
  /** Include system indexes */
118
118
  includeSystem?: boolean;
@@ -179,11 +179,11 @@ export interface IAnalyzeIndexOptions {
179
179
  indexName?: string;
180
180
  /** Table name */
181
181
  table: string;
182
- /** Environment slug */
183
- env: string;
184
- /** Product tag */
182
+ /** Environment slug (optional if connection is already established) */
183
+ env?: string;
184
+ /** Product tag (optional if connection is already established) */
185
185
  product?: string;
186
- /** Database tag */
186
+ /** Database tag (optional if connection is already established) */
187
187
  database?: string;
188
188
  }
189
189
  /**
@@ -194,11 +194,11 @@ export interface IRebuildIndexOptions {
194
194
  indexName: string;
195
195
  /** Table name */
196
196
  table: string;
197
- /** Environment slug */
198
- env: string;
199
- /** Product tag */
197
+ /** Environment slug (optional if connection is already established) */
198
+ env?: string;
199
+ /** Product tag (optional if connection is already established) */
200
200
  product?: string;
201
- /** Database tag */
201
+ /** Database tag (optional if connection is already established) */
202
202
  database?: string;
203
203
  /** Rebuild concurrently (PostgreSQL) */
204
204
  concurrent?: boolean;
@@ -94,11 +94,11 @@ export interface IMigrationHistory {
94
94
  tag: string;
95
95
  /** Migration name */
96
96
  name: string;
97
- /** Environment slug */
98
- env: string;
99
- /** Product tag */
97
+ /** Environment slug (optional if connection is already established) */
98
+ env?: string;
99
+ /** Product tag (optional if connection is already established) */
100
100
  product?: string;
101
- /** Database tag */
101
+ /** Database tag (optional if connection is already established) */
102
102
  database?: string;
103
103
  /** Status */
104
104
  status: MigrationStatus;
@@ -135,11 +135,11 @@ export interface IMigrationGenerationOptions {
135
135
  * Migration execution options
136
136
  */
137
137
  export interface IMigrationExecutionOptions {
138
- /** Environment slug */
139
- env: string;
140
- /** Product tag */
138
+ /** Environment slug (optional if connection is already established) */
139
+ env?: string;
140
+ /** Product tag (optional if connection is already established) */
141
141
  product?: string;
142
- /** Database tag */
142
+ /** Database tag (optional if connection is already established) */
143
143
  database?: string;
144
144
  /** Run specific migration tag */
145
145
  tag?: string;
@@ -156,11 +156,11 @@ export interface IMigrationExecutionOptions {
156
156
  * Migration rollback options
157
157
  */
158
158
  export interface IMigrationRollbackOptions {
159
- /** Environment slug */
160
- env: string;
161
- /** Product tag */
159
+ /** Environment slug (optional if connection is already established) */
160
+ env?: string;
161
+ /** Product tag (optional if connection is already established) */
162
162
  product?: string;
163
- /** Database tag */
163
+ /** Database tag (optional if connection is already established) */
164
164
  database?: string;
165
165
  /** Rollback specific migration */
166
166
  tag?: string;
@@ -110,17 +110,46 @@ export interface IPagination {
110
110
  /** Page size (alternative to limit) */
111
111
  pageSize?: number;
112
112
  }
113
+ /**
114
+ * Include options for relationship lookups
115
+ */
116
+ export interface IInclude {
117
+ /** Relationship name/table to include */
118
+ relation: string;
119
+ /** Fields to select from the related table */
120
+ select?: string[];
121
+ /** Where clause for the related table */
122
+ where?: WhereClause;
123
+ /** Nested includes (for deep relationships) */
124
+ include?: IInclude | IInclude[];
125
+ /** Limit results from the relationship */
126
+ limit?: number;
127
+ /** Order results from the relationship */
128
+ orderBy?: IOrderBy | IOrderBy[];
129
+ /** Foreign key column in the main table (defaults to relation_id) */
130
+ foreignKey?: string;
131
+ /** Primary key column in the related table (defaults to id) */
132
+ primaryKey?: string;
133
+ /** Relationship type */
134
+ type?: 'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many';
135
+ /** For many-to-many: junction table name */
136
+ through?: string;
137
+ /** For many-to-many: foreign key in junction table pointing to main table */
138
+ throughForeignKey?: string;
139
+ /** For many-to-many: foreign key in junction table pointing to related table */
140
+ throughRelatedKey?: string;
141
+ }
113
142
  /**
114
143
  * Query options
115
144
  */
116
145
  export interface IQueryOptions {
117
146
  /** Table/Collection name */
118
147
  table: string;
119
- /** Environment slug */
120
- env: string;
121
- /** Product tag */
148
+ /** Environment slug (optional if connection is already established) */
149
+ env?: string;
150
+ /** Product tag (optional if connection is already established) */
122
151
  product?: string;
123
- /** Database tag */
152
+ /** Database tag (optional if connection is already established) */
124
153
  database?: string;
125
154
  /** Columns to select (empty for all) */
126
155
  select?: string[];
@@ -134,6 +163,8 @@ export interface IQueryOptions {
134
163
  offset?: number;
135
164
  /** Joins (SQL only) */
136
165
  joins?: IJoinClause[];
166
+ /** Include related data (relationship lookups) */
167
+ include?: IInclude | IInclude[];
137
168
  /** Group by columns */
138
169
  groupBy?: string[];
139
170
  /** Having clause (for grouped queries) */
@@ -149,11 +180,11 @@ export interface IQueryOptions {
149
180
  export interface IInsertOptions {
150
181
  /** Table/Collection name */
151
182
  table: string;
152
- /** Environment slug */
153
- env: string;
154
- /** Product tag */
183
+ /** Environment slug (optional if connection is already established) */
184
+ env?: string;
185
+ /** Product tag (optional if connection is already established) */
155
186
  product?: string;
156
- /** Database tag */
187
+ /** Database tag (optional if connection is already established) */
157
188
  database?: string;
158
189
  /** Data to insert (single record or array) */
159
190
  data: Record<string, any> | Record<string, any>[];
@@ -179,11 +210,11 @@ export interface IInsertOptions {
179
210
  export interface IUpdateOptions {
180
211
  /** Table/Collection name */
181
212
  table: string;
182
- /** Environment slug */
183
- env: string;
184
- /** Product tag */
213
+ /** Environment slug (optional if connection is already established) */
214
+ env?: string;
215
+ /** Product tag (optional if connection is already established) */
185
216
  product?: string;
186
- /** Database tag */
217
+ /** Database tag (optional if connection is already established) */
187
218
  database?: string;
188
219
  /** Data to update */
189
220
  data: Record<string, any>;
@@ -202,11 +233,11 @@ export interface IUpdateOptions {
202
233
  export interface IDeleteOptions {
203
234
  /** Table/Collection name */
204
235
  table: string;
205
- /** Environment slug */
206
- env: string;
207
- /** Product tag */
236
+ /** Environment slug (optional if connection is already established) */
237
+ env?: string;
238
+ /** Product tag (optional if connection is already established) */
208
239
  product?: string;
209
- /** Database tag */
240
+ /** Database tag (optional if connection is already established) */
210
241
  database?: string;
211
242
  /** Where clause */
212
243
  where: WhereClause;
@@ -223,11 +254,11 @@ export interface IDeleteOptions {
223
254
  export interface IUpsertOptions {
224
255
  /** Table/Collection name */
225
256
  table: string;
226
- /** Environment slug */
227
- env: string;
228
- /** Product tag */
257
+ /** Environment slug (optional if connection is already established) */
258
+ env?: string;
259
+ /** Product tag (optional if connection is already established) */
229
260
  product?: string;
230
- /** Database tag */
261
+ /** Database tag (optional if connection is already established) */
231
262
  database?: string;
232
263
  /** Data to upsert */
233
264
  data: Record<string, any> | Record<string, any>[];
@@ -242,11 +273,11 @@ export interface IUpsertOptions {
242
273
  * Transaction execution options
243
274
  */
244
275
  export interface ITransactionExecutionOptions {
245
- /** Environment slug */
246
- env: string;
247
- /** Product tag */
276
+ /** Environment slug (optional if connection is already established) */
277
+ env?: string;
278
+ /** Product tag (optional if connection is already established) */
248
279
  product?: string;
249
- /** Database tag */
280
+ /** Database tag (optional if connection is already established) */
250
281
  database?: string;
251
282
  /** Isolation level */
252
283
  isolationLevel?: 'READ_UNCOMMITTED' | 'READ_COMMITTED' | 'REPEATABLE_READ' | 'SERIALIZABLE';
@@ -259,11 +290,11 @@ export interface ITransactionExecutionOptions {
259
290
  * Raw query options
260
291
  */
261
292
  export interface IRawQueryOptions {
262
- /** Environment slug */
263
- env: string;
264
- /** Product tag */
293
+ /** Environment slug (optional if connection is already established) */
294
+ env?: string;
295
+ /** Product tag (optional if connection is already established) */
265
296
  product?: string;
266
- /** Database tag */
297
+ /** Database tag (optional if connection is already established) */
267
298
  database?: string;
268
299
  /** Raw SQL/query string */
269
300
  query: string;