@myparcel-dev/pdk-admin 1.13.0
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 +459 -0
- package/dist/__tests__/doComponentTestSetup.d.ts +2 -0
- package/dist/__tests__/doComponentTestTeardown.d.ts +1 -0
- package/dist/__tests__/index.d.ts +3 -0
- package/dist/__tests__/mocks/index.d.ts +14 -0
- package/dist/__tests__/mocks/mockDefaultAccount.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultAppConfig.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultAppInfo.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultCarriers.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultConfig.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultDynamicContext.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultEndpoints.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultGlobalContext.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultLogger.d.ts +1 -0
- package/dist/__tests__/mocks/mockDefaultPlatform.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultPluginSettings.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultPrintOptionsView.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultShop.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultTranslations.d.ts +2 -0
- package/dist/actions/composables/index.d.ts +2 -0
- package/dist/actions/composables/mutations/account/index.d.ts +2 -0
- package/dist/actions/composables/mutations/account/useDeleteAccountMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/account/useUpdateAccountMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/index.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/useDownloadLogsMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/useSwitchToAcceptanceApiMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/useSwitchToProductionApiMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/index.d.ts +7 -0
- package/dist/actions/composables/mutations/orders/index.d.ts +3 -0
- package/dist/actions/composables/mutations/orders/useExportOrdersMutation.d.ts +5 -0
- package/dist/actions/composables/mutations/orders/usePrintOrdersMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/orders/useUpdateOrdersMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/settings/index.d.ts +2 -0
- package/dist/actions/composables/mutations/settings/useUpdatePluginSettingsMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/settings/useUpdateProductSettingsMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/shipments/index.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/useDeleteShipmentsMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/useExportReturnMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/usePrintShipmentsMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/useUpdateShipmentsMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/usePdkMutation.d.ts +15 -0
- package/dist/actions/composables/mutations/webhooks/index.d.ts +2 -0
- package/dist/actions/composables/mutations/webhooks/useCreateWebhooksMutation.d.ts +1 -0
- package/dist/actions/composables/mutations/webhooks/useDeleteWebhooksMutation.d.ts +3 -0
- package/dist/actions/composables/queries/account/index.d.ts +1 -0
- package/dist/actions/composables/queries/account/useFetchContextQuery.d.ts +3 -0
- package/dist/actions/composables/queries/index.d.ts +6 -0
- package/dist/actions/composables/queries/orders/index.d.ts +1 -0
- package/dist/actions/composables/queries/orders/useFetchOrdersQuery.d.ts +3 -0
- package/dist/actions/composables/queries/products/index.d.ts +1 -0
- package/dist/actions/composables/queries/products/useFetchProductsQuery.d.ts +3 -0
- package/dist/actions/composables/queries/queryKeys.d.ts +2 -0
- package/dist/actions/composables/queries/shipments/index.d.ts +1 -0
- package/dist/actions/composables/queries/shipments/useFetchShipmentsQuery.d.ts +4 -0
- package/dist/actions/composables/queries/webhooks/index.d.ts +1 -0
- package/dist/actions/composables/queries/webhooks/useFetchWebhooksQuery.d.ts +3 -0
- package/dist/actions/defineAction.d.ts +8 -0
- package/dist/actions/definitions/account.d.ts +13 -0
- package/dist/actions/definitions/context.d.ts +6 -0
- package/dist/actions/definitions/debug.d.ts +13 -0
- package/dist/actions/definitions/index.d.ts +8 -0
- package/dist/actions/definitions/modal.d.ts +17 -0
- package/dist/actions/definitions/orders.d.ts +38 -0
- package/dist/actions/definitions/settings.d.ts +2 -0
- package/dist/actions/definitions/shipments.d.ts +15 -0
- package/dist/actions/definitions/webhooks.d.ts +4 -0
- package/dist/actions/executors/createHandlerWithParameters.d.ts +5 -0
- package/dist/actions/executors/createMutationHandler.d.ts +3 -0
- package/dist/actions/executors/createOrdersMutationHandler.d.ts +2 -0
- package/dist/actions/executors/createQueryHandler.d.ts +3 -0
- package/dist/actions/executors/createShipmentsMutationHandler.d.ts +2 -0
- package/dist/actions/executors/doMutate.d.ts +4 -0
- package/dist/actions/executors/executeAction.d.ts +6 -0
- package/dist/actions/executors/executeAfterHandle.d.ts +3 -0
- package/dist/actions/executors/executeBeforeHandle.d.ts +4 -0
- package/dist/actions/executors/executeHandler.d.ts +3 -0
- package/dist/actions/executors/executeNextAction.d.ts +6 -0
- package/dist/actions/executors/index.d.ts +14 -0
- package/dist/actions/executors/resolveOrderParameters.d.ts +3 -0
- package/dist/actions/executors/resolveQuerySuffix.d.ts +3 -0
- package/dist/actions/executors/types.d.ts +19 -0
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/print/index.d.ts +3 -0
- package/dist/actions/print/openOrPrintPdf.d.ts +3 -0
- package/dist/actions/print/resolvePrintParameters.d.ts +3 -0
- package/dist/actions/print/waitForLabelPrompt.d.ts +3 -0
- package/dist/actions/stopActionHandler.d.ts +2 -0
- package/dist/components/OrderBox/OrderShipmentsTable.vue.d.ts +6 -0
- package/dist/components/OrderBox/OrderShipmentsTableRow.vue.d.ts +21 -0
- package/dist/components/OrderBox/ShipmentOptionsBox.vue.d.ts +2 -0
- package/dist/components/OrderBox/ShipmentTableBox.vue.d.ts +2 -0
- package/dist/components/OrderListItem/OrderModeOrderListItem.vue.d.ts +2 -0
- package/dist/components/OrderListItem/ShipmentLabel.vue.d.ts +15 -0
- package/dist/components/OrderListItem/ShipmentModeOrderListItem.vue.d.ts +2 -0
- package/dist/components/PluginSettings/AccountSettings.vue.d.ts +2 -0
- package/dist/components/PluginSettings/DebugOptions.vue.d.ts +2 -0
- package/dist/components/PluginSettings/EditApiKeyForm.vue.d.ts +7 -0
- package/dist/components/PluginSettings/PluginSettingsForms.vue.d.ts +2 -0
- package/dist/components/PluginSettings/WebhooksStatus.vue.d.ts +2 -0
- package/dist/components/PluginSettings/createUpdateAccountSettingsValidator.d.ts +4 -0
- package/dist/components/common/ActionButton.vue.d.ts +52 -0
- package/dist/components/common/BulkSelectCheckbox.vue.d.ts +22 -0
- package/dist/components/common/CarrierLogo.vue.d.ts +16 -0
- package/dist/components/common/DateRelative.vue.d.ts +16 -0
- package/dist/components/common/DeliveryOptionsDeliveryType.vue.d.ts +16 -0
- package/dist/components/common/DeliveryOptionsExcerpt.vue.d.ts +2 -0
- package/dist/components/common/DeliveryOptionsExcerptCarrierName.vue.d.ts +16 -0
- package/dist/components/common/DeliveryOptionsPackageType.vue.d.ts +16 -0
- package/dist/components/common/DigitalStampWeightRange.vue.d.ts +15 -0
- package/dist/components/common/NotificationContainer.vue.d.ts +19 -0
- package/dist/components/common/PackageType.vue.d.ts +16 -0
- package/dist/components/common/PlainElement.d.ts +2 -0
- package/dist/components/common/ResetButton.vue.d.ts +15 -0
- package/dist/components/common/ReturnsForm.vue.d.ts +14 -0
- package/dist/components/common/ShipmentBarcode.vue.d.ts +15 -0
- package/dist/components/common/ShipmentOptionsForm.vue.d.ts +16 -0
- package/dist/components/common/ShipmentStatus.vue.d.ts +15 -0
- package/dist/components/common/StatusIndicator.vue.d.ts +23 -0
- package/dist/components/common/SubmitButton.vue.d.ts +15 -0
- package/dist/components/common/TabNavigation.vue.d.ts +66 -0
- package/dist/components/common/index.d.ts +20 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/modals/PrintOptionsModal.vue.d.ts +2 -0
- package/dist/components/modals/PrintOptionsModalForm.vue.d.ts +2 -0
- package/dist/components/modals/ShipmentOptionsModal.vue.d.ts +2 -0
- package/dist/components/modals/ShipmentOptionsModalForm.vue.d.ts +16 -0
- package/dist/composables/components/index.d.ts +15 -0
- package/dist/composables/components/useBulkSelectCheckbox.d.ts +9 -0
- package/dist/composables/components/useCheckboxGroupContext.d.ts +4 -0
- package/dist/composables/components/useDropOffInputContext.d.ts +13 -0
- package/dist/composables/components/useDropdownButtonContext.d.ts +15 -0
- package/dist/composables/components/useElementContext.d.ts +7 -0
- package/dist/composables/components/useElementOptions.d.ts +6 -0
- package/dist/composables/components/useInputWithOptionsContext.d.ts +10 -0
- package/dist/composables/components/useModalElementContext.d.ts +11 -0
- package/dist/composables/components/useMultiSelectInputContext.d.ts +4 -0
- package/dist/composables/components/useRadioGroupContext.d.ts +10 -0
- package/dist/composables/components/useSelectInputContext.d.ts +4 -0
- package/dist/composables/components/useShippingMethodsInputContext.d.ts +13 -0
- package/dist/composables/components/useTableContext.d.ts +7 -0
- package/dist/composables/components/useToggleInputContext.d.ts +11 -0
- package/dist/composables/components/useTriStateInputContext.d.ts +17 -0
- package/dist/composables/context/index.d.ts +7 -0
- package/dist/composables/context/useAppInfo.d.ts +2 -0
- package/dist/composables/context/useContext.d.ts +3 -0
- package/dist/composables/context/useGlobalContext.d.ts +2 -0
- package/dist/composables/context/useInstanceContext.d.ts +8 -0
- package/dist/composables/context/useModalContext.d.ts +11 -0
- package/dist/composables/context/useModalOrder.d.ts +1 -0
- package/dist/composables/context/usePluginSettings.d.ts +2 -0
- package/dist/composables/formatter/default/createCurrencyFormat.d.ts +1 -0
- package/dist/composables/formatter/default/createLongDateFormat.d.ts +1 -0
- package/dist/composables/formatter/default/createRelativeTimeFormat.d.ts +1 -0
- package/dist/composables/formatter/default/defaultCurrencyFormatters.d.ts +2 -0
- package/dist/composables/formatter/default/defaultDateFormatters.d.ts +4 -0
- package/dist/composables/formatter/default/index.d.ts +6 -0
- package/dist/composables/formatter/default/parseDate.d.ts +1 -0
- package/dist/composables/formatter/formatter.types.d.ts +23 -0
- package/dist/composables/formatter/index.d.ts +4 -0
- package/dist/composables/formatter/useFormatter.d.ts +2 -0
- package/dist/composables/formatter/useLocalizedFormatter.d.ts +2 -0
- package/dist/composables/index.d.ts +17 -0
- package/dist/composables/language/index.d.ts +4 -0
- package/dist/composables/language/resolveTranslatedString.d.ts +3 -0
- package/dist/composables/language/resolveTranslationKey.d.ts +2 -0
- package/dist/composables/language/types.d.ts +1 -0
- package/dist/composables/language/useLanguage.d.ts +23 -0
- package/dist/composables/orders/index.d.ts +3 -0
- package/dist/composables/orders/useOrder.d.ts +3 -0
- package/dist/composables/orders/useOrderData.d.ts +9 -0
- package/dist/composables/orders/useOrdersData.d.ts +3 -0
- package/dist/composables/products/index.d.ts +1 -0
- package/dist/composables/products/useProductData.d.ts +8 -0
- package/dist/composables/shipments/index.d.ts +3 -0
- package/dist/composables/shipments/useShipment.d.ts +3 -0
- package/dist/composables/shipments/useShipmentData.d.ts +12 -0
- package/dist/composables/shipments/useShipmentsData.d.ts +2 -0
- package/dist/composables/useAdminConfig.d.ts +2 -0
- package/dist/composables/useAdminInstance.d.ts +2 -0
- package/dist/composables/useDigitalStampRanges.d.ts +9 -0
- package/dist/composables/useGlobalPdkAdmin.d.ts +2 -0
- package/dist/composables/useLoadMore.d.ts +14 -0
- package/dist/composables/useLoading.d.ts +10 -0
- package/dist/composables/useLogger.d.ts +2 -0
- package/dist/composables/useStoreContextQuery.d.ts +3 -0
- package/dist/composables/useStoreQuery.d.ts +4 -0
- package/dist/composables/useWeekdays.d.ts +9 -0
- package/dist/data/components.d.ts +195 -0
- package/dist/data/constants.d.ts +63 -0
- package/dist/data/endpoints.d.ts +5 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/view.d.ts +9 -0
- package/dist/deprecated.d.ts +6 -0
- package/dist/forms/createReturnsForm.d.ts +1 -0
- package/dist/forms/form-builder/builders/buildAfterUpdate.d.ts +3 -0
- package/dist/forms/form-builder/builders/buildFormStateWatcher.d.ts +3 -0
- package/dist/forms/form-builder/builders/index.d.ts +2 -0
- package/dist/forms/form-builder/conditions/index.d.ts +3 -0
- package/dist/forms/form-builder/conditions/validateIfCondition.d.ts +2 -0
- package/dist/forms/form-builder/conditions/validateIfConditions.d.ts +2 -0
- package/dist/forms/form-builder/conditions/validateIsTruthy.d.ts +2 -0
- package/dist/forms/form-builder/index.d.ts +5 -0
- package/dist/forms/form-builder/operations/executeCustomOperationHandlers.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeOperation.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeOperations.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeSetPropOperation.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeSetValueOperation.d.ts +2 -0
- package/dist/forms/form-builder/operations/index.d.ts +5 -0
- package/dist/forms/form-builder/operations/parseBuilders.d.ts +3 -0
- package/dist/forms/form-builder/types/FormCondition.types.d.ts +36 -0
- package/dist/forms/form-builder/types/FormOperations.types.d.ts +16 -0
- package/dist/forms/form-builder/types/SubOperationBuilder.types.d.ts +13 -0
- package/dist/forms/form-builder/types/common.types.d.ts +21 -0
- package/dist/forms/form-builder/types/index.d.ts +4 -0
- package/dist/forms/form-builder/utils/createPropSetter.d.ts +4 -0
- package/dist/forms/form-builder/utils/createValueGetter.d.ts +4 -0
- package/dist/forms/form-builder/utils/createValueSetter.d.ts +4 -0
- package/dist/forms/form-builder/utils/index.d.ts +4 -0
- package/dist/forms/formKeys.d.ts +10 -0
- package/dist/forms/helpers/addBulkEditNotification.d.ts +1 -0
- package/dist/forms/helpers/createDefaultOption.d.ts +3 -0
- package/dist/forms/helpers/createHasShipmentOptionWatcher.d.ts +3 -0
- package/dist/forms/helpers/createLabel.d.ts +1 -0
- package/dist/forms/helpers/defineFormField.d.ts +2 -0
- package/dist/forms/helpers/getCarrier.d.ts +3 -0
- package/dist/forms/helpers/getDeliveryTypes.d.ts +3 -0
- package/dist/forms/helpers/getFieldLabel.d.ts +2 -0
- package/dist/forms/helpers/getFormCarrierName.d.ts +2 -0
- package/dist/forms/helpers/getInsuranceOptions.d.ts +3 -0
- package/dist/forms/helpers/getPackageTypes.d.ts +3 -0
- package/dist/forms/helpers/hasPostNlAgeCheck.d.ts +2 -0
- package/dist/forms/helpers/hasShipmentOption.d.ts +3 -0
- package/dist/forms/helpers/index.d.ts +20 -0
- package/dist/forms/helpers/isPackageTypePackage.d.ts +2 -0
- package/dist/forms/helpers/isPackageTypePackageOrSmall.d.ts +2 -0
- package/dist/forms/helpers/isPackageTypeSmallPackage.d.ts +2 -0
- package/dist/forms/helpers/resolveFormComponent.d.ts +3 -0
- package/dist/forms/helpers/setFieldProp.d.ts +8 -0
- package/dist/forms/helpers/setPostNlAgeCheckSubtext.d.ts +2 -0
- package/dist/forms/helpers/triStateFieldIsEnabled.d.ts +2 -0
- package/dist/forms/helpers/updateFieldsDefaults.d.ts +6 -0
- package/dist/forms/index.d.ts +6 -0
- package/dist/forms/pluginSettings/createFormTab.d.ts +3 -0
- package/dist/forms/pluginSettings/createPluginSettingsForm.d.ts +4 -0
- package/dist/forms/pluginSettings/createPluginSettingsTabs.d.ts +4 -0
- package/dist/forms/pluginSettings/createPluginSettingsTabsComponent.d.ts +4 -0
- package/dist/forms/pluginSettings/generateFormFields.d.ts +8 -0
- package/dist/forms/pluginSettings/index.d.ts +6 -0
- package/dist/forms/pluginSettings/types.d.ts +13 -0
- package/dist/forms/shipmentOptions/createShipmentOptionsForm.d.ts +4 -0
- package/dist/forms/shipmentOptions/field.d.ts +34 -0
- package/dist/forms/shipmentOptions/fields/createAgeCheckField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createCarrierField.d.ts +4 -0
- package/dist/forms/shipmentOptions/fields/createDeliveryTypeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createDigitalStampRangeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createDirectReturnField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createHideSenderField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createInsuranceField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createLabelAmountField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createLargeFormatField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createOnlyRecipientField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createPackageTypeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createReceiptCodeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createRef.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createSameDayDeliveryField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createShipmentOptionField.d.ts +4 -0
- package/dist/forms/shipmentOptions/fields/createSignatureField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/index.d.ts +14 -0
- package/dist/forms/shipmentOptions/index.d.ts +4 -0
- package/dist/forms/shipmentOptions/types.d.ts +2 -0
- package/dist/index.d.ts +19 -0
- package/dist/pdk/PdkAdmin.d.ts +18 -0
- package/dist/pdk/boot.d.ts +3 -0
- package/dist/pdk/createAdminConfig.d.ts +2 -0
- package/dist/pdk/createPdkAdmin.d.ts +8 -0
- package/dist/pdk/createPdkAdminPlugin.d.ts +3 -0
- package/dist/pdk/fillShipmentsQueryData.d.ts +4 -0
- package/dist/pdk/index.d.ts +11 -0
- package/dist/pdk/instance/createInstanceContext.d.ts +5 -0
- package/dist/pdk/instance/createQueryClient.d.ts +2 -0
- package/dist/pdk/instance/index.d.ts +3 -0
- package/dist/pdk/instance/plugins/createContextPlugin.d.ts +2 -0
- package/dist/pdk/instance/plugins/createLoggerPlugin.d.ts +2 -0
- package/dist/pdk/instance/plugins/createRegisterComponentsPlugin.d.ts +5 -0
- package/dist/pdk/instance/plugins/createStorePlugin.d.ts +2 -0
- package/dist/pdk/instance/plugins/createVueQueryPlugin.d.ts +5 -0
- package/dist/pdk/instance/plugins/index.d.ts +6 -0
- package/dist/pdk/instance/plugins/plugins.types.d.ts +3 -0
- package/dist/pdk/renderMap.d.ts +3 -0
- package/dist/pdk/sendBootEvent.d.ts +3 -0
- package/dist/pdk/setupAdminApp.d.ts +3 -0
- package/dist/pdk/testIdDirective.d.ts +5 -0
- package/dist/sdk/PdkFetchClient.d.ts +11 -0
- package/dist/sdk/composables/api/index.d.ts +1 -0
- package/dist/sdk/composables/api/useFetchCarrier.d.ts +2 -0
- package/dist/sdk/composables/index.d.ts +3 -0
- package/dist/sdk/composables/useMyParcelApi.d.ts +5 -0
- package/dist/sdk/composables/usePdkAdminApi.d.ts +6 -0
- package/dist/sdk/endpoints/abstractPdkEndpoint.d.ts +7 -0
- package/dist/sdk/endpoints/index.d.ts +1 -0
- package/dist/sdk/index.d.ts +3 -0
- package/dist/services/actions/createAction.d.ts +4 -0
- package/dist/services/actions/createActionContext.d.ts +3 -0
- package/dist/services/actions/downloadFile.d.ts +4 -0
- package/dist/services/actions/getActionIdentifier.d.ts +2 -0
- package/dist/services/actions/index.d.ts +4 -0
- package/dist/services/addErrorToNotifications.d.ts +2 -0
- package/dist/services/context/getElementContext.d.ts +2 -0
- package/dist/services/context/index.d.ts +1 -0
- package/dist/services/createNotification.d.ts +5 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/instantiateAction.d.ts +2 -0
- package/dist/services/instantiateActions.d.ts +8 -0
- package/dist/services/logger.d.ts +19 -0
- package/dist/services/mutations/getCallbackForMutationMode.d.ts +4 -0
- package/dist/services/mutations/getModalMutationOptions.d.ts +2 -0
- package/dist/services/mutations/index.d.ts +3 -0
- package/dist/services/mutations/mutationMode.d.ts +4 -0
- package/dist/services/print/index.d.ts +1 -0
- package/dist/services/print/openPdfInNewWindow.d.ts +4 -0
- package/dist/stores/createQueryCacheKey.d.ts +3 -0
- package/dist/stores/index.d.ts +6 -0
- package/dist/stores/types.d.ts +13 -0
- package/dist/stores/useActionStore.d.ts +25 -0
- package/dist/stores/useModalStore.d.ts +16 -0
- package/dist/stores/useNotificationStore.d.ts +60 -0
- package/dist/stores/useQueryStore.d.ts +77 -0
- package/dist/symbols.d.ts +5 -0
- package/dist/testing.d.ts +1 -0
- package/dist/types/actions/actions.types.d.ts +31 -0
- package/dist/types/actions/endpoints.types.d.ts +9 -0
- package/dist/types/actions/index.d.ts +4 -0
- package/dist/types/actions/parameters.types.d.ts +55 -0
- package/dist/types/actions/response.types.d.ts +7 -0
- package/dist/types/actions.types.d.ts +45 -0
- package/dist/types/admin.types.d.ts +26 -0
- package/dist/types/common.types.d.ts +53 -0
- package/dist/types/components-form.types.d.ts +107 -0
- package/dist/types/components.types.d.ts +273 -0
- package/dist/types/configuration.types.d.ts +95 -0
- package/dist/types/context.types.d.ts +20 -0
- package/dist/types/endpoints.types.d.ts +7 -0
- package/dist/types/form.types.d.ts +39 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/language.types.d.ts +9 -0
- package/dist/types/sdk.types.d.ts +155 -0
- package/dist/utils/booleanToTriState.d.ts +2 -0
- package/dist/utils/convertDotNotationToObject.d.ts +1 -0
- package/dist/utils/createAssetUrl.d.ts +1 -0
- package/dist/utils/createClasses.d.ts +8 -0
- package/dist/utils/createObjectWithKeys.d.ts +3 -0
- package/dist/utils/decodeHtmlEntities.d.ts +7 -0
- package/dist/utils/downloadBlob.d.ts +1 -0
- package/dist/utils/downloadFileFromUrl.d.ts +1 -0
- package/dist/utils/encodeArrayParameter.d.ts +2 -0
- package/dist/utils/extendAdminInstance.d.ts +2 -0
- package/dist/utils/fakeLinkClick.d.ts +4 -0
- package/dist/utils/forms/createFormElement.d.ts +3 -0
- package/dist/utils/forms/createShipmentFormName.d.ts +1 -0
- package/dist/utils/forms/formToBody.d.ts +2 -0
- package/dist/utils/forms/generateFieldId.d.ts +3 -0
- package/dist/utils/forms/index.d.ts +4 -0
- package/dist/utils/generateLabelFilename.d.ts +3 -0
- package/dist/utils/getOrderId.d.ts +3 -0
- package/dist/utils/getOrderShipmentIds.d.ts +2 -0
- package/dist/utils/index.d.ts +22 -0
- package/dist/utils/openUrlInNewTab.d.ts +1 -0
- package/dist/utils/prefixComponent.d.ts +3 -0
- package/dist/utils/query/index.d.ts +3 -0
- package/dist/utils/query/setQueryData.d.ts +2 -0
- package/dist/utils/query/setQueryOrder.d.ts +10 -0
- package/dist/utils/query/setQueryShipment.d.ts +3 -0
- package/dist/utils/resolveCarrier.d.ts +1 -0
- package/dist/utils/translations/getDeliveryTypeTranslation.d.ts +2 -0
- package/dist/utils/translations/getDynamicTranslation.d.ts +1 -0
- package/dist/utils/translations/getPackageTypeTranslation.d.ts +2 -0
- package/dist/utils/translations/index.d.ts +4 -0
- package/dist/utils/translations/translateSelectOption.d.ts +3 -0
- package/dist/utils/triStateToBoolean.d.ts +2 -0
- package/dist/utils/unprefixComponent.d.ts +3 -0
- package/dist/utils/validateId.d.ts +2 -0
- package/dist/views/ChildProductSettings.vue.d.ts +2 -0
- package/dist/views/Modals.vue.d.ts +2 -0
- package/dist/views/Notifications.vue.d.ts +2 -0
- package/dist/views/OrderBox.vue.d.ts +2 -0
- package/dist/views/OrderListItem.vue.d.ts +2 -0
- package/dist/views/PluginSettings.vue.d.ts +2 -0
- package/dist/views/ProductSettings.vue.d.ts +35 -0
- package/dist/views/integrated/OrderBoxView.vue.d.ts +12 -0
- package/dist/views/integrated/OrderListItemView.vue.d.ts +12 -0
- package/dist/views/integrated/index.d.ts +7 -0
- package/package.json +70 -0
- package/src/__tests__/__snapshots__/exports.spec.ts.snap +195 -0
- package/src/__tests__/doComponentTestSetup.ts +54 -0
- package/src/__tests__/doComponentTestTeardown.ts +6 -0
- package/src/__tests__/exports.spec.ts +13 -0
- package/src/__tests__/getElementContext.spec.ts +18 -0
- package/src/__tests__/index.ts +3 -0
- package/src/__tests__/mocks/index.ts +14 -0
- package/src/__tests__/mocks/mockDefaultAccount.ts +18 -0
- package/src/__tests__/mocks/mockDefaultAppConfig.ts +21 -0
- package/src/__tests__/mocks/mockDefaultAppInfo.ts +12 -0
- package/src/__tests__/mocks/mockDefaultCarriers.ts +4 -0
- package/src/__tests__/mocks/mockDefaultConfig.ts +11 -0
- package/src/__tests__/mocks/mockDefaultDynamicContext.ts +17 -0
- package/src/__tests__/mocks/mockDefaultEndpoints.ts +19 -0
- package/src/__tests__/mocks/mockDefaultGlobalContext.ts +21 -0
- package/src/__tests__/mocks/mockDefaultLogger.ts +4 -0
- package/src/__tests__/mocks/mockDefaultPlatform.ts +14 -0
- package/src/__tests__/mocks/mockDefaultPluginSettings.ts +15 -0
- package/src/__tests__/mocks/mockDefaultPrintOptionsView.ts +13 -0
- package/src/__tests__/mocks/mockDefaultShop.ts +20 -0
- package/src/__tests__/mocks/mockDefaultTranslations.ts +4 -0
- package/src/__tests__/render.spec.ts +53 -0
- package/src/__tests__/utils/mockLinkElement.ts +20 -0
- package/src/actions/composables/index.ts +2 -0
- package/src/actions/composables/mutations/account/index.ts +2 -0
- package/src/actions/composables/mutations/account/useDeleteAccountMutation.ts +30 -0
- package/src/actions/composables/mutations/account/useUpdateAccountMutation.ts +60 -0
- package/src/actions/composables/mutations/debug/index.ts +3 -0
- package/src/actions/composables/mutations/debug/useDownloadLogsMutation.ts +8 -0
- package/src/actions/composables/mutations/debug/useSwitchToAcceptanceApiMutation.ts +10 -0
- package/src/actions/composables/mutations/debug/useSwitchToProductionApiMutation.ts +10 -0
- package/src/actions/composables/mutations/index.ts +7 -0
- package/src/actions/composables/mutations/orders/index.ts +3 -0
- package/src/actions/composables/mutations/orders/useExportOrdersMutation.ts +51 -0
- package/src/actions/composables/mutations/orders/usePrintOrdersMutation.ts +23 -0
- package/src/actions/composables/mutations/orders/useUpdateOrdersMutation.ts +36 -0
- package/src/actions/composables/mutations/settings/index.ts +2 -0
- package/src/actions/composables/mutations/settings/useUpdatePluginSettingsMutation.ts +16 -0
- package/src/actions/composables/mutations/settings/useUpdateProductSettingsMutation.ts +22 -0
- package/src/actions/composables/mutations/shipments/index.ts +4 -0
- package/src/actions/composables/mutations/shipments/useDeleteShipmentsMutation.ts +65 -0
- package/src/actions/composables/mutations/shipments/useExportReturnMutation.ts +36 -0
- package/src/actions/composables/mutations/shipments/usePrintShipmentsMutation.ts +39 -0
- package/src/actions/composables/mutations/shipments/useUpdateShipmentsMutation.ts +36 -0
- package/src/actions/composables/mutations/usePdkMutation.ts +41 -0
- package/src/actions/composables/mutations/webhooks/index.ts +2 -0
- package/src/actions/composables/mutations/webhooks/useCreateWebhooksMutation.ts +20 -0
- package/src/actions/composables/mutations/webhooks/useDeleteWebhooksMutation.ts +20 -0
- package/src/actions/composables/queries/account/index.ts +1 -0
- package/src/actions/composables/queries/account/useFetchContextQuery.ts +43 -0
- package/src/actions/composables/queries/index.ts +6 -0
- package/src/actions/composables/queries/orders/index.ts +1 -0
- package/src/actions/composables/queries/orders/useFetchOrdersQuery.ts +35 -0
- package/src/actions/composables/queries/products/index.ts +1 -0
- package/src/actions/composables/queries/products/useFetchProductsQuery.ts +20 -0
- package/src/actions/composables/queries/queryKeys.ts +3 -0
- package/src/actions/composables/queries/shipments/index.ts +1 -0
- package/src/actions/composables/queries/shipments/useFetchShipmentsQuery.ts +44 -0
- package/src/actions/composables/queries/webhooks/index.ts +1 -0
- package/src/actions/composables/queries/webhooks/useFetchWebhooksQuery.ts +24 -0
- package/src/actions/defineAction.ts +10 -0
- package/src/actions/definitions/account.ts +39 -0
- package/src/actions/definitions/context.ts +17 -0
- package/src/actions/definitions/debug.ts +39 -0
- package/src/actions/definitions/index.ts +8 -0
- package/src/actions/definitions/modal.ts +32 -0
- package/src/actions/definitions/orders.ts +128 -0
- package/src/actions/definitions/settings.ts +11 -0
- package/src/actions/definitions/shipments.ts +61 -0
- package/src/actions/definitions/webhooks.ts +25 -0
- package/src/actions/executors/createHandlerWithParameters.ts +29 -0
- package/src/actions/executors/createMutationHandler.ts +10 -0
- package/src/actions/executors/createOrdersMutationHandler.ts +12 -0
- package/src/actions/executors/createQueryHandler.ts +19 -0
- package/src/actions/executors/createShipmentsMutationHandler.ts +12 -0
- package/src/actions/executors/doMutate.ts +16 -0
- package/src/actions/executors/executeAction.ts +35 -0
- package/src/actions/executors/executeAfterHandle.ts +23 -0
- package/src/actions/executors/executeBeforeHandle.ts +29 -0
- package/src/actions/executors/executeHandler.ts +34 -0
- package/src/actions/executors/executeNextAction.ts +34 -0
- package/src/actions/executors/index.ts +14 -0
- package/src/actions/executors/resolveOrderParameters.ts +19 -0
- package/src/actions/executors/resolveQuerySuffix.ts +10 -0
- package/src/actions/executors/types.ts +45 -0
- package/src/actions/index.ts +6 -0
- package/src/actions/print/index.ts +3 -0
- package/src/actions/print/openOrPrintPdf.ts +16 -0
- package/src/actions/print/resolvePrintParameters.ts +24 -0
- package/src/actions/print/waitForLabelPrompt.ts +39 -0
- package/src/actions/stopActionHandler.ts +1 -0
- package/src/components/OrderBox/OrderShipmentsTable.vue +53 -0
- package/src/components/OrderBox/OrderShipmentsTableRow.vue +81 -0
- package/src/components/OrderBox/ShipmentOptionsBox.vue +74 -0
- package/src/components/OrderBox/ShipmentTableBox.vue +51 -0
- package/src/components/OrderListItem/OrderModeOrderListItem.vue +45 -0
- package/src/components/OrderListItem/ShipmentLabel.vue +44 -0
- package/src/components/OrderListItem/ShipmentModeOrderListItem.vue +67 -0
- package/src/components/PluginSettings/AccountSettings.vue +81 -0
- package/src/components/PluginSettings/DebugOptions.vue +89 -0
- package/src/components/PluginSettings/EditApiKeyForm.vue +89 -0
- package/src/components/PluginSettings/PluginSettingsForms.vue +56 -0
- package/src/components/PluginSettings/WebhooksStatus.vue +73 -0
- package/src/components/PluginSettings/createUpdateAccountSettingsValidator.ts +21 -0
- package/src/components/common/ActionButton.vue +53 -0
- package/src/components/common/BulkSelectCheckbox.vue +46 -0
- package/src/components/common/CarrierLogo.vue +14 -0
- package/src/components/common/DateRelative.vue +20 -0
- package/src/components/common/DeliveryOptionsDeliveryType.vue +23 -0
- package/src/components/common/DeliveryOptionsExcerpt.vue +39 -0
- package/src/components/common/DeliveryOptionsExcerptCarrierName.vue +21 -0
- package/src/components/common/DeliveryOptionsPackageType.vue +30 -0
- package/src/components/common/DigitalStampWeightRange.vue +14 -0
- package/src/components/common/NotificationContainer.vue +35 -0
- package/src/components/common/PackageType.vue +16 -0
- package/src/components/common/PlainElement.ts +8 -0
- package/src/components/common/ResetButton.vue +26 -0
- package/src/components/common/ReturnsForm.vue +31 -0
- package/src/components/common/ShipmentBarcode.vue +41 -0
- package/src/components/common/ShipmentOptionsForm.vue +22 -0
- package/src/components/common/ShipmentStatus.vue +23 -0
- package/src/components/common/StatusIndicator.vue +46 -0
- package/src/components/common/SubmitButton.vue +30 -0
- package/src/components/common/TabNavigation.vue +134 -0
- package/src/components/common/index.ts +39 -0
- package/src/components/index.ts +1 -0
- package/src/components/modals/PrintOptionsModal.vue +32 -0
- package/src/components/modals/PrintOptionsModalForm.vue +33 -0
- package/src/components/modals/ShipmentOptionsModal.vue +56 -0
- package/src/components/modals/ShipmentOptionsModalForm.vue +21 -0
- package/src/composables/components/index.ts +15 -0
- package/src/composables/components/useBulkSelectCheckbox.ts +39 -0
- package/src/composables/components/useCheckboxGroupContext.ts +10 -0
- package/src/composables/components/useDropOffInputContext.ts +74 -0
- package/src/composables/components/useDropdownButtonContext.ts +42 -0
- package/src/composables/components/useElementContext.ts +27 -0
- package/src/composables/components/useElementOptions.ts +48 -0
- package/src/composables/components/useInputWithOptionsContext.ts +46 -0
- package/src/composables/components/useModalElementContext.ts +27 -0
- package/src/composables/components/useMultiSelectInputContext.ts +11 -0
- package/src/composables/components/useRadioGroupContext.ts +56 -0
- package/src/composables/components/useSelectInputContext.ts +11 -0
- package/src/composables/components/useShippingMethodsInputContext.spec.ts +93 -0
- package/src/composables/components/useShippingMethodsInputContext.ts +130 -0
- package/src/composables/components/useTableContext.ts +17 -0
- package/src/composables/components/useToggleInputContext.ts +35 -0
- package/src/composables/components/useTriStateInputContext.ts +117 -0
- package/src/composables/context/index.ts +7 -0
- package/src/composables/context/useAppInfo.ts +6 -0
- package/src/composables/context/useContext.ts +18 -0
- package/src/composables/context/useGlobalContext.ts +7 -0
- package/src/composables/context/useInstanceContext.ts +15 -0
- package/src/composables/context/useModalContext.ts +52 -0
- package/src/composables/context/useModalOrder.ts +13 -0
- package/src/composables/context/usePluginSettings.ts +12 -0
- package/src/composables/formatter/default/createCurrencyFormat.ts +6 -0
- package/src/composables/formatter/default/createLongDateFormat.ts +7 -0
- package/src/composables/formatter/default/createRelativeTimeFormat.ts +5 -0
- package/src/composables/formatter/default/defaultCurrencyFormatters.ts +16 -0
- package/src/composables/formatter/default/defaultDateFormatters.ts +83 -0
- package/src/composables/formatter/default/index.ts +6 -0
- package/src/composables/formatter/default/parseDate.ts +12 -0
- package/src/composables/formatter/formatter.types.ts +32 -0
- package/src/composables/formatter/index.ts +4 -0
- package/src/composables/formatter/useFormatter.spec.ts +147 -0
- package/src/composables/formatter/useFormatter.ts +51 -0
- package/src/composables/formatter/useLocalizedFormatter.ts +11 -0
- package/src/composables/index.ts +17 -0
- package/src/composables/language/index.ts +4 -0
- package/src/composables/language/resolveTranslatedString.ts +30 -0
- package/src/composables/language/resolveTranslationKey.ts +5 -0
- package/src/composables/language/types.ts +1 -0
- package/src/composables/language/useLanguage.spec.ts +124 -0
- package/src/composables/language/useLanguage.ts +117 -0
- package/src/composables/orders/index.ts +3 -0
- package/src/composables/orders/useOrder.ts +8 -0
- package/src/composables/orders/useOrderData.ts +29 -0
- package/src/composables/orders/useOrdersData.ts +14 -0
- package/src/composables/products/index.ts +1 -0
- package/src/composables/products/useProductData.ts +23 -0
- package/src/composables/shipments/index.ts +3 -0
- package/src/composables/shipments/useShipment.ts +7 -0
- package/src/composables/shipments/useShipmentData.ts +52 -0
- package/src/composables/shipments/useShipmentsData.ts +5 -0
- package/src/composables/useAdminConfig.ts +8 -0
- package/src/composables/useAdminInstance.ts +13 -0
- package/src/composables/useDigitalStampRanges.ts +38 -0
- package/src/composables/useGlobalPdkAdmin.ts +13 -0
- package/src/composables/useLoadMore.spec.ts +69 -0
- package/src/composables/useLoadMore.ts +46 -0
- package/src/composables/useLoading.spec.ts +20 -0
- package/src/composables/useLoading.ts +18 -0
- package/src/composables/useLogger.ts +8 -0
- package/src/composables/useStoreContextQuery.ts +9 -0
- package/src/composables/useStoreQuery.ts +9 -0
- package/src/composables/useWeekdays.ts +24 -0
- package/src/data/components.ts +289 -0
- package/src/data/constants.ts +76 -0
- package/src/data/endpoints.ts +28 -0
- package/src/data/index.ts +4 -0
- package/src/data/view.ts +9 -0
- package/src/deprecated.ts +9 -0
- package/src/forms/createReturnsForm.ts +8 -0
- package/src/forms/form-builder/builders/buildAfterUpdate.spec.ts +48 -0
- package/src/forms/form-builder/builders/buildAfterUpdate.ts +26 -0
- package/src/forms/form-builder/builders/buildFormStateWatcher.spec.ts +206 -0
- package/src/forms/form-builder/builders/buildFormStateWatcher.ts +15 -0
- package/src/forms/form-builder/builders/index.ts +2 -0
- package/src/forms/form-builder/conditions/index.ts +3 -0
- package/src/forms/form-builder/conditions/validateIfCondition.spec.ts +69 -0
- package/src/forms/form-builder/conditions/validateIfCondition.ts +43 -0
- package/src/forms/form-builder/conditions/validateIfConditions.spec.ts +238 -0
- package/src/forms/form-builder/conditions/validateIfConditions.ts +31 -0
- package/src/forms/form-builder/conditions/validateIsTruthy.ts +15 -0
- package/src/forms/form-builder/index.ts +5 -0
- package/src/forms/form-builder/operations/executeCustomOperationHandlers.ts +18 -0
- package/src/forms/form-builder/operations/executeOperation.ts +27 -0
- package/src/forms/form-builder/operations/executeOperations.spec.ts +63 -0
- package/src/forms/form-builder/operations/executeOperations.ts +10 -0
- package/src/forms/form-builder/operations/executeSetPropOperation.spec.ts +164 -0
- package/src/forms/form-builder/operations/executeSetPropOperation.ts +15 -0
- package/src/forms/form-builder/operations/executeSetValueOperation.spec.ts +203 -0
- package/src/forms/form-builder/operations/executeSetValueOperation.ts +15 -0
- package/src/forms/form-builder/operations/index.ts +5 -0
- package/src/forms/form-builder/operations/parseBuilders.spec.ts +70 -0
- package/src/forms/form-builder/operations/parseBuilders.ts +39 -0
- package/src/forms/form-builder/types/FormCondition.types.ts +57 -0
- package/src/forms/form-builder/types/FormOperations.types.ts +21 -0
- package/src/forms/form-builder/types/SubOperationBuilder.types.ts +18 -0
- package/src/forms/form-builder/types/common.types.ts +35 -0
- package/src/forms/form-builder/types/index.ts +4 -0
- package/src/forms/form-builder/utils/createPropSetter.ts +19 -0
- package/src/forms/form-builder/utils/createValueGetter.ts +16 -0
- package/src/forms/form-builder/utils/createValueSetter.ts +21 -0
- package/src/forms/form-builder/utils/index.ts +6 -0
- package/src/forms/formKeys.ts +28 -0
- package/src/forms/helpers/addBulkEditNotification.ts +21 -0
- package/src/forms/helpers/createDefaultOption.ts +12 -0
- package/src/forms/helpers/createHasShipmentOptionWatcher.ts +12 -0
- package/src/forms/helpers/createLabel.ts +3 -0
- package/src/forms/helpers/defineFormField.ts +19 -0
- package/src/forms/helpers/getCarrier.ts +11 -0
- package/src/forms/helpers/getDeliveryTypes.ts +19 -0
- package/src/forms/helpers/getFieldLabel.ts +6 -0
- package/src/forms/helpers/getFormCarrierName.ts +7 -0
- package/src/forms/helpers/getInsuranceOptions.ts +23 -0
- package/src/forms/helpers/getPackageTypes.ts +19 -0
- package/src/forms/helpers/hasPostNlAgeCheck.ts +11 -0
- package/src/forms/helpers/hasShipmentOption.ts +8 -0
- package/src/forms/helpers/index.ts +20 -0
- package/src/forms/helpers/isPackageTypePackage.ts +7 -0
- package/src/forms/helpers/isPackageTypePackageOrSmall.ts +7 -0
- package/src/forms/helpers/isPackageTypeSmallPackage.ts +7 -0
- package/src/forms/helpers/resolveFormComponent.ts +12 -0
- package/src/forms/helpers/setFieldProp.ts +32 -0
- package/src/forms/helpers/setPostNlAgeCheckSubtext.ts +17 -0
- package/src/forms/helpers/triStateFieldIsEnabled.ts +20 -0
- package/src/forms/helpers/updateFieldsDefaults.ts +26 -0
- package/src/forms/index.ts +6 -0
- package/src/forms/pluginSettings/__snapshots__/generateFormFields.spec.ts.snap +37 -0
- package/src/forms/pluginSettings/createFormTab.ts +19 -0
- package/src/forms/pluginSettings/createPluginSettingsForm.ts +39 -0
- package/src/forms/pluginSettings/createPluginSettingsTabs.ts +35 -0
- package/src/forms/pluginSettings/createPluginSettingsTabsComponent.ts +42 -0
- package/src/forms/pluginSettings/generateFormFields.spec.ts +54 -0
- package/src/forms/pluginSettings/generateFormFields.ts +50 -0
- package/src/forms/pluginSettings/index.ts +6 -0
- package/src/forms/pluginSettings/types.ts +15 -0
- package/src/forms/shipmentOptions/createShipmentOptionsForm.ts +83 -0
- package/src/forms/shipmentOptions/field.ts +90 -0
- package/src/forms/shipmentOptions/fields/createAgeCheckField.ts +33 -0
- package/src/forms/shipmentOptions/fields/createCarrierField.ts +83 -0
- package/src/forms/shipmentOptions/fields/createDeliveryTypeField.ts +18 -0
- package/src/forms/shipmentOptions/fields/createDigitalStampRangeField.ts +48 -0
- package/src/forms/shipmentOptions/fields/createDirectReturnField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createHideSenderField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createInsuranceField.ts +31 -0
- package/src/forms/shipmentOptions/fields/createLabelAmountField.ts +20 -0
- package/src/forms/shipmentOptions/fields/createLargeFormatField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createOnlyRecipientField.ts +21 -0
- package/src/forms/shipmentOptions/fields/createPackageTypeField.ts +18 -0
- package/src/forms/shipmentOptions/fields/createReceiptCodeField.ts +21 -0
- package/src/forms/shipmentOptions/fields/createRef.ts +6 -0
- package/src/forms/shipmentOptions/fields/createSameDayDeliveryField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createShipmentOptionField.ts +25 -0
- package/src/forms/shipmentOptions/fields/createSignatureField.ts +11 -0
- package/src/forms/shipmentOptions/fields/index.ts +14 -0
- package/src/forms/shipmentOptions/index.ts +4 -0
- package/src/forms/shipmentOptions/types.ts +3 -0
- package/src/index.ts +114 -0
- package/src/pdk/PdkAdmin.ts +82 -0
- package/src/pdk/boot.ts +14 -0
- package/src/pdk/createAdminConfig.ts +29 -0
- package/src/pdk/createPdkAdmin.ts +39 -0
- package/src/pdk/createPdkAdminPlugin.ts +18 -0
- package/src/pdk/fillShipmentsQueryData.ts +44 -0
- package/src/pdk/index.ts +11 -0
- package/src/pdk/instance/createInstanceContext.ts +23 -0
- package/src/pdk/instance/createQueryClient.ts +31 -0
- package/src/pdk/instance/index.ts +3 -0
- package/src/pdk/instance/plugins/createContextPlugin.ts +17 -0
- package/src/pdk/instance/plugins/createLoggerPlugin.ts +13 -0
- package/src/pdk/instance/plugins/createRegisterComponentsPlugin.spec.ts +58 -0
- package/src/pdk/instance/plugins/createRegisterComponentsPlugin.ts +87 -0
- package/src/pdk/instance/plugins/createStorePlugin.ts +23 -0
- package/src/pdk/instance/plugins/createVueQueryPlugin.ts +48 -0
- package/src/pdk/instance/plugins/index.ts +6 -0
- package/src/pdk/instance/plugins/plugins.types.ts +4 -0
- package/src/pdk/renderMap.ts +27 -0
- package/src/pdk/sendBootEvent.ts +12 -0
- package/src/pdk/setupAdminApp.ts +20 -0
- package/src/pdk/testIdDirective.spec.ts +42 -0
- package/src/pdk/testIdDirective.ts +28 -0
- package/src/sdk/PdkFetchClient.ts +70 -0
- package/src/sdk/composables/api/index.ts +1 -0
- package/src/sdk/composables/api/useFetchCarrier.ts +23 -0
- package/src/sdk/composables/index.ts +3 -0
- package/src/sdk/composables/useMyParcelApi.ts +18 -0
- package/src/sdk/composables/usePdkAdminApi.ts +34 -0
- package/src/sdk/endpoints/abstractPdkEndpoint.ts +10 -0
- package/src/sdk/endpoints/index.ts +1 -0
- package/src/sdk/index.ts +3 -0
- package/src/services/actions/createAction.ts +24 -0
- package/src/services/actions/createActionContext.ts +49 -0
- package/src/services/actions/downloadFile.ts +16 -0
- package/src/services/actions/getActionIdentifier.ts +7 -0
- package/src/services/actions/index.ts +4 -0
- package/src/services/addErrorToNotifications.ts +35 -0
- package/src/services/context/getElementContext.ts +17 -0
- package/src/services/context/index.ts +1 -0
- package/src/services/createNotification.ts +35 -0
- package/src/services/index.ts +9 -0
- package/src/services/instantiateAction.ts +11 -0
- package/src/services/instantiateActions.ts +14 -0
- package/src/services/logger.spec.ts +70 -0
- package/src/services/logger.ts +118 -0
- package/src/services/mutations/getCallbackForMutationMode.ts +18 -0
- package/src/services/mutations/getModalMutationOptions.ts +24 -0
- package/src/services/mutations/index.ts +3 -0
- package/src/services/mutations/mutationMode.ts +4 -0
- package/src/services/print/index.ts +1 -0
- package/src/services/print/openPdfInNewWindow.ts +11 -0
- package/src/stores/createQueryCacheKey.ts +6 -0
- package/src/stores/index.ts +6 -0
- package/src/stores/types.ts +35 -0
- package/src/stores/useActionStore.ts +94 -0
- package/src/stores/useModalStore.ts +65 -0
- package/src/stores/useNotificationStore.ts +65 -0
- package/src/stores/useQueryStore.ts +184 -0
- package/src/symbols.ts +7 -0
- package/src/testing.ts +1 -0
- package/src/types/actions/actions.types.ts +42 -0
- package/src/types/actions/endpoints.types.ts +32 -0
- package/src/types/actions/index.ts +4 -0
- package/src/types/actions/parameters.types.ts +80 -0
- package/src/types/actions/response.types.ts +12 -0
- package/src/types/actions.types.ts +57 -0
- package/src/types/admin.types.ts +47 -0
- package/src/types/common.types.ts +66 -0
- package/src/types/components-form.types.ts +183 -0
- package/src/types/components.types.ts +349 -0
- package/src/types/configuration.types.ts +116 -0
- package/src/types/context.types.ts +25 -0
- package/src/types/endpoints.types.ts +17 -0
- package/src/types/form.types.ts +65 -0
- package/src/types/index.ts +12 -0
- package/src/types/language.types.ts +12 -0
- package/src/types/sdk.types.ts +213 -0
- package/src/utils/booleanToTriState.spec.ts +13 -0
- package/src/utils/booleanToTriState.ts +5 -0
- package/src/utils/convertDotNotationToObject.ts +15 -0
- package/src/utils/createAssetUrl.ts +9 -0
- package/src/utils/createClasses.ts +18 -0
- package/src/utils/createObjectWithKeys.ts +10 -0
- package/src/utils/decodeHtmlEntities.ts +11 -0
- package/src/utils/downloadBlob.ts +9 -0
- package/src/utils/downloadFileFromUrl.spec.ts +29 -0
- package/src/utils/downloadFileFromUrl.ts +5 -0
- package/src/utils/encodeArrayParameter.ts +6 -0
- package/src/utils/extendAdminInstance.ts +10 -0
- package/src/utils/fakeLinkClick.ts +17 -0
- package/src/utils/forms/createFormElement.ts +20 -0
- package/src/utils/forms/createShipmentFormName.ts +9 -0
- package/src/utils/forms/formToBody.ts +16 -0
- package/src/utils/forms/generateFieldId.ts +17 -0
- package/src/utils/forms/index.ts +4 -0
- package/src/utils/generateLabelFilename.spec.ts +24 -0
- package/src/utils/generateLabelFilename.ts +26 -0
- package/src/utils/getOrderId.ts +12 -0
- package/src/utils/getOrderShipmentIds.ts +12 -0
- package/src/utils/index.ts +23 -0
- package/src/utils/openUrlInNewTab.spec.ts +29 -0
- package/src/utils/openUrlInNewTab.ts +5 -0
- package/src/utils/prefixComponent.spec.ts +15 -0
- package/src/utils/prefixComponent.ts +10 -0
- package/src/utils/query/index.ts +3 -0
- package/src/utils/query/setQueryData.ts +8 -0
- package/src/utils/query/setQueryOrder.ts +26 -0
- package/src/utils/query/setQueryShipment.ts +8 -0
- package/src/utils/resolveCarrier.spec.ts +11 -0
- package/src/utils/resolveCarrier.ts +3 -0
- package/src/utils/translations/getDeliveryTypeTranslation.ts +5 -0
- package/src/utils/translations/getDynamicTranslation.ts +7 -0
- package/src/utils/translations/getPackageTypeTranslation.ts +5 -0
- package/src/utils/translations/index.ts +4 -0
- package/src/utils/translations/translateSelectOption.ts +15 -0
- package/src/utils/triStateToBoolean.spec.ts +13 -0
- package/src/utils/triStateToBoolean.ts +5 -0
- package/src/utils/unprefixComponent.spec.ts +13 -0
- package/src/utils/unprefixComponent.ts +6 -0
- package/src/utils/validateId.spec.ts +20 -0
- package/src/utils/validateId.ts +16 -0
- package/src/views/ChildProductSettings.vue +14 -0
- package/src/views/Modals.vue +22 -0
- package/src/views/Notifications.vue +9 -0
- package/src/views/OrderBox.vue +32 -0
- package/src/views/OrderListItem.vue +52 -0
- package/src/views/PluginSettings.vue +43 -0
- package/src/views/ProductSettings.vue +76 -0
- package/src/views/integrated/OrderBoxView.vue +20 -0
- package/src/views/integrated/OrderListItemView.vue +20 -0
- package/src/views/integrated/index.ts +13 -0
- package/src/vue-form-builder.d.ts +14 -0
- package/src/vue.shims.d.ts +11 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {afterEach, describe, expect, it, vi} from 'vitest';
|
|
2
|
+
import {mockLinkElement} from '../__tests__/utils/mockLinkElement';
|
|
3
|
+
import {openUrlInNewTab} from './openUrlInNewTab';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @vitest-environment happy-dom
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
describe('openUrlInNewTab', () => {
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.restoreAllMocks();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('creates a fake link, sets attributes, clicks it, and removes it', () => {
|
|
15
|
+
const {createElementSpy, appendChildSpy, mockElement} = mockLinkElement();
|
|
16
|
+
|
|
17
|
+
const url = 'https://example.com';
|
|
18
|
+
|
|
19
|
+
openUrlInNewTab(url);
|
|
20
|
+
|
|
21
|
+
expect(createElementSpy).toHaveBeenCalledWith('a');
|
|
22
|
+
expect(appendChildSpy).toHaveBeenCalledWith(mockElement);
|
|
23
|
+
expect(mockElement.setAttribute).toHaveBeenCalledWith('href', url);
|
|
24
|
+
expect(mockElement.setAttribute).toHaveBeenCalledWith('target', '_blank');
|
|
25
|
+
expect(mockElement.setAttribute).toHaveBeenCalledWith('rel', 'noopener noreferrer');
|
|
26
|
+
expect(mockElement.click).toHaveBeenCalledOnce();
|
|
27
|
+
expect(mockElement.remove).toHaveBeenCalledOnce();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {ADMIN_COMPONENT_PREFIX, AdminComponent} from '../data';
|
|
3
|
+
import {prefixComponent} from './prefixComponent';
|
|
4
|
+
|
|
5
|
+
describe('prefixComponent', () => {
|
|
6
|
+
it('should prefix the component name', () => {
|
|
7
|
+
expect(prefixComponent(AdminComponent.Box)).toBe(`${ADMIN_COMPONENT_PREFIX}${AdminComponent.Box}`);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should not prefix the component name if it is already prefixed', () => {
|
|
11
|
+
expect(prefixComponent(`${ADMIN_COMPONENT_PREFIX}${AdminComponent.Box}`)).toBe(
|
|
12
|
+
`${ADMIN_COMPONENT_PREFIX}${AdminComponent.Box}`,
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {type PrefixedAdminComponent} from '../types';
|
|
2
|
+
import {ADMIN_COMPONENT_PREFIX, type AdminComponent} from '../data';
|
|
3
|
+
|
|
4
|
+
export const prefixComponent = (componentName: string | AdminComponent): PrefixedAdminComponent => {
|
|
5
|
+
if (componentName.startsWith(ADMIN_COMPONENT_PREFIX)) {
|
|
6
|
+
return componentName as PrefixedAdminComponent;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return `${ADMIN_COMPONENT_PREFIX}${componentName}` as PrefixedAdminComponent;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {type QueryClient, type QueryKey} from '@tanstack/vue-query';
|
|
2
|
+
import {globalLogger} from '../../services';
|
|
3
|
+
|
|
4
|
+
export const setQueryData = (queryClient: QueryClient, queryKey: QueryKey, data: unknown): void => {
|
|
5
|
+
globalLogger.debug('QUERY UPDATE:', JSON.stringify(queryKey));
|
|
6
|
+
|
|
7
|
+
queryClient.setQueryData(queryKey, data);
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {type QueryClient} from '@tanstack/vue-query';
|
|
2
|
+
import {type Plugin, type Shipment} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {isOfType, type Replace} from '@myparcel-dev/ts-utils';
|
|
4
|
+
import {QUERY_KEY_ORDER} from '../../actions';
|
|
5
|
+
import {setQueryData} from './setQueryData';
|
|
6
|
+
|
|
7
|
+
type FilteredShipment = {id: number; updated: unknown};
|
|
8
|
+
|
|
9
|
+
type FilteredOrder = Replace<Plugin.ModelPdkOrder, 'shipments', FilteredShipment[]>;
|
|
10
|
+
|
|
11
|
+
export const setQueryOrder = (queryClient: QueryClient, order: Plugin.ModelPdkOrder | FilteredOrder): void => {
|
|
12
|
+
let filteredOrder: FilteredOrder;
|
|
13
|
+
|
|
14
|
+
if (order.shipments?.length && isOfType<Shipment.ModelShipment>(order.shipments[0], 'orderId')) {
|
|
15
|
+
filteredOrder = {
|
|
16
|
+
...order,
|
|
17
|
+
shipments: (order as Plugin.ModelPdkOrder).shipments
|
|
18
|
+
.filter((shipment) => !shipment.deleted)
|
|
19
|
+
.map(({id, updated}) => ({id, updated})),
|
|
20
|
+
};
|
|
21
|
+
} else {
|
|
22
|
+
filteredOrder = order;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
setQueryData(queryClient, [QUERY_KEY_ORDER, {id: order.externalIdentifier}], filteredOrder);
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {type QueryClient} from '@tanstack/vue-query';
|
|
2
|
+
import {type Shipment} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {QUERY_KEY_SHIPMENT} from '../../actions';
|
|
4
|
+
import {setQueryData} from './setQueryData';
|
|
5
|
+
|
|
6
|
+
export const setQueryShipment = (queryClient: QueryClient, shipment: Shipment.ModelShipment): void => {
|
|
7
|
+
setQueryData(queryClient, [QUERY_KEY_SHIPMENT, {id: shipment.id}], shipment);
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {resolveCarrier} from './resolveCarrier';
|
|
3
|
+
|
|
4
|
+
describe('resolveCarrier', () => {
|
|
5
|
+
it.each([
|
|
6
|
+
['postnl:identifier', 'postnl'],
|
|
7
|
+
['carrier', 'carrier'],
|
|
8
|
+
])('resolves the carrier name', (input, expected) => {
|
|
9
|
+
expect(resolveCarrier(input)).toBe(expected);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {isOfType} from '@myparcel-dev/ts-utils';
|
|
2
|
+
import {type SelectOption, type SelectOptionValue, type SelectOptionWithLabel} from '../../types';
|
|
3
|
+
import {type useLanguage} from '../../composables';
|
|
4
|
+
|
|
5
|
+
export const translateSelectOption = <T extends SelectOptionValue = SelectOptionValue>(
|
|
6
|
+
option: SelectOption<T>,
|
|
7
|
+
translate: ReturnType<typeof useLanguage>['translate'],
|
|
8
|
+
): SelectOptionWithLabel<T, string> => {
|
|
9
|
+
const hasLabel = isOfType<SelectOptionWithLabel>(option, 'label');
|
|
10
|
+
const translatedOption = {...option} as SelectOptionWithLabel<T>;
|
|
11
|
+
|
|
12
|
+
translatedOption.label = hasLabel ? translate(option.label) : option.plainLabel;
|
|
13
|
+
|
|
14
|
+
return Object.freeze(translatedOption) as SelectOptionWithLabel<T, string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {TriState} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {triStateToBoolean} from './triStateToBoolean';
|
|
4
|
+
|
|
5
|
+
describe('triStateToBoolean', () => {
|
|
6
|
+
it.each([
|
|
7
|
+
[TriState.Off, false],
|
|
8
|
+
[TriState.On, true],
|
|
9
|
+
[TriState.Inherit, false],
|
|
10
|
+
])('should return %s for %s', (value, expected) => {
|
|
11
|
+
expect(triStateToBoolean(value)).toEqual(expected);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {AdminComponent} from '../data';
|
|
3
|
+
import {unprefixComponent} from './unprefixComponent';
|
|
4
|
+
|
|
5
|
+
describe('unprefixComponent', () => {
|
|
6
|
+
it('should unprefix a component name', () => {
|
|
7
|
+
expect(unprefixComponent('PdkTriStateInput')).toBe(AdminComponent.TriStateInput);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should do nothing if the component name is not prefixed', () => {
|
|
11
|
+
expect(unprefixComponent('TriStateInput')).toBe('TriStateInput');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {type PrefixedAdminComponent} from '../types';
|
|
2
|
+
import {ADMIN_COMPONENT_PREFIX, type AdminComponent} from '../data';
|
|
3
|
+
|
|
4
|
+
export const unprefixComponent = (componentName: PrefixedAdminComponent | string): AdminComponent => {
|
|
5
|
+
return componentName.replace(ADMIN_COMPONENT_PREFIX, '') as AdminComponent;
|
|
6
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {validateId} from './validateId';
|
|
3
|
+
|
|
4
|
+
describe('validateId', () => {
|
|
5
|
+
it('should throw an error when no id is provided', () => {
|
|
6
|
+
expect(() => validateId()).toThrowError('no id provided');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('should throw an error when id is an array and canBeArray is not true', () => {
|
|
10
|
+
expect(() => validateId(['1', '2'])).toThrowError('id cannot be an array');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should return the id when it is a string', () => {
|
|
14
|
+
expect(validateId('1')).toBe('1');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should return the id when it is an array and canBeArray is true', () => {
|
|
18
|
+
expect(validateId(['1', '2'], true)).toEqual(['1', '2']);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {type OneOrMore} from '@myparcel-dev/ts-utils';
|
|
2
|
+
|
|
3
|
+
export const validateId = <O extends undefined | OneOrMore<string | number>, A extends boolean = false>(
|
|
4
|
+
id?: O,
|
|
5
|
+
canBeArray?: A,
|
|
6
|
+
): A extends true ? NonNullable<O> : string => {
|
|
7
|
+
if (!id) {
|
|
8
|
+
throw new Error('no id provided');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (Array.isArray(id) && canBeArray !== true) {
|
|
12
|
+
throw new Error('id cannot be an array');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return id as A extends true ? NonNullable<O> : string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ProductSettings
|
|
3
|
+
:form-key="FORM_KEY_CHILD_PRODUCT_SETTINGS"
|
|
4
|
+
:form-name="`${FORM_KEY_CHILD_PRODUCT_SETTINGS}--${productId}`" />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import {FORM_KEY_CHILD_PRODUCT_SETTINGS} from '../forms';
|
|
9
|
+
import {useInstanceContext} from '../composables';
|
|
10
|
+
import ProductSettings from './ProductSettings.vue';
|
|
11
|
+
import {AdminInstanceContextKey} from "../data";
|
|
12
|
+
|
|
13
|
+
const productId = useInstanceContext(AdminInstanceContextKey.ProductIdentifier);
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-test>
|
|
3
|
+
<KeepAlive>
|
|
4
|
+
<PrintOptionsModal v-if="pluginSettings.label.prompt" />
|
|
5
|
+
</KeepAlive>
|
|
6
|
+
|
|
7
|
+
<ShipmentOptionsModal />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import {useActionStore, useQueryStore} from '../stores';
|
|
13
|
+
import {usePluginSettings} from '../composables';
|
|
14
|
+
import ShipmentOptionsModal from '../components/modals/ShipmentOptionsModal.vue';
|
|
15
|
+
import PrintOptionsModal from '../components/modals/PrintOptionsModal.vue';
|
|
16
|
+
|
|
17
|
+
useQueryStore().registerContextQueries();
|
|
18
|
+
|
|
19
|
+
useActionStore().registerModalActions();
|
|
20
|
+
|
|
21
|
+
const pluginSettings = usePluginSettings();
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NotificationContainer :category="NotificationCategory.General" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<!-- The notification container. Used to display notifications. -->
|
|
6
|
+
<script lang="ts" setup>
|
|
7
|
+
import {NotificationContainer} from '../components';
|
|
8
|
+
import {NotificationCategory} from "../data";
|
|
9
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ShipmentOptionsBox />
|
|
3
|
+
|
|
4
|
+
<ShipmentTableBox v-if="!orderMode && data?.shipments.some((item) => !item.deleted)" />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import {computed, defineAsyncComponent, toValue} from 'vue';
|
|
9
|
+
import {useActionStore, useQueryStore} from '../stores';
|
|
10
|
+
import {useOrderData, usePluginSettings} from '../composables';
|
|
11
|
+
import ShipmentOptionsBox from '../components/OrderBox/ShipmentOptionsBox.vue';
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14
|
+
const ShipmentTableBox = defineAsyncComponent(() => import('../components/OrderBox/ShipmentTableBox.vue'));
|
|
15
|
+
|
|
16
|
+
const queryStore = useQueryStore();
|
|
17
|
+
|
|
18
|
+
queryStore.registerContextQueries();
|
|
19
|
+
queryStore.registerOrderQueries();
|
|
20
|
+
|
|
21
|
+
const actionStore = useActionStore();
|
|
22
|
+
|
|
23
|
+
actionStore.registerOrderActions();
|
|
24
|
+
|
|
25
|
+
const pluginSettings = usePluginSettings();
|
|
26
|
+
|
|
27
|
+
const {query} = useOrderData();
|
|
28
|
+
|
|
29
|
+
const data = computed(() => toValue(query.data));
|
|
30
|
+
|
|
31
|
+
const {orderMode} = pluginSettings.order;
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!query.isLoading">
|
|
3
|
+
<OrderModeOrderListItem v-if="orderMode" />
|
|
4
|
+
|
|
5
|
+
<ShipmentModeOrderListItem v-else />
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<NotificationContainer
|
|
9
|
+
:category="NotificationCategory.Action"
|
|
10
|
+
:filter="notificationFilter" />
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
/**
|
|
15
|
+
* This is the main entry point for the order list column.
|
|
16
|
+
*/
|
|
17
|
+
import {defineAsyncComponent, toValue} from 'vue';
|
|
18
|
+
import {type NotificationFilter} from '../types';
|
|
19
|
+
import {useActionStore, useQueryStore} from '../stores';
|
|
20
|
+
import {NotificationCategory} from '../data';
|
|
21
|
+
import {useOrderData, usePluginSettings} from '../composables';
|
|
22
|
+
import {NotificationContainer} from '../components';
|
|
23
|
+
|
|
24
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
25
|
+
const OrderModeOrderListItem = defineAsyncComponent(() => {
|
|
26
|
+
return import('../components/OrderListItem/OrderModeOrderListItem.vue');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const ShipmentModeOrderListItem = defineAsyncComponent(() => {
|
|
30
|
+
return import('../components/OrderListItem/ShipmentModeOrderListItem.vue');
|
|
31
|
+
});
|
|
32
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
33
|
+
|
|
34
|
+
const queryStore = useQueryStore();
|
|
35
|
+
|
|
36
|
+
queryStore.registerContextQueries();
|
|
37
|
+
queryStore.registerOrderQueries();
|
|
38
|
+
|
|
39
|
+
const actionStore = useActionStore();
|
|
40
|
+
|
|
41
|
+
actionStore.registerOrderActions();
|
|
42
|
+
|
|
43
|
+
const pluginSettings = usePluginSettings();
|
|
44
|
+
|
|
45
|
+
const {orderMode} = pluginSettings.order;
|
|
46
|
+
|
|
47
|
+
const {query} = useOrderData();
|
|
48
|
+
|
|
49
|
+
const notificationFilter: NotificationFilter = (notification) => {
|
|
50
|
+
return notification.tags?.orderIds === toValue(query.data)?.externalIdentifier;
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PdkPluginSettingsWrapper v-test>
|
|
3
|
+
<AccountSettings />
|
|
4
|
+
|
|
5
|
+
<PluginSettingsForms v-if="hasAccount" />
|
|
6
|
+
</PdkPluginSettingsWrapper>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
/**
|
|
11
|
+
* Plugin settings screen.
|
|
12
|
+
*/
|
|
13
|
+
import {computed, toValue} from 'vue';
|
|
14
|
+
import {AdminContextKey, BackendEndpoint} from '@myparcel-dev/pdk-common';
|
|
15
|
+
import {useActionStore, useQueryStore} from '../stores';
|
|
16
|
+
import {useStoreContextQuery} from '../composables';
|
|
17
|
+
import PluginSettingsForms from '../components/PluginSettings/PluginSettingsForms.vue';
|
|
18
|
+
import AccountSettings from '../components/PluginSettings/AccountSettings.vue';
|
|
19
|
+
import {
|
|
20
|
+
fetchDynamicContextAction,
|
|
21
|
+
fetchPluginSettingsViewContextAction,
|
|
22
|
+
pluginSettingsUpdateAction,
|
|
23
|
+
useDeleteAccountMutation,
|
|
24
|
+
useUpdateAccountMutation,
|
|
25
|
+
useUpdatePluginSettingsMutation,
|
|
26
|
+
} from '../actions';
|
|
27
|
+
|
|
28
|
+
const queryStore = useQueryStore();
|
|
29
|
+
|
|
30
|
+
queryStore.registerContextQueries(AdminContextKey.PluginSettingsView);
|
|
31
|
+
|
|
32
|
+
queryStore.register(BackendEndpoint.DeleteAccount, useDeleteAccountMutation());
|
|
33
|
+
queryStore.register(BackendEndpoint.UpdateAccount, useUpdateAccountMutation());
|
|
34
|
+
queryStore.register(BackendEndpoint.UpdatePluginSettings, useUpdatePluginSettingsMutation());
|
|
35
|
+
|
|
36
|
+
const actionStore = useActionStore();
|
|
37
|
+
|
|
38
|
+
actionStore.register([pluginSettingsUpdateAction, fetchPluginSettingsViewContextAction, fetchDynamicContextAction]);
|
|
39
|
+
|
|
40
|
+
const dynamicContextQuery = useStoreContextQuery();
|
|
41
|
+
|
|
42
|
+
const hasAccount = computed(() => Boolean(toValue(dynamicContextQuery.data)?.account));
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MagicForm :form="form" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
/**
|
|
7
|
+
* Product settings.
|
|
8
|
+
*/
|
|
9
|
+
import {toRefs, toValue} from 'vue';
|
|
10
|
+
import {AdminContextKey} from '@myparcel-dev/pdk-common';
|
|
11
|
+
import MagicForm, {defineForm, type FormInstance} from '@myparcel-dev/vue-form-builder';
|
|
12
|
+
import {useQueryStore} from '../stores';
|
|
13
|
+
import {FORM_KEY_CHILD_PRODUCT_SETTINGS, FORM_KEY_PRODUCT_SETTINGS, generateFormFields} from '../forms';
|
|
14
|
+
import {useAdminConfig, useContext, useProductData} from '../composables';
|
|
15
|
+
import {useUpdateProductSettingsMutation} from '../actions';
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
formName?: string;
|
|
20
|
+
formKey?: typeof FORM_KEY_PRODUCT_SETTINGS | typeof FORM_KEY_CHILD_PRODUCT_SETTINGS;
|
|
21
|
+
}>(),
|
|
22
|
+
{
|
|
23
|
+
formName: FORM_KEY_PRODUCT_SETTINGS,
|
|
24
|
+
formKey: FORM_KEY_PRODUCT_SETTINGS,
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const propRefs = toRefs(props);
|
|
29
|
+
|
|
30
|
+
const queryStore = useQueryStore();
|
|
31
|
+
queryStore.registerContextQueries(AdminContextKey.ProductSettingsView);
|
|
32
|
+
queryStore.registerProductQueries();
|
|
33
|
+
|
|
34
|
+
const viewContext = useContext(AdminContextKey.ProductSettingsView);
|
|
35
|
+
|
|
36
|
+
const {product} = useProductData();
|
|
37
|
+
|
|
38
|
+
const updateProductSettingsMutation = useUpdateProductSettingsMutation();
|
|
39
|
+
const adminConfig = useAdminConfig();
|
|
40
|
+
|
|
41
|
+
const createProductSettingsForm = (): FormInstance => {
|
|
42
|
+
const resolvedProduct = toValue(product);
|
|
43
|
+
|
|
44
|
+
if (!resolvedProduct || !viewContext.view) {
|
|
45
|
+
throw new Error('Product settings not loaded');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const overrides =
|
|
49
|
+
FORM_KEY_CHILD_PRODUCT_SETTINGS === toValue(propRefs.formKey)
|
|
50
|
+
? {
|
|
51
|
+
...adminConfig.formConfigOverrides?.[FORM_KEY_PRODUCT_SETTINGS],
|
|
52
|
+
...adminConfig.formConfigOverrides?.[FORM_KEY_CHILD_PRODUCT_SETTINGS],
|
|
53
|
+
}
|
|
54
|
+
: adminConfig.formConfigOverrides?.[FORM_KEY_PRODUCT_SETTINGS];
|
|
55
|
+
|
|
56
|
+
return defineForm(toValue(propRefs.formName), {
|
|
57
|
+
...overrides,
|
|
58
|
+
fields: [
|
|
59
|
+
...generateFormFields({
|
|
60
|
+
// @ts-expect-error todo
|
|
61
|
+
fields: viewContext.view.elements,
|
|
62
|
+
values: resolvedProduct.settings ?? {},
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
|
|
66
|
+
afterSubmit: async (form: FormInstance) => {
|
|
67
|
+
await updateProductSettingsMutation.mutateAsync({
|
|
68
|
+
form,
|
|
69
|
+
productIds: [resolvedProduct.externalIdentifier],
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const form = createProductSettingsForm();
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<OrderBox />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import {toRefs} from 'vue';
|
|
7
|
+
import OrderBox from '../OrderBox.vue';
|
|
8
|
+
import {extendAdminInstance} from '../../utils';
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
orderIdentifier: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const propRefs = toRefs(props);
|
|
18
|
+
|
|
19
|
+
extendAdminInstance({context: {orderIdentifier: propRefs.orderIdentifier?.value}});
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<OrderListItem />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import {toRefs} from 'vue';
|
|
7
|
+
import OrderListItem from '../OrderListItem.vue';
|
|
8
|
+
import {extendAdminInstance} from '../../utils';
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
orderIdentifier: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const propRefs = toRefs(props);
|
|
18
|
+
|
|
19
|
+
extendAdminInstance({context: {orderIdentifier: propRefs.orderIdentifier?.value}});
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export {default as ChildProductSettingsView} from '../ChildProductSettings.vue';
|
|
2
|
+
|
|
3
|
+
export {default as ModalsView} from '../Modals.vue';
|
|
4
|
+
|
|
5
|
+
export {default as NotificationsView} from '../Notifications.vue';
|
|
6
|
+
|
|
7
|
+
export {default as OrderBoxView} from './OrderBoxView.vue';
|
|
8
|
+
|
|
9
|
+
export {default as OrderListItemView} from './OrderListItemView.vue';
|
|
10
|
+
|
|
11
|
+
export {default as PluginSettingsView} from '../PluginSettings.vue';
|
|
12
|
+
|
|
13
|
+
export {default as ProductSettingsView} from '../ProductSettings.vue';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '@myparcel-dev/vue-form-builder';
|
|
2
|
+
|
|
3
|
+
declare module '@myparcel-dev/vue-form-builder' {
|
|
4
|
+
// Re-add fields to FormConfiguration (removed in beta.44+)
|
|
5
|
+
export interface FormConfiguration {
|
|
6
|
+
fields?: unknown[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Re-add lifecycle hooks to FieldConfiguration (removed from types but still work at runtime)
|
|
10
|
+
export interface FieldConfiguration {
|
|
11
|
+
onBeforeMount?(instance: FieldInstance): Promise<void> | void;
|
|
12
|
+
onMounted?(instance: FieldInstance): Promise<void> | void;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
declare module '*.vue' {
|
|
4
|
+
import type {DefineComponent} from 'vue';
|
|
5
|
+
const component: DefineComponent<{}, {}, any>;
|
|
6
|
+
export default component;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare const __VUE_HMR_RUNTIME__: Record<string, any>;
|
|
10
|
+
declare const __VUE_OPTIONS_API__: boolean;
|
|
11
|
+
declare const __VUE_PROD_DEVTOOLS__: boolean;
|