@posiwise/flows 0.0.12 → 0.0.13

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.
@@ -174,7 +174,7 @@ var FlowsNodeService = class FlowsNodeService {
174
174
  cached(subscriptionId) {
175
175
  let nodes = this.cache.get(subscriptionId);
176
176
  if (!nodes) {
177
- nodes = this.api.getWithParams(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map((response) => response.flow_nodes), catchError((error) => {
177
+ nodes = this.api.getList(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map((response) => response.result), catchError((error) => {
178
178
  this.cache.delete(subscriptionId);
179
179
  return throwError(() => error);
180
180
  }), shareReplay({
@@ -241,17 +241,17 @@ var FlowsRunService = class FlowsRunService {
241
241
  this.RUNS_PATH = FLOWS_RUNS_PATH;
242
242
  }
243
243
  getRuns(subscriptionId, query = {}, paging) {
244
- return this.api.getWithParams(`${this.RUNS_PATH}/get_all`, {
244
+ return this.api.getList(`${this.RUNS_PATH}/get_all`, {
245
245
  subscription_id: subscriptionId,
246
246
  ...this.definedQuery(query),
247
247
  ...HelperService.getPagingParams(paging)
248
248
  });
249
249
  }
250
250
  getRun(id, subscriptionId) {
251
- return this.api.getWithParams(`${this.RUNS_PATH}/${id}`, { subscription_id: subscriptionId });
251
+ return this.api.getItem(`${this.RUNS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
252
252
  }
253
253
  getRunSteps(runId, subscriptionId, paging) {
254
- return this.api.getWithParams(`${this.RUNS_PATH}/${runId}/steps`, {
254
+ return this.api.getList(`${this.RUNS_PATH}/${runId}/steps`, {
255
255
  subscription_id: subscriptionId,
256
256
  ...HelperService.getPagingParams(paging)
257
257
  });
@@ -287,10 +287,10 @@ var FlowsRunService = class FlowsRunService {
287
287
  });
288
288
  }
289
289
  hasUnsettledRun(response) {
290
- return (response?.flow_runs ?? []).some((run) => !isFlowRunTerminal(run));
290
+ return (response?.result ?? []).some((run) => !isFlowRunTerminal(run));
291
291
  }
292
292
  getWorkflowFields(workflowId, subscriptionId) {
293
- return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/fields`, { subscription_id: subscriptionId }).pipe(map((response) => toFlowWorkflowFields(response.flow_workflow_fields)), catchError(() => of(NO_FLOW_WORKFLOW_FIELDS)));
293
+ return this.api.getList(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/fields`, { subscription_id: subscriptionId }).pipe(map((response) => toFlowWorkflowFields(response.result)), catchError(() => of(NO_FLOW_WORKFLOW_FIELDS)));
294
294
  }
295
295
  definedQuery(query) {
296
296
  const params = {};
@@ -334,59 +334,59 @@ var FlowsWorkflowService = class FlowsWorkflowService {
334
334
  this.api = inject(ProductsHttpService);
335
335
  }
336
336
  getWorkflows(subscriptionId, status, paging) {
337
- return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/get_all`, {
337
+ return this.api.getList(`${FLOWS_WORKFLOWS_PATH}/get_all`, {
338
338
  subscription_id: subscriptionId,
339
339
  ...status ? { status } : {},
340
340
  ...HelperService.getPagingParams(paging)
341
341
  });
342
342
  }
343
343
  getWorkflow(id, subscriptionId) {
344
- return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: subscriptionId });
344
+ return this.api.getItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
345
345
  }
346
346
  getVersion(id, subscriptionId) {
347
- return this.api.getWithParams(`${FLOWS_VERSIONS_PATH}/${id}`, { subscription_id: subscriptionId });
347
+ return this.api.getItem(`${FLOWS_VERSIONS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
348
348
  }
349
349
  createWorkflow(subscriptionId, attrs) {
350
- return this.api.post(FLOWS_WORKFLOWS_PATH, {
350
+ return this.api.postItem(FLOWS_WORKFLOWS_PATH, {
351
351
  subscription_id: subscriptionId,
352
352
  ...attrs
353
- });
353
+ }).pipe(map((response) => response.result));
354
354
  }
355
355
  updateWorkflow(id, subscriptionId, attrs) {
356
- return this.api.put(`${FLOWS_WORKFLOWS_PATH}/${id}`, {
356
+ return this.api.putItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, {
357
357
  subscription_id: subscriptionId,
358
358
  ...attrs
359
- });
359
+ }).pipe(map((response) => response.result));
360
360
  }
361
361
  deleteWorkflow(id, subscriptionId) {
362
- return this.api.delete(`${FLOWS_WORKFLOWS_PATH}/${id}`, { params: { subscription_id: String(subscriptionId) } });
362
+ return this.api.deleteItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: String(subscriptionId) });
363
363
  }
364
364
  getVersions(workflowId, subscriptionId, paging) {
365
- return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
365
+ return this.api.getList(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
366
366
  subscription_id: subscriptionId,
367
367
  ...HelperService.getPagingParams(paging)
368
368
  });
369
369
  }
370
370
  createVersion(workflowId, subscriptionId, graph) {
371
- return this.api.post(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
371
+ return this.api.postItem(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
372
372
  subscription_id: subscriptionId,
373
373
  graph
374
- });
374
+ }).pipe(map((response) => response.result));
375
375
  }
376
376
  updateVersion(id, subscriptionId, graph) {
377
- return this.api.put(`${FLOWS_VERSIONS_PATH}/${id}`, {
377
+ return this.api.putItem(`${FLOWS_VERSIONS_PATH}/${id}`, {
378
378
  subscription_id: subscriptionId,
379
379
  graph
380
- });
380
+ }).pipe(map((response) => response.result));
381
381
  }
382
382
  checkGraph(workflowId, subscriptionId, graph) {
383
- return this.api.post(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions/check`, {
383
+ return this.api.postItem(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions/check`, {
384
384
  subscription_id: subscriptionId,
385
385
  graph
386
- });
386
+ }).pipe(map((response) => response.result));
387
387
  }
388
388
  publishVersion(id, subscriptionId) {
389
- return this.api.put(`${FLOWS_VERSIONS_PATH}/${id}/publish`, { subscription_id: subscriptionId });
389
+ return this.api.putItem(`${FLOWS_VERSIONS_PATH}/${id}/publish`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
390
390
  }
391
391
  publishChecked(workflowId, version, subscriptionId) {
392
392
  return this.checkGraph(workflowId, subscriptionId, version.graph).pipe(switchMap((check) => check.valid ? this.publishVersion(version.id, subscriptionId) : of(check)));
@@ -1062,7 +1062,7 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
1062
1062
  this.watch$ = this.flowsRunService.watchRun(this.runId, subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
1063
1063
  next: (detail) => {
1064
1064
  this.run = detail.run;
1065
- this.steps = detail.steps?.flow_run_steps ?? [];
1065
+ this.steps = detail.steps?.result ?? [];
1066
1066
  this.nameNodes(subscriptionId);
1067
1067
  this.notFound = false;
1068
1068
  this.settle();
@@ -1418,7 +1418,7 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
1418
1418
  this.cdr.markForCheck();
1419
1419
  });
1420
1420
  this.workflowService.getWorkflows(this.subscriptionId, null, OPTIONS_PAGE).pipe(takeUntil(this.destroy$)).subscribe((response) => {
1421
- this.workflowOptions = (response.flow_workflows ?? []).map((workflow) => ({
1421
+ this.workflowOptions = (response.result ?? []).map((workflow) => ({
1422
1422
  value: workflow.id,
1423
1423
  label: workflow.name
1424
1424
  }));
@@ -1446,7 +1446,7 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
1446
1446
  }
1447
1447
  loadVersions(workflowId) {
1448
1448
  this.workflowService.getVersions(workflowId, this.subscriptionId, OPTIONS_PAGE).pipe(takeUntil(this.destroy$)).subscribe((response) => {
1449
- this.versionOptions = (response.flow_versions ?? []).map((version) => ({
1449
+ this.versionOptions = (response.result ?? []).map((version) => ({
1450
1450
  value: version.id,
1451
1451
  label: this.translation.translate("Flows.Runs.VersionLabel", { number: version.version })
1452
1452
  }));
@@ -1677,9 +1677,9 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
1677
1677
  };
1678
1678
  this.watch = this.flowsRunService.watchRuns(this.subscriptionId, this.query, paging).pipe(takeUntil(this.destroy$)).subscribe((response) => {
1679
1679
  if (response) {
1680
- this.runs = response.flow_runs ?? [];
1681
- this.totalRecords = response.object_count ?? 0;
1682
- this.totalRecordsUnFilter = response.unfiltered_count ?? 0;
1680
+ this.runs = response.result ?? [];
1681
+ this.totalRecords = response.page_info?.total_count ?? 0;
1682
+ this.totalRecordsUnFilter = response.page_info?.total_count_unfiltered ?? 0;
1683
1683
  }
1684
1684
  this.settle();
1685
1685
  });
@@ -4788,7 +4788,7 @@ var FlowsMemberService = class FlowsMemberService {
4788
4788
  page: 1,
4789
4789
  page_size: SEARCH_PAGE_SIZE,
4790
4790
  search: query
4791
- }).pipe(map((response) => (response.members ?? []).map(toFlowMember)), tap((members) => members.forEach((member) => this.known.set(member.id, member))));
4791
+ }).pipe(map((response) => (response.result ?? []).map(toFlowMember)), tap((members) => members.forEach((member) => this.known.set(member.id, member))));
4792
4792
  }
4793
4793
  knownMember(id) {
4794
4794
  return this.known.get(id);
@@ -7117,8 +7117,8 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
7117
7117
  load() {
7118
7118
  this.workflowService.getVersions(this.workflowId, this.subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
7119
7119
  next: (response) => {
7120
- this.versions = response.flow_versions ?? [];
7121
- this.totalRecords = response.object_count ?? 0;
7120
+ this.versions = response.result ?? [];
7121
+ this.totalRecords = response.page_info?.total_count ?? 0;
7122
7122
  this.notFound = false;
7123
7123
  this.openRequestedVersion();
7124
7124
  this.settle();
@@ -7541,9 +7541,9 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
7541
7541
  };
7542
7542
  this.workflowService.getWorkflows(this.subscriptionId, this.status, paging).pipe(takeUntil(this.destroy$)).subscribe({
7543
7543
  next: (response) => {
7544
- this.workflows = response.flow_workflows ?? [];
7545
- this.totalRecords = response.object_count ?? 0;
7546
- this.totalRecordsUnFilter = response.unfiltered_count ?? 0;
7544
+ this.workflows = response.result ?? [];
7545
+ this.totalRecords = response.page_info?.total_count ?? 0;
7546
+ this.totalRecordsUnFilter = response.page_info?.total_count_unfiltered ?? 0;
7547
7547
  this.settle();
7548
7548
  },
7549
7549
  error: () => {