@commandable/integration-data 0.0.1 → 0.0.4
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/dist/credentials-index.d.ts +4 -21
- package/dist/credentials-index.d.ts.map +1 -1
- package/dist/credentials-index.js +407 -215
- package/dist/credentials-index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +38 -2
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +70 -16
- package/dist/loader.js.map +1 -1
- package/integrations/__tests__/liveHarness.ts +84 -0
- package/integrations/__tests__/usageParity.ts +54 -0
- package/integrations/airtable/__tests__/get_handlers.test.ts +18 -15
- package/integrations/airtable/__tests__/usage_parity.test.ts +3 -29
- package/integrations/airtable/__tests__/write_and_admin_handlers.test.ts +20 -17
- package/integrations/airtable/credentials.json +21 -16
- package/integrations/github/__tests__/get_handlers.test.ts +101 -108
- package/integrations/github/__tests__/usage_parity.test.ts +15 -27
- package/integrations/github/__tests__/write_handlers.test.ts +219 -306
- package/integrations/github/credentials.json +40 -15
- package/integrations/github/credentials_hint_classic_pat.md +8 -0
- package/integrations/github/credentials_hint_fine_grained_pat.md +9 -0
- package/integrations/github/manifest.json +2 -2
- package/integrations/google-calendar/__tests__/get_handlers.test.ts +21 -13
- package/integrations/google-calendar/__tests__/usage_parity.test.ts +3 -28
- package/integrations/google-calendar/__tests__/write_and_admin_handlers.test.ts +24 -17
- package/integrations/google-calendar/credentials.json +50 -29
- package/integrations/google-calendar/credentials_hint_oauth_token.md +8 -0
- package/integrations/google-calendar/credentials_hint_service_account.md +10 -0
- package/integrations/google-docs/__tests__/get_handlers.test.ts +87 -61
- package/integrations/google-docs/__tests__/usage_parity.test.ts +3 -28
- package/integrations/google-docs/__tests__/write_handlers.test.ts +248 -245
- package/integrations/google-docs/credentials.json +50 -29
- package/integrations/google-docs/credentials_hint_oauth_token.md +8 -0
- package/integrations/google-docs/credentials_hint_service_account.md +10 -0
- package/integrations/google-drive/credentials.json +57 -0
- package/integrations/google-drive/credentials_hint_oauth_token.md +8 -0
- package/integrations/google-drive/credentials_hint_service_account.md +10 -0
- package/integrations/google-drive/handlers/create_file.js +15 -0
- package/integrations/google-drive/handlers/create_folder.js +15 -0
- package/integrations/google-drive/handlers/delete_file.js +14 -0
- package/integrations/google-drive/handlers/get_file.js +7 -0
- package/integrations/google-drive/handlers/move_file.js +12 -0
- package/integrations/google-drive/manifest.json +42 -0
- package/integrations/google-drive/schemas/create_file.json +12 -0
- package/integrations/google-drive/schemas/create_folder.json +11 -0
- package/integrations/google-drive/schemas/delete_file.json +10 -0
- package/integrations/google-drive/schemas/get_file.json +10 -0
- package/integrations/google-drive/schemas/move_file.json +12 -0
- package/integrations/google-sheet/__tests__/get_handlers.test.ts +47 -55
- package/integrations/google-sheet/__tests__/usage_parity.test.ts +3 -29
- package/integrations/google-sheet/__tests__/write_handlers.test.ts +64 -63
- package/integrations/google-sheet/credentials.json +50 -29
- package/integrations/google-sheet/credentials_hint_oauth_token.md +8 -0
- package/integrations/google-sheet/credentials_hint_service_account.md +10 -0
- package/integrations/google-slides/__tests__/get_handlers.test.ts +37 -36
- package/integrations/google-slides/__tests__/usage_parity.test.ts +3 -28
- package/integrations/google-slides/__tests__/write_handlers.test.ts +65 -58
- package/integrations/google-slides/credentials.json +50 -29
- package/integrations/google-slides/credentials_hint_oauth_token.md +8 -0
- package/integrations/google-slides/credentials_hint_service_account.md +10 -0
- package/integrations/notion/__tests__/get_handlers.test.ts +18 -15
- package/integrations/notion/__tests__/usage_parity.test.ts +3 -28
- package/integrations/notion/__tests__/write_and_admin_handlers.test.ts +56 -60
- package/integrations/notion/credentials.json +22 -17
- package/integrations/trello/__tests__/get_handlers.test.ts +58 -73
- package/integrations/trello/__tests__/usage_parity.test.ts +3 -28
- package/integrations/trello/__tests__/write_and_admin_handlers.test.ts +49 -67
- package/integrations/trello/credentials.json +26 -21
- package/integrations/trello/handlers/close_board.js +6 -0
- package/integrations/trello/handlers/create_board.js +11 -0
- package/integrations/trello/handlers/delete_board.js +13 -0
- package/integrations/trello/manifest.json +21 -0
- package/integrations/trello/schemas/close_board.json +10 -0
- package/integrations/trello/schemas/create_board.json +12 -0
- package/integrations/trello/schemas/delete_board.json +10 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials-index.js","sourceRoot":"","sources":["../src/credentials-index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"credentials-index.js","sourceRoot":"","sources":["../src/credentials-index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,CAAC,MAAM,iBAAiB,GAA2C;IACvE,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,qBAAqB,EAAE;oBACrB,KAAK,EAAE,uBAAuB;oBAC9B,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,KAAK,EAAE,uBAAuB;gCAC9B,WAAW,EAAE,iCAAiC;6BAC/C;yBACF;wBACD,QAAQ,EAAE,CAAC,OAAO,CAAC;wBACnB,oBAAoB,EAAE,KAAK;qBAC5B;oBACD,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE;iBAC9D;aACF;YACD,OAAO,EAAE,uBAAuB;SACjC;QACD,KAAK,EAAE;YACL,qBAAqB,EAAE;;kGAEqE;SAC7F;KACF;IAED,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,WAAW,EAAE;oBACX,KAAK,EAAE,+BAA+B;oBACtC,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,KAAK,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;KACF;IAED,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,aAAa,EAAE;oBACb,KAAK,EAAE,iBAAiB;oBACxB,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,6DAA6D;6BAC3E;4BACD,QAAQ,EAAE;gCACR,IAAI,EAAE,QAAQ;gCACd,KAAK,EAAE,WAAW;gCAClB,WAAW,EAAE,mFAAmF;6BACjG;yBACF;wBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;wBAChC,oBAAoB,EAAE,KAAK;qBAC5B;oBACD,SAAS,EAAE;wBACT,KAAK,EAAE;4BACL,GAAG,EAAE,YAAY;4BACjB,KAAK,EAAE,cAAc;yBACtB;qBACF;iBACF;aACF;YACD,OAAO,EAAE,eAAe;SACzB;QACD,KAAK,EAAE;YACL,aAAa,EAAE;;;mDAG8B;SAC9C;KACF;CACF,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { IntegrationCredentialConfig, DisplayCardData, ToolData, IntegrationCatalogItem, } from './loader.js';
|
|
2
|
-
export { integrationDataRoot, loadIntegrationManifest, loadIntegrationPrompt, loadIntegrationTools, loadIntegrationDisplayCards, loadIntegrationCredentialConfig, listIntegrationTypes, listIntegrationCatalog, } from './loader.js';
|
|
1
|
+
export type { IntegrationCredentialConfig, CredentialVariantConfig, CredentialVariantsFile, DisplayCardData, ToolData, IntegrationCatalogItem, } from './loader.js';
|
|
2
|
+
export { integrationDataRoot, loadIntegrationManifest, loadIntegrationPrompt, loadIntegrationTools, loadIntegrationDisplayCards, loadIntegrationCredentialConfig, loadIntegrationVariants, loadIntegrationHint, listIntegrationTypes, listIntegrationCatalog, } from './loader.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,eAAe,EACf,QAAQ,EACR,sBAAsB,GACvB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,QAAQ,EACR,sBAAsB,GACvB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { integrationDataRoot, loadIntegrationManifest, loadIntegrationPrompt, loadIntegrationTools, loadIntegrationDisplayCards, loadIntegrationCredentialConfig, listIntegrationTypes, listIntegrationCatalog, } from './loader.js';
|
|
1
|
+
export { integrationDataRoot, loadIntegrationManifest, loadIntegrationPrompt, loadIntegrationTools, loadIntegrationDisplayCards, loadIntegrationCredentialConfig, loadIntegrationVariants, loadIntegrationHint, listIntegrationTypes, listIntegrationCatalog, } from './loader.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,aAAa,CAAA"}
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import type { JSONSchema7 } from 'json-schema';
|
|
2
|
+
export interface CredentialVariantConfig {
|
|
3
|
+
label: string;
|
|
4
|
+
schema: JSONSchema7;
|
|
5
|
+
injection: {
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
query?: Record<string, string>;
|
|
8
|
+
};
|
|
9
|
+
preprocess?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CredentialVariantsFile {
|
|
12
|
+
variants: Record<string, CredentialVariantConfig>;
|
|
13
|
+
default: string;
|
|
14
|
+
}
|
|
15
|
+
/** Resolved config for a single credential variant -- what the proxy actually uses. */
|
|
2
16
|
export interface IntegrationCredentialConfig {
|
|
17
|
+
variantKey: string;
|
|
18
|
+
label: string;
|
|
3
19
|
schema: JSONSchema7;
|
|
4
20
|
injection: {
|
|
5
21
|
headers?: Record<string, string>;
|
|
6
22
|
query?: Record<string, string>;
|
|
7
23
|
};
|
|
24
|
+
preprocess?: string;
|
|
8
25
|
}
|
|
9
26
|
interface ToolRef {
|
|
10
27
|
name: string;
|
|
@@ -12,6 +29,7 @@ interface ToolRef {
|
|
|
12
29
|
inputSchema: string;
|
|
13
30
|
handler: string;
|
|
14
31
|
scope?: 'read' | 'write' | 'admin';
|
|
32
|
+
credentialVariants?: string[];
|
|
15
33
|
}
|
|
16
34
|
type FlatTools = ToolRef[];
|
|
17
35
|
interface DisplayCardRef {
|
|
@@ -53,12 +71,30 @@ export declare function integrationDataRoot(): string;
|
|
|
53
71
|
export declare function loadIntegrationManifest(type: string): Manifest | null;
|
|
54
72
|
export declare function loadIntegrationPrompt(type: string): string | null;
|
|
55
73
|
export declare function loadIntegrationDisplayCards(type: string): DisplayCardData[];
|
|
56
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Load tools for an integration, optionally filtered to only those compatible
|
|
76
|
+
* with the active credential variant. Tools without a `credentialVariants`
|
|
77
|
+
* whitelist are always included.
|
|
78
|
+
*/
|
|
79
|
+
export declare function loadIntegrationTools(type: string, opts?: {
|
|
80
|
+
credentialVariant?: string;
|
|
81
|
+
}): {
|
|
57
82
|
read: ToolData[];
|
|
58
83
|
write: ToolData[];
|
|
59
84
|
admin: ToolData[];
|
|
60
85
|
} | null;
|
|
61
|
-
|
|
86
|
+
/** Load the full variants file for an integration. */
|
|
87
|
+
export declare function loadIntegrationVariants(type: string): CredentialVariantsFile | null;
|
|
88
|
+
/**
|
|
89
|
+
* Load the resolved credential config for a specific variant (or the default
|
|
90
|
+
* variant if none is specified).
|
|
91
|
+
*/
|
|
92
|
+
export declare function loadIntegrationCredentialConfig(type: string, variantKey?: string | null): IntegrationCredentialConfig | null;
|
|
93
|
+
/**
|
|
94
|
+
* Resolve the hint markdown for a specific variant. Falls back to the
|
|
95
|
+
* generic credentials_hint.md if no variant-specific file exists.
|
|
96
|
+
*/
|
|
97
|
+
export declare function loadIntegrationHint(type: string, variantKey?: string | null): string | null;
|
|
62
98
|
export interface IntegrationCatalogItem {
|
|
63
99
|
type: string;
|
|
64
100
|
name: string;
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAK9C,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,WAAW,CAAA;IACnB,SAAS,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChC,KAAK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KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,GAAG,IAAI,CA4BnE;AAED,sDAAsD;AACtD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,GAAG,IAAI,CAenF;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,2BAA2B,GAAG,IAAI,CAoBpC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAyB3F;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAe/C;AAED,wBAAgB,sBAAsB,IAAI,sBAAsB,EAAE,CAejE"}
|
package/dist/loader.js
CHANGED
|
@@ -83,15 +83,23 @@ export function loadIntegrationDisplayCards(type) {
|
|
|
83
83
|
};
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Load tools for an integration, optionally filtered to only those compatible
|
|
88
|
+
* with the active credential variant. Tools without a `credentialVariants`
|
|
89
|
+
* whitelist are always included.
|
|
90
|
+
*/
|
|
91
|
+
export function loadIntegrationTools(type, opts) {
|
|
87
92
|
const manifest = loadIntegrationManifest(type);
|
|
88
93
|
if (!manifest)
|
|
89
94
|
return null;
|
|
95
|
+
const activeVariant = opts?.credentialVariant;
|
|
90
96
|
const flat = manifest.tools;
|
|
91
97
|
const readRefs = [];
|
|
92
98
|
const writeRefs = [];
|
|
93
99
|
const adminRefs = [];
|
|
94
100
|
for (const t of flat) {
|
|
101
|
+
if (activeVariant && t.credentialVariants && !t.credentialVariants.includes(activeVariant))
|
|
102
|
+
continue;
|
|
95
103
|
const scope = t.scope || 'read';
|
|
96
104
|
if (scope === 'read')
|
|
97
105
|
readRefs.push(t);
|
|
@@ -102,28 +110,74 @@ export function loadIntegrationTools(type) {
|
|
|
102
110
|
else
|
|
103
111
|
readRefs.push(t);
|
|
104
112
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
return {
|
|
114
|
+
read: readRefs.map(t => materializeTool(type, t)),
|
|
115
|
+
write: writeRefs.map(t => materializeTool(type, t)),
|
|
116
|
+
admin: adminRefs.map(t => materializeTool(type, t)),
|
|
117
|
+
};
|
|
109
118
|
}
|
|
110
|
-
|
|
119
|
+
/** Load the full variants file for an integration. */
|
|
120
|
+
export function loadIntegrationVariants(type) {
|
|
111
121
|
const dir = integrationDir(type);
|
|
112
122
|
const path = resolve(dir, 'credentials.json');
|
|
113
123
|
if (!existsSync(path))
|
|
114
124
|
return null;
|
|
115
125
|
try {
|
|
116
126
|
const raw = readJsonFile(path);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
if (!raw?.variants)
|
|
128
|
+
return null;
|
|
129
|
+
return raw;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Load the resolved credential config for a specific variant (or the default
|
|
137
|
+
* variant if none is specified).
|
|
138
|
+
*/
|
|
139
|
+
export function loadIntegrationCredentialConfig(type, variantKey) {
|
|
140
|
+
const file = loadIntegrationVariants(type);
|
|
141
|
+
if (!file)
|
|
142
|
+
return null;
|
|
143
|
+
const key = variantKey || file.default;
|
|
144
|
+
const variant = file.variants[key];
|
|
145
|
+
if (!variant)
|
|
146
|
+
return null;
|
|
147
|
+
return {
|
|
148
|
+
variantKey: key,
|
|
149
|
+
label: variant.label,
|
|
150
|
+
schema: ensureSchemaObject(variant.schema),
|
|
151
|
+
injection: {
|
|
152
|
+
headers: variant.injection?.headers || undefined,
|
|
153
|
+
query: variant.injection?.query || undefined,
|
|
154
|
+
},
|
|
155
|
+
preprocess: variant.preprocess,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Resolve the hint markdown for a specific variant. Falls back to the
|
|
160
|
+
* generic credentials_hint.md if no variant-specific file exists.
|
|
161
|
+
*/
|
|
162
|
+
export function loadIntegrationHint(type, variantKey) {
|
|
163
|
+
const dir = integrationDir(type);
|
|
164
|
+
if (variantKey) {
|
|
165
|
+
const variantHintPath = resolve(dir, `credentials_hint_${variantKey}.md`);
|
|
166
|
+
if (existsSync(variantHintPath)) {
|
|
167
|
+
try {
|
|
168
|
+
const content = readFileSync(variantHintPath, 'utf8').trim();
|
|
169
|
+
if (content.length)
|
|
170
|
+
return content;
|
|
171
|
+
}
|
|
172
|
+
catch { }
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const fallbackPath = resolve(dir, 'credentials_hint.md');
|
|
176
|
+
if (!existsSync(fallbackPath))
|
|
177
|
+
return null;
|
|
178
|
+
try {
|
|
179
|
+
const content = readFileSync(fallbackPath, 'utf8').trim();
|
|
180
|
+
return content.length ? content : null;
|
|
127
181
|
}
|
|
128
182
|
catch {
|
|
129
183
|
return null;
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY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AC,IAAI,CAAA;IACxC,CAAC;IACD,MAAM,CAAC;QACL,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAOD,MAAM,UAAU,oBAAoB;IAClC,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAA;IAClC,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE;YAChD,IAAI,CAAC;gBACH,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;YACrD,CAAC;YACD,MAAM,CAAC;gBACL,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,CAAC;QACL,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAA;IACpC,MAAM,KAAK,GAA6B,EAAE,CAAA;IAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;YAC9C,IAAI,CAAC,QAAQ;gBACX,SAAQ;YACV,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAA;QACnD,CAAC;QACD,MAAM,CAAC;YACL,wCAAwC;QAC1C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { IntegrationProxy } from '../../../server/src/integrations/proxy.js'
|
|
2
|
+
import { loadIntegrationTools } from '../../../server/src/integrations/dataLoader.js'
|
|
3
|
+
|
|
4
|
+
type ToolDef = { name: string, handlerCode: string }
|
|
5
|
+
|
|
6
|
+
type ToolSet = {
|
|
7
|
+
read: ToolDef[]
|
|
8
|
+
write: ToolDef[]
|
|
9
|
+
admin: ToolDef[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function hasEnv(...keys: string[]) {
|
|
13
|
+
const env = process.env as Record<string, string | undefined>
|
|
14
|
+
return keys.every(k => Boolean(env[k] && String(env[k]).trim().length > 0))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function safeCleanup(fn: () => Promise<any>) {
|
|
18
|
+
return fn().catch(() => {})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function createCredentialStore(getCredentials: () => Promise<any>) {
|
|
22
|
+
return { getCredentials }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function createIntegrationNode(type: string, opts?: { id?: string, label?: string, credentialId?: string, credentialVariant?: string }) {
|
|
26
|
+
const id = opts?.id || `node-${type}`
|
|
27
|
+
return {
|
|
28
|
+
spaceId: 'ci',
|
|
29
|
+
id,
|
|
30
|
+
referenceId: id,
|
|
31
|
+
type,
|
|
32
|
+
label: opts?.label || type,
|
|
33
|
+
connectionMethod: 'credentials',
|
|
34
|
+
credentialId: opts?.credentialId || `${type}-creds`,
|
|
35
|
+
credentialVariant: opts?.credentialVariant,
|
|
36
|
+
} as any
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function createProxy(credentialStore: { getCredentials: () => Promise<any> }) {
|
|
40
|
+
return new IntegrationProxy({ credentialStore })
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getTools(type: string, credentialVariant?: string): ToolSet {
|
|
44
|
+
const tools = loadIntegrationTools(type, { credentialVariant })
|
|
45
|
+
if (!tools)
|
|
46
|
+
throw new Error(`Missing integration tools for '${type}'`)
|
|
47
|
+
return tools as any
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function compileTool(proxy: IntegrationProxy, node: any, tool: ToolDef) {
|
|
51
|
+
const integration = { fetch: (path: string, init?: RequestInit) => proxy.call(node, path, init) }
|
|
52
|
+
const build = new Function('integration', `return (${tool.handlerCode});`)
|
|
53
|
+
return build(integration) as (input: any) => Promise<any>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function createToolbox(type: string, proxy: IntegrationProxy, node: any, credentialVariant?: string) {
|
|
57
|
+
const tools = getTools(type, credentialVariant)
|
|
58
|
+
|
|
59
|
+
const findTool = (scope: keyof ToolSet, name: string) => tools[scope].find(t => t.name === name)
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
/** Returns true if the tool exists in this variant's toolset. */
|
|
63
|
+
hasTool: (scope: keyof ToolSet, name: string) => !!findTool(scope, name),
|
|
64
|
+
|
|
65
|
+
read: (name: string) => {
|
|
66
|
+
const tool = findTool('read', name)
|
|
67
|
+
if (!tool)
|
|
68
|
+
throw new Error(`Missing read tool '${name}' for '${type}' (variant: ${credentialVariant ?? 'default'})`)
|
|
69
|
+
return compileTool(proxy, node, tool)
|
|
70
|
+
},
|
|
71
|
+
write: (name: string) => {
|
|
72
|
+
const tool = findTool('write', name)
|
|
73
|
+
if (!tool)
|
|
74
|
+
throw new Error(`Missing write tool '${name}' for '${type}' (variant: ${credentialVariant ?? 'default'})`)
|
|
75
|
+
return compileTool(proxy, node, tool)
|
|
76
|
+
},
|
|
77
|
+
admin: (name: string) => {
|
|
78
|
+
const tool = findTool('admin', name) || findTool('write', name) || findTool('read', name)
|
|
79
|
+
if (!tool)
|
|
80
|
+
throw new Error(`Missing admin tool '${name}' for '${type}' (variant: ${credentialVariant ?? 'default'})`)
|
|
81
|
+
return compileTool(proxy, node, tool)
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import { loadIntegrationManifest } from '../../../server/src/integrations/dataLoader.js'
|
|
5
|
+
|
|
6
|
+
function escapeRegExp(str: string): string {
|
|
7
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Returns tool names from the manifest that are not exercised in any test file,
|
|
12
|
+
* excluding tools that are restricted to specific credential variants (those are
|
|
13
|
+
* covered by their own variant-specific test suites).
|
|
14
|
+
*/
|
|
15
|
+
export function getMissingToolUsages(opts: { integrationName: string, importMetaUrl: string, credentialVariant?: string }): string[] {
|
|
16
|
+
const manifest = loadIntegrationManifest(opts.integrationName)
|
|
17
|
+
if (!manifest)
|
|
18
|
+
throw new Error(`Missing integration manifest for '${opts.integrationName}'`)
|
|
19
|
+
|
|
20
|
+
const tools = manifest.tools as any[]
|
|
21
|
+
|
|
22
|
+
const relevantTools = tools.filter((t) => {
|
|
23
|
+
if (!t.credentialVariants || !Array.isArray(t.credentialVariants) || t.credentialVariants.length === 0)
|
|
24
|
+
return true
|
|
25
|
+
if (opts.credentialVariant)
|
|
26
|
+
return t.credentialVariants.includes(opts.credentialVariant)
|
|
27
|
+
return false
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const toolNames = relevantTools.map(t => t.name)
|
|
31
|
+
|
|
32
|
+
const testsDir = fileURLToPath(new URL('.', opts.importMetaUrl))
|
|
33
|
+
if (!existsSync(testsDir))
|
|
34
|
+
throw new Error(`Missing tests directory: ${testsDir}`)
|
|
35
|
+
|
|
36
|
+
const testFiles = readdirSync(testsDir)
|
|
37
|
+
.filter(f => /\.test\.(t|j)s$/.test(f) && !f.includes('usage_parity.test'))
|
|
38
|
+
.map(f => resolve(testsDir, f))
|
|
39
|
+
|
|
40
|
+
const fileContents = testFiles.map(f => readFileSync(f, 'utf8'))
|
|
41
|
+
|
|
42
|
+
const missing: string[] = []
|
|
43
|
+
for (const name of toolNames) {
|
|
44
|
+
const nameRe = new RegExp(
|
|
45
|
+
`(?:build(?:Read|Write|Admin)?(?:Handler)?|\\.(?:read|write|admin))\\(\\s*['\"\`]${escapeRegExp(name)}['\"\`]\\s*\\)`,
|
|
46
|
+
'm',
|
|
47
|
+
)
|
|
48
|
+
const found = fileContents.some(src => nameRe.test(src))
|
|
49
|
+
if (!found)
|
|
50
|
+
missing.push(name)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return missing
|
|
54
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
-
import { IntegrationProxy } from '
|
|
3
|
-
import { loadIntegrationTools } from '
|
|
2
|
+
import { IntegrationProxy } from '../../../../server/src/integrations/proxy.js'
|
|
3
|
+
import { loadIntegrationTools } from '../../../../server/src/integrations/dataLoader.js'
|
|
4
4
|
|
|
5
|
-
// LIVE Airtable integration tests using
|
|
5
|
+
// LIVE Airtable integration tests using credentials
|
|
6
6
|
// Required env vars:
|
|
7
|
-
// -
|
|
8
|
-
// - COMMANDABLE_MANAGED_OAUTH_SECRET_KEY
|
|
9
|
-
// - AIRTABLE_TEST_CONNECTION_ID (managed OAuth connection for provider 'airtable')
|
|
7
|
+
// - AIRTABLE_TOKEN
|
|
10
8
|
|
|
11
9
|
interface Ctx {
|
|
12
10
|
baseId?: string
|
|
@@ -17,9 +15,7 @@ interface Ctx {
|
|
|
17
15
|
const env = process.env as Record<string, string>
|
|
18
16
|
const hasEnv = (...keys: string[]) => keys.every(k => !!env[k] && env[k].trim().length > 0)
|
|
19
17
|
const suite = hasEnv(
|
|
20
|
-
'
|
|
21
|
-
'COMMANDABLE_MANAGED_OAUTH_SECRET_KEY',
|
|
22
|
-
'AIRTABLE_TEST_CONNECTION_ID',
|
|
18
|
+
'AIRTABLE_TOKEN',
|
|
23
19
|
)
|
|
24
20
|
? describe
|
|
25
21
|
: describe.skip
|
|
@@ -29,13 +25,20 @@ suite('airtable read handlers (live)', () => {
|
|
|
29
25
|
let buildHandler: (name: string) => ((input: any) => Promise<any>)
|
|
30
26
|
|
|
31
27
|
beforeAll(async () => {
|
|
32
|
-
const
|
|
28
|
+
const credentialStore = {
|
|
29
|
+
getCredentials: async () => ({ token: env.AIRTABLE_TOKEN || '' }),
|
|
30
|
+
}
|
|
33
31
|
|
|
34
|
-
const proxy = new IntegrationProxy({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
const proxy = new IntegrationProxy({ credentialStore })
|
|
33
|
+
const integrationNode = {
|
|
34
|
+
spaceId: 'ci',
|
|
35
|
+
id: 'node-airtable',
|
|
36
|
+
referenceId: 'node-airtable',
|
|
37
|
+
type: 'airtable',
|
|
38
|
+
label: 'Airtable',
|
|
39
|
+
connectionMethod: 'credentials',
|
|
40
|
+
credentialId: 'airtable-creds',
|
|
41
|
+
} as any
|
|
39
42
|
|
|
40
43
|
const tools = loadIntegrationTools('airtable')
|
|
41
44
|
expect(tools).toBeTruthy()
|
|
@@ -1,35 +1,9 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
2
|
-
import { resolve } from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
1
|
import { describe, expect, it } from 'vitest'
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
function escapeRegExp(str: string): string {
|
|
8
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
9
|
-
}
|
|
2
|
+
import { getMissingToolUsages } from '../../__tests__/usageParity.js'
|
|
10
3
|
|
|
11
4
|
describe('airtable static usage parity', () => {
|
|
12
|
-
it('every manifest tool is referenced in tests
|
|
13
|
-
const
|
|
14
|
-
const toolNames = (manifest.tools as any[]).map(t => t.name)
|
|
15
|
-
|
|
16
|
-
const testsDir = fileURLToPath(new URL('.', import.meta.url))
|
|
17
|
-
expect(existsSync(testsDir)).toBe(true)
|
|
18
|
-
const testFiles = readdirSync(testsDir)
|
|
19
|
-
.filter(f => /\.test\.(t|j)s$/.test(f) && !f.includes('usage_parity.test'))
|
|
20
|
-
.map(f => resolve(testsDir, f))
|
|
21
|
-
|
|
22
|
-
const fileContents = testFiles.map(f => readFileSync(f, 'utf8'))
|
|
23
|
-
|
|
24
|
-
const missing: string[] = []
|
|
25
|
-
for (const name of toolNames) {
|
|
26
|
-
// Matches buildRead('x'), buildWrite('x'), buildAdmin('x'), buildHandler('x'), buildReadHandler('x'), buildWriteHandler('x')
|
|
27
|
-
const nameRe = new RegExp(`build(?:Read|Write|Admin)?(?:Handler)?\\(\\s*['\"\`]${escapeRegExp(name)}['\"\`]\\s*\\)`, 'm')
|
|
28
|
-
const found = fileContents.some(src => nameRe.test(src))
|
|
29
|
-
if (!found)
|
|
30
|
-
missing.push(name)
|
|
31
|
-
}
|
|
32
|
-
|
|
5
|
+
it('every manifest tool is referenced in tests', () => {
|
|
6
|
+
const missing = getMissingToolUsages({ integrationName: 'airtable', importMetaUrl: import.meta.url })
|
|
33
7
|
expect(missing, `Missing handler usages in tests: ${missing.join(', ')}`).toEqual([])
|
|
34
8
|
})
|
|
35
9
|
})
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
-
import { IntegrationProxy } from '
|
|
3
|
-
import { loadIntegrationTools } from '
|
|
4
|
-
|
|
5
|
-
// LIVE Airtable write tests using
|
|
6
|
-
// Required env vars
|
|
7
|
-
// -
|
|
8
|
-
// - COMMANDABLE_MANAGED_OAUTH_SECRET_KEY
|
|
9
|
-
// - AIRTABLE_TEST_CONNECTION_ID (managed OAuth connection for provider 'airtable')
|
|
2
|
+
import { IntegrationProxy } from '../../../../server/src/integrations/proxy.js'
|
|
3
|
+
import { loadIntegrationTools } from '../../../../server/src/integrations/dataLoader.js'
|
|
4
|
+
|
|
5
|
+
// LIVE Airtable write tests using credentials
|
|
6
|
+
// Required env vars:
|
|
7
|
+
// - AIRTABLE_TOKEN
|
|
10
8
|
// Optional env for choosing base/table (otherwise picks first available):
|
|
11
9
|
// - AIRTABLE_TEST_WRITE_BASE_ID
|
|
12
10
|
// - AIRTABLE_TEST_WRITE_TABLE_ID
|
|
@@ -20,9 +18,7 @@ interface Ctx {
|
|
|
20
18
|
const env = process.env as Record<string, string>
|
|
21
19
|
const hasEnv = (...keys: string[]) => keys.every(k => !!env[k] && env[k].trim().length > 0)
|
|
22
20
|
const suite = hasEnv(
|
|
23
|
-
'
|
|
24
|
-
'COMMANDABLE_MANAGED_OAUTH_SECRET_KEY',
|
|
25
|
-
'AIRTABLE_TEST_CONNECTION_ID',
|
|
21
|
+
'AIRTABLE_TOKEN',
|
|
26
22
|
)
|
|
27
23
|
? describe
|
|
28
24
|
: describe.skip
|
|
@@ -33,13 +29,20 @@ suite('airtable write handlers (live)', () => {
|
|
|
33
29
|
let buildReadHandler: (name: string) => ((input: any) => Promise<any>)
|
|
34
30
|
|
|
35
31
|
beforeAll(async () => {
|
|
36
|
-
const
|
|
32
|
+
const credentialStore = {
|
|
33
|
+
getCredentials: async () => ({ token: env.AIRTABLE_TOKEN || '' }),
|
|
34
|
+
}
|
|
37
35
|
|
|
38
|
-
const proxy = new IntegrationProxy({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const proxy = new IntegrationProxy({ credentialStore })
|
|
37
|
+
const integrationNode = {
|
|
38
|
+
spaceId: 'ci',
|
|
39
|
+
id: 'node-airtable',
|
|
40
|
+
referenceId: 'node-airtable',
|
|
41
|
+
type: 'airtable',
|
|
42
|
+
label: 'Airtable',
|
|
43
|
+
connectionMethod: 'credentials',
|
|
44
|
+
credentialId: 'airtable-creds',
|
|
45
|
+
} as any
|
|
43
46
|
|
|
44
47
|
const tools = loadIntegrationTools('airtable')
|
|
45
48
|
expect(tools).toBeTruthy()
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"type": "
|
|
7
|
-
"
|
|
8
|
-
|
|
2
|
+
"variants": {
|
|
3
|
+
"personal_access_token": {
|
|
4
|
+
"label": "Personal Access Token",
|
|
5
|
+
"schema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"token": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"title": "Personal Access Token",
|
|
11
|
+
"description": "Airtable personal access token."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": ["token"],
|
|
15
|
+
"additionalProperties": false
|
|
16
|
+
},
|
|
17
|
+
"injection": {
|
|
18
|
+
"headers": {
|
|
19
|
+
"Authorization": "Bearer {{token}}"
|
|
20
|
+
}
|
|
9
21
|
}
|
|
10
|
-
},
|
|
11
|
-
"required": ["token"],
|
|
12
|
-
"additionalProperties": false
|
|
13
|
-
},
|
|
14
|
-
"injection": {
|
|
15
|
-
"headers": {
|
|
16
|
-
"Authorization": "Bearer {{token}}"
|
|
17
22
|
}
|
|
18
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"default": "personal_access_token"
|
|
19
25
|
}
|
|
20
|
-
|