@ductape/sdk 0.0.4-v43 → 0.0.4-v45

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 (40) hide show
  1. package/dist/apps/services/app.service.js +2 -72
  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 +170 -149
  32. package/dist/index.js +196 -178
  33. package/dist/index.js.map +1 -1
  34. package/dist/processor/services/processor.service.d.ts +1 -3
  35. package/dist/processor/services/processor.service.js +0 -90
  36. package/dist/processor/services/processor.service.js.map +1 -1
  37. package/dist/test/test.processor.js +1 -3
  38. package/dist/test/test.processor.js.map +1 -1
  39. package/dist/types/appBuilder.types.d.ts +1 -1
  40. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DatabaseService } from './database/database.service';
2
- import { ImportDocsTypes, IApp, IAppConstants, IAppEnv, IAppVariables, IAppWebhook, IAppWebhookEvent, ICreateAppBuilder, IProduct, IProductApp, IProductCache, IProductDatabase, IProductDatabaseAction, IProductEnv, IProductFeature, IProductJobs, IProductStorage, IProcessorInput, IActionProcessorInput, IDBActionProcessorInput, IProductMessageBroker, IProductNotification, INotificationProcessorInput, IProductNotificationTemplate, IStorageProcessorInput, IParsedSample, IRegisterWebhook, IGenerateWebhookLink, IAppAuth, IMessageBrokerPublishInput, IMessageBrokerSubscribeInput, IProductMessageBrokerTopic, IAppAction, IProductDatabaseMigration, LogQueryParams, IProductQuota, FetchRemoteCachePayload, IFileReadResult, IProductSession, ISessionInput, IActionUpdate, IProductFallback, IFetchFilesPayload, ISessionPayload, ISessionRefreshPayload, IFetchUsersPayload, IProductAppHealth } from './types';
2
+ import { ImportDocsTypes, IApp, IAppConstants, IAppEnv, IAppVariables, IAppWebhook, IAppWebhookEvent, ICreateAppBuilder, IProduct, IProductApp, IProductCache, IProductDatabase, IProductDatabaseAction, IProductEnv, IProductFeature, IProductJobs, IProductStorage, IProcessorInput, IActionProcessorInput, IDBActionProcessorInput, IProductMessageBroker, IProductNotification, INotificationProcessorInput, IProductNotificationTemplate, IStorageProcessorInput, IParsedSample, IGenerateWebhookLink, IAppAuth, IMessageBrokerPublishInput, IMessageBrokerSubscribeInput, IProductMessageBrokerTopic, IAppAction, IProductDatabaseMigration, LogQueryParams, IProductQuota, FetchRemoteCachePayload, IFileReadResult, IProductSession, ISessionInput, IActionUpdate, IProductFallback, IFetchFilesPayload, ISessionPayload, ISessionRefreshPayload, IFetchUsersPayload, IProductAppHealth } from './types';
3
3
  import { IDuctapeInit } from './types/index.types';
4
4
  import { PublicStates } from './types/enums';
5
5
  /**
@@ -370,12 +370,6 @@ export default class Ductape implements IDuctape {
370
370
  * @returns {Promise<IAppWebhook[]>} The list of webhooks.
371
371
  */
372
372
  fetchAll: (accessTag: string) => Promise<IAppWebhook[]>;
373
- /**
374
- * Enables a webhook for an app.
375
- * @param {IRegisterWebhook} data - The webhook registration data.
376
- * @returns {Promise<void>} Resolves when the webhook is enabled. Throws on error.
377
- */
378
- enable: (data: IRegisterWebhook) => Promise<void>;
379
373
  /**
380
374
  * Generates a webhook link for an app.
381
375
  * @param {IGenerateWebhookLink} data - The webhook link data.
@@ -1055,25 +1049,177 @@ export default class Ductape implements IDuctape {
1055
1049
  validation: (selector: string, update: Partial<IParsedSample>) => Promise<void>;
1056
1050
  };
1057
1051
  /**
1058
- * Processor-related operations for running jobs, actions, database actions, sessions, features, quotas, fallbacks, notifications, storage, and message broker.
1052
+ * Job-related operations for scheduling jobs.
1053
+ */
1054
+ job: {
1055
+ /**
1056
+ * Schedules a job for a product.
1057
+ * @param {IProduct} data - The product data.
1058
+ * @returns {Promise<any>} The result of the job scheduling.
1059
+ */
1060
+ schedule: (data: IProduct) => Promise<void>;
1061
+ };
1062
+ /**
1063
+ * Action-related operations for running actions.
1064
+ */
1065
+ action: {
1066
+ /**
1067
+ * Runs an action processor.
1068
+ * @param {IActionProcessorInput} data - The action processor input.
1069
+ * @returns {Promise<any>} The result of the action processing.
1070
+ */
1071
+ run: (data: IActionProcessorInput) => Promise<any>;
1072
+ };
1073
+ /**
1074
+ * Session-related operations for creating, validating, and refreshing sessions.
1075
+ */
1076
+ sessions: {
1077
+ /**
1078
+ * Starts a new session.
1079
+ * @param {ISessionInput} data - The session input data.
1080
+ * @returns {Promise<any>} The result of the session generation.
1081
+ */
1082
+ create: (data: ISessionInput) => Promise<import("./types").ISessionOutput>;
1083
+ /**
1084
+ * Decrypts a session.
1085
+ * @param {ISessionPayload} data - The session payload.
1086
+ * @returns {Promise<any>} The decrypted session.
1087
+ */
1088
+ validate: (data: ISessionPayload) => Promise<any>;
1089
+ /**
1090
+ * Refreshes a session.
1091
+ * @param {ISessionRefreshPayload} data - The session refresh payload.
1092
+ * @returns {Promise<any>} The refreshed session.
1093
+ */
1094
+ refresh: (data: ISessionRefreshPayload) => Promise<import("./types").ISessionOutput>;
1095
+ };
1096
+ /**
1097
+ * Feature-related operations for running, replaying, and resuming features.
1098
+ */
1099
+ feature: {
1100
+ /**
1101
+ * Runs a feature processor.
1102
+ * @param {IProcessorInput} data - The feature processor input.
1103
+ * @returns {Promise<any>} The result of the feature processing.
1104
+ */
1105
+ run: (data: IProcessorInput) => Promise<{
1106
+ process_id: string;
1107
+ }>;
1108
+ /**
1109
+ * Generates output for a process by ID.
1110
+ * @param {string} process_id - The process ID.
1111
+ * @returns {Promise<any>} The generated output.
1112
+ */
1113
+ output: (process_id: string) => Promise<{
1114
+ process_id: string;
1115
+ status: import("./types").LogEventStatus;
1116
+ data: Record<string, unknown>;
1117
+ errors?: undefined;
1118
+ } | {
1119
+ process_id: string;
1120
+ status: import("./types").LogEventStatus;
1121
+ errors: string[];
1122
+ data?: undefined;
1123
+ } | {
1124
+ process_id: string;
1125
+ status: import("./types").LogEventStatus;
1126
+ data?: undefined;
1127
+ errors?: undefined;
1128
+ }>;
1129
+ /**
1130
+ * Replays a process by ID.
1131
+ * @param {string} process_id - The process ID.
1132
+ * @returns {Promise<any>} The result of the replay.
1133
+ */
1134
+ replay: (process_id: string) => Promise<{
1135
+ process_id: string;
1136
+ }>;
1137
+ /**
1138
+ * Resumes a process by ID.
1139
+ * @param {string} process_id - The process ID.
1140
+ * @returns {Promise<any>} The result of the resume.
1141
+ */
1142
+ resume: (process_id: string) => Promise<{
1143
+ process_id: string;
1144
+ }>;
1145
+ };
1146
+ /**
1147
+ * Quota-related operations for running quota processors.
1148
+ */
1149
+ quota: {
1150
+ /**
1151
+ * Runs a quota processor.
1152
+ * @param {IProcessorInput} data - The quota processor input.
1153
+ * @returns {Promise<any>} The result of the quota processing.
1154
+ */
1155
+ run: (data: IProcessorInput) => Promise<any>;
1156
+ };
1157
+ /**
1158
+ * Fallback-related operations for running fallback processors.
1159
+ */
1160
+ fallback: {
1161
+ /**
1162
+ * Runs a fallback processor.
1163
+ * @param {IProcessorInput} data - The fallback processor input.
1164
+ * @returns {Promise<any>} The result of the fallback processing.
1165
+ */
1166
+ run: (data: IProcessorInput) => Promise<any>;
1167
+ };
1168
+ /**
1169
+ * Notification-related operations for sending notifications.
1170
+ */
1171
+ notification: {
1172
+ /**
1173
+ * Sends a notification using the notification processor.
1174
+ * @param {INotificationProcessorInput} data - The notification processor input.
1175
+ * @returns {Promise<any>} The result of the notification processing.
1176
+ */
1177
+ send: (data: INotificationProcessorInput) => Promise<{
1178
+ process_id: string;
1179
+ }>;
1180
+ };
1181
+ /**
1182
+ * Storage-related operations for reading and saving files.
1183
+ */
1184
+ storage: {
1185
+ /**
1186
+ * Reads a file from storage.
1187
+ * @param {string} path - The file path.
1188
+ * @returns {Promise<IFileReadResult>} The file read result.
1189
+ */
1190
+ read: (path: string) => Promise<IFileReadResult>;
1191
+ /**
1192
+ * Saves data to storage using the storage processor.
1193
+ * @param {IStorageProcessorInput} data - The storage processor input.
1194
+ * @returns {Promise<any>} The result of the storage processing.
1195
+ */
1196
+ save: (data: IStorageProcessorInput) => Promise<any>;
1197
+ };
1198
+ /**
1199
+ * Message broker-related operations for publishing and subscribing to topics.
1200
+ */
1201
+ broker: {
1202
+ /**
1203
+ * Publishes a message using the message broker processor.
1204
+ * @param {IMessageBrokerPublishInput} data - The publish input.
1205
+ * @returns {Promise<any>} The result of the publish operation.
1206
+ */
1207
+ publish: (data: IMessageBrokerPublishInput) => Promise<void | {
1208
+ process_id: string;
1209
+ }>;
1210
+ /**
1211
+ * Subscribes to a message broker topic.
1212
+ * @param {IMessageBrokerSubscribeInput} data - The subscribe input.
1213
+ * @returns {Promise<any>} The result of the subscribe operation.
1214
+ */
1215
+ subcribe: (data: IMessageBrokerSubscribeInput) => Promise<void | {
1216
+ process_id: string;
1217
+ }>;
1218
+ };
1219
+ /**
1220
+ * Processor-related operations for database actions only.
1059
1221
  */
1060
1222
  processor: {
1061
- job: {
1062
- /**
1063
- * Schedules a job for a product.
1064
- * @param {IProduct} data - The product data.
1065
- * @returns {Promise<any>} The result of the job scheduling.
1066
- */
1067
- schedule: (data: IProduct) => Promise<void>;
1068
- };
1069
- action: {
1070
- /**
1071
- * Runs an action processor.
1072
- * @param {IActionProcessorInput} data - The action processor input.
1073
- * @returns {Promise<any>} The result of the action processing.
1074
- */
1075
- run: (data: IActionProcessorInput) => Promise<any>;
1076
- };
1077
1223
  db: {
1078
1224
  /**
1079
1225
  * Executes a database action processor.
@@ -1114,131 +1260,6 @@ export default class Ductape implements IDuctape {
1114
1260
  }>;
1115
1261
  };
1116
1262
  };
1117
- sessions: {
1118
- /**
1119
- * Starts a new session.
1120
- * @param {ISessionInput} data - The session input data.
1121
- * @returns {Promise<any>} The result of the session generation.
1122
- */
1123
- start: (data: ISessionInput) => Promise<import("./types").ISessionOutput>;
1124
- /**
1125
- * Decrypts a session.
1126
- * @param {ISessionPayload} data - The session payload.
1127
- * @returns {Promise<any>} The decrypted session.
1128
- */
1129
- decrypt: (data: ISessionPayload) => Promise<any>;
1130
- /**
1131
- * Refreshes a session.
1132
- * @param {ISessionRefreshPayload} data - The session refresh payload.
1133
- * @returns {Promise<any>} The refreshed session.
1134
- */
1135
- refresh: (data: ISessionRefreshPayload) => Promise<import("./types").ISessionOutput>;
1136
- };
1137
- feature: {
1138
- /**
1139
- * Runs a feature processor.
1140
- * @param {IProcessorInput} data - The feature processor input.
1141
- * @returns {Promise<any>} The result of the feature processing.
1142
- */
1143
- run: (data: IProcessorInput) => Promise<{
1144
- process_id: string;
1145
- }>;
1146
- /**
1147
- * Generates output for a process by ID.
1148
- * @param {string} process_id - The process ID.
1149
- * @returns {Promise<any>} The generated output.
1150
- */
1151
- output: (process_id: string) => Promise<{
1152
- process_id: string;
1153
- status: import("./types").LogEventStatus;
1154
- data: Record<string, unknown>;
1155
- errors?: undefined;
1156
- } | {
1157
- process_id: string;
1158
- status: import("./types").LogEventStatus;
1159
- errors: string[];
1160
- data?: undefined;
1161
- } | {
1162
- process_id: string;
1163
- status: import("./types").LogEventStatus;
1164
- data?: undefined;
1165
- errors?: undefined;
1166
- }>;
1167
- /**
1168
- * Replays a process by ID.
1169
- * @param {string} process_id - The process ID.
1170
- * @returns {Promise<any>} The result of the replay.
1171
- */
1172
- replay: (process_id: string) => Promise<{
1173
- process_id: string;
1174
- }>;
1175
- /**
1176
- * Resumes a process by ID.
1177
- * @param {string} process_id - The process ID.
1178
- * @returns {Promise<any>} The result of the resume.
1179
- */
1180
- resume: (process_id: string) => Promise<{
1181
- process_id: string;
1182
- }>;
1183
- };
1184
- quota: {
1185
- /**
1186
- * Runs a quota processor.
1187
- * @param {IProcessorInput} data - The quota processor input.
1188
- * @returns {Promise<any>} The result of the quota processing.
1189
- */
1190
- run: (data: IProcessorInput) => Promise<any>;
1191
- };
1192
- fallback: {
1193
- /**
1194
- * Runs a fallback processor.
1195
- * @param {IProcessorInput} data - The fallback processor input.
1196
- * @returns {Promise<any>} The result of the fallback processing.
1197
- */
1198
- run: (data: IProcessorInput) => Promise<any>;
1199
- };
1200
- notification: {
1201
- /**
1202
- * Sends a notification using the notification processor.
1203
- * @param {INotificationProcessorInput} data - The notification processor input.
1204
- * @returns {Promise<any>} The result of the notification processing.
1205
- */
1206
- send: (data: INotificationProcessorInput) => Promise<{
1207
- process_id: string;
1208
- }>;
1209
- };
1210
- storage: {
1211
- /**
1212
- * Reads a file from storage.
1213
- * @param {string} path - The file path.
1214
- * @returns {Promise<IFileReadResult>} The file read result.
1215
- */
1216
- readFile: (path: string) => Promise<IFileReadResult>;
1217
- /**
1218
- * Saves data to storage using the storage processor.
1219
- * @param {IStorageProcessorInput} data - The storage processor input.
1220
- * @returns {Promise<any>} The result of the storage processing.
1221
- */
1222
- save: (data: IStorageProcessorInput) => Promise<any>;
1223
- };
1224
- messageBroker: {
1225
- /**
1226
- * Publishes a message using the message broker processor.
1227
- * @param {IMessageBrokerPublishInput} data - The publish input.
1228
- * @returns {Promise<any>} The result of the publish operation.
1229
- */
1230
- publish: (data: IMessageBrokerPublishInput) => Promise<void | {
1231
- process_id: string;
1232
- }>;
1233
- /**
1234
- * Subscribes to a message broker topic.
1235
- * @param {IMessageBrokerSubscribeInput} data - The subscribe input.
1236
- * @returns {Promise<any>} The result of the subscribe operation.
1237
- */
1238
- subcribe: (data: IMessageBrokerSubscribeInput) => Promise<void | {
1239
- process_id: string;
1240
- }>;
1241
- };
1242
1263
  };
1243
1264
  /**
1244
1265
  * Database operations for querying, inserting, updating, and managing databases.