@datalayer/core 0.0.13 → 0.0.15

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 (85) 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/checkout/StripeCheckout.js +19 -23
  33. package/lib/components/context/OrganizationSelect.js +12 -15
  34. package/lib/components/context/SpaceSelect.js +24 -25
  35. package/lib/components/runtimes/RuntimeLauncherDialog.js +2 -2
  36. package/lib/components/runtimes/RuntimePickerCell.js +1 -1
  37. package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
  38. package/lib/components/runtimes/RuntimeTransfer.d.ts +1 -1
  39. package/lib/hooks/useAuthorization.js +4 -2
  40. package/lib/hooks/useCache.d.ts +932 -285
  41. package/lib/hooks/useCache.js +5736 -2767
  42. package/lib/hooks/useCache0.d.ts +312 -0
  43. package/lib/hooks/useCache0.js +3189 -0
  44. package/lib/hooks/useIAM.js +18 -17
  45. package/lib/index.d.ts +1 -2
  46. package/lib/index.js +1 -2
  47. package/lib/{client/models/Credits.d.ts → models/CreditsDTO.d.ts} +38 -5
  48. package/lib/{client/models/Credits.js → models/CreditsDTO.js} +7 -2
  49. package/lib/models/Environment.d.ts +1 -1
  50. package/lib/{client/models/Environment.d.ts → models/EnvironmentDTO.d.ts} +55 -3
  51. package/lib/{client/models/Environment.js → models/EnvironmentDTO.js} +2 -2
  52. package/lib/{client/models → models}/HealthCheck.js +1 -1
  53. package/lib/{api/types/iam.d.ts → models/IAM.d.ts} +1 -87
  54. package/lib/{client/models/Item.d.ts → models/ItemDTO.d.ts} +6 -1
  55. package/lib/{client/models/Item.js → models/ItemDTO.js} +2 -7
  56. package/lib/{client/models/Lexical.d.ts → models/LexicalDTO.d.ts} +79 -7
  57. package/lib/{client/models/Lexical.js → models/LexicalDTO.js} +10 -5
  58. package/lib/{client/models/Notebook.d.ts → models/NotebookDTO.d.ts} +16 -7
  59. package/lib/{client/models/Notebook.js → models/NotebookDTO.js} +5 -5
  60. package/lib/models/Profile.d.ts +65 -0
  61. package/lib/models/Runtime.d.ts +49 -49
  62. package/lib/{client/models/Runtime.d.ts → models/RuntimeDTO.d.ts} +74 -5
  63. package/lib/{client/models/Runtime.js → models/RuntimeDTO.js} +5 -5
  64. package/lib/{client/models/Snapshot.d.ts → models/RuntimeSnapshotDTO.d.ts} +89 -8
  65. package/lib/{client/models/Snapshot.js → models/RuntimeSnapshotDTO.js} +4 -4
  66. package/lib/models/SpaceDTO.d.ts +280 -0
  67. package/lib/{client/models/Space.js → models/SpaceDTO.js} +17 -12
  68. package/lib/{client/models/User.d.ts → models/UserDTO.d.ts} +25 -3
  69. package/lib/{client/models/User.js → models/UserDTO.js} +3 -2
  70. package/lib/models/index.d.ts +45 -4
  71. package/lib/models/index.js +45 -4
  72. package/package.json +2 -1
  73. package/lib/api/types/index.d.ts +0 -34
  74. package/lib/api/types/index.js +0 -38
  75. package/lib/api/types/runtimes.d.ts +0 -205
  76. package/lib/api/types/runtimes.js +0 -5
  77. package/lib/api/types/spacer.d.ts +0 -243
  78. package/lib/api/types/spacer.js +0 -5
  79. package/lib/client/models/Space.d.ts +0 -135
  80. package/lib/client/models/index.d.ts +0 -26
  81. package/lib/client/models/index.js +0 -25
  82. /package/lib/{api/types/common.d.ts → models/Common.d.ts} +0 -0
  83. /package/lib/{api/types/common.js → models/Common.js} +0 -0
  84. /package/lib/{client/models → models}/HealthCheck.d.ts +0 -0
  85. /package/lib/{api/types/iam.js → models/IAM.js} +0 -0
@@ -2,15 +2,20 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as users from '../../api/spacer/users';
6
- import * as items from '../../api/spacer/items';
7
- import * as notebooks from '../../api/spacer/notebooks';
8
- import * as lexicals from '../../api/spacer/lexicals';
9
- import { Notebook } from './Notebook';
10
- import { Lexical } from './Lexical';
11
- import { ItemTypes } from '../constants';
12
- import { convertSpaceItemsToModels } from '../utils/spacerUtils';
13
- import { validateJSON } from '../../api/utils/validation';
5
+ /**
6
+ * Space domain model for the Datalayer SDK.
7
+ *
8
+ * @module models/SpaceDTO
9
+ */
10
+ import * as users from '../api/spacer/users';
11
+ import * as items from '../api/spacer/items';
12
+ import * as notebooks from '../api/spacer/notebooks';
13
+ import * as lexicals from '../api/spacer/lexicals';
14
+ import { NotebookDTO } from './NotebookDTO';
15
+ import { LexicalDTO } from './LexicalDTO';
16
+ import { ItemTypes } from '../client/constants';
17
+ import { convertSpaceItemsToModels } from '../client/utils/spacerUtils';
18
+ import { validateJSON } from '../api/utils/validation';
14
19
  /**
15
20
  * Space domain model that wraps API responses with convenient methods.
16
21
  * Provides workspace management with data refresh and content creation operations.
@@ -22,7 +27,7 @@ import { validateJSON } from '../../api/utils/validation';
22
27
  * const notebook = await space.createNotebook({ name: 'Analysis' });
23
28
  * ```
24
29
  */
25
- export class Space {
30
+ export class SpaceDTO {
26
31
  _data;
27
32
  _sdk;
28
33
  _items = null;
@@ -120,7 +125,7 @@ export class Space {
120
125
  throw new Error('Failed to create notebook: No notebook returned');
121
126
  }
122
127
  else {
123
- return new Notebook(response.notebook, this._sdk);
128
+ return new NotebookDTO(response.notebook, this._sdk);
124
129
  }
125
130
  }
126
131
  else if (data.type === ItemTypes.LEXICAL) {
@@ -136,7 +141,7 @@ export class Space {
136
141
  throw new Error('Failed to create lexical document: No document returned');
137
142
  }
138
143
  else {
139
- return new Lexical(response.document, this._sdk);
144
+ return new LexicalDTO(response.document, this._sdk);
140
145
  }
141
146
  }
142
147
  else {
@@ -1,10 +1,31 @@
1
1
  /**
2
2
  * User model for the Datalayer SDK with rich functionality.
3
3
  *
4
- * @module client/models/User
4
+ * @module models/UserDTO
5
5
  */
6
- import type { User as UserData } from '../../api/types/iam';
7
6
  import type { DatalayerClient } from '../index';
7
+ /**
8
+ * Represents a user in the Datalayer platform
9
+ * @interface UserData
10
+ */
11
+ export interface UserData {
12
+ /** uuid for the user */
13
+ id: string;
14
+ /** ulid for the user */
15
+ uid: string;
16
+ /** User's handle or nickname */
17
+ handle_s: string;
18
+ /** User's email address */
19
+ email_s: string;
20
+ /** User's first name */
21
+ first_name_t: string;
22
+ /** User's last name */
23
+ last_name_t: string;
24
+ /** Display name shown in the UI */
25
+ avatar_url_s: string;
26
+ /** Additional fields that may be present in the response */
27
+ [key: string]: any;
28
+ }
8
29
  export interface UserJSON {
9
30
  /** uuid for the user */
10
31
  id: string;
@@ -27,7 +48,7 @@ export interface UserJSON {
27
48
  * User model representing a Datalayer platform user.
28
49
  * Provides rich functionality for accessing user data and authentication providers.
29
50
  */
30
- export declare class User {
51
+ export declare class UserDTO {
31
52
  protected _data: UserData;
32
53
  /**
33
54
  * Create a User instance.
@@ -62,3 +83,4 @@ export declare class User {
62
83
  /** String representation of the user. */
63
84
  toString(): string;
64
85
  }
86
+ export default UserDTO;
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { validateJSON } from '../../api/utils/validation';
5
+ import { validateJSON } from '../api/utils/validation';
6
6
  /**
7
7
  * User model representing a Datalayer platform user.
8
8
  * Provides rich functionality for accessing user data and authentication providers.
9
9
  */
10
- export class User {
10
+ export class UserDTO {
11
11
  _data;
12
12
  /**
13
13
  * Create a User instance.
@@ -81,3 +81,4 @@ export class User {
81
81
  return `User(${this.uid}, ${this.displayName})`;
82
82
  }
83
83
  }
84
+ export default UserDTO;
@@ -1,9 +1,40 @@
1
+ /**
2
+ * Models definitions for all Datalayer API services.
3
+ *
4
+ * This module consolidates all type definitions used by the SDK, providing
5
+ * comprehensive TypeScript support for requests, responses, and data models
6
+ * across all Datalayer services.
7
+ *
8
+ * These types follow the exact backend API format (snake_case naming) to
9
+ * ensure compatibility. For frontend business logic types with camelCase
10
+ * naming, see the models in `/src/models/`.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import type {
15
+ * Runtime,
16
+ * Environment,
17
+ * Space,
18
+ * Notebook,
19
+ * User,
20
+ * LoginRequest
21
+ * } from '@datalayer/core/api/types';
22
+ *
23
+ * // Use types for function parameters and return values
24
+ * function createRuntime(config: CreateRuntimeRequest): Promise<Runtime> {
25
+ * // Implementation
26
+ * }
27
+ * ```
28
+ *
29
+ * @module models
30
+ */
1
31
  export * from './AIAgent';
2
- export * from './Base';
3
32
  export * from './Assignment';
33
+ export * from './Base';
4
34
  export * from './Cell';
5
35
  export * from './CodeBlock';
6
36
  export * from './CodefeedBlocks';
37
+ export * from './Common';
7
38
  export * from './Contact';
8
39
  export * from './ContactEvent';
9
40
  export * from './ContactIAMProvider';
@@ -11,29 +42,35 @@ export * from './ContactTags';
11
42
  export * from './Content';
12
43
  export * from './Course';
13
44
  export * from './Credits';
14
- export * from './Datasource';
45
+ export * from './CreditsDTO';
15
46
  export * from './Dataset';
47
+ export * from './Datasource';
16
48
  export * from './Dean';
17
49
  export * from './Document';
18
50
  export * from './Environment';
51
+ export * from './EnvironmentDTO';
19
52
  export * from './Errors';
20
53
  export * from './Exercise';
21
54
  export * from './GrowthKPI';
55
+ export * from './IAM';
22
56
  export * from './IAMProviderLinked';
23
57
  export * from './IAMProviderPost';
24
- export * from './IAMProvidersSpecs';
25
58
  export * from './IAMProviderUsers';
26
- export * from './Instructor';
59
+ export * from './IAMProvidersSpecs';
27
60
  export * from './IAMToken';
28
61
  export * from './Inbound';
62
+ export * from './Instructor';
29
63
  export * from './Invite';
30
64
  export * from './Item';
65
+ export * from './ItemDTO';
31
66
  export * from './ItemType';
32
67
  export * from './LandingRoles';
33
68
  export * from './Lesson';
69
+ export * from './LexicalDTO';
34
70
  export * from './Library';
35
71
  export * from './Member';
36
72
  export * from './Notebook';
73
+ export * from './NotebookDTO';
37
74
  export * from './Organization';
38
75
  export * from './OrganizationMember';
39
76
  export * from './Outbound';
@@ -45,10 +82,13 @@ export * from './RolesOrganization';
45
82
  export * from './RolesPlatform';
46
83
  export * from './RolesTeam';
47
84
  export * from './Runtime';
85
+ export * from './RuntimeDTO';
48
86
  export * from './RuntimeSnapshot';
87
+ export * from './RuntimeSnapshotDTO';
49
88
  export * from './School';
50
89
  export * from './Secret';
51
90
  export * from './Space';
91
+ export * from './SpaceDTO';
52
92
  export * from './SpaceItem';
53
93
  export * from './SpaceMember';
54
94
  export * from './Student';
@@ -59,6 +99,7 @@ export * from './TeamMember';
59
99
  export * from './URN';
60
100
  export * from './Usage';
61
101
  export * from './User';
102
+ export * from './UserDTO';
62
103
  export * from './UserEvent';
63
104
  export * from './UserOnboarding';
64
105
  export * from './UserSettings';
@@ -2,12 +2,43 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
+ /**
6
+ * Models definitions for all Datalayer API services.
7
+ *
8
+ * This module consolidates all type definitions used by the SDK, providing
9
+ * comprehensive TypeScript support for requests, responses, and data models
10
+ * across all Datalayer services.
11
+ *
12
+ * These types follow the exact backend API format (snake_case naming) to
13
+ * ensure compatibility. For frontend business logic types with camelCase
14
+ * naming, see the models in `/src/models/`.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import type {
19
+ * Runtime,
20
+ * Environment,
21
+ * Space,
22
+ * Notebook,
23
+ * User,
24
+ * LoginRequest
25
+ * } from '@datalayer/core/api/types';
26
+ *
27
+ * // Use types for function parameters and return values
28
+ * function createRuntime(config: CreateRuntimeRequest): Promise<Runtime> {
29
+ * // Implementation
30
+ * }
31
+ * ```
32
+ *
33
+ * @module models
34
+ */
5
35
  export * from './AIAgent';
6
- export * from './Base';
7
36
  export * from './Assignment';
37
+ export * from './Base';
8
38
  export * from './Cell';
9
39
  export * from './CodeBlock';
10
40
  export * from './CodefeedBlocks';
41
+ export * from './Common';
11
42
  export * from './Contact';
12
43
  export * from './ContactEvent';
13
44
  export * from './ContactIAMProvider';
@@ -15,29 +46,35 @@ export * from './ContactTags';
15
46
  export * from './Content';
16
47
  export * from './Course';
17
48
  export * from './Credits';
18
- export * from './Datasource';
49
+ export * from './CreditsDTO';
19
50
  export * from './Dataset';
51
+ export * from './Datasource';
20
52
  export * from './Dean';
21
53
  export * from './Document';
22
54
  export * from './Environment';
55
+ export * from './EnvironmentDTO';
23
56
  export * from './Errors';
24
57
  export * from './Exercise';
25
58
  export * from './GrowthKPI';
59
+ export * from './IAM';
26
60
  export * from './IAMProviderLinked';
27
61
  export * from './IAMProviderPost';
28
- export * from './IAMProvidersSpecs';
29
62
  export * from './IAMProviderUsers';
30
- export * from './Instructor';
63
+ export * from './IAMProvidersSpecs';
31
64
  export * from './IAMToken';
32
65
  export * from './Inbound';
66
+ export * from './Instructor';
33
67
  export * from './Invite';
34
68
  export * from './Item';
69
+ export * from './ItemDTO';
35
70
  export * from './ItemType';
36
71
  export * from './LandingRoles';
37
72
  export * from './Lesson';
73
+ export * from './LexicalDTO';
38
74
  export * from './Library';
39
75
  export * from './Member';
40
76
  export * from './Notebook';
77
+ export * from './NotebookDTO';
41
78
  export * from './Organization';
42
79
  export * from './OrganizationMember';
43
80
  export * from './Outbound';
@@ -49,10 +86,13 @@ export * from './RolesOrganization';
49
86
  export * from './RolesPlatform';
50
87
  export * from './RolesTeam';
51
88
  export * from './Runtime';
89
+ export * from './RuntimeDTO';
52
90
  export * from './RuntimeSnapshot';
91
+ export * from './RuntimeSnapshotDTO';
53
92
  export * from './School';
54
93
  export * from './Secret';
55
94
  export * from './Space';
95
+ export * from './SpaceDTO';
56
96
  export * from './SpaceItem';
57
97
  export * from './SpaceMember';
58
98
  export * from './Student';
@@ -63,6 +103,7 @@ export * from './TeamMember';
63
103
  export * from './URN';
64
104
  export * from './Usage';
65
105
  export * from './User';
106
+ export * from './UserDTO';
66
107
  export * from './UserEvent';
67
108
  export * from './UserOnboarding';
68
109
  export * from './UserSettings';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/core",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -103,6 +103,7 @@
103
103
  "@primer/react": "^37.19.0",
104
104
  "@primer/react-brand": "^0.58.0",
105
105
  "@stripe/react-stripe-js": "^2.7.1",
106
+ "@tanstack/react-query": "^5.90.6",
106
107
  "axios": "^1.7.7",
107
108
  "boring-avatars": "^2.0.1",
108
109
  "buffer": "^6.0.3",
@@ -1,34 +0,0 @@
1
- /**
2
- * TypeScript type definitions for all Datalayer API services.
3
- *
4
- * This module consolidates all type definitions used by the SDK, providing
5
- * comprehensive TypeScript support for requests, responses, and data models
6
- * across all Datalayer services.
7
- *
8
- * These types follow the exact backend API format (snake_case naming) to
9
- * ensure compatibility. For frontend business logic types with camelCase
10
- * naming, see the models in `/src/models/`.
11
- *
12
- * @example
13
- * ```typescript
14
- * import type {
15
- * Runtime,
16
- * Environment,
17
- * Space,
18
- * Notebook,
19
- * User,
20
- * LoginRequest
21
- * } from '@datalayer/core/api/types';
22
- *
23
- * // Use types for function parameters and return values
24
- * function createRuntime(config: CreateRuntimeRequest): Promise<Runtime> {
25
- * // Implementation
26
- * }
27
- * ```
28
- *
29
- * @module types
30
- */
31
- export * from './common';
32
- export * from './runtimes';
33
- export * from './iam';
34
- export * from './spacer';
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2025 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- /**
6
- * TypeScript type definitions for all Datalayer API services.
7
- *
8
- * This module consolidates all type definitions used by the SDK, providing
9
- * comprehensive TypeScript support for requests, responses, and data models
10
- * across all Datalayer services.
11
- *
12
- * These types follow the exact backend API format (snake_case naming) to
13
- * ensure compatibility. For frontend business logic types with camelCase
14
- * naming, see the models in `/src/models/`.
15
- *
16
- * @example
17
- * ```typescript
18
- * import type {
19
- * Runtime,
20
- * Environment,
21
- * Space,
22
- * Notebook,
23
- * User,
24
- * LoginRequest
25
- * } from '@datalayer/core/api/types';
26
- *
27
- * // Use types for function parameters and return values
28
- * function createRuntime(config: CreateRuntimeRequest): Promise<Runtime> {
29
- * // Implementation
30
- * }
31
- * ```
32
- *
33
- * @module types
34
- */
35
- export * from './common';
36
- export * from './runtimes';
37
- export * from './iam';
38
- export * from './spacer';
@@ -1,205 +0,0 @@
1
- /**
2
- * Represents a computing environment available in the Datalayer platform
3
- * @interface Environment
4
- */
5
- export interface Environment {
6
- /** Human-readable title for the environment */
7
- title: string;
8
- /** Detailed description of the environment */
9
- description: string;
10
- /** Docker image used for this environment */
11
- dockerImage: string;
12
- /** Example usage or description */
13
- example?: string;
14
- /** Code snippets for this environment */
15
- snippets?: any[];
16
- /** Content mounts for this environment */
17
- contents?: any[];
18
- /** Kernel configuration */
19
- kernel?: {
20
- /** Template for kernel naming */
21
- givenNameTemplate?: string;
22
- };
23
- /** Programming language (e.g., "python", "r") */
24
- language: string;
25
- /** Resource ranges configuration */
26
- resourcesRanges?: any;
27
- /** Credits consumed per hour when running */
28
- burning_rate: number;
29
- /** Simple resource specification */
30
- resources?: any;
31
- /** Name identifier for the environment */
32
- name: string;
33
- /** Docker registry for the image */
34
- dockerRegistry?: string;
35
- /** Icon or avatar URL for the environment */
36
- icon?: string;
37
- /** Whether the environment is enabled */
38
- enabled?: boolean;
39
- /** Tags associated with the environment */
40
- tags?: string[];
41
- }
42
- /**
43
- * Represents a running instance of a computing environment
44
- * @interface Runtime
45
- */
46
- export interface Runtime {
47
- /** Kubernetes pod name for the runtime instance */
48
- pod_name: string;
49
- /** Unique identifier for the runtime */
50
- uid: string;
51
- /** Name of the environment this runtime is based on */
52
- environment_name: string;
53
- /** Title of the environment for display */
54
- environment_title: string;
55
- /** Type of runtime - notebook, terminal, or job */
56
- type: string;
57
- /** Credits consumed per second */
58
- burning_rate: number;
59
- /** User-friendly name for the runtime */
60
- given_name: string;
61
- /** Authentication token for accessing the runtime */
62
- token: string;
63
- /** Ingress URL for accessing the runtime */
64
- ingress: string;
65
- /** ISO 8601 timestamp of when the runtime started */
66
- started_at: string;
67
- /** ISO 8601 timestamp of when the runtime will expire */
68
- expired_at: string;
69
- }
70
- /**
71
- * Request payload for creating a new runtime
72
- * @interface CreateRuntimeRequest
73
- */
74
- export interface CreateRuntimeRequest {
75
- /** Name of the environment to use */
76
- environment_name: string;
77
- /** Type of runtime (e.g., 'notebook', 'terminal', 'job') */
78
- type?: 'notebook' | 'terminal' | 'job';
79
- /** Optional given name for the runtime */
80
- given_name?: string;
81
- /** Maximum credits this runtime can consume */
82
- credits_limit?: number;
83
- /** Optional capabilities for the runtime */
84
- capabilities?: string[];
85
- /** Optional source to create runtime from (e.g., snapshot ID) */
86
- from?: string;
87
- }
88
- /**
89
- * Represents a snapshot of a runtime's state and files
90
- * @interface RuntimeSnapshot
91
- */
92
- export interface RuntimeSnapshot {
93
- /** Unique identifier for the snapshot */
94
- uid: string;
95
- /** Name of the snapshot */
96
- name: string;
97
- /** Optional description of the snapshot */
98
- description?: string;
99
- /** Name of the environment used by the runtime */
100
- environment: string;
101
- /** Metadata associated with the snapshot */
102
- metadata?: {
103
- version?: string;
104
- language_info?: any;
105
- [key: string]: any;
106
- };
107
- /** Size of the snapshot in bytes */
108
- size?: number;
109
- /** Format of the snapshot */
110
- format?: string;
111
- /** Format version of the snapshot */
112
- format_version?: string;
113
- /** Status of the snapshot */
114
- status?: string;
115
- /** ISO 8601 timestamp when the snapshot was last updated */
116
- updated_at: string;
117
- /** List of files included in the snapshot */
118
- files?: any[];
119
- }
120
- /**
121
- * Request payload for creating a runtime snapshot
122
- * @interface CreateRuntimeSnapshotRequest
123
- */
124
- export interface CreateRuntimeSnapshotRequest {
125
- /** Pod name of the runtime to snapshot */
126
- pod_name: string;
127
- /** Name for the snapshot */
128
- name: string;
129
- /** Description of the snapshot */
130
- description: string;
131
- /** Whether to stop the runtime after creating snapshot */
132
- stop: boolean;
133
- }
134
- /**
135
- * Response for getting a specific runtime snapshot
136
- * @interface SnapshotGetResponse
137
- */
138
- export interface SnapshotGetResponse {
139
- /** Indicates if the request was successful */
140
- success: boolean;
141
- /** Response message */
142
- message: string;
143
- /** The snapshot details */
144
- snapshot: RuntimeSnapshot;
145
- }
146
- /**
147
- * Response for creating a runtime snapshot
148
- * @interface SnapshotCreateResponse
149
- */
150
- export interface SnapshotCreateResponse {
151
- /** Indicates if the request was successful */
152
- success: boolean;
153
- /** Response message */
154
- message: string;
155
- /** The created snapshot details */
156
- snapshot: RuntimeSnapshot;
157
- }
158
- /**
159
- * Response from listing available environments
160
- * @interface EnvironmentsListResponse
161
- */
162
- export interface EnvironmentsListResponse {
163
- /** Whether the request was successful */
164
- success: boolean;
165
- /** Response message from the server */
166
- message: string;
167
- /** Array of available environments */
168
- environments: Environment[];
169
- }
170
- /**
171
- * Response from creating a new runtime
172
- * @interface RuntimeCreateResponse
173
- */
174
- export interface CreateRuntimeResponse {
175
- /** Whether the request was successful */
176
- success: boolean;
177
- /** Response message from the server */
178
- message: string;
179
- /** The created runtime instance */
180
- runtime: Runtime;
181
- }
182
- /**
183
- * Response from listing runtimes
184
- * @interface RuntimesListResponse
185
- */
186
- export interface RuntimesListResponse {
187
- /** Whether the request was successful */
188
- success: boolean;
189
- /** Response message from the server */
190
- message: string;
191
- /** Array of runtime instances */
192
- runtimes: Runtime[];
193
- }
194
- /**
195
- * Response from listing runtime snapshots
196
- * @interface RuntimeSnapshotsListResponse
197
- */
198
- export interface SnapshotsListResponse {
199
- /** Whether the request was successful */
200
- success: boolean;
201
- /** Response message from the server */
202
- message: string;
203
- /** Array of runtime snapshots */
204
- snapshots: RuntimeSnapshot[];
205
- }
@@ -1,5 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2025 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- export {};