@posiwise/flows 0.0.13 → 0.0.14

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.getList(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map((response) => response.result), catchError((error) => {
177
+ nodes = this.api.getList(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map(({ result }) => result), catchError((error) => {
178
178
  this.cache.delete(subscriptionId);
179
179
  return throwError(() => error);
180
180
  }), shareReplay({
@@ -248,7 +248,7 @@ var FlowsRunService = class FlowsRunService {
248
248
  });
249
249
  }
250
250
  getRun(id, subscriptionId) {
251
- return this.api.getItem(`${this.RUNS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
251
+ return this.api.getItem(`${this.RUNS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map(({ result }) => result));
252
252
  }
253
253
  getRunSteps(runId, subscriptionId, paging) {
254
254
  return this.api.getList(`${this.RUNS_PATH}/${runId}/steps`, {
@@ -290,7 +290,7 @@ var FlowsRunService = class FlowsRunService {
290
290
  return (response?.result ?? []).some((run) => !isFlowRunTerminal(run));
291
291
  }
292
292
  getWorkflowFields(workflowId, subscriptionId) {
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)));
293
+ return this.api.getList(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/fields`, { subscription_id: subscriptionId }).pipe(map(({ result }) => toFlowWorkflowFields(result)), catchError(() => of(NO_FLOW_WORKFLOW_FIELDS)));
294
294
  }
295
295
  definedQuery(query) {
296
296
  const params = {};
@@ -341,22 +341,22 @@ var FlowsWorkflowService = class FlowsWorkflowService {
341
341
  });
342
342
  }
343
343
  getWorkflow(id, subscriptionId) {
344
- return this.api.getItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
344
+ return this.api.getItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map(({ result }) => result));
345
345
  }
346
346
  getVersion(id, subscriptionId) {
347
- return this.api.getItem(`${FLOWS_VERSIONS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
347
+ return this.api.getItem(`${FLOWS_VERSIONS_PATH}/${id}`, { subscription_id: subscriptionId }).pipe(map(({ result }) => result));
348
348
  }
349
349
  createWorkflow(subscriptionId, attrs) {
350
350
  return this.api.postItem(FLOWS_WORKFLOWS_PATH, {
351
351
  subscription_id: subscriptionId,
352
352
  ...attrs
353
- }).pipe(map((response) => response.result));
353
+ }).pipe(map(({ result }) => result));
354
354
  }
355
355
  updateWorkflow(id, subscriptionId, attrs) {
356
356
  return this.api.putItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, {
357
357
  subscription_id: subscriptionId,
358
358
  ...attrs
359
- }).pipe(map((response) => response.result));
359
+ }).pipe(map(({ result }) => result));
360
360
  }
361
361
  deleteWorkflow(id, subscriptionId) {
362
362
  return this.api.deleteItem(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: String(subscriptionId) });
@@ -371,22 +371,22 @@ var FlowsWorkflowService = class FlowsWorkflowService {
371
371
  return this.api.postItem(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
372
372
  subscription_id: subscriptionId,
373
373
  graph
374
- }).pipe(map((response) => response.result));
374
+ }).pipe(map(({ result }) => result));
375
375
  }
376
376
  updateVersion(id, subscriptionId, graph) {
377
377
  return this.api.putItem(`${FLOWS_VERSIONS_PATH}/${id}`, {
378
378
  subscription_id: subscriptionId,
379
379
  graph
380
- }).pipe(map((response) => response.result));
380
+ }).pipe(map(({ result }) => result));
381
381
  }
382
382
  checkGraph(workflowId, subscriptionId, graph) {
383
383
  return this.api.postItem(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions/check`, {
384
384
  subscription_id: subscriptionId,
385
385
  graph
386
- }).pipe(map((response) => response.result));
386
+ }).pipe(map(({ result }) => result));
387
387
  }
388
388
  publishVersion(id, subscriptionId) {
389
- return this.api.putItem(`${FLOWS_VERSIONS_PATH}/${id}/publish`, { subscription_id: subscriptionId }).pipe(map((response) => response.result));
389
+ return this.api.putItem(`${FLOWS_VERSIONS_PATH}/${id}/publish`, { subscription_id: subscriptionId }).pipe(map(({ result }) => 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)));
@@ -1417,8 +1417,8 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
1417
1417
  }));
1418
1418
  this.cdr.markForCheck();
1419
1419
  });
1420
- this.workflowService.getWorkflows(this.subscriptionId, null, OPTIONS_PAGE).pipe(takeUntil(this.destroy$)).subscribe((response) => {
1421
- this.workflowOptions = (response.result ?? []).map((workflow) => ({
1420
+ this.workflowService.getWorkflows(this.subscriptionId, null, OPTIONS_PAGE).pipe(takeUntil(this.destroy$)).subscribe(({ result }) => {
1421
+ this.workflowOptions = (result ?? []).map((workflow) => ({
1422
1422
  value: workflow.id,
1423
1423
  label: workflow.name
1424
1424
  }));
@@ -1445,8 +1445,8 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
1445
1445
  this.emit();
1446
1446
  }
1447
1447
  loadVersions(workflowId) {
1448
- this.workflowService.getVersions(workflowId, this.subscriptionId, OPTIONS_PAGE).pipe(takeUntil(this.destroy$)).subscribe((response) => {
1449
- this.versionOptions = (response.result ?? []).map((version) => ({
1448
+ this.workflowService.getVersions(workflowId, this.subscriptionId, OPTIONS_PAGE).pipe(takeUntil(this.destroy$)).subscribe(({ result }) => {
1449
+ this.versionOptions = (result ?? []).map((version) => ({
1450
1450
  value: version.id,
1451
1451
  label: this.translation.translate("Flows.Runs.VersionLabel", { number: version.version })
1452
1452
  }));
@@ -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.result ?? []).map(toFlowMember)), tap((members) => members.forEach((member) => this.known.set(member.id, member))));
4791
+ }).pipe(map(({ result }) => (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);
@@ -7116,9 +7116,9 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
7116
7116
  }
7117
7117
  load() {
7118
7118
  this.workflowService.getVersions(this.workflowId, this.subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
7119
- next: (response) => {
7120
- this.versions = response.result ?? [];
7121
- this.totalRecords = response.page_info?.total_count ?? 0;
7119
+ next: ({ result, page_info }) => {
7120
+ this.versions = result ?? [];
7121
+ this.totalRecords = page_info?.total_count ?? 0;
7122
7122
  this.notFound = false;
7123
7123
  this.openRequestedVersion();
7124
7124
  this.settle();
@@ -7540,10 +7540,10 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
7540
7540
  search: this.searchText
7541
7541
  };
7542
7542
  this.workflowService.getWorkflows(this.subscriptionId, this.status, paging).pipe(takeUntil(this.destroy$)).subscribe({
7543
- next: (response) => {
7544
- this.workflows = response.result ?? [];
7545
- this.totalRecords = response.page_info?.total_count ?? 0;
7546
- this.totalRecordsUnFilter = response.page_info?.total_count_unfiltered ?? 0;
7543
+ next: ({ result, page_info }) => {
7544
+ this.workflows = result ?? [];
7545
+ this.totalRecords = page_info?.total_count ?? 0;
7546
+ this.totalRecordsUnFilter = page_info?.total_count_unfiltered ?? 0;
7547
7547
  this.settle();
7548
7548
  },
7549
7549
  error: () => {