@keystrokehq/exa 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/contents.schema-BNgTB2DN.mjs +133 -0
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +3 -0
- package/dist/exa.credential-set-BGLENRlR.d.mts +14 -0
- package/dist/exa.credential-set-Ba-RsxL2.mjs +15 -0
- package/dist/index.d.mts +4 -1260
- package/dist/index.mjs +4 -576
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/schemas/index.d.mts +2 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/search.schema-Cw-d91N6.d.mts +204 -0
- package/dist/update-monitor.operation-D-vWJFP3.mjs +478 -0
- package/dist/update-monitor.operation-Dm50YoS7.d.mts +570 -0
- package/package.json +14 -6
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/integration-BBhYAh8z.mjs +0 -107
- package/dist/integration-Ml2KWc_6.d.mts +0 -28
|
@@ -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 exaAuthSchema = z.object({ EXA_API_KEY: z.string().min(1) });
|
|
96
|
-
const exaOfficialIntegration = {
|
|
97
|
-
id: "exa",
|
|
98
|
-
name: "Exa",
|
|
99
|
-
description: "AI-native semantic web search, content extraction, and monitoring",
|
|
100
|
-
auth: exaAuthSchema,
|
|
101
|
-
proxy: { hosts: ["api.exa.ai"] }
|
|
102
|
-
};
|
|
103
|
-
const exaBundle = defineOfficialIntegration(exaOfficialIntegration);
|
|
104
|
-
const exa = exaBundle.credentialSet;
|
|
105
|
-
|
|
106
|
-
//#endregion
|
|
107
|
-
export { exaBundle as n, createOfficialOperationFactory as r, exa as t };
|
|
@@ -1,28 +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 exaBundle: undefined<"exa", z.ZodObject<{
|
|
19
|
-
EXA_API_KEY: z.ZodString;
|
|
20
|
-
}, z.core.$strip>>;
|
|
21
|
-
declare const exa: _keystrokehq_core0.CredentialSet<"exa", z.ZodObject<{
|
|
22
|
-
EXA_API_KEY: z.ZodString;
|
|
23
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
24
|
-
EXA_API_KEY: z.ZodString;
|
|
25
|
-
}, z.core.$strip>>[] | undefined>;
|
|
26
|
-
type ExaCredentials = InferCredentialSetAuth<typeof exa>;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { createOfficialOperationFactory as i, exa as n, exaBundle as r, ExaCredentials as t };
|