@datalayer/core 0.0.26 → 1.0.1

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 (78) hide show
  1. package/lib/api/index.d.ts +1 -1
  2. package/lib/api/index.js +1 -1
  3. package/lib/client/utils/spacerUtils.d.ts +2 -2
  4. package/lib/client/utils/spacerUtils.js +4 -4
  5. package/lib/components/auth/Login.d.ts +4 -0
  6. package/lib/components/auth/Login.js +8 -2
  7. package/lib/components/auth/Login.stories.d.ts +1 -0
  8. package/lib/components/progress/ConsumptionBar.js +7 -7
  9. package/lib/components/progress/CreditsIndicator.d.ts +7 -1
  10. package/lib/components/progress/CreditsIndicator.js +4 -2
  11. package/lib/components/{screenshot/ScreenCapture.d.ts → screencapture/Screencapture.d.ts} +5 -5
  12. package/lib/components/{screenshot/ScreenCapture.js → screencapture/Screencapture.js} +2 -2
  13. package/lib/components/screencapture/ScreencaptureButton.d.ts +3 -0
  14. package/lib/components/{screenshot/ScreenCaptureButton.js → screencapture/ScreencaptureButton.js} +8 -8
  15. package/lib/components/screencapture/index.d.ts +2 -0
  16. package/lib/components/{screenshot → screencapture}/index.js +2 -2
  17. package/lib/components/storage/ContentsBrowser.js +2 -2
  18. package/lib/hooks/index.d.ts +1 -1
  19. package/lib/hooks/index.js +1 -1
  20. package/lib/hooks/layouts/{LayoutScreenshot.css → LayoutScreencapture.css} +2 -2
  21. package/lib/hooks/layouts/LayoutScreencapture.d.ts +3 -0
  22. package/lib/hooks/layouts/{LayoutScreenshot.js → LayoutScreencapture.js} +14 -14
  23. package/lib/hooks/layouts/index.d.ts +1 -1
  24. package/lib/hooks/layouts/index.js +1 -1
  25. package/lib/hooks/useCache.d.ts +12 -2
  26. package/lib/hooks/useCache.js +180 -68
  27. package/lib/hooks/useCellOutputshot.js +2 -2
  28. package/lib/hooks/useScreencapture.d.ts +18 -0
  29. package/lib/hooks/useScreencapture.js +53 -0
  30. package/lib/models/CreditsDTO.d.ts +1 -1
  31. package/lib/models/CreditsDTO.js +1 -1
  32. package/lib/models/Datasource.d.ts +4 -4
  33. package/lib/models/Datasource.js +7 -7
  34. package/lib/models/EnvironmentDTO.d.ts +3 -3
  35. package/lib/models/EnvironmentDTO.js +3 -3
  36. package/lib/models/HealthCheck.d.ts +2 -2
  37. package/lib/models/HealthCheck.js +2 -2
  38. package/lib/models/IAMProviderUsers.d.ts +11 -0
  39. package/lib/models/IAMProvidersSpecs.d.ts +2 -1
  40. package/lib/models/IAMProvidersSpecs.js +14 -0
  41. package/lib/models/ItemDTO.d.ts +3 -3
  42. package/lib/models/ItemDTO.js +10 -10
  43. package/lib/models/LexicalDTO.d.ts +3 -3
  44. package/lib/models/LexicalDTO.js +4 -4
  45. package/lib/models/NotebookDTO.d.ts +3 -3
  46. package/lib/models/NotebookDTO.js +6 -6
  47. package/lib/models/Page.js +1 -1
  48. package/lib/models/PageTag.d.ts +1 -1
  49. package/lib/models/PageTag.js +21 -0
  50. package/lib/models/RuntimeDTO.d.ts +4 -4
  51. package/lib/models/RuntimeDTO.js +9 -9
  52. package/lib/models/RuntimeSnapshotDTO.d.ts +3 -3
  53. package/lib/models/RuntimeSnapshotDTO.js +7 -7
  54. package/lib/models/Secret.d.ts +4 -4
  55. package/lib/models/Secret.js +7 -7
  56. package/lib/models/Space.js +3 -0
  57. package/lib/models/SpaceDTO.d.ts +3 -3
  58. package/lib/models/SpaceDTO.js +14 -14
  59. package/lib/models/UserDTO.d.ts +2 -2
  60. package/lib/models/UserDTO.js +2 -2
  61. package/lib/state/substates/LayoutState.d.ts +5 -5
  62. package/lib/state/substates/LayoutState.js +3 -3
  63. package/lib/theme/DatalayerTheme.js +5 -5
  64. package/lib/utils/Screencapture.d.ts +1 -0
  65. package/lib/utils/{Screenshot.js → Screencapture.js} +1 -1
  66. package/lib/utils/index.js +1 -1
  67. package/lib/views/datasources/DatasourceNew.d.ts +7 -1
  68. package/lib/views/datasources/DatasourceNew.js +3 -3
  69. package/lib/views/datasources/Datasources.d.ts +7 -1
  70. package/lib/views/datasources/Datasources.js +6 -4
  71. package/package.json +1 -1
  72. package/style/screencapture/index.css +58 -0
  73. package/lib/components/screenshot/ScreenCaptureButton.d.ts +0 -3
  74. package/lib/components/screenshot/index.d.ts +0 -2
  75. package/lib/hooks/layouts/LayoutScreenshot.d.ts +0 -3
  76. package/lib/hooks/useScreenshot.d.ts +0 -18
  77. package/lib/hooks/useScreenshot.js +0 -53
  78. package/lib/utils/Screenshot.d.ts +0 -1
@@ -12,6 +12,9 @@ export class IAMProvidersSpecs {
12
12
  case 'github': {
13
13
  return this.GitHub;
14
14
  }
15
+ case 'google': {
16
+ return this.Google;
17
+ }
15
18
  case 'linkedin': {
16
19
  return this.LinkedIn;
17
20
  }
@@ -46,6 +49,17 @@ export class IAMProvidersSpecs {
46
49
  postShareURL: '',
47
50
  registerUploadURL: '',
48
51
  };
52
+ static Google = {
53
+ name: 'google',
54
+ oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
55
+ oauth2CallbackUIRoute: '/iam/oauth2/google/callback',
56
+ accessTokenCookieName: (user) => `__datalayer__google_access_token_${user.id}`,
57
+ refreshTokenCookieName: '__datalayer__google_refresh_token',
58
+ userInfoURL: 'https://openidconnect.googleapis.com/v1/userinfo',
59
+ tokenRefreshURL: 'https://oauth2.googleapis.com/token',
60
+ postShareURL: '',
61
+ registerUploadURL: '',
62
+ };
49
63
  static LinkedIn = {
50
64
  name: 'linkedin',
51
65
  oauth2CallbackServerRoute: 'jupyter_iam/oauth2/callback',
@@ -13,14 +13,14 @@ import type { DatalayerClient } from '../index';
13
13
  */
14
14
  export declare abstract class ItemDTO<TData> {
15
15
  protected _data: TData;
16
- private _sdk;
16
+ private _client;
17
17
  private _deleted;
18
18
  /**
19
19
  * Create an Item instance.
20
20
  * @param data - Item data from API
21
- * @param sdk - Client instance
21
+ * @param client - Client instance
22
22
  */
23
- constructor(data: TData, sdk: DatalayerClient);
23
+ constructor(data: TData, client: DatalayerClient);
24
24
  /** Check if this item has been deleted. */
25
25
  get isDeleted(): boolean;
26
26
  /**
@@ -12,16 +12,16 @@ import * as items from '../api/spacer/items';
12
12
  */
13
13
  export class ItemDTO {
14
14
  _data;
15
- _sdk;
15
+ _client;
16
16
  _deleted = false;
17
17
  /**
18
18
  * Create an Item instance.
19
19
  * @param data - Item data from API
20
- * @param sdk - Client instance
20
+ * @param client - Client instance
21
21
  */
22
- constructor(data, sdk) {
22
+ constructor(data, client) {
23
23
  this._data = data;
24
- this._sdk = sdk;
24
+ this._client = client;
25
25
  }
26
26
  // ========================================================================
27
27
  // Deletion State Management
@@ -105,8 +105,8 @@ export class ItemDTO {
105
105
  */
106
106
  async delete() {
107
107
  this._checkDeleted();
108
- const token = this._sdk.getToken();
109
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
108
+ const token = this._client.getToken();
109
+ const spacerRunUrl = this._client.getSpacerRunUrl();
110
110
  await items.deleteItem(token, this.uid, spacerRunUrl);
111
111
  this._deleted = true;
112
112
  }
@@ -137,8 +137,8 @@ export class ItemDTO {
137
137
  }
138
138
  // Third try: Fetch full item details from API
139
139
  try {
140
- const token = this._sdk.getToken();
141
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
140
+ const token = this._client.getToken();
141
+ const spacerRunUrl = this._client.getSpacerRunUrl();
142
142
  const response = await items.getItem(token, this.uid, spacerRunUrl);
143
143
  // Update internal data with full item details
144
144
  if (response.success && response.item) {
@@ -173,11 +173,11 @@ export class ItemDTO {
173
173
  // ========================================================================
174
174
  /** Get Client token for API calls. */
175
175
  _getToken() {
176
- return this._sdk.getToken();
176
+ return this._client.getToken();
177
177
  }
178
178
  /** Get spacer API URL for API calls. */
179
179
  _getSpacerRunUrl() {
180
- return this._sdk.getSpacerRunUrl();
180
+ return this._client.getSpacerRunUrl();
181
181
  }
182
182
  /** Update internal data after API call. */
183
183
  _updateData(newData) {
@@ -109,7 +109,7 @@ export interface LexicalJSON {
109
109
  *
110
110
  * @example
111
111
  * ```typescript
112
- * const lexical = await sdk.createLexical(formData);
112
+ * const lexical = await client.createLexical(formData);
113
113
  * await lexical.update({ name: 'Updated Documentation' });
114
114
  * ```
115
115
  */
@@ -118,9 +118,9 @@ export declare class LexicalDTO extends ItemDTO<LexicalData> {
118
118
  * Create a Lexical instance.
119
119
  *
120
120
  * @param data - Lexical data from API
121
- * @param sdk - Client instance
121
+ * @param client - Client instance
122
122
  */
123
- constructor(data: LexicalData, sdk: DatalayerClient);
123
+ constructor(data: LexicalData, client: DatalayerClient);
124
124
  /** Document type identifier. */
125
125
  get type(): string;
126
126
  /** The cached name of the document. */
@@ -17,7 +17,7 @@ import { validateJSON } from '../api/utils/validation';
17
17
  *
18
18
  * @example
19
19
  * ```typescript
20
- * const lexical = await sdk.createLexical(formData);
20
+ * const lexical = await client.createLexical(formData);
21
21
  * await lexical.update({ name: 'Updated Documentation' });
22
22
  * ```
23
23
  */
@@ -26,10 +26,10 @@ export class LexicalDTO extends ItemDTO {
26
26
  * Create a Lexical instance.
27
27
  *
28
28
  * @param data - Lexical data from API
29
- * @param sdk - Client instance
29
+ * @param client - Client instance
30
30
  */
31
- constructor(data, sdk) {
32
- super(data, sdk);
31
+ constructor(data, client) {
32
+ super(data, client);
33
33
  }
34
34
  // ========================================================================
35
35
  // Abstract Method Implementations
@@ -42,7 +42,7 @@ export interface NotebookJSON {
42
42
  *
43
43
  * @example
44
44
  * ```typescript
45
- * const notebook = await sdk.createNotebook(formData);
45
+ * const notebook = await client.createNotebook(formData);
46
46
  * const kernelSpec = await notebook.getKernelSpec();
47
47
  * ```
48
48
  */
@@ -51,9 +51,9 @@ export declare class NotebookDTO extends ItemDTO<NotebookData> {
51
51
  * Create a Notebook instance.
52
52
  *
53
53
  * @param data - Notebook data from API
54
- * @param sdk - Client instance
54
+ * @param client - Client instance
55
55
  */
56
- constructor(data: NotebookData, sdk: DatalayerClient);
56
+ constructor(data: NotebookData, client: DatalayerClient);
57
57
  /** Document type identifier. */
58
58
  get type(): string;
59
59
  /** The cached name of the notebook. */
@@ -12,7 +12,7 @@ import { validateJSON } from '../api/utils/validation';
12
12
  *
13
13
  * @example
14
14
  * ```typescript
15
- * const notebook = await sdk.createNotebook(formData);
15
+ * const notebook = await client.createNotebook(formData);
16
16
  * const kernelSpec = await notebook.getKernelSpec();
17
17
  * ```
18
18
  */
@@ -21,10 +21,10 @@ export class NotebookDTO extends ItemDTO {
21
21
  * Create a Notebook instance.
22
22
  *
23
23
  * @param data - Notebook data from API
24
- * @param sdk - Client instance
24
+ * @param client - Client instance
25
25
  */
26
- constructor(data, sdk) {
27
- super(data, sdk);
26
+ constructor(data, client) {
27
+ super(data, client);
28
28
  }
29
29
  // ========================================================================
30
30
  // Abstract Method Implementations
@@ -74,8 +74,8 @@ export class NotebookDTO extends ItemDTO {
74
74
  async update(name, description) {
75
75
  // FIXME: check if both are needed, and use the existing values if only one provided
76
76
  this._checkDeleted();
77
- const token = this._sdk.getToken();
78
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
77
+ const token = this._client.getToken();
78
+ const spacerRunUrl = this._client.getSpacerRunUrl();
79
79
  const updateData = {};
80
80
  if (name !== undefined)
81
81
  updateData.name = name;
@@ -13,7 +13,7 @@ export const asPage = (s) => {
13
13
  description: s.description_t,
14
14
  theme: s.theme_s,
15
15
  nbformat: s.nbformat_s ? JSON.parse(s.nbformat_s) : undefined,
16
- screenCapture: s.screen_capture_s,
16
+ screenCapture: s.screen_capture_cdn_url_s || s.screen_capture_s,
17
17
  tags: s.tags_ss ?? [],
18
18
  creator: s.creator ? asUser(s.creator) : undefined,
19
19
  creatorId: s.creator_uid,
@@ -4,7 +4,7 @@ type CardIconColorsType = (typeof CardIconColors)[number];
4
4
  export type PageTagMetadata = {
5
5
  fillColor: React.CSSProperties['backgroundColor'];
6
6
  };
7
- export type PageTagName = 'ai' | 'deep-learning' | 'example' | 'llm' | 'python' | 'pytorch' | 'spatial' | 'tutorial';
7
+ export type PageTagName = 'agent' | 'ai' | 'ai-agent' | 'deep-learning' | 'example' | 'llm' | 'notebook' | 'python' | 'pytorch' | 'spatial' | 'tutorial';
8
8
  export type PageTag = {
9
9
  id: string;
10
10
  text?: PageTagName;
@@ -9,12 +9,24 @@ export const PAGE_TAGE_NONE = {
9
9
  Icon: CopilotIcon,
10
10
  color: 'pink',
11
11
  };
12
+ const PAGE_TAGE_AGENT = {
13
+ id: '9',
14
+ text: 'agent',
15
+ Icon: CopilotIcon,
16
+ color: 'teal',
17
+ };
12
18
  const PAGE_TAGE_AI = {
13
19
  id: '1',
14
20
  text: 'ai',
15
21
  Icon: CopilotIcon,
16
22
  color: 'pink',
17
23
  };
24
+ const PAGE_TAGE_AI_AGENT = {
25
+ id: '10',
26
+ text: 'ai-agent',
27
+ Icon: CopilotIcon,
28
+ color: 'purple',
29
+ };
18
30
  const PAGE_TAGE_DEEP_LEARNING = {
19
31
  id: '2',
20
32
  text: 'deep-learning',
@@ -33,6 +45,12 @@ const PAGE_TAGE_LLM = {
33
45
  Icon: CopilotIcon,
34
46
  color: 'coral',
35
47
  };
48
+ const PAGE_TAGE_NOTEBOOK = {
49
+ id: '11',
50
+ text: 'notebook',
51
+ Icon: CopilotIcon,
52
+ color: 'blue',
53
+ };
36
54
  const PAGE_TAGE_PYTHON = {
37
55
  id: '5',
38
56
  text: 'python',
@@ -60,10 +78,13 @@ const PAGE_TAGE_TUTORIAL = {
60
78
  metadata: { fillColor: 'yellow' },
61
79
  };
62
80
  export const PAGE_TAGS = [
81
+ PAGE_TAGE_AGENT,
63
82
  PAGE_TAGE_AI,
83
+ PAGE_TAGE_AI_AGENT,
64
84
  PAGE_TAGE_DEEP_LEARNING,
65
85
  PAGE_TAGE_EXAMPLE,
66
86
  PAGE_TAGE_LLM,
87
+ PAGE_TAGE_NOTEBOOK,
67
88
  PAGE_TAGE_PYTHON,
68
89
  PAGE_TAGE_PYTORCH,
69
90
  PAGE_TAGE_SPATIAL,
@@ -105,22 +105,22 @@ export interface ListRuntimesResponse {
105
105
  *
106
106
  * @example
107
107
  * ```typescript
108
- * const runtime = await sdk.createRuntime({ environment_name: 'python-cpu' });
108
+ * const runtime = await client.createRuntime({ environment_name: 'python-cpu' });
109
109
  * await runtime.waitUntilReady();
110
110
  * ```
111
111
  */
112
112
  export declare class RuntimeDTO {
113
113
  /** @internal */
114
114
  _data: RuntimeData;
115
- private _sdk;
115
+ private _client;
116
116
  private _deleted;
117
117
  /**
118
118
  * Create a Runtime instance.
119
119
  *
120
120
  * @param data - Runtime data from API
121
- * @param sdk - Client instance
121
+ * @param client - Client instance
122
122
  */
123
- constructor(data: RuntimeData, sdk: DatalayerClient);
123
+ constructor(data: RuntimeData, client: DatalayerClient);
124
124
  /**
125
125
  * Check if this runtime has been deleted and throw error if so.
126
126
  * @throws Error if deleted
@@ -15,24 +15,24 @@ import { validateJSON } from '../api/utils/validation';
15
15
  *
16
16
  * @example
17
17
  * ```typescript
18
- * const runtime = await sdk.createRuntime({ environment_name: 'python-cpu' });
18
+ * const runtime = await client.createRuntime({ environment_name: 'python-cpu' });
19
19
  * await runtime.waitUntilReady();
20
20
  * ```
21
21
  */
22
22
  export class RuntimeDTO {
23
23
  /** @internal */
24
24
  _data;
25
- _sdk;
25
+ _client;
26
26
  _deleted = false;
27
27
  /**
28
28
  * Create a Runtime instance.
29
29
  *
30
30
  * @param data - Runtime data from API
31
- * @param sdk - Client instance
31
+ * @param client - Client instance
32
32
  */
33
- constructor(data, sdk) {
33
+ constructor(data, client) {
34
34
  this._data = data;
35
- this._sdk = sdk;
35
+ this._client = client;
36
36
  }
37
37
  // ========================================================================
38
38
  // Helper Methods
@@ -112,7 +112,7 @@ export class RuntimeDTO {
112
112
  * After deletion, subsequent calls to dynamic methods will throw errors.
113
113
  */
114
114
  async delete() {
115
- await this._sdk.deleteRuntime(this.podName);
115
+ await this._client.deleteRuntime(this.podName);
116
116
  this._deleted = true;
117
117
  }
118
118
  /**
@@ -123,8 +123,8 @@ export class RuntimeDTO {
123
123
  */
124
124
  async update(from) {
125
125
  this._checkDeleted();
126
- const updated = await updateRuntime(this._sdk.getToken(), this.podName, from, this._sdk.getRuntimesRunUrl());
127
- return new RuntimeDTO(updated, this._sdk);
126
+ const updated = await updateRuntime(this._client.getToken(), this.podName, from, this._client.getRuntimesRunUrl());
127
+ return new RuntimeDTO(updated, this._client);
128
128
  }
129
129
  /**
130
130
  * Create a snapshot of this runtime.
@@ -136,7 +136,7 @@ export class RuntimeDTO {
136
136
  */
137
137
  async createSnapshot(name, description, stop) {
138
138
  this._checkDeleted();
139
- return await this._sdk.createSnapshot(this.podName, name, description, stop);
139
+ return await this._client.createSnapshot(this.podName, name, description, stop);
140
140
  }
141
141
  // ========================================================================
142
142
  // Utility Methods
@@ -116,15 +116,15 @@ export interface ListRuntimeSnapshotsResponse {
116
116
  */
117
117
  export declare class RuntimeSnapshotDTO {
118
118
  protected _data: RuntimeSnapshotData;
119
- private _sdk;
119
+ private _client;
120
120
  private _deleted;
121
121
  /**
122
122
  * Create a Runtime Snapshot instance.
123
123
  *
124
124
  * @param data - Snapshot data from API
125
- * @param sdk - Client instance
125
+ * @param client - Client instance
126
126
  */
127
- constructor(data: RuntimeSnapshotData, sdk: DatalayerClient);
127
+ constructor(data: RuntimeSnapshotData, client: DatalayerClient);
128
128
  /**
129
129
  * Check if this snapshot has been deleted and throw error if so.
130
130
  * @throws Error if deleted
@@ -16,17 +16,17 @@ import { validateJSON } from '../api/utils/validation';
16
16
  */
17
17
  export class RuntimeSnapshotDTO {
18
18
  _data;
19
- _sdk;
19
+ _client;
20
20
  _deleted = false;
21
21
  /**
22
22
  * Create a Runtime Snapshot instance.
23
23
  *
24
24
  * @param data - Snapshot data from API
25
- * @param sdk - Client instance
25
+ * @param client - Client instance
26
26
  */
27
- constructor(data, sdk) {
27
+ constructor(data, client) {
28
28
  this._data = data;
29
- this._sdk = sdk;
29
+ this._client = client;
30
30
  }
31
31
  // ========================================================================
32
32
  // Helper Methods
@@ -77,8 +77,8 @@ export class RuntimeSnapshotDTO {
77
77
  */
78
78
  async delete() {
79
79
  this._checkDeleted();
80
- const token = this._sdk.getToken();
81
- const runtimesRunUrl = this._sdk.getRuntimesRunUrl();
80
+ const token = this._client.getToken();
81
+ const runtimesRunUrl = this._client.getRuntimesRunUrl();
82
82
  await snapshots.deleteSnapshot(token, this.uid, runtimesRunUrl);
83
83
  this._deleted = true;
84
84
  }
@@ -90,7 +90,7 @@ export class RuntimeSnapshotDTO {
90
90
  */
91
91
  async restore(minutesLimit) {
92
92
  this._checkDeleted();
93
- return await this._sdk.createRuntime({
93
+ return await this._client.createRuntime({
94
94
  environmentName: this.environment,
95
95
  type: 'notebook',
96
96
  givenName: `Restored from ${this.name}`,
@@ -116,7 +116,7 @@ export interface DeleteSecretResponse {
116
116
  *
117
117
  * @example
118
118
  * ```typescript
119
- * const secret = await sdk.createSecret({
119
+ * const secret = await client.createSecret({
120
120
  * variant: 'password',
121
121
  * name: 'db_password',
122
122
  * description: 'Production DB password',
@@ -131,14 +131,14 @@ export interface DeleteSecretResponse {
131
131
  export declare class SecretDTO {
132
132
  /** @internal */
133
133
  _data: SecretData;
134
- private _sdk;
134
+ private _client;
135
135
  private _deleted;
136
136
  /**
137
137
  * Create a Secret instance.
138
138
  * @param data - Secret data from API
139
- * @param sdk - Client instance
139
+ * @param client - Client instance
140
140
  */
141
- constructor(data: SecretData, sdk: DatalayerClient);
141
+ constructor(data: SecretData, client: DatalayerClient);
142
142
  private _checkDeleted;
143
143
  private _decodeValue;
144
144
  get uid(): string;
@@ -21,7 +21,7 @@ import { validateJSON } from '../api/utils/validation';
21
21
  *
22
22
  * @example
23
23
  * ```typescript
24
- * const secret = await sdk.createSecret({
24
+ * const secret = await client.createSecret({
25
25
  * variant: 'password',
26
26
  * name: 'db_password',
27
27
  * description: 'Production DB password',
@@ -36,16 +36,16 @@ import { validateJSON } from '../api/utils/validation';
36
36
  export class SecretDTO {
37
37
  /** @internal */
38
38
  _data;
39
- _sdk;
39
+ _client;
40
40
  _deleted = false;
41
41
  /**
42
42
  * Create a Secret instance.
43
43
  * @param data - Secret data from API
44
- * @param sdk - Client instance
44
+ * @param client - Client instance
45
45
  */
46
- constructor(data, sdk) {
46
+ constructor(data, client) {
47
47
  this._data = data;
48
- this._sdk = sdk;
48
+ this._client = client;
49
49
  }
50
50
  // ========================================================================
51
51
  // Helper Methods
@@ -105,7 +105,7 @@ export class SecretDTO {
105
105
  */
106
106
  async update(updates) {
107
107
  this._checkDeleted();
108
- const updated = await this._sdk.updateSecret(this.uid, updates);
108
+ const updated = await this._client.updateSecret(this.uid, updates);
109
109
  return updated;
110
110
  }
111
111
  /**
@@ -113,7 +113,7 @@ export class SecretDTO {
113
113
  */
114
114
  async delete() {
115
115
  this._checkDeleted();
116
- await this._sdk.deleteSecret(this.uid);
116
+ await this._client.deleteSecret(this.uid);
117
117
  this._deleted = true;
118
118
  }
119
119
  // ========================================================================
@@ -34,6 +34,9 @@ export const asSpace = (raw_space) => {
34
34
  organization: {
35
35
  handle: raw_space.handle_s,
36
36
  },
37
+ // Preserve raw Solr fields so consumers can access dynamic fields
38
+ // (e.g. attached_agent_pod_name_s for project-agent assignment)
39
+ ...raw_space,
37
40
  };
38
41
  return space;
39
42
  };
@@ -48,16 +48,16 @@ export interface SpaceJSON {
48
48
  */
49
49
  export declare class SpaceDTO {
50
50
  protected _data: SpaceData;
51
- private _sdk;
51
+ private _client;
52
52
  private _items;
53
53
  private _deleted;
54
54
  /**
55
55
  * Create a Space instance.
56
56
  *
57
57
  * @param data - Space data from API
58
- * @param sdk - Client instance
58
+ * @param client - Client instance
59
59
  */
60
- constructor(data: SpaceData, sdk: DatalayerClient);
60
+ constructor(data: SpaceData, client: DatalayerClient);
61
61
  /**
62
62
  * Check if this space has been deleted and throw error if so.
63
63
  * @throws Error if deleted
@@ -29,18 +29,18 @@ import { validateJSON } from '../api/utils/validation';
29
29
  */
30
30
  export class SpaceDTO {
31
31
  _data;
32
- _sdk;
32
+ _client;
33
33
  _items = null;
34
34
  _deleted = false;
35
35
  /**
36
36
  * Create a Space instance.
37
37
  *
38
38
  * @param data - Space data from API
39
- * @param sdk - Client instance
39
+ * @param client - Client instance
40
40
  */
41
- constructor(data, sdk) {
41
+ constructor(data, client) {
42
42
  this._data = data;
43
- this._sdk = sdk;
43
+ this._client = client;
44
44
  }
45
45
  // ========================================================================
46
46
  // Helper Methods
@@ -58,8 +58,8 @@ export class SpaceDTO {
58
58
  * Refresh space data from the API by fetching user's spaces.
59
59
  */
60
60
  async refresh() {
61
- const token = this._sdk.getToken();
62
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
61
+ const token = this._client.getToken();
62
+ const spacerRunUrl = this._client.getSpacerRunUrl();
63
63
  const response = await users.getMySpaces(token, spacerRunUrl);
64
64
  const freshSpace = response.spaces.find(s => s.uid === this.uid);
65
65
  if (freshSpace) {
@@ -110,8 +110,8 @@ export class SpaceDTO {
110
110
  async _createItem(data) {
111
111
  this._checkDeleted();
112
112
  // Get necessary configuration from Client
113
- const token = this._sdk.getToken();
114
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
113
+ const token = this._client.getToken();
114
+ const spacerRunUrl = this._client.getSpacerRunUrl();
115
115
  if (data.type === ItemTypes.NOTEBOOK) {
116
116
  const requestData = {
117
117
  spaceId: this.uid,
@@ -125,7 +125,7 @@ export class SpaceDTO {
125
125
  throw new Error('Failed to create notebook: No notebook returned');
126
126
  }
127
127
  else {
128
- return new NotebookDTO(response.notebook, this._sdk);
128
+ return new NotebookDTO(response.notebook, this._client);
129
129
  }
130
130
  }
131
131
  else if (data.type === ItemTypes.LEXICAL) {
@@ -141,7 +141,7 @@ export class SpaceDTO {
141
141
  throw new Error('Failed to create lexical document: No document returned');
142
142
  }
143
143
  else {
144
- return new LexicalDTO(response.document, this._sdk);
144
+ return new LexicalDTO(response.document, this._client);
145
145
  }
146
146
  }
147
147
  else {
@@ -155,11 +155,11 @@ export class SpaceDTO {
155
155
  */
156
156
  async getItems() {
157
157
  this._checkDeleted();
158
- const token = this._sdk.getToken();
159
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
158
+ const token = this._client.getToken();
159
+ const spacerRunUrl = this._client.getSpacerRunUrl();
160
160
  const response = await items.getSpaceItems(token, this.uid, spacerRunUrl);
161
161
  // Use shared utility function to convert items to model instances
162
- this._items = convertSpaceItemsToModels(response.items || [], this._sdk);
162
+ this._items = convertSpaceItemsToModels(response.items || [], this._client);
163
163
  return this._items;
164
164
  }
165
165
  /**
@@ -215,7 +215,7 @@ export class SpaceDTO {
215
215
  variant: this.variant,
216
216
  handle: this.handle,
217
217
  items: this._data.items
218
- ? convertSpaceItemsToModels(this._data.items, this._sdk).map(item => item.toJSON())
218
+ ? convertSpaceItemsToModels(this._data.items, this._client).map(item => item.toJSON())
219
219
  : [],
220
220
  };
221
221
  validateJSON(obj, 'Space');
@@ -54,9 +54,9 @@ export declare class UserDTO {
54
54
  * Create a User instance.
55
55
  *
56
56
  * @param data - User data from API
57
- * @param sdk - Client instance (currently unused but kept for compatibility)
57
+ * @param client - Client instance (currently unused but kept for compatibility)
58
58
  */
59
- constructor(data: UserData, sdk?: DatalayerClient);
59
+ constructor(data: UserData, client?: DatalayerClient);
60
60
  get id(): string;
61
61
  get uid(): string;
62
62
  get email(): string;
@@ -13,9 +13,9 @@ export class UserDTO {
13
13
  * Create a User instance.
14
14
  *
15
15
  * @param data - User data from API
16
- * @param sdk - Client instance (currently unused but kept for compatibility)
16
+ * @param client - Client instance (currently unused but kept for compatibility)
17
17
  */
18
- constructor(data, sdk) {
18
+ constructor(data, client) {
19
19
  this._data = data;
20
20
  }
21
21
  // Basic properties