@barndoor-ai/sdk 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/clientCredentials.d.ts +67 -0
- package/dist/auth/clientCredentials.d.ts.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/store.d.ts +1 -1
- package/dist/client.d.ts +143 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/http/client.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +11 -11
- package/dist/index.js +11 -11
- package/dist/models/index.d.ts +133 -0
- package/dist/models/index.d.ts.map +1 -1
- package/package.json +16 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth 2.0 client-credentials (machine-to-machine) grant support.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Python SDK's `get_client_credentials_token` /
|
|
5
|
+
* `get_client_credentials_token_async` helpers (PR #78).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parameters for the client-credentials grant.
|
|
9
|
+
*/
|
|
10
|
+
export interface ClientCredentialsParams {
|
|
11
|
+
/** OAuth client ID for a Barndoor M2M application. */
|
|
12
|
+
clientId: string;
|
|
13
|
+
/** OAuth client secret. */
|
|
14
|
+
clientSecret: string;
|
|
15
|
+
/** API audience identifier (e.g., `https://barndoor.ai/`). */
|
|
16
|
+
audience: string;
|
|
17
|
+
/**
|
|
18
|
+
* OIDC issuer URL. Preferred over `domain`; OIDC discovery is used to
|
|
19
|
+
* locate the token endpoint.
|
|
20
|
+
*/
|
|
21
|
+
issuer?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Legacy auth domain (POSTs directly to `https://{domain}/oauth/token`).
|
|
24
|
+
* Provide either `issuer` or `domain`.
|
|
25
|
+
*/
|
|
26
|
+
domain?: string;
|
|
27
|
+
/** Request timeout in milliseconds (default: 15000). */
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the token endpoint and form body for a client-credentials grant.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare function _resolveClientCredentialsRequest(params: ClientCredentialsParams): Promise<{
|
|
35
|
+
tokenEndpoint: string;
|
|
36
|
+
body: URLSearchParams;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Perform the OAuth 2.0 client-credentials grant against the auth server
|
|
40
|
+
* and return the issued access token.
|
|
41
|
+
*
|
|
42
|
+
* Suitable for headless / machine-to-machine use cases where no interactive
|
|
43
|
+
* user is available. The token is returned directly without caching; for
|
|
44
|
+
* a ready-to-use SDK instance with automatic refresh, prefer
|
|
45
|
+
* {@link BarndoorSDK.fromClientCredentials}.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const token = await getClientCredentialsToken({
|
|
50
|
+
* clientId: process.env.BARNDOOR_M2M_CLIENT_ID!,
|
|
51
|
+
* clientSecret: process.env.BARNDOOR_M2M_CLIENT_SECRET!,
|
|
52
|
+
* audience: 'https://barndoor.ai/',
|
|
53
|
+
* issuer: 'https://auth.barndoor.ai/realms/barndoor',
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function getClientCredentialsToken(params: ClientCredentialsParams): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Return true if the given JWT's `exp` claim is within `skewSeconds` of now.
|
|
60
|
+
*
|
|
61
|
+
* Tokens that cannot be parsed or have no `exp` claim are treated as
|
|
62
|
+
* already expired so callers err on the side of refreshing.
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
export declare function _tokenNearExpiry(token: string, skewSeconds: number): boolean;
|
|
67
|
+
//# sourceMappingURL=clientCredentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientCredentials.d.ts","sourceRoot":"","sources":["../../src/auth/clientCredentials.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC,CAqB3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ChG;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAyB5E"}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* including PKCE OAuth flows, token storage, and interactive login.
|
|
6
6
|
*/
|
|
7
7
|
export { PKCEManager, startLocalCallbackServer } from './pkce';
|
|
8
|
+
export { getClientCredentialsToken, _tokenNearExpiry } from './clientCredentials';
|
|
9
|
+
export type { ClientCredentialsParams } from './clientCredentials';
|
|
8
10
|
export { getTokenStorage, TokenManager, loadUserToken, saveUserToken, clearCachedToken, verifyJWTLocal, JWTVerificationResult, isTokenActive, isTokenActiveWithRefresh, validateToken, setTokenLogger, getOidcConfig, clearOidcConfigCache, } from './store';
|
|
9
11
|
export type { OidcConfig } from './store';
|
|
10
12
|
export type { AuthorizationUrlParams, TokenExchangeParams, PKCEState } from './pkce';
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAE/D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrF,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAE/D,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClF,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrF,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/auth/store.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface OidcConfig {
|
|
|
20
20
|
* Fetch and cache OIDC configuration from the issuer's discovery endpoint.
|
|
21
21
|
*
|
|
22
22
|
* @param issuer - The OIDC issuer URL (e.g., https://auth.barndoor.ai or
|
|
23
|
-
* https://auth.
|
|
23
|
+
* https://auth.barndoor.ai/realms/barndoor)
|
|
24
24
|
* @returns OIDC configuration containing endpoints like token_endpoint, jwks_uri, etc.
|
|
25
25
|
*/
|
|
26
26
|
export declare function getOidcConfig(issuer: string): Promise<OidcConfig>;
|
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* SDK's client.py functionality with 100% API compatibility.
|
|
6
6
|
*/
|
|
7
7
|
import { ServerSummary, ServerDetail } from './models';
|
|
8
|
+
import type { Channel, ChannelOptions, ChannelTestResult, UpsertChannelInput, WebhookSecret } from './models';
|
|
9
|
+
import { ClientCredentialsParams } from './auth/clientCredentials';
|
|
8
10
|
/**
|
|
9
11
|
* Configuration options for BarndoorSDK constructor.
|
|
10
12
|
*/
|
|
@@ -40,6 +42,15 @@ export interface ConnectionStatusResponse {
|
|
|
40
42
|
/** Current connection status */
|
|
41
43
|
status: string;
|
|
42
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Options for {@link BarndoorSDK.fromClientCredentials}.
|
|
47
|
+
*/
|
|
48
|
+
export interface FromClientCredentialsOptions extends ClientCredentialsParams {
|
|
49
|
+
/** Request timeout in seconds for API calls (default: 30). */
|
|
50
|
+
timeout?: number;
|
|
51
|
+
/** Maximum number of retries for API calls (default: 3). */
|
|
52
|
+
maxRetries?: number;
|
|
53
|
+
}
|
|
43
54
|
/**
|
|
44
55
|
* Async client for interacting with the Barndoor Platform API.
|
|
45
56
|
*
|
|
@@ -52,6 +63,8 @@ export interface ConnectionStatusResponse {
|
|
|
52
63
|
* JWT token in all requests.
|
|
53
64
|
*/
|
|
54
65
|
export declare class BarndoorSDK {
|
|
66
|
+
/** Platform path for the public notification channel-management surface (BCP-3758). */
|
|
67
|
+
private static readonly CHANNELS_PATH;
|
|
55
68
|
/** Base URL of the Barndoor API */
|
|
56
69
|
readonly base: string;
|
|
57
70
|
/** User JWT token */
|
|
@@ -62,6 +75,8 @@ export declare class BarndoorSDK {
|
|
|
62
75
|
private _tokenValidated;
|
|
63
76
|
/** Whether the SDK has been closed */
|
|
64
77
|
private _closed;
|
|
78
|
+
/** Cached client-credentials parameters for automatic token refresh. */
|
|
79
|
+
private _credentials;
|
|
65
80
|
/** Scoped logger for this SDK instance */
|
|
66
81
|
private readonly _logger;
|
|
67
82
|
/**
|
|
@@ -70,6 +85,30 @@ export declare class BarndoorSDK {
|
|
|
70
85
|
* @param options - Configuration options (token is optional)
|
|
71
86
|
*/
|
|
72
87
|
constructor(apiBaseUrl: string, options?: BarndoorSDKOptions);
|
|
88
|
+
/**
|
|
89
|
+
* Build a {@link BarndoorSDK} authenticated via the OAuth 2.0
|
|
90
|
+
* client-credentials (machine-to-machine) grant.
|
|
91
|
+
*
|
|
92
|
+
* Performs the grant against the Barndoor auth server and returns a
|
|
93
|
+
* ready-to-use SDK instance. The credentials are retained on the
|
|
94
|
+
* instance so the access token can be refreshed automatically when it
|
|
95
|
+
* nears expiry or when the API responds with 401.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const sdk = await BarndoorSDK.fromClientCredentials(
|
|
100
|
+
* 'https://api.barndoor.host',
|
|
101
|
+
* {
|
|
102
|
+
* clientId: process.env.BARNDOOR_M2M_CLIENT_ID!,
|
|
103
|
+
* clientSecret: process.env.BARNDOOR_M2M_CLIENT_SECRET!,
|
|
104
|
+
* audience: 'https://barndoor.ai/',
|
|
105
|
+
* issuer: 'https://auth.barndoor.ai/realms/barndoor',
|
|
106
|
+
* }
|
|
107
|
+
* );
|
|
108
|
+
* const servers = await sdk.listServers();
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
static fromClientCredentials(apiBaseUrl: string, options: FromClientCredentialsOptions): Promise<BarndoorSDK>;
|
|
73
112
|
/**
|
|
74
113
|
* Get the current token.
|
|
75
114
|
*/
|
|
@@ -99,6 +138,18 @@ export declare class BarndoorSDK {
|
|
|
99
138
|
* @private
|
|
100
139
|
*/
|
|
101
140
|
private _req;
|
|
141
|
+
/**
|
|
142
|
+
* Refresh the M2M access token if it is near expiry.
|
|
143
|
+
*
|
|
144
|
+
* No-op for SDK instances not created via {@link BarndoorSDK.fromClientCredentials}.
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
private _maybeRefreshM2MToken;
|
|
148
|
+
/**
|
|
149
|
+
* Unconditionally fetch a fresh M2M token using stored credentials.
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
private _refreshM2MToken;
|
|
102
153
|
/**
|
|
103
154
|
* Validate the cached token by making a test API call.
|
|
104
155
|
* @returns True if the token is valid
|
|
@@ -142,6 +193,98 @@ export declare class BarndoorSDK {
|
|
|
142
193
|
* @param serverId - Server ID or slug to disconnect from
|
|
143
194
|
*/
|
|
144
195
|
disconnectServer(serverId: string): Promise<void>;
|
|
196
|
+
/**
|
|
197
|
+
* List the alert types this organization may subscribe a channel to.
|
|
198
|
+
*
|
|
199
|
+
* Read this before building a subscription set: the alert-type vocabulary grows over
|
|
200
|
+
* time and is gated per organization, so this endpoint — not a hardcoded list — is the
|
|
201
|
+
* authoritative answer to what `subscriptions` accepts. Subscribing to a type absent
|
|
202
|
+
* here is accepted but never delivers.
|
|
203
|
+
*
|
|
204
|
+
* @returns The admitted alert types, plus the category and severity vocabularies
|
|
205
|
+
*/
|
|
206
|
+
getChannelOptions(): Promise<ChannelOptions>;
|
|
207
|
+
/**
|
|
208
|
+
* List the organization's shared notification channels.
|
|
209
|
+
*
|
|
210
|
+
* Returns the organization-wide channels — `email`, `webhook`, `slack`, `teams` — with
|
|
211
|
+
* their current subscription sets. Personal channels are not included; use
|
|
212
|
+
* {@link listUserChannels} for those.
|
|
213
|
+
*
|
|
214
|
+
* @returns The organization's shared channels, in no guaranteed order
|
|
215
|
+
*/
|
|
216
|
+
listChannels(): Promise<Channel[]>;
|
|
217
|
+
/**
|
|
218
|
+
* List the caller's own personal notification channels.
|
|
219
|
+
*
|
|
220
|
+
* Returns the authenticated caller's `in_app` and `user_email` channels. Always
|
|
221
|
+
* self-scoped — there is no way to read another user's personal channels.
|
|
222
|
+
*
|
|
223
|
+
* @returns The caller's personal channels
|
|
224
|
+
*/
|
|
225
|
+
listUserChannels(): Promise<Channel[]>;
|
|
226
|
+
/**
|
|
227
|
+
* Create or update a notification channel and replace its subscriptions.
|
|
228
|
+
*
|
|
229
|
+
* This is a full upsert, not a patch: `subscriptions` **replaces** the channel's
|
|
230
|
+
* existing set, so omitting it removes every subscription the channel had. Send the
|
|
231
|
+
* complete desired set on every call.
|
|
232
|
+
*
|
|
233
|
+
* Without `channelId` the channel is keyed on its type's natural identity, so repeating
|
|
234
|
+
* an identical call is idempotent rather than creating duplicates: `email` by address,
|
|
235
|
+
* `webhook` by URL, `slack` by channel id, and the personal types by (organization,
|
|
236
|
+
* type, caller). With `channelId` it is an authoritative edit of that row — the only way
|
|
237
|
+
* to update a `teams` channel, whose natural identity is a secret URL.
|
|
238
|
+
*
|
|
239
|
+
* Which destination fields are permitted depends on `type`; sending one that does not
|
|
240
|
+
* belong throws {@link HTTPError} with status 422 rather than being silently ignored.
|
|
241
|
+
*
|
|
242
|
+
* @param input - Channel definition; see {@link UpsertChannelInput}
|
|
243
|
+
* @returns The created or updated channel. When this call *creates* a `webhook`
|
|
244
|
+
* channel, `signing_secret` carries the one-time reveal — store it. A retried create
|
|
245
|
+
* that lands after the first attempt already succeeded returns a null
|
|
246
|
+
* `signing_secret` rather than a second secret; use {@link regenerateChannelSecret}
|
|
247
|
+
* if you need one.
|
|
248
|
+
*/
|
|
249
|
+
upsertChannel(input: UpsertChannelInput): Promise<Channel>;
|
|
250
|
+
/**
|
|
251
|
+
* Delete a notification channel.
|
|
252
|
+
*
|
|
253
|
+
* Its subscriptions cascade and any stored secret is removed. Irreversible — to stop
|
|
254
|
+
* delivery reversibly, call {@link upsertChannel} with `enabled: false`.
|
|
255
|
+
*
|
|
256
|
+
* @param channelId - Unique identifier of the channel to delete
|
|
257
|
+
* @throws {HTTPError} With status 404 when no such channel exists in the caller's org
|
|
258
|
+
*/
|
|
259
|
+
deleteChannel(channelId: string): Promise<void>;
|
|
260
|
+
/**
|
|
261
|
+
* Rotate a webhook channel's signing secret.
|
|
262
|
+
*
|
|
263
|
+
* Returns the new secret once. The previous secret stops verifying immediately, so
|
|
264
|
+
* deploy the new one to your receiver before the next alert fires. There is no endpoint
|
|
265
|
+
* that reads the current secret, so this is also the recovery path when a secret from
|
|
266
|
+
* channel creation was lost.
|
|
267
|
+
*
|
|
268
|
+
* @param channelId - Unique identifier of the webhook channel
|
|
269
|
+
* @returns The new signing secret
|
|
270
|
+
*/
|
|
271
|
+
regenerateChannelSecret(channelId: string): Promise<WebhookSecret>;
|
|
272
|
+
/**
|
|
273
|
+
* Send a connectivity-test message through a channel's real transport.
|
|
274
|
+
*
|
|
275
|
+
* Lets you verify a webhook receiver, email address, Slack channel, or Teams workflow
|
|
276
|
+
* actually works. It is not an alert: nothing is persisted, no other channel is
|
|
277
|
+
* notified, and it ignores the channel's subscriptions.
|
|
278
|
+
*
|
|
279
|
+
* A transport failure comes back as `ok: false` with a reason, not as a thrown error —
|
|
280
|
+
* the request succeeded, the delivery did not.
|
|
281
|
+
*
|
|
282
|
+
* @param channelId - Unique identifier of the channel to test
|
|
283
|
+
* @returns Whether the message reached the transport, and why not if it did not
|
|
284
|
+
*/
|
|
285
|
+
testChannel(channelId: string): Promise<ChannelTestResult>;
|
|
286
|
+
/** Validate and normalize a channel id shared by the by-id channel methods. */
|
|
287
|
+
private _requireChannelId;
|
|
145
288
|
/**
|
|
146
289
|
* Validate server ID format.
|
|
147
290
|
* @private
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EACV,OAAO,EAEP,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACd,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,uBAAuB,EAGxB,MAAM,0BAA0B,CAAC;AAQlC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAsBD;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM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ACS,IAAI,SAAK,EAAE,OAAO,SAAK;CAIpC;AAED;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,4BAA4B;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,yCAAyC;IAClC,MAAM,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;gBACS,aAAa,gBAAsB,EAAE,UAAU,SAAI;IAM/D;;;;;;OAMG;IACU,OAAO,CAClB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,OAAO,CAAC;IAiKnB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAejB;;;OAGG;IACH,OAAO,CAAC,MAAM;IAId;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export { BarndoorSDK } from './client';
|
|
31
|
+
export type { FromClientCredentialsOptions } from './client';
|
|
31
32
|
export { BarndoorError, AuthenticationError, TokenError, TokenExpiredError, TokenValidationError, ConnectionError, HTTPError, ServerNotFoundError, OAuthError, ConfigurationError, TimeoutError, } from './exceptions';
|
|
32
33
|
export { ServerSummary, ServerDetail, AgentToken } from './models';
|
|
34
|
+
export type { AlertTypeOption, Channel, ChannelListResponse, ChannelOptions, ChannelSubscription, ChannelTestResult, ChannelType, LabeledOption, UpsertChannelInput, WebhookSecret, } from './models';
|
|
33
35
|
export { loginInteractive, ensureServerConnected, makeMcpConnectionParams, makeMcpClient, } from './quickstart';
|
|
34
|
-
export { PKCEManager, startLocalCallbackServer, loadUserToken, saveUserToken, clearCachedToken, setTokenLogger, verifyJWTLocal, JWTVerificationResult, isTokenActive, isTokenActiveWithRefresh, validateToken, TokenManager, getOidcConfig, clearOidcConfigCache, } from './auth';
|
|
35
|
-
export type { OidcConfig } from './auth';
|
|
36
|
+
export { PKCEManager, startLocalCallbackServer, loadUserToken, saveUserToken, clearCachedToken, setTokenLogger, verifyJWTLocal, JWTVerificationResult, isTokenActive, isTokenActiveWithRefresh, validateToken, TokenManager, getOidcConfig, clearOidcConfigCache, getClientCredentialsToken, } from './auth';
|
|
37
|
+
export type { OidcConfig, ClientCredentialsParams } from './auth';
|
|
36
38
|
export { AUTH_CONFIG, BarndoorConfig, getStaticConfig, getDynamicConfig, checkTokenOrganization, hasOrganizationInfo, isBrowser, isNode, } from './config';
|
|
37
39
|
export { setLogger, getLogger, createScopedLogger, debug, info, warn, error } from './logging';
|
|
38
40
|
export type { Logger } from './logging';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnE,YAAY,EACV,eAAe,EACf,OAAO,EACP,mBAAmB,EACnB,cA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