@zapier/zapier-sdk 0.9.0 → 0.10.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.
- package/CHANGELOG.md +12 -0
- package/README.md +7 -7
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +14 -0
- package/dist/api/debug.d.ts +1 -0
- package/dist/api/debug.d.ts.map +1 -1
- package/dist/api/debug.js +42 -1
- package/dist/api/debug.test.d.ts +2 -0
- package/dist/api/debug.test.d.ts.map +1 -0
- package/dist/api/debug.test.js +59 -0
- package/dist/api/schemas.d.ts +451 -251
- package/dist/api/schemas.d.ts.map +1 -1
- package/dist/api/schemas.js +51 -29
- package/dist/index.cjs +834 -563
- package/dist/index.d.mts +2287 -2085
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.mjs +832 -557
- package/dist/plugins/findFirstAuthentication/index.d.ts +1 -1
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findFirstAuthentication/index.js +9 -1
- package/dist/plugins/findFirstAuthentication/index.test.js +3 -4
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +5 -3
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.js +4 -0
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +5 -3
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +1 -1
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +10 -0
- package/dist/plugins/getAction/schemas.d.ts +5 -3
- package/dist/plugins/getAction/schemas.d.ts.map +1 -1
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +8 -0
- package/dist/plugins/getApp/index.test.js +2 -2
- package/dist/plugins/getApp/schemas.d.ts +3 -1
- package/dist/plugins/getApp/schemas.d.ts.map +1 -1
- package/dist/plugins/getApp/schemas.js +2 -4
- package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/getAuthentication/index.js +8 -0
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +4 -0
- package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
- package/dist/plugins/getProfile/schemas.js +4 -3
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +9 -0
- package/dist/plugins/listActions/schemas.d.ts +5 -3
- package/dist/plugins/listActions/schemas.d.ts.map +1 -1
- package/dist/plugins/listActions/schemas.js +2 -4
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +4 -0
- package/dist/plugins/listApps/index.test.js +1 -1
- package/dist/plugins/listApps/schemas.d.ts.map +1 -1
- package/dist/plugins/listApps/schemas.js +3 -9
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/index.js +8 -0
- package/dist/plugins/listAuthentications/schemas.d.ts +5 -3
- package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +14 -2
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +5 -3
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +10 -19
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +14 -2
- package/dist/plugins/listInputFields/index.test.js +5 -9
- package/dist/plugins/listInputFields/schemas.d.ts +5 -3
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +8 -2
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +1 -0
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +12 -0
- package/dist/plugins/runAction/schemas.d.ts +5 -3
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/resolvers/actionKey.d.ts +13 -7
- package/dist/resolvers/actionKey.d.ts.map +1 -1
- package/dist/resolvers/actionType.d.ts +8 -7
- package/dist/resolvers/actionType.d.ts.map +1 -1
- package/dist/resolvers/appKey.d.ts +2 -6
- package/dist/resolvers/appKey.d.ts.map +1 -1
- package/dist/resolvers/authenticationId.d.ts +7 -7
- package/dist/resolvers/authenticationId.d.ts.map +1 -1
- package/dist/resolvers/authenticationId.js +16 -7
- package/dist/resolvers/index.d.ts +3 -35
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +4 -87
- package/dist/resolvers/inputFieldKey.d.ts +11 -0
- package/dist/resolvers/inputFieldKey.d.ts.map +1 -0
- package/dist/resolvers/inputFieldKey.js +23 -0
- package/dist/resolvers/inputs.d.ts +11 -6
- package/dist/resolvers/inputs.d.ts.map +1 -1
- package/dist/resolvers/inputs.js +17 -0
- package/dist/schemas/Action.d.ts +8 -8
- package/dist/schemas/Action.d.ts.map +1 -1
- package/dist/schemas/Action.js +8 -3
- package/dist/schemas/App.d.ts +183 -11
- package/dist/schemas/App.d.ts.map +1 -1
- package/dist/schemas/App.js +7 -9
- package/dist/schemas/Auth.d.ts +12 -12
- package/dist/schemas/Auth.js +1 -1
- package/dist/schemas/Field.d.ts +5 -98
- package/dist/schemas/Field.d.ts.map +1 -1
- package/dist/schemas/Field.js +24 -52
- package/dist/schemas/Run.d.ts +3 -0
- package/dist/schemas/Run.d.ts.map +1 -0
- package/dist/schemas/Run.js +31 -0
- package/dist/schemas/UserProfile.d.ts +11 -11
- package/dist/schemas/UserProfile.d.ts.map +1 -1
- package/dist/schemas/UserProfile.js +21 -7
- package/dist/sdk.d.ts +11 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +5 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/properties.d.ts +3 -1
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +5 -0
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/utils/domain-utils.d.ts +1 -16
- package/dist/utils/domain-utils.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +7 -51
- package/dist/utils/schema-utils.d.ts +44 -21
- package/dist/utils/schema-utils.d.ts.map +1 -1
- package/dist/utils/schema-utils.js +17 -11
- package/package.json +1 -1
- package/src/api/client.ts +12 -0
- package/src/api/debug.test.ts +76 -0
- package/src/api/debug.ts +46 -2
- package/src/api/schemas.ts +51 -29
- package/src/index.ts +4 -5
- package/src/plugins/findFirstAuthentication/index.test.ts +8 -5
- package/src/plugins/findFirstAuthentication/index.ts +14 -2
- package/src/plugins/findUniqueAuthentication/index.ts +4 -0
- package/src/plugins/getAction/index.ts +14 -0
- package/src/plugins/getApp/index.test.ts +2 -2
- package/src/plugins/getApp/index.ts +8 -0
- package/src/plugins/getApp/schemas.ts +7 -12
- package/src/plugins/getAuthentication/index.ts +8 -0
- package/src/plugins/getProfile/index.ts +4 -0
- package/src/plugins/getProfile/schemas.ts +4 -6
- package/src/plugins/listActions/index.ts +9 -0
- package/src/plugins/listActions/schemas.ts +20 -25
- package/src/plugins/listApps/index.test.ts +1 -1
- package/src/plugins/listApps/index.ts +4 -0
- package/src/plugins/listApps/schemas.ts +17 -26
- package/src/plugins/listAuthentications/index.ts +8 -0
- package/src/plugins/listInputFieldChoices/index.ts +21 -1
- package/src/plugins/listInputFieldChoices/schemas.ts +61 -76
- package/src/plugins/listInputFields/index.test.ts +5 -9
- package/src/plugins/listInputFields/index.ts +20 -2
- package/src/plugins/registry/index.ts +8 -2
- package/src/plugins/request/index.ts +1 -0
- package/src/plugins/runAction/index.ts +18 -0
- package/src/resolvers/actionKey.ts +15 -13
- package/src/resolvers/actionType.ts +10 -12
- package/src/resolvers/appKey.ts +2 -6
- package/src/resolvers/authenticationId.ts +25 -19
- package/src/resolvers/index.ts +7 -113
- package/src/resolvers/inputFieldKey.ts +38 -0
- package/src/resolvers/inputs.ts +28 -10
- package/src/schemas/Action.ts +8 -3
- package/src/schemas/App.ts +7 -9
- package/src/schemas/Auth.ts +1 -1
- package/src/schemas/Field.ts +24 -57
- package/src/schemas/Run.ts +40 -0
- package/src/schemas/UserProfile.ts +24 -7
- package/src/sdk.ts +17 -7
- package/src/types/plugin.ts +5 -0
- package/src/types/sdk.ts +5 -0
- package/src/utils/domain-utils.ts +9 -67
- package/src/utils/schema-utils.ts +96 -44
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,7 +4,7 @@ import { FindFirstAuthenticationSchema, type FindFirstAuthenticationOptions } fr
|
|
|
4
4
|
import type { ListAuthenticationsPluginProvides } from "../listAuthentications";
|
|
5
5
|
export interface FindFirstAuthenticationPluginProvides {
|
|
6
6
|
findFirstAuthentication: (options?: FindFirstAuthenticationOptions) => Promise<{
|
|
7
|
-
data: AuthenticationItem
|
|
7
|
+
data: AuthenticationItem;
|
|
8
8
|
}>;
|
|
9
9
|
context: {
|
|
10
10
|
meta: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACpC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACpC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAIhF,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,EAAE,EAAE,0BAA0B;AAC9B,qCAAqC,CAwCtC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FindFirstAuthenticationSchema, } from "./schemas";
|
|
2
2
|
import { createFunction } from "../../utils/function-utils";
|
|
3
|
+
import { AuthenticationItemSchema } from "../../schemas/Auth";
|
|
4
|
+
import { ZapierResourceNotFoundError } from "../../types/errors";
|
|
3
5
|
export const findFirstAuthenticationPlugin = ({ sdk }) => {
|
|
4
6
|
const findFirstAuthentication = createFunction(async function findFirstAuthentication(options = {}) {
|
|
5
7
|
// Use listAuthentications with maxItems 1 to get the first result
|
|
@@ -7,8 +9,11 @@ export const findFirstAuthenticationPlugin = ({ sdk }) => {
|
|
|
7
9
|
...options,
|
|
8
10
|
maxItems: 1,
|
|
9
11
|
});
|
|
12
|
+
if (authsResponse.data.length === 0) {
|
|
13
|
+
throw new ZapierResourceNotFoundError("No authentication found matching the specified criteria", { resourceType: "Authentication" });
|
|
14
|
+
}
|
|
10
15
|
return {
|
|
11
|
-
data: authsResponse.data
|
|
16
|
+
data: authsResponse.data[0],
|
|
12
17
|
};
|
|
13
18
|
}, FindFirstAuthenticationSchema);
|
|
14
19
|
return {
|
|
@@ -17,7 +22,10 @@ export const findFirstAuthenticationPlugin = ({ sdk }) => {
|
|
|
17
22
|
meta: {
|
|
18
23
|
findFirstAuthentication: {
|
|
19
24
|
categories: ["authentication"],
|
|
25
|
+
type: "item",
|
|
26
|
+
itemType: "Authentication",
|
|
20
27
|
inputSchema: FindFirstAuthenticationSchema,
|
|
28
|
+
outputSchema: AuthenticationItemSchema,
|
|
21
29
|
},
|
|
22
30
|
},
|
|
23
31
|
},
|
|
@@ -109,15 +109,14 @@ describe("findFirstAuthentication plugin", () => {
|
|
|
109
109
|
});
|
|
110
110
|
expect(result.data).toEqual(mockAuth);
|
|
111
111
|
});
|
|
112
|
-
it("should
|
|
112
|
+
it("should throw error when no authentications found", async () => {
|
|
113
113
|
mockListAuthentications.mockResolvedValue({
|
|
114
114
|
data: [],
|
|
115
115
|
});
|
|
116
116
|
const sdk = createTestSdk();
|
|
117
|
-
|
|
117
|
+
await expect(sdk.findFirstAuthentication({
|
|
118
118
|
appKey: "nonexistent",
|
|
119
|
-
});
|
|
120
|
-
expect(result.data).toBeNull();
|
|
119
|
+
})).rejects.toThrow("No authentication found matching the specified criteria");
|
|
121
120
|
});
|
|
122
121
|
it("should return first authentication when multiple found", async () => {
|
|
123
122
|
const mockAuth = mockAuthentications[0];
|
|
@@ -2,20 +2,22 @@ import { z } from "zod";
|
|
|
2
2
|
import type { AuthenticationItem } from "../../types/domain";
|
|
3
3
|
import type { ZapierAuthenticationError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
4
4
|
export declare const FindFirstAuthenticationSchema: z.ZodObject<{
|
|
5
|
-
appKey: z.ZodOptional<z.ZodString
|
|
5
|
+
appKey: z.ZodOptional<z.ZodString & {
|
|
6
|
+
_def: z.ZodStringDef & import("../..").PositionalMetadata;
|
|
7
|
+
}>;
|
|
6
8
|
search: z.ZodOptional<z.ZodString>;
|
|
7
9
|
title: z.ZodOptional<z.ZodString>;
|
|
8
10
|
accountId: z.ZodOptional<z.ZodString>;
|
|
9
11
|
owner: z.ZodOptional<z.ZodString>;
|
|
10
12
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
title?: string | undefined;
|
|
12
13
|
search?: string | undefined;
|
|
14
|
+
title?: string | undefined;
|
|
13
15
|
appKey?: string | undefined;
|
|
14
16
|
accountId?: string | undefined;
|
|
15
17
|
owner?: string | undefined;
|
|
16
18
|
}, {
|
|
17
|
-
title?: string | undefined;
|
|
18
19
|
search?: string | undefined;
|
|
20
|
+
title?: string | undefined;
|
|
19
21
|
appKey?: string | undefined;
|
|
20
22
|
accountId?: string | undefined;
|
|
21
23
|
owner?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;EAgBwB,CAAC;AAGnE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,4BAA4B,GACpC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,kCAAkC;IACjD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,KAAK,+BAA+B,EACrC,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,KAAK,+BAA+B,EACrC,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAGhF,MAAM,WAAW,sCAAsC;IACrD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,wBAAwB,EAAE;gBACxB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,EAAE,EAAE,0BAA0B;AAC9B,sCAAsC,CA8CvC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FindUniqueAuthenticationSchema, } from "./schemas";
|
|
2
2
|
import { ZapierResourceNotFoundError, ZapierValidationError, } from "../../types/errors";
|
|
3
3
|
import { createFunction } from "../../utils/function-utils";
|
|
4
|
+
import { AuthenticationItemSchema } from "../../schemas/Auth";
|
|
4
5
|
export const findUniqueAuthenticationPlugin = ({ sdk }) => {
|
|
5
6
|
const findUniqueAuthentication = createFunction(async function findUniqueAuthentication(options = {}) {
|
|
6
7
|
// Use listAuthentications with maxItems 2 to check for uniqueness
|
|
@@ -24,7 +25,10 @@ export const findUniqueAuthenticationPlugin = ({ sdk }) => {
|
|
|
24
25
|
meta: {
|
|
25
26
|
findUniqueAuthentication: {
|
|
26
27
|
categories: ["authentication"],
|
|
28
|
+
type: "item",
|
|
29
|
+
itemType: "Authentication",
|
|
27
30
|
inputSchema: FindUniqueAuthenticationSchema,
|
|
31
|
+
outputSchema: AuthenticationItemSchema,
|
|
28
32
|
},
|
|
29
33
|
},
|
|
30
34
|
},
|
|
@@ -2,20 +2,22 @@ import { z } from "zod";
|
|
|
2
2
|
import type { AuthenticationItem } from "../../types/domain";
|
|
3
3
|
import type { ZapierAuthenticationError, ZapierApiError, ZapierResourceNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
4
4
|
export declare const FindUniqueAuthenticationSchema: z.ZodObject<{
|
|
5
|
-
appKey: z.ZodOptional<z.ZodString
|
|
5
|
+
appKey: z.ZodOptional<z.ZodString & {
|
|
6
|
+
_def: z.ZodStringDef & import("../..").PositionalMetadata;
|
|
7
|
+
}>;
|
|
6
8
|
search: z.ZodOptional<z.ZodString>;
|
|
7
9
|
title: z.ZodOptional<z.ZodString>;
|
|
8
10
|
accountId: z.ZodOptional<z.ZodString>;
|
|
9
11
|
owner: z.ZodOptional<z.ZodString>;
|
|
10
12
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
title?: string | undefined;
|
|
12
13
|
search?: string | undefined;
|
|
14
|
+
title?: string | undefined;
|
|
13
15
|
appKey?: string | undefined;
|
|
14
16
|
accountId?: string | undefined;
|
|
15
17
|
owner?: string | undefined;
|
|
16
18
|
}, {
|
|
17
|
-
title?: string | undefined;
|
|
18
19
|
search?: string | undefined;
|
|
20
|
+
title?: string | undefined;
|
|
19
21
|
appKey?: string | undefined;
|
|
20
22
|
accountId?: string | undefined;
|
|
21
23
|
owner?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;EAgBsB,CAAC;AAGlE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC;AAGF,MAAM,MAAM,6BAA6B,GACrC,yBAAyB,GACzB,cAAc,GACd,2BAA2B,GAC3B,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,mCAAmC;IAClD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;CAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAQhE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IACxE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,UAAU,CAAC,yBAAyB,CAAC,EAAE,8BAA8B;AACrE;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,uBAAuB,CA2CxB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { GetActionSchema } from "./schemas";
|
|
2
2
|
import { ZapierResourceNotFoundError } from "../../types/errors";
|
|
3
3
|
import { createFunction } from "../../utils/function-utils";
|
|
4
|
+
import { appKeyResolver, actionTypeResolver, actionKeyResolver, } from "../../resolvers";
|
|
5
|
+
import { ActionItemSchema } from "../../schemas/Action";
|
|
4
6
|
export const getActionPlugin = ({ sdk }) => {
|
|
5
7
|
const getAction = createFunction(async function getAction(options) {
|
|
6
8
|
const { actionKey, actionType, appKey } = options;
|
|
@@ -21,7 +23,15 @@ export const getActionPlugin = ({ sdk }) => {
|
|
|
21
23
|
meta: {
|
|
22
24
|
getAction: {
|
|
23
25
|
categories: ["action"],
|
|
26
|
+
type: "item",
|
|
27
|
+
itemType: "Action",
|
|
24
28
|
inputSchema: GetActionSchema,
|
|
29
|
+
outputSchema: ActionItemSchema,
|
|
30
|
+
resolvers: {
|
|
31
|
+
appKey: appKeyResolver,
|
|
32
|
+
actionType: actionTypeResolver,
|
|
33
|
+
actionKey: actionKeyResolver,
|
|
34
|
+
},
|
|
25
35
|
},
|
|
26
36
|
},
|
|
27
37
|
},
|
|
@@ -2,16 +2,18 @@ import { z } from "zod";
|
|
|
2
2
|
import type { ActionItem } from "../../types/domain";
|
|
3
3
|
import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierResourceNotFoundError, ZapierUnknownError } from "../../types/errors";
|
|
4
4
|
export declare const GetActionSchema: z.ZodObject<{
|
|
5
|
-
appKey: z.ZodString
|
|
5
|
+
appKey: z.ZodString & {
|
|
6
|
+
_def: z.ZodStringDef & import("../..").PositionalMetadata;
|
|
7
|
+
};
|
|
6
8
|
actionType: z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>;
|
|
7
9
|
actionKey: z.ZodString;
|
|
8
10
|
}, "strip", z.ZodTypeAny, {
|
|
9
11
|
appKey: string;
|
|
10
|
-
actionType: "filter" | "read" | "read_bulk" | "
|
|
12
|
+
actionType: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write";
|
|
11
13
|
actionKey: string;
|
|
12
14
|
}, {
|
|
13
15
|
appKey: string;
|
|
14
|
-
actionType: "filter" | "read" | "read_bulk" | "
|
|
16
|
+
actionType: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write";
|
|
15
17
|
actionKey: string;
|
|
16
18
|
}>;
|
|
17
19
|
export type GetActionOptions = z.infer<typeof GetActionSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;EAMmC,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,2BAA2B,GAC3B,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CACzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,YAAY,CAAC;aAClC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,UAAU,CAAC,sBAAsB,CAAC,EAClC,EAAE,EACF,oBAAoB,CAgCrB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createFunction } from "../../utils/function-utils";
|
|
2
2
|
import { GetAppSchema } from "./schemas";
|
|
3
|
+
import { AppItemSchema } from "../../schemas/App";
|
|
3
4
|
import { ZapierAppNotFoundError } from "../../types/errors";
|
|
5
|
+
import { appKeyResolver } from "../../resolvers";
|
|
4
6
|
// GetApp plugin depends on listApps SDK function
|
|
5
7
|
export const getAppPlugin = ({ sdk }) => {
|
|
6
8
|
const getApp = createFunction(async function getApp(options) {
|
|
@@ -21,7 +23,13 @@ export const getAppPlugin = ({ sdk }) => {
|
|
|
21
23
|
meta: {
|
|
22
24
|
getApp: {
|
|
23
25
|
categories: ["app"],
|
|
26
|
+
type: "item",
|
|
27
|
+
itemType: "App",
|
|
24
28
|
inputSchema: GetAppSchema,
|
|
29
|
+
outputSchema: AppItemSchema,
|
|
30
|
+
resolvers: {
|
|
31
|
+
appKey: appKeyResolver,
|
|
32
|
+
},
|
|
25
33
|
},
|
|
26
34
|
},
|
|
27
35
|
},
|
|
@@ -54,7 +54,7 @@ describe("getApp plugin", () => {
|
|
|
54
54
|
});
|
|
55
55
|
expect(result.data.title).toBe("Slack");
|
|
56
56
|
expect(result.data.key).toBe("SlackCLIAPI");
|
|
57
|
-
expect(result.data.
|
|
57
|
+
expect(result.data.implementation_id).toBe("SlackCLIAPI@1.0.0");
|
|
58
58
|
expect(result.data.version).toBe("1.0.0");
|
|
59
59
|
});
|
|
60
60
|
});
|
|
@@ -94,7 +94,7 @@ describe("getApp plugin", () => {
|
|
|
94
94
|
});
|
|
95
95
|
expect(result.data.title).toBeDefined();
|
|
96
96
|
expect(result.data.key).toBeDefined();
|
|
97
|
-
expect(result.data.
|
|
97
|
+
expect(result.data.implementation_id).toBeDefined();
|
|
98
98
|
expect(result.data.title).toBe("Test App");
|
|
99
99
|
expect(result.data.key).toBe("TestCLIAPI");
|
|
100
100
|
});
|
|
@@ -3,7 +3,9 @@ import type { AppItem } from "../../types/domain";
|
|
|
3
3
|
import type { ZapierApiError, ZapierAppNotFoundError, ZapierValidationError } from "../../types/errors";
|
|
4
4
|
export type GetAppError = ZapierAppNotFoundError | ZapierApiError | ZapierValidationError;
|
|
5
5
|
export declare const GetAppSchema: z.ZodObject<{
|
|
6
|
-
appKey: z.ZodString
|
|
6
|
+
appKey: z.ZodString & {
|
|
7
|
+
_def: z.ZodStringDef & import("../..").PositionalMetadata;
|
|
8
|
+
};
|
|
7
9
|
}, "strip", z.ZodTypeAny, {
|
|
8
10
|
appKey: string;
|
|
9
11
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,MAAM,WAAW,GACnB,sBAAsB,GACtB,cAAc,GACd,qBAAqB,CAAC;AAG1B,eAAO,MAAM,YAAY;;;;;;;;EAMmC,CAAC;AAG7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAChE"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AppKeyPropertySchema } from "../../types/properties";
|
|
3
|
-
import { withOutputSchema } from "../../utils/schema-utils";
|
|
4
|
-
import { AppItemSchema } from "../../schemas/App";
|
|
5
3
|
// Pure Zod schema - no resolver metadata!
|
|
6
|
-
export const GetAppSchema =
|
|
4
|
+
export const GetAppSchema = z
|
|
7
5
|
.object({
|
|
8
6
|
appKey: AppKeyPropertySchema.describe("App key of app to fetch (e.g., 'SlackCLIAPI')"),
|
|
9
7
|
})
|
|
10
|
-
.describe("Get detailed information about a specific app")
|
|
8
|
+
.describe("Get detailed information about a specific app");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;AAUnB,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,uBAAuB,CAAC;aAC7C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,EAAE,EAAE,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,+BAA+B,CA6DhC,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { GetAuthenticationSchema, } from "./schemas";
|
|
|
2
2
|
import { ZapierAuthenticationError, ZapierResourceNotFoundError, } from "../../types/errors";
|
|
3
3
|
import { createFunction } from "../../utils/function-utils";
|
|
4
4
|
import { normalizeAuthenticationItem } from "../../utils/domain-utils";
|
|
5
|
+
import { authenticationIdGenericResolver } from "../../resolvers";
|
|
6
|
+
import { AuthenticationItemSchema } from "../../schemas/Auth";
|
|
5
7
|
export const getAuthenticationPlugin = ({ context }) => {
|
|
6
8
|
const getAuthentication = createFunction(async function getAuthentication(options) {
|
|
7
9
|
const { api } = context;
|
|
@@ -34,7 +36,13 @@ export const getAuthenticationPlugin = ({ context }) => {
|
|
|
34
36
|
meta: {
|
|
35
37
|
getAuthentication: {
|
|
36
38
|
categories: ["authentication"],
|
|
39
|
+
type: "item",
|
|
40
|
+
itemType: "Authentication",
|
|
37
41
|
inputSchema: GetAuthenticationSchema,
|
|
42
|
+
outputSchema: AuthenticationItemSchema,
|
|
43
|
+
resolvers: {
|
|
44
|
+
authenticationId: authenticationIdGenericResolver,
|
|
45
|
+
},
|
|
38
46
|
},
|
|
39
47
|
},
|
|
40
48
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,EAAE,EAAE,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,wBAAwB,CAiCzB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createFunction } from "../../utils/function-utils";
|
|
2
2
|
import { GetProfileSchema } from "./schemas";
|
|
3
|
+
import { UserProfileItemSchema } from "../../schemas/UserProfile";
|
|
3
4
|
// Direct plugin function - takes options + sdk + context in one object
|
|
4
5
|
export const getProfilePlugin = ({ context }) => {
|
|
5
6
|
const getProfile = createFunction(async function getProfile() {
|
|
@@ -22,7 +23,10 @@ export const getProfilePlugin = ({ context }) => {
|
|
|
22
23
|
meta: {
|
|
23
24
|
getProfile: {
|
|
24
25
|
categories: ["account"],
|
|
26
|
+
type: "item",
|
|
27
|
+
itemType: "Profile",
|
|
25
28
|
inputSchema: GetProfileSchema,
|
|
29
|
+
outputSchema: UserProfileItemSchema,
|
|
26
30
|
},
|
|
27
31
|
},
|
|
28
32
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGrE,eAAO,MAAM,gBAAgB,+DAGwB,CAAC;AAGtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAC9D,eAAe,CAAC;AAGlB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;CACzC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { withOutputSchema } from "../../utils/schema-utils";
|
|
3
|
-
import { UserProfileItemSchema } from "../../schemas/UserProfile";
|
|
4
2
|
// Pure Zod schema - no resolver metadata!
|
|
5
|
-
export const GetProfileSchema =
|
|
3
|
+
export const GetProfileSchema = z
|
|
4
|
+
.object({})
|
|
5
|
+
.optional()
|
|
6
|
+
.describe("Get current user's profile information");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAOnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;KACpB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;KACpC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,iBAAiB,CAAC;aACvC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EACD,yBAAyB,CAyF1B,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { normalizeActionItem } from "../../utils/domain-utils";
|
|
2
2
|
import { ListActionsSchema, } from "./schemas";
|
|
3
|
+
import { ActionItemSchema } from "../../schemas/Action";
|
|
3
4
|
import { ZapierConfigurationError, ZapierAuthenticationError, } from "../../types/errors";
|
|
4
5
|
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
6
|
+
import { appKeyResolver, actionTypeResolver } from "../../resolvers";
|
|
5
7
|
export const listActionsPlugin = ({ context }) => {
|
|
6
8
|
const listActions = createPaginatedFunction(async function listActionsPage(options) {
|
|
7
9
|
const { api, getVersionedImplementationId } = context;
|
|
@@ -53,7 +55,14 @@ export const listActionsPlugin = ({ context }) => {
|
|
|
53
55
|
meta: {
|
|
54
56
|
listActions: {
|
|
55
57
|
categories: ["action"],
|
|
58
|
+
type: "list",
|
|
59
|
+
itemType: "Action",
|
|
56
60
|
inputSchema: ListActionsSchema,
|
|
61
|
+
outputSchema: ActionItemSchema,
|
|
62
|
+
resolvers: {
|
|
63
|
+
appKey: appKeyResolver,
|
|
64
|
+
actionType: actionTypeResolver,
|
|
65
|
+
},
|
|
57
66
|
},
|
|
58
67
|
},
|
|
59
68
|
},
|
|
@@ -3,18 +3,20 @@ import type { ActionItem } from "../../types/domain";
|
|
|
3
3
|
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
4
4
|
import type { ZapierAuthenticationError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
5
5
|
export declare const ListActionsSchema: z.ZodObject<{
|
|
6
|
-
appKey: z.ZodString
|
|
6
|
+
appKey: z.ZodString & {
|
|
7
|
+
_def: z.ZodStringDef & import("../..").PositionalMetadata;
|
|
8
|
+
};
|
|
7
9
|
actionType: z.ZodOptional<z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>>;
|
|
8
10
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
9
11
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
10
12
|
}, "strip", z.ZodTypeAny, {
|
|
11
13
|
appKey: string;
|
|
12
|
-
actionType?: "filter" | "read" | "read_bulk" | "
|
|
14
|
+
actionType?: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write" | undefined;
|
|
13
15
|
pageSize?: number | undefined;
|
|
14
16
|
maxItems?: number | undefined;
|
|
15
17
|
}, {
|
|
16
18
|
appKey: string;
|
|
17
|
-
actionType?: "filter" | "read" | "read_bulk" | "
|
|
19
|
+
actionType?: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write" | undefined;
|
|
18
20
|
pageSize?: number | undefined;
|
|
19
21
|
maxItems?: number | undefined;
|
|
20
22
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;EAmBoB,CAAC;AAGnD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,oBAAoB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACnE"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AppKeyPropertySchema, ActionTypePropertySchema, } from "../../types/properties";
|
|
3
|
-
import { withOutputSchema } from "../../utils/schema-utils";
|
|
4
|
-
import { ActionItemSchema } from "../../schemas/Action";
|
|
5
3
|
// Pure Zod schema - no resolver metadata!
|
|
6
|
-
export const ListActionsSchema =
|
|
4
|
+
export const ListActionsSchema = z
|
|
7
5
|
.object({
|
|
8
6
|
appKey: AppKeyPropertySchema.describe("App key of actions to list (e.g., 'SlackCLIAPI')"),
|
|
9
7
|
actionType: ActionTypePropertySchema.optional().describe("Filter actions by type"),
|
|
@@ -18,4 +16,4 @@ export const ListActionsSchema = withOutputSchema(z
|
|
|
18
16
|
.optional()
|
|
19
17
|
.describe("Maximum total items to return across all pages"),
|
|
20
18
|
})
|
|
21
|
-
.describe("List all actions for a specific app")
|
|
19
|
+
.describe("List all actions for a specific app");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAWlD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC,GACnE,aAAa,CAAC;QAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACxD,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,WAAW,EAAE,OAAO,cAAc,CAAC;aACpC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,EAAE,EACF,cAAc,CAAC,iBAAiB,GAAG,sBAAsB,CAAC,EAC1D,sBAAsB,CA+GvB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
2
2
|
import { ListAppsSchema } from "./schemas";
|
|
3
|
+
import { AppItemSchema } from "../../schemas/App";
|
|
3
4
|
import { normalizeImplementationMetaToAppItem, splitVersionedKey, toAppLocator, toImplementationId, } from "../../utils/domain-utils";
|
|
4
5
|
import { extractCursor } from "../../utils/function-utils";
|
|
5
6
|
export const listAppsPlugin = ({ context }) => {
|
|
@@ -71,7 +72,10 @@ export const listAppsPlugin = ({ context }) => {
|
|
|
71
72
|
meta: {
|
|
72
73
|
listApps: {
|
|
73
74
|
categories: ["app"],
|
|
75
|
+
type: "list",
|
|
76
|
+
itemType: "App",
|
|
74
77
|
inputSchema: ListAppsSchema,
|
|
78
|
+
outputSchema: AppItemSchema,
|
|
75
79
|
},
|
|
76
80
|
},
|
|
77
81
|
},
|
|
@@ -201,7 +201,7 @@ describe("listApps plugin", () => {
|
|
|
201
201
|
const result = await sdk.listApps({});
|
|
202
202
|
expect(result.data[0]).toHaveProperty("title");
|
|
203
203
|
expect(result.data[0]).toHaveProperty("key");
|
|
204
|
-
expect(result.data[0]).toHaveProperty("
|
|
204
|
+
expect(result.data[0]).toHaveProperty("implementation_id");
|
|
205
205
|
// Version is optional
|
|
206
206
|
expect(result.data[0]).toHaveProperty("version");
|
|
207
207
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGnE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAgBmC,CAAC;AAG/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CACtE"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AppItemSchema } from "../../schemas/App";
|
|
3
|
-
import { withOutputSchema } from "../../utils/schema-utils";
|
|
4
2
|
// Pure Zod schema - no pagination metadata exposed
|
|
5
|
-
export const ListAppsSchema =
|
|
3
|
+
export const ListAppsSchema = z
|
|
6
4
|
.object({
|
|
7
5
|
appKeys: z
|
|
8
6
|
.array(z.string())
|
|
9
7
|
.optional()
|
|
10
8
|
.describe("Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
11
9
|
search: z.string().optional().describe("Search for apps by name"),
|
|
12
|
-
pageSize: z
|
|
13
|
-
.number()
|
|
14
|
-
.min(1)
|
|
15
|
-
.optional()
|
|
16
|
-
.describe("Number of apps per page"),
|
|
10
|
+
pageSize: z.number().min(1).optional().describe("Number of apps per page"),
|
|
17
11
|
maxItems: z
|
|
18
12
|
.number()
|
|
19
13
|
.min(1)
|
|
20
14
|
.optional()
|
|
21
15
|
.describe("Maximum total items to return across all pages"),
|
|
22
16
|
})
|
|
23
|
-
.describe("List all available apps with optional filtering")
|
|
17
|
+
.describe("List all available apps with optional filtering");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,WAAW,CAAC;AAUnB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,WAAW,CAAC;AAUnB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC;QACrE,IAAI,EAAE,kBAAkB,EAAE,CAAC;KAC5B,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACnE,KAAK,IAAI,aAAa,CAAC,kBAAkB,CAAC,CAAC;KAC5C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,mBAAmB,EAAE;gBACnB,WAAW,EAAE,OAAO,yBAAyB,CAAC;aAC/C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAC5C,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EACD,iCAAiC,CAyGlC,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { ListAuthenticationsSchema, } from "./schemas";
|
|
|
2
2
|
import { normalizeAuthenticationItem, splitVersionedKey, } from "../../utils/domain-utils";
|
|
3
3
|
import { ZapierAuthenticationError } from "../../types/errors";
|
|
4
4
|
import { createPaginatedFunction, extractCursor, } from "../../utils/function-utils";
|
|
5
|
+
import { appKeyResolver } from "../../resolvers";
|
|
6
|
+
import { AuthenticationItemSchema } from "../../schemas/Auth";
|
|
5
7
|
export const listAuthenticationsPlugin = ({ context }) => {
|
|
6
8
|
const listAuthentications = createPaginatedFunction(async function listAuthenticationsPage(options) {
|
|
7
9
|
const { api, getVersionedImplementationId } = context;
|
|
@@ -69,7 +71,13 @@ export const listAuthenticationsPlugin = ({ context }) => {
|
|
|
69
71
|
meta: {
|
|
70
72
|
listAuthentications: {
|
|
71
73
|
categories: ["authentication"],
|
|
74
|
+
type: "list",
|
|
75
|
+
itemType: "Authentication",
|
|
72
76
|
inputSchema: ListAuthenticationsSchema,
|
|
77
|
+
outputSchema: AuthenticationItemSchema,
|
|
78
|
+
resolvers: {
|
|
79
|
+
appKey: appKeyResolver,
|
|
80
|
+
},
|
|
73
81
|
},
|
|
74
82
|
},
|
|
75
83
|
},
|
|
@@ -3,7 +3,9 @@ import type { PaginatedSdkFunction } from "../../types/functions";
|
|
|
3
3
|
import type { AuthenticationItem } from "../../types/domain";
|
|
4
4
|
import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
5
5
|
export declare const ListAuthenticationsSchema: z.ZodObject<{
|
|
6
|
-
appKey: z.ZodOptional<z.ZodString
|
|
6
|
+
appKey: z.ZodOptional<z.ZodString & {
|
|
7
|
+
_def: z.ZodStringDef & import("../..").PositionalMetadata;
|
|
8
|
+
}>;
|
|
7
9
|
authenticationIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
10
|
search: z.ZodOptional<z.ZodString>;
|
|
9
11
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -12,8 +14,8 @@ export declare const ListAuthenticationsSchema: z.ZodObject<{
|
|
|
12
14
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
13
15
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
14
16
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
title?: string | undefined;
|
|
16
17
|
search?: string | undefined;
|
|
18
|
+
title?: string | undefined;
|
|
17
19
|
appKey?: string | undefined;
|
|
18
20
|
pageSize?: number | undefined;
|
|
19
21
|
maxItems?: number | undefined;
|
|
@@ -21,8 +23,8 @@ export declare const ListAuthenticationsSchema: z.ZodObject<{
|
|
|
21
23
|
owner?: string | undefined;
|
|
22
24
|
authenticationIds?: string[] | undefined;
|
|
23
25
|
}, {
|
|
24
|
-
title?: string | undefined;
|
|
25
26
|
search?: string | undefined;
|
|
27
|
+
title?: string | undefined;
|
|
26
28
|
appKey?: string | undefined;
|
|
27
29
|
pageSize?: number | undefined;
|
|
28
30
|
maxItems?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B+B,CAAC;AAGtE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AAGF,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,wBAAwB,GAChC,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,8BAA8B;IAC7C,mBAAmB,EAAE,oBAAoB,CACvC,0BAA0B,EAC1B,kBAAkB,CACnB,CAAC;CACH"}
|