@keystrokehq/serpapi 0.0.9 → 0.0.16-integration-id-canonicalization.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/README.md +5 -0
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +3 -0
- package/dist/index.d.mts +3 -3760
- package/dist/index.mjs +3 -2765
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/schemas/index.d.mts +1 -0
- package/dist/schemas/index.mjs +1 -0
- package/dist/serpapi.credential-set-5iG6pd3Y.d.mts +14 -0
- package/dist/serpapi.credential-set-CuEBudaA.mjs +15 -0
- package/dist/youtube-video-transcript.operation-BoQHn90s.mjs +2763 -0
- package/dist/youtube-video-transcript.operation-IqJOT2iH.d.mts +1988 -0
- package/package.json +14 -6
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/integration-9TPiVaR2.d.mts +0 -39
- package/dist/integration-CLoyNwR6.mjs +0 -107
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/serpapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16-integration-id-canonicalization.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -9,9 +9,17 @@
|
|
|
9
9
|
"types": "./dist/index.d.mts",
|
|
10
10
|
"default": "./dist/index.mjs"
|
|
11
11
|
},
|
|
12
|
-
"./
|
|
13
|
-
"types": "./dist/
|
|
14
|
-
"default": "./dist/
|
|
12
|
+
"./credential-sets": {
|
|
13
|
+
"types": "./dist/credential-sets/index.d.mts",
|
|
14
|
+
"default": "./dist/credential-sets/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"./operations": {
|
|
17
|
+
"types": "./dist/operations/index.d.mts",
|
|
18
|
+
"default": "./dist/operations/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./schemas": {
|
|
21
|
+
"types": "./dist/schemas/index.d.mts",
|
|
22
|
+
"default": "./dist/schemas/index.mjs"
|
|
15
23
|
}
|
|
16
24
|
},
|
|
17
25
|
"files": [
|
|
@@ -33,8 +41,8 @@
|
|
|
33
41
|
"vitest": "^4.0.18",
|
|
34
42
|
"@keystrokehq/core": "^0.0.12",
|
|
35
43
|
"@keystrokehq/test-utils": "0.0.0",
|
|
36
|
-
"@keystrokehq/
|
|
37
|
-
"@keystrokehq/
|
|
44
|
+
"@keystrokehq/integration-authoring": "0.0.9",
|
|
45
|
+
"@keystrokehq/typescript-config": "0.0.0"
|
|
38
46
|
},
|
|
39
47
|
"keywords": [
|
|
40
48
|
"serpapi",
|
package/dist/_official/index.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
import { CredentialSet, Operation } from "@keystrokehq/core";
|
|
4
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
5
|
-
import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
|
|
6
|
-
|
|
7
|
-
//#region ../../packages/integration-authoring/dist/official/index.d.mts
|
|
8
|
-
/**
|
|
9
|
-
* Creates a factory for Keystroke-official integration operations.
|
|
10
|
-
*
|
|
11
|
-
* It keeps the same flat `run(input, credentials)` ergonomics as the generic
|
|
12
|
-
* operation factory, while registering official metadata for builder/runtime
|
|
13
|
-
* operation metadata.
|
|
14
|
-
*/
|
|
15
|
-
declare function createOfficialOperationFactory(credentialSet: any): (config: any) => Operation<any, any, any[], undefined>;
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/integration.d.ts
|
|
18
|
-
declare const serpApiOfficialIntegration: {
|
|
19
|
-
id: "serpapi";
|
|
20
|
-
name: string;
|
|
21
|
-
description: string;
|
|
22
|
-
auth: z.ZodObject<{
|
|
23
|
-
SERPAPI_API_KEY: z.ZodString;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
proxy: {
|
|
26
|
-
hosts: string[];
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
declare const serpApiBundle: undefined<"serpapi", z.ZodObject<{
|
|
30
|
-
SERPAPI_API_KEY: z.ZodString;
|
|
31
|
-
}, z.core.$strip>>;
|
|
32
|
-
declare const serpApi: _keystrokehq_core0.CredentialSet<"serpapi", z.ZodObject<{
|
|
33
|
-
SERPAPI_API_KEY: z.ZodString;
|
|
34
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
35
|
-
SERPAPI_API_KEY: z.ZodString;
|
|
36
|
-
}, z.core.$strip>>[] | undefined>;
|
|
37
|
-
type SerpApiCredentials = InferCredentialSetAuth<typeof serpApi>;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { createOfficialOperationFactory as a, serpApiOfficialIntegration as i, serpApi as n, serpApiBundle as r, SerpApiCredentials as t };
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { CredentialSet, Operation } from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region ../../packages/integration-authoring/dist/official/runtime.mjs
|
|
5
|
-
const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
|
|
6
|
-
function getRegistry() {
|
|
7
|
-
const globalStore = globalThis;
|
|
8
|
-
if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
return globalStore[REGISTRY_KEY];
|
|
10
|
-
}
|
|
11
|
-
function registerOfficialOperation(operation, metadata) {
|
|
12
|
-
getRegistry().set(operation, Object.freeze({ ...metadata }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../packages/integration-authoring/dist/official/index.mjs
|
|
17
|
-
const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
|
|
18
|
-
function stripOfficialCredentialSetIdPrefix(id) {
|
|
19
|
-
return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Creates a factory for Keystroke-official integration operations.
|
|
23
|
-
*
|
|
24
|
-
* It keeps the same flat `run(input, credentials)` ergonomics as the generic
|
|
25
|
-
* operation factory, while registering official metadata for builder/runtime
|
|
26
|
-
* operation metadata.
|
|
27
|
-
*/
|
|
28
|
-
function createOfficialOperationFactory(credentialSet) {
|
|
29
|
-
const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
|
|
30
|
-
return (config) => {
|
|
31
|
-
const wrappedRun = async (input, ctx) => {
|
|
32
|
-
const creds = ctx.credentials[credentialSet.id];
|
|
33
|
-
return config.run(input, creds);
|
|
34
|
-
};
|
|
35
|
-
const operation = new Operation({
|
|
36
|
-
id: config.id,
|
|
37
|
-
name: config.name,
|
|
38
|
-
description: config.description,
|
|
39
|
-
input: config.input,
|
|
40
|
-
output: config.output,
|
|
41
|
-
credentialSets: [credentialSet],
|
|
42
|
-
...config.tags !== void 0 ? { tags: config.tags } : {},
|
|
43
|
-
...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
|
|
44
|
-
...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
|
|
45
|
-
...config.retries !== void 0 ? { retries: config.retries } : {},
|
|
46
|
-
...config.timeout !== void 0 ? { timeout: config.timeout } : {},
|
|
47
|
-
...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
|
|
48
|
-
run: wrappedRun
|
|
49
|
-
});
|
|
50
|
-
registerOfficialOperation(operation, { integrationId });
|
|
51
|
-
return operation;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Creates an official integration bundle from a single config object.
|
|
56
|
-
*
|
|
57
|
-
* - Creates the public `CredentialSet` internally.
|
|
58
|
-
* - Accepts optional `internal` fields for Keystroke-owned platform credentials.
|
|
59
|
-
*/
|
|
60
|
-
function defineOfficialIntegration(config) {
|
|
61
|
-
const internalCredentialSets = config.internal ?? {};
|
|
62
|
-
const allInternalCredentialSets = [
|
|
63
|
-
...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
|
|
64
|
-
...internalCredentialSets.providerAppVariants ?? [],
|
|
65
|
-
...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
|
|
66
|
-
...internalCredentialSets.other ?? []
|
|
67
|
-
];
|
|
68
|
-
const credentialSet = new CredentialSet({
|
|
69
|
-
id: config.id,
|
|
70
|
-
name: config.name,
|
|
71
|
-
description: config.description,
|
|
72
|
-
auth: config.auth,
|
|
73
|
-
...config.connections ? { connections: config.connections } : {},
|
|
74
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
75
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {}
|
|
76
|
-
});
|
|
77
|
-
return Object.freeze({
|
|
78
|
-
integration: {
|
|
79
|
-
id: config.id,
|
|
80
|
-
name: config.name,
|
|
81
|
-
...config.description !== void 0 ? { description: config.description } : {},
|
|
82
|
-
auth: config.auth,
|
|
83
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
84
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {},
|
|
85
|
-
...config.connections ? { connections: config.connections } : {}
|
|
86
|
-
},
|
|
87
|
-
credentialSet,
|
|
88
|
-
internalCredentialSets,
|
|
89
|
-
allInternalCredentialSets
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/integration.ts
|
|
95
|
-
const serpApiAuthSchema = z.object({ SERPAPI_API_KEY: z.string().min(1) });
|
|
96
|
-
const serpApiOfficialIntegration = {
|
|
97
|
-
id: "serpapi",
|
|
98
|
-
name: "SerpApi",
|
|
99
|
-
description: "Search engine results from Google, Bing, Yahoo, YouTube, and 90+ other engines",
|
|
100
|
-
auth: serpApiAuthSchema,
|
|
101
|
-
proxy: { hosts: ["serpapi.com"] }
|
|
102
|
-
};
|
|
103
|
-
const serpApiBundle = defineOfficialIntegration(serpApiOfficialIntegration);
|
|
104
|
-
const serpApi = serpApiBundle.credentialSet;
|
|
105
|
-
|
|
106
|
-
//#endregion
|
|
107
|
-
export { createOfficialOperationFactory as i, serpApiBundle as n, serpApiOfficialIntegration as r, serpApi as t };
|