@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.
- package/lib/api/DatalayerApi.js +17 -5
- package/lib/api/iam/authentication.d.ts +1 -1
- package/lib/api/iam/healthz.d.ts +1 -1
- package/lib/api/iam/index.d.ts +1 -1
- package/lib/api/iam/index.js +1 -1
- package/lib/api/iam/profile.d.ts +1 -1
- package/lib/api/iam/usage.d.ts +1 -39
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +0 -2
- package/lib/api/runtimes/environments.d.ts +2 -2
- package/lib/api/runtimes/healthz.d.ts +1 -1
- package/lib/api/runtimes/runtimes.d.ts +4 -4
- package/lib/api/runtimes/snapshots.d.ts +4 -4
- package/lib/api/spacer/documents.d.ts +1 -1
- package/lib/api/spacer/healthz.d.ts +1 -1
- package/lib/api/spacer/items.d.ts +1 -1
- package/lib/api/spacer/lexicals.d.ts +1 -1
- package/lib/api/spacer/notebooks.d.ts +1 -1
- package/lib/api/spacer/spaces.d.ts +1 -1
- package/lib/api/spacer/users.d.ts +1 -1
- package/lib/client/base.d.ts +2 -2
- package/lib/client/index.d.ts +44 -44
- package/lib/client/index.js +10 -10
- package/lib/client/mixins/IAMMixin.d.ts +7 -7
- package/lib/client/mixins/IAMMixin.js +5 -5
- package/lib/client/mixins/RuntimesMixin.d.ts +13 -13
- package/lib/client/mixins/RuntimesMixin.js +11 -11
- package/lib/client/mixins/SpacerMixin.d.ts +14 -14
- package/lib/client/mixins/SpacerMixin.js +12 -12
- package/lib/client/utils/spacerUtils.d.ts +4 -4
- package/lib/client/utils/spacerUtils.js +4 -4
- package/lib/components/checkout/StripeCheckout.js +19 -23
- package/lib/components/context/OrganizationSelect.js +12 -15
- package/lib/components/context/SpaceSelect.js +24 -25
- package/lib/components/runtimes/RuntimeLauncherDialog.js +2 -2
- package/lib/components/runtimes/RuntimePickerCell.js +1 -1
- package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
- package/lib/components/runtimes/RuntimeTransfer.d.ts +1 -1
- package/lib/hooks/useAuthorization.js +4 -2
- package/lib/hooks/useCache.d.ts +932 -285
- package/lib/hooks/useCache.js +5736 -2767
- package/lib/hooks/useCache0.d.ts +312 -0
- package/lib/hooks/useCache0.js +3189 -0
- package/lib/hooks/useIAM.js +18 -17
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/{client/models/Credits.d.ts → models/CreditsDTO.d.ts} +38 -5
- package/lib/{client/models/Credits.js → models/CreditsDTO.js} +7 -2
- package/lib/models/Environment.d.ts +1 -1
- package/lib/{client/models/Environment.d.ts → models/EnvironmentDTO.d.ts} +55 -3
- package/lib/{client/models/Environment.js → models/EnvironmentDTO.js} +2 -2
- package/lib/{client/models → models}/HealthCheck.js +1 -1
- package/lib/{api/types/iam.d.ts → models/IAM.d.ts} +1 -87
- package/lib/{client/models/Item.d.ts → models/ItemDTO.d.ts} +6 -1
- package/lib/{client/models/Item.js → models/ItemDTO.js} +2 -7
- package/lib/{client/models/Lexical.d.ts → models/LexicalDTO.d.ts} +79 -7
- package/lib/{client/models/Lexical.js → models/LexicalDTO.js} +10 -5
- package/lib/{client/models/Notebook.d.ts → models/NotebookDTO.d.ts} +16 -7
- package/lib/{client/models/Notebook.js → models/NotebookDTO.js} +5 -5
- package/lib/models/Profile.d.ts +65 -0
- package/lib/models/Runtime.d.ts +49 -49
- package/lib/{client/models/Runtime.d.ts → models/RuntimeDTO.d.ts} +74 -5
- package/lib/{client/models/Runtime.js → models/RuntimeDTO.js} +5 -5
- package/lib/{client/models/Snapshot.d.ts → models/RuntimeSnapshotDTO.d.ts} +89 -8
- package/lib/{client/models/Snapshot.js → models/RuntimeSnapshotDTO.js} +4 -4
- package/lib/models/SpaceDTO.d.ts +280 -0
- package/lib/{client/models/Space.js → models/SpaceDTO.js} +17 -12
- package/lib/{client/models/User.d.ts → models/UserDTO.d.ts} +25 -3
- package/lib/{client/models/User.js → models/UserDTO.js} +3 -2
- package/lib/models/index.d.ts +45 -4
- package/lib/models/index.js +45 -4
- package/package.json +2 -1
- package/lib/api/types/index.d.ts +0 -34
- package/lib/api/types/index.js +0 -38
- package/lib/api/types/runtimes.d.ts +0 -205
- package/lib/api/types/runtimes.js +0 -5
- package/lib/api/types/spacer.d.ts +0 -243
- package/lib/api/types/spacer.js +0 -5
- package/lib/client/models/Space.d.ts +0 -135
- package/lib/client/models/index.d.ts +0 -26
- package/lib/client/models/index.js +0 -25
- /package/lib/{api/types/common.d.ts → models/Common.d.ts} +0 -0
- /package/lib/{api/types/common.js → models/Common.js} +0 -0
- /package/lib/{client/models → models}/HealthCheck.d.ts +0 -0
- /package/lib/{api/types/iam.js → models/IAM.js} +0 -0
package/lib/hooks/useIAM.js
CHANGED
|
@@ -14,7 +14,9 @@ export const useIAM = (props = { user: undefined, token: undefined }) => {
|
|
|
14
14
|
const layoutStore = useLayoutStore();
|
|
15
15
|
const organizationStore = useOrganizationStore();
|
|
16
16
|
const spaceStore = useSpaceStore();
|
|
17
|
-
const {
|
|
17
|
+
const { useWhoami, useLogout } = useCache();
|
|
18
|
+
const { data: whoamiData } = useWhoami();
|
|
19
|
+
const logoutMutation = useLogout();
|
|
18
20
|
const loginAndNavigate = async (token, logout, refresh, navigate, homeRoute) => {
|
|
19
21
|
try {
|
|
20
22
|
const resp = await requestDatalayerAPI({
|
|
@@ -60,27 +62,26 @@ export const useIAM = (props = { user: undefined, token: undefined }) => {
|
|
|
60
62
|
layoutStore.reset();
|
|
61
63
|
organizationStore.updateOrganizations([]);
|
|
62
64
|
spaceStore.updateSpaces([]);
|
|
63
|
-
|
|
65
|
+
// Call TanStack Query logout mutation which will clear all caches
|
|
66
|
+
logoutMutation.mutate();
|
|
64
67
|
setIAMState({ user: ANONYMOUS_USER, token: ANONYMOUS_USER_TOKEN });
|
|
65
68
|
};
|
|
66
69
|
useEffect(() => {
|
|
67
|
-
if (token) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
}
|
|
70
|
+
if (token && whoamiData) {
|
|
71
|
+
if (whoamiData.success) {
|
|
72
|
+
const user = asUser(whoamiData.profile);
|
|
73
|
+
setIAMState({ user, token });
|
|
74
|
+
iamStore.setLogin(user, token);
|
|
75
|
+
// TODO centralize user settings management.
|
|
76
|
+
const aiagentsRunUrl = user.settings?.aiAgentsUrl;
|
|
77
|
+
if (aiagentsRunUrl) {
|
|
78
|
+
coreStore.getState().setConfiguration({
|
|
79
|
+
aiagentsRunUrl,
|
|
80
|
+
});
|
|
80
81
|
}
|
|
81
|
-
}
|
|
82
|
+
}
|
|
82
83
|
}
|
|
83
|
-
}, []);
|
|
84
|
+
}, [token, whoamiData, iamStore]);
|
|
84
85
|
return {
|
|
85
86
|
user: iamState.user,
|
|
86
87
|
token: iamState.token,
|
package/lib/index.d.ts
CHANGED
|
@@ -7,9 +7,8 @@ export * from './hooks';
|
|
|
7
7
|
export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi';
|
|
8
8
|
export type { IRequestDatalayerAPIOptions } from './api/DatalayerApi';
|
|
9
9
|
export { API_BASE_PATHS } from './api/constants';
|
|
10
|
-
export * from './api/types';
|
|
11
10
|
export * as runtimesApi from './api/runtimes';
|
|
12
11
|
export * as iamApi from './api/iam';
|
|
13
12
|
export * as spacerApi from './api/spacer';
|
|
14
|
-
export { DatalayerClient, type DatalayerClientConfig, type SDKHandlers, User, Runtime, Environment, Snapshot, Space, Notebook,
|
|
13
|
+
export { DatalayerClient, type DatalayerClientConfig, type SDKHandlers, User, Runtime, Environment, Snapshot, Space, Notebook, LexicalDTO, Credits, Item, type RuntimeJSON, type EnvironmentJSON, type UserJSON, } from './client';
|
|
15
14
|
export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getRuntimeSnapshots, loadRuntimeSnapshot, } from './stateful/runtimes/actions';
|
package/lib/index.js
CHANGED
|
@@ -12,12 +12,11 @@ export * from './hooks';
|
|
|
12
12
|
// Export API and SDK layers
|
|
13
13
|
export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi';
|
|
14
14
|
export { API_BASE_PATHS } from './api/constants';
|
|
15
|
-
export * from './api/types';
|
|
16
15
|
export * as runtimesApi from './api/runtimes';
|
|
17
16
|
export * as iamApi from './api/iam';
|
|
18
17
|
export * as spacerApi from './api/spacer';
|
|
19
18
|
export { DatalayerClient,
|
|
20
19
|
// Export SDK models
|
|
21
|
-
User, Runtime, Environment, Snapshot, Space, Notebook,
|
|
20
|
+
User, Runtime, Environment, Snapshot, Space, Notebook, LexicalDTO, Credits, Item, } from './client';
|
|
22
21
|
// Export commonly used SDK functions directly for convenience
|
|
23
22
|
export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getRuntimeSnapshots, loadRuntimeSnapshot, } from './stateful/runtimes/actions';
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* Credit information for a user.
|
|
3
|
+
*/
|
|
4
|
+
export interface CreditsInfo {
|
|
5
|
+
/** Available credits */
|
|
6
|
+
credits: number;
|
|
7
|
+
/** Credit quota (null if unlimited) */
|
|
8
|
+
quota: number | null;
|
|
9
|
+
/** Last update timestamp */
|
|
10
|
+
last_update: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Credit reservation information.
|
|
5
14
|
*/
|
|
6
|
-
|
|
15
|
+
export interface CreditReservation {
|
|
16
|
+
/** Reservation ID */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Reserved credits */
|
|
19
|
+
credits: number;
|
|
20
|
+
/** Resource ID (e.g., runtime ID) */
|
|
21
|
+
resource: string;
|
|
22
|
+
/** Last update timestamp */
|
|
23
|
+
last_update: string;
|
|
24
|
+
/** Burning rate (credits per hour) for this reservation */
|
|
25
|
+
burning_rate: number;
|
|
26
|
+
/** Start date of the reservation */
|
|
27
|
+
start_date: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response from the credits endpoint.
|
|
31
|
+
*/
|
|
32
|
+
export interface CreditsResponse {
|
|
33
|
+
/** Operation success status */
|
|
34
|
+
success: boolean;
|
|
35
|
+
/** Credit information */
|
|
36
|
+
credits: CreditsInfo;
|
|
37
|
+
/** Active credit reservations */
|
|
38
|
+
reservations: CreditReservation[];
|
|
39
|
+
}
|
|
7
40
|
/**
|
|
8
41
|
* Credits model representing user's available credits and usage.
|
|
9
42
|
*
|
|
@@ -17,7 +50,7 @@ import type { CreditsInfo, CreditReservation } from '../../api/iam/usage';
|
|
|
17
50
|
* const maxMinutes = credits.calculateMaxRuntimeMinutes(environment.burningRate);
|
|
18
51
|
* ```
|
|
19
52
|
*/
|
|
20
|
-
export declare class
|
|
53
|
+
export declare class CreditsDTO {
|
|
21
54
|
/** @internal */
|
|
22
55
|
_data: CreditsInfo;
|
|
23
56
|
private _reservations;
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Credits model for the Datalayer SDK.
|
|
7
|
+
*
|
|
8
|
+
* @module models/CreditsDTO
|
|
9
|
+
*/
|
|
10
|
+
import { validateJSON } from '../api/utils/validation';
|
|
6
11
|
/**
|
|
7
12
|
* Credits model representing user's available credits and usage.
|
|
8
13
|
*
|
|
@@ -16,7 +21,7 @@ import { validateJSON } from '../../api/utils/validation';
|
|
|
16
21
|
* const maxMinutes = credits.calculateMaxRuntimeMinutes(environment.burningRate);
|
|
17
22
|
* ```
|
|
18
23
|
*/
|
|
19
|
-
export class
|
|
24
|
+
export class CreditsDTO {
|
|
20
25
|
/** @internal */
|
|
21
26
|
_data;
|
|
22
27
|
_reservations;
|
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Environment domain model for the Datalayer SDK.
|
|
3
3
|
*
|
|
4
|
-
* @module
|
|
4
|
+
* @module models/EnvironmentDTO
|
|
5
5
|
*/
|
|
6
|
-
import type { Environment as EnvironmentData } from '../../api/types/runtimes';
|
|
7
6
|
import type { DatalayerClient } from '../index';
|
|
7
|
+
/**
|
|
8
|
+
* Represents a computing environment available in the Datalayer platform.
|
|
9
|
+
* @interface EnvironmentData
|
|
10
|
+
*/
|
|
11
|
+
export interface EnvironmentData {
|
|
12
|
+
/** Human-readable title for the environment */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Detailed description of the environment */
|
|
15
|
+
description: string;
|
|
16
|
+
/** Docker image used for this environment */
|
|
17
|
+
dockerImage: string;
|
|
18
|
+
/** Example usage or description */
|
|
19
|
+
example?: string;
|
|
20
|
+
/** Code snippets for this environment */
|
|
21
|
+
snippets?: any[];
|
|
22
|
+
/** Content mounts for this environment */
|
|
23
|
+
contents?: any[];
|
|
24
|
+
/** Kernel configuration */
|
|
25
|
+
runtime?: {
|
|
26
|
+
/** Template for kernel naming */
|
|
27
|
+
givenNameTemplate?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Programming language (e.g., "python", "r") */
|
|
30
|
+
language: string;
|
|
31
|
+
/** Resource ranges configuration */
|
|
32
|
+
resourcesRanges?: any;
|
|
33
|
+
/** Credits consumed per hour when running */
|
|
34
|
+
burning_rate: number;
|
|
35
|
+
/** Simple resource specification */
|
|
36
|
+
resources?: any;
|
|
37
|
+
/** Name identifier for the environment */
|
|
38
|
+
name: string;
|
|
39
|
+
/** Docker registry for the image */
|
|
40
|
+
dockerRegistry?: string;
|
|
41
|
+
/** Icon or avatar URL for the environment */
|
|
42
|
+
icon?: string;
|
|
43
|
+
/** Whether the environment is enabled */
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
/** Tags associated with the environment */
|
|
46
|
+
tags?: string[];
|
|
47
|
+
}
|
|
8
48
|
/**
|
|
9
49
|
* Stable public interface for Environment data.
|
|
10
50
|
* This is the contract that SDK consumers can rely on.
|
|
@@ -22,6 +62,18 @@ export interface EnvironmentJSON {
|
|
|
22
62
|
/** Rich description of the environment (contains HTML markup) */
|
|
23
63
|
richDescription: string;
|
|
24
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Response from listing available environments
|
|
67
|
+
* @interface ListEnvironmentsResponse
|
|
68
|
+
*/
|
|
69
|
+
export interface ListEnvironmentsResponse {
|
|
70
|
+
/** Whether the request was successful */
|
|
71
|
+
success: boolean;
|
|
72
|
+
/** Response message from the server */
|
|
73
|
+
message: string;
|
|
74
|
+
/** Array of available environments */
|
|
75
|
+
environments: EnvironmentData[];
|
|
76
|
+
}
|
|
25
77
|
/**
|
|
26
78
|
* Environment domain model that wraps API responses with convenient methods.
|
|
27
79
|
* Provides information about available computational environments.
|
|
@@ -33,7 +85,7 @@ export interface EnvironmentJSON {
|
|
|
33
85
|
* console.log(aiEnv.title); // "AI Environment"
|
|
34
86
|
* ```
|
|
35
87
|
*/
|
|
36
|
-
export declare class
|
|
88
|
+
export declare class EnvironmentDTO {
|
|
37
89
|
/** @internal */
|
|
38
90
|
_data: EnvironmentData;
|
|
39
91
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
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 '
|
|
5
|
+
import { validateJSON } from '../api/utils/validation';
|
|
6
6
|
/**
|
|
7
7
|
* Environment domain model that wraps API responses with convenient methods.
|
|
8
8
|
* Provides information about available computational environments.
|
|
@@ -14,7 +14,7 @@ import { validateJSON } from '../../api/utils/validation';
|
|
|
14
14
|
* console.log(aiEnv.title); // "AI Environment"
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export class
|
|
17
|
+
export class EnvironmentDTO {
|
|
18
18
|
/** @internal */
|
|
19
19
|
_data;
|
|
20
20
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
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 '
|
|
5
|
+
import { validateJSON } from '../api/utils/validation';
|
|
6
6
|
/**
|
|
7
7
|
* Represents a health check response from a Datalayer service.
|
|
8
8
|
* Provides standardized health status information across all services.
|
|
@@ -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
|
|
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
|
|
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
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @module client/models/Lexical
|
|
4
|
+
* Represents a Lexical document (rich text editor)
|
|
5
|
+
* @interface Lexical
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @module client/models/Notebook
|
|
4
|
+
* Represents a Jupyter notebook document
|
|
5
|
+
* @interface NotebookData
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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 '
|
|
6
|
-
import {
|
|
7
|
-
import { ItemTypes } from '../constants';
|
|
8
|
-
import { validateJSON } from '
|
|
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
|
|
19
|
+
export class NotebookDTO extends ItemDTO {
|
|
20
20
|
/**
|
|
21
21
|
* Create a Notebook instance.
|
|
22
22
|
*
|
package/lib/models/Profile.d.ts
CHANGED
|
@@ -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;
|