@datalayer/core 0.0.13 → 0.0.14

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 (75) hide show
  1. package/lib/api/DatalayerApi.js +17 -5
  2. package/lib/api/iam/authentication.d.ts +1 -1
  3. package/lib/api/iam/healthz.d.ts +1 -1
  4. package/lib/api/iam/index.d.ts +1 -1
  5. package/lib/api/iam/index.js +1 -1
  6. package/lib/api/iam/profile.d.ts +1 -1
  7. package/lib/api/iam/usage.d.ts +1 -39
  8. package/lib/api/index.d.ts +0 -1
  9. package/lib/api/index.js +0 -2
  10. package/lib/api/runtimes/environments.d.ts +2 -2
  11. package/lib/api/runtimes/healthz.d.ts +1 -1
  12. package/lib/api/runtimes/runtimes.d.ts +4 -4
  13. package/lib/api/runtimes/snapshots.d.ts +4 -4
  14. package/lib/api/spacer/documents.d.ts +1 -1
  15. package/lib/api/spacer/healthz.d.ts +1 -1
  16. package/lib/api/spacer/items.d.ts +1 -1
  17. package/lib/api/spacer/lexicals.d.ts +1 -1
  18. package/lib/api/spacer/notebooks.d.ts +1 -1
  19. package/lib/api/spacer/spaces.d.ts +1 -1
  20. package/lib/api/spacer/users.d.ts +1 -1
  21. package/lib/client/base.d.ts +2 -2
  22. package/lib/client/index.d.ts +44 -44
  23. package/lib/client/index.js +10 -10
  24. package/lib/client/mixins/IAMMixin.d.ts +7 -7
  25. package/lib/client/mixins/IAMMixin.js +5 -5
  26. package/lib/client/mixins/RuntimesMixin.d.ts +13 -13
  27. package/lib/client/mixins/RuntimesMixin.js +11 -11
  28. package/lib/client/mixins/SpacerMixin.d.ts +14 -14
  29. package/lib/client/mixins/SpacerMixin.js +12 -12
  30. package/lib/client/utils/spacerUtils.d.ts +4 -4
  31. package/lib/client/utils/spacerUtils.js +4 -4
  32. package/lib/components/runtimes/RuntimeLauncherDialog.js +2 -2
  33. package/lib/components/runtimes/RuntimePickerCell.js +1 -1
  34. package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
  35. package/lib/components/runtimes/RuntimeTransfer.d.ts +1 -1
  36. package/lib/index.d.ts +1 -2
  37. package/lib/index.js +1 -2
  38. package/lib/{client/models/Credits.d.ts → models/CreditsDTO.d.ts} +38 -5
  39. package/lib/{client/models/Credits.js → models/CreditsDTO.js} +7 -2
  40. package/lib/models/Environment.d.ts +1 -1
  41. package/lib/{client/models/Environment.d.ts → models/EnvironmentDTO.d.ts} +55 -3
  42. package/lib/{client/models/Environment.js → models/EnvironmentDTO.js} +2 -2
  43. package/lib/{client/models → models}/HealthCheck.js +1 -1
  44. package/lib/{api/types/iam.d.ts → models/IAM.d.ts} +1 -87
  45. package/lib/{client/models/Item.d.ts → models/ItemDTO.d.ts} +6 -1
  46. package/lib/{client/models/Item.js → models/ItemDTO.js} +2 -7
  47. package/lib/{client/models/Lexical.d.ts → models/LexicalDTO.d.ts} +79 -7
  48. package/lib/{client/models/Lexical.js → models/LexicalDTO.js} +10 -5
  49. package/lib/{client/models/Notebook.d.ts → models/NotebookDTO.d.ts} +16 -7
  50. package/lib/{client/models/Notebook.js → models/NotebookDTO.js} +5 -5
  51. package/lib/models/Profile.d.ts +65 -0
  52. package/lib/{client/models/Runtime.d.ts → models/RuntimeDTO.d.ts} +74 -5
  53. package/lib/{client/models/Runtime.js → models/RuntimeDTO.js} +5 -5
  54. package/lib/{client/models/Snapshot.d.ts → models/RuntimeSnapshotDTO.d.ts} +89 -8
  55. package/lib/{client/models/Snapshot.js → models/RuntimeSnapshotDTO.js} +4 -4
  56. package/lib/models/SpaceDTO.d.ts +280 -0
  57. package/lib/{client/models/Space.js → models/SpaceDTO.js} +17 -12
  58. package/lib/{client/models/User.d.ts → models/UserDTO.d.ts} +25 -3
  59. package/lib/{client/models/User.js → models/UserDTO.js} +3 -2
  60. package/lib/models/index.d.ts +45 -4
  61. package/lib/models/index.js +45 -4
  62. package/package.json +2 -1
  63. package/lib/api/types/index.d.ts +0 -34
  64. package/lib/api/types/index.js +0 -38
  65. package/lib/api/types/runtimes.d.ts +0 -205
  66. package/lib/api/types/runtimes.js +0 -5
  67. package/lib/api/types/spacer.d.ts +0 -243
  68. package/lib/api/types/spacer.js +0 -5
  69. package/lib/client/models/Space.d.ts +0 -135
  70. package/lib/client/models/index.d.ts +0 -26
  71. package/lib/client/models/index.js +0 -25
  72. /package/lib/{api/types/common.d.ts → models/Common.d.ts} +0 -0
  73. /package/lib/{api/types/common.js → models/Common.js} +0 -0
  74. /package/lib/{client/models → models}/HealthCheck.d.ts +0 -0
  75. /package/lib/{api/types/iam.js → models/IAM.js} +0 -0
@@ -1,89 +1,4 @@
1
- /**
2
- * Represents a user in the Datalayer platform
3
- * @interface User
4
- */
5
- export interface User {
6
- /** uuid for the user */
7
- id: string;
8
- /** ulid for the user */
9
- uid: string;
10
- /** User's handle or nickname */
11
- handle_s: string;
12
- /** User's email address */
13
- email_s: string;
14
- /** User's first name */
15
- first_name_t: string;
16
- /** User's last name */
17
- last_name_t: string;
18
- /** Display name shown in the UI */
19
- avatar_url_s: string;
20
- /** Additional fields that may be present in the response */
21
- [key: string]: any;
22
- }
23
- /**
24
- * Represents a user profile in the Datalayer platform
25
- * @interface Profile
26
- */
27
- interface Profile {
28
- /** ISO 8601 timestamp of when the user was created */
29
- creation_ts_dt: string;
30
- /** Unique identifier for the user */
31
- id: string;
32
- /** ISO 8601 timestamp of when the user requested to join */
33
- join_request_ts_dt: string | null;
34
- /** ISO 8601 timestamp of when the user joined */
35
- join_ts_dt: string;
36
- /** ISO 8601 timestamp of last update */
37
- last_update_ts_dt: string;
38
- /** Origin of the user account */
39
- origin_s: string;
40
- /** Type of the record */
41
- type_s: string;
42
- /** User ID */
43
- uid: string;
44
- /** Email address */
45
- email_s: string;
46
- /** First name */
47
- first_name_t: string;
48
- /** User handle */
49
- handle_s: string;
50
- /** Last name */
51
- last_name_t: string;
52
- /** User roles array */
53
- roles_ss?: string[];
54
- /** Avatar URL */
55
- avatar_url_s?: string;
56
- /** Onboarding state as JSON string */
57
- onboarding_s?: string;
58
- /** New password request timestamp */
59
- new_password_request_ts_dt?: string | null;
60
- /** New password confirmation timestamp */
61
- new_password_confirmation_ts_dt?: string | null;
62
- /** Customer UID */
63
- customer_uid?: string | null;
64
- /** Credits customer UID for billing */
65
- credits_customer_uid?: string | null;
66
- /** Email unsubscription status */
67
- unsubscribed_from_outbounds_b?: boolean;
68
- /** Linked contact UID */
69
- linked_contact_uid?: string | null;
70
- /** MFA URL */
71
- mfa_url_s?: string | null;
72
- /** MFA secret */
73
- mfa_secret_s?: string | null;
74
- /** Email verification token */
75
- email_token_s?: string | null;
76
- /** Pending email update */
77
- email_update_s?: string | null;
78
- /** IAM providers (nested structure - not typed in detail) */
79
- iam_providers?: any[];
80
- /** User settings (nested structure - not typed in detail) */
81
- settings?: any;
82
- /** User events (nested structure - not typed in detail) */
83
- events?: any[];
84
- /** Allow additional fields that may come from the server */
85
- [key: string]: any;
86
- }
1
+ import { Profile } from './Profile';
87
2
  /**
88
3
  * Request payload for user login
89
4
  * @interface LoginRequest
@@ -200,4 +115,3 @@ export interface MembershipsResponse {
200
115
  /** Memberships information */
201
116
  memberships: any[];
202
117
  }
203
- export {};
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Abstract base class for all Datalayer content items.
3
+ *
4
+ * @module models/ItemDTO
5
+ */
1
6
  import type { DatalayerClient } from '../index';
2
7
  /**
3
8
  * Abstract base class for all Datalayer content items.
@@ -6,7 +11,7 @@ import type { DatalayerClient } from '../index';
6
11
  * @template TData - Raw data type from API
7
12
  * @template TUpdateRequest - Update request type for API
8
13
  */
9
- export declare abstract class Item<TData> {
14
+ export declare abstract class ItemDTO<TData> {
10
15
  protected _data: TData;
11
16
  private _sdk;
12
17
  private _deleted;
@@ -2,12 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /**
6
- * Abstract base class for all Datalayer content items.
7
- *
8
- * @module client/models/Item
9
- */
10
- import * as items from '../../api/spacer/items';
5
+ import * as items from '../api/spacer/items';
11
6
  /**
12
7
  * Abstract base class for all Datalayer content items.
13
8
  * Provides common functionality for content management including lifecycle tracking.
@@ -15,7 +10,7 @@ import * as items from '../../api/spacer/items';
15
10
  * @template TData - Raw data type from API
16
11
  * @template TUpdateRequest - Update request type for API
17
12
  */
18
- export class Item {
13
+ export class ItemDTO {
19
14
  _data;
20
15
  _sdk;
21
16
  _deleted = false;
@@ -1,11 +1,83 @@
1
+ import type { DatalayerClient } from '../index';
2
+ import { ItemDTO } from './ItemDTO';
1
3
  /**
2
- * Lexical domain model for the Datalayer SDK.
3
- *
4
- * @module client/models/Lexical
4
+ * Represents a Lexical document (rich text editor)
5
+ * @interface Lexical
5
6
  */
6
- import type { Lexical as LexicalData } from '../../api/types/spacer';
7
- import type { DatalayerClient } from '../index';
8
- import { Item } from './Item';
7
+ export interface LexicalData {
8
+ id: string;
9
+ uid: string;
10
+ name?: string;
11
+ name_t?: string;
12
+ content?: any;
13
+ space_id?: string;
14
+ owner_id?: string;
15
+ creator_uid?: string;
16
+ creator_handle_s?: string;
17
+ created_at?: string;
18
+ creation_ts_dt?: string;
19
+ updated_at?: string;
20
+ last_update_ts_dt?: string;
21
+ cdn_url_s: string;
22
+ type_s?: string;
23
+ public_b?: boolean;
24
+ description_t?: string;
25
+ document_name_s?: string;
26
+ document_extension_s: string;
27
+ document_format_s?: string;
28
+ content_length_i?: number;
29
+ content_type_s?: string;
30
+ mime_type_s?: string;
31
+ s3_path_s?: string;
32
+ s3_url_s?: string;
33
+ model_s?: string;
34
+ }
35
+ /**
36
+ * Request payload for creating a Lexical document
37
+ * @interface CreateLexicalRequest
38
+ */
39
+ export interface CreateLexicalRequest {
40
+ spaceId: string;
41
+ documentType: string;
42
+ name: string;
43
+ description: string;
44
+ file?: File | Blob;
45
+ }
46
+ /**
47
+ * Response from creating a Lexical document
48
+ * @interface CreateLexicalResponse
49
+ */
50
+ export interface CreateLexicalResponse {
51
+ success: boolean;
52
+ message: string;
53
+ document?: LexicalData;
54
+ }
55
+ /**
56
+ * Response from getting a Lexical document
57
+ * @interface GetLexicalResponse
58
+ */
59
+ export interface GetLexicalResponse {
60
+ success: boolean;
61
+ message: string;
62
+ document?: LexicalData;
63
+ }
64
+ /**
65
+ * Request payload for updating a Lexical document
66
+ * @interface UpdateLexicalRequest
67
+ */
68
+ export interface UpdateLexicalRequest {
69
+ name?: string;
70
+ description?: string;
71
+ }
72
+ /**
73
+ * Response from updating a Lexical document
74
+ * @interface UpdateLexicalResponse
75
+ */
76
+ export interface UpdateLexicalResponse {
77
+ success: boolean;
78
+ message: string;
79
+ document: LexicalData;
80
+ }
9
81
  /**
10
82
  * Stable public interface for Lexical data.
11
83
  * This is the contract that SDK consumers can rely on.
@@ -41,7 +113,7 @@ export interface LexicalJSON {
41
113
  * await lexical.update({ name: 'Updated Documentation' });
42
114
  * ```
43
115
  */
44
- export declare class Lexical extends Item<LexicalData> {
116
+ export declare class LexicalDTO extends ItemDTO<LexicalData> {
45
117
  /**
46
118
  * Create a Lexical instance.
47
119
  *
@@ -2,10 +2,15 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as lexicals from '../../api/spacer/lexicals';
6
- import { Item } from './Item';
7
- import { ItemTypes } from '../constants';
8
- import { validateJSON } from '../../api/utils/validation';
5
+ /**
6
+ * Lexical domain model for the Datalayer SDK.
7
+ *
8
+ * @module models/LexicalDTO
9
+ */
10
+ import * as lexicals from '../api/spacer/lexicals';
11
+ import { ItemTypes } from '../client';
12
+ import { ItemDTO } from './ItemDTO';
13
+ import { validateJSON } from '../api/utils/validation';
9
14
  /**
10
15
  * Lexical domain model that extends the base Item class.
11
16
  * Provides lexical document functionality for managing rich text documents.
@@ -16,7 +21,7 @@ import { validateJSON } from '../../api/utils/validation';
16
21
  * await lexical.update({ name: 'Updated Documentation' });
17
22
  * ```
18
23
  */
19
- export class Lexical extends Item {
24
+ export class LexicalDTO extends ItemDTO {
20
25
  /**
21
26
  * Create a Lexical instance.
22
27
  *
@@ -1,11 +1,20 @@
1
+ import type { DatalayerClient } from '../index';
2
+ import { ItemDTO } from './ItemDTO';
1
3
  /**
2
- * Notebook domain model for the Datalayer SDK.
3
- *
4
- * @module client/models/Notebook
4
+ * Represents a Jupyter notebook document
5
+ * @interface NotebookData
5
6
  */
6
- import type { Notebook as NotebookData } from '../../api/types/spacer';
7
- import type { DatalayerClient } from '../index';
8
- import { Item } from './Item';
7
+ export interface NotebookData {
8
+ id: string;
9
+ uid: string;
10
+ name_t: string;
11
+ description_t: string;
12
+ type_s: string;
13
+ notebook_extension_s: string;
14
+ s3_path_s: string;
15
+ s3_url_s: string;
16
+ cdn_url_s: string;
17
+ }
9
18
  /**
10
19
  * Stable public interface for Notebook data.
11
20
  * This is the contract that SDK consumers can rely on.
@@ -37,7 +46,7 @@ export interface NotebookJSON {
37
46
  * const kernelSpec = await notebook.getKernelSpec();
38
47
  * ```
39
48
  */
40
- export declare class Notebook extends Item<NotebookData> {
49
+ export declare class NotebookDTO extends ItemDTO<NotebookData> {
41
50
  /**
42
51
  * Create a Notebook instance.
43
52
  *
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as notebooks from '../../api/spacer/notebooks';
6
- import { Item } from './Item';
7
- import { ItemTypes } from '../constants';
8
- import { validateJSON } from '../../api/utils/validation';
5
+ import * as notebooks from '../api/spacer/notebooks';
6
+ import { ItemDTO } from './ItemDTO';
7
+ import { ItemTypes } from '../client/constants';
8
+ import { validateJSON } from '../api/utils/validation';
9
9
  /**
10
10
  * Notebook domain model that extends the base Item class.
11
11
  * Provides notebook-specific functionality for managing Jupyter notebooks.
@@ -16,7 +16,7 @@ import { validateJSON } from '../../api/utils/validation';
16
16
  * const kernelSpec = await notebook.getKernelSpec();
17
17
  * ```
18
18
  */
19
- export class Notebook extends Item {
19
+ export class NotebookDTO extends ItemDTO {
20
20
  /**
21
21
  * Create a Notebook instance.
22
22
  *
@@ -1 +1,66 @@
1
1
  export type IProfileType = 'user' | 'organization' | undefined;
2
+ /**
3
+ * Represents a user profile in the Datalayer platform
4
+ * @interface Profile
5
+ */
6
+ export interface Profile {
7
+ /** ISO 8601 timestamp of when the user was created */
8
+ creation_ts_dt: string;
9
+ /** Unique identifier for the user */
10
+ id: string;
11
+ /** ISO 8601 timestamp of when the user requested to join */
12
+ join_request_ts_dt: string | null;
13
+ /** ISO 8601 timestamp of when the user joined */
14
+ join_ts_dt: string;
15
+ /** ISO 8601 timestamp of last update */
16
+ last_update_ts_dt: string;
17
+ /** Origin of the user account */
18
+ origin_s: string;
19
+ /** Type of the record */
20
+ type_s: string;
21
+ /** User ID */
22
+ uid: string;
23
+ /** Email address */
24
+ email_s: string;
25
+ /** First name */
26
+ first_name_t: string;
27
+ /** User handle */
28
+ handle_s: string;
29
+ /** Last name */
30
+ last_name_t: string;
31
+ /** User roles array */
32
+ roles_ss?: string[];
33
+ /** Avatar URL */
34
+ avatar_url_s?: string;
35
+ /** Onboarding state as JSON string */
36
+ onboarding_s?: string;
37
+ /** New password request timestamp */
38
+ new_password_request_ts_dt?: string | null;
39
+ /** New password confirmation timestamp */
40
+ new_password_confirmation_ts_dt?: string | null;
41
+ /** Customer UID */
42
+ customer_uid?: string | null;
43
+ /** Credits customer UID for billing */
44
+ credits_customer_uid?: string | null;
45
+ /** Email unsubscription status */
46
+ unsubscribed_from_outbounds_b?: boolean;
47
+ /** Linked contact UID */
48
+ linked_contact_uid?: string | null;
49
+ /** MFA URL */
50
+ mfa_url_s?: string | null;
51
+ /** MFA secret */
52
+ mfa_secret_s?: string | null;
53
+ /** Email verification token */
54
+ email_token_s?: string | null;
55
+ /** Pending email update */
56
+ email_update_s?: string | null;
57
+ /** IAM providers (nested structure - not typed in detail) */
58
+ iam_providers?: any[];
59
+ /** User settings (nested structure - not typed in detail) */
60
+ settings?: any;
61
+ /** User events (nested structure - not typed in detail) */
62
+ events?: any[];
63
+ /** Allow additional fields that may come from the server */
64
+ [key: string]: any;
65
+ }
66
+ export default Profile;
@@ -1,6 +1,33 @@
1
- import type { Runtime as RuntimeData } from '../../api/types/runtimes';
2
1
  import type { DatalayerClient } from '../index';
3
- import { Snapshot } from './Snapshot';
2
+ import { RuntimeSnapshotDTO } from './RuntimeSnapshotDTO';
3
+ /**
4
+ * Represents a running instance of a computing environment.
5
+ * @interface RuntimeData
6
+ */
7
+ export interface RuntimeData {
8
+ /** Kubernetes pod name for the runtime instance */
9
+ pod_name: string;
10
+ /** Unique identifier for the runtime */
11
+ uid: string;
12
+ /** Name of the environment this runtime is based on */
13
+ environment_name: string;
14
+ /** Title of the environment for display */
15
+ environment_title: string;
16
+ /** Type of runtime - notebook, terminal, or job */
17
+ type: string;
18
+ /** Credits consumed per second */
19
+ burning_rate: number;
20
+ /** User-friendly name for the runtime */
21
+ given_name: string;
22
+ /** Authentication token for accessing the runtime */
23
+ token: string;
24
+ /** Ingress URL for accessing the runtime */
25
+ ingress: string;
26
+ /** ISO 8601 timestamp of when the runtime started */
27
+ started_at: string;
28
+ /** ISO 8601 timestamp of when the runtime will expire */
29
+ expired_at: string;
30
+ }
4
31
  /**
5
32
  * Stable public interface for Runtime data.
6
33
  * This is the contract that SDK consumers can rely on.
@@ -30,6 +57,48 @@ export interface RuntimeJSON {
30
57
  /** When the runtime will expire */
31
58
  expiredAt: string;
32
59
  }
60
+ /**
61
+ * Request payload for creating a new runtime
62
+ * @interface CreateRuntimeRequest
63
+ */
64
+ export interface CreateRuntimeRequest {
65
+ /** Name of the environment to use */
66
+ environment_name: string;
67
+ /** Type of runtime (e.g., 'notebook', 'terminal', 'job') */
68
+ type?: 'notebook' | 'terminal' | 'job';
69
+ /** Optional given name for the runtime */
70
+ given_name?: string;
71
+ /** Maximum credits this runtime can consume */
72
+ credits_limit?: number;
73
+ /** Optional capabilities for the runtime */
74
+ capabilities?: string[];
75
+ /** Optional source to create runtime from (e.g., snapshot ID) */
76
+ from?: string;
77
+ }
78
+ /**
79
+ * Response from creating a new runtime
80
+ * @interface CreateRuntimeResponse
81
+ */
82
+ export interface CreateRuntimeResponse {
83
+ /** Whether the request was successful */
84
+ success: boolean;
85
+ /** Response message from the server */
86
+ message: string;
87
+ /** The created runtime instance */
88
+ runtime: RuntimeData;
89
+ }
90
+ /**
91
+ * Response from listing runtimes
92
+ * @interface ListRuntimesResponse
93
+ */
94
+ export interface ListRuntimesResponse {
95
+ /** Whether the request was successful */
96
+ success: boolean;
97
+ /** Response message from the server */
98
+ message: string;
99
+ /** Array of runtime instances */
100
+ runtimes: RuntimeData[];
101
+ }
33
102
  /**
34
103
  * Runtime domain model that wraps API responses with convenient methods.
35
104
  * Provides state management and lifecycle operations for computational runtimes.
@@ -40,7 +109,7 @@ export interface RuntimeJSON {
40
109
  * await runtime.waitUntilReady();
41
110
  * ```
42
111
  */
43
- export declare class Runtime {
112
+ export declare class RuntimeDTO {
44
113
  /** @internal */
45
114
  _data: RuntimeData;
46
115
  private _sdk;
@@ -90,7 +159,7 @@ export declare class Runtime {
90
159
  * @param from - Snapshot identifier to restore from
91
160
  * @returns Updated Runtime instance
92
161
  */
93
- update(from: string): Promise<Runtime>;
162
+ update(from: string): Promise<RuntimeDTO>;
94
163
  /**
95
164
  * Create a snapshot of this runtime.
96
165
  *
@@ -99,7 +168,7 @@ export declare class Runtime {
99
168
  * @param stop - Whether to stop runtime after snapshotting
100
169
  * @returns Created Snapshot instance
101
170
  */
102
- createSnapshot(name: string, description?: string, stop?: boolean): Promise<Snapshot>;
171
+ createSnapshot(name: string, description?: string, stop?: boolean): Promise<RuntimeSnapshotDTO>;
103
172
  /**
104
173
  * Get runtime data in camelCase format.
105
174
  * Returns only the core fields that consumers need.
@@ -5,10 +5,10 @@
5
5
  /**
6
6
  * Runtime domain model for the Datalayer SDK.
7
7
  *
8
- * @module client/models/Runtime
8
+ * @module models/RuntimeDTO
9
9
  */
10
- import { updateRuntime } from '../../api/runtimes/runtimes';
11
- import { validateJSON } from '../../api/utils/validation';
10
+ import { updateRuntime } from '../api/runtimes/runtimes';
11
+ import { validateJSON } from '../api/utils/validation';
12
12
  /**
13
13
  * Runtime domain model that wraps API responses with convenient methods.
14
14
  * Provides state management and lifecycle operations for computational runtimes.
@@ -19,7 +19,7 @@ import { validateJSON } from '../../api/utils/validation';
19
19
  * await runtime.waitUntilReady();
20
20
  * ```
21
21
  */
22
- export class Runtime {
22
+ export class RuntimeDTO {
23
23
  /** @internal */
24
24
  _data;
25
25
  _sdk;
@@ -124,7 +124,7 @@ export class Runtime {
124
124
  async update(from) {
125
125
  this._checkDeleted();
126
126
  const updated = await updateRuntime(this._sdk.getToken(), this.podName, from, this._sdk.getRuntimesRunUrl());
127
- return new Runtime(updated, this._sdk);
127
+ return new RuntimeDTO(updated, this._sdk);
128
128
  }
129
129
  /**
130
130
  * Create a snapshot of this runtime.
@@ -1,17 +1,48 @@
1
1
  /**
2
2
  * Snapshot domain model for the Datalayer SDK.
3
3
  *
4
- * @module client/models/Snapshot
4
+ * @module models/RuntimeSnapshotDTO
5
5
  */
6
- import type { RuntimeSnapshot as RuntimeSnapshotData } from '../../api/types/runtimes';
7
6
  import type { DatalayerClient } from '../index';
8
- import { Runtime } from './Runtime';
7
+ import { RuntimeDTO } from './RuntimeDTO';
8
+ /**
9
+ * Represents a runthime snapshot of a runtime's state and files.
10
+ * @interface RuntimeSnapshotData
11
+ */
12
+ export interface RuntimeSnapshotData {
13
+ /** Unique identifier for the snapshot */
14
+ uid: string;
15
+ /** Name of the snapshot */
16
+ name: string;
17
+ /** Optional description of the snapshot */
18
+ description?: string;
19
+ /** Name of the environment used by the runtime */
20
+ environment: string;
21
+ /** Metadata associated with the snapshot */
22
+ metadata?: {
23
+ version?: string;
24
+ language_info?: any;
25
+ [key: string]: any;
26
+ };
27
+ /** Size of the snapshot in bytes */
28
+ size?: number;
29
+ /** Format of the snapshot */
30
+ format?: string;
31
+ /** Format version of the snapshot */
32
+ format_version?: string;
33
+ /** Status of the snapshot */
34
+ status?: string;
35
+ /** ISO 8601 timestamp when the snapshot was last updated */
36
+ updated_at: string;
37
+ /** List of files included in the snapshot */
38
+ files?: any[];
39
+ }
9
40
  /**
10
41
  * Stable public interface for Snapshot data.
11
42
  * This is the contract that SDK consumers can rely on.
12
43
  * The raw API may change, but this interface remains stable.
13
44
  */
14
- export interface SnapshotJSON {
45
+ export interface RuntimeSnapshotJSON {
15
46
  /** Unique identifier for the snapshot */
16
47
  uid: string;
17
48
  /** Name of the snapshot */
@@ -23,6 +54,56 @@ export interface SnapshotJSON {
23
54
  /** ISO 8601 timestamp when the snapshot was last updated */
24
55
  updatedAt: string;
25
56
  }
57
+ /**
58
+ * Request payload for creating a runtime snapshot
59
+ * @interface CreateRuntimeSnapshotRequest
60
+ */
61
+ export interface CreateRuntimeSnapshotRequest {
62
+ /** Pod name of the runtime to snapshot */
63
+ pod_name: string;
64
+ /** Name for the snapshot */
65
+ name: string;
66
+ /** Description of the snapshot */
67
+ description: string;
68
+ /** Whether to stop the runtime after creating snapshot */
69
+ stop: boolean;
70
+ }
71
+ /**
72
+ * Response for getting a specific runtime snapshot
73
+ * @interface GetRuntimeSnapshotResponse
74
+ */
75
+ export interface GetRuntimeSnapshotResponse {
76
+ /** Indicates if the request was successful */
77
+ success: boolean;
78
+ /** Response message */
79
+ message: string;
80
+ /** The snapshot details */
81
+ snapshot: RuntimeSnapshotData;
82
+ }
83
+ /**
84
+ * Response for creating a runtime snapshot
85
+ * @interface CreateRuntimeSnapshotResponse
86
+ */
87
+ export interface CreateRuntimeSnapshotResponse {
88
+ /** Indicates if the request was successful */
89
+ success: boolean;
90
+ /** Response message */
91
+ message: string;
92
+ /** The created snapshot details */
93
+ snapshot: RuntimeSnapshotData;
94
+ }
95
+ /**
96
+ * Response from listing runtime snapshots
97
+ * @interface RuntimeSnapshotsListResponse
98
+ */
99
+ export interface ListRuntimeSnapshotsResponse {
100
+ /** Whether the request was successful */
101
+ success: boolean;
102
+ /** Response message from the server */
103
+ message: string;
104
+ /** Array of runtime snapshots */
105
+ snapshots: RuntimeSnapshotData[];
106
+ }
26
107
  /**
27
108
  * Snapshot domain model that wraps API responses with convenient methods.
28
109
  * Provides runtime snapshot management with data refresh and lifecycle operations.
@@ -33,12 +114,12 @@ export interface SnapshotJSON {
33
114
  * const runtime = await snapshot.restore();
34
115
  * ```
35
116
  */
36
- export declare class Snapshot {
117
+ export declare class RuntimeSnapshotDTO {
37
118
  protected _data: RuntimeSnapshotData;
38
119
  private _sdk;
39
120
  private _deleted;
40
121
  /**
41
- * Create a Snapshot instance.
122
+ * Create a Runtime Snapshot instance.
42
123
  *
43
124
  * @param data - Snapshot data from API
44
125
  * @param sdk - SDK instance
@@ -70,7 +151,7 @@ export declare class Snapshot {
70
151
  * @param config - Optional runtime configuration to override defaults
71
152
  * @returns Created Runtime instance
72
153
  */
73
- restore(minutesLimit: number): Promise<Runtime>;
154
+ restore(minutesLimit: number): Promise<RuntimeDTO>;
74
155
  /**
75
156
  * Get snapshot data in camelCase format.
76
157
  * Returns only the core fields that consumers need.
@@ -79,7 +160,7 @@ export declare class Snapshot {
79
160
  *
80
161
  * @returns Core snapshot data with camelCase properties
81
162
  */
82
- toJSON(): SnapshotJSON;
163
+ toJSON(): RuntimeSnapshotJSON;
83
164
  /**
84
165
  * Get the raw snapshot data exactly as received from the API.
85
166
  * This preserves the original snake_case naming from the API response.