@friggframework/core 2.0.0--canary.593.6169422.0 → 2.0.0--canary.593.29890e5.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.
@@ -25,7 +25,8 @@ const ERROR_CODE_MAP = {
25
25
  ENTITY_NOT_FOUND: 401,
26
26
  ENTITY_USER_NOT_FOUND: 401,
27
27
  INTEGRATION_NOT_FOUND: 404,
28
- EXTERNAL_ENTITY_ID_REQUIRED: 400,
28
+ EXTERNAL_ID_REQUIRED: 400,
29
+ TYPE_REQUIRED: 400,
29
30
  INTEGRATION_RECORD_NOT_FOUND: 404,
30
31
  };
31
32
 
@@ -83,14 +84,20 @@ function createIntegrationCommands({ integrationClass }) {
83
84
  });
84
85
 
85
86
  return {
86
- async findIntegrationContextByExternalEntityId(externalEntityId) {
87
+ /**
88
+ * Find integration context by external entity ID and type
89
+ * @param {Object} params
90
+ * @param {string} params.externalId - External ID of the entity
91
+ * @param {string} params.type - Integration type (config.type)
92
+ * @returns {Promise<Object>} Integration context, entity, and record
93
+ */
94
+ async findIntegrationContextByExternalEntityId({ externalId, type }) {
87
95
  try {
88
- const { context } = await findByExternalEntityIdUseCase.execute(
89
- {
90
- externalEntityId,
91
- }
92
- );
93
- return { context };
96
+ const result = await findByExternalEntityIdUseCase.execute({
97
+ externalId,
98
+ type,
99
+ });
100
+ return result;
94
101
  } catch (error) {
95
102
  return mapErrorToResponse(error);
96
103
  }
@@ -197,11 +204,12 @@ function createIntegrationCommands({ integrationClass }) {
197
204
 
198
205
  async function findIntegrationContextByExternalEntityId({
199
206
  integrationClass,
200
- externalEntityId,
207
+ externalId,
208
+ type,
201
209
  } = {}) {
202
210
  const commands = createIntegrationCommands({ integrationClass });
203
211
 
204
- return commands.findIntegrationContextByExternalEntityId(externalEntityId);
212
+ return commands.findIntegrationContextByExternalEntityId({ externalId, type });
205
213
  }
206
214
 
207
215
  module.exports = {
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--canary.593.6169422.0",
4
+ "version": "2.0.0--canary.593.29890e5.0",
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--canary.593.6169422.0",
42
- "@friggframework/prettier-config": "2.0.0--canary.593.6169422.0",
43
- "@friggframework/test": "2.0.0--canary.593.6169422.0",
41
+ "@friggframework/eslint-config": "2.0.0--canary.593.29890e5.0",
42
+ "@friggframework/prettier-config": "2.0.0--canary.593.29890e5.0",
43
+ "@friggframework/test": "2.0.0--canary.593.29890e5.0",
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": "61694220fe8bf334758c2d51a433b9fd7c740cc5"
83
+ "gitHead": "29890e55330e99deee4d7f2b43c6d5e8e44a177e"
84
84
  }