shuttlepro-shared 1.2.12 → 1.2.13
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.
|
@@ -68,7 +68,11 @@ const findIntegrationsByWorkspace = async (workspaceId, filter = {}) => {
|
|
|
68
68
|
/**
|
|
69
69
|
* Find integration by filter (supports both workspace & non-workspace).
|
|
70
70
|
*/
|
|
71
|
-
const findIntegrationByFilter = async (
|
|
71
|
+
const findIntegrationByFilter = async (
|
|
72
|
+
filter,
|
|
73
|
+
bodyFilter = {},
|
|
74
|
+
workspaceId = null
|
|
75
|
+
) => {
|
|
72
76
|
const allIntegrations = await getCachedAllIntegrations();
|
|
73
77
|
|
|
74
78
|
let filteredIntegrations = allIntegrations;
|
|
@@ -79,8 +83,12 @@ const findIntegrationByFilter = async (filter, workspaceId = null) => {
|
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
return (
|
|
82
|
-
filteredIntegrations.find(
|
|
83
|
-
|
|
86
|
+
filteredIntegrations.find(
|
|
87
|
+
(item) =>
|
|
88
|
+
Object.entries(filter).every(([key, value]) => item[key] === value) &&
|
|
89
|
+
Object.entries(bodyFilter).every(
|
|
90
|
+
([key, value]) => item.body?.[key] === value
|
|
91
|
+
)
|
|
84
92
|
) || null
|
|
85
93
|
);
|
|
86
94
|
};
|