@privateaim/client-vue 0.8.22 → 0.8.25

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/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { hasOwnProperty, isObject as isObject$1, merge, createMerger } from 'smob';
2
- import { hasInjectionContext, inject as inject$1, provide as provide$1, defineComponent, computed, renderSlot, normalizeProps, guardReactiveProps, createBlock, openBlock, resolveDynamicComponent, withCtx, mergeProps, h, withDirectives, isRef, onMounted, onUnmounted, watch, ref, unref, toRef, resolveComponent, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, toDisplayString, createTextVNode, Fragment, createVNode, createCommentVNode, reactive, nextTick, withModifiers, renderList, getCurrentInstance, useTemplateRef, toHandlers, resolveDirective, vModelCheckbox, vShow } from 'vue';
2
+ import { hasInjectionContext, inject as inject$1, provide as provide$1, defineComponent, computed, renderSlot, normalizeProps, guardReactiveProps, openBlock, createBlock, resolveDynamicComponent, withCtx, mergeProps, h, withDirectives, isRef, onMounted, onUnmounted, watch, ref, unref, toRef, resolveComponent, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, toDisplayString, createTextVNode, Fragment, createVNode, createCommentVNode, reactive, nextTick, withModifiers, renderList, getCurrentInstance, useTemplateRef, toHandlers, resolveDirective, vModelCheckbox, vShow } from 'vue';
3
3
  import { VCLink } from '@vuecs/link';
4
4
  import { AnalysisError, buildDomainNamespaceName, DomainEventSubscriptionName, buildDomainChannelName, AnalysisCommand, AnalysisConfiguratorCommandChecker, AnalysisDistributorCommandChecker, AnalysisBuilderCommandChecker, DomainType, ProjectNodeApprovalCommand, ProjectNodeApprovalStatus, DomainSubType, AnalysisBucketType, MasterImageCommand, AnalysisNodeApprovalCommand, AnalysisNodeApprovalStatus, RegistryAPICommand, registryRobotSecretRegex, ServiceID, RegistryProjectType, NodeType } from '@privateaim/core-kit';
5
- import { extractErrorMessage, hasOwnProperty as hasOwnProperty$1, buildDomainEventFullName, PermissionName, ProcessStatus, humanFileSize, createNanoID, alphaNumHyphenUnderscoreRegex, hexToUTF8, isHex, CryptoAsymmetricAlgorithm, exportAsymmetricPublicKey, exportAsymmetricPrivateKey } from '@privateaim/kit';
6
- import { injectHTTPClientAuthenticationHook, inject as inject$2, provide as provide$2, injectStore, storeToRefs, injectStoreDispatcher, StoreDispatcherEventName, usePermissionCheck, useTranslation, TranslatorTranslationGroup, ATitle, ASearch, APagination, createFormSubmitTranslations, buildFormSubmitWithTranslations, TranslatorTranslationDefaultKey, ARobot, AUser, renderToggleButton as renderToggleButton$1, defineEntityCollectionVProps, APermissions, ARealms, AClient, AClientForm } from '@authup/client-web-kit';
5
+ import { extractErrorMessage, hasOwnProperty as hasOwnProperty$1, buildDomainEventFullName, PermissionName, ProcessStatus, humanFileSize, createNanoID, alphaNumHyphenUnderscoreRegex, isHex, hexToUTF8, CryptoAsymmetricAlgorithm, exportAsymmetricPublicKey, exportAsymmetricPrivateKey } from '@privateaim/kit';
6
+ import { injectHTTPClientAuthenticationHook, inject as inject$2, provide as provide$2, injectStore, storeToRefs, injectStoreDispatcher, StoreDispatcherEventName, usePermissionCheck, useTranslation, TranslatorTranslationGroup, ATitle, ASearch, APagination, createFormSubmitTranslations, buildFormSubmitWithTranslations, TranslatorTranslationDefaultKey, ARobot, AUser, renderToggleButton as renderToggleButton$1, APermissions, defineEntityCollectionVProps, ARealms, AClient, AClientForm } from '@authup/client-web-kit';
7
7
  import { vBTooltip, BModal } from 'bootstrap-vue-next';
8
8
  import { buildList, SlotName } from '@vuecs/list-controls';
9
9
  import { Client, isClientErrorWithStatusCode } from '@privateaim/core-http-kit';
@@ -1228,7 +1228,7 @@ function createList(context) {
1228
1228
  return createListRaw(context);
1229
1229
  }
1230
1230
 
1231
- var EntityListSlotName = /*#__PURE__*/ function(EntityListSlotName) {
1231
+ var EntityListSlotName = function(EntityListSlotName) {
1232
1232
  EntityListSlotName[EntityListSlotName["DEFAULT"] = SlotName.DEFAULT] = "DEFAULT";
1233
1233
  EntityListSlotName[EntityListSlotName["BODY"] = SlotName.BODY] = "BODY";
1234
1234
  EntityListSlotName[EntityListSlotName["ITEM"] = SlotName.ITEM] = "ITEM";
@@ -1751,9 +1751,9 @@ const FAnalysisCommand = defineComponent({
1751
1751
  ],
1752
1752
  setup (props, { emit, slots }) {
1753
1753
  const apiClient = injectCoreHTTPClient();
1754
- const busy = ref(false);
1754
+ const isBusy = ref(false);
1755
1755
  const entity = toRef(props, 'entity');
1756
- const execute = wrapFnWithBusyState(busy, async ()=>{
1756
+ const execute = wrapFnWithBusyState(isBusy, async ()=>{
1757
1757
  try {
1758
1758
  const response = await apiClient.analysis.runCommand(entity.value.id, props.command);
1759
1759
  emit('executed', props.command);
@@ -6543,26 +6543,49 @@ var _sfc_main$j = defineComponent({
6543
6543
  },
6544
6544
  props: {
6545
6545
  entityId: {
6546
- type: String
6546
+ type: String,
6547
+ required: true
6547
6548
  },
6548
6549
  type: {
6549
6550
  type: String
6550
6551
  }
6551
6552
  },
6552
- setup (_, { emit }) {
6553
+ emits: [
6554
+ 'updated',
6555
+ 'executed',
6556
+ 'failed'
6557
+ ],
6558
+ setup (props, { emit }) {
6553
6559
  const vNode = useTemplateRef('analysisBucket');
6560
+ const httpClient = injectCoreHTTPClient();
6554
6561
  const forward = (name, ...args)=>{
6555
6562
  emit(name, ...args);
6556
6563
  };
6557
- const retry = ()=>{
6564
+ const isBusy = ref(false);
6565
+ const execute = wrapFnWithBusyState(isBusy, async ()=>{
6566
+ try {
6567
+ const response = await httpClient.analysis.runCommand(props.entityId, AnalysisCommand.STORAGE_CHECK);
6568
+ emit('executed', AnalysisCommand.STORAGE_CHECK);
6569
+ emit('updated', response);
6570
+ } catch (e) {
6571
+ if (e instanceof Error) {
6572
+ emit('failed', e);
6573
+ }
6574
+ }
6575
+ });
6576
+ const refresh = ()=>{
6558
6577
  if (vNode.value) {
6559
6578
  vNode.value.resolve({
6560
6579
  reset: true
6561
6580
  });
6562
6581
  }
6563
6582
  };
6583
+ const retry = ()=>{
6584
+ Promise.resolve().then(()=>execute()).then(()=>refresh());
6585
+ };
6564
6586
  return {
6565
6587
  forward,
6588
+ refresh,
6566
6589
  retry
6567
6590
  };
6568
6591
  }
@@ -6577,7 +6600,7 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
6577
6600
  analysis_id: _ctx.entityId,
6578
6601
  type: _ctx.type
6579
6602
  }
6580
- }, _ctx.$props, toHandlers(_ctx.forward)), {
6603
+ }, toHandlers(_ctx.forward)), {
6581
6604
  default: withCtx((props) => [
6582
6605
  renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(props)))
6583
6606
  ]),
@@ -9346,12 +9369,9 @@ var _sfc_main$1 = defineComponent({
9346
9369
  busy.value = true;
9347
9370
  const response = await httpClient.event.getMany(query);
9348
9371
  data.value = response.data;
9349
- meta.value = {
9350
- ...meta.value,
9351
- pagination: {
9352
- ...meta.value.pagination,
9353
- ...response.meta
9354
- }
9372
+ meta.value.pagination = {
9373
+ ...meta.value.pagination,
9374
+ ...response.meta
9355
9375
  };
9356
9376
  busy.value = false;
9357
9377
  };