@zapier/zapier-sdk 0.113.0 → 0.114.1
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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/beta.cjs +278 -278
- package/dist/beta.d.mts +12 -12
- package/dist/beta.d.ts +12 -12
- package/dist/beta.mjs +2 -2
- package/dist/{chunk-ORPCPBJR.mjs → chunk-77ZQIJTO.mjs} +1 -1
- package/dist/{chunk-FF6YC735.cjs → chunk-AMFRFORO.cjs} +4 -4
- package/dist/{chunk-GQKHLPXO.cjs → chunk-C5EU6GM6.cjs} +58 -49
- package/dist/{chunk-UCCI3JDP.mjs → chunk-D25G6MHC.mjs} +58 -49
- package/dist/experimental.cjs +384 -384
- package/dist/experimental.d.mts +12 -12
- package/dist/experimental.d.ts +12 -12
- package/dist/experimental.mjs +4 -4
- package/dist/{index-CJoDlPxK.d.mts → index-BCJAutN8.d.mts} +17 -18
- package/dist/{index-CJoDlPxK.d.ts → index-BCJAutN8.d.ts} +17 -18
- package/dist/index.cjs +276 -276
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -2818,7 +2818,7 @@ function logRouteOverride({
|
|
|
2818
2818
|
}
|
|
2819
2819
|
|
|
2820
2820
|
// src/sdk-version.ts
|
|
2821
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
2821
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.114.1" : void 0) || "unknown";
|
|
2822
2822
|
|
|
2823
2823
|
// src/utils/open-url.ts
|
|
2824
2824
|
var nodePrefix = "node:";
|
|
@@ -5429,7 +5429,7 @@ var actionKeyResolver = defineResolver({
|
|
|
5429
5429
|
const page = await imports.listActions({ app: input.app, cursor });
|
|
5430
5430
|
return {
|
|
5431
5431
|
data: page.data.filter(
|
|
5432
|
-
(action) => action.action_type === input.actionType
|
|
5432
|
+
(action) => action.action_type === input.actionType
|
|
5433
5433
|
),
|
|
5434
5434
|
nextCursor: page.nextCursor
|
|
5435
5435
|
};
|
|
@@ -6942,6 +6942,45 @@ var actionItemFormatter = defineFormatter({
|
|
|
6942
6942
|
format: ({ item }) => formatActionItem(item)
|
|
6943
6943
|
});
|
|
6944
6944
|
|
|
6945
|
+
// src/plugins/listActions/fetch.ts
|
|
6946
|
+
async function fetchAppActions({
|
|
6947
|
+
imports,
|
|
6948
|
+
app
|
|
6949
|
+
}) {
|
|
6950
|
+
const selectedApi = await imports.manifest.getVersionedImplementationId(app);
|
|
6951
|
+
if (!selectedApi) {
|
|
6952
|
+
throw new ZapierConfigurationError(
|
|
6953
|
+
"No current_implementation_id found for app",
|
|
6954
|
+
{ configType: "current_implementation_id" }
|
|
6955
|
+
);
|
|
6956
|
+
}
|
|
6957
|
+
const data = await imports.api.get(
|
|
6958
|
+
"/zapier/api/v4/implementations/",
|
|
6959
|
+
{
|
|
6960
|
+
searchParams: {
|
|
6961
|
+
global: "true",
|
|
6962
|
+
// Include private/unlisted implementations the caller has access to.
|
|
6963
|
+
// With public_only the API drops actions on private apps, so they
|
|
6964
|
+
// surface as "unknown action" downstream (COSUB-562).
|
|
6965
|
+
public_only: "false",
|
|
6966
|
+
selected_apis: selectedApi
|
|
6967
|
+
}
|
|
6968
|
+
}
|
|
6969
|
+
);
|
|
6970
|
+
const actions = [];
|
|
6971
|
+
for (const implementation of data.results || []) {
|
|
6972
|
+
for (const action of implementation.actions ?? []) {
|
|
6973
|
+
actions.push(
|
|
6974
|
+
normalizeActionItem({
|
|
6975
|
+
...action,
|
|
6976
|
+
selected_api: action.selected_api || implementation.selected_api
|
|
6977
|
+
})
|
|
6978
|
+
);
|
|
6979
|
+
}
|
|
6980
|
+
}
|
|
6981
|
+
return { selectedApi, actions };
|
|
6982
|
+
}
|
|
6983
|
+
|
|
6945
6984
|
// src/plugins/listActions/index.ts
|
|
6946
6985
|
var listActionsPlugin = defineMethod({
|
|
6947
6986
|
name: "listActions",
|
|
@@ -6961,56 +7000,26 @@ var listActionsPlugin = defineMethod({
|
|
|
6961
7000
|
// the resolver.
|
|
6962
7001
|
resolvers: { app: appKeyResolver },
|
|
6963
7002
|
run: async ({ imports, input, annotate }) => {
|
|
6964
|
-
const api = imports.api;
|
|
6965
|
-
const getVersionedImplementationId = imports.manifest.getVersionedImplementationId;
|
|
6966
7003
|
const appKey = "app" in input ? input.app : input.appKey;
|
|
6967
|
-
const selectedApi = await
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
{ configType: "current_implementation_id" }
|
|
6972
|
-
);
|
|
6973
|
-
}
|
|
7004
|
+
const { selectedApi, actions } = await fetchAppActions({
|
|
7005
|
+
imports,
|
|
7006
|
+
app: appKey
|
|
7007
|
+
});
|
|
6974
7008
|
annotate({ selectedApi });
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
// Include private/unlisted implementations the caller has access to.
|
|
6981
|
-
// With public_only the API drops actions on private apps, so they
|
|
6982
|
-
// surface as "unknown action" downstream (COSUB-562).
|
|
6983
|
-
public_only: "false",
|
|
6984
|
-
selected_apis: selectedApi
|
|
6985
|
-
}
|
|
6986
|
-
}
|
|
6987
|
-
);
|
|
6988
|
-
let allActions = [];
|
|
6989
|
-
for (const implementation of data.results || []) {
|
|
6990
|
-
if (implementation.actions) {
|
|
6991
|
-
for (const action of implementation.actions) {
|
|
6992
|
-
allActions.push(
|
|
6993
|
-
normalizeActionItem({
|
|
6994
|
-
...action,
|
|
6995
|
-
selected_api: action.selected_api || implementation.selected_api
|
|
6996
|
-
})
|
|
6997
|
-
);
|
|
6998
|
-
}
|
|
6999
|
-
}
|
|
7000
|
-
}
|
|
7001
|
-
if (input.actionType) {
|
|
7002
|
-
allActions = allActions.filter(
|
|
7003
|
-
(action) => action.action_type === input.actionType
|
|
7004
|
-
);
|
|
7005
|
-
}
|
|
7006
|
-
return { data: allActions };
|
|
7009
|
+
return {
|
|
7010
|
+
data: actions.filter(
|
|
7011
|
+
(action) => !action.is_hidden && (!input.actionType || action.action_type === input.actionType)
|
|
7012
|
+
)
|
|
7013
|
+
};
|
|
7007
7014
|
}
|
|
7008
7015
|
});
|
|
7009
7016
|
|
|
7010
7017
|
// src/plugins/getAction/index.ts
|
|
7011
7018
|
var getActionPlugin = defineMethod({
|
|
7012
7019
|
name: "getAction",
|
|
7013
|
-
|
|
7020
|
+
// `listActionsPlugin` is here for the action-type and action-key resolvers,
|
|
7021
|
+
// which reach it through a stand-in; the lookup itself doesn't use it.
|
|
7022
|
+
imports: [listActionsPlugin, manifestPluginRef, apiPluginRef],
|
|
7014
7023
|
categories: ["action"],
|
|
7015
7024
|
itemType: "Action",
|
|
7016
7025
|
inputSchema: GetActionInputSchema,
|
|
@@ -7027,11 +7036,11 @@ var getActionPlugin = defineMethod({
|
|
|
7027
7036
|
const appKey = "app" in input ? input.app : input.appKey;
|
|
7028
7037
|
const actionKey = "action" in input ? input.action : input.actionKey;
|
|
7029
7038
|
const { actionType } = input;
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
}
|
|
7039
|
+
const { actions } = await fetchAppActions({ imports, app: appKey });
|
|
7040
|
+
const action = actions.find(
|
|
7041
|
+
(candidate) => (candidate.key === actionKey || candidate.id === actionKey) && candidate.action_type === actionType
|
|
7042
|
+
);
|
|
7043
|
+
if (action) return { data: action };
|
|
7035
7044
|
throw new ZapierResourceNotFoundError(
|
|
7036
7045
|
`Action not found: ${actionKey} with type ${actionType}`,
|
|
7037
7046
|
{ resourceType: "Action", resourceId: `${actionKey} (${actionType})` }
|