@vertesia/client 1.5.0-dev.20260717.131047Z → 1.5.0-dev.20260722.120446Z

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 (57) hide show
  1. package/lib/AppsApi.d.ts +34 -6
  2. package/lib/AppsApi.d.ts.map +1 -1
  3. package/lib/AppsApi.js +60 -7
  4. package/lib/AppsApi.js.map +1 -1
  5. package/lib/AuditTrailApi.d.ts +2 -1
  6. package/lib/AuditTrailApi.d.ts.map +1 -1
  7. package/lib/AuditTrailApi.js +3 -0
  8. package/lib/AuditTrailApi.js.map +1 -1
  9. package/lib/ProjectsApi.d.ts +3 -1
  10. package/lib/ProjectsApi.d.ts.map +1 -1
  11. package/lib/ProjectsApi.js +16 -8
  12. package/lib/ProjectsApi.js.map +1 -1
  13. package/lib/ViewsApi.d.ts +21 -0
  14. package/lib/ViewsApi.d.ts.map +1 -0
  15. package/lib/ViewsApi.js +41 -0
  16. package/lib/ViewsApi.js.map +1 -0
  17. package/lib/client.d.ts +3 -1
  18. package/lib/client.d.ts.map +1 -1
  19. package/lib/client.js +4 -1
  20. package/lib/client.js.map +1 -1
  21. package/lib/index.d.ts +1 -0
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +1 -0
  24. package/lib/index.js.map +1 -1
  25. package/lib/store/AnalyzeDocApi.d.ts +9 -11
  26. package/lib/store/AnalyzeDocApi.d.ts.map +1 -1
  27. package/lib/store/AnalyzeDocApi.js +12 -36
  28. package/lib/store/AnalyzeDocApi.js.map +1 -1
  29. package/lib/store/ViewsApi.d.ts +12 -0
  30. package/lib/store/ViewsApi.d.ts.map +1 -0
  31. package/lib/store/ViewsApi.js +17 -0
  32. package/lib/store/ViewsApi.js.map +1 -0
  33. package/lib/store/client.d.ts +2 -0
  34. package/lib/store/client.d.ts.map +1 -1
  35. package/lib/store/client.js +2 -0
  36. package/lib/store/client.js.map +1 -1
  37. package/lib/store/index.d.ts +1 -0
  38. package/lib/store/index.d.ts.map +1 -1
  39. package/lib/store/index.js +1 -0
  40. package/lib/store/index.js.map +1 -1
  41. package/lib/vertesia-client.js +5 -5
  42. package/lib/vertesia-client.js.map +1 -1
  43. package/package.json +8 -8
  44. package/src/AppsApi.test.ts +124 -0
  45. package/src/AppsApi.ts +81 -9
  46. package/src/AuditTrailApi.ts +10 -1
  47. package/src/ProjectsApi.test.ts +33 -0
  48. package/src/ProjectsApi.ts +19 -8
  49. package/src/ViewsApi.test.ts +36 -0
  50. package/src/ViewsApi.ts +60 -0
  51. package/src/client.ts +4 -1
  52. package/src/index.ts +1 -0
  53. package/src/store/AnalyzeDocApi.ts +16 -54
  54. package/src/store/ViewsApi.test.ts +33 -0
  55. package/src/store/ViewsApi.ts +20 -0
  56. package/src/store/client.ts +2 -0
  57. package/src/store/index.ts +1 -0
@@ -0,0 +1,33 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+ import { ZenoClient } from './client.js';
3
+
4
+ describe('StoreViewsApi', () => {
5
+ it('uses the View execution resource for persisted and draft execution', async () => {
6
+ const requests: Request[] = [];
7
+ const fetchMock = vi.fn(async () => {
8
+ return new Response(JSON.stringify({}), {
9
+ status: 200,
10
+ headers: { 'content-type': 'application/json' },
11
+ });
12
+ });
13
+ const client = new ZenoClient({
14
+ serverUrl: 'https://api.example.com',
15
+ fetch: fetchMock,
16
+ onRequest: (request) => requests.push(request),
17
+ });
18
+
19
+ await client.views.execute('app:content:document-library');
20
+ await client.views.preview({
21
+ configuration: {
22
+ name: 'Document library',
23
+ description: 'Browse documents.',
24
+ scope: {},
25
+ },
26
+ });
27
+
28
+ expect(requests.map((request) => request.url)).toEqual([
29
+ 'https://api.example.com/api/v1/view-executions/app%3Acontent%3Adocument-library/execute',
30
+ 'https://api.example.com/api/v1/view-executions/preview',
31
+ ]);
32
+ });
33
+ });
@@ -0,0 +1,20 @@
1
+ import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
2
+ import type { ExecuteViewRequest, PreviewViewExperienceRequest, ViewExecutionResult } from '@vertesia/common';
3
+
4
+ export class StoreViewsApi extends ApiTopic {
5
+ constructor(parent: ClientBase) {
6
+ super(parent, '/api/v1/view-executions');
7
+ }
8
+
9
+ execute(id: string, payload: ExecuteViewRequest = {}): Promise<ViewExecutionResult> {
10
+ return this.post(`/${encodeURIComponent(id)}/execute`, { payload });
11
+ }
12
+
13
+ /**
14
+ * Validate and execute an unsaved View configuration without persisting it.
15
+ * Returns the same normalized results as {@link execute}.
16
+ */
17
+ preview(payload: PreviewViewExperienceRequest): Promise<ViewExecutionResult> {
18
+ return this.post('/preview', { payload });
19
+ }
20
+ }
@@ -24,6 +24,7 @@ import { RenderingApi } from './RenderingApi.js';
24
24
  import { SchedulesApi } from './SchedulesApi.js';
25
25
  import { TaskApi } from './TaskApi.js';
26
26
  import { TypesApi } from './TypesApi.js';
27
+ import { StoreViewsApi } from './ViewsApi.js';
27
28
  import { VERSION, VERSION_HEADER } from './version.js';
28
29
  import { WorkflowsApi } from './WorkflowsApi.js';
29
30
 
@@ -125,4 +126,5 @@ export class ZenoClient extends AbstractFetchClient<ZenoClient> {
125
126
  query = new QueryApi(this);
126
127
  hiveMemory = new HiveMemoryApi(this);
127
128
  rendering = new RenderingApi(this);
129
+ views = new StoreViewsApi(this);
128
130
  }
@@ -20,5 +20,6 @@ export * from './signed-url.js';
20
20
  export * from './TaskApi.js';
21
21
  export * from './TypeCatalogApi.js';
22
22
  export * from './TypesApi.js';
23
+ export * from './ViewsApi.js';
23
24
  export { APP_VERSION_HEADER } from './version.js';
24
25
  export * from './WorkflowsApi.js';