@nangohq/types 0.71.10 → 0.71.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/api.d.ts +22 -2
- package/dist/agent/session.d.ts +10 -0
- package/dist/api-keys/scopes.d.ts +1 -1
- package/dist/api.endpoints.d.ts +2 -2
- package/dist/audit-trail/event.d.ts +2 -1
- package/dist/audit-trail/metadata.d.ts +3 -0
- package/dist/function/db.d.ts +2 -0
- package/dist/functions/api.d.ts +60 -2
- package/dist/functions/domain.d.ts +15 -3
- package/dist/integration/api.d.ts +24 -0
- package/dist/meta/api.d.ts +6 -0
- package/dist/mfa/api.d.ts +1 -3
- package/dist/providers/provider.d.ts +1 -1
- package/dist/webhooks/api.d.ts +4 -0
- package/package.json +2 -2
package/dist/agent/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ApiEndpoint, ApiError } from '../api.js';
|
|
|
2
2
|
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
3
3
|
import type { Tags } from '../db.js';
|
|
4
4
|
import type { AgentSessionUnknownPinnedConnectionsPayload } from './connections.js';
|
|
5
|
-
import type { AgentSessionEndedReason } from './session.js';
|
|
5
|
+
import type { AgentSessionCreateConnectionConfig, AgentSessionEndedReason } from './session.js';
|
|
6
6
|
import type { AgentSessionToolsNotInToolsetPayload, AgentSessionUnknownIntegrationsPayload, AgentSessionUnknownToolsPayload, AgentSessionUnsupportedFunctionTypesPayload } from './toolset.js';
|
|
7
7
|
export interface AgentSessionToolListInput {
|
|
8
8
|
tools: string[];
|
|
@@ -11,6 +11,25 @@ export type AgentSessionIntegrationPolicyInput = '*' | {
|
|
|
11
11
|
allow?: AgentSessionToolListInput | '*' | undefined;
|
|
12
12
|
deny?: AgentSessionToolListInput | undefined;
|
|
13
13
|
};
|
|
14
|
+
export type AgentSessionMetaToolInput = boolean | {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
tags?: Tags | undefined;
|
|
17
|
+
};
|
|
18
|
+
export interface AgentSessionMetaToolsInput {
|
|
19
|
+
nango_tool_search?: boolean | {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
} | undefined;
|
|
22
|
+
nango_execute?: boolean | {
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
} | undefined;
|
|
25
|
+
nango_proxy?: boolean | {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
nango_create_connection?: boolean | {
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
tags?: Tags | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}
|
|
14
33
|
export interface PostAgentSessionsBody {
|
|
15
34
|
tenant: {
|
|
16
35
|
connections: {
|
|
@@ -25,7 +44,7 @@ export interface PostAgentSessionsBody {
|
|
|
25
44
|
};
|
|
26
45
|
toolset?: '*' | Record<string, AgentSessionIntegrationPolicyInput> | undefined;
|
|
27
46
|
pinned_tools?: Record<string, string[]> | undefined;
|
|
28
|
-
meta_tools?:
|
|
47
|
+
meta_tools?: AgentSessionMetaToolsInput | undefined;
|
|
29
48
|
expires_in?: string | undefined;
|
|
30
49
|
}
|
|
31
50
|
export interface AgentSessionToolsetSummary {
|
|
@@ -37,6 +56,7 @@ export interface AgentSessionMetaToolsSummary {
|
|
|
37
56
|
nango_tool_search: boolean;
|
|
38
57
|
nango_execute: boolean;
|
|
39
58
|
nango_proxy: boolean;
|
|
59
|
+
nango_create_connection: AgentSessionCreateConnectionConfig;
|
|
40
60
|
}
|
|
41
61
|
export interface AgentSessionUnknownMetaToolsPayload {
|
|
42
62
|
meta_tools: string[];
|
package/dist/agent/session.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import type { Tags } from '../db.js';
|
|
1
2
|
import type { AgentSessionResolvedConnections } from './connections.js';
|
|
2
3
|
import type { AgentSessionCompiledToolset } from './toolset.js';
|
|
4
|
+
/**
|
|
5
|
+
* `tags` are stamped on the connection the agent has created, on top of the reserved tag that binds
|
|
6
|
+
* it to the session, so it also matches the selectors a later session for the same tenant will use.
|
|
7
|
+
*/
|
|
8
|
+
export interface AgentSessionCreateConnectionConfig {
|
|
9
|
+
readonly enabled: boolean;
|
|
10
|
+
readonly tags: Tags;
|
|
11
|
+
}
|
|
3
12
|
export interface AgentSessionMetaTools {
|
|
4
13
|
readonly nangoToolSearch: boolean;
|
|
5
14
|
readonly nangoExecute: boolean;
|
|
6
15
|
readonly nangoProxy: boolean;
|
|
16
|
+
readonly nangoCreateConnection: AgentSessionCreateConnectionConfig;
|
|
7
17
|
}
|
|
8
18
|
export type AgentSessionEndedReason = 'terminated' | 'expired';
|
|
9
19
|
export interface AgentSession {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Every wildcard in a namespace: `environment:*`, `environment:connections:*`, … */
|
|
2
2
|
export type WildcardsFor<Namespace extends string> = `${Namespace}:*` | `${Namespace}:${string}:*`;
|
|
3
|
-
export declare const API_KEY_SCOPES: readonly ["environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:list_functions", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:create", "environment:integrations:update", "environment:integrations:delete", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connect_sessions:write", "environment:agent_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:functions:list", "environment:functions:read", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:invocations", "environment:deploy", "environment:records:read", "environment:records:write", "environment:logs:read", "environment:actions:execute", "environment:proxy", "environment:variables:read", "environment:webhook_signing_key:rotate", "environment:mcp"];
|
|
3
|
+
export declare const API_KEY_SCOPES: readonly ["environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:list_functions", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:create", "environment:integrations:update", "environment:integrations:delete", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connect_sessions:write", "environment:agent_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:functions:list", "environment:functions:read", "environment:functions:update", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:invocations", "environment:deploy", "environment:records:read", "environment:records:write", "environment:logs:read", "environment:actions:execute", "environment:proxy", "environment:variables:read", "environment:webhook_signing_key:rotate", "environment:mcp"];
|
|
4
4
|
export type ConcreteApiKeyScope = (typeof API_KEY_SCOPES)[number];
|
|
5
5
|
/** A scope, or a wildcard over scopes. Which wildcards resolve to something is checked at runtime. */
|
|
6
6
|
export type ApiKeyScope = ConcreteApiKeyScope | WildcardsFor<'environment'>;
|
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, DeletePublicApiKey,
|
|
|
17
17
|
import type { PatchWebhook } from './environment/api/webhook.js';
|
|
18
18
|
import type { PostEnvironmentVariables } from './environment/variable/api.js';
|
|
19
19
|
import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api.js';
|
|
20
|
-
import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunctionDeployment, GetFunctionDryrun, GetFunctionInvocation, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentBundle, PostFunctionDeploymentBundlePreview, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult, PostFunctionInvocation } from './functions/api.js';
|
|
20
|
+
import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunction, GetFunctionDeployment, GetFunctionDryrun, GetFunctionInvocation, GetFunctions, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PatchFunction, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentBundle, PostFunctionDeploymentBundlePreview, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult, PostFunctionInvocation } from './functions/api.js';
|
|
21
21
|
import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
|
|
22
22
|
import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
|
|
23
23
|
import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
|
|
@@ -35,7 +35,7 @@ import type { GetConnectionSyncs, GetPublicSyncStatus, PostPublicSyncPause, Post
|
|
|
35
35
|
import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
|
|
36
36
|
import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
|
|
37
37
|
import type { PostPublicWebhook } from './webhooks/http.api.js';
|
|
38
|
-
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostAgentSessions | DeleteAgentSession | PostAgentSessionMcp | GetAgentSessionMcp | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | DeleteConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicClientMetadata | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PostCliTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | PostFunctionInvocation | GetFunctionInvocation | PostFunctionDeploymentBundle | PostFunctionDeploymentBundlePreview | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | PostPublicRotateWebhookSigningKey | AllPublicProxy | PostPublicEnvironment | DeletePublicEnvironment | GetPublicEnvironments | GetPublicApiKey | GetPublicApiKeys | PostPublicApiKey | DeletePublicApiKey;
|
|
38
|
+
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostAgentSessions | DeleteAgentSession | PostAgentSessionMcp | GetAgentSessionMcp | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | DeleteConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicClientMetadata | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PostCliTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | GetFunction | GetFunctions | PatchFunction | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | PostFunctionInvocation | GetFunctionInvocation | PostFunctionDeploymentBundle | PostFunctionDeploymentBundlePreview | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | PostPublicRotateWebhookSigningKey | AllPublicProxy | PostPublicEnvironment | DeletePublicEnvironment | GetPublicEnvironments | GetPublicApiKey | GetPublicApiKeys | PostPublicApiKey | DeletePublicApiKey;
|
|
39
39
|
export type PrivateApiEndpoints = GetAuditTrail | GetAuditTrailExport | ListAccountApiKeys | CreateAccountApiKey | DeleteAccountApiKey | ConfirmEmail | PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetOverdueInvoices | GetBillingUsage | GetBillingUsageTopDimensionValues | GetUpcomingInvoice | GetBillingPeriodCosts | GetProjectedCosts | GetSpendAlert | PutSpendAlert | DeleteSpendAlert | GetUser | PatchUser | PutUserPassword | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunction | GetIntegrationFunctions | GetFunctionCode | DeleteIntegrationFunction | GetIntegrationTemplates | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | PatchConnection | PostConnectionMetadata | GetConnectionRecordModels | GetConnectionRecords | GetConnectionSyncs | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | GetOnboardingAccountDiscovery | PostOnboardingRequestInvite | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | PostRotateWebhookSigningKey | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction | GetMFAStatus | PostMFAEnrollment | PostMFAActivation | PostMFARecoveryCodes | PostMFALoginVerification | DeleteMFA | GetPlainHmac;
|
|
40
40
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
41
41
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentSessionCreatedMetadata, ApiKeyUpdatedMetadata, AppAuthLoginMetadata, AuditTrailFiltersMetadata, AuditTrailQueriedMetadata, BillingPaymentMethodRemovedMetadata, BillingPlanChangedMetadata, BillingSpendAlertChangedMetadata, ConnectionMetadata, ConnectionUpdatedMetadata, EnvironmentCreatedMetadata, EnvironmentUpdatedMetadata, EnvironmentVariablesChangedMetadata, EnvironmentWebhookMetadata, FunctionDeletedMetadata, FunctionDeployedMetadata, FunctionUpgradedMetadata, IntegrationProviderMetadata, IntegrationUpdatedMetadata, MemberInvitedMetadata, MemberRoleChangedMetadata, MfaVerifiedMetadata, SyncBaseMetadata, SyncFrequencyChangedMetadata, SyncTriggeredMetadata, SyncVariantMetadata, TeamUpdatedMetadata, UserUpdatedMetadata } from './metadata.js';
|
|
1
|
+
import type { AgentSessionCreatedMetadata, ApiKeyUpdatedMetadata, AppAuthLoginMetadata, AuditTrailFiltersMetadata, AuditTrailQueriedMetadata, BillingPaymentMethodRemovedMetadata, BillingPlanChangedMetadata, BillingSpendAlertChangedMetadata, ConnectionMetadata, ConnectionUpdatedMetadata, EnvironmentCreatedMetadata, EnvironmentUpdatedMetadata, EnvironmentVariablesChangedMetadata, EnvironmentWebhookMetadata, FunctionDeletedMetadata, FunctionDeployedMetadata, FunctionUpdatedMetadata, FunctionUpgradedMetadata, IntegrationProviderMetadata, IntegrationUpdatedMetadata, MemberInvitedMetadata, MemberRoleChangedMetadata, MfaVerifiedMetadata, SyncBaseMetadata, SyncFrequencyChangedMetadata, SyncTriggeredMetadata, SyncVariantMetadata, TeamUpdatedMetadata, UserUpdatedMetadata } from './metadata.js';
|
|
2
2
|
export type AuditTrailVersion = '2026-07-16';
|
|
3
3
|
export type AuditActorType = 'user' | 'api_key' | 'public_key' | 'connect_session' | 'anonymous' | 'unknown';
|
|
4
4
|
export type AuditOutcome = 'success' | 'failure' | 'denied';
|
|
@@ -26,6 +26,7 @@ interface AuditEventTable {
|
|
|
26
26
|
function: {
|
|
27
27
|
deployed: FunctionDeployedMetadata;
|
|
28
28
|
upgraded: FunctionUpgradedMetadata;
|
|
29
|
+
updated: FunctionUpdatedMetadata;
|
|
29
30
|
deleted: FunctionDeletedMetadata;
|
|
30
31
|
};
|
|
31
32
|
integration: {
|
|
@@ -34,6 +34,9 @@ export interface FunctionDeployedMetadata {
|
|
|
34
34
|
export interface FunctionUpgradedMetadata {
|
|
35
35
|
upgradeVersion?: string;
|
|
36
36
|
}
|
|
37
|
+
export interface FunctionUpdatedMetadata {
|
|
38
|
+
state?: string;
|
|
39
|
+
}
|
|
37
40
|
export interface FunctionDeletedMetadata {
|
|
38
41
|
type?: string;
|
|
39
42
|
}
|
package/dist/function/db.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTr
|
|
|
4
4
|
import type { JSONSchema7 } from 'json-schema';
|
|
5
5
|
export interface DBFunctionConfig extends TimestampsAndDeletedAt {
|
|
6
6
|
id: number;
|
|
7
|
+
uuid: string;
|
|
7
8
|
nango_config_id: number;
|
|
8
9
|
environment_id: number;
|
|
9
10
|
name: string;
|
|
@@ -34,6 +35,7 @@ export interface DBFunctionInstance extends TimestampsAndDeletedAt {
|
|
|
34
35
|
function_config_id: number;
|
|
35
36
|
name: string;
|
|
36
37
|
variant: string;
|
|
38
|
+
enabled: boolean;
|
|
37
39
|
last_run_at: Date | null;
|
|
38
40
|
frequency: string | null;
|
|
39
41
|
}
|
package/dist/functions/api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
2
|
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
3
3
|
import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTriggerDefinition } from '../function/config.js';
|
|
4
|
+
import type { FunctionSource } from '../syncConfigs/db.js';
|
|
4
5
|
import type { FunctionType, ListedNangoFunction, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
|
|
5
6
|
import type { JSONSchema7 } from 'json-schema';
|
|
6
7
|
export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
|
|
@@ -222,6 +223,63 @@ export type PostFunctionDeploymentResult = ApiEndpoint<{
|
|
|
222
223
|
};
|
|
223
224
|
}>;
|
|
224
225
|
export type FunctionInvocationType = 'wait' | 'no_wait';
|
|
226
|
+
export interface GetFunctionResponse {
|
|
227
|
+
uuid: string;
|
|
228
|
+
integration_id: string;
|
|
229
|
+
provider: string;
|
|
230
|
+
name: string;
|
|
231
|
+
description: string;
|
|
232
|
+
state: 'enabled' | 'disabled';
|
|
233
|
+
source: FunctionSource;
|
|
234
|
+
trigger: FunctionTriggerDefinition;
|
|
235
|
+
created_at: string;
|
|
236
|
+
updated_at: string;
|
|
237
|
+
}
|
|
238
|
+
export type GetFunction = ApiEndpoint<{
|
|
239
|
+
Audit: {
|
|
240
|
+
kind: 'no-audit';
|
|
241
|
+
reason: 'non-auditable';
|
|
242
|
+
};
|
|
243
|
+
Method: 'GET';
|
|
244
|
+
Path: '/functions/:uuid';
|
|
245
|
+
Params: {
|
|
246
|
+
uuid: string;
|
|
247
|
+
};
|
|
248
|
+
Success: GetFunctionResponse;
|
|
249
|
+
}>;
|
|
250
|
+
export type PatchFunction = ApiEndpoint<{
|
|
251
|
+
Audit: AuditPolicy<'function', 'updated', 'environment'>;
|
|
252
|
+
Method: 'PATCH';
|
|
253
|
+
Path: '/functions/:uuid';
|
|
254
|
+
Params: {
|
|
255
|
+
uuid: string;
|
|
256
|
+
};
|
|
257
|
+
Body: {
|
|
258
|
+
state: 'enabled' | 'disabled';
|
|
259
|
+
};
|
|
260
|
+
Success: GetFunctionResponse;
|
|
261
|
+
}>;
|
|
262
|
+
export interface GetFunctionsQuery {
|
|
263
|
+
integration?: string | undefined;
|
|
264
|
+
provider?: string | undefined;
|
|
265
|
+
state?: 'enabled' | 'disabled' | undefined;
|
|
266
|
+
'trigger.kind'?: FunctionTriggerDefinition['kind'] | undefined;
|
|
267
|
+
cursor?: string | undefined;
|
|
268
|
+
limit?: number | undefined;
|
|
269
|
+
}
|
|
270
|
+
export type GetFunctions = ApiEndpoint<{
|
|
271
|
+
Audit: {
|
|
272
|
+
kind: 'no-audit';
|
|
273
|
+
reason: 'non-auditable';
|
|
274
|
+
};
|
|
275
|
+
Method: 'GET';
|
|
276
|
+
Path: '/functions';
|
|
277
|
+
Querystring: GetFunctionsQuery;
|
|
278
|
+
Success: {
|
|
279
|
+
data: GetFunctionResponse[];
|
|
280
|
+
next_cursor: string | null;
|
|
281
|
+
};
|
|
282
|
+
}>;
|
|
225
283
|
export type FunctionInvocationErrorCode = 'function_failed' | 'server_error' | 'connection_not_found' | 'function_not_found' | 'function_disabled' | 'validation_error' | 'invalid_invocation';
|
|
226
284
|
type FunctionInvocationSuccess = any;
|
|
227
285
|
export type PostFunctionInvocation = ApiEndpoint<{
|
|
@@ -325,7 +383,7 @@ export type DeleteIntegrationFunction = ApiEndpoint<{
|
|
|
325
383
|
providerConfigKey: string;
|
|
326
384
|
functionName: string;
|
|
327
385
|
};
|
|
328
|
-
Error: ApiError<'function_managed_by_deploy'>;
|
|
386
|
+
Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
|
|
329
387
|
Success: FunctionDeletionSuccess;
|
|
330
388
|
}>;
|
|
331
389
|
export type GetProviderTemplates = ApiEndpoint<{
|
|
@@ -384,7 +442,7 @@ export type DeletePublicIntegrationFunction = ApiEndpoint<{
|
|
|
384
442
|
uniqueKey: string;
|
|
385
443
|
name: string;
|
|
386
444
|
};
|
|
387
|
-
Error: ApiError<'function_managed_by_deploy'>;
|
|
445
|
+
Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
|
|
388
446
|
Success: FunctionDeletionSuccess;
|
|
389
447
|
}>;
|
|
390
448
|
export type GetPublicProviderTemplates = ApiEndpoint<{
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { OnEventType } from '../scripts/on-events/api.js';
|
|
2
2
|
import type { FunctionSource } from '../syncConfigs/db.js';
|
|
3
3
|
import type { JSONSchema7 } from 'json-schema';
|
|
4
|
+
/** `tools-catalog` is list/API only — never a DB `FunctionSource`. */
|
|
5
|
+
export type FunctionListSource = FunctionSource | 'tools-catalog';
|
|
4
6
|
export type FunctionType = 'action' | 'sync' | 'on-event';
|
|
5
7
|
interface NangoFunctionBase {
|
|
6
8
|
name: string;
|
|
@@ -28,6 +30,7 @@ export interface NangoOnEventFunction extends NangoFunctionBase {
|
|
|
28
30
|
event: OnEventType;
|
|
29
31
|
}
|
|
30
32
|
export type NangoFunction = NangoSyncFunction | NangoActionFunction | NangoOnEventFunction;
|
|
33
|
+
/** A deployed sync-config row. `id` and `last_deployed` are always present. */
|
|
31
34
|
export interface FunctionAvailability {
|
|
32
35
|
id: number;
|
|
33
36
|
enabled: boolean;
|
|
@@ -35,9 +38,18 @@ export interface FunctionAvailability {
|
|
|
35
38
|
last_deployed: string;
|
|
36
39
|
source: FunctionSource;
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
+
/** A row in a function list. Catalog actions have no deployed row. */
|
|
42
|
+
export interface ListedFunctionAvailability {
|
|
43
|
+
/** Sync-config id. `null` when the function is served from the catalog (no deployed row). */
|
|
44
|
+
id: number | null;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
/** ISO-8601 timestamp. `null` when the function was never deployed. */
|
|
47
|
+
last_deployed: string | null;
|
|
48
|
+
source: FunctionListSource;
|
|
49
|
+
}
|
|
50
|
+
export type ListedNangoSyncFunction = NangoSyncFunction & ListedFunctionAvailability;
|
|
51
|
+
export type ListedNangoActionFunction = NangoActionFunction & ListedFunctionAvailability;
|
|
52
|
+
export type ListedNangoOnEventFunction = NangoOnEventFunction & ListedFunctionAvailability;
|
|
41
53
|
export type ListedNangoFunction = ListedNangoSyncFunction | ListedNangoActionFunction | ListedNangoOnEventFunction;
|
|
42
54
|
export type NangoFunctionTemplate = (NangoSyncFunction | NangoActionFunction) & {
|
|
43
55
|
deployed?: FunctionAvailability;
|
|
@@ -32,6 +32,20 @@ export interface ApiPublicIntegrationInclude {
|
|
|
32
32
|
app_id: string | null;
|
|
33
33
|
app_link: string | null;
|
|
34
34
|
private_key: string | null;
|
|
35
|
+
} | {
|
|
36
|
+
type: AuthModes['MCP_OAUTH2_GENERIC'];
|
|
37
|
+
client_name: string | null;
|
|
38
|
+
client_uri: string | null;
|
|
39
|
+
client_logo_uri: string | null;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'INTEGRATION_CONFIG';
|
|
42
|
+
auth_mode: AuthModeType;
|
|
43
|
+
integration_config: Record<string, string>;
|
|
44
|
+
} | {
|
|
45
|
+
type: AuthModes['MCP_OAUTH2'];
|
|
46
|
+
client_id: string | null;
|
|
47
|
+
client_secret: string | null;
|
|
48
|
+
scopes: string | null;
|
|
35
49
|
} | null;
|
|
36
50
|
}
|
|
37
51
|
export type GetPublicListIntegrations = ApiEndpoint<{
|
|
@@ -372,4 +386,14 @@ export type ApiPublicIntegrationCredentials = {
|
|
|
372
386
|
app_id: string;
|
|
373
387
|
app_link: string;
|
|
374
388
|
private_key: string;
|
|
389
|
+
} | {
|
|
390
|
+
type: Extract<AuthModeType, 'MCP_OAUTH2_GENERIC'>;
|
|
391
|
+
client_name?: string | undefined;
|
|
392
|
+
client_uri?: string | undefined;
|
|
393
|
+
client_logo_uri?: string | undefined;
|
|
394
|
+
} | {
|
|
395
|
+
type: Extract<AuthModeType, 'MCP_OAUTH2'>;
|
|
396
|
+
client_id?: string | undefined;
|
|
397
|
+
client_secret?: string | undefined;
|
|
398
|
+
scopes?: string | undefined;
|
|
375
399
|
};
|
package/dist/meta/api.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
2
|
import type { DBEnvironment } from '../environment/db.js';
|
|
3
3
|
export type ApiEnvironmentSummary = Pick<DBEnvironment, 'id' | 'account_id' | 'name' | 'is_production'>;
|
|
4
|
+
export type AccountGroupProperties = {
|
|
5
|
+
name?: string;
|
|
6
|
+
plan?: string;
|
|
7
|
+
created_date?: string;
|
|
8
|
+
};
|
|
4
9
|
export type GetMeta = ApiEndpoint<{
|
|
5
10
|
Audit: {
|
|
6
11
|
kind: 'no-audit';
|
|
@@ -20,6 +25,7 @@ export type GetMeta = ApiEndpoint<{
|
|
|
20
25
|
debugMode: boolean;
|
|
21
26
|
gettingStartedClosed: boolean;
|
|
22
27
|
auditTrail: boolean;
|
|
28
|
+
accountGroup: AccountGroupProperties;
|
|
23
29
|
};
|
|
24
30
|
};
|
|
25
31
|
}>;
|
package/dist/mfa/api.d.ts
CHANGED
|
@@ -59,9 +59,7 @@ export type DeleteMFA = ApiEndpoint<{
|
|
|
59
59
|
Audit: AuditPolicy<'mfa', 'disabled', 'account'>;
|
|
60
60
|
Method: 'DELETE';
|
|
61
61
|
Path: '/api/v1/account/mfa';
|
|
62
|
-
Body:
|
|
63
|
-
code: string;
|
|
64
|
-
};
|
|
62
|
+
Body: MFACredential;
|
|
65
63
|
Error: ApiError<'invalid_mfa_code'> | ApiError<'mfa_not_enabled'>;
|
|
66
64
|
Success: {
|
|
67
65
|
success: true;
|
package/dist/webhooks/api.d.ts
CHANGED
|
@@ -71,6 +71,10 @@ export interface NangoForwardWebhookBody extends NangoWebhookBase {
|
|
|
71
71
|
connectionId?: string;
|
|
72
72
|
providerConfigKey: string;
|
|
73
73
|
payload: unknown;
|
|
74
|
+
/**
|
|
75
|
+
* Only present when Nango could not verify the webhook came from the provider
|
|
76
|
+
*/
|
|
77
|
+
unverified?: true;
|
|
74
78
|
}
|
|
75
79
|
export interface NangoAsyncActionWebhookBody extends NangoWebhookBase {
|
|
76
80
|
type: 'async_action';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nangohq/types",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.11",
|
|
4
4
|
"description": "Types used in Nango applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/utils"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"axios": "1.
|
|
15
|
+
"axios": "1.20.0",
|
|
16
16
|
"json-schema": "0.4.0",
|
|
17
17
|
"type-fest": "4.41.0"
|
|
18
18
|
},
|