@datalayer/core 1.1.41 → 1.1.43

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/README.md CHANGED
@@ -25,12 +25,10 @@ This package serves as the base foundation used by many other Datalayer packages
25
25
  ## Key Features
26
26
 
27
27
  - **🔐 Simple Authentication**: Easy token-based authentication with environment variable support
28
- - **⚡ Runtime Management**: Create and manage scalable compute runtimes (CPU/GPU) for code execution
29
- - **📸 Snapshot Management**: Create and manage compute snapshots of your runtimes for reproducible environments
30
28
  - **🔒 Secrets Management**: Securely handle sensitive data and credentials in your workflows
31
29
  - **🐍 Python Client**: Programmatic access to Datalayer platform with context managers and clean resource management
32
30
  - **🌐 TypeScript/React Client**: React components and services for building Jupyter-based applications
33
- - **💻 Command Line Interface**: CLI tools for managing runtimes, snapshots, and platform resources
31
+ - **💻 Command Line Interface**: CLI tools for account and platform operations
34
32
  - **🔧 Base Classes**: Core application classes and configuration inherited by other Datalayer projects
35
33
  - **📓 Jupyter Integration**: ServiceManager and collaboration providers for notebook experiences
36
34
  - **🧭 Universal Navigation**: Smart navigation hooks that auto-detect and work with React Router, Next.js, or native browser
@@ -85,136 +83,27 @@ from datalayer_core import DatalayerClient
85
83
  client = DatalayerClient()
86
84
 
87
85
  # Or pass token directly
88
- client = DatalayerClient(token="your-token-here")
86
+ client = DatalayerClient(api_key="your-api-key-here")
89
87
 
90
88
  if client.authenticate():
91
89
  print("Successfully authenticated!")
92
90
  ```
93
91
 
94
- ### 2. Execute Code in a Runtime
92
+ ### 2. Runtime, Snapshots, and Evals
95
93
 
96
- > **Note:** Runtime creation and code execution have moved to the
97
- > [`agent-runtimes`](https://github.com/datalayer/agent-runtimes) package. Use its
98
- > `RuntimeClient` (and the `@datalayer` decorator) for runtime workloads. The
99
- > `datalayer-core` `DatalayerClient` now focuses on account/platform operations
100
- > (authentication, secrets, API keys, usage, profile).
94
+ Runtime execution, snapshot workflows, and evals CLI are now documented and maintained in:
101
95
 
102
- ```python
103
- from agent_runtimes.client import RuntimeClient
104
-
105
- client = RuntimeClient()
106
-
107
- # Execute code in a managed runtime
108
- with client.create_runtime() as runtime:
109
- response = runtime.execute("print('Hello from Datalayer!')")
110
- print(response.stdout)
111
- ```
112
-
113
- ### 3. Using the CLI
114
-
115
- The CLI provides command-line access to Datalayer platform features:
96
+ - [agent-runtimes README](https://github.com/datalayer/agent-runtimes/blob/main/README.md)
97
+ - [agent-runtimes CLI docs](https://agent-runtimes.datalayer.tech/cli)
116
98
 
117
- ```bash
118
- # List available runtimes
119
- datalayer runtime list
120
-
121
- # Create a new runtime
122
- datalayer runtime create ai-env --given-name my-runtime-123
123
-
124
- # Execute a script in a runtime
125
- datalayer runtime exec my-script.py --agent <agent-id>
126
-
127
- # Create a snapshot from a runtime but do not terminate the runtime
128
- datalayer snapshots create <pod-name> my-snapshot 'AI work!' False
129
- ```
130
-
131
- ### 4. Subscription and Credits CLI
132
-
133
- Use these commands to inspect billing and manage credits distribution.
134
-
135
- ```bash
136
- # End-user billing view
137
- datalayer subscriptions show
138
- datalayer subscriptions available
139
- datalayer subscriptions move
140
- datalayer subscriptions topups
141
- datalayer subscriptions dry-run
142
-
143
- # Organization and team credits visibility
144
- datalayer usage org-overview --organization-uid <org_uid>
145
- datalayer usage team-overview --team-uid <team_uid>
146
-
147
- # Monitoring-driven credit management
148
- datalayer usage org-monitor --organization-uid <org_uid> --window-hours 24
149
- datalayer usage team-monitor --team-uid <team_uid> --window-hours 24
150
-
151
- # Credits transfer operations (owners/admins)
152
- datalayer usage org-allocate-team --organization-uid <org_uid> --team-uid <team_uid> --amount 50
153
- datalayer usage org-revoke-team --organization-uid <org_uid> --team-uid <team_uid> --amount 20
154
- datalayer usage team-allocate-member --team-uid <team_uid> --member-uid <member_uid> --amount 15
155
- datalayer usage team-revoke-member --team-uid <team_uid> --member-uid <member_uid> --amount 5
156
- ```
157
-
158
- ### 5. Evals CLI (Multi-Agentspec)
159
-
160
- Use comma-separated agentspec ids to create one experiment per agentspec variant:
161
-
162
- ```bash
163
- # Creates one experiment per agentspec in the list
164
- agent-runtimes evals experiments create my-exp \
165
- --evalset-id <evalset_id> \
166
- --agent-spec-ids example-evals,example-evals-nocodemode,example-custom
167
- ```
168
-
169
- Generate a comparison report:
170
-
171
- ```bash
172
- agent-runtimes evals report <evalset_id> --run-limit 50 --export
173
- ```
174
-
175
- How to interpret grouped comparisons in the report:
176
-
177
- - `Within-Agentspec Pairwise Latest-Pass Deltas`: compares experiments using the same agentspec id.
178
- - `Cross-Agentspec Pairwise Latest-Pass Deltas`: compares experiments using different agentspec ids.
179
- - Pairwise sections compute all combinations for the selected experiments, not just two agentspecs.
99
+ Use `agent-runtimes` for runtime workloads (`RuntimeClient`, `@datalayer`, snapshots, and evals), and use `datalayer-core` for account/platform operations (authentication, secrets, API keys, usage, profile).
180
100
 
181
101
  ## Examples
182
102
 
183
- ### Python Examples
184
-
185
- For comprehensive Python usage examples, see the [`examples/`](https://github.com/datalayer/core/tree/main/examples) directory which includes:
186
-
187
- - **OpenTelemetry observability**: Traces and metrics instrumentation with a visualization UI
188
-
189
- The framework and client examples (**FastAPI + scikit-learn**, **Streamlit + scikit-learn**, **PyTorch GPU workloads**, **`@datalayer` decorator patterns**, and **Next.js**) have moved to the [Agent Runtimes examples](https://github.com/datalayer/agent-runtimes/tree/main/examples).
190
-
191
- ### TypeScript/React Examples
192
-
193
- Run the interactive examples locally:
194
-
195
- ```bash
196
- # Install dependencies
197
- npm install
198
-
199
- # Set your Datalayer API token in .env
200
- echo "VITE_DATALAYER_API_KEY=your-token-here" > .env
201
-
202
- # Start the examples server
203
- npm run examples
204
- ```
205
-
206
- Available at http://localhost:3000/:
207
-
208
- - **DatalayerNotebookExample**: Full integration with Datalayer services and collaboration
209
- - **NotebookExample**: Basic Jupyter notebook in React
210
- - **CellExample**: Individual code cell execution
211
- - **ReactRouterAdvancedExample**: Comprehensive navigation demo with React Router integration
212
- - **ReactRouterNavigationExample**: Basic navigation with route parameters
213
- - **NativeNavigationExample**: Browser-native navigation fallback
214
-
215
- ### Next.js Application Example
103
+ Examples have moved to Agent Runtimes:
216
104
 
217
- The Next.js application example has moved to the [Agent Runtimes examples](https://github.com/datalayer/agent-runtimes/tree/main/examples/nextjs).
105
+ - [Agent Runtimes examples README](https://github.com/datalayer/agent-runtimes/blob/main/examples/README.md)
106
+ - [Agent Runtimes examples directory](https://github.com/datalayer/agent-runtimes/tree/main/examples)
218
107
 
219
108
  ## Platform Integration
220
109
 
@@ -10,15 +10,15 @@ import { UserDTO } from '../../models/UserDTO';
10
10
  export declare class AuthenticationManager {
11
11
  private strategies;
12
12
  private storage;
13
- private iamRunUrl;
13
+ private iamUrl;
14
14
  private currentUser?;
15
15
  private currentToken?;
16
16
  /**
17
17
  * Create an AuthenticationManager instance
18
- * @param iamRunUrl - IAM service URL (e.g., "https://prod1.datalayer.run")
18
+ * @param iamUrl - IAM service URL (e.g., "https://prod1.datalayer.run")
19
19
  * @param storage - Token storage backend (optional, defaults to auto-detected)
20
20
  */
21
- constructor(iamRunUrl: string, storage?: TokenStorage);
21
+ constructor(iamUrl: string, storage?: TokenStorage);
22
22
  /**
23
23
  * Login using various authentication methods
24
24
  * Automatically selects the appropriate strategy based on options
@@ -15,25 +15,25 @@ import { NodeStorage, BrowserStorage } from './storage.js';
15
15
  export class AuthenticationManager {
16
16
  strategies;
17
17
  storage;
18
- iamRunUrl;
18
+ iamUrl;
19
19
  currentUser;
20
20
  currentToken;
21
21
  /**
22
22
  * Create an AuthenticationManager instance
23
- * @param iamRunUrl - IAM service URL (e.g., "https://prod1.datalayer.run")
23
+ * @param iamUrl - IAM service URL (e.g., "https://prod1.datalayer.run")
24
24
  * @param storage - Token storage backend (optional, defaults to auto-detected)
25
25
  */
26
- constructor(iamRunUrl, storage) {
27
- this.iamRunUrl = iamRunUrl;
28
- // Extract run_url (remove /api/iam/v1 if present)
29
- const runUrl = iamRunUrl.replace('/api/iam/v1', '');
30
- // CRITICAL: Pass runUrl to storage for keyring compatibility
26
+ constructor(iamUrl, storage) {
27
+ this.iamUrl = iamUrl;
28
+ // Extract datalayer_url (remove /api/iam/v1 if present)
29
+ const datalayerUrl = iamUrl.replace('/api/iam/v1', '');
30
+ // CRITICAL: Pass datalayerUrl to storage for keyring compatibility
31
31
  if (!storage) {
32
32
  if (typeof window !== 'undefined') {
33
33
  this.storage = new BrowserStorage();
34
34
  }
35
35
  else {
36
- this.storage = new NodeStorage(runUrl); // Pass runUrl as serviceUrl
36
+ this.storage = new NodeStorage(datalayerUrl); // Pass datalayerUrl as serviceUrl
37
37
  }
38
38
  }
39
39
  else {
@@ -41,10 +41,10 @@ export class AuthenticationManager {
41
41
  }
42
42
  // Initialize strategies
43
43
  this.strategies = [
44
- new TokenAuthStrategy(this.iamRunUrl, this.storage),
45
- new CredentialsAuthStrategy(this.iamRunUrl, this.storage),
46
- new StorageAuthStrategy(this.iamRunUrl, this.storage),
47
- new BrowserOAuthStrategy(this.iamRunUrl, this.storage),
44
+ new TokenAuthStrategy(this.iamUrl, this.storage),
45
+ new CredentialsAuthStrategy(this.iamUrl, this.storage),
46
+ new StorageAuthStrategy(this.iamUrl, this.storage),
47
+ new BrowserOAuthStrategy(this.iamUrl, this.storage),
48
48
  ];
49
49
  }
50
50
  /**
@@ -98,7 +98,7 @@ export class AuthenticationManager {
98
98
  async logout() {
99
99
  if (this.currentToken) {
100
100
  try {
101
- await authentication.logout(this.currentToken, this.iamRunUrl);
101
+ await authentication.logout(this.currentToken, this.iamUrl);
102
102
  }
103
103
  catch (error) {
104
104
  console.error('Error during logout API call:', error);
@@ -4,9 +4,9 @@ import { UserDTO } from '../../models/UserDTO';
4
4
  * Base authentication strategy with common functionality
5
5
  */
6
6
  declare abstract class BaseAuthStrategy implements AuthStrategy {
7
- protected iamRunUrl: string;
7
+ protected iamUrl: string;
8
8
  protected storage?: TokenStorage | undefined;
9
- constructor(iamRunUrl: string, storage?: TokenStorage | undefined);
9
+ constructor(iamUrl: string, storage?: TokenStorage | undefined);
10
10
  abstract authenticate(options: AuthOptions): Promise<AuthResult>;
11
11
  abstract canHandle(options: AuthOptions): boolean;
12
12
  /**
@@ -17,17 +17,17 @@ import { UserDTO } from '../../models/UserDTO.js';
17
17
  * Base authentication strategy with common functionality
18
18
  */
19
19
  class BaseAuthStrategy {
20
- iamRunUrl;
20
+ iamUrl;
21
21
  storage;
22
- constructor(iamRunUrl, storage) {
23
- this.iamRunUrl = iamRunUrl;
22
+ constructor(iamUrl, storage) {
23
+ this.iamUrl = iamUrl;
24
24
  this.storage = storage;
25
25
  }
26
26
  /**
27
27
  * Validate a token by calling whoami
28
28
  */
29
29
  async validateToken(token) {
30
- const response = await profile.whoami(token, this.iamRunUrl);
30
+ const response = await profile.whoami(token, this.iamUrl);
31
31
  if (!response || !response.profile) {
32
32
  throw new Error('Invalid response from profile API');
33
33
  }
@@ -82,7 +82,7 @@ export class CredentialsAuthStrategy extends BaseAuthStrategy {
82
82
  throw new Error('Handle and password are required for credentials authentication');
83
83
  }
84
84
  // Call the login API
85
- const response = await authentication.login({ handle: options.handle, password: options.password }, this.iamRunUrl);
85
+ const response = await authentication.login({ handle: options.handle, password: options.password }, this.iamUrl);
86
86
  if (!response || !response.success || !response.token) {
87
87
  throw new Error(response?.message || 'Login failed');
88
88
  }
@@ -158,7 +158,7 @@ export class BrowserOAuthStrategy extends BaseAuthStrategy {
158
158
  const callbackUri = options.callbackUri || `${window.location.origin}/auth/callback`;
159
159
  try {
160
160
  // Step 1: Get OAuth authorization URL
161
- const authzResponse = await getOAuth2AuthzUrl(provider, callbackUri, this.iamRunUrl, options.nonce);
161
+ const authzResponse = await getOAuth2AuthzUrl(provider, callbackUri, this.iamUrl, options.nonce);
162
162
  // Step 2: Open OAuth URL in popup or redirect
163
163
  if (options.usePopup !== false) {
164
164
  // Use popup window
@@ -14,11 +14,11 @@ export interface DatalayerClientConfig {
14
14
  /** Authentication token for API requests */
15
15
  token?: string;
16
16
  /** URL for the IAM service */
17
- iamRunUrl?: string;
17
+ iamUrl?: string;
18
18
  /** URL for the Runtimes service */
19
- runtimesRunUrl?: string;
19
+ runtimesUrl?: string;
20
20
  /** URL for the Spacer service */
21
- spacerRunUrl?: string;
21
+ spacerUrl?: string;
22
22
  /** Custom token storage backend (optional, defaults to auto-detected) */
23
23
  storage?: TokenStorage;
24
24
  /** Handlers for intercepting Client method calls */
@@ -27,11 +27,11 @@ export interface DatalayerClientConfig {
27
27
  /** Base Client class providing core configuration and token management. */
28
28
  export declare class DatalayerClientBase {
29
29
  /** URL for IAM service */
30
- readonly iamRunUrl: string;
30
+ readonly iamUrl: string;
31
31
  /** URL for Runtimes service */
32
- readonly runtimesRunUrl: string;
32
+ readonly runtimesUrl: string;
33
33
  /** URL for Spacer service */
34
- readonly spacerRunUrl: string;
34
+ readonly spacerUrl: string;
35
35
  /** Authentication token */
36
36
  token?: string;
37
37
  /** Method lifecycle handlers */
@@ -49,11 +49,11 @@ export declare class DatalayerClientBase {
49
49
  */
50
50
  getConfig(): DatalayerClientConfig;
51
51
  /** Get the IAM service URL. */
52
- getIamRunUrl(): string;
52
+ getIamUrl(): string;
53
53
  /** Get the Runtimes service URL. */
54
- getRuntimesRunUrl(): string;
54
+ getRuntimesUrl(): string;
55
55
  /** Get the Spacer service URL. */
56
- getSpacerRunUrl(): string;
56
+ getSpacerUrl(): string;
57
57
  /** Get the current authentication token. */
58
58
  getToken(): string | undefined;
59
59
  /**
@@ -11,11 +11,11 @@ import { AuthenticationManager } from './auth/index.js';
11
11
  /** Base Client class providing core configuration and token management. */
12
12
  export class DatalayerClientBase {
13
13
  /** URL for IAM service */
14
- iamRunUrl;
14
+ iamUrl;
15
15
  /** URL for Runtimes service */
16
- runtimesRunUrl;
16
+ runtimesUrl;
17
17
  /** URL for Spacer service */
18
- spacerRunUrl;
18
+ spacerUrl;
19
19
  /** Authentication token */
20
20
  token;
21
21
  /** Method lifecycle handlers */
@@ -27,14 +27,14 @@ export class DatalayerClientBase {
27
27
  * @param config - Client configuration options
28
28
  */
29
29
  constructor(config) {
30
- this.iamRunUrl = config.iamRunUrl || DEFAULT_SERVICE_URLS.IAM;
31
- this.runtimesRunUrl =
32
- config.runtimesRunUrl || DEFAULT_SERVICE_URLS.RUNTIMES;
33
- this.spacerRunUrl = config.spacerRunUrl || DEFAULT_SERVICE_URLS.SPACER;
30
+ this.iamUrl = config.iamUrl || DEFAULT_SERVICE_URLS.IAM;
31
+ this.runtimesUrl =
32
+ config.runtimesUrl || DEFAULT_SERVICE_URLS.RUNTIMES;
33
+ this.spacerUrl = config.spacerUrl || DEFAULT_SERVICE_URLS.SPACER;
34
34
  this.token = config.token;
35
35
  this.handlers = config.handlers;
36
36
  // Initialize authentication manager with custom storage if provided
37
- this.auth = new AuthenticationManager(this.iamRunUrl, config.storage);
37
+ this.auth = new AuthenticationManager(this.iamUrl, config.storage);
38
38
  // If a token was provided, store it in the auth manager
39
39
  if (this.token) {
40
40
  this.auth.storeToken(this.token);
@@ -46,23 +46,23 @@ export class DatalayerClientBase {
46
46
  */
47
47
  getConfig() {
48
48
  return {
49
- iamRunUrl: this.iamRunUrl,
50
- runtimesRunUrl: this.runtimesRunUrl,
51
- spacerRunUrl: this.spacerRunUrl,
49
+ iamUrl: this.iamUrl,
50
+ runtimesUrl: this.runtimesUrl,
51
+ spacerUrl: this.spacerUrl,
52
52
  token: this.token,
53
53
  };
54
54
  }
55
55
  /** Get the IAM service URL. */
56
- getIamRunUrl() {
57
- return this.iamRunUrl;
56
+ getIamUrl() {
57
+ return this.iamUrl;
58
58
  }
59
59
  /** Get the Runtimes service URL. */
60
- getRuntimesRunUrl() {
61
- return this.runtimesRunUrl;
60
+ getRuntimesUrl() {
61
+ return this.runtimesUrl;
62
62
  }
63
63
  /** Get the Spacer service URL. */
64
- getSpacerRunUrl() {
65
- return this.spacerRunUrl;
64
+ getSpacerUrl() {
65
+ return this.spacerUrl;
66
66
  }
67
67
  /** Get the current authentication token. */
68
68
  getToken() {
@@ -29,8 +29,8 @@ export function IAMMixin(Base) {
29
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
30
  const token = this.getToken();
31
31
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- const iamRunUrl = this.getIamRunUrl();
33
- const response = await profile.whoami(token, iamRunUrl);
32
+ const iamUrl = this.getIamUrl();
33
+ const response = await profile.whoami(token, iamUrl);
34
34
  // Handle the whoami response format
35
35
  let userData;
36
36
  if (!response) {
@@ -83,8 +83,8 @@ export function IAMMixin(Base) {
83
83
  /** Log out the current user. */
84
84
  async logout() {
85
85
  const token = this.getToken();
86
- const iamRunUrl = this.getIamRunUrl();
87
- await authentication.logout(token, iamRunUrl);
86
+ const iamUrl = this.getIamUrl();
87
+ await authentication.logout(token, iamUrl);
88
88
  // Clear the token from the Client and cached user
89
89
  this.setToken('');
90
90
  this.currentUserCache = undefined;
@@ -95,8 +95,8 @@ export function IAMMixin(Base) {
95
95
  */
96
96
  async getCredits() {
97
97
  const token = this.getToken();
98
- const iamRunUrl = this.getIamRunUrl();
99
- const response = await usage.getCredits(token, iamRunUrl);
98
+ const iamUrl = this.getIamUrl();
99
+ const response = await usage.getCredits(token, iamUrl);
100
100
  if (!response || !response.credits) {
101
101
  throw new Error('Invalid response from credits API');
102
102
  }
@@ -191,8 +191,8 @@ export function IAMMixin(Base) {
191
191
  */
192
192
  async createSecret(data) {
193
193
  const token = this.getToken();
194
- const iamRunUrl = this.getIamRunUrl();
195
- const response = await secrets.createSecret(token, data, iamRunUrl);
194
+ const iamUrl = this.getIamUrl();
195
+ const response = await secrets.createSecret(token, data, iamUrl);
196
196
  return new SecretDTO(response.secret, this);
197
197
  }
198
198
  /**
@@ -201,8 +201,8 @@ export function IAMMixin(Base) {
201
201
  */
202
202
  async listSecrets() {
203
203
  const token = this.getToken();
204
- const iamRunUrl = this.getIamRunUrl();
205
- const response = await secrets.listSecrets(token, iamRunUrl);
204
+ const iamUrl = this.getIamUrl();
205
+ const response = await secrets.listSecrets(token, iamUrl);
206
206
  return response.secrets.map(s => new SecretDTO(s, this));
207
207
  }
208
208
  /**
@@ -212,8 +212,8 @@ export function IAMMixin(Base) {
212
212
  */
213
213
  async getSecret(secretId) {
214
214
  const token = this.getToken();
215
- const iamRunUrl = this.getIamRunUrl();
216
- const response = await secrets.getSecret(token, secretId, iamRunUrl);
215
+ const iamUrl = this.getIamUrl();
216
+ const response = await secrets.getSecret(token, secretId, iamUrl);
217
217
  return new SecretDTO(response.secret, this);
218
218
  }
219
219
  /**
@@ -224,8 +224,8 @@ export function IAMMixin(Base) {
224
224
  */
225
225
  async updateSecret(secretId, updates) {
226
226
  const token = this.getToken();
227
- const iamRunUrl = this.getIamRunUrl();
228
- const response = await secrets.updateSecret(token, secretId, updates, iamRunUrl);
227
+ const iamUrl = this.getIamUrl();
228
+ const response = await secrets.updateSecret(token, secretId, updates, iamUrl);
229
229
  return new SecretDTO(response.secret, this);
230
230
  }
231
231
  /**
@@ -234,8 +234,8 @@ export function IAMMixin(Base) {
234
234
  */
235
235
  async deleteSecret(secretId) {
236
236
  const token = this.getToken();
237
- const iamRunUrl = this.getIamRunUrl();
238
- await secrets.deleteSecret(token, secretId, iamRunUrl);
237
+ const iamUrl = this.getIamUrl();
238
+ await secrets.deleteSecret(token, secretId, iamUrl);
239
239
  }
240
240
  // ========================================================================
241
241
  // Datasources Management
@@ -247,8 +247,8 @@ export function IAMMixin(Base) {
247
247
  */
248
248
  async createDatasource(data) {
249
249
  const token = this.getToken();
250
- const iamRunUrl = this.getIamRunUrl();
251
- const response = await datasources.createDatasource(token, data, iamRunUrl);
250
+ const iamUrl = this.getIamUrl();
251
+ const response = await datasources.createDatasource(token, data, iamUrl);
252
252
  return new DatasourceDTO(response.datasource, this);
253
253
  }
254
254
  /**
@@ -257,8 +257,8 @@ export function IAMMixin(Base) {
257
257
  */
258
258
  async listDatasources() {
259
259
  const token = this.getToken();
260
- const iamRunUrl = this.getIamRunUrl();
261
- const response = await datasources.listDatasources(token, iamRunUrl);
260
+ const iamUrl = this.getIamUrl();
261
+ const response = await datasources.listDatasources(token, iamUrl);
262
262
  return response.datasources.map(d => new DatasourceDTO(d, this));
263
263
  }
264
264
  /**
@@ -268,8 +268,8 @@ export function IAMMixin(Base) {
268
268
  */
269
269
  async getDatasource(datasourceId) {
270
270
  const token = this.getToken();
271
- const iamRunUrl = this.getIamRunUrl();
272
- const response = await datasources.getDatasource(token, datasourceId, iamRunUrl);
271
+ const iamUrl = this.getIamUrl();
272
+ const response = await datasources.getDatasource(token, datasourceId, iamUrl);
273
273
  return new DatasourceDTO(response.datasource, this);
274
274
  }
275
275
  /**
@@ -280,8 +280,8 @@ export function IAMMixin(Base) {
280
280
  */
281
281
  async updateDatasource(datasourceId, updates) {
282
282
  const token = this.getToken();
283
- const iamRunUrl = this.getIamRunUrl();
284
- const response = await datasources.updateDatasource(token, datasourceId, updates, iamRunUrl);
283
+ const iamUrl = this.getIamUrl();
284
+ const response = await datasources.updateDatasource(token, datasourceId, updates, iamUrl);
285
285
  return new DatasourceDTO(response.datasource, this);
286
286
  }
287
287
  /**
@@ -290,8 +290,8 @@ export function IAMMixin(Base) {
290
290
  */
291
291
  async deleteDatasource(datasourceId) {
292
292
  const token = this.getToken();
293
- const iamRunUrl = this.getIamRunUrl();
294
- await datasources.deleteDatasource(token, datasourceId, iamRunUrl);
293
+ const iamUrl = this.getIamUrl();
294
+ await datasources.deleteDatasource(token, datasourceId, iamUrl);
295
295
  }
296
296
  };
297
297
  }
@@ -22,7 +22,7 @@ export const Login = (props) => {
22
22
  const loginMutation = useLogin();
23
23
  const getOAuth2URLMutation = useOAuth2AuthorizationURL();
24
24
  const { loginAndNavigate, setLogin } = useIAM();
25
- const { externalToken, iamProvidersAuthorizationURL, addIAMProviderAuthorizationURL, iamRunUrl, logout, checkIAMToken, } = useIAMStore();
25
+ const { externalToken, iamProvidersAuthorizationURL, addIAMProviderAuthorizationURL, iamUrl, logout, checkIAMToken, } = useIAMStore();
26
26
  const { enqueueToast } = useToast();
27
27
  const navigate = useNavigate();
28
28
  const [loading, setLoading] = useState(false);
@@ -76,7 +76,7 @@ export const Login = (props) => {
76
76
  if (!iamProvidersAuthorizationURL[IAMProvidersSpecs.LinkedIn.name]) {
77
77
  initIAMProvider(IAMProvidersSpecs.LinkedIn);
78
78
  }
79
- }, [iamRunUrl, iamProvidersAuthorizationURL, addIAMProviderAuthorizationURL]);
79
+ }, [iamUrl, iamProvidersAuthorizationURL, addIAMProviderAuthorizationURL]);
80
80
  useEffect(() => {
81
81
  if (externalToken) {
82
82
  setLoadingWithToken(1);
@@ -32,7 +32,7 @@ function truncatePrincipalLabel(label, maxChars) {
32
32
  * - selecting a team principal → billable account = the team's parent org
33
33
  */
34
34
  export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, showClosedBorder = true, }) {
35
- const { user, token, iamRunUrl } = useIAMStore();
35
+ const { user, token, iamUrl } = useIAMStore();
36
36
  const { configuration } = useCoreStore();
37
37
  const { checkIsPlatformAdmin } = useAuthorization();
38
38
  const { useUserOrganizations } = useCache();
@@ -85,7 +85,7 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
85
85
  }
86
86
  setTeamsLoading(true);
87
87
  try {
88
- const baseUrl = iamRunUrl || configuration.iamRunUrl;
88
+ const baseUrl = iamUrl || configuration.iamUrl;
89
89
  const response = await fetchMemberships(token, baseUrl);
90
90
  const rawMemberships = Array.isArray(response?.memberships)
91
91
  ? response.memberships
@@ -120,7 +120,7 @@ export function PrincipalSwitcherMenu({ maxLabelChars = 48, fullWidth = true, sh
120
120
  return () => {
121
121
  cancelled = true;
122
122
  };
123
- }, [token, iamRunUrl, configuration.iamRunUrl]);
123
+ }, [token, iamUrl, configuration.iamUrl]);
124
124
  useEffect(() => {
125
125
  if (!personalUid || !personalHandle) {
126
126
  return;