corsair 0.1.16 → 0.1.18
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/core/client/index.d.ts +1 -1
- package/dist/core/client/index.d.ts.map +1 -1
- package/dist/core/client/index.js +2 -2
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/inspect/index.d.ts +88 -10
- package/dist/core/inspect/index.d.ts.map +1 -1
- package/dist/core/inspect/index.js +193 -10
- package/dist/core/plugins/index.d.ts +57 -2
- package/dist/core/plugins/index.d.ts.map +1 -1
- package/dist/core/webhooks/index.d.ts +23 -0
- package/dist/core/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/discord/endpoints/types.d.ts +3055 -160
- package/dist/plugins/discord/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/discord/endpoints/types.js +301 -1
- package/dist/plugins/discord/index.d.ts +4031 -21
- package/dist/plugins/discord/index.d.ts.map +1 -1
- package/dist/plugins/discord/index.js +136 -11
- package/dist/plugins/discord/schema/database.d.ts +18 -18
- package/dist/plugins/discord/schema/index.d.ts +18 -18
- package/dist/plugins/discord/webhooks/index.d.ts +507 -3
- package/dist/plugins/discord/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/discord/webhooks/types.d.ts +3743 -48
- package/dist/plugins/discord/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/discord/webhooks/types.js +107 -0
- package/dist/plugins/github/endpoints/index.d.ts +380 -380
- package/dist/plugins/github/endpoints/types.d.ts +1034 -9274
- package/dist/plugins/github/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/github/endpoints/types.js +0 -26
- package/dist/plugins/github/index.d.ts +9123 -7
- package/dist/plugins/github/index.d.ts.map +1 -1
- package/dist/plugins/github/index.js +121 -1
- package/dist/plugins/github/schema/database.d.ts +126 -126
- package/dist/plugins/github/schema/index.d.ts +126 -126
- package/dist/plugins/github/webhooks/index.d.ts +1758 -6
- package/dist/plugins/github/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/github/webhooks/types.d.ts +10765 -136
- package/dist/plugins/github/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/github/webhooks/types.js +202 -0
- package/dist/plugins/gmail/endpoints/index.d.ts +20 -20
- package/dist/plugins/gmail/endpoints/types.d.ts +140 -1784
- package/dist/plugins/gmail/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/gmail/endpoints/types.js +12 -34
- package/dist/plugins/gmail/index.d.ts +1703 -3
- package/dist/plugins/gmail/index.d.ts.map +1 -1
- package/dist/plugins/gmail/index.js +112 -3
- package/dist/plugins/gmail/schema/database.d.ts +2 -2
- package/dist/plugins/gmail/schema/index.d.ts +2 -2
- package/dist/plugins/gmail/webhooks/index.d.ts +35 -1
- package/dist/plugins/gmail/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/gmail/webhooks/types.d.ts +168 -30
- package/dist/plugins/gmail/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/gmail/webhooks/types.js +49 -0
- package/dist/plugins/googlecalendar/endpoints/index.d.ts +5 -5
- package/dist/plugins/googlecalendar/endpoints/types.d.ts +10 -2324
- package/dist/plugins/googlecalendar/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/googlecalendar/endpoints/types.js +0 -11
- package/dist/plugins/googlecalendar/index.d.ts +2338 -3
- package/dist/plugins/googlecalendar/index.d.ts.map +1 -1
- package/dist/plugins/googlecalendar/index.js +48 -6
- package/dist/plugins/googlecalendar/schema/database.d.ts +2 -2
- package/dist/plugins/googlecalendar/schema/index.d.ts +2 -2
- package/dist/plugins/googlecalendar/webhooks/index.d.ts +31 -1
- package/dist/plugins/googlecalendar/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/googlecalendar/webhooks/types.d.ts +172 -28
- package/dist/plugins/googlecalendar/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/googlecalendar/webhooks/types.js +55 -1
- package/dist/plugins/googledrive/endpoints/index.d.ts +18 -18
- package/dist/plugins/googledrive/endpoints/types.d.ts +30 -2468
- package/dist/plugins/googledrive/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/googledrive/endpoints/types.js +0 -26
- package/dist/plugins/googledrive/index.d.ts +2470 -3
- package/dist/plugins/googledrive/index.d.ts.map +1 -1
- package/dist/plugins/googledrive/index.js +144 -15
- package/dist/plugins/googledrive/schema/database.d.ts +6 -6
- package/dist/plugins/googledrive/schema/index.d.ts +6 -6
- package/dist/plugins/googledrive/webhooks/index.d.ts +47 -1
- package/dist/plugins/googledrive/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/googledrive/webhooks/types.d.ts +172 -34
- package/dist/plugins/googledrive/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/googledrive/webhooks/types.js +64 -1
- package/dist/plugins/googlesheets/endpoints/index.d.ts +1 -1
- package/dist/plugins/googlesheets/endpoints/types.d.ts +26 -614
- package/dist/plugins/googlesheets/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/googlesheets/endpoints/types.js +0 -15
- package/dist/plugins/googlesheets/index.d.ts +603 -3
- package/dist/plugins/googlesheets/index.d.ts.map +1 -1
- package/dist/plugins/googlesheets/index.js +68 -6
- package/dist/plugins/googlesheets/schema/database.d.ts +4 -4
- package/dist/plugins/googlesheets/schema/index.d.ts +4 -4
- package/dist/plugins/googlesheets/webhooks/index.d.ts +15 -1
- package/dist/plugins/googlesheets/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/googlesheets/webhooks/types.d.ts +45 -10
- package/dist/plugins/googlesheets/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/googlesheets/webhooks/types.js +26 -0
- package/dist/plugins/hubspot/endpoints/types.d.ts +0 -7291
- package/dist/plugins/hubspot/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/hubspot/endpoints/types.js +0 -39
- package/dist/plugins/hubspot/index.d.ts +7443 -14
- package/dist/plugins/hubspot/index.d.ts.map +1 -1
- package/dist/plugins/hubspot/index.js +252 -14
- package/dist/plugins/hubspot/schema/database.d.ts +8 -8
- package/dist/plugins/hubspot/schema/index.d.ts +8 -8
- package/dist/plugins/hubspot/webhooks/index.d.ts +144 -12
- package/dist/plugins/hubspot/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/hubspot/webhooks/types.d.ts +855 -45
- package/dist/plugins/hubspot/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/hubspot/webhooks/types.js +104 -0
- package/dist/plugins/linear/endpoints/index.d.ts +120 -120
- package/dist/plugins/linear/endpoints/types.d.ts +634 -2347
- package/dist/plugins/linear/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/linear/endpoints/types.js +0 -23
- package/dist/plugins/linear/index.d.ts +6088 -11
- package/dist/plugins/linear/index.d.ts.map +1 -1
- package/dist/plugins/linear/index.js +124 -2
- package/dist/plugins/linear/schema/database.d.ts +10 -10
- package/dist/plugins/linear/schema/index.d.ts +10 -10
- package/dist/plugins/linear/webhooks/index.d.ts +619 -9
- package/dist/plugins/linear/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/linear/webhooks/types.d.ts +2809 -115
- package/dist/plugins/linear/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/linear/webhooks/types.js +196 -0
- package/dist/plugins/posthog/endpoints/types.d.ts +0 -139
- package/dist/plugins/posthog/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/posthog/endpoints/types.js +0 -10
- package/dist/plugins/posthog/index.d.ts +161 -3
- package/dist/plugins/posthog/index.d.ts.map +1 -1
- package/dist/plugins/posthog/index.js +44 -5
- package/dist/plugins/posthog/webhooks/index.d.ts +29 -1
- package/dist/plugins/posthog/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/posthog/webhooks/types.d.ts +96 -15
- package/dist/plugins/posthog/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/posthog/webhooks/types.js +25 -0
- package/dist/plugins/resend/endpoints/index.d.ts +6 -6
- package/dist/plugins/resend/endpoints/types.d.ts +18 -336
- package/dist/plugins/resend/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/resend/endpoints/types.js +0 -13
- package/dist/plugins/resend/index.d.ts +456 -12
- package/dist/plugins/resend/index.d.ts.map +1 -1
- package/dist/plugins/resend/index.js +105 -6
- package/dist/plugins/resend/schema/database.d.ts +2 -2
- package/dist/plugins/resend/schema/index.d.ts +2 -2
- package/dist/plugins/resend/webhooks/index.d.ts +252 -10
- package/dist/plugins/resend/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/resend/webhooks/types.d.ts +971 -70
- package/dist/plugins/resend/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/resend/webhooks/types.js +185 -0
- package/dist/plugins/slack/endpoints/index.d.ts +8 -8
- package/dist/plugins/slack/endpoints/types.d.ts +16 -17339
- package/dist/plugins/slack/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/slack/endpoints/types.js +0 -47
- package/dist/plugins/slack/index.d.ts +17553 -10
- package/dist/plugins/slack/index.d.ts.map +1 -1
- package/dist/plugins/slack/index.js +220 -2
- package/dist/plugins/slack/schema/database.d.ts +48 -48
- package/dist/plugins/slack/schema/index.d.ts +48 -48
- package/dist/plugins/slack/webhooks/index.d.ts +449 -8
- package/dist/plugins/slack/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/slack/webhooks/types.d.ts +5461 -469
- package/dist/plugins/slack/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/slack/webhooks/types.js +605 -0
- package/dist/plugins/spotify/api.test.js +14 -2
- package/dist/plugins/spotify/endpoints/albums.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/artists.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/index.d.ts +4 -4
- package/dist/plugins/spotify/endpoints/index.js +4 -4
- package/dist/plugins/spotify/endpoints/library.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/my-data.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/player.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/playlists.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/playlists.js +1 -1
- package/dist/plugins/spotify/endpoints/tracks.d.ts.map +1 -1
- package/dist/plugins/spotify/endpoints/types.d.ts +30 -30
- package/dist/plugins/spotify/endpoints/types.d.ts.map +1 -1
- package/dist/plugins/spotify/index.d.ts +5612 -4
- package/dist/plugins/spotify/index.d.ts.map +1 -1
- package/dist/plugins/spotify/index.js +239 -3
- package/dist/plugins/spotify/schema/database.d.ts +6 -6
- package/dist/plugins/spotify/schema/index.d.ts +6 -6
- package/dist/plugins/spotify/webhooks/example.d.ts.map +1 -1
- package/dist/plugins/spotify/webhooks/index.d.ts +17 -1
- package/dist/plugins/spotify/webhooks/index.d.ts.map +1 -1
- package/dist/plugins/spotify/webhooks/types.d.ts +50 -49
- package/dist/plugins/spotify/webhooks/types.d.ts.map +1 -1
- package/dist/plugins/spotify/webhooks/types.js +48 -31
- package/dist/plugins/tavily/endpoints/index.d.ts +1 -1
- package/dist/plugins/tavily/endpoints/types.d.ts +6 -6
- package/dist/plugins/tavily/index.d.ts +7 -1
- package/dist/plugins/tavily/index.d.ts.map +1 -1
- package/dist/templates/plugin/generate.js +18 -13
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ZodTypeAny } from 'zod';
|
|
2
2
|
import type { CorsairDatabase } from '../../db/kysely/database';
|
|
3
|
-
import { type CorsairInspectMethods } from '../inspect';
|
|
4
3
|
import type { CorsairPluginSchema, PluginEntityClients } from '../../db/orm';
|
|
5
4
|
import type { AccountKeyManagerFor, IntegrationKeyManagerFor, PluginAuthConfig } from '../auth/types';
|
|
6
5
|
import type { AuthTypes } from '../constants';
|
|
7
6
|
import type { BindEndpoints, EndpointTree } from '../endpoints';
|
|
8
7
|
import type { CorsairErrorHandler } from '../errors';
|
|
8
|
+
import type { CorsairInspectMethods } from '../inspect';
|
|
9
9
|
import type { CorsairPlugin } from '../plugins';
|
|
10
10
|
import type { BindWebhooks, RawWebhookRequest, WebhookTree } from '../webhooks';
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EACX,mBAAmB,EAEnB,mBAAmB,EACnB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EACX,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAEX,aAAa,EAIb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAOhF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAC9B,MAAM,SAAS,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAAG,SAAS,IACvE,MAAM,SAAS,mBAAmB,CAAC,MAAM,QAAQ,CAAC,GACnD;IAAE,EAAE,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;CAAE,GACrC,EAAE,CAAC;AAMN;;GAEG;AACH,KAAK,mBAAmB,CAAC,CAA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AAO,CAAC,CAoKxB;AAMD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,CAAC,OAAO,SAAS,SAAS,aAAa,EAAE,EAE9C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,eAAe,EACzB,GAAG,EAAE,MAAM,GACT,uBAAuB,CAAC,OAAO,CAAC,CAyBlC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createKyselyEntityClient } from '../../db/kysely/orm';
|
|
2
|
-
import { buildInspectMethods, } from '../inspect';
|
|
3
2
|
import { createAccountKeyManager, createIntegrationKeyManager, } from '../auth/key-manager';
|
|
4
3
|
import { bindEndpointsRecursively } from '../endpoints/bind';
|
|
4
|
+
import { buildInspectMethods } from '../inspect';
|
|
5
5
|
import { bindWebhooksRecursively } from '../webhooks/bind';
|
|
6
6
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
7
|
// Account ID Resolver
|
|
@@ -79,7 +79,7 @@ function createEntityClient(database, getAccountId, entityTypeName, version, dat
|
|
|
79
79
|
* @returns A fully configured Corsair client with account-level keys
|
|
80
80
|
*/
|
|
81
81
|
export function buildCorsairClient(plugins, options) {
|
|
82
|
-
const { database, tenantId, kek, rootErrorHandlers, approvalConfig
|
|
82
|
+
const { database, tenantId, kek, rootErrorHandlers, approvalConfig } = options;
|
|
83
83
|
const apiUnsafe = {};
|
|
84
84
|
const pluginEntitiesUnsafe = {};
|
|
85
85
|
for (const plugin of plugins) {
|
package/dist/core/index.d.ts
CHANGED
|
@@ -34,12 +34,12 @@ export declare function createCorsair<const Plugins extends readonly CorsairPlug
|
|
|
34
34
|
export type { AccountFieldNames, AccountKeyManagerFor, BaseAuthFieldConfig, BaseKeyManager, IntegrationFieldNames, IntegrationKeyManagerFor, OAuth2IntegrationCredentials, PluginAuthConfig, } from './auth';
|
|
35
35
|
export { BASE_AUTH_FIELDS, createAccountKeyManager, createIntegrationKeyManager, decryptConfig, decryptDEK, decryptWithDEK, encryptConfig, encryptDEK, encryptWithDEK, generateDEK, initializeAccountDEK, initializeIntegrationDEK, reEncryptConfig, } from './auth';
|
|
36
36
|
export type { CorsairClient, CorsairSingleTenantClient, CorsairTenantWrapper, } from './client';
|
|
37
|
-
export type { CorsairInspectMethods, EndpointSchemaResult } from './inspect';
|
|
38
37
|
export type { AllProviders, AuthTypes, BaseProviders } from './constants';
|
|
39
38
|
export type { BindEndpoints, BoundEndpointFn, BoundEndpointTree, CorsairContext, CorsairEndpoint, EndpointPathsOf, EndpointTree, } from './endpoints';
|
|
40
39
|
export type { CorsairErrorHandler, ErrorContext, ErrorHandler, ErrorHandlerAndMatchFunction, ErrorMatcher, RetryStrategies, RetryStrategy, } from './errors';
|
|
40
|
+
export type { CorsairInspectMethods, EndpointSchemaResult } from './inspect';
|
|
41
41
|
export type { EnforcePermissionOptions } from './permissions';
|
|
42
|
-
export type { BeforeHookResult, CorsairIntegration, CorsairKeyBuilder, CorsairKeyBuilderBase, CorsairPlugin, CorsairPluginContext, EndpointHooks, EndpointMetaEntry, EndpointRiskLevel, KeyBuilderContext, PermissionMode, PermissionPolicy, PluginEndpointMeta, PluginPermissionsConfig, WebhookHooks, } from './plugins';
|
|
42
|
+
export type { BeforeHookResult, CorsairIntegration, CorsairKeyBuilder, CorsairKeyBuilderBase, CorsairPlugin, CorsairPluginContext, EndpointHooks, EndpointMetaEntry, EndpointRiskLevel, KeyBuilderContext, PermissionMode, PermissionPolicy, PluginEndpointMeta, PluginPermissionsConfig, RequiredPluginEndpointMeta, RequiredPluginEndpointSchemas, RequiredPluginWebhookSchemas, WebhookHooks, } from './plugins';
|
|
43
43
|
export type { Bivariant, UnionToIntersection } from './utils';
|
|
44
|
-
export type { BindWebhooks, BoundWebhook, BoundWebhookTree, CorsairWebhook, CorsairWebhookHandler, CorsairWebhookMatcher, RawWebhookRequest, WebhookRequest, WebhookResponse, WebhookTree, } from './webhooks';
|
|
44
|
+
export type { BindWebhooks, BoundWebhook, BoundWebhookTree, CorsairWebhook, CorsairWebhookHandler, CorsairWebhookMatcher, RawWebhookRequest, WebhookPathsOf, WebhookRequest, WebhookResponse, WebhookTree, } from './webhooks';
|
|
45
45
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../core/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAMnE,eAAO,MAAM,gBAAgB,eAAiC,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IACnC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;KAC9B,CAAC;CACF,CAAC;AAMF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,aAAa,EAAE,EAC3E,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG;IAAE,YAAY,EAAE,IAAI,CAAA;CAAE,GAC1D,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,aAAa,EAAE,EAC3E,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,GACxE,yBAAyB,CAAC,OAAO,CAAC,CAAC;AA6EtC,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EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,YAAY,GACZ,MAAM,WAAW,CAAC;AAGnB,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9D,YAAY,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,WAAW,GACX,MAAM,YAAY,CAAC"}
|
|
@@ -16,42 +16,120 @@ export type EndpointSchemaResult = {
|
|
|
16
16
|
*/
|
|
17
17
|
availableMethods?: Record<string, string[]>;
|
|
18
18
|
};
|
|
19
|
+
export type WebhookSchemaResult = {
|
|
20
|
+
/** Human-readable description of what triggers this webhook. */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** JSON Schema for the webhook payload — the type of `request.payload` in the before hook. */
|
|
23
|
+
payload?: unknown;
|
|
24
|
+
/** JSON Schema for the webhook response data — the type of `response.data` in the after hook. */
|
|
25
|
+
response?: unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Ready-to-copy code example showing exactly how to configure this webhook,
|
|
28
|
+
* including response.data type as an inline comment.
|
|
29
|
+
*/
|
|
30
|
+
usage?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Present when the requested webhook path was not found.
|
|
33
|
+
* Lists all available webhook dot-paths per plugin so the caller can self-correct.
|
|
34
|
+
*/
|
|
35
|
+
availableWebhooks?: Record<string, string[]>;
|
|
36
|
+
};
|
|
19
37
|
export type CorsairInspectMethods = {
|
|
20
38
|
/**
|
|
21
39
|
* Returns all available endpoint paths for every registered plugin.
|
|
22
|
-
* Keys are plugin IDs, values are arrays of full-form paths (plugin.group.method).
|
|
40
|
+
* Keys are plugin IDs, values are arrays of full-form paths (plugin.api.group.method), all lowercase.
|
|
23
41
|
*
|
|
24
42
|
* @example
|
|
25
43
|
* corsair.get_methods()
|
|
26
|
-
* // { slack: ['slack.channels.list', 'slack.messages.post', ...], github: ['github.issues.list', ...] }
|
|
44
|
+
* // { slack: ['slack.api.channels.list', 'slack.api.messages.post', ...], github: ['github.api.issues.list', ...] }
|
|
27
45
|
*/
|
|
28
46
|
get_methods(): Record<string, string[]>;
|
|
29
47
|
/**
|
|
30
48
|
* Returns all available endpoint paths for a specific plugin.
|
|
31
|
-
* Paths are full-form (plugin.group.method)
|
|
49
|
+
* Paths are full-form (plugin.api.group.method), all lowercase, and can be passed directly to get_schema().
|
|
32
50
|
*
|
|
33
51
|
* @example
|
|
34
52
|
* corsair.get_methods('slack')
|
|
35
|
-
* // ['slack.channels.list', 'slack.channels.get', 'slack.messages.post', ...]
|
|
53
|
+
* // ['slack.api.channels.list', 'slack.api.channels.get', 'slack.api.messages.post', ...]
|
|
36
54
|
*/
|
|
37
55
|
get_methods(plugin: string): string[];
|
|
38
56
|
/**
|
|
39
57
|
* Returns schema and metadata for a specific endpoint.
|
|
40
|
-
* Pass the full dot-path including the plugin ID: 'slack.channels.list'.
|
|
58
|
+
* Pass the full dot-path including the plugin ID and 'api' segment: 'slack.api.channels.list'.
|
|
59
|
+
* Casing is ignored — the method string is lowercased before lookup.
|
|
41
60
|
* If the method is not found, returns an empty result with `availableMethods` listing all valid paths.
|
|
42
61
|
*
|
|
43
62
|
* @example
|
|
44
|
-
* corsair.get_schema('slack.channels.list')
|
|
63
|
+
* corsair.get_schema('slack.api.channels.list')
|
|
45
64
|
* // { description: '...', riskLevel: 'read', input: { type: 'object', ... }, output: { ... } }
|
|
46
65
|
*
|
|
47
|
-
* corsair.get_schema('slack.
|
|
48
|
-
* // {
|
|
66
|
+
* corsair.get_schema('slack.api.channels.getHistory') // casing normalised automatically
|
|
67
|
+
* // { description: '...', riskLevel: 'read', input: { type: 'object', ... }, output: { ... } }
|
|
68
|
+
*
|
|
69
|
+
* corsair.get_schema('slack.api.invalid')
|
|
70
|
+
* // { availableMethods: { slack: ['slack.api.channels.list', ...], ... } }
|
|
49
71
|
*/
|
|
50
72
|
get_schema(method: string): EndpointSchemaResult;
|
|
73
|
+
/**
|
|
74
|
+
* Returns all available webhook paths for every registered plugin.
|
|
75
|
+
* Keys are plugin IDs, values are arrays of full dot-paths (pluginId.group.event).
|
|
76
|
+
* Pass a path directly to get_webhook_schema() to get its usage example and type info.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* corsair.get_webhooks()
|
|
80
|
+
* // {
|
|
81
|
+
* // slack: ['slack.messages.message', 'slack.channels.created', ...],
|
|
82
|
+
* // googlecalendar: ['googlecalendar.onEventChanged', 'googlecalendar.onEventCreated', ...],
|
|
83
|
+
* // }
|
|
84
|
+
*/
|
|
85
|
+
get_webhooks(): Record<string, string[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns all available webhook paths for a specific plugin.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* corsair.get_webhooks('slack')
|
|
91
|
+
* // ['slack.messages.message', 'slack.channels.created', ...]
|
|
92
|
+
*/
|
|
93
|
+
get_webhooks(plugin: string): string[];
|
|
94
|
+
/**
|
|
95
|
+
* Returns a ready-to-copy usage example plus type information for a specific webhook.
|
|
96
|
+
* Pass the dot-path from get_webhooks(): 'slack.messages.message'.
|
|
97
|
+
* Casing is ignored — the path is lowercased before lookup.
|
|
98
|
+
*
|
|
99
|
+
* The `usage` field is a complete code snippet showing how to configure this webhook
|
|
100
|
+
* inside the plugin options, with the response.data type embedded as an inline comment.
|
|
101
|
+
*
|
|
102
|
+
* If the webhook path is not found, returns `availableWebhooks` for self-correction.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* corsair.get_webhook_schema('slack.messages.message')
|
|
106
|
+
* // {
|
|
107
|
+
* // description: 'Fires when a message is posted',
|
|
108
|
+
* // usage: `
|
|
109
|
+
* // slack({
|
|
110
|
+
* // webhookHooks: {
|
|
111
|
+
* // messages: {
|
|
112
|
+
* // message: {
|
|
113
|
+
* // before(ctx, args) {
|
|
114
|
+
* // return { ctx, args };
|
|
115
|
+
* // },
|
|
116
|
+
* // after(ctx, response) {
|
|
117
|
+
* // // response.data:
|
|
118
|
+
* // // { "type": "object", ... }
|
|
119
|
+
* // },
|
|
120
|
+
* // },
|
|
121
|
+
* // },
|
|
122
|
+
* // },
|
|
123
|
+
* // })`,
|
|
124
|
+
* // payload: { ... },
|
|
125
|
+
* // response: { ... },
|
|
126
|
+
* // }
|
|
127
|
+
*/
|
|
128
|
+
get_webhook_schema(webhook: string): WebhookSchemaResult;
|
|
51
129
|
};
|
|
52
130
|
/**
|
|
53
|
-
* Creates the get_methods / get_schema
|
|
54
|
-
* Used by both single-tenant and multi-tenant client builders.
|
|
131
|
+
* Creates the get_methods / get_schema / get_webhooks / get_webhook_schema functions
|
|
132
|
+
* bound to a specific plugin list. Used by both single-tenant and multi-tenant client builders.
|
|
55
133
|
*/
|
|
56
134
|
export declare function buildInspectMethods(plugins: readonly CorsairPlugin[]): CorsairInspectMethods;
|
|
57
135
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/inspect/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAC;AAqFnE,MAAM,MAAM,oBAAoB,GAAG;IAClC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC;IAC7C,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,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AE,CAAC,CAAC;IACxC;;;;;;;OAOG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACtC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACjD;;;;;;;;;;;OAWG;IACH,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACzC;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACzD,CAAC;AAkUF;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,SAAS,aAAa,EAAE,GAC/B,qBAAqB,CAgBvB"}
|
|
@@ -45,8 +45,10 @@ function zodToJsonSchema(schema) {
|
|
|
45
45
|
const required = [];
|
|
46
46
|
for (const [key, val] of Object.entries(shape)) {
|
|
47
47
|
properties[key] = zodToJsonSchema(val);
|
|
48
|
-
const fieldTypeName = val._def
|
|
49
|
-
|
|
48
|
+
const fieldTypeName = val._def
|
|
49
|
+
.typeName;
|
|
50
|
+
if (fieldTypeName !== 'ZodOptional' &&
|
|
51
|
+
fieldTypeName !== 'ZodNullable') {
|
|
50
52
|
required.push(key);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -86,6 +88,108 @@ function walkEndpointTree(tree, pathParts, result) {
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
91
|
+
// Webhook Tree Helpers
|
|
92
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
93
|
+
/**
|
|
94
|
+
* Returns true if a value is a webhook leaf (has both `match` and `handler` functions).
|
|
95
|
+
* Mirrors the isWebhook guard in core/webhooks/bind.ts without importing it.
|
|
96
|
+
*/
|
|
97
|
+
function isWebhookLeaf(value) {
|
|
98
|
+
return (value !== null &&
|
|
99
|
+
typeof value === 'object' &&
|
|
100
|
+
'match' in value &&
|
|
101
|
+
'handler' in value &&
|
|
102
|
+
typeof value.match === 'function' &&
|
|
103
|
+
typeof value.handler === 'function');
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Recursively collects all webhook leaf paths in a webhook tree.
|
|
107
|
+
* Preserves original key casing so paths can be used as object keys in webhookHooks config.
|
|
108
|
+
*/
|
|
109
|
+
function walkWebhookTree(tree, pathParts, result) {
|
|
110
|
+
for (const [key, value] of Object.entries(tree)) {
|
|
111
|
+
const current = [...pathParts, key];
|
|
112
|
+
if (isWebhookLeaf(value)) {
|
|
113
|
+
result.push(current.join('.'));
|
|
114
|
+
}
|
|
115
|
+
else if (value !== null && typeof value === 'object') {
|
|
116
|
+
walkWebhookTree(value, current, result);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Walks a webhook tree with a normalised (lowercased) path and returns the original-cased
|
|
122
|
+
* key segments when found. Used to reconstruct the exact key names for usage examples.
|
|
123
|
+
* Returns null if the path does not resolve to a webhook leaf.
|
|
124
|
+
*/
|
|
125
|
+
function resolveWebhookPathOriginalCase(tree, normalizedParts) {
|
|
126
|
+
if (normalizedParts.length === 0)
|
|
127
|
+
return null;
|
|
128
|
+
const [head, ...tail] = normalizedParts;
|
|
129
|
+
const entry = Object.entries(tree).find(([k]) => k.toLowerCase() === head);
|
|
130
|
+
if (!entry)
|
|
131
|
+
return null;
|
|
132
|
+
const [originalKey, value] = entry;
|
|
133
|
+
if (tail.length === 0) {
|
|
134
|
+
return isWebhookLeaf(value) ? [originalKey] : null;
|
|
135
|
+
}
|
|
136
|
+
if (value !== null && typeof value === 'object' && !isWebhookLeaf(value)) {
|
|
137
|
+
const rest = resolveWebhookPathOriginalCase(value, tail);
|
|
138
|
+
if (rest !== null)
|
|
139
|
+
return [originalKey, ...rest];
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
144
|
+
// Webhook Usage Example Builder
|
|
145
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
146
|
+
/**
|
|
147
|
+
* Builds a ready-to-copy code snippet showing how to configure a specific webhook.
|
|
148
|
+
* The response.data type (if available) is embedded as an inline comment inside the after hook.
|
|
149
|
+
*
|
|
150
|
+
* @param pluginId Plugin ID (e.g. 'slack')
|
|
151
|
+
* @param pathParts Original-cased path segments (e.g. ['messages', 'message'])
|
|
152
|
+
* @param responseSchema JSON Schema for response.data, or null if no schema registered
|
|
153
|
+
*/
|
|
154
|
+
function buildWebhookUsageExample(pluginId, pathParts, responseSchema) {
|
|
155
|
+
const lines = [];
|
|
156
|
+
lines.push(`${pluginId}({`);
|
|
157
|
+
lines.push(` webhookHooks: {`);
|
|
158
|
+
// Open nested key blocks
|
|
159
|
+
for (let i = 0; i < pathParts.length; i++) {
|
|
160
|
+
const indent = ' '.repeat(i + 2);
|
|
161
|
+
lines.push(`${indent}${pathParts[i]}: {`);
|
|
162
|
+
}
|
|
163
|
+
// Hook body — indented one level deeper than the innermost key
|
|
164
|
+
const hookIndent = ' '.repeat(pathParts.length + 2);
|
|
165
|
+
const bodyIndent = hookIndent + ' ';
|
|
166
|
+
lines.push(`${hookIndent}before(ctx, args) {`);
|
|
167
|
+
lines.push(`${bodyIndent}return { ctx, args };`);
|
|
168
|
+
lines.push(`${hookIndent}},`);
|
|
169
|
+
lines.push(`${hookIndent}after(ctx, response) {`);
|
|
170
|
+
if (responseSchema !== null) {
|
|
171
|
+
const json = JSON.stringify(responseSchema, null, 2);
|
|
172
|
+
const commentLines = json
|
|
173
|
+
.split('\n')
|
|
174
|
+
.map((l, i) => i === 0
|
|
175
|
+
? `${bodyIndent}// response.data: ${l}`
|
|
176
|
+
: `${bodyIndent}// ${l}`);
|
|
177
|
+
lines.push(...commentLines);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
lines.push(`${bodyIndent}// response.data: unknown (register webhookSchemas to see the type)`);
|
|
181
|
+
}
|
|
182
|
+
lines.push(`${hookIndent}},`);
|
|
183
|
+
// Close nested key blocks (innermost first)
|
|
184
|
+
for (let i = pathParts.length - 1; i >= 0; i--) {
|
|
185
|
+
const indent = ' '.repeat(i + 2);
|
|
186
|
+
lines.push(`${indent}},`);
|
|
187
|
+
}
|
|
188
|
+
lines.push(` },`);
|
|
189
|
+
lines.push(`})`);
|
|
190
|
+
return lines.join('\n');
|
|
191
|
+
}
|
|
192
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
89
193
|
// Core Functions
|
|
90
194
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
91
195
|
function getMethods(plugins, plugin) {
|
|
@@ -95,7 +199,7 @@ function getMethods(plugins, plugin) {
|
|
|
95
199
|
return [];
|
|
96
200
|
const paths = [];
|
|
97
201
|
walkEndpointTree(found.endpoints, [], paths);
|
|
98
|
-
return paths.map((path) => `${found.id}.${path}`);
|
|
202
|
+
return paths.map((path) => `${found.id}.api.${path.toLowerCase()}`);
|
|
99
203
|
}
|
|
100
204
|
const result = {};
|
|
101
205
|
for (const p of plugins) {
|
|
@@ -103,19 +207,58 @@ function getMethods(plugins, plugin) {
|
|
|
103
207
|
continue;
|
|
104
208
|
const paths = [];
|
|
105
209
|
walkEndpointTree(p.endpoints, [], paths);
|
|
210
|
+
result[p.id] = paths.map((path) => `${p.id}.api.${path.toLowerCase()}`);
|
|
211
|
+
}
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
function getWebhooks(plugins, plugin) {
|
|
215
|
+
if (plugin !== undefined) {
|
|
216
|
+
const found = plugins.find((p) => p.id === plugin);
|
|
217
|
+
if (!found?.webhooks)
|
|
218
|
+
return [];
|
|
219
|
+
const paths = [];
|
|
220
|
+
walkWebhookTree(found.webhooks, [], paths);
|
|
221
|
+
return paths.map((path) => `${found.id}.${path}`);
|
|
222
|
+
}
|
|
223
|
+
const result = {};
|
|
224
|
+
for (const p of plugins) {
|
|
225
|
+
if (!p.webhooks)
|
|
226
|
+
continue;
|
|
227
|
+
const paths = [];
|
|
228
|
+
walkWebhookTree(p.webhooks, [], paths);
|
|
106
229
|
result[p.id] = paths.map((path) => `${p.id}.${path}`);
|
|
107
230
|
}
|
|
108
231
|
return result;
|
|
109
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Case-insensitive lookup in an endpoint record (endpointMeta or endpointSchemas).
|
|
235
|
+
* Keys in those records use camelCase (e.g. 'channels.getHistory') while the
|
|
236
|
+
* normalised path coming from the agent is fully lowercased.
|
|
237
|
+
*/
|
|
238
|
+
function findEndpointCaseInsensitive(record, lowercasedPath) {
|
|
239
|
+
if (!record)
|
|
240
|
+
return undefined;
|
|
241
|
+
for (const [key, value] of Object.entries(record)) {
|
|
242
|
+
if (key.toLowerCase() === lowercasedPath)
|
|
243
|
+
return value;
|
|
244
|
+
}
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
110
247
|
function getSchema(plugins, method) {
|
|
111
|
-
|
|
248
|
+
// Normalise casing so the agent can call with any capitalisation
|
|
249
|
+
const normalised = method.toLowerCase();
|
|
250
|
+
const dotIndex = normalised.indexOf('.');
|
|
112
251
|
if (dotIndex !== -1) {
|
|
113
|
-
const pluginId =
|
|
114
|
-
|
|
252
|
+
const pluginId = normalised.slice(0, dotIndex);
|
|
253
|
+
let remainder = normalised.slice(dotIndex + 1);
|
|
254
|
+
// Strip the optional 'api.' segment (present in the new full-form paths)
|
|
255
|
+
if (remainder.startsWith('api.')) {
|
|
256
|
+
remainder = remainder.slice(4);
|
|
257
|
+
}
|
|
115
258
|
const plugin = plugins.find((p) => p.id === pluginId);
|
|
116
259
|
if (plugin) {
|
|
117
|
-
const meta = plugin.endpointMeta
|
|
118
|
-
const schemas = plugin.endpointSchemas
|
|
260
|
+
const meta = findEndpointCaseInsensitive(plugin.endpointMeta, remainder);
|
|
261
|
+
const schemas = findEndpointCaseInsensitive(plugin.endpointSchemas, remainder);
|
|
119
262
|
// Valid entry — meta or schemas found
|
|
120
263
|
if (meta || schemas) {
|
|
121
264
|
return {
|
|
@@ -131,12 +274,46 @@ function getSchema(plugins, method) {
|
|
|
131
274
|
// Invalid or unknown method — return all available methods so the caller can self-correct
|
|
132
275
|
return { availableMethods: getMethods(plugins) };
|
|
133
276
|
}
|
|
277
|
+
function getWebhookSchema(plugins, webhook) {
|
|
278
|
+
// Normalise casing so the agent can call with any capitalisation
|
|
279
|
+
const normalised = webhook.toLowerCase();
|
|
280
|
+
const dotIndex = normalised.indexOf('.');
|
|
281
|
+
if (dotIndex !== -1) {
|
|
282
|
+
const pluginId = normalised.slice(0, dotIndex);
|
|
283
|
+
const webhookPathNormalised = normalised.slice(dotIndex + 1);
|
|
284
|
+
const plugin = plugins.find((p) => p.id === pluginId);
|
|
285
|
+
if (plugin?.webhooks) {
|
|
286
|
+
// Resolve original-cased key segments from the webhook tree
|
|
287
|
+
const originalPathParts = resolveWebhookPathOriginalCase(plugin.webhooks, webhookPathNormalised.split('.'));
|
|
288
|
+
if (originalPathParts !== null) {
|
|
289
|
+
// Look up optional schemas using original-cased path (case-insensitive fallback)
|
|
290
|
+
const originalPath = originalPathParts.join('.');
|
|
291
|
+
const schemas = findEndpointCaseInsensitive(plugin.webhookSchemas, originalPath.toLowerCase());
|
|
292
|
+
const responseSchema = schemas?.response
|
|
293
|
+
? zodToJsonSchema(schemas.response)
|
|
294
|
+
: null;
|
|
295
|
+
return {
|
|
296
|
+
description: schemas?.description,
|
|
297
|
+
payload: schemas?.payload
|
|
298
|
+
? zodToJsonSchema(schemas.payload)
|
|
299
|
+
: undefined,
|
|
300
|
+
response: responseSchema ?? undefined,
|
|
301
|
+
usage: buildWebhookUsageExample(pluginId, originalPathParts, responseSchema),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// Invalid or unknown webhook — return all available webhooks so the caller can self-correct
|
|
307
|
+
return {
|
|
308
|
+
availableWebhooks: getWebhooks(plugins),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
134
311
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
135
312
|
// Factory — binds inspect methods to a fixed plugin list
|
|
136
313
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
137
314
|
/**
|
|
138
|
-
* Creates the get_methods / get_schema
|
|
139
|
-
* Used by both single-tenant and multi-tenant client builders.
|
|
315
|
+
* Creates the get_methods / get_schema / get_webhooks / get_webhook_schema functions
|
|
316
|
+
* bound to a specific plugin list. Used by both single-tenant and multi-tenant client builders.
|
|
140
317
|
*/
|
|
141
318
|
export function buildInspectMethods(plugins) {
|
|
142
319
|
return {
|
|
@@ -146,5 +323,11 @@ export function buildInspectMethods(plugins) {
|
|
|
146
323
|
get_schema(method) {
|
|
147
324
|
return getSchema(plugins, method);
|
|
148
325
|
},
|
|
326
|
+
get_webhooks(plugin) {
|
|
327
|
+
return getWebhooks(plugins, plugin);
|
|
328
|
+
},
|
|
329
|
+
get_webhook_schema(webhook) {
|
|
330
|
+
return getWebhookSchema(plugins, webhook);
|
|
331
|
+
},
|
|
149
332
|
};
|
|
150
333
|
}
|
|
@@ -6,7 +6,7 @@ import type { ExtractAuthType, InferPluginEntities } from '../client';
|
|
|
6
6
|
import type { AllProviders, AuthTypes } from '../constants';
|
|
7
7
|
import type { BindEndpoints, BoundEndpointTree, CorsairContext, CorsairEndpoint, EndpointPathsOf, EndpointTree } from '../endpoints';
|
|
8
8
|
import type { CorsairErrorHandler } from '../errors';
|
|
9
|
-
import type { CorsairWebhook, CorsairWebhookHandler, CorsairWebhookMatcher, WebhookRequest, WebhookResponse, WebhookTree } from '../webhooks';
|
|
9
|
+
import type { CorsairWebhook, CorsairWebhookHandler, CorsairWebhookMatcher, WebhookPathsOf, WebhookRequest, WebhookResponse, WebhookTree } from '../webhooks';
|
|
10
10
|
/**
|
|
11
11
|
* Risk level classification for plugin endpoints.
|
|
12
12
|
* The permission mode maps each risk level to a policy (allow / deny / require_approval).
|
|
@@ -56,9 +56,43 @@ export type EndpointMetaEntry = {
|
|
|
56
56
|
* @template T - The plugin's endpoint tree (e.g. `typeof githubEndpointsNested`)
|
|
57
57
|
*/
|
|
58
58
|
export type PluginEndpointMeta<T extends EndpointTree> = Partial<Record<EndpointPathsOf<T>, EndpointMetaEntry>>;
|
|
59
|
+
/**
|
|
60
|
+
* A **required** map from dot-notation endpoint paths to their metadata entries.
|
|
61
|
+
* Every endpoint in the tree must have a corresponding entry — omitting any path
|
|
62
|
+
* is a compile-time error. Use this for `satisfies` annotations on `endpointMeta`
|
|
63
|
+
* objects where exhaustiveness is enforced.
|
|
64
|
+
*
|
|
65
|
+
* @template T - The plugin's endpoint tree (e.g. `typeof githubEndpointsNested`)
|
|
66
|
+
*/
|
|
67
|
+
export type RequiredPluginEndpointMeta<T extends EndpointTree> = Record<EndpointPathsOf<T>, EndpointMetaEntry>;
|
|
68
|
+
/**
|
|
69
|
+
* A **required** map from dot-notation endpoint paths to their `{ input, output }` schema
|
|
70
|
+
* pairs. Every endpoint in the tree must have a corresponding entry — omitting any path
|
|
71
|
+
* is a compile-time error. Use this for `satisfies` annotations on `endpointSchemas`
|
|
72
|
+
* objects where exhaustiveness is enforced.
|
|
73
|
+
*
|
|
74
|
+
* @template T - The plugin's endpoint tree (e.g. `typeof githubEndpointsNested`)
|
|
75
|
+
*/
|
|
76
|
+
export type RequiredPluginEndpointSchemas<T extends EndpointTree> = Record<EndpointPathsOf<T>, {
|
|
77
|
+
input?: ZodTypeAny;
|
|
78
|
+
output?: ZodTypeAny;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* A **required** map from dot-notation webhook paths to their `{ description, payload, response }`
|
|
82
|
+
* schema entries. Every webhook in the tree must have a corresponding entry — omitting any path
|
|
83
|
+
* is a compile-time error. Use this for `satisfies` annotations on `webhookSchemas` objects
|
|
84
|
+
* where exhaustiveness is enforced.
|
|
85
|
+
*
|
|
86
|
+
* @template T - The plugin's webhook tree (e.g. `typeof slackWebhooksNested`)
|
|
87
|
+
*/
|
|
88
|
+
export type RequiredPluginWebhookSchemas<T extends WebhookTree> = Record<WebhookPathsOf<T>, {
|
|
89
|
+
description?: string;
|
|
90
|
+
payload?: ZodTypeAny;
|
|
91
|
+
response?: ZodTypeAny;
|
|
92
|
+
}>;
|
|
59
93
|
/**
|
|
60
94
|
* Permission configuration for a plugin, passed as `permissions` in the plugin options.
|
|
61
|
-
* Controls what the AI agent is allowed to do
|
|
95
|
+
* Controls what the AI agent is allowed to do.
|
|
62
96
|
*
|
|
63
97
|
* The `overrides` object uses dot-notation keys derived from the plugin's endpoint tree at
|
|
64
98
|
* the TypeScript level — only valid paths autocomplete and compile. Passing a nonexistent
|
|
@@ -327,6 +361,27 @@ export type CorsairPlugin<Id extends AllProviders = AllProviders, Schema extends
|
|
|
327
361
|
input?: ZodTypeAny;
|
|
328
362
|
output?: ZodTypeAny;
|
|
329
363
|
}>;
|
|
364
|
+
/**
|
|
365
|
+
* Zod schemas for each webhook, keyed by dot-notation path.
|
|
366
|
+
* Used by get_webhook_schema() to expose structured type information to the agent.
|
|
367
|
+
* Keys must match the dot-paths of the webhook tree (e.g. 'messages.message').
|
|
368
|
+
*
|
|
369
|
+
* - `payload` — the type of `request.payload` in the before hook
|
|
370
|
+
* - `response` — the type of `response.data` in the after hook
|
|
371
|
+
* - `description` — optional human-readable description of what triggers this webhook
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```ts
|
|
375
|
+
* webhookSchemas: {
|
|
376
|
+
* 'messages.message': { description: 'Fires when a message is posted', payload: MessageEventSchema, response: z.object({ ... }) },
|
|
377
|
+
* }
|
|
378
|
+
* ```
|
|
379
|
+
*/
|
|
380
|
+
webhookSchemas?: Record<string, {
|
|
381
|
+
description?: string;
|
|
382
|
+
payload?: ZodTypeAny;
|
|
383
|
+
response?: ZodTypeAny;
|
|
384
|
+
}>;
|
|
330
385
|
};
|
|
331
386
|
/**
|
|
332
387
|
* The full context type for a plugin, combining base context with typed services and options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,WAAW,EACX,MAAM,aAAa,CAAC;AAMrB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,kBAAkB,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,4FAA4F;IAC5F,SAAS,EAAE,iBAAiB,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,O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AAE;QACV;;;;WAIG;QACH,OAAO,EAAE,MAAM,CAAC;QAChB;;;;WAIG;QACH,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;KAC9B,CAAC;CACF,CAAC"}
|
|
@@ -134,5 +134,28 @@ export type BoundWebhookTree = {
|
|
|
134
134
|
export type BindWebhooks<T extends WebhookTree> = {
|
|
135
135
|
[K in keyof T]: T[K] extends CorsairWebhook<any, infer P, infer R> ? BoundWebhook<P, R> : T[K] extends WebhookTree ? BindWebhooks<T[K]> : never;
|
|
136
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* Derives all dot-notation webhook paths from a WebhookTree as a string literal union.
|
|
139
|
+
* Used to provide compile-time validation for webhook schema registry keys.
|
|
140
|
+
* Passing an invalid path to any config that accepts WebhookPathsOf<T> is a type error.
|
|
141
|
+
*
|
|
142
|
+
* Design note: Same recursive constraint relaxation as EndpointPathsOf — see that type
|
|
143
|
+
* for a full explanation of why we use `extends object` rather than `extends WebhookTree`
|
|
144
|
+
* on the recursive call. We also check `{ match: any; handler: any }` before `object`
|
|
145
|
+
* because webhook leaves are objects themselves.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* Given: `{ messages: { message: { match: fn, handler: fn } }, channels: { created: { match: fn, handler: fn } } }`
|
|
149
|
+
* Result: `'messages.message' | 'channels.created'`
|
|
150
|
+
*
|
|
151
|
+
* @template T - The webhook tree to extract paths from (unconstrained to allow recursion through as-const types)
|
|
152
|
+
* @template Prefix - Internal accumulator for the current path prefix (do not supply manually)
|
|
153
|
+
*/
|
|
154
|
+
export type WebhookPathsOf<T, Prefix extends string = ''> = {
|
|
155
|
+
[K in keyof T & string]: T[K] extends {
|
|
156
|
+
match: any;
|
|
157
|
+
handler: any;
|
|
158
|
+
} ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends object ? WebhookPathsOf<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never;
|
|
159
|
+
}[keyof T & string];
|
|
137
160
|
export {};
|
|
138
161
|
//# sourceMappingURL=index.d.ts.map
|