@friggframework/core 2.0.0-next.58 → 2.0.0-next.59

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.
@@ -235,6 +235,38 @@ function createUserCommands() {
235
235
  return mapErrorToResponse(error);
236
236
  }
237
237
  },
238
+
239
+ /**
240
+ * Delete a user by ID
241
+ * Cascades to all related records (credentials, entities, integrations, etc.)
242
+ * @param {string} userId - User ID to delete
243
+ * @returns {Promise<Object>} Deletion result
244
+ */
245
+ async deleteUserById(userId) {
246
+ try {
247
+ if (!userId) {
248
+ const error = new Error('userId is required');
249
+ error.code = 'INVALID_USER_DATA';
250
+ throw error;
251
+ }
252
+
253
+ const deleted = await userRepository.deleteUser(userId);
254
+
255
+ if (!deleted) {
256
+ const error = new Error(`User ${userId} not found`);
257
+ error.code = 'USER_NOT_FOUND';
258
+ return mapErrorToResponse(error);
259
+ }
260
+
261
+ return {
262
+ success: true,
263
+ userId,
264
+ message: 'User and all related data deleted successfully',
265
+ };
266
+ } catch (error) {
267
+ return mapErrorToResponse(error);
268
+ }
269
+ },
238
270
  };
239
271
  }
240
272
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0-next.58",
4
+ "version": "2.0.0-next.59",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -38,9 +38,9 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@friggframework/eslint-config": "2.0.0-next.58",
42
- "@friggframework/prettier-config": "2.0.0-next.58",
43
- "@friggframework/test": "2.0.0-next.58",
41
+ "@friggframework/eslint-config": "2.0.0-next.59",
42
+ "@friggframework/prettier-config": "2.0.0-next.59",
43
+ "@friggframework/test": "2.0.0-next.59",
44
44
  "@prisma/client": "^6.17.0",
45
45
  "@types/lodash": "4.17.15",
46
46
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "bfd8911703e8d407435ba89556fd9b0fde5d22ac"
83
+ "gitHead": "53a970071272e2fd89c6454742c50de367647c85"
84
84
  }