@datalayer/core 1.0.20 → 1.0.21

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.
Files changed (96) hide show
  1. package/README.md +27 -0
  2. package/lib/api/DatalayerApi.d.ts +5 -1
  3. package/lib/api/DatalayerApi.js +55 -8
  4. package/lib/api/iam/oauth2.d.ts +3 -3
  5. package/lib/api/iam/oauth2.js +2 -2
  6. package/lib/api/iam/profile.d.ts +9 -1
  7. package/lib/api/iam/profile.js +15 -0
  8. package/lib/api/runtimes/checkpoints.js +1 -1
  9. package/lib/api/runtimes/snapshots.d.ts +7 -7
  10. package/lib/api/runtimes/snapshots.js +9 -9
  11. package/lib/client/auth/storage.js +103 -12
  12. package/lib/client/index.d.ts +7 -7
  13. package/lib/client/index.js +1 -1
  14. package/lib/client/mixins/RuntimesMixin.d.ts +6 -6
  15. package/lib/client/mixins/RuntimesMixin.js +5 -5
  16. package/lib/client/mixins/SpacerMixin.js +22 -1
  17. package/lib/collaboration/DatalayerCollaborationProvider.d.ts +4 -3
  18. package/lib/components/avatars/DLAvatar.d.ts +24 -0
  19. package/lib/components/avatars/DLAvatar.js +26 -0
  20. package/lib/components/avatars/UserProfileAvatar.js +4 -4
  21. package/lib/components/avatars/index.d.ts +1 -0
  22. package/lib/components/avatars/index.js +1 -0
  23. package/lib/components/checkout/StripeCheckout.d.ts +24 -3
  24. package/lib/components/checkout/StripeCheckout.js +1116 -55
  25. package/lib/components/display/DatalayerBox.js +6 -1
  26. package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +2 -2
  27. package/lib/components/snapshots/{RuntimeSnapshotMenu.d.ts → SandboxSnapshotMenu.d.ts} +4 -4
  28. package/lib/components/snapshots/{RuntimeSnapshotMenu.js → SandboxSnapshotMenu.js} +33 -33
  29. package/lib/components/snapshots/index.d.ts +1 -1
  30. package/lib/components/snapshots/index.js +1 -1
  31. package/lib/components/storage/ContentsBrowser.js +2 -2
  32. package/lib/components/tokens/SpaceVariantToken.d.ts +1 -1
  33. package/lib/components/tokens/SpaceVariantToken.js +7 -4
  34. package/lib/components/users/PeerIndicator.js +5 -4
  35. package/lib/hooks/useCache.d.ts +125 -18
  36. package/lib/hooks/useCache.js +893 -120
  37. package/lib/hooks/useDatalayer.js +31 -3
  38. package/lib/hooks/useIAM.js +1 -8
  39. package/lib/hooks/useProjects.d.ts +44 -0
  40. package/lib/hooks/useProjects.js +26 -2
  41. package/lib/index.d.ts +2 -2
  42. package/lib/index.js +1 -1
  43. package/lib/mocks/components/FlashMock.js +8 -2
  44. package/lib/models/{RuntimeSnapshot.d.ts → CodeSandboxSnapshot.d.ts} +5 -5
  45. package/lib/models/{RuntimeSnapshot.js → CodeSandboxSnapshot.js} +1 -1
  46. package/lib/models/{RuntimeSnapshotDTO.d.ts → CodeSandboxSnapshotDTO.d.ts} +30 -30
  47. package/lib/models/{RuntimeSnapshotDTO.js → CodeSandboxSnapshotDTO.js} +6 -6
  48. package/lib/models/Environment.d.ts +4 -0
  49. package/lib/models/IAM.d.ts +66 -0
  50. package/lib/models/Organization.d.ts +1 -0
  51. package/lib/models/Organization.js +1 -0
  52. package/lib/models/Page.d.ts +2 -2
  53. package/lib/models/Page.js +2 -2
  54. package/lib/models/Profile.d.ts +1 -1
  55. package/lib/models/RuntimeDTO.d.ts +2 -2
  56. package/lib/models/Space.d.ts +1 -0
  57. package/lib/models/Space.js +29 -5
  58. package/lib/models/SpaceDTO.d.ts +4 -0
  59. package/lib/models/SpaceDTO.js +5 -0
  60. package/lib/models/Usage.d.ts +15 -0
  61. package/lib/models/Usage.js +9 -0
  62. package/lib/models/User.d.ts +21 -0
  63. package/lib/models/User.js +6 -2
  64. package/lib/models/index.d.ts +2 -2
  65. package/lib/models/index.js +2 -2
  66. package/lib/otel/auth.js +0 -4
  67. package/lib/services/index.d.ts +1 -1
  68. package/lib/services/index.js +1 -1
  69. package/lib/state/substates/IAMState.js +0 -7
  70. package/lib/state/substates/RuntimesState.d.ts +9 -9
  71. package/lib/state/substates/RuntimesState.js +3 -3
  72. package/lib/stateful/runtimes/actions.d.ts +17 -17
  73. package/lib/stateful/runtimes/actions.js +35 -55
  74. package/lib/stateful/runtimes/apis.d.ts +3 -3
  75. package/lib/stateful/runtimes/snapshots.d.ts +2 -2
  76. package/lib/stateful/runtimes/snapshots.js +7 -7
  77. package/lib/utils/Format.d.ts +6 -0
  78. package/lib/utils/Format.js +17 -0
  79. package/lib/utils/Snapshot.d.ts +1 -1
  80. package/lib/utils/Snapshot.js +1 -1
  81. package/lib/views/datasources/DatasourceDetail.d.ts +7 -1
  82. package/lib/views/datasources/DatasourceDetail.js +61 -23
  83. package/lib/views/datasources/DatasourceNew.d.ts +8 -1
  84. package/lib/views/datasources/DatasourceNew.js +23 -10
  85. package/lib/views/datasources/Datasources.d.ts +5 -1
  86. package/lib/views/datasources/Datasources.js +38 -30
  87. package/lib/views/iam-tokens/IAMTokenNew.d.ts +3 -1
  88. package/lib/views/iam-tokens/IAMTokenNew.js +2 -2
  89. package/lib/views/iam-tokens/IAMTokens.d.ts +3 -1
  90. package/lib/views/iam-tokens/IAMTokens.js +2 -2
  91. package/lib/views/otel/OtelHeader.d.ts +5 -0
  92. package/lib/views/otel/OtelHeader.js +3 -3
  93. package/lib/views/profile/UserBadge.d.ts +7 -2
  94. package/lib/views/profile/UserBadge.js +11 -2
  95. package/lib/views/secrets/Secrets.js +21 -21
  96. package/package.json +8 -7
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { asUser } from './User.js';
6
- import { asRuntimeSnapshot } from './RuntimeSnapshot.js';
6
+ import { asCodeSandboxSnapshot, } from './CodeSandboxSnapshot.js';
7
7
  export const asPage = (s) => {
8
8
  return {
9
9
  id: s.uid,
@@ -18,7 +18,7 @@ export const asPage = (s) => {
18
18
  creator: s.creator ? asUser(s.creator) : undefined,
19
19
  creatorId: s.creator_uid,
20
20
  kernelSnapshot: s.kernel_snapshot
21
- ? asRuntimeSnapshot(s.kernel_snapshot)
21
+ ? asCodeSandboxSnapshot(s.kernel_snapshot)
22
22
  : undefined,
23
23
  kernelSnapshotId: s.kernel_snapshot_uid,
24
24
  };
@@ -41,7 +41,7 @@ export interface Profile {
41
41
  /** Customer UID */
42
42
  customer_uid?: string | null;
43
43
  /** Credits customer UID for billing */
44
- credits_customer_uid?: string | null;
44
+ stripe_customer_id_s?: string | null;
45
45
  /** Email unsubscription status */
46
46
  unsubscribed_from_outbounds_b?: boolean;
47
47
  /** Linked contact UID */
@@ -1,5 +1,5 @@
1
1
  import type { DatalayerClient } from '../index';
2
- import { RuntimeSnapshotDTO } from './RuntimeSnapshotDTO';
2
+ import { CodeSandboxSnapshotDTO } from './CodeSandboxSnapshotDTO';
3
3
  /**
4
4
  * Represents a running instance of a computing environment.
5
5
  * @interface RuntimeData
@@ -168,7 +168,7 @@ export declare class RuntimeDTO {
168
168
  * @param stop - Whether to stop runtime after snapshotting
169
169
  * @returns Created Snapshot instance
170
170
  */
171
- createSnapshot(name: string, description?: string, stop?: boolean): Promise<RuntimeSnapshotDTO>;
171
+ createSnapshot(name: string, description?: string, stop?: boolean): Promise<CodeSandboxSnapshotDTO>;
172
172
  /**
173
173
  * Get runtime data in camelCase format.
174
174
  * Returns only the core fields that consumers need.
@@ -24,6 +24,7 @@ export type IBaseSpace = {
24
24
  owner: IUser;
25
25
  organization?: Partial<IOrganization>;
26
26
  members?: SpaceMember[];
27
+ sharedOwnerUserUids?: string[];
27
28
  };
28
29
  export type ISpace = IBaseSpace & {
29
30
  type: 'space';
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { asUser } from './User.js';
6
6
  import { asArray } from '../utils/index.js';
7
- import { newUserMock } from './../mocks/models/index.js';
8
7
  /**
9
8
  * Convert the raw space object to {@link ISpace}.
10
9
  *
@@ -12,7 +11,31 @@ import { newUserMock } from './../mocks/models/index.js';
12
11
  * @returns Space
13
12
  */
14
13
  export const asSpace = (raw_space) => {
15
- const owner = newUserMock();
14
+ const sharedOwnerUserUids = asArray(raw_space?.shared_owner_user_uids_ss ||
15
+ raw_space?.shared_ower_user_uids_ss ||
16
+ []).filter((uid) => typeof uid === 'string' && uid.length > 0);
17
+ // The backend resolves the canonical (friendly) account handles and exposes
18
+ // them as `space.owner` and `space.organization`. Trust those single sources
19
+ // of truth; do not invent fallbacks here.
20
+ const organizationHandle = raw_space?.organization?.handle;
21
+ const owner = raw_space?.owner
22
+ ? asUser(raw_space.owner)
23
+ : {
24
+ id: '',
25
+ handle: '',
26
+ email: '',
27
+ firstName: '',
28
+ lastName: '',
29
+ initials: '',
30
+ displayName: '',
31
+ roles: [],
32
+ iamProviders: [],
33
+ setRoles: () => { },
34
+ unsubscribedFromOutbounds: false,
35
+ onboarding: {},
36
+ events: [],
37
+ settings: {},
38
+ };
16
39
  let members = new Array();
17
40
  if (raw_space.members) {
18
41
  members = asArray(raw_space.members).map(m => {
@@ -31,9 +54,10 @@ export const asSpace = (raw_space) => {
31
54
  members,
32
55
  creationDate: new Date(raw_space.creation_ts_dt),
33
56
  owner,
34
- organization: {
35
- handle: raw_space.handle_s,
36
- },
57
+ organization: organizationHandle
58
+ ? { handle: organizationHandle }
59
+ : undefined,
60
+ sharedOwnerUserUids,
37
61
  // Preserve raw Solr fields so consumers can access dynamic fields
38
62
  // (e.g. attached_agent_pod_name_s for project-agent assignment)
39
63
  ...raw_space,
@@ -21,6 +21,8 @@ export interface SpaceData {
21
21
  attached_agent_pod_name_s?: string;
22
22
  attached_agent_spec_id_s?: string;
23
23
  attached_agent_given_name_s?: string;
24
+ shared_owner_user_uids_ss?: string[];
25
+ shared_ower_user_uids_ss?: string[];
24
26
  }
25
27
  /**
26
28
  * Stable public interface for Space data.
@@ -40,6 +42,8 @@ export interface SpaceJSON {
40
42
  description: string;
41
43
  /** Items contained in the space (as JSON) */
42
44
  items: Array<NotebookJSON | LexicalJSON>;
45
+ /** Owner user UIDs for this space */
46
+ ownerUserUids?: string[];
43
47
  }
44
48
  /**
45
49
  * Space domain model that wraps API responses with convenient methods.
@@ -208,12 +208,17 @@ export class SpaceDTO {
208
208
  */
209
209
  toJSON() {
210
210
  this._checkDeleted();
211
+ const ownerUserUids = Array.from(new Set([
212
+ ...(this._data.shared_owner_user_uids_ss || []),
213
+ ...(this._data.shared_ower_user_uids_ss || []),
214
+ ].filter(uid => typeof uid === 'string' && uid.length > 0)));
211
215
  const obj = {
212
216
  uid: this.uid,
213
217
  name: this.name,
214
218
  description: this.description,
215
219
  variant: this.variant,
216
220
  handle: this.handle,
221
+ ownerUserUids,
217
222
  items: this._data.items
218
223
  ? convertSpaceItemsToModels(this._data.items, this._client).map(item => item.toJSON())
219
224
  : [],
@@ -12,6 +12,11 @@ export interface IRawUsage {
12
12
  resource_given_name?: string;
13
13
  resource_state?: string;
14
14
  pod_resources?: IResources;
15
+ plan?: string;
16
+ usage_period_key?: string;
17
+ usage_period_label?: string;
18
+ usage_period_start?: string;
19
+ usage_period_end?: string;
15
20
  metadata: Map<string, string>;
16
21
  }
17
22
  export declare const asUsage: (u: any) => {
@@ -27,6 +32,11 @@ export declare const asUsage: (u: any) => {
27
32
  endDate: Date | undefined;
28
33
  resourceState: any;
29
34
  resources: any;
35
+ plan: any;
36
+ usagePeriodKey: any;
37
+ usagePeriodLabel: any;
38
+ usagePeriodStart: Date | undefined;
39
+ usagePeriodEnd: Date | undefined;
30
40
  metadata: Map<string, string>;
31
41
  };
32
42
  export interface IUsage {
@@ -42,5 +52,10 @@ export interface IUsage {
42
52
  givenName: string;
43
53
  resourceState: string;
44
54
  resources?: IResources;
55
+ plan?: string;
56
+ usagePeriodKey?: string;
57
+ usagePeriodLabel?: string;
58
+ usagePeriodStart?: Date;
59
+ usagePeriodEnd?: Date;
45
60
  metadata: Map<string, string>;
46
61
  }
@@ -3,6 +3,10 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  export const asUsage = (u) => {
6
+ const usagePeriodKey = u.usage_period_key;
7
+ const usagePeriodLabel = u.usage_period_label;
8
+ const usagePeriodStart = u.usage_period_start;
9
+ const usagePeriodEnd = u.usage_period_end;
6
10
  return {
7
11
  id: u.resource_uid,
8
12
  accountId: u.account_uid ?? '',
@@ -16,6 +20,11 @@ export const asUsage = (u) => {
16
20
  endDate: u.end_date ? new Date(u.end_date) : undefined,
17
21
  resourceState: u.resource_state,
18
22
  resources: u.pod_resources,
23
+ plan: u.plan ?? 'free_plan',
24
+ usagePeriodKey,
25
+ usagePeriodLabel,
26
+ usagePeriodStart: usagePeriodStart ? new Date(usagePeriodStart) : undefined,
27
+ usagePeriodEnd: usagePeriodEnd ? new Date(usagePeriodEnd) : undefined,
19
28
  metadata: new Map(Object.entries(u.metadata ?? {})),
20
29
  };
21
30
  };
@@ -12,6 +12,7 @@ export declare const ANONYMOUS_USER_EXTERNAL_TOKEN: undefined;
12
12
  export declare const getUserRandomColor: () => string;
13
13
  export declare class User implements IUser {
14
14
  id: string;
15
+ uid?: string;
15
16
  handle: string;
16
17
  email: string;
17
18
  firstName: string;
@@ -33,6 +34,7 @@ export declare class User implements IUser {
33
34
  onboarding: IUserOnboarding;
34
35
  linkedContactId?: string;
35
36
  events: Array<IUserEvent>;
37
+ subscription?: IUserSubscription;
36
38
  constructor(u: any);
37
39
  setRoles(roles: string[]): void;
38
40
  }
@@ -56,6 +58,7 @@ export type IBaseUser = {
56
58
  };
57
59
  export type IUser = IBaseUser & {
58
60
  id: string;
61
+ uid?: string;
59
62
  handle: string;
60
63
  credits?: number;
61
64
  creditsCustomerId?: string;
@@ -69,5 +72,23 @@ export type IUser = IBaseUser & {
69
72
  onboarding: IUserOnboarding;
70
73
  linkedContactId?: string;
71
74
  events: Array<IUserEvent>;
75
+ subscription?: IUserSubscription;
76
+ };
77
+ export type IUserSubscription = {
78
+ plan_name?: string;
79
+ plan?: {
80
+ name?: string;
81
+ } | string;
82
+ tier?: string;
83
+ included_runs?: number;
84
+ current_runs?: number;
85
+ used_runs?: number;
86
+ current_credits?: number;
87
+ used_credits?: number;
88
+ usage?: {
89
+ included_runs?: number;
90
+ current_runs?: number;
91
+ current_credits?: number;
92
+ };
72
93
  };
73
94
  export default IUser;
@@ -28,6 +28,7 @@ const USER_COLORS = [
28
28
  export const getUserRandomColor = () => USER_COLORS[Math.floor(Math.random() * USER_COLORS.length)];
29
29
  export class User {
30
30
  id;
31
+ uid;
31
32
  handle;
32
33
  email;
33
34
  firstName;
@@ -49,8 +50,10 @@ export class User {
49
50
  onboarding;
50
51
  linkedContactId;
51
52
  events;
53
+ subscription;
52
54
  constructor(u) {
53
- this.id = u.uid;
55
+ this.id = u.uid || u.id;
56
+ this.uid = u.uid || u.id;
54
57
  this.handle = u.handle_s;
55
58
  this.email = u.email_s;
56
59
  this.firstName = u.first_name_t;
@@ -64,7 +67,7 @@ export class User {
64
67
  this.origin = u.origin_s;
65
68
  this.joinDate = u.join_ts_dt ? new Date(u.join_ts_dt) : undefined;
66
69
  this.credits = u.credits_i ? Number(u.credits_i) : 0;
67
- this.creditsCustomerId = u.credits_customer_uid;
70
+ this.creditsCustomerId = u.stripe_customer_id_s;
68
71
  this.roles = u.roles_ss ?? [];
69
72
  let iamProviders = [];
70
73
  try {
@@ -81,6 +84,7 @@ export class User {
81
84
  ? JSON.parse(u.onboarding_s)
82
85
  : BOOTSTRAP_USER_ONBOARDING;
83
86
  this.linkedContactId = u.linked_contact_uid;
87
+ this.subscription = u.subscription;
84
88
  let events = u.events ?? [];
85
89
  if (!Array.isArray(events)) {
86
90
  events = [events];
@@ -82,8 +82,8 @@ export * from './RolesPlatform';
82
82
  export * from './RolesTeam';
83
83
  export * from './Runtime';
84
84
  export * from './RuntimeDTO';
85
- export * from './RuntimeSnapshot';
86
- export * from './RuntimeSnapshotDTO';
85
+ export * from './CodeSandboxSnapshot';
86
+ export * from './CodeSandboxSnapshotDTO';
87
87
  export * from './School';
88
88
  export * from './Secret';
89
89
  export * from './Space';
@@ -86,8 +86,8 @@ export * from './RolesPlatform.js';
86
86
  export * from './RolesTeam.js';
87
87
  export * from './Runtime.js';
88
88
  export * from './RuntimeDTO.js';
89
- export * from './RuntimeSnapshot.js';
90
- export * from './RuntimeSnapshotDTO.js';
89
+ export * from './CodeSandboxSnapshot.js';
90
+ export * from './CodeSandboxSnapshotDTO.js';
91
91
  export * from './School.js';
92
92
  export * from './Secret.js';
93
93
  export * from './Space.js';
package/lib/otel/auth.js CHANGED
@@ -2,10 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2023-2026 Datalayer, Inc.
7
- * Distributed under the terms of the Modified BSD License.
8
- */
9
5
  import { getDatalayerJwtUser, parseJwtPayload } from '../utils/Jwt.js';
10
6
  function normalizeBaseUrl(baseUrl) {
11
7
  const normalized = baseUrl.startsWith('ws://') || baseUrl.startsWith('wss://')
@@ -1,4 +1,4 @@
1
1
  export { createDatalayerServiceManager } from './DatalayerServiceManager';
2
- export { default as DatalayerServiceManager } from './DatalayerServiceManager';
3
2
  export { reconnectToRuntime } from './reconnectToRuntime';
4
3
  export type { RuntimeInfo } from './reconnectToRuntime';
4
+ export { default as DatalayerServiceManager } from './DatalayerServiceManager';
@@ -3,5 +3,5 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  export { createDatalayerServiceManager } from './DatalayerServiceManager.js';
6
- export { default as DatalayerServiceManager } from './DatalayerServiceManager.js';
7
6
  export { reconnectToRuntime } from './reconnectToRuntime.js';
7
+ export { default as DatalayerServiceManager } from './DatalayerServiceManager.js';
@@ -179,13 +179,6 @@ export const iamStore = createStore((set, get) => {
179
179
  storeUser(user);
180
180
  storeToken(token);
181
181
  set(() => ({ user, token }));
182
- // TODO Centralize User Setting Management.
183
- const aiagentsRunUrl = user.settings?.aiAgentsUrl;
184
- if (aiagentsRunUrl) {
185
- coreStore.getState().setConfiguration({
186
- aiagentsRunUrl,
187
- });
188
- }
189
182
  }
190
183
  catch (error) {
191
184
  if (error.name === 'RunResponseError' &&
@@ -1,6 +1,6 @@
1
1
  import type { IMultiServiceManager } from '../../stateful/runtimes';
2
2
  import type { IRuntimesConfiguration } from '../../config';
3
- import type { IRuntimePod, IRuntimeSnapshot, IRuntimeModel } from '../../models';
3
+ import type { IRuntimePod, ICodeSandboxSnapshot, IRuntimeModel } from '../../models';
4
4
  /**
5
5
  * Datalayer Runtimes state.
6
6
  */
@@ -49,21 +49,21 @@ export type RuntimesState = {
49
49
  showDisclaimer: boolean;
50
50
  setShowDisclaimer: (showDisclaimer: boolean) => void;
51
51
  /**
52
- * Runtime snapshots.
52
+ * Code Sandbox snapshots.
53
53
  */
54
- runtimeSnapshots: readonly IRuntimeSnapshot[];
54
+ runtimeSnapshots: readonly ICodeSandboxSnapshot[];
55
55
  /**
56
- * Add a runtime snapshot.
56
+ * Add a code sandbox snapshot.
57
57
  */
58
- addRuntimeSnapshot: (snapshot: IRuntimeSnapshot) => void;
58
+ addSandboxSnapshot: (snapshot: ICodeSandboxSnapshot) => void;
59
59
  /**
60
- * Remove a Runtime Snapshot.
60
+ * Remove a Code Sandbox Snapshot.
61
61
  */
62
- removeRuntimeSnapshot: (id: string) => void;
62
+ removeSandboxSnapshot: (id: string) => void;
63
63
  /**
64
- * Set Runtime Snapshots.
64
+ * Set Code Sandbox Snapshots.
65
65
  */
66
- setRuntimeSnapshots: (snapshots: IRuntimeSnapshot[]) => void;
66
+ setSandboxSnapshots: (snapshots: ICodeSandboxSnapshot[]) => void;
67
67
  /**
68
68
  * Package version.
69
69
  */
@@ -90,7 +90,7 @@ export const runtimesStore = createStore((set, get) => {
90
90
  /**
91
91
  * Add a Kernel Snapshot
92
92
  */
93
- addRuntimeSnapshot: (snapshot) => {
93
+ addSandboxSnapshot: (snapshot) => {
94
94
  const snapshots = get().runtimeSnapshots;
95
95
  const index = snapshots.findIndex(s => s.id === snapshot.id);
96
96
  if (index < 0) {
@@ -106,7 +106,7 @@ export const runtimesStore = createStore((set, get) => {
106
106
  /**
107
107
  * Remove a Kernel Snapshot.
108
108
  */
109
- removeRuntimeSnapshot: (id) => {
109
+ removeSandboxSnapshot: (id) => {
110
110
  const snapshots = get().runtimeSnapshots;
111
111
  const index = snapshots.findIndex(s => s.id === id);
112
112
  if (index >= 0) {
@@ -118,7 +118,7 @@ export const runtimesStore = createStore((set, get) => {
118
118
  /**
119
119
  * Set Kernel Snapshots.
120
120
  */
121
- setRuntimeSnapshots: (snapshots) => {
121
+ setSandboxSnapshots: (snapshots) => {
122
122
  if (!JSONExt.deepEqual(get().runtimeSnapshots, snapshots)) {
123
123
  set({ runtimeSnapshots: [...snapshots] });
124
124
  }
@@ -1,5 +1,5 @@
1
1
  import { IRuntimeOptions } from '../../api';
2
- import type { IRuntimeSnapshot, IDatalayerEnvironment, IRuntimePod } from '../../models';
2
+ import type { ICodeSandboxSnapshot, IDatalayerEnvironment, IRuntimePod } from '../../models';
3
3
  /**
4
4
  * Get available Environments.
5
5
  */
@@ -45,15 +45,15 @@ export declare function snapshotRuntime(options: {
45
45
  * Whether to stop the runtime after the snapshot completion or not.
46
46
  */
47
47
  stop?: boolean;
48
- }): Promise<IRuntimeSnapshot>;
48
+ }): Promise<ICodeSandboxSnapshot | undefined>;
49
49
  /**
50
- * Get Runtime Snapshots.
50
+ * Get Code Sandbox Snapshots.
51
51
  */
52
- export declare function getRuntimeSnapshots(): Promise<IRuntimeSnapshot[]>;
52
+ export declare function getSandboxSnapshots(): Promise<ICodeSandboxSnapshot[]>;
53
53
  /**
54
- * Load a Runtime Snapshot within a Runtime.
54
+ * Load a Code Sandbox Snapshot within a Runtime.
55
55
  */
56
- export declare function loadRuntimeSnapshot(options: {
56
+ export declare function loadSandboxSnapshot(options: {
57
57
  /**
58
58
  * Runtime ID
59
59
  */
@@ -64,35 +64,35 @@ export declare function loadRuntimeSnapshot(options: {
64
64
  from: string;
65
65
  }): Promise<void>;
66
66
  /**
67
- * Returns the Runtime Snapshot download URL.
67
+ * Returns the Code Sandbox Snapshot download URL.
68
68
  *
69
69
  * @param id Snapshot UID to download
70
70
  * @returns The download URL
71
71
  */
72
- export declare function createRuntimeSnapshotDownloadURL(id: string): string;
72
+ export declare function createSandboxSnapshotDownloadURL(id: string): string;
73
73
  /**
74
- * Export a Runtime Snapshot.
74
+ * Export a Code Sandbox Snapshot.
75
75
  *
76
- * @param id Runtime snapshot UID to download
76
+ * @param id Code Sandbox snapshot UID to download
77
77
  */
78
- export declare function exportRuntimeSnapshot(id: string): void;
78
+ export declare function exportCodeSandboxSnapshot(id: string): void;
79
79
  /**
80
- * Delete a Runtime Snapshot.
80
+ * Delete a Code Sandbox Snapshot.
81
81
  */
82
- export declare function deleteRuntimeSnapshot(id: string): Promise<void>;
82
+ export declare function deleteCodeSandboxSnapshot(id: string): Promise<void>;
83
83
  /**
84
- * Update Runtime Snapshot metadata.
84
+ * Update Code Sandbox Snapshot metadata.
85
85
  */
86
- export declare function updateRuntimeSnapshot(id: string, metadata: {
86
+ export declare function updateCodeSandboxSnapshot(id: string, metadata: {
87
87
  name?: string;
88
88
  description?: string;
89
89
  }): Promise<void>;
90
90
  /**
91
- * Upload a Runtime Snapshot.
91
+ * Upload a Code Sandbox Snapshot.
92
92
  *
93
93
  * Note: The promise will be rejected if the runtime state is empty.
94
94
  */
95
- export declare function uploadRuntimeSnapshot(options: {
95
+ export declare function uploadCodeSandboxSnapshot(options: {
96
96
  file: File | Blob;
97
97
  metadata: {
98
98
  filename: string;