@bodhiapp/bodhi-js-core 0.0.38 → 0.0.40

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.
@@ -1,41 +1,28 @@
1
- import { AccessRequestStatusResponse, CreateAccessRequest, FlowType, RequestedResourcesV1, UserScope } from '@bodhiapp/ts-client';
2
- import { ApiResponse } from '@bodhiapp/bodhi-browser-types';
1
+ import { CreateAccessRequest, RequestedResourcesV1, UserScope } from '@bodhiapp/ts-client';
3
2
  import { LoginOptions, LoginProgressCallback } from './types';
4
- export declare const DEFAULT_POLL_INTERVAL_MS = 2000;
5
- export declare const DEFAULT_POLL_TIMEOUT_MS = 300000;
6
- /**
7
- * Shared polling logic for access request status.
8
- * Polls until approved, denied, failed, or expired.
9
- *
10
- * @param getStatusFn - Function that fetches the current status (throws BodhiError on operational errors)
11
- * @param requestId - The access request ID to poll
12
- * @param options - Polling interval and timeout configuration
13
- * @returns The approved AccessRequestStatusResponse
14
- * @throws BodhiError on denial, failure, expiry, timeout, or fetch error
15
- */
16
- export declare function pollAccessRequestUntilResolved(getStatusFn: (requestId: string) => Promise<ApiResponse<AccessRequestStatusResponse>>, requestId: string, options?: {
17
- intervalMs?: number;
18
- timeoutMs?: number;
19
- }): Promise<AccessRequestStatusResponse>;
20
3
  export declare class AccessRequestBuilder {
21
4
  private body;
22
5
  constructor(appClientId: string);
23
- flowType(type: FlowType): this;
24
- redirectUrl(url: string): this;
25
6
  requestedRole(role: UserScope): this;
26
7
  requested(resources: RequestedResourcesV1): this;
8
+ modelsAccess(show?: boolean): this;
9
+ modelsList(show?: boolean): this;
10
+ mcpsAccess(show?: boolean): this;
11
+ mcpsList(show?: boolean): this;
27
12
  addMcpServer(url: string): this;
13
+ private ensureRequested;
28
14
  build(): CreateAccessRequest;
29
15
  }
30
16
  export declare class LoginOptionsBuilder {
31
17
  private options;
32
- private mcpServers;
18
+ private requested;
33
19
  setRole(role: UserScope): this;
20
+ setModelsAccess(show?: boolean): this;
21
+ setModelsList(show?: boolean): this;
22
+ setMcpsAccess(show?: boolean): this;
23
+ setMcpsList(show?: boolean): this;
34
24
  addMcpServer(url: string): this;
35
- setFlowType(type: FlowType): this;
36
- setRedirectUrl(url: string): this;
25
+ setRequested(resources: RequestedResourcesV1): this;
37
26
  setOnProgress(callback: LoginProgressCallback): this;
38
- setPollInterval(ms: number): this;
39
- setPollTimeout(ms: number): this;
40
27
  build(): LoginOptions;
41
28
  }