@objectstack/client 0.8.1 → 0.8.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @objectstack/client
2
2
 
3
+ ## 0.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [555e6a7]
8
+ - @objectstack/spec@0.8.2
9
+ - @objectstack/core@0.8.2
10
+
3
11
  ## 0.8.1
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QueryAST, SortNode, AggregationNode } from '@objectstack/spec/data';
2
- import { BatchUpdateRequest, BatchUpdateResponse, BatchOptions, MetadataCacheRequest, MetadataCacheResponse, StandardErrorCode, ErrorCategory, CreateViewRequest, UpdateViewRequest, ListViewsRequest, ListViewsResponse, ViewResponse } from '@objectstack/spec/api';
2
+ import { BatchUpdateRequest, BatchUpdateResponse, BatchOptions, MetadataCacheRequest, MetadataCacheResponse, StandardErrorCode, ErrorCategory } from '@objectstack/spec/api';
3
3
  import { Logger } from '@objectstack/core';
4
4
  export interface ClientConfig {
5
5
  baseUrl: string;
@@ -106,42 +106,6 @@ export declare class ObjectStackClient {
106
106
  */
107
107
  deleteMany: (object: string, ids: string[], options?: BatchOptions) => Promise<BatchUpdateResponse>;
108
108
  };
109
- /**
110
- * View Storage Operations
111
- * Save, load, and manage UI view configurations
112
- */
113
- views: {
114
- /**
115
- * Create a new saved view
116
- */
117
- create: (request: CreateViewRequest) => Promise<ViewResponse>;
118
- /**
119
- * Get a saved view by ID
120
- */
121
- get: (id: string) => Promise<ViewResponse>;
122
- /**
123
- * List saved views with optional filters
124
- */
125
- list: (request?: ListViewsRequest) => Promise<ListViewsResponse>;
126
- /**
127
- * Update an existing view
128
- */
129
- update: (request: UpdateViewRequest) => Promise<ViewResponse>;
130
- /**
131
- * Delete a saved view
132
- */
133
- delete: (id: string) => Promise<{
134
- success: boolean;
135
- }>;
136
- /**
137
- * Share a view with users/teams
138
- */
139
- share: (id: string, userIds: string[]) => Promise<ViewResponse>;
140
- /**
141
- * Set a view as default for an object
142
- */
143
- setDefault: (id: string, object: string) => Promise<ViewResponse>;
144
- };
145
109
  /**
146
110
  * Private Helpers
147
111
  */
@@ -150,4 +114,4 @@ export declare class ObjectStackClient {
150
114
  private getRoute;
151
115
  }
152
116
  export { QueryBuilder, FilterBuilder, createQuery, createFilter } from './query-builder';
153
- export type { BatchUpdateRequest, BatchUpdateResponse, UpdateManyRequest, DeleteManyRequest, BatchOptions, BatchRecord, BatchOperationResult, MetadataCacheRequest, MetadataCacheResponse, StandardErrorCode, ErrorCategory, CreateViewRequest, UpdateViewRequest, ListViewsRequest, SavedView, ViewResponse, ListViewsResponse, ViewType, ViewVisibility, ViewColumn, ViewLayout } from '@objectstack/spec/api';
117
+ export type { BatchUpdateRequest, BatchUpdateResponse, UpdateManyRequest, DeleteManyRequest, BatchOptions, BatchRecord, BatchOperationResult, MetadataCacheRequest, MetadataCacheResponse, StandardErrorCode, ErrorCategory } from '@objectstack/spec/api';
package/dist/index.js CHANGED
@@ -201,101 +201,6 @@ export class ObjectStackClient {
201
201
  return res.json();
202
202
  }
203
203
  };
204
- /**
205
- * View Storage Operations
206
- * Save, load, and manage UI view configurations
207
- */
208
- this.views = {
209
- /**
210
- * Create a new saved view
211
- */
212
- create: async (request) => {
213
- const route = this.getRoute('ui');
214
- const res = await this.fetch(`${this.baseUrl}${route}/views`, {
215
- method: 'POST',
216
- body: JSON.stringify(request)
217
- });
218
- return res.json();
219
- },
220
- /**
221
- * Get a saved view by ID
222
- */
223
- get: async (id) => {
224
- const route = this.getRoute('ui');
225
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}`);
226
- return res.json();
227
- },
228
- /**
229
- * List saved views with optional filters
230
- */
231
- list: async (request) => {
232
- const route = this.getRoute('ui');
233
- const queryParams = new URLSearchParams();
234
- if (request?.object)
235
- queryParams.set('object', request.object);
236
- if (request?.type)
237
- queryParams.set('type', request.type);
238
- if (request?.visibility)
239
- queryParams.set('visibility', request.visibility);
240
- if (request?.createdBy)
241
- queryParams.set('createdBy', request.createdBy);
242
- if (request?.isDefault !== undefined)
243
- queryParams.set('isDefault', String(request.isDefault));
244
- if (request?.limit)
245
- queryParams.set('limit', String(request.limit));
246
- if (request?.offset)
247
- queryParams.set('offset', String(request.offset));
248
- const url = queryParams.toString()
249
- ? `${this.baseUrl}${route}/views?${queryParams.toString()}`
250
- : `${this.baseUrl}${route}/views`;
251
- const res = await this.fetch(url);
252
- return res.json();
253
- },
254
- /**
255
- * Update an existing view
256
- */
257
- update: async (request) => {
258
- const route = this.getRoute('ui');
259
- const { id, ...updateData } = request;
260
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}`, {
261
- method: 'PATCH',
262
- body: JSON.stringify(updateData)
263
- });
264
- return res.json();
265
- },
266
- /**
267
- * Delete a saved view
268
- */
269
- delete: async (id) => {
270
- const route = this.getRoute('ui');
271
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}`, {
272
- method: 'DELETE'
273
- });
274
- return res.json();
275
- },
276
- /**
277
- * Share a view with users/teams
278
- */
279
- share: async (id, userIds) => {
280
- const route = this.getRoute('ui');
281
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}/share`, {
282
- method: 'POST',
283
- body: JSON.stringify({ sharedWith: userIds })
284
- });
285
- return res.json();
286
- },
287
- /**
288
- * Set a view as default for an object
289
- */
290
- setDefault: async (id, object) => {
291
- const route = this.getRoute('ui');
292
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}/set-default`, {
293
- method: 'POST',
294
- body: JSON.stringify({ object })
295
- });
296
- return res.json();
297
- }
298
- };
299
204
  this.baseUrl = config.baseUrl.replace(/\/$/, ''); // Remove trailing slash
300
205
  this.token = config.token;
301
206
  this.fetchImpl = config.fetch || globalThis.fetch.bind(globalThis);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@objectstack/client",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Official Client SDK for ObjectStack Protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
- "@objectstack/spec": "0.8.1",
9
- "@objectstack/core": "0.8.1"
8
+ "@objectstack/spec": "0.8.2",
9
+ "@objectstack/core": "0.8.2"
10
10
  },
11
11
  "devDependencies": {
12
12
  "typescript": "^5.0.0"
package/src/index.ts CHANGED
@@ -8,13 +8,7 @@ import {
8
8
  MetadataCacheRequest,
9
9
  MetadataCacheResponse,
10
10
  StandardErrorCode,
11
- ErrorCategory,
12
- CreateViewRequest,
13
- UpdateViewRequest,
14
- ListViewsRequest,
15
- SavedView,
16
- ListViewsResponse,
17
- ViewResponse
11
+ ErrorCategory
18
12
  } from '@objectstack/spec/api';
19
13
  import { Logger, createLogger } from '@objectstack/core';
20
14
 
@@ -342,103 +336,7 @@ export class ObjectStackClient {
342
336
  }
343
337
  };
344
338
 
345
- /**
346
- * View Storage Operations
347
- * Save, load, and manage UI view configurations
348
- */
349
- views = {
350
- /**
351
- * Create a new saved view
352
- */
353
- create: async (request: CreateViewRequest): Promise<ViewResponse> => {
354
- const route = this.getRoute('ui');
355
- const res = await this.fetch(`${this.baseUrl}${route}/views`, {
356
- method: 'POST',
357
- body: JSON.stringify(request)
358
- });
359
- return res.json();
360
- },
361
-
362
- /**
363
- * Get a saved view by ID
364
- */
365
- get: async (id: string): Promise<ViewResponse> => {
366
- const route = this.getRoute('ui');
367
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}`);
368
- return res.json();
369
- },
370
-
371
- /**
372
- * List saved views with optional filters
373
- */
374
- list: async (request?: ListViewsRequest): Promise<ListViewsResponse> => {
375
- const route = this.getRoute('ui');
376
- const queryParams = new URLSearchParams();
377
-
378
- if (request?.object) queryParams.set('object', request.object);
379
- if (request?.type) queryParams.set('type', request.type);
380
- if (request?.visibility) queryParams.set('visibility', request.visibility);
381
- if (request?.createdBy) queryParams.set('createdBy', request.createdBy);
382
- if (request?.isDefault !== undefined) queryParams.set('isDefault', String(request.isDefault));
383
- if (request?.limit) queryParams.set('limit', String(request.limit));
384
- if (request?.offset) queryParams.set('offset', String(request.offset));
385
-
386
- const url = queryParams.toString()
387
- ? `${this.baseUrl}${route}/views?${queryParams.toString()}`
388
- : `${this.baseUrl}${route}/views`;
389
-
390
- const res = await this.fetch(url);
391
- return res.json();
392
- },
393
339
 
394
- /**
395
- * Update an existing view
396
- */
397
- update: async (request: UpdateViewRequest): Promise<ViewResponse> => {
398
- const route = this.getRoute('ui');
399
- const { id, ...updateData } = request;
400
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}`, {
401
- method: 'PATCH',
402
- body: JSON.stringify(updateData)
403
- });
404
- return res.json();
405
- },
406
-
407
- /**
408
- * Delete a saved view
409
- */
410
- delete: async (id: string): Promise<{ success: boolean }> => {
411
- const route = this.getRoute('ui');
412
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}`, {
413
- method: 'DELETE'
414
- });
415
- return res.json();
416
- },
417
-
418
- /**
419
- * Share a view with users/teams
420
- */
421
- share: async (id: string, userIds: string[]): Promise<ViewResponse> => {
422
- const route = this.getRoute('ui');
423
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}/share`, {
424
- method: 'POST',
425
- body: JSON.stringify({ sharedWith: userIds })
426
- });
427
- return res.json();
428
- },
429
-
430
- /**
431
- * Set a view as default for an object
432
- */
433
- setDefault: async (id: string, object: string): Promise<ViewResponse> => {
434
- const route = this.getRoute('ui');
435
- const res = await this.fetch(`${this.baseUrl}${route}/views/${id}/set-default`, {
436
- method: 'POST',
437
- body: JSON.stringify({ object })
438
- });
439
- return res.json();
440
- }
441
- };
442
340
 
443
341
  /**
444
342
  * Private Helpers
@@ -537,15 +435,5 @@ export type {
537
435
  MetadataCacheRequest,
538
436
  MetadataCacheResponse,
539
437
  StandardErrorCode,
540
- ErrorCategory,
541
- CreateViewRequest,
542
- UpdateViewRequest,
543
- ListViewsRequest,
544
- SavedView,
545
- ViewResponse,
546
- ListViewsResponse,
547
- ViewType,
548
- ViewVisibility,
549
- ViewColumn,
550
- ViewLayout
438
+ ErrorCategory
551
439
  } from '@objectstack/spec/api';