@zapier/zapier-sdk 0.15.10 → 0.15.11
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 +6 -0
- package/dist/index.cjs +583 -337
- package/dist/index.d.mts +184 -39
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +583 -338
- package/dist/plugins/eventEmission/builders.d.ts +3 -2
- package/dist/plugins/eventEmission/builders.d.ts.map +1 -1
- package/dist/plugins/eventEmission/builders.js +32 -0
- package/dist/plugins/eventEmission/index.d.ts +4 -2
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +8 -2
- package/dist/plugins/eventEmission/types.d.ts +10 -0
- package/dist/plugins/eventEmission/types.d.ts.map +1 -1
- package/dist/plugins/fetch/index.d.ts +2 -1
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +39 -11
- package/dist/plugins/findFirstAuthentication/index.d.ts +2 -1
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findFirstAuthentication/index.js +4 -2
- package/dist/plugins/findFirstAuthentication/index.test.js +11 -4
- package/dist/plugins/findUniqueAuthentication/index.d.ts +2 -1
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.js +4 -2
- package/dist/plugins/findUniqueAuthentication/index.test.js +9 -2
- package/dist/plugins/getAction/index.d.ts +3 -1
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +6 -3
- package/dist/plugins/getAction/index.test.js +5 -3
- package/dist/plugins/getAction/schemas.d.ts +14 -0
- package/dist/plugins/getAction/schemas.d.ts.map +1 -1
- package/dist/plugins/getAction/schemas.js +2 -0
- package/dist/plugins/getApp/index.d.ts +2 -1
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +9 -3
- package/dist/plugins/getApp/index.test.js +7 -0
- package/dist/plugins/getAuthentication/index.d.ts +3 -1
- package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/getAuthentication/index.js +2 -1
- package/dist/plugins/getAuthentication/index.test.js +10 -1
- package/dist/plugins/getInputFieldsSchema/index.d.ts +2 -1
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +2 -1
- package/dist/plugins/getInputFieldsSchema/index.test.js +3 -0
- package/dist/plugins/getProfile/index.d.ts +3 -1
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +2 -1
- package/dist/plugins/listActions/index.d.ts +2 -1
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +14 -12
- package/dist/plugins/listActions/index.test.js +7 -0
- package/dist/plugins/listActions/schemas.d.ts +18 -4
- package/dist/plugins/listActions/schemas.d.ts.map +1 -1
- package/dist/plugins/listActions/schemas.js +2 -0
- package/dist/plugins/listApps/index.d.ts +2 -1
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +2 -1
- package/dist/plugins/listApps/index.test.js +7 -0
- package/dist/plugins/listAuthentications/index.d.ts +2 -1
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/index.js +2 -1
- package/dist/plugins/listAuthentications/index.test.js +7 -0
- package/dist/plugins/listAuthentications/schemas.d.ts +18 -4
- package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/schemas.js +2 -0
- package/dist/plugins/listInputFieldChoices/index.d.ts +3 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +2 -1
- package/dist/plugins/listInputFieldChoices/index.test.js +5 -2
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -4
- package/dist/plugins/listInputFields/index.d.ts +3 -1
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +2 -1
- package/dist/plugins/listInputFields/index.test.js +3 -0
- package/dist/plugins/listInputFields/schemas.d.ts +4 -4
- package/dist/plugins/manifest/index.test.js +10 -1
- package/dist/plugins/request/index.d.ts +3 -1
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +2 -1
- package/dist/plugins/request/index.test.js +10 -1
- package/dist/plugins/request/schemas.d.ts +28 -0
- package/dist/plugins/request/schemas.d.ts.map +1 -1
- package/dist/plugins/request/schemas.js +2 -0
- package/dist/plugins/runAction/index.d.ts +3 -1
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +3 -1
- package/dist/plugins/runAction/index.test.js +20 -8
- package/dist/plugins/runAction/schemas.d.ts +4 -4
- package/dist/temporary-internal-core/schemas/apps/index.d.ts +21 -7
- package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +1 -1
- package/dist/temporary-internal-core/schemas/apps/index.js +2 -0
- package/dist/types/telemetry-events.d.ts +31 -2
- package/dist/types/telemetry-events.d.ts.map +1 -1
- package/dist/utils/function-utils.d.ts +42 -3
- package/dist/utils/function-utils.d.ts.map +1 -1
- package/dist/utils/function-utils.js +83 -8
- package/dist/utils/telemetry-utils.d.ts +32 -0
- package/dist/utils/telemetry-utils.d.ts.map +1 -0
- package/dist/utils/telemetry-utils.js +43 -0
- package/dist/utils/telemetry-utils.test.d.ts +2 -0
- package/dist/utils/telemetry-utils.test.d.ts.map +1 -0
- package/dist/utils/telemetry-utils.test.js +94 -0
- package/package.json +1 -1
|
@@ -39,9 +39,9 @@ export declare const ListInputFieldChoicesSchema: z.ZodObject<{
|
|
|
39
39
|
page?: number | undefined;
|
|
40
40
|
authenticationId?: number | null | undefined;
|
|
41
41
|
inputs?: Record<string, unknown> | undefined;
|
|
42
|
-
pageSize?: number | undefined;
|
|
43
|
-
maxItems?: number | undefined;
|
|
44
42
|
cursor?: string | undefined;
|
|
43
|
+
maxItems?: number | undefined;
|
|
44
|
+
pageSize?: number | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
appKey: string;
|
|
47
47
|
actionKey: string;
|
|
@@ -50,9 +50,9 @@ export declare const ListInputFieldChoicesSchema: z.ZodObject<{
|
|
|
50
50
|
page?: number | undefined;
|
|
51
51
|
authenticationId?: number | null | undefined;
|
|
52
52
|
inputs?: Record<string, unknown> | undefined;
|
|
53
|
-
pageSize?: number | undefined;
|
|
54
|
-
maxItems?: number | undefined;
|
|
55
53
|
cursor?: string | undefined;
|
|
54
|
+
maxItems?: number | undefined;
|
|
55
|
+
pageSize?: number | undefined;
|
|
56
56
|
}>;
|
|
57
57
|
export type ListInputFieldChoicesOptions = z.infer<typeof ListInputFieldChoicesSchema>;
|
|
58
58
|
export type ListInputFieldChoicesError = ZapierConfigurationError | ZapierApiError | ZapierAuthenticationError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
|
|
@@ -5,6 +5,7 @@ import { ListInputFieldsSchema, type ListInputFieldsOptions } from "./schemas";
|
|
|
5
5
|
import type { GetAppPluginProvides } from "../getApp";
|
|
6
6
|
import type { GetActionPluginProvides } from "../getAction";
|
|
7
7
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
8
|
+
import type { EventEmissionContext } from "../eventEmission";
|
|
8
9
|
export interface ListInputFieldsPluginProvides {
|
|
9
10
|
listInputFields: (options?: ListInputFieldsOptions) => Promise<{
|
|
10
11
|
data: RootFieldItem[];
|
|
@@ -24,9 +25,10 @@ export interface ListInputFieldsPluginProvides {
|
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
export declare const listInputFieldsPlugin: Plugin<GetSdkType<GetAppPluginProvides & GetActionPluginProvides>, // requires getApp and getAction in SDK
|
|
28
|
+
// requires getApp and getAction in SDK
|
|
27
29
|
{
|
|
28
30
|
api: ApiClient;
|
|
29
31
|
getVersionedImplementationId: GetVersionedImplementationId;
|
|
30
|
-
}, // requires api and
|
|
32
|
+
} & EventEmissionContext, // requires api, getVersionedImplementationId, and eventEmission in context
|
|
31
33
|
ListInputFieldsPluginProvides>;
|
|
32
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/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,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,EAE5B,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/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,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,EAE5B,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAYxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA0J7D,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC;QAC7D,IAAI,EAAE,aAAa,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,aAAa,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC9D,KAAK,IAAI,aAAa,CAAC,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC,CAAC;KACvE,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,eAAe,EAAE;gBACf,WAAW,EAAE,OAAO,qBAAqB,CAAC;aAC3C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,UAAU,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,EAAE,uCAAuC;AACnG,AAD4D,uCAAuC;AACnG;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,GAAG,oBAAoB,EAAE,2EAA2E;AACrG,6BAA6B,CAoF9B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { appKeyResolver, actionTypeResolver, actionKeyResolver, authenticationId
|
|
|
5
5
|
import { RootFieldItemSchema } from "../../schemas/Field";
|
|
6
6
|
import { toTitleCase } from "../../utils/string-utils";
|
|
7
7
|
import { fetchImplementationNeeds } from "../../services/implementations";
|
|
8
|
+
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
8
9
|
// Enums for input field transformation
|
|
9
10
|
var InputFieldType;
|
|
10
11
|
(function (InputFieldType) {
|
|
@@ -176,7 +177,7 @@ export const listInputFieldsPlugin = ({ sdk, context }) => {
|
|
|
176
177
|
data: rootFieldset,
|
|
177
178
|
nextCursor: undefined, // No pagination needed since we return all input fields
|
|
178
179
|
};
|
|
179
|
-
}, ListInputFieldsSchema);
|
|
180
|
+
}, ListInputFieldsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, "listInputFields"));
|
|
180
181
|
return {
|
|
181
182
|
listInputFields,
|
|
182
183
|
context: {
|
|
@@ -6,6 +6,7 @@ import { getAppPlugin } from "../getApp";
|
|
|
6
6
|
import { listActionsPlugin } from "../listActions";
|
|
7
7
|
import { listAppsPlugin } from "../listApps";
|
|
8
8
|
import { createSdk } from "../../sdk";
|
|
9
|
+
import { eventEmissionPlugin } from "../eventEmission";
|
|
9
10
|
const mockNeeds = [
|
|
10
11
|
{
|
|
11
12
|
key: "message",
|
|
@@ -77,8 +78,10 @@ describe("listInputFields plugin", () => {
|
|
|
77
78
|
return createSdk({}, {}, {
|
|
78
79
|
api: mockApiClient,
|
|
79
80
|
meta: {},
|
|
81
|
+
options: {},
|
|
80
82
|
getVersionedImplementationId: mockGetVersionedImplementationId,
|
|
81
83
|
})
|
|
84
|
+
.addPlugin(eventEmissionPlugin)
|
|
82
85
|
.addPlugin(listAppsPlugin)
|
|
83
86
|
.addPlugin(listActionsPlugin)
|
|
84
87
|
.addPlugin(getAppPlugin)
|
|
@@ -19,18 +19,18 @@ export declare const ListInputFieldsSchema: z.ZodObject<{
|
|
|
19
19
|
actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
|
|
20
20
|
authenticationId?: number | null | undefined;
|
|
21
21
|
inputs?: Record<string, unknown> | undefined;
|
|
22
|
-
pageSize?: number | undefined;
|
|
23
|
-
maxItems?: number | undefined;
|
|
24
22
|
cursor?: string | undefined;
|
|
23
|
+
maxItems?: number | undefined;
|
|
24
|
+
pageSize?: number | undefined;
|
|
25
25
|
}, {
|
|
26
26
|
appKey: string;
|
|
27
27
|
actionKey: string;
|
|
28
28
|
actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
|
|
29
29
|
authenticationId?: number | null | undefined;
|
|
30
30
|
inputs?: Record<string, unknown> | undefined;
|
|
31
|
-
pageSize?: number | undefined;
|
|
32
|
-
maxItems?: number | undefined;
|
|
33
31
|
cursor?: string | undefined;
|
|
32
|
+
maxItems?: number | undefined;
|
|
33
|
+
pageSize?: number | undefined;
|
|
34
34
|
}>;
|
|
35
35
|
export type ListInputFieldsOptions = z.infer<typeof ListInputFieldsSchema>;
|
|
36
36
|
export type ListInputFieldsError = ZapierConfigurationError | ZapierApiError | ZapierAuthenticationError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
2
|
import { manifestPlugin, readManifestFromFile, findManifestEntry, getPreferredManifestEntryKey, } from "./index";
|
|
3
3
|
import { createSdk } from "../../sdk";
|
|
4
|
+
import { eventEmissionPlugin } from "../eventEmission";
|
|
4
5
|
// Mock file-utils module
|
|
5
6
|
vi.mock("../../utils/file-utils", () => ({
|
|
6
7
|
readFile: vi.fn(),
|
|
@@ -150,7 +151,15 @@ describe("manifestPlugin", () => {
|
|
|
150
151
|
},
|
|
151
152
|
});
|
|
152
153
|
function createTestSdk(options = {}) {
|
|
153
|
-
return createSdk(options)
|
|
154
|
+
return createSdk(options)
|
|
155
|
+
.addPlugin(() => ({
|
|
156
|
+
context: {
|
|
157
|
+
options: {},
|
|
158
|
+
},
|
|
159
|
+
}))
|
|
160
|
+
.addPlugin(apiPlugin)
|
|
161
|
+
.addPlugin(eventEmissionPlugin)
|
|
162
|
+
.addPlugin(manifestPlugin);
|
|
154
163
|
}
|
|
155
164
|
describe("plugin initialization", () => {
|
|
156
165
|
it("should provide helper functions with direct manifest", () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import { RelayRequestSchema, type RelayRequestOptions } from "./schemas";
|
|
4
|
+
import type { EventEmissionContext } from "../eventEmission";
|
|
4
5
|
export interface RequestPluginProvides {
|
|
5
6
|
request: (options: RelayRequestOptions) => Promise<Response>;
|
|
6
7
|
context: {
|
|
@@ -12,8 +13,9 @@ export interface RequestPluginProvides {
|
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
export declare const requestPlugin: Plugin<{}, // no SDK dependencies
|
|
16
|
+
// no SDK dependencies
|
|
15
17
|
{
|
|
16
18
|
api: ApiClient;
|
|
17
|
-
}, // requires api in context
|
|
19
|
+
} & EventEmissionContext, // requires api in context
|
|
18
20
|
RequestPluginProvides>;
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAmB7D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,WAAW,EAAE,OAAO,kBAAkB,CAAC;aACxC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAChC,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,0BAA0B;AACrE,qBAAqB,CAuEtB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RelayRequestSchema } from "./schemas";
|
|
2
2
|
import { createFunction } from "../../utils/function-utils";
|
|
3
|
+
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
3
4
|
/**
|
|
4
5
|
* Transforms full URLs into Relay format: /relay/{domain}/{path}
|
|
5
6
|
*
|
|
@@ -48,7 +49,7 @@ export const requestPlugin = ({ context }) => {
|
|
|
48
49
|
body,
|
|
49
50
|
headers,
|
|
50
51
|
});
|
|
51
|
-
}, RelayRequestSchema);
|
|
52
|
+
}, RelayRequestSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, "request"));
|
|
52
53
|
return {
|
|
53
54
|
request,
|
|
54
55
|
context: {
|
|
@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
|
2
2
|
import { ZapierValidationError } from "../../types/errors";
|
|
3
3
|
import { requestPlugin } from "./index";
|
|
4
4
|
import { createSdk } from "../../sdk";
|
|
5
|
+
import { eventEmissionPlugin } from "../eventEmission";
|
|
5
6
|
describe("request plugin", () => {
|
|
6
7
|
let mockApiClient;
|
|
7
8
|
let mockFetch;
|
|
@@ -21,7 +22,15 @@ describe("request plugin", () => {
|
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
24
|
function createTestSdk() {
|
|
24
|
-
return createSdk()
|
|
25
|
+
return createSdk()
|
|
26
|
+
.addPlugin(() => ({
|
|
27
|
+
context: {
|
|
28
|
+
options: {},
|
|
29
|
+
},
|
|
30
|
+
}))
|
|
31
|
+
.addPlugin(apiPlugin)
|
|
32
|
+
.addPlugin(eventEmissionPlugin)
|
|
33
|
+
.addPlugin(requestPlugin);
|
|
25
34
|
}
|
|
26
35
|
describe("schema validation", () => {
|
|
27
36
|
it("should throw validation error for missing url", async () => {
|
|
@@ -10,12 +10,23 @@ export declare const RelayRequestSchema: z.ZodObject<{
|
|
|
10
10
|
headers: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodType<Headers, z.ZodTypeDef, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">]>>;
|
|
11
11
|
} & {
|
|
12
12
|
relayBaseUrl: z.ZodOptional<z.ZodString>;
|
|
13
|
+
} & {
|
|
14
|
+
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
isNested?: boolean | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
isNested?: boolean | undefined;
|
|
20
|
+
}>>;
|
|
13
21
|
}, "strip", z.ZodTypeAny, {
|
|
14
22
|
url: string;
|
|
15
23
|
method?: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
|
|
16
24
|
authenticationId?: number | undefined;
|
|
17
25
|
headers?: Record<string, string> | [string, string][] | Headers | undefined;
|
|
18
26
|
body?: any;
|
|
27
|
+
_telemetry?: {
|
|
28
|
+
isNested?: boolean | undefined;
|
|
29
|
+
} | undefined;
|
|
19
30
|
callbackUrl?: string | undefined;
|
|
20
31
|
authenticationTemplate?: string | undefined;
|
|
21
32
|
relayBaseUrl?: string | undefined;
|
|
@@ -25,6 +36,9 @@ export declare const RelayRequestSchema: z.ZodObject<{
|
|
|
25
36
|
authenticationId?: number | undefined;
|
|
26
37
|
headers?: Record<string, string> | [string, string][] | Headers | undefined;
|
|
27
38
|
body?: any;
|
|
39
|
+
_telemetry?: {
|
|
40
|
+
isNested?: boolean | undefined;
|
|
41
|
+
} | undefined;
|
|
28
42
|
callbackUrl?: string | undefined;
|
|
29
43
|
authenticationTemplate?: string | undefined;
|
|
30
44
|
relayBaseUrl?: string | undefined;
|
|
@@ -44,12 +58,23 @@ export declare const RelayFetchSchema: z.ZodObject<{
|
|
|
44
58
|
headers: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodType<Headers, z.ZodTypeDef, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">]>>;
|
|
45
59
|
} & {
|
|
46
60
|
relayBaseUrl: z.ZodOptional<z.ZodString>;
|
|
61
|
+
} & {
|
|
62
|
+
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
isNested?: boolean | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
isNested?: boolean | undefined;
|
|
68
|
+
}>>;
|
|
47
69
|
}, "strip", z.ZodTypeAny, {
|
|
48
70
|
url: string;
|
|
49
71
|
method?: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
|
|
50
72
|
authenticationId?: number | undefined;
|
|
51
73
|
headers?: Record<string, string> | [string, string][] | Headers | undefined;
|
|
52
74
|
body?: any;
|
|
75
|
+
_telemetry?: {
|
|
76
|
+
isNested?: boolean | undefined;
|
|
77
|
+
} | undefined;
|
|
53
78
|
callbackUrl?: string | undefined;
|
|
54
79
|
authenticationTemplate?: string | undefined;
|
|
55
80
|
relayBaseUrl?: string | undefined;
|
|
@@ -59,6 +84,9 @@ export declare const RelayFetchSchema: z.ZodObject<{
|
|
|
59
84
|
authenticationId?: number | undefined;
|
|
60
85
|
headers?: Record<string, string> | [string, string][] | Headers | undefined;
|
|
61
86
|
body?: any;
|
|
87
|
+
_telemetry?: {
|
|
88
|
+
isNested?: boolean | undefined;
|
|
89
|
+
} | undefined;
|
|
62
90
|
callbackUrl?: string | undefined;
|
|
63
91
|
authenticationTemplate?: string | undefined;
|
|
64
92
|
relayBaseUrl?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC+C,CAAC;AAG/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAGrE,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9D;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqB,CAAC;AACnD,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACpD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC1D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { TelemetryMarkerSchema } from "../../utils/function-utils";
|
|
2
3
|
// Pure Zod schema for the request function
|
|
3
4
|
export const RelayRequestSchema = z
|
|
4
5
|
.object({
|
|
@@ -37,6 +38,7 @@ export const RelayRequestSchema = z
|
|
|
37
38
|
.extend({
|
|
38
39
|
relayBaseUrl: z.string().optional().describe("Base URL for Relay service"),
|
|
39
40
|
})
|
|
41
|
+
.merge(TelemetryMarkerSchema)
|
|
40
42
|
.describe("Make authenticated HTTP requests through Zapier's Relay service");
|
|
41
43
|
// Legacy exports for compatibility
|
|
42
44
|
export const RelayFetchSchema = RelayRequestSchema;
|
|
@@ -4,6 +4,7 @@ import { RunActionSchema, type RunActionOptions } from "./schemas";
|
|
|
4
4
|
import type { GetActionPluginProvides } from "../getAction";
|
|
5
5
|
import type { GetAppPluginProvides } from "../getApp";
|
|
6
6
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
7
|
+
import type { EventEmissionContext } from "../eventEmission";
|
|
7
8
|
export interface RunActionPluginProvides {
|
|
8
9
|
runAction: (options?: RunActionOptions) => Promise<{
|
|
9
10
|
data: any[];
|
|
@@ -23,9 +24,10 @@ export interface RunActionPluginProvides {
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
export declare const runActionPlugin: Plugin<GetSdkType<GetActionPluginProvides & GetAppPluginProvides>, // requires getAction and getApp in SDK
|
|
27
|
+
// requires getAction and getApp in SDK
|
|
26
28
|
{
|
|
27
29
|
api: ApiClient;
|
|
28
30
|
getVersionedImplementationId: GetVersionedImplementationId;
|
|
29
|
-
}, // requires api in context
|
|
31
|
+
} & EventEmissionContext, // requires api and eventEmission in context
|
|
30
32
|
RunActionPluginProvides>;
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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,eAAe,EACf,KAAK,gBAAgB,EAEtB,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAQtD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC;QACjD,IAAI,EAAE,GAAG,EAAE,CAAC;QACZ,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACpD,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;KAC7B,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAgFD,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,UAAU,CAAC,uBAAuB,GAAG,oBAAoB,CAAC,EAAE,uCAAuC;AACnG,AAD4D,uCAAuC;AACnG;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,GAAG,oBAAoB,EAAE,4CAA4C;AACtE,uBAAuB,CAmGxB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { ActionResultItemSchema } from "../../schemas/Run";
|
|
|
3
3
|
import { ZapierValidationError, ZapierConfigurationError, ZapierActionError, } from "../../types/errors";
|
|
4
4
|
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
5
5
|
import { appKeyResolver, actionTypeResolver, actionKeyResolver, authenticationIdResolver, inputsResolver, } from "../../resolvers";
|
|
6
|
+
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
6
7
|
async function executeAction(actionOptions) {
|
|
7
8
|
const { api, context, appKey, actionId, actionKey, actionType, executionOptions, authenticationId, } = actionOptions;
|
|
8
9
|
// Use the manifest plugin to get the current implementation ID
|
|
@@ -43,6 +44,7 @@ export const runActionPlugin = ({ sdk, context }) => {
|
|
|
43
44
|
appKey: appKey,
|
|
44
45
|
actionKey: actionKey,
|
|
45
46
|
actionType: actionType,
|
|
47
|
+
_telemetry: { isNested: true },
|
|
46
48
|
});
|
|
47
49
|
// Validate action type matches
|
|
48
50
|
if (actionData.data.action_type !== actionType) {
|
|
@@ -78,7 +80,7 @@ export const runActionPlugin = ({ sdk, context }) => {
|
|
|
78
80
|
data: result.results || [],
|
|
79
81
|
nextCursor: undefined, // No pagination implemented yet
|
|
80
82
|
};
|
|
81
|
-
}, RunActionSchema);
|
|
83
|
+
}, RunActionSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, "runAction"));
|
|
82
84
|
return {
|
|
83
85
|
runAction,
|
|
84
86
|
context: {
|
|
@@ -38,12 +38,24 @@ describe("runAction plugin", () => {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
function createTestSdk() {
|
|
41
|
-
return createSdk(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
})
|
|
41
|
+
return createSdk()
|
|
42
|
+
.addPlugin(() => ({
|
|
43
|
+
context: {
|
|
44
|
+
options: {},
|
|
45
|
+
},
|
|
46
|
+
}))
|
|
47
|
+
.addPlugin(() => ({
|
|
48
|
+
getAction: mockGetAction,
|
|
49
|
+
getApp: mockGetApp,
|
|
50
|
+
context: {
|
|
51
|
+
api: mockApiClient,
|
|
52
|
+
getVersionedImplementationId: () => "SlackCLIAPI@1.21.1",
|
|
53
|
+
eventEmission: {
|
|
54
|
+
emitMethodCalled: vi.fn(),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
}))
|
|
58
|
+
.addPlugin(runActionPlugin);
|
|
47
59
|
}
|
|
48
60
|
describe("schema validation", () => {
|
|
49
61
|
it("should throw validation error for missing appKey", () => {
|
|
@@ -97,11 +109,11 @@ describe("runAction plugin", () => {
|
|
|
97
109
|
actionKey: "send_message",
|
|
98
110
|
inputs: { message: "Hello" },
|
|
99
111
|
});
|
|
100
|
-
expect(mockGetAction).toHaveBeenCalledWith({
|
|
112
|
+
expect(mockGetAction).toHaveBeenCalledWith(expect.objectContaining({
|
|
101
113
|
appKey: "slack",
|
|
102
114
|
actionKey: "send_message",
|
|
103
115
|
actionType: "write",
|
|
104
|
-
});
|
|
116
|
+
}));
|
|
105
117
|
});
|
|
106
118
|
it("should throw error when action type doesn't match", async () => {
|
|
107
119
|
// Mock getAction to return an action with different type
|
|
@@ -18,18 +18,18 @@ export declare const RunActionSchema: z.ZodObject<{
|
|
|
18
18
|
actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
|
|
19
19
|
authenticationId?: number | null | undefined;
|
|
20
20
|
inputs?: Record<string, unknown> | undefined;
|
|
21
|
-
pageSize?: number | undefined;
|
|
22
|
-
maxItems?: number | undefined;
|
|
23
21
|
cursor?: string | undefined;
|
|
22
|
+
maxItems?: number | undefined;
|
|
23
|
+
pageSize?: number | undefined;
|
|
24
24
|
}, {
|
|
25
25
|
appKey: string;
|
|
26
26
|
actionKey: string;
|
|
27
27
|
actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
|
|
28
28
|
authenticationId?: number | null | undefined;
|
|
29
29
|
inputs?: Record<string, unknown> | undefined;
|
|
30
|
-
pageSize?: number | undefined;
|
|
31
|
-
maxItems?: number | undefined;
|
|
32
30
|
cursor?: string | undefined;
|
|
31
|
+
maxItems?: number | undefined;
|
|
32
|
+
pageSize?: number | undefined;
|
|
33
33
|
}>;
|
|
34
34
|
export type RunActionOptions = z.infer<typeof RunActionSchema>;
|
|
35
35
|
export interface RunActionPage {
|
|
@@ -19,18 +19,32 @@ export declare const ListAppsOptionsSchema: z.ZodObject<{
|
|
|
19
19
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
20
20
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
21
21
|
cursor: z.ZodOptional<z.ZodString>;
|
|
22
|
+
} & {
|
|
23
|
+
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
isNested?: boolean | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
isNested?: boolean | undefined;
|
|
29
|
+
}>>;
|
|
22
30
|
}, "strip", z.ZodTypeAny, {
|
|
23
31
|
search?: string | undefined;
|
|
24
32
|
appKeys?: string[] | undefined;
|
|
25
|
-
pageSize?: number | undefined;
|
|
26
|
-
maxItems?: number | undefined;
|
|
27
33
|
cursor?: string | undefined;
|
|
34
|
+
maxItems?: number | undefined;
|
|
35
|
+
pageSize?: number | undefined;
|
|
36
|
+
_telemetry?: {
|
|
37
|
+
isNested?: boolean | undefined;
|
|
38
|
+
} | undefined;
|
|
28
39
|
}, {
|
|
29
40
|
search?: string | undefined;
|
|
30
41
|
appKeys?: string[] | undefined;
|
|
31
|
-
pageSize?: number | undefined;
|
|
32
|
-
maxItems?: number | undefined;
|
|
33
42
|
cursor?: string | undefined;
|
|
43
|
+
maxItems?: number | undefined;
|
|
44
|
+
pageSize?: number | undefined;
|
|
45
|
+
_telemetry?: {
|
|
46
|
+
isNested?: boolean | undefined;
|
|
47
|
+
} | undefined;
|
|
34
48
|
}>;
|
|
35
49
|
export type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
|
|
36
50
|
/**
|
|
@@ -559,13 +573,13 @@ export declare const ListAppsHandlerRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
559
573
|
cursor: z.ZodOptional<z.ZodString>;
|
|
560
574
|
}, "strip", z.ZodTypeAny, {
|
|
561
575
|
search?: string | undefined;
|
|
562
|
-
pageSize?: string | number | undefined;
|
|
563
576
|
cursor?: string | undefined;
|
|
577
|
+
pageSize?: string | number | undefined;
|
|
564
578
|
implementationIds?: string | string[] | undefined;
|
|
565
579
|
}, {
|
|
566
580
|
search?: string | undefined;
|
|
567
|
-
pageSize?: string | number | undefined;
|
|
568
581
|
cursor?: string | undefined;
|
|
582
|
+
pageSize?: string | number | undefined;
|
|
569
583
|
implementationIds?: string | string[] | undefined;
|
|
570
584
|
}>, {
|
|
571
585
|
implementationIds: string[];
|
|
@@ -574,8 +588,8 @@ export declare const ListAppsHandlerRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
574
588
|
cursor: string | undefined;
|
|
575
589
|
}, {
|
|
576
590
|
search?: string | undefined;
|
|
577
|
-
pageSize?: string | number | undefined;
|
|
578
591
|
cursor?: string | undefined;
|
|
592
|
+
pageSize?: string | number | undefined;
|
|
579
593
|
implementationIds?: string | string[] | undefined;
|
|
580
594
|
}>;
|
|
581
595
|
export type ListAppsHandlerRequest = z.infer<typeof ListAppsHandlerRequestSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/temporary-internal-core/schemas/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/temporary-internal-core/schemas/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB4B,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAiCpC,CAAC;AAEN,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { ImplementationMetaSchema } from "../implementations";
|
|
11
|
+
import { TelemetryMarkerSchema } from "../../../utils/function-utils";
|
|
11
12
|
/**
|
|
12
13
|
* Public API schema for listApps operation
|
|
13
14
|
*
|
|
@@ -29,6 +30,7 @@ export const ListAppsOptionsSchema = z
|
|
|
29
30
|
.describe("Maximum total items to return across all pages"),
|
|
30
31
|
cursor: z.string().optional().describe("Cursor to start from"),
|
|
31
32
|
})
|
|
33
|
+
.merge(TelemetryMarkerSchema)
|
|
32
34
|
.describe("List all available apps with optional filtering");
|
|
33
35
|
/**
|
|
34
36
|
* Normalized app item returned by listApps
|
|
@@ -71,6 +71,35 @@ export interface ApplicationLifecycleEvent extends BaseEvent {
|
|
|
71
71
|
shutdown_duration_ms?: number | null;
|
|
72
72
|
active_requests_count?: number | null;
|
|
73
73
|
}
|
|
74
|
-
export
|
|
75
|
-
|
|
74
|
+
export interface MethodCalledEvent extends BaseEvent {
|
|
75
|
+
method_name: string;
|
|
76
|
+
method_module: string | null;
|
|
77
|
+
execution_duration_ms: number;
|
|
78
|
+
success_flag: boolean;
|
|
79
|
+
error_message: string | null;
|
|
80
|
+
error_type: string | null;
|
|
81
|
+
argument_count: number;
|
|
82
|
+
is_paginated: boolean;
|
|
83
|
+
sdk_version: string;
|
|
84
|
+
environment: string | null;
|
|
85
|
+
selected_api: string | null;
|
|
86
|
+
app_id: number | null;
|
|
87
|
+
app_version_id: number | null;
|
|
88
|
+
zap_id: number | null;
|
|
89
|
+
node_id: number | null;
|
|
90
|
+
operation_type: string | null;
|
|
91
|
+
operation_key: string | null;
|
|
92
|
+
call_context: string | null;
|
|
93
|
+
is_retry: boolean;
|
|
94
|
+
retry_attempt: number | null;
|
|
95
|
+
argument_types: string[] | null;
|
|
96
|
+
return_type: string | null;
|
|
97
|
+
caller_method: string | null;
|
|
98
|
+
call_stack_depth: number | null;
|
|
99
|
+
is_synchronous: boolean | null;
|
|
100
|
+
cpu_time_ms: number | null;
|
|
101
|
+
memory_usage_bytes: number | null;
|
|
102
|
+
}
|
|
103
|
+
export type TelemetryEvent = ErrorOccurredEvent | ApplicationLifecycleEvent | MethodCalledEvent;
|
|
104
|
+
export type TelemetryEventType = "error_occurred" | "application_lifecycle" | "method_called";
|
|
76
105
|
//# sourceMappingURL=telemetry-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-events.d.ts","sourceRoot":"","sources":["../../src/types/telemetry-events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAGD,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAA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B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAGD,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,yBAAyB,GACzB,iBAAiB,CAAC;AAGtB,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,uBAAuB,GACvB,eAAe,CAAC"}
|
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generic utility functions for creating paginated SDK functions
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for telemetry marker to prevent nested telemetry emissions.
|
|
7
|
+
* Used to extend options schemas with proper typing.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TelemetryMarkerSchema: z.ZodObject<{
|
|
10
|
+
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
isNested?: boolean | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
isNested?: boolean | undefined;
|
|
16
|
+
}>>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
_telemetry?: {
|
|
19
|
+
isNested?: boolean | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
_telemetry?: {
|
|
23
|
+
isNested?: boolean | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Marker for SDK method calls to control telemetry behavior
|
|
28
|
+
*/
|
|
29
|
+
export type TelemetryMarker = z.infer<typeof TelemetryMarkerSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* Callbacks for telemetry events during function execution
|
|
32
|
+
*/
|
|
33
|
+
export interface TelemetryCallbacks {
|
|
34
|
+
onMethodCalled?: (data: {
|
|
35
|
+
methodName: string;
|
|
36
|
+
durationMs: number;
|
|
37
|
+
success: boolean;
|
|
38
|
+
error?: Error;
|
|
39
|
+
argumentCount: number;
|
|
40
|
+
isPaginated: boolean;
|
|
41
|
+
}) => void;
|
|
42
|
+
}
|
|
5
43
|
/**
|
|
6
44
|
* Helper function to extract cursor from pagination data
|
|
7
45
|
*/
|
|
@@ -13,9 +51,10 @@ export declare function extractCursor(data: {
|
|
|
13
51
|
*
|
|
14
52
|
* @param coreFn - Function that returns T directly or throws errors
|
|
15
53
|
* @param schema - Optional Zod schema for validation
|
|
54
|
+
* @param telemetry - Optional telemetry callbacks
|
|
16
55
|
* @returns A function that normalizes and rethrows errors
|
|
17
56
|
*/
|
|
18
|
-
export declare function createFunction<TOptions, TResult, TSchemaOptions extends TOptions = TOptions>(coreFn: (options: TOptions) => Promise<TResult>, schema?: z.ZodSchema<TSchemaOptions
|
|
57
|
+
export declare function createFunction<TOptions, TResult, TSchemaOptions extends TOptions = TOptions>(coreFn: (options: TOptions) => Promise<TResult>, schema?: z.ZodSchema<TSchemaOptions>, telemetry?: TelemetryCallbacks): (options?: TOptions) => Promise<TResult>;
|
|
19
58
|
/**
|
|
20
59
|
* Higher-order function that creates a paginated function that wraps results in {data}
|
|
21
60
|
*
|
|
@@ -34,7 +73,7 @@ type ItemType<TResult> = TResult extends {
|
|
|
34
73
|
} ? TData extends readonly (infer TItem)[] ? TItem : TData : TResult extends readonly (infer TItem)[] ? TItem : TResult;
|
|
35
74
|
export declare function createPaginatedFunction<TOptions, TResult, TSchemaOptions extends TOptions = TOptions>(coreFn: (options: TOptions & {
|
|
36
75
|
pageSize: number;
|
|
37
|
-
}) => Promise<TResult>, schema?: z.ZodSchema<TSchemaOptions
|
|
76
|
+
}) => Promise<TResult>, schema?: z.ZodSchema<TSchemaOptions>, telemetry?: TelemetryCallbacks): (options?: TOptions & {
|
|
38
77
|
cursor?: string;
|
|
39
78
|
pageSize?: number;
|
|
40
79
|
maxItems?: number;
|