@inferencesh/sdk 0.25.0 → 0.26.1
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/CHANGELOG.md +14 -0
- package/dist/types.d.ts +509 -22
- package/dist/types.js +69 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.26.1] - 2026-10-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Generated types follow the API: `AuthSchemeSpec` gains `resource`, `issuer`, `authorization_response_iss_parameter_supported`, `callback` and `profile`, and `AuthSchemeClientAuth` adds `"none"`.
|
|
15
|
+
|
|
16
|
+
## [0.26.0] - 2026-10-12
|
|
17
|
+
|
|
18
|
+
Breaking (types only, following the API's credential model): `CredentialRequirement.provider` is now a `ProviderSeed` object (`{ name?, website? }`) instead of a string, and the requirement's `name`, `website` and `key` fields moved into it. Requirements are keyed by slug.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Generated types for the credential model: `ProviderSeed`, `ProviderSummary`, `ConnectTokens`, `SecretField`, `CredentialRequirements`, and the auth scheme vocabulary (`AuthSchemeKind`, `AuthSchemeFlow`, `AuthSchemeAPIKeyIn`, `AuthSchemeHTTPScheme`, `AuthSchemeClientAuth`), plus `provider_info` and MCP credentials on the DTOs.
|
|
23
|
+
|
|
10
24
|
## [0.25.0] - 2026-10-12
|
|
11
25
|
|
|
12
26
|
### Added
|
package/dist/types.d.ts
CHANGED
|
@@ -548,7 +548,7 @@ export interface AppVersionInput {
|
|
|
548
548
|
};
|
|
549
549
|
kernel?: string;
|
|
550
550
|
required_secrets?: SecretRequirement[];
|
|
551
|
-
required_credentials?:
|
|
551
|
+
required_credentials?: CredentialRequirements;
|
|
552
552
|
resources?: AppResources;
|
|
553
553
|
}
|
|
554
554
|
/**
|
|
@@ -1408,7 +1408,7 @@ export interface AppFunction {
|
|
|
1408
1408
|
* in app code. Each must be covered by the app-wide list in inf.yml.
|
|
1409
1409
|
* Empty means the function gets the app-wide list.
|
|
1410
1410
|
*/
|
|
1411
|
-
credentials?:
|
|
1411
|
+
credentials?: CredentialRequirements;
|
|
1412
1412
|
/**
|
|
1413
1413
|
* Annotations are MCP tool hints (read-only, destructive, idempotent,
|
|
1414
1414
|
* open-world) declared on the function. Hints only: nothing trusts
|
|
@@ -1448,33 +1448,63 @@ export interface SecretRequirement {
|
|
|
1448
1448
|
optional?: boolean;
|
|
1449
1449
|
}
|
|
1450
1450
|
/**
|
|
1451
|
-
* CredentialRequirement is an entry under credentials: in inf.yml:
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1454
|
-
* credential), Scopes what to ask for (an OAuth one)
|
|
1451
|
+
* CredentialRequirement is an entry under credentials: in inf.yml: a
|
|
1452
|
+
* credential the app uses, keyed by the credential's slug (what
|
|
1453
|
+
* Credential.Provider stores). Secrets lists the keys to inject from it (an
|
|
1454
|
+
* API key credential), Scopes what to ask for (an OAuth one), Capabilities
|
|
1455
|
+
* the platform-defined grants it needs ("x.tweet.read", "google.sheets":
|
|
1456
|
+
* an OAuth grant with the scopes it implies), each a capability of the
|
|
1457
|
+
* entry's own provider. Provider seeds the catalog row for the company the
|
|
1458
|
+
* first time it is seen and never overwrites it; Auth seeds the auth scheme
|
|
1459
|
+
* when the slug is free.
|
|
1455
1460
|
* credentials:
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
1458
|
-
*
|
|
1461
|
+
* slack:
|
|
1462
|
+
* capabilities: [slack.channels.write]
|
|
1463
|
+
* acme:
|
|
1459
1464
|
* secrets: [ACME_API_KEY]
|
|
1460
|
-
*
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1465
|
+
* provider: {name: Acme CRM, website: acme.com}
|
|
1466
|
+
* The list form that preceded it is still read: `- provider: acme` names
|
|
1467
|
+
* the slug, `- key: x.tweet.read` a capability (its slug is the part
|
|
1468
|
+
* before the first dot), `name:` and `website:` seed the provider.
|
|
1463
1469
|
*/
|
|
1464
1470
|
export interface CredentialRequirement {
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
* Name and Website describe a provider the platform does not list: the
|
|
1468
|
-
* name its credential is shown under and the site its logo comes from.
|
|
1469
|
-
*/
|
|
1470
|
-
name?: string;
|
|
1471
|
-
website?: string;
|
|
1472
|
-
key?: string;
|
|
1471
|
+
slug?: string;
|
|
1472
|
+
capabilities?: string[];
|
|
1473
1473
|
description?: string;
|
|
1474
1474
|
optional?: boolean;
|
|
1475
1475
|
secrets?: string[];
|
|
1476
1476
|
scopes?: string[];
|
|
1477
|
+
/**
|
|
1478
|
+
* Provider describes the company the credential belongs to, for a
|
|
1479
|
+
* catalog row that does not exist yet. Its slug defaults to the
|
|
1480
|
+
* credential slug.
|
|
1481
|
+
*/
|
|
1482
|
+
provider?: ProviderSeed;
|
|
1483
|
+
/**
|
|
1484
|
+
* Auth is the credential's auth scheme, for a slug no row defines yet.
|
|
1485
|
+
*/
|
|
1486
|
+
auth?: AuthSchemeSpec;
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* ProviderSeed is a provider (the company behind a credential) as an app
|
|
1490
|
+
* declares it: enough to create its catalog row when none exists.
|
|
1491
|
+
*/
|
|
1492
|
+
export interface ProviderSeed {
|
|
1493
|
+
slug?: string;
|
|
1494
|
+
name?: string;
|
|
1495
|
+
description?: string;
|
|
1496
|
+
website?: string;
|
|
1497
|
+
logo_uri?: string;
|
|
1498
|
+
docs_uri?: string;
|
|
1499
|
+
tos_uri?: string;
|
|
1500
|
+
policy_uri?: string;
|
|
1477
1501
|
}
|
|
1502
|
+
/**
|
|
1503
|
+
* CredentialRequirements is the credentials: list of a manifest. It reads
|
|
1504
|
+
* both forms: a map keyed by credential slug (the current one) and a list
|
|
1505
|
+
* of entries; it is always written as a list.
|
|
1506
|
+
*/
|
|
1507
|
+
export type CredentialRequirements = CredentialRequirement[];
|
|
1478
1508
|
/**
|
|
1479
1509
|
* AppDTO is the API response for a full app.
|
|
1480
1510
|
*/
|
|
@@ -1571,7 +1601,7 @@ export interface AppVersionDTO extends BaseModelDTO {
|
|
|
1571
1601
|
};
|
|
1572
1602
|
kernel: string;
|
|
1573
1603
|
required_secrets?: SecretRequirement[];
|
|
1574
|
-
required_credentials?:
|
|
1604
|
+
required_credentials?: CredentialRequirements;
|
|
1575
1605
|
resources: AppResources;
|
|
1576
1606
|
/**
|
|
1577
1607
|
* Sandbox is the version's declared sandbox exceptions. Absent on a
|
|
@@ -2449,6 +2479,16 @@ export interface ToolExplanationDTO {
|
|
|
2449
2479
|
*/
|
|
2450
2480
|
risk: string;
|
|
2451
2481
|
}
|
|
2482
|
+
/**
|
|
2483
|
+
* ConnectTokens are tokens a provider minted while connecting, for grants
|
|
2484
|
+
* that need no redirect (OAuth client credentials): the credential service
|
|
2485
|
+
* saves them on the login it writes. They travel inside the process only.
|
|
2486
|
+
*/
|
|
2487
|
+
export interface ConnectTokens {
|
|
2488
|
+
AccessToken: SensitiveString;
|
|
2489
|
+
RefreshToken: SensitiveString;
|
|
2490
|
+
ExpiresAt?: string;
|
|
2491
|
+
}
|
|
2452
2492
|
/**
|
|
2453
2493
|
* CredentialDTO is the API response for a credential (never exposes secrets).
|
|
2454
2494
|
*/
|
|
@@ -2478,12 +2518,32 @@ export interface CredentialDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
2478
2518
|
is_primary: boolean;
|
|
2479
2519
|
error_message?: string;
|
|
2480
2520
|
}
|
|
2521
|
+
/**
|
|
2522
|
+
* ProviderSummary is the company a credential slug belongs to: the
|
|
2523
|
+
* providers row's identity, for grouping and display.
|
|
2524
|
+
*/
|
|
2525
|
+
export interface ProviderSummary {
|
|
2526
|
+
slug: string;
|
|
2527
|
+
name: string;
|
|
2528
|
+
icon_url?: string;
|
|
2529
|
+
website?: string;
|
|
2530
|
+
docs_url?: string;
|
|
2531
|
+
}
|
|
2481
2532
|
/**
|
|
2482
2533
|
* CredentialConfigDTO is the merged view: provider catalog + credential state.
|
|
2483
2534
|
*/
|
|
2484
2535
|
export interface CredentialConfigDTO {
|
|
2485
2536
|
slug: string;
|
|
2537
|
+
/**
|
|
2538
|
+
* Provider is the credential slug (what Credential.Provider stores):
|
|
2539
|
+
* one way to authenticate. The company it belongs to is ProviderInfo.
|
|
2540
|
+
*/
|
|
2486
2541
|
provider: string;
|
|
2542
|
+
/**
|
|
2543
|
+
* ProviderInfo is the company this slug belongs to, for grouping: the
|
|
2544
|
+
* providers row its auth scheme names, else the slug's own identity.
|
|
2545
|
+
*/
|
|
2546
|
+
provider_info?: ProviderSummary;
|
|
2487
2547
|
type: string;
|
|
2488
2548
|
name: string;
|
|
2489
2549
|
short_name: string;
|
|
@@ -3970,6 +4030,13 @@ export interface MCPServerDTO {
|
|
|
3970
4030
|
*/
|
|
3971
4031
|
setup?: MCPServerSetup;
|
|
3972
4032
|
documentation_url: string;
|
|
4033
|
+
/**
|
|
4034
|
+
* Credentials is what the server needs to be called (the same shape as
|
|
4035
|
+
* an app's inf.yml credentials). CredentialSlug is the first entry's
|
|
4036
|
+
* slug: the vault entry a call sends, so a page can link to it.
|
|
4037
|
+
*/
|
|
4038
|
+
credentials?: CredentialRequirements;
|
|
4039
|
+
credential_slug?: string;
|
|
3973
4040
|
connection_status?: string;
|
|
3974
4041
|
/**
|
|
3975
4042
|
* ConnectionScope is who the caller's connection to this server belongs
|
|
@@ -4481,7 +4548,7 @@ export interface SetupAction {
|
|
|
4481
4548
|
*/
|
|
4482
4549
|
export interface CheckRequirementsRequest {
|
|
4483
4550
|
secrets?: SecretRequirement[];
|
|
4484
|
-
credentials?:
|
|
4551
|
+
credentials?: CredentialRequirements;
|
|
4485
4552
|
}
|
|
4486
4553
|
/**
|
|
4487
4554
|
* CheckRequirementsResponse is the API response for checking requirements
|
|
@@ -4534,6 +4601,23 @@ export interface SecretDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
4534
4601
|
*/
|
|
4535
4602
|
credential_id?: string;
|
|
4536
4603
|
}
|
|
4604
|
+
/**
|
|
4605
|
+
* SensitiveString is a string type that prevents accidental exposure of secrets.
|
|
4606
|
+
* It redacts in JSON/fmt output unless explicitly accessed via .Expose().
|
|
4607
|
+
* Encryption at rest is handled by the GORM "sensitive" serializer
|
|
4608
|
+
* (api/internal/lib/secrets). Fields must be tagged: `gorm:"serializer:sensitive"`
|
|
4609
|
+
* Note: map-based GORM Updates (map[string]any{"value": ...}) bypass serializers.
|
|
4610
|
+
* Always use struct-based operations for SensitiveString fields.
|
|
4611
|
+
* Redaction:
|
|
4612
|
+
* - JSON serialization: always returns "" (empty string)
|
|
4613
|
+
* - fmt.Sprintf with %s, %v, %#v: always returns "[REDACTED]"
|
|
4614
|
+
* - Only .Expose() returns the actual value
|
|
4615
|
+
* Encryption is enabled when SECRETS_ENCRYPTION_KEY env var is set.
|
|
4616
|
+
* Values are stored as "enc:v2:<encrypted_dek>:<encrypted_data>" in the database.
|
|
4617
|
+
* Key rotation only re-encrypts the DEK, not the data.
|
|
4618
|
+
*/
|
|
4619
|
+
export interface SensitiveString {
|
|
4620
|
+
}
|
|
4537
4621
|
/**
|
|
4538
4622
|
* SocketAccess is where one end of a socket dials and the credential it
|
|
4539
4623
|
* presents. The task's caller gets one in the run response; the worker gets
|
|
@@ -5410,6 +5494,409 @@ export declare const GPUTypeIntel: GPUType;
|
|
|
5410
5494
|
export declare const GPUTypeNvidia: GPUType;
|
|
5411
5495
|
export declare const GPUTypeAMD: GPUType;
|
|
5412
5496
|
export declare const GPUTypeApple: GPUType;
|
|
5497
|
+
/**
|
|
5498
|
+
* AuthSchemeKind is how a provider authenticates: the kinds of an OpenAPI
|
|
5499
|
+
* Security Scheme Object (oauth2, apiKey, http), named the same so a
|
|
5500
|
+
* vendor's spec maps onto a scheme without translation.
|
|
5501
|
+
*/
|
|
5502
|
+
export type AuthSchemeKind = "oauth2" | "api_key" | "http" | "oauth2_authorization_code";
|
|
5503
|
+
/**
|
|
5504
|
+
* AuthSchemeOAuth2 is OAuth 2.0; Flow says which grant.
|
|
5505
|
+
*/
|
|
5506
|
+
export declare const AuthSchemeOAuth2: AuthSchemeKind;
|
|
5507
|
+
/**
|
|
5508
|
+
* AuthSchemeAPIKey is one or more keys a person pastes, sent as a
|
|
5509
|
+
* header or query parameter.
|
|
5510
|
+
*/
|
|
5511
|
+
export declare const AuthSchemeAPIKey: AuthSchemeKind;
|
|
5512
|
+
/**
|
|
5513
|
+
* AuthSchemeHTTP is a pasted secret sent as an HTTP auth scheme
|
|
5514
|
+
* (Authorization: Bearer or Basic).
|
|
5515
|
+
*/
|
|
5516
|
+
export declare const AuthSchemeHTTP: AuthSchemeKind;
|
|
5517
|
+
/**
|
|
5518
|
+
* Deprecated: the kind is AuthSchemeOAuth2 with AuthSchemeFlowAuthorizationCode.
|
|
5519
|
+
* Same value, so comparisons keep working; rows still stored as
|
|
5520
|
+
* "oauth2_authorization_code" are read as oauth2 (UnmarshalJSON).
|
|
5521
|
+
*/
|
|
5522
|
+
export declare const AuthSchemeOAuth2AuthorizationCode: "oauth2";
|
|
5523
|
+
/**
|
|
5524
|
+
* AuthSchemeFlow is the OAuth 2.0 grant an oauth2 scheme uses.
|
|
5525
|
+
*/
|
|
5526
|
+
export type AuthSchemeFlow = "authorization_code" | "client_credentials";
|
|
5527
|
+
/**
|
|
5528
|
+
* AuthSchemeFlowAuthorizationCode is the user-consent flow: authorization
|
|
5529
|
+
* endpoint → code → token endpoint, optionally with PKCE. The default.
|
|
5530
|
+
*/
|
|
5531
|
+
export declare const AuthSchemeFlowAuthorizationCode: AuthSchemeFlow;
|
|
5532
|
+
/**
|
|
5533
|
+
* AuthSchemeFlowClientCredentials is server-to-server: the app's client
|
|
5534
|
+
* id and secret are exchanged at the token endpoint, no redirect, no
|
|
5535
|
+
* user. The login is the app's own.
|
|
5536
|
+
*/
|
|
5537
|
+
export declare const AuthSchemeFlowClientCredentials: AuthSchemeFlow;
|
|
5538
|
+
/**
|
|
5539
|
+
* AuthSchemeAPIKeyIn is where an api_key scheme's key travels.
|
|
5540
|
+
*/
|
|
5541
|
+
export type AuthSchemeAPIKeyIn = "header" | "query";
|
|
5542
|
+
export declare const AuthSchemeAPIKeyInHeader: AuthSchemeAPIKeyIn;
|
|
5543
|
+
export declare const AuthSchemeAPIKeyInQuery: AuthSchemeAPIKeyIn;
|
|
5544
|
+
/**
|
|
5545
|
+
* AuthSchemeHTTPScheme is the Authorization scheme of an http scheme.
|
|
5546
|
+
*/
|
|
5547
|
+
export type AuthSchemeHTTPScheme = "bearer" | "basic";
|
|
5548
|
+
export declare const AuthSchemeHTTPBearer: AuthSchemeHTTPScheme;
|
|
5549
|
+
export declare const AuthSchemeHTTPBasic: AuthSchemeHTTPScheme;
|
|
5550
|
+
/**
|
|
5551
|
+
* SecretField is one value a person pastes to connect an api_key or http
|
|
5552
|
+
* scheme: its vault key and how the form asks for it. Several fields make
|
|
5553
|
+
* a multi-secret provider (Kling's access and secret key).
|
|
5554
|
+
*/
|
|
5555
|
+
export interface SecretField {
|
|
5556
|
+
key: string;
|
|
5557
|
+
label?: string;
|
|
5558
|
+
placeholder?: string;
|
|
5559
|
+
sensitive?: boolean;
|
|
5560
|
+
optional?: boolean;
|
|
5561
|
+
}
|
|
5562
|
+
/**
|
|
5563
|
+
* AuthSchemeClientAuth is how client_id/client_secret reach the token
|
|
5564
|
+
* endpoint. Most providers accept either; a few insist on one.
|
|
5565
|
+
*/
|
|
5566
|
+
export type AuthSchemeClientAuth = "basic" | "body" | "none";
|
|
5567
|
+
/**
|
|
5568
|
+
* AuthSchemeClientAuthBasic sends them as an HTTP Basic Authorization
|
|
5569
|
+
* header (RFC 6749 §2.3.1, the default).
|
|
5570
|
+
*/
|
|
5571
|
+
export declare const AuthSchemeClientAuthBasic: AuthSchemeClientAuth;
|
|
5572
|
+
/**
|
|
5573
|
+
* AuthSchemeClientAuthBody sends them as form fields in the request body.
|
|
5574
|
+
*/
|
|
5575
|
+
export declare const AuthSchemeClientAuthBody: AuthSchemeClientAuth;
|
|
5576
|
+
/**
|
|
5577
|
+
* AuthSchemeClientAuthNone is a public client (RFC 8414
|
|
5578
|
+
* token_endpoint_auth_method "none"): the client id goes in the body,
|
|
5579
|
+
* there is no secret, and PKCE is what proves the client. Its OAuth app
|
|
5580
|
+
* is complete with a client id alone (a dynamically registered client,
|
|
5581
|
+
* or a Client ID Metadata Document URL).
|
|
5582
|
+
*/
|
|
5583
|
+
export declare const AuthSchemeClientAuthNone: AuthSchemeClientAuth;
|
|
5584
|
+
/**
|
|
5585
|
+
* AuthSchemeTokenRequest is the token request's body encoding.
|
|
5586
|
+
*/
|
|
5587
|
+
export type AuthSchemeTokenRequest = "form" | "json";
|
|
5588
|
+
export declare const AuthSchemeTokenRequestForm: AuthSchemeTokenRequest;
|
|
5589
|
+
export declare const AuthSchemeTokenRequestJSON: AuthSchemeTokenRequest;
|
|
5590
|
+
/**
|
|
5591
|
+
* AuthSchemeRefresh is when an access token is refreshed.
|
|
5592
|
+
*/
|
|
5593
|
+
export type AuthSchemeRefresh = "" | "always";
|
|
5594
|
+
/**
|
|
5595
|
+
* AuthSchemeRefreshWhenExpiring refreshes within five minutes of the
|
|
5596
|
+
* reported expiry; a token with no expiry is treated as long-lived
|
|
5597
|
+
* (Slack without token rotation, Notion).
|
|
5598
|
+
*/
|
|
5599
|
+
export declare const AuthSchemeRefreshWhenExpiring: AuthSchemeRefresh;
|
|
5600
|
+
/**
|
|
5601
|
+
* AuthSchemeRefreshAlways refreshes on every read: the provider reports
|
|
5602
|
+
* no expiry but the token does expire (Salesforce's session timeout is
|
|
5603
|
+
* per org and not reported).
|
|
5604
|
+
*/
|
|
5605
|
+
export declare const AuthSchemeRefreshAlways: AuthSchemeRefresh;
|
|
5606
|
+
/**
|
|
5607
|
+
* AuthSchemeRevokeStyle is how the token reaches the revoke endpoint.
|
|
5608
|
+
*/
|
|
5609
|
+
export type AuthSchemeRevokeStyle = "bearer" | "query" | "form";
|
|
5610
|
+
export declare const AuthSchemeRevokeBearer: AuthSchemeRevokeStyle;
|
|
5611
|
+
export declare const AuthSchemeRevokeQuery: AuthSchemeRevokeStyle;
|
|
5612
|
+
export declare const AuthSchemeRevokeForm: AuthSchemeRevokeStyle;
|
|
5613
|
+
/**
|
|
5614
|
+
* AuthSchemeRevoke is the optional token revocation on disconnect.
|
|
5615
|
+
*/
|
|
5616
|
+
export interface AuthSchemeRevoke {
|
|
5617
|
+
url: string;
|
|
5618
|
+
style: AuthSchemeRevokeStyle;
|
|
5619
|
+
/**
|
|
5620
|
+
* ClientAuth also sends client_id and client_secret in the form
|
|
5621
|
+
* (Discord).
|
|
5622
|
+
*/
|
|
5623
|
+
client_auth?: boolean;
|
|
5624
|
+
}
|
|
5625
|
+
/**
|
|
5626
|
+
* AuthSchemeAppKey is one key of the OAuth app a login goes through. The
|
|
5627
|
+
* client id and secret are implied (PREFIX_CLIENT_ID, PREFIX_CLIENT_SECRET);
|
|
5628
|
+
* listing them only overrides their label and placeholder. Other keys
|
|
5629
|
+
* (bot_token, signing_secret, tenant_id) are optional extras the app holds,
|
|
5630
|
+
* read back by name in templates as {app.<name>} and by hooks.
|
|
5631
|
+
*/
|
|
5632
|
+
export interface AuthSchemeAppKey {
|
|
5633
|
+
/**
|
|
5634
|
+
* Name is the key's role: client_id, client_secret, bot_token, …
|
|
5635
|
+
*/
|
|
5636
|
+
name: string;
|
|
5637
|
+
/**
|
|
5638
|
+
* Key is the vault key; default PREFIX_<NAME>.
|
|
5639
|
+
*/
|
|
5640
|
+
key?: string;
|
|
5641
|
+
label?: string;
|
|
5642
|
+
placeholder?: string;
|
|
5643
|
+
sensitive?: boolean;
|
|
5644
|
+
/**
|
|
5645
|
+
* Optional is implied for every name but client_id and client_secret.
|
|
5646
|
+
*/
|
|
5647
|
+
optional?: boolean;
|
|
5648
|
+
}
|
|
5649
|
+
/**
|
|
5650
|
+
* AuthSchemeLookup is a call made after the token exchange, with the new
|
|
5651
|
+
* access token as bearer; its decoded response becomes a document root of
|
|
5652
|
+
* its name for the identity, metadata and later lookups ({user.email},
|
|
5653
|
+
* {resources.0.id}). userinfo_url is shorthand for the lookup named user.
|
|
5654
|
+
* URL, body and headers are templates.
|
|
5655
|
+
*/
|
|
5656
|
+
export interface AuthSchemeLookup {
|
|
5657
|
+
name: string;
|
|
5658
|
+
url: string;
|
|
5659
|
+
method?: string;
|
|
5660
|
+
/**
|
|
5661
|
+
* Body is sent as is; a JSON body is the default content type
|
|
5662
|
+
* (Dropbox's "null", Linear's GraphQL query).
|
|
5663
|
+
*/
|
|
5664
|
+
body?: string;
|
|
5665
|
+
content_type?: string;
|
|
5666
|
+
headers?: {
|
|
5667
|
+
[key: string]: string;
|
|
5668
|
+
};
|
|
5669
|
+
}
|
|
5670
|
+
/**
|
|
5671
|
+
* AuthSchemeCapability is something an app can ask for from this provider,
|
|
5672
|
+
* satisfied by a connection holding its scopes. Scopes are in the scheme's
|
|
5673
|
+
* own (friendly) names, the ones a credential stores.
|
|
5674
|
+
*/
|
|
5675
|
+
export interface AuthSchemeCapability {
|
|
5676
|
+
key: string;
|
|
5677
|
+
scopes?: string[];
|
|
5678
|
+
satisfies?: string[];
|
|
5679
|
+
display_name: string;
|
|
5680
|
+
description?: string;
|
|
5681
|
+
}
|
|
5682
|
+
/**
|
|
5683
|
+
* AuthSchemeSpec is one way to authenticate against a provider, as data.
|
|
5684
|
+
* Everything a standard OAuth2 provider needs is a field; where a provider
|
|
5685
|
+
* deviates in a way data cannot express, the spec names a hook and Go
|
|
5686
|
+
* supplies it (authprovider.RegisterTokenResponseHook and friends).
|
|
5687
|
+
* Templates: URLs, headers, lookup bodies, identifier, name, metadata and
|
|
5688
|
+
* env values are strings with {{path}} placeholders. A path is read from
|
|
5689
|
+
* the flow's document, which grows as the flow goes:
|
|
5690
|
+
* client_id from the authorize step on
|
|
5691
|
+
* vars.* (and each var bare) what the vars hook produced, e.g. {{tenant}}
|
|
5692
|
+
* access_token, token.* after the token exchange (token.* is the
|
|
5693
|
+
* decoded response)
|
|
5694
|
+
* callback.* the other query params the callback carried
|
|
5695
|
+
* (QuickBooks' realmId, Shopify's shop)
|
|
5696
|
+
* <lookup>.* each lookup's response, by its name; user.*
|
|
5697
|
+
* is the userinfo lookup
|
|
5698
|
+
* expires_at, metadata.*, app.* env only: the token's expiry (RFC 3339),
|
|
5699
|
+
* the stored metadata, the app's extra keys
|
|
5700
|
+
* Array elements are indexed: {{resources.0.id}}. {{a|b}} takes the first
|
|
5701
|
+
* path present. A template none of whose placeholders resolve renders "":
|
|
5702
|
+
* omitted from env and metadata, blank as identifier or name.
|
|
5703
|
+
*/
|
|
5704
|
+
export interface AuthSchemeSpec {
|
|
5705
|
+
kind: AuthSchemeKind;
|
|
5706
|
+
/**
|
|
5707
|
+
* Flow is the oauth2 grant; empty means authorization_code.
|
|
5708
|
+
*/
|
|
5709
|
+
flow?: AuthSchemeFlow;
|
|
5710
|
+
/**
|
|
5711
|
+
* Fields are what a person pastes (api_key and http kinds).
|
|
5712
|
+
*/
|
|
5713
|
+
fields?: SecretField[];
|
|
5714
|
+
/**
|
|
5715
|
+
* In and ParamName say where an api_key key goes on a request: the
|
|
5716
|
+
* header or query parameter of that name. ValuePrefix is prepended to
|
|
5717
|
+
* the value ("Bearer "). Not needed to connect; read by injection.
|
|
5718
|
+
*/
|
|
5719
|
+
in?: AuthSchemeAPIKeyIn;
|
|
5720
|
+
param_name?: string;
|
|
5721
|
+
value_prefix?: string;
|
|
5722
|
+
/**
|
|
5723
|
+
* Scheme and BearerFormat describe an http kind's Authorization header.
|
|
5724
|
+
*/
|
|
5725
|
+
scheme?: AuthSchemeHTTPScheme;
|
|
5726
|
+
bearer_format?: string;
|
|
5727
|
+
authorization_endpoint?: string;
|
|
5728
|
+
scopes?: string[];
|
|
5729
|
+
/**
|
|
5730
|
+
* ScopeAliases map the scheme's own scope names to what the provider
|
|
5731
|
+
* wants on the wire ("gmail.send" → "https://www.googleapis.com/auth/
|
|
5732
|
+
* gmail.send"). Credentials store the alias; the wire form is used only
|
|
5733
|
+
* in requests. A scope with no alias is sent as is.
|
|
5734
|
+
*/
|
|
5735
|
+
scope_aliases?: {
|
|
5736
|
+
[key: string]: string;
|
|
5737
|
+
};
|
|
5738
|
+
scope_param?: string;
|
|
5739
|
+
scope_separator?: string;
|
|
5740
|
+
omit_scope_param?: boolean;
|
|
5741
|
+
pkce?: boolean;
|
|
5742
|
+
/**
|
|
5743
|
+
* ClientIDParam is the name the client id travels under in the
|
|
5744
|
+
* authorize URL and the token body; default "client_id" (TikTok:
|
|
5745
|
+
* "client_key").
|
|
5746
|
+
*/
|
|
5747
|
+
client_id_param?: string;
|
|
5748
|
+
/**
|
|
5749
|
+
* ExtraAuthorizeParams are appended to the authorize URL verbatim
|
|
5750
|
+
* (Google's access_type=offline). AddScopesParams override them when
|
|
5751
|
+
* re-authorizing for more scopes (Google's include_granted_scopes).
|
|
5752
|
+
*/
|
|
5753
|
+
extra_authorize_params?: {
|
|
5754
|
+
[key: string]: string;
|
|
5755
|
+
};
|
|
5756
|
+
add_scopes_params?: {
|
|
5757
|
+
[key: string]: string;
|
|
5758
|
+
};
|
|
5759
|
+
/**
|
|
5760
|
+
* AccountHintParam is the authorize param that names the account to sign
|
|
5761
|
+
* in with (Google's and Microsoft's "login_hint"). When re-authorizing
|
|
5762
|
+
* for more scopes it carries the login's account identifier, so the
|
|
5763
|
+
* provider goes to that account instead of offering a chooser. Empty =
|
|
5764
|
+
* no hint sent.
|
|
5765
|
+
*/
|
|
5766
|
+
account_hint_param?: string;
|
|
5767
|
+
/**
|
|
5768
|
+
* AnotherAccountParams are authorize params for connecting an account
|
|
5769
|
+
* next to one already connected: the provider shows its account chooser
|
|
5770
|
+
* instead of signing the user back in to the account it remembers
|
|
5771
|
+
* (Google prompt=select_account). They override ExtraAuthorizeParams.
|
|
5772
|
+
*/
|
|
5773
|
+
another_account_params?: {
|
|
5774
|
+
[key: string]: string;
|
|
5775
|
+
};
|
|
5776
|
+
/**
|
|
5777
|
+
* RequiredScopes are always requested, on a connect and when
|
|
5778
|
+
* re-authorizing for more scopes, whatever the caller asked for: the
|
|
5779
|
+
* scopes the identity lookup and token refresh need (Google's openid,
|
|
5780
|
+
* email and profile; X's users.read and offline.access). In the
|
|
5781
|
+
* scheme's own names, like Scopes. Empty = only what was asked for.
|
|
5782
|
+
*/
|
|
5783
|
+
required_scopes?: string[];
|
|
5784
|
+
/**
|
|
5785
|
+
* IncrementalAddScopes: re-authorizing for more scopes asks only for
|
|
5786
|
+
* the new ones (plus RequiredScopes), and the provider returns a token
|
|
5787
|
+
* that also covers what the login already holds (Google, with
|
|
5788
|
+
* include_granted_scopes in AddScopesParams). Without it the full list
|
|
5789
|
+
* is asked for again.
|
|
5790
|
+
*/
|
|
5791
|
+
incremental_add_scopes?: boolean;
|
|
5792
|
+
/**
|
|
5793
|
+
* Resource is the RFC 8707 resource indicator: the protected resource
|
|
5794
|
+
* the token is minted for (an MCP server's URL). Sent on the authorize,
|
|
5795
|
+
* code and refresh requests when the profile takes one. Empty = none.
|
|
5796
|
+
*/
|
|
5797
|
+
resource?: string;
|
|
5798
|
+
/**
|
|
5799
|
+
* Issuer is the authorization server's RFC 8414 issuer. With
|
|
5800
|
+
* AuthorizationResponseIssParameterSupported, the callback's iss must
|
|
5801
|
+
* name it (RFC 9207, against mix-up); an issuer alone still refuses a
|
|
5802
|
+
* callback naming another one.
|
|
5803
|
+
*/
|
|
5804
|
+
issuer?: string;
|
|
5805
|
+
authorization_response_iss_parameter_supported?: boolean;
|
|
5806
|
+
/**
|
|
5807
|
+
* Callback is the name of the redirect URI the app was registered with
|
|
5808
|
+
* (<app>/settings/secrets/oauth/<callback>). Empty = the slug. Schemes
|
|
5809
|
+
* whose clients are registered once for many slugs share one (an MCP
|
|
5810
|
+
* server's dynamically registered client and the Client ID Metadata
|
|
5811
|
+
* Document name the "mcp" callback); the flow's provider then comes
|
|
5812
|
+
* from the connect intent, never from the callback's path.
|
|
5813
|
+
*/
|
|
5814
|
+
callback?: string;
|
|
5815
|
+
/**
|
|
5816
|
+
* Profile names the authorization server's deviations from the specs
|
|
5817
|
+
* (authprovider.AuthServerProfile: endpoints placed by app fields,
|
|
5818
|
+
* scopes on refresh, actionable errors, admin consent). Empty = none.
|
|
5819
|
+
*/
|
|
5820
|
+
profile?: string;
|
|
5821
|
+
token_endpoint?: string;
|
|
5822
|
+
/**
|
|
5823
|
+
* RevocationEndpoint is the RFC 7009 endpoint, when the provider has
|
|
5824
|
+
* one and Revoke names no style of its own: tokens are revoked there
|
|
5825
|
+
* with a form POST.
|
|
5826
|
+
*/
|
|
5827
|
+
revocation_endpoint?: string;
|
|
5828
|
+
client_auth?: AuthSchemeClientAuth;
|
|
5829
|
+
token_request?: AuthSchemeTokenRequest;
|
|
5830
|
+
/**
|
|
5831
|
+
* Headers go on every request to the provider (User-Agent for Reddit,
|
|
5832
|
+
* Notion-Version); values are templates ({{client_id}} for Twitch's
|
|
5833
|
+
* Client-Id).
|
|
5834
|
+
*/
|
|
5835
|
+
headers?: {
|
|
5836
|
+
[key: string]: string;
|
|
5837
|
+
};
|
|
5838
|
+
/**
|
|
5839
|
+
* TokenResponseHook names the Go reader for a token response that is
|
|
5840
|
+
* not the RFC 6749 shape (Slack's nested authed_user). Empty = standard.
|
|
5841
|
+
*/
|
|
5842
|
+
token_response_hook?: string;
|
|
5843
|
+
refresh?: AuthSchemeRefresh;
|
|
5844
|
+
revoke?: AuthSchemeRevoke;
|
|
5845
|
+
/**
|
|
5846
|
+
* UserInfoURL is fetched with the new access token; the response is the
|
|
5847
|
+
* identity document (user.*). UserInfoURLPath instead reads that URL
|
|
5848
|
+
* from a path within the token response (Salesforce's "id"). Lookups
|
|
5849
|
+
* are further calls, each becoming a root of its name, in order, after
|
|
5850
|
+
* user. With none of these, the token response is all there is.
|
|
5851
|
+
*/
|
|
5852
|
+
userinfo_url?: string;
|
|
5853
|
+
userinfo_url_path?: string;
|
|
5854
|
+
lookups?: AuthSchemeLookup[];
|
|
5855
|
+
/**
|
|
5856
|
+
* Identifier is the connected account's stable, human-readable id
|
|
5857
|
+
* ("{{user.email}}", "@{{user.data.username}}"); Name its display name.
|
|
5858
|
+
*/
|
|
5859
|
+
identifier?: string;
|
|
5860
|
+
name?: string;
|
|
5861
|
+
/**
|
|
5862
|
+
* AccountID is the account's id as the provider keeps it and never
|
|
5863
|
+
* changes it ("{{user.sub}}" for Google, "{{user.data.id}}" for X), as
|
|
5864
|
+
* opposed to Identifier, which the user may rename. Logins are matched
|
|
5865
|
+
* and chosen by it. Empty = Identifier, for providers whose identifier
|
|
5866
|
+
* already is such an id (Slack, Notion).
|
|
5867
|
+
*/
|
|
5868
|
+
account_id?: string;
|
|
5869
|
+
/**
|
|
5870
|
+
* IdentityHook names Go code that derives identifier and name when a
|
|
5871
|
+
* template cannot (Discord's discriminator rule). It wins over both.
|
|
5872
|
+
*/
|
|
5873
|
+
identity_hook?: string;
|
|
5874
|
+
/**
|
|
5875
|
+
* Metadata is what the credential stores about the account, by key.
|
|
5876
|
+
*/
|
|
5877
|
+
metadata?: {
|
|
5878
|
+
[key: string]: string;
|
|
5879
|
+
};
|
|
5880
|
+
/**
|
|
5881
|
+
* Env is what a run reads, by variable. Empty = PREFIX_ACCESS_TOKEN and
|
|
5882
|
+
* PREFIX_ACCESS_TOKEN_EXPIRES_AT.
|
|
5883
|
+
*/
|
|
5884
|
+
env?: {
|
|
5885
|
+
[key: string]: string;
|
|
5886
|
+
};
|
|
5887
|
+
/**
|
|
5888
|
+
* AppKeys are the OAuth app's keys beyond the implied client id and
|
|
5889
|
+
* secret, and label overrides for those.
|
|
5890
|
+
*/
|
|
5891
|
+
app_keys?: AuthSchemeAppKey[];
|
|
5892
|
+
/**
|
|
5893
|
+
* VarsHook names Go code that turns the app's extra keys into the
|
|
5894
|
+
* {var} values substituted into the URLs (Microsoft's tenant,
|
|
5895
|
+
* Salesforce's sandbox host).
|
|
5896
|
+
*/
|
|
5897
|
+
vars_hook?: string;
|
|
5898
|
+
capabilities?: AuthSchemeCapability[];
|
|
5899
|
+
}
|
|
5413
5900
|
/**
|
|
5414
5901
|
* Visibility represents the visibility level of a resource
|
|
5415
5902
|
*/
|
package/dist/types.js
CHANGED
|
@@ -742,6 +742,75 @@ export const GPUTypeIntel = "intel";
|
|
|
742
742
|
export const GPUTypeNvidia = "nvidia";
|
|
743
743
|
export const GPUTypeAMD = "amd";
|
|
744
744
|
export const GPUTypeApple = "apple";
|
|
745
|
+
/**
|
|
746
|
+
* AuthSchemeOAuth2 is OAuth 2.0; Flow says which grant.
|
|
747
|
+
*/
|
|
748
|
+
export const AuthSchemeOAuth2 = "oauth2";
|
|
749
|
+
/**
|
|
750
|
+
* AuthSchemeAPIKey is one or more keys a person pastes, sent as a
|
|
751
|
+
* header or query parameter.
|
|
752
|
+
*/
|
|
753
|
+
export const AuthSchemeAPIKey = "api_key";
|
|
754
|
+
/**
|
|
755
|
+
* AuthSchemeHTTP is a pasted secret sent as an HTTP auth scheme
|
|
756
|
+
* (Authorization: Bearer or Basic).
|
|
757
|
+
*/
|
|
758
|
+
export const AuthSchemeHTTP = "http";
|
|
759
|
+
/**
|
|
760
|
+
* Deprecated: the kind is AuthSchemeOAuth2 with AuthSchemeFlowAuthorizationCode.
|
|
761
|
+
* Same value, so comparisons keep working; rows still stored as
|
|
762
|
+
* "oauth2_authorization_code" are read as oauth2 (UnmarshalJSON).
|
|
763
|
+
*/
|
|
764
|
+
export const AuthSchemeOAuth2AuthorizationCode = AuthSchemeOAuth2;
|
|
765
|
+
/**
|
|
766
|
+
* AuthSchemeFlowAuthorizationCode is the user-consent flow: authorization
|
|
767
|
+
* endpoint → code → token endpoint, optionally with PKCE. The default.
|
|
768
|
+
*/
|
|
769
|
+
export const AuthSchemeFlowAuthorizationCode = "authorization_code";
|
|
770
|
+
/**
|
|
771
|
+
* AuthSchemeFlowClientCredentials is server-to-server: the app's client
|
|
772
|
+
* id and secret are exchanged at the token endpoint, no redirect, no
|
|
773
|
+
* user. The login is the app's own.
|
|
774
|
+
*/
|
|
775
|
+
export const AuthSchemeFlowClientCredentials = "client_credentials";
|
|
776
|
+
export const AuthSchemeAPIKeyInHeader = "header";
|
|
777
|
+
export const AuthSchemeAPIKeyInQuery = "query";
|
|
778
|
+
export const AuthSchemeHTTPBearer = "bearer";
|
|
779
|
+
export const AuthSchemeHTTPBasic = "basic";
|
|
780
|
+
/**
|
|
781
|
+
* AuthSchemeClientAuthBasic sends them as an HTTP Basic Authorization
|
|
782
|
+
* header (RFC 6749 §2.3.1, the default).
|
|
783
|
+
*/
|
|
784
|
+
export const AuthSchemeClientAuthBasic = "basic";
|
|
785
|
+
/**
|
|
786
|
+
* AuthSchemeClientAuthBody sends them as form fields in the request body.
|
|
787
|
+
*/
|
|
788
|
+
export const AuthSchemeClientAuthBody = "body";
|
|
789
|
+
/**
|
|
790
|
+
* AuthSchemeClientAuthNone is a public client (RFC 8414
|
|
791
|
+
* token_endpoint_auth_method "none"): the client id goes in the body,
|
|
792
|
+
* there is no secret, and PKCE is what proves the client. Its OAuth app
|
|
793
|
+
* is complete with a client id alone (a dynamically registered client,
|
|
794
|
+
* or a Client ID Metadata Document URL).
|
|
795
|
+
*/
|
|
796
|
+
export const AuthSchemeClientAuthNone = "none";
|
|
797
|
+
export const AuthSchemeTokenRequestForm = "form";
|
|
798
|
+
export const AuthSchemeTokenRequestJSON = "json";
|
|
799
|
+
/**
|
|
800
|
+
* AuthSchemeRefreshWhenExpiring refreshes within five minutes of the
|
|
801
|
+
* reported expiry; a token with no expiry is treated as long-lived
|
|
802
|
+
* (Slack without token rotation, Notion).
|
|
803
|
+
*/
|
|
804
|
+
export const AuthSchemeRefreshWhenExpiring = "";
|
|
805
|
+
/**
|
|
806
|
+
* AuthSchemeRefreshAlways refreshes on every read: the provider reports
|
|
807
|
+
* no expiry but the token does expire (Salesforce's session timeout is
|
|
808
|
+
* per org and not reported).
|
|
809
|
+
*/
|
|
810
|
+
export const AuthSchemeRefreshAlways = "always";
|
|
811
|
+
export const AuthSchemeRevokeBearer = "bearer";
|
|
812
|
+
export const AuthSchemeRevokeQuery = "query";
|
|
813
|
+
export const AuthSchemeRevokeForm = "form";
|
|
745
814
|
export const VisibilityPrivate = "private";
|
|
746
815
|
export const VisibilityTeam = "team";
|
|
747
816
|
/**
|