@bctrl/sdk 1.0.6 → 1.0.8

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,126 +1,20 @@
1
- import type { JsonObject, V1ListEnvelope, V1PageQuery } from './types.js';
2
- export type V1AuthScope = 'organization' | 'subaccount';
3
- export type V1Plan = 'free' | 'developer' | 'business' | 'enterprise';
4
- export interface V1AuthWhoamiResponse {
5
- email: string | null;
6
- scope: V1AuthScope;
7
- organizationId: string;
8
- subaccountId: string | null;
9
- defaultSpaceId: string;
10
- plan: V1Plan;
11
- keyId: string;
12
- }
13
- export interface V1ApiKey {
14
- id: string;
15
- keyKind: 'organization' | 'subaccount';
16
- subaccountId: string | null;
17
- name: string | null;
18
- keyPrefix: string;
19
- scopes: '*'[];
20
- expiresAt: string | null;
21
- createdAt: string;
22
- updatedAt: string;
23
- lastUsedAt: string | null;
24
- usageCount: number;
25
- }
26
- export interface V1ApiKeyListQuery extends V1PageQuery {
27
- subaccountId?: string;
28
- keyKind?: V1ApiKey['keyKind'];
29
- }
30
- export interface V1ApiKeyCreateRequest {
31
- name?: string;
32
- subaccountId?: string;
33
- scopes?: '*'[];
34
- expiresAt?: string | null;
35
- }
36
- export interface V1ApiKeyCreateResponse {
37
- data: V1ApiKey;
38
- secret: string;
39
- }
40
- export interface V1ApiKeyDeleteResponse {
41
- id: string;
42
- deleted: true;
43
- }
44
- export interface V1AccountUsage {
45
- organizationId: string;
46
- isBlocked: boolean;
47
- blockedReasons: string[];
48
- cycle: {
49
- startedAt: string | null;
50
- endsAt: string | null;
51
- };
52
- credits: {
53
- monthlyLimit: number;
54
- monthlyUsed: number;
55
- monthlyRemaining: number;
56
- purchasedRemaining: number;
57
- available: number;
58
- outstandingDebt: number;
59
- effectiveBalance: number;
60
- breakdown: JsonObject;
61
- };
62
- computedAt: string;
63
- }
64
- export interface V1SubaccountLimits {
65
- monthlyCredits?: number | null;
66
- maxConcurrentRuntimes?: number | null;
67
- maxRuntimeMinutes?: number | null;
68
- }
69
- export interface V1Subaccount {
70
- id: string;
71
- name: string;
72
- status: 'active' | 'archived';
73
- externalId?: string | null;
74
- metadata?: JsonObject | null;
75
- archivedAt?: string | null;
76
- defaultSpaceId: string;
77
- limits: V1SubaccountLimits;
78
- usage?: V1SubaccountUsage;
79
- createdAt: string;
80
- updatedAt: string;
81
- }
82
- export interface V1SubaccountListQuery extends V1PageQuery {
83
- status?: V1Subaccount['status'];
84
- externalId?: string;
85
- }
86
- export interface V1SubaccountCreateRequest {
87
- name: string;
88
- externalId?: string;
89
- metadata?: JsonObject;
90
- limits?: V1SubaccountLimits;
91
- }
92
- export interface V1SubaccountUpdateRequest {
93
- name?: string;
94
- externalId?: string | null;
95
- metadata?: JsonObject | null;
96
- limits?: V1SubaccountLimits;
97
- }
98
- export interface V1SubaccountGetQuery {
99
- include?: 'usage' | 'usage'[];
100
- }
101
- export interface V1SubaccountArchiveResponse {
102
- id: string;
103
- archived: true;
104
- }
105
- export interface V1SubaccountUsage {
106
- subaccountId: string;
107
- isBlocked: boolean;
108
- blockedReasons: string[];
109
- cycle: {
110
- startedAt: string | null;
111
- endsAt: string | null;
112
- };
113
- credits: {
114
- monthlyLimit: number;
115
- monthlyUsed: number;
116
- monthlyRemaining: number;
117
- purchasedRemaining: number;
118
- available: number;
119
- breakdown: JsonObject;
120
- };
121
- computedAt: string;
122
- }
123
- export type V1SubaccountUsageListQuery = V1PageQuery & {
124
- subaccountId?: string;
125
- };
126
- export type V1SubaccountUsageListResponse = V1ListEnvelope<V1SubaccountUsage>;
1
+ import type { OpenApiQuery, OpenApiSchemas } from './openapi.js';
2
+ export type V1AuthScope = OpenApiSchemas['AuthWhoamiResponse']['scope'];
3
+ export type V1Plan = OpenApiSchemas['AuthWhoamiResponse']['plan'];
4
+ export type V1AuthWhoamiResponse = OpenApiSchemas['AuthWhoamiResponse'];
5
+ export type V1ApiKey = OpenApiSchemas['ApiKey'];
6
+ export type V1ApiKeyListQuery = OpenApiQuery<'api-keys.list'>;
7
+ export type V1ApiKeyCreateRequest = OpenApiSchemas['ApiKeyCreateRequest'];
8
+ export type V1ApiKeyCreateResponse = OpenApiSchemas['ApiKeyCreateResponse'];
9
+ export type V1ApiKeyDeleteResponse = OpenApiSchemas['ApiKeyDeleteResponse'];
10
+ export type V1AccountUsage = OpenApiSchemas['AccountUsage'];
11
+ export type V1SubaccountLimits = OpenApiSchemas['SubaccountLimits'];
12
+ export type V1Subaccount = OpenApiSchemas['Subaccount'];
13
+ export type V1SubaccountListQuery = OpenApiQuery<'subaccounts.list'>;
14
+ export type V1SubaccountCreateRequest = OpenApiSchemas['SubaccountCreateRequest'];
15
+ export type V1SubaccountUpdateRequest = OpenApiSchemas['SubaccountUpdateRequest'];
16
+ export type V1SubaccountGetQuery = OpenApiQuery<'subaccounts.get'>;
17
+ export type V1SubaccountArchiveResponse = OpenApiSchemas['SubaccountArchiveResponse'];
18
+ export type V1SubaccountUsage = OpenApiSchemas['SubaccountUsage'];
19
+ export type V1SubaccountUsageListQuery = OpenApiQuery<'subaccounts.usage.list'>;
20
+ export type V1SubaccountUsageListResponse = OpenApiSchemas['SubaccountUsageListResponse'];
package/dist/aiTypes.d.ts CHANGED
@@ -1,97 +1,19 @@
1
- import type { JsonObject, V1PageQuery } from './types.js';
2
- export type V1AiCredentialProvider = 'openai' | 'anthropic' | 'google' | 'azure' | 'groq' | 'deepseek' | 'mistral' | 'cerebras' | 'openrouter' | 'xai' | 'perplexity' | 'togetherai' | 'vercel-ai-gateway' | 'custom';
3
- export type V1AiModelStatus = 'recommended' | 'supported' | 'experimental';
4
- export type V1AiModelEngine = 'stagehand' | 'browserUse';
5
- export interface V1AiModel {
6
- id: string;
7
- provider: V1AiCredentialProvider;
8
- displayName: string;
9
- managed: boolean;
10
- status: V1AiModelStatus;
11
- engines: V1AiModelEngine[];
12
- supportsTools: boolean;
13
- supportsVision: boolean;
14
- supportsStructuredOutput: boolean;
15
- supportsReasoningEffort: boolean;
16
- supportsThinkingBudget: boolean;
17
- }
18
- export interface V1AiModelListQuery {
19
- provider?: V1AiCredentialProvider;
20
- status?: V1AiModelStatus;
21
- managed?: boolean;
22
- engine?: V1AiModelEngine;
23
- }
24
- export interface V1AiModelListResponse {
25
- data: V1AiModel[];
26
- }
27
- export type V1AiCredentialStatus = 'enabled' | 'disabled';
28
- export interface V1AiCredential {
29
- id: string;
30
- name: string;
31
- provider: V1AiCredentialProvider;
32
- status: V1AiCredentialStatus;
33
- subaccountId?: string;
34
- defaultModel?: string;
35
- baseUrl?: string;
36
- hasApiKey: boolean;
37
- createdAt: string;
38
- updatedAt: string;
39
- }
40
- export interface V1AiCredentialListQuery extends V1PageQuery {
41
- provider?: V1AiCredentialProvider;
42
- name?: string;
43
- status?: V1AiCredentialStatus;
44
- }
45
- export interface V1AiCredentialCreateRequest {
46
- provider: V1AiCredentialProvider;
47
- name?: string;
48
- apiKey?: string;
49
- defaultModel?: string;
50
- baseUrl?: string;
51
- status?: V1AiCredentialStatus;
52
- subaccountId?: string | null;
53
- test?: boolean;
54
- }
55
- export interface V1AiCredentialUpdateRequest {
56
- name?: string;
57
- apiKey?: string | null;
58
- defaultModel?: string | null;
59
- baseUrl?: string | null;
60
- status?: V1AiCredentialStatus;
61
- }
62
- export interface V1AiCredentialDeleteResponse {
63
- id: string;
64
- deleted: true;
65
- }
66
- export interface V1AiCredentialTestResponse {
67
- ok: boolean;
68
- checkedAt: string;
69
- latencyMs?: number;
70
- error?: string;
71
- }
72
- export type V1AiModelSelectionAuth = 'managed' | {
73
- credential: string;
74
- } | {
75
- apiKey: string;
76
- };
77
- export interface V1AiModelSelectionObject {
78
- model: string;
79
- auth?: V1AiModelSelectionAuth;
80
- provider?: V1AiCredentialProvider;
81
- baseUrl?: string;
82
- temperature?: number;
83
- maxTokens?: number;
84
- topP?: number;
85
- reasoningEffort?: 'none' | 'low' | 'medium' | 'high' | 'xhigh';
86
- thinkingBudgetTokens?: number;
87
- responseFormat?: 'text' | 'json';
88
- responseSchema?: JsonObject;
89
- providerOptions?: JsonObject;
90
- }
1
+ import type { OpenApiQuery, OpenApiSchemas } from './openapi.js';
2
+ export type V1AiCredentialProvider = OpenApiSchemas['AiCredential']['provider'];
3
+ export type V1AiModelStatus = OpenApiSchemas['AiModel']['status'];
4
+ export type V1AiModelEngine = OpenApiSchemas['AiModel']['engines'][number];
5
+ export type V1AiModel = OpenApiSchemas['AiModel'];
6
+ export type V1AiModelListQuery = OpenApiQuery<'ai.models.list'>;
7
+ export type V1AiModelListResponse = OpenApiSchemas['AiModelListResponse'];
8
+ export type V1AiCredentialStatus = OpenApiSchemas['AiCredential']['status'];
9
+ export type V1AiCredential = OpenApiSchemas['AiCredential'];
10
+ export type V1AiCredentialListQuery = OpenApiQuery<'ai.credentials.list'>;
11
+ export type V1AiCredentialCreateRequest = OpenApiSchemas['AiCredentialCreateRequest'];
12
+ export type V1AiCredentialUpdateRequest = OpenApiSchemas['AiCredentialUpdateRequest'];
13
+ export type V1AiCredentialDeleteResponse = OpenApiSchemas['AiCredentialDeleteResponse'];
14
+ export type V1AiCredentialTestResponse = OpenApiSchemas['AiCredentialTestResponse'];
15
+ export type V1AiModelSelectionAuth = OpenApiSchemas['AiModelSelectionAuth'];
16
+ export type V1AiModelSelectionObject = OpenApiSchemas['AiModelSelection'];
91
17
  export type V1AiModelSelection = string | V1AiModelSelectionObject;
92
- export type V1AiStoredModelSelectionAuth = 'managed' | {
93
- credential: string;
94
- };
95
- export type V1AiStoredModelSelection = string | (Omit<V1AiModelSelectionObject, 'auth' | 'baseUrl'> & {
96
- auth?: V1AiStoredModelSelectionAuth;
97
- });
18
+ export type V1AiStoredModelSelectionAuth = OpenApiSchemas['AiStoredModelSelectionAuth'];
19
+ export type V1AiStoredModelSelection = string | OpenApiSchemas['AiStoredModelSelection'];
@@ -1,25 +1,8 @@
1
- import type { V1PageQuery } from './types.js';
2
- export type V1BrowserExtensionFormat = 'crx';
1
+ import type { OpenApiQuery, OpenApiSchemas } from './openapi.js';
2
+ export type V1BrowserExtensionFormat = OpenApiSchemas['BrowserExtension']['format'];
3
3
  export type V1BrowserExtensionSource = 'upload' | 'url';
4
- export interface V1BrowserExtension {
5
- id: string;
6
- name: string;
7
- version: string;
8
- format: V1BrowserExtensionFormat;
9
- subaccountId?: string;
10
- sourceUrl?: string;
11
- sizeBytes?: number;
12
- contentHash?: string;
13
- profileCount: number;
14
- createdAt: string;
15
- updatedAt: string;
16
- }
17
- export interface V1BrowserExtensionListQuery extends V1PageQuery {
18
- subaccountId?: string;
19
- q?: string;
20
- format?: V1BrowserExtensionFormat;
21
- source?: V1BrowserExtensionSource;
22
- }
4
+ export type V1BrowserExtension = OpenApiSchemas['BrowserExtension'];
5
+ export type V1BrowserExtensionListQuery = OpenApiQuery<'browser-extensions.list'>;
23
6
  export interface V1BrowserExtensionUploadRequest {
24
7
  /** Packed Chromium extension package. Only .crx is supported today. */
25
8
  file: Blob;
@@ -28,18 +11,6 @@ export interface V1BrowserExtensionUploadRequest {
28
11
  /** Parent/org keys may create inside a child subaccount. */
29
12
  subaccountId?: string;
30
13
  }
31
- export interface V1BrowserExtensionImportRequest {
32
- /** Chrome Web Store detail URL. */
33
- url: string;
34
- /** Optional display name. Defaults to manifest.name. */
35
- name?: string;
36
- /** Parent/org keys may create inside a child subaccount. */
37
- subaccountId?: string;
38
- }
39
- export interface V1BrowserExtensionUpdateRequest {
40
- name: string;
41
- }
42
- export interface V1BrowserExtensionDeleteResponse {
43
- id: string;
44
- deleted: true;
45
- }
14
+ export type V1BrowserExtensionImportRequest = OpenApiSchemas['BrowserExtensionImportRequest'];
15
+ export type V1BrowserExtensionUpdateRequest = OpenApiSchemas['BrowserExtensionUpdateRequest'];
16
+ export type V1BrowserExtensionDeleteResponse = OpenApiSchemas['BrowserExtensionDeleteResponse'];