@myparcel-dev/pdk-admin 2.1.0 → 2.2.1
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 +15 -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/mockDefaultPluginSettings.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultPrintOptionsView.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultProposition.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/account/useOrderCapabilitiesQuery.d.ts +29 -0
- package/dist/actions/composables/queries/account/useShipmentCapabilitiesQuery.d.ts +45 -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 +39 -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 +3 -0
- package/dist/actions/executors/createQueryHandler.d.ts +3 -0
- package/dist/actions/executors/createShipmentsMutationHandler.d.ts +3 -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 +7 -0
- package/dist/actions/orderModeActions.d.ts +37 -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 +7 -0
- package/dist/components/OrderBox/OrderShipmentsTableRow.vue.d.ts +19 -0
- package/dist/components/OrderBox/ShipmentOptionsBox.vue.d.ts +3 -0
- package/dist/components/OrderBox/ShipmentTableBox.vue.d.ts +3 -0
- package/dist/components/OrderListItem/OrderModeOrderListItem.vue.d.ts +3 -0
- package/dist/components/OrderListItem/ShipmentLabel.vue.d.ts +14 -0
- package/dist/components/OrderListItem/ShipmentModeOrderListItem.vue.d.ts +3 -0
- package/dist/components/PluginSettings/AccountSettings.vue.d.ts +3 -0
- package/dist/components/PluginSettings/DebugOptions.vue.d.ts +3 -0
- package/dist/components/PluginSettings/EditApiKeyForm.vue.d.ts +8 -0
- package/dist/components/PluginSettings/PluginSettingsForms.vue.d.ts +3 -0
- package/dist/components/PluginSettings/WebhooksStatus.vue.d.ts +3 -0
- package/dist/components/PluginSettings/createUpdateAccountSettingsValidator.d.ts +4 -0
- package/dist/components/common/ActionButton.vue.d.ts +48 -0
- package/dist/components/common/BulkSelectCheckbox.vue.d.ts +20 -0
- package/dist/components/common/CarrierLogo.vue.d.ts +15 -0
- package/dist/components/common/DateRelative.vue.d.ts +15 -0
- package/dist/components/common/DeliveryOptionsDeliveryType.vue.d.ts +15 -0
- package/dist/components/common/DeliveryOptionsExcerpt.vue.d.ts +3 -0
- package/dist/components/common/DeliveryOptionsExcerptCarrierName.vue.d.ts +15 -0
- package/dist/components/common/DeliveryOptionsPackageType.vue.d.ts +15 -0
- package/dist/components/common/DigitalStampWeightRange.vue.d.ts +14 -0
- package/dist/components/common/NotificationContainer.vue.d.ts +17 -0
- package/dist/components/common/PackageType.vue.d.ts +15 -0
- package/dist/components/common/PlainElement.d.ts +2 -0
- package/dist/components/common/ResetButton.vue.d.ts +14 -0
- package/dist/components/common/ReturnsForm.vue.d.ts +15 -0
- package/dist/components/common/ShipmentBarcode.vue.d.ts +14 -0
- package/dist/components/common/ShipmentOptionsForm.vue.d.ts +15 -0
- package/dist/components/common/ShipmentStatus.vue.d.ts +14 -0
- package/dist/components/common/StatusIndicator.vue.d.ts +27 -0
- package/dist/components/common/SubmitButton.vue.d.ts +14 -0
- package/dist/components/common/TabNavigation.vue.d.ts +70 -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 +3 -0
- package/dist/components/modals/PrintOptionsModalForm.vue.d.ts +3 -0
- package/dist/components/modals/ShipmentOptionsModal.vue.d.ts +3 -0
- package/dist/components/modals/ShipmentOptionsModalForm.vue.d.ts +15 -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 +8 -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/useOrderMode.d.ts +12 -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 +12 -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 +5 -0
- package/dist/data/orderMode.d.ts +25 -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 +11 -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/addCapabilitiesClearNotification.d.ts +15 -0
- package/dist/forms/helpers/createDefaultOption.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/getDeliveryTypes.d.ts +3 -0
- package/dist/forms/helpers/getFieldLabel.d.ts +7 -0
- package/dist/forms/helpers/getFormCarrierName.d.ts +2 -0
- package/dist/forms/helpers/getPackageTypes.d.ts +3 -0
- package/dist/forms/helpers/index.d.ts +14 -0
- package/dist/forms/helpers/resolveFormComponent.d.ts +3 -0
- package/dist/forms/helpers/setFieldProp.d.ts +8 -0
- package/dist/forms/helpers/triStateFieldIsEnabled.d.ts +2 -0
- package/dist/forms/helpers/updateFieldsDefaults.d.ts +6 -0
- package/dist/forms/helpers/useFormCapabilities.d.ts +66 -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/filterPluginSettingsView.d.ts +15 -0
- package/dist/forms/pluginSettings/generateFormFields.d.ts +8 -0
- package/dist/forms/pluginSettings/index.d.ts +7 -0
- package/dist/forms/pluginSettings/resolveSettingsValues.d.ts +8 -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 +22 -0
- package/dist/forms/shipmentOptions/fieldFactoryRegistry.d.ts +21 -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 +4 -0
- package/dist/forms/shipmentOptions/fields/createDimensionFields.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createInsuranceField.d.ts +17 -0
- package/dist/forms/shipmentOptions/fields/createLabelAmountField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createPackageTypeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createRef.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createShipmentOptionField.d.ts +15 -0
- package/dist/forms/shipmentOptions/fields/index.d.ts +7 -0
- package/dist/forms/shipmentOptions/index.d.ts +4 -0
- package/dist/forms/shipmentOptions/types.d.ts +2 -0
- package/dist/forms/shipmentOptions/useCapabilitiesAutoClear.d.ts +36 -0
- package/dist/forms/shipmentOptions/useCapabilitiesWatcher.d.ts +22 -0
- package/dist/forms/shipmentOptions/wireProxyCapabilities.d.ts +31 -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 +1 -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 +80 -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 +212 -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/getEnabledValues.d.ts +11 -0
- package/dist/utils/forms/index.d.ts +5 -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 +3 -0
- package/dist/views/Modals.vue.d.ts +3 -0
- package/dist/views/Notifications.vue.d.ts +3 -0
- package/dist/views/OrderBox.vue.d.ts +3 -0
- package/dist/views/OrderListItem.vue.d.ts +3 -0
- package/dist/views/PluginSettings.vue.d.ts +3 -0
- package/dist/views/ProductSettings.vue.d.ts +35 -0
- package/dist/views/integrated/OrderBoxView.vue.d.ts +13 -0
- package/dist/views/integrated/OrderListItemView.vue.d.ts +13 -0
- package/dist/views/integrated/index.d.ts +7 -0
- package/package.json +5 -6
- package/src/forms/shipmentOptions/createShipmentOptionsForm.spec.ts +1 -0
- package/src/forms/shipmentOptions/createShipmentOptionsForm.ts +21 -2
- package/src/forms/shipmentOptions/field.ts +12 -0
- package/src/forms/shipmentOptions/fields/createDimensionFields.spec.ts +49 -0
- package/src/forms/shipmentOptions/fields/createDimensionFields.ts +32 -0
- package/src/forms/shipmentOptions/fields/index.ts +1 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Directive } from 'vue';
|
|
2
|
+
import { type AnyElementInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
type TestIdBinding = string | string[] | [string, AnyElementInstance];
|
|
4
|
+
export declare const testIdDirective: Directive<Element, TestIdBinding>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AbstractEndpoint, type EndpointResponse, FetchClient, type Options } from '@myparcel-dev/sdk';
|
|
2
|
+
export declare class PdkFetchClient extends FetchClient {
|
|
3
|
+
/**
|
|
4
|
+
* Prepare and execute the final request and handle the response.
|
|
5
|
+
*/
|
|
6
|
+
doRequest<E extends AbstractEndpoint>(endpoint: E, options: Options<E>): Promise<EndpointResponse<E>>;
|
|
7
|
+
/**
|
|
8
|
+
* If the url already contains a query string, append the parameters with an ampersand instead.
|
|
9
|
+
*/
|
|
10
|
+
protected createUrl<E extends AbstractEndpoint>(endpoint: E, options: Options<E>): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useFetchCarrier';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFetchCarrier: (carrier?: string | number) => import("@tanstack/vue-query").UseQueryReturnType<import("@myparcel-dev/sdk").Carrier, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BackendEndpoint, type ExtractEndpointDefinition } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { AbstractEndpoint } from '@myparcel-dev/sdk';
|
|
3
|
+
import { type BackendEndpointDefinition } from '../../types';
|
|
4
|
+
export declare abstract class AbstractPdkEndpoint<N extends BackendEndpoint = BackendEndpoint> extends AbstractEndpoint<ExtractEndpointDefinition<N, BackendEndpointDefinition>> {
|
|
5
|
+
readonly name: N | `${N}}`;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './abstractPdkEndpoint';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ActionParameters, type AdminInstance, type AnyActionDefinition, type MaybeAdminAction } from '../../types';
|
|
2
|
+
import { type ActionContext } from '../../actions';
|
|
3
|
+
export declare const createActionContext: <A extends MaybeAdminAction>(action: AnyActionDefinition<A>, parameters?: ActionParameters<A>, existingInstance?: AdminInstance) => ActionContext<A>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getElementContext';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * from './addErrorToNotifications';
|
|
3
|
+
export * from './context';
|
|
4
|
+
export * from './createNotification';
|
|
5
|
+
export * from './instantiateAction';
|
|
6
|
+
export * from './instantiateActions';
|
|
7
|
+
export * from './logger';
|
|
8
|
+
export * from './mutations';
|
|
9
|
+
export * from './print';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { type ActionDefinition, type ActionParameters, type AnyActionDefinition, type MaybeAdminAction } from '../types';
|
|
2
|
+
export declare const instantiateAction: <A extends MaybeAdminAction>(action: AnyActionDefinition<A>, parameters?: ActionParameters<A>) => ActionDefinition<A>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ActionDefinition, type ActionParameters, type AnyActionDefinition } from '../types';
|
|
2
|
+
import { type AdminAction } from '../data';
|
|
3
|
+
type InstantiateActions = {
|
|
4
|
+
(action: AnyActionDefinition, parameters?: ActionParameters<AdminAction>): ActionDefinition[];
|
|
5
|
+
(actions: AnyActionDefinition[], parameters?: ActionParameters<AdminAction>): ActionDefinition[];
|
|
6
|
+
};
|
|
7
|
+
export declare const instantiateActions: InstantiateActions;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
Debug = 1,
|
|
3
|
+
Info = 2,
|
|
4
|
+
Warn = 3,
|
|
5
|
+
Error = 4,
|
|
6
|
+
Off = 5
|
|
7
|
+
}
|
|
8
|
+
export interface PdkLogger {
|
|
9
|
+
level: LogLevel;
|
|
10
|
+
scope: string | null;
|
|
11
|
+
debug(...messages: any[]): void;
|
|
12
|
+
error(...messages: any[]): void;
|
|
13
|
+
info(...messages: any[]): void;
|
|
14
|
+
log(level: LogLevel, ...messages: any[]): void;
|
|
15
|
+
setScope(scope: string | null): void;
|
|
16
|
+
warn(...messages: any[]): void;
|
|
17
|
+
}
|
|
18
|
+
export declare const globalLogger: PdkLogger;
|
|
19
|
+
export declare const createLogger: (scope?: string | null, logLevel?: LogLevel | null) => PdkLogger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './openPdfInNewWindow';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type UseMutationReturnType, type UseQueryReturnType } from '@tanstack/vue-query';
|
|
2
|
+
import { type AdminContextKey, type BackendEndpoint } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type ApiException } from '@myparcel-dev/sdk';
|
|
4
|
+
import { type ActionInput, type AdminContext, type BackendEndpointResponse, type BackendMutationEndpoints, type BackendQueryEndpoints } from '../types';
|
|
5
|
+
import { type QueryModifier } from '../actions';
|
|
6
|
+
type EndpointQuery<E extends BackendEndpoint> = E extends BackendMutationEndpoints ? UseMutationReturnType<BackendEndpointResponse<E>, ApiException, ActionInput<E>, unknown> : E extends BackendQueryEndpoints ? UseQueryReturnType<BackendEndpointResponse<E>, ApiException> : never;
|
|
7
|
+
export type ContextQuery<C extends AdminContextKey = AdminContextKey.Dynamic> = UseQueryReturnType<AdminContext<C>, ApiException>;
|
|
8
|
+
export type ResolvedQuery<E extends BackendEndpoint = BackendEndpoint> = E extends BackendEndpoint ? EndpointQuery<E> : never;
|
|
9
|
+
export type RegisterQuery = {
|
|
10
|
+
<E extends BackendEndpoint, Q extends ResolvedQuery<E> = ResolvedQuery<E>>(endpoint: E, query: Q, arg3?: never): Q;
|
|
11
|
+
<E extends BackendEndpoint, Q extends ResolvedQuery<E> = ResolvedQuery<E>>(endpoint: E, modifier: QueryModifier<E>, query: Q): Q;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type OneOrMore, type PromiseOr } from '@myparcel-dev/ts-utils';
|
|
2
|
+
import { type ActionParameters, type AnyActionDefinition, type ResolvedAction } from '../types';
|
|
3
|
+
import { type AdminAction } from '../data';
|
|
4
|
+
export declare const useActionStore: import("pinia").StoreDefinition<"actions", import("pinia")._UnwrapAll<Pick<{
|
|
5
|
+
get: (action: string | AdminAction) => ResolvedAction | undefined;
|
|
6
|
+
register: (action: OneOrMore<AnyActionDefinition>) => void;
|
|
7
|
+
dispatch: <A extends string | AdminAction>(action: A, parameters?: ActionParameters<A>) => PromiseOr<void>;
|
|
8
|
+
registerOrderActions: () => void;
|
|
9
|
+
registerModalActions: () => void;
|
|
10
|
+
registerWebhookActions: () => void;
|
|
11
|
+
}, never>>, Pick<{
|
|
12
|
+
get: (action: string | AdminAction) => ResolvedAction | undefined;
|
|
13
|
+
register: (action: OneOrMore<AnyActionDefinition>) => void;
|
|
14
|
+
dispatch: <A extends string | AdminAction>(action: A, parameters?: ActionParameters<A>) => PromiseOr<void>;
|
|
15
|
+
registerOrderActions: () => void;
|
|
16
|
+
registerModalActions: () => void;
|
|
17
|
+
registerWebhookActions: () => void;
|
|
18
|
+
}, never>, Pick<{
|
|
19
|
+
get: (action: string | AdminAction) => ResolvedAction | undefined;
|
|
20
|
+
register: (action: OneOrMore<AnyActionDefinition>) => void;
|
|
21
|
+
dispatch: <A extends string | AdminAction>(action: A, parameters?: ActionParameters<A>) => PromiseOr<void>;
|
|
22
|
+
registerOrderActions: () => void;
|
|
23
|
+
registerModalActions: () => void;
|
|
24
|
+
registerWebhookActions: () => void;
|
|
25
|
+
}, "get" | "register" | "dispatch" | "registerOrderActions" | "registerModalActions" | "registerWebhookActions">>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Ref, type UnwrapNestedRefs } from 'vue';
|
|
2
|
+
import { type AdminModalContext } from '../types';
|
|
3
|
+
import { type AdminModalKey } from '../data';
|
|
4
|
+
type ModalOpenFn = <K extends AdminModalKey>(modal: K, context?: AdminModalContext<K>) => void;
|
|
5
|
+
type ModalCloseFn = <K extends AdminModalKey>(modal: K) => void;
|
|
6
|
+
type ModalStore = {
|
|
7
|
+
loading: Ref<boolean>;
|
|
8
|
+
opened: Ref<AdminModalKey | null>;
|
|
9
|
+
context: Ref<UnwrapNestedRefs<AdminModalContext>>;
|
|
10
|
+
onOpen(callback: ModalOpenFn): void;
|
|
11
|
+
onClose(callback: ModalCloseFn): void;
|
|
12
|
+
open<K extends AdminModalKey>(modal: K, newContext?: AdminModalContext<K>): void;
|
|
13
|
+
close(): void;
|
|
14
|
+
};
|
|
15
|
+
export declare const useModalStore: import("pinia").StoreDefinition<"modal", import("pinia")._UnwrapAll<Pick<ModalStore, "context" | "loading" | "opened">>, Pick<ModalStore, never>, Pick<ModalStore, "open" | "close" | "onOpen" | "onClose">>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type NotificationId, type PdkNotification } from '../types';
|
|
2
|
+
import { NotificationSource } from '../data';
|
|
3
|
+
export declare const useNotificationStore: import("pinia").StoreDefinition<"notifications", import("pinia")._UnwrapAll<Pick<{
|
|
4
|
+
notifications: import("vue").Ref<{
|
|
5
|
+
category?: import("..").NotificationCategory | undefined;
|
|
6
|
+
content?: import("@myparcel-dev/ts-utils").OneOrMore<string> | undefined;
|
|
7
|
+
dismissible: boolean;
|
|
8
|
+
id: string | number;
|
|
9
|
+
tags?: Record<string, string> | undefined;
|
|
10
|
+
timeout: boolean | number;
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
variant: import("@myparcel-dev/pdk-common").Variant;
|
|
13
|
+
}[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Add a notification to the store.
|
|
16
|
+
*/
|
|
17
|
+
add(notification: PdkNotification, tags?: object | Record<string, string>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Remove one or more notifications from the store by tag or id.
|
|
20
|
+
*/
|
|
21
|
+
remove(input: NotificationId | NotificationSource): void;
|
|
22
|
+
}, "notifications">>, Pick<{
|
|
23
|
+
notifications: import("vue").Ref<{
|
|
24
|
+
category?: import("..").NotificationCategory | undefined;
|
|
25
|
+
content?: import("@myparcel-dev/ts-utils").OneOrMore<string> | undefined;
|
|
26
|
+
dismissible: boolean;
|
|
27
|
+
id: string | number;
|
|
28
|
+
tags?: Record<string, string> | undefined;
|
|
29
|
+
timeout: boolean | number;
|
|
30
|
+
title?: string | undefined;
|
|
31
|
+
variant: import("@myparcel-dev/pdk-common").Variant;
|
|
32
|
+
}[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Add a notification to the store.
|
|
35
|
+
*/
|
|
36
|
+
add(notification: PdkNotification, tags?: object | Record<string, string>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Remove one or more notifications from the store by tag or id.
|
|
39
|
+
*/
|
|
40
|
+
remove(input: NotificationId | NotificationSource): void;
|
|
41
|
+
}, never>, Pick<{
|
|
42
|
+
notifications: import("vue").Ref<{
|
|
43
|
+
category?: import("..").NotificationCategory | undefined;
|
|
44
|
+
content?: import("@myparcel-dev/ts-utils").OneOrMore<string> | undefined;
|
|
45
|
+
dismissible: boolean;
|
|
46
|
+
id: string | number;
|
|
47
|
+
tags?: Record<string, string> | undefined;
|
|
48
|
+
timeout: boolean | number;
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
variant: import("@myparcel-dev/pdk-common").Variant;
|
|
51
|
+
}[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Add a notification to the store.
|
|
54
|
+
*/
|
|
55
|
+
add(notification: PdkNotification, tags?: object | Record<string, string>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Remove one or more notifications from the store by tag or id.
|
|
58
|
+
*/
|
|
59
|
+
remove(input: NotificationId | NotificationSource): void;
|
|
60
|
+
}, "add" | "remove">>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
import { type MaybeRef } from '@vueuse/core';
|
|
3
|
+
import { AdminContextKey, BackendEndpoint } from '@myparcel-dev/pdk-common';
|
|
4
|
+
import { type OneOrMore } from '@myparcel-dev/ts-utils';
|
|
5
|
+
import { MutationMode } from '../services';
|
|
6
|
+
import { type PlainModifier } from '../actions';
|
|
7
|
+
import { type RegisterQuery, type ResolvedQuery } from './types';
|
|
8
|
+
export declare const useQueryStore: import("pinia").StoreDefinition<"query", import("pinia")._UnwrapAll<Pick<{
|
|
9
|
+
get: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => ResolvedQuery<E>;
|
|
10
|
+
has: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => boolean;
|
|
11
|
+
register: RegisterQuery;
|
|
12
|
+
unregister: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => void;
|
|
13
|
+
registerShipmentQueries: (shipmentIds: MaybeRef<OneOrMore<number>>, orderIds?: MaybeRef<OneOrMore<string>>) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Register queries needed to render any order related component.
|
|
16
|
+
*/
|
|
17
|
+
registerOrderQueries: (orderId?: string | undefined, mode?: MutationMode) => void;
|
|
18
|
+
registerProductQueries: (productId?: string | undefined) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Register context queries. Always includes global and dynamic context.
|
|
21
|
+
*/
|
|
22
|
+
registerContextQueries: <C extends Exclude<AdminContextKey, AdminContextKey.Global | AdminContextKey.Dynamic>>(...keys: C[]) => void;
|
|
23
|
+
getQueriesForShipment(id: number): ComputedRef<Record<BackendEndpoint, ResolvedQuery>>;
|
|
24
|
+
getQueriesForOrder(externalIdentifier: string): ComputedRef<Record<BackendEndpoint, ResolvedQuery>>;
|
|
25
|
+
registerWebhookQueries: () => {
|
|
26
|
+
fetchWebhooks: import("@tanstack/vue-query").UseQueryReturnType<import("..").WebhookDefinition[], import("@myparcel-dev/sdk").ApiException>;
|
|
27
|
+
createWebhooks: import("@tanstack/vue-query").UseMutationReturnType<any, any, any, any>;
|
|
28
|
+
deleteWebhooks: import("@tanstack/vue-query").UseMutationReturnType<import("..").WebhookDefinition[], import("@myparcel-dev/sdk").ApiException, {
|
|
29
|
+
hooks: OneOrMore<string>;
|
|
30
|
+
}, unknown>;
|
|
31
|
+
};
|
|
32
|
+
}, never>>, Pick<{
|
|
33
|
+
get: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => ResolvedQuery<E>;
|
|
34
|
+
has: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => boolean;
|
|
35
|
+
register: RegisterQuery;
|
|
36
|
+
unregister: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => void;
|
|
37
|
+
registerShipmentQueries: (shipmentIds: MaybeRef<OneOrMore<number>>, orderIds?: MaybeRef<OneOrMore<string>>) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Register queries needed to render any order related component.
|
|
40
|
+
*/
|
|
41
|
+
registerOrderQueries: (orderId?: string | undefined, mode?: MutationMode) => void;
|
|
42
|
+
registerProductQueries: (productId?: string | undefined) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Register context queries. Always includes global and dynamic context.
|
|
45
|
+
*/
|
|
46
|
+
registerContextQueries: <C extends Exclude<AdminContextKey, AdminContextKey.Global | AdminContextKey.Dynamic>>(...keys: C[]) => void;
|
|
47
|
+
getQueriesForShipment(id: number): ComputedRef<Record<BackendEndpoint, ResolvedQuery>>;
|
|
48
|
+
getQueriesForOrder(externalIdentifier: string): ComputedRef<Record<BackendEndpoint, ResolvedQuery>>;
|
|
49
|
+
registerWebhookQueries: () => {
|
|
50
|
+
fetchWebhooks: import("@tanstack/vue-query").UseQueryReturnType<import("..").WebhookDefinition[], import("@myparcel-dev/sdk").ApiException>;
|
|
51
|
+
createWebhooks: import("@tanstack/vue-query").UseMutationReturnType<any, any, any, any>;
|
|
52
|
+
deleteWebhooks: import("@tanstack/vue-query").UseMutationReturnType<import("..").WebhookDefinition[], import("@myparcel-dev/sdk").ApiException, {
|
|
53
|
+
hooks: OneOrMore<string>;
|
|
54
|
+
}, unknown>;
|
|
55
|
+
};
|
|
56
|
+
}, never>, Pick<{
|
|
57
|
+
get: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => ResolvedQuery<E>;
|
|
58
|
+
has: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => boolean;
|
|
59
|
+
register: RegisterQuery;
|
|
60
|
+
unregister: <E extends BackendEndpoint>(endpoint: E, modifier?: PlainModifier) => void;
|
|
61
|
+
registerShipmentQueries: (shipmentIds: MaybeRef<OneOrMore<number>>, orderIds?: MaybeRef<OneOrMore<string>>) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Register queries needed to render any order related component.
|
|
64
|
+
*/
|
|
65
|
+
registerOrderQueries: (orderId?: string | undefined, mode?: MutationMode) => void;
|
|
66
|
+
registerProductQueries: (productId?: string | undefined) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Register context queries. Always includes global and dynamic context.
|
|
69
|
+
*/
|
|
70
|
+
registerContextQueries: <C extends Exclude<AdminContextKey, AdminContextKey.Global | AdminContextKey.Dynamic>>(...keys: C[]) => void;
|
|
71
|
+
getQueriesForShipment(id: number): ComputedRef<Record<BackendEndpoint, ResolvedQuery>>;
|
|
72
|
+
getQueriesForOrder(externalIdentifier: string): ComputedRef<Record<BackendEndpoint, ResolvedQuery>>;
|
|
73
|
+
registerWebhookQueries: () => {
|
|
74
|
+
fetchWebhooks: import("@tanstack/vue-query").UseQueryReturnType<import("..").WebhookDefinition[], import("@myparcel-dev/sdk").ApiException>;
|
|
75
|
+
createWebhooks: import("@tanstack/vue-query").UseMutationReturnType<any, any, any, any>;
|
|
76
|
+
deleteWebhooks: import("@tanstack/vue-query").UseMutationReturnType<import("..").WebhookDefinition[], import("@myparcel-dev/sdk").ApiException, {
|
|
77
|
+
hooks: OneOrMore<string>;
|
|
78
|
+
}, unknown>;
|
|
79
|
+
};
|
|
80
|
+
}, "get" | "has" | "register" | "unregister" | "registerShipmentQueries" | "registerOrderQueries" | "registerProductQueries" | "registerContextQueries" | "getQueriesForShipment" | "getQueriesForOrder" | "registerWebhookQueries">>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
|
+
import { type AdminInstance } from './types';
|
|
3
|
+
import { type PdkAdmin } from './pdk';
|
|
4
|
+
export declare const INJECT_ADMIN_INSTANCE: InjectionKey<AdminInstance>;
|
|
5
|
+
export declare const INJECT_GLOBAL_PDK_ADMIN: InjectionKey<PdkAdmin>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './__tests__';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BackendEndpoint } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type ReverseMap } from '@myparcel-dev/ts-utils';
|
|
3
|
+
import { type AdminAction } from '../../data';
|
|
4
|
+
export type MaybeAdminAction = AdminAction | undefined;
|
|
5
|
+
export type PrintAction = AdminAction.ShipmentsPrint | AdminAction.OrdersPrint;
|
|
6
|
+
export type OrderAction = AdminAction.OrdersEdit | AdminAction.OrdersExport | AdminAction.OrdersExportPrint | AdminAction.OrdersFetch | AdminAction.OrdersPrint | AdminAction.OrdersUpdate;
|
|
7
|
+
export interface AdminActionEndpointMap extends Record<AdminAction, BackendEndpoint> {
|
|
8
|
+
[AdminAction.AccountDelete]: BackendEndpoint.DeleteAccount;
|
|
9
|
+
[AdminAction.AccountUpdate]: BackendEndpoint.UpdateAccount;
|
|
10
|
+
[AdminAction.ContextFetch]: BackendEndpoint.FetchContext;
|
|
11
|
+
[AdminAction.DownloadLogs]: BackendEndpoint.DownloadLogs;
|
|
12
|
+
[AdminAction.SwitchToAcceptanceApi]: BackendEndpoint.SwitchToAcceptanceApi;
|
|
13
|
+
[AdminAction.SwitchToProductionApi]: BackendEndpoint.SwitchToProductionApi;
|
|
14
|
+
[AdminAction.OrdersEdit]: BackendEndpoint.UpdateOrders;
|
|
15
|
+
[AdminAction.OrdersExportPrint]: BackendEndpoint.ExportOrders;
|
|
16
|
+
[AdminAction.OrdersExport]: BackendEndpoint.ExportOrders;
|
|
17
|
+
[AdminAction.OrdersFetch]: BackendEndpoint.FetchOrders;
|
|
18
|
+
[AdminAction.OrdersPrint]: BackendEndpoint.PrintOrders;
|
|
19
|
+
[AdminAction.OrdersUpdate]: BackendEndpoint.UpdateOrders;
|
|
20
|
+
[AdminAction.PluginSettingsUpdate]: BackendEndpoint.UpdatePluginSettings;
|
|
21
|
+
[AdminAction.ProductSettingsUpdate]: BackendEndpoint.UpdateProductSettings;
|
|
22
|
+
[AdminAction.ShipmentsDelete]: BackendEndpoint.DeleteShipments;
|
|
23
|
+
[AdminAction.ShipmentsExportReturn]: BackendEndpoint.ExportReturn;
|
|
24
|
+
[AdminAction.ShipmentsFetch]: BackendEndpoint.FetchShipments;
|
|
25
|
+
[AdminAction.ShipmentsPrint]: BackendEndpoint.PrintShipments;
|
|
26
|
+
[AdminAction.ShipmentsUpdate]: BackendEndpoint.UpdateShipments;
|
|
27
|
+
[AdminAction.WebhooksCreate]: BackendEndpoint.CreateWebhooks;
|
|
28
|
+
[AdminAction.WebhooksDelete]: BackendEndpoint.DeleteWebhooks;
|
|
29
|
+
[AdminAction.WebhooksFetch]: BackendEndpoint.FetchWebhooks;
|
|
30
|
+
}
|
|
31
|
+
export type EndpointAdminActionMap = ReverseMap<AdminActionEndpointMap>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type BackendEndpoint } from '@myparcel-dev/pdk-common';
|
|
2
|
+
/**
|
|
3
|
+
* All backend endpoints that are mutations.
|
|
4
|
+
*/
|
|
5
|
+
export type BackendMutationEndpoints = BackendEndpoint.CreateWebhooks | BackendEndpoint.DownloadLogs | BackendEndpoint.SwitchToAcceptanceApi | BackendEndpoint.SwitchToProductionApi | BackendEndpoint.DeleteAccount | BackendEndpoint.DeleteShipments | BackendEndpoint.DeleteWebhooks | BackendEndpoint.ExportOrders | BackendEndpoint.ExportReturn | BackendEndpoint.PrintOrders | BackendEndpoint.PrintShipments | BackendEndpoint.UpdateAccount | BackendEndpoint.UpdateOrders | BackendEndpoint.UpdatePluginSettings | BackendEndpoint.UpdateProductSettings | BackendEndpoint.UpdateShipments;
|
|
6
|
+
/**
|
|
7
|
+
* All backend endpoints that are queries.
|
|
8
|
+
*/
|
|
9
|
+
export type BackendQueryEndpoints = BackendEndpoint.FetchContext | BackendEndpoint.FetchOrders | BackendEndpoint.FetchProducts | BackendEndpoint.FetchShipments | BackendEndpoint.FetchWebhooks | BackendEndpoint.ProxyCapabilities;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type AdminContextKey, type BackendEndpoint, type LabelFormat, type LabelOutput, type LabelPosition } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type OneOrMore } from '@myparcel-dev/ts-utils';
|
|
4
|
+
import { type OrderIds, type ShipmentIds } from '../common.types';
|
|
5
|
+
import { type AdminAction } from '../../data';
|
|
6
|
+
import { type AdminActionEndpointMap, type MaybeAdminAction } from './actions.types';
|
|
7
|
+
type LabelParameters = {
|
|
8
|
+
output?: LabelOutput;
|
|
9
|
+
format?: LabelFormat;
|
|
10
|
+
position?: OneOrMore<LabelPosition>;
|
|
11
|
+
};
|
|
12
|
+
type OrderIdParameters = {
|
|
13
|
+
orderIds?: OrderIds;
|
|
14
|
+
};
|
|
15
|
+
interface ShipmentIdParameters {
|
|
16
|
+
shipmentIds?: ShipmentIds;
|
|
17
|
+
}
|
|
18
|
+
type FormParameters = {
|
|
19
|
+
form: FormInstance;
|
|
20
|
+
};
|
|
21
|
+
type OptionalFormParameters = {
|
|
22
|
+
form?: false | FormInstance;
|
|
23
|
+
};
|
|
24
|
+
type ProductIdParameters = {
|
|
25
|
+
productIds?: OneOrMore<string>;
|
|
26
|
+
};
|
|
27
|
+
type HooksParameters = {
|
|
28
|
+
hooks: OneOrMore<string>;
|
|
29
|
+
};
|
|
30
|
+
type ContextParameters = {
|
|
31
|
+
context?: OneOrMore<AdminContextKey>;
|
|
32
|
+
};
|
|
33
|
+
export interface EndpointMutationInputMap extends Record<BackendEndpoint, object> {
|
|
34
|
+
[BackendEndpoint.FetchContext]: ContextParameters;
|
|
35
|
+
[BackendEndpoint.UpdateAccount]: OptionalFormParameters;
|
|
36
|
+
[BackendEndpoint.ExportOrders]: OrderIdParameters & OptionalFormParameters;
|
|
37
|
+
[BackendEndpoint.FetchOrders]: OrderIdParameters;
|
|
38
|
+
[BackendEndpoint.PrintOrders]: OrderIdParameters & LabelParameters & OptionalFormParameters;
|
|
39
|
+
[BackendEndpoint.UpdateOrders]: OrderIdParameters & FormParameters;
|
|
40
|
+
[BackendEndpoint.DeleteShipments]: OrderIdParameters & ShipmentIdParameters;
|
|
41
|
+
[BackendEndpoint.ExportReturn]: OrderIdParameters & ShipmentIdParameters;
|
|
42
|
+
[BackendEndpoint.FetchShipments]: OrderIdParameters & ShipmentIdParameters;
|
|
43
|
+
[BackendEndpoint.UpdateShipments]: OrderIdParameters & ShipmentIdParameters;
|
|
44
|
+
[BackendEndpoint.PrintShipments]: OrderIdParameters & ShipmentIdParameters & OptionalFormParameters & LabelParameters;
|
|
45
|
+
[BackendEndpoint.FetchProducts]: ProductIdParameters;
|
|
46
|
+
[BackendEndpoint.UpdatePluginSettings]: FormParameters;
|
|
47
|
+
[BackendEndpoint.UpdateProductSettings]: ProductIdParameters & FormParameters;
|
|
48
|
+
[BackendEndpoint.CreateWebhooks]: HooksParameters;
|
|
49
|
+
[BackendEndpoint.DeleteWebhooks]: HooksParameters;
|
|
50
|
+
[BackendEndpoint.FetchWebhooks]: never;
|
|
51
|
+
}
|
|
52
|
+
export type ActionInput<E extends BackendEndpoint> = EndpointMutationInputMap[E];
|
|
53
|
+
export type ActionParameters<A extends string | MaybeAdminAction> = A extends AdminAction ? ActionInput<AdminActionEndpointMap[A]> : object;
|
|
54
|
+
export type MaybeActionParameters<A extends MaybeAdminAction> = ActionParameters<A> | void;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BackendEndpoint, type PdkEndpointResponse } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type BackendEndpointDefinition } from '../sdk.types';
|
|
3
|
+
import { type AdminAction } from '../../data';
|
|
4
|
+
import { type AdminActionEndpointMap, type MaybeAdminAction } from './actions.types';
|
|
5
|
+
export type BackendEndpointResponse<E extends BackendEndpoint> = PdkEndpointResponse<E, BackendEndpointDefinition>;
|
|
6
|
+
export type ActionResponse<A extends MaybeAdminAction> = A extends AdminAction ? BackendEndpointResponse<AdminActionEndpointMap[A]> : void;
|
|
7
|
+
export type MaybeActionResponse<A extends MaybeAdminAction> = ActionResponse<A> | void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type MaybeRef } from '@vueuse/core';
|
|
2
|
+
import { type Variant } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type OneOrMore, type PromiseOr } from '@myparcel-dev/ts-utils';
|
|
4
|
+
import { type AdminAction, type AdminIcon } from '../data';
|
|
5
|
+
import { type ActionContext, type ActionContextWithResponse, type QueryHandler } from '../actions';
|
|
6
|
+
import { type Translation } from './language.types';
|
|
7
|
+
import { type ActionParameters, type ActionResponse, type AdminActionEndpointMap, type MaybeAdminAction } from './actions';
|
|
8
|
+
interface BaseActionDefinition {
|
|
9
|
+
disabled?: MaybeRef<boolean>;
|
|
10
|
+
icon?: AdminIcon;
|
|
11
|
+
label?: Translation;
|
|
12
|
+
notifications?: OneOrMore<Variant>;
|
|
13
|
+
standalone?: boolean;
|
|
14
|
+
variant?: MaybeRef<Variant | undefined>;
|
|
15
|
+
afterHandle?(...args: unknown[]): PromiseOr<unknown>;
|
|
16
|
+
beforeHandle?(...args: unknown[]): PromiseOr<unknown>;
|
|
17
|
+
handler(...args: unknown[]): PromiseOr<unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface NamedActionDefinition<A extends AdminAction = AdminAction> extends BaseActionDefinition {
|
|
20
|
+
name: A;
|
|
21
|
+
afterHandle?(context: ActionContextWithResponse<A>): PromiseOr<ActionResponse<A>>;
|
|
22
|
+
beforeHandle?(context: ActionContext<A>): PromiseOr<ActionParameters<A>>;
|
|
23
|
+
handler: QueryHandler<AdminActionEndpointMap[A]>;
|
|
24
|
+
}
|
|
25
|
+
export interface GenericActionDefinition extends BaseActionDefinition {
|
|
26
|
+
name?: never;
|
|
27
|
+
id: string;
|
|
28
|
+
afterHandle?(context: ActionContextWithResponse): PromiseOr<void>;
|
|
29
|
+
beforeHandle?(context: ActionContext): PromiseOr<void>;
|
|
30
|
+
handler(context: ActionContext): PromiseOr<void>;
|
|
31
|
+
}
|
|
32
|
+
export type AnyActionDefinition<A extends MaybeAdminAction = MaybeAdminAction> = A extends AdminAction ? NamedActionDefinition<A> : GenericActionDefinition;
|
|
33
|
+
export type ActionDefinition<A extends MaybeAdminAction = MaybeAdminAction> = AnyActionDefinition<A> & {
|
|
34
|
+
id: string;
|
|
35
|
+
parameters?: ActionParameters<A>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The final action type that can be executed.
|
|
39
|
+
*/
|
|
40
|
+
export type ResolvedAction = BaseActionDefinition & {
|
|
41
|
+
id: string;
|
|
42
|
+
standalone?: boolean;
|
|
43
|
+
handler(parameters?: ActionParameters<AdminAction> | Record<string, unknown>): PromiseOr<void>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
import { type PdkLogger } from '../services';
|
|
3
|
+
import { type ADMIN_COMPONENT_PREFIX, type AdminComponent, type AdminView, type optionalAdminActionContainerComponentNames, type optionalAdminComponentNames, type optionalAdminPlainWrapperComponentNames, type requiredAdminComponentNames } from '../data';
|
|
4
|
+
import { type AdminContextObject, type AdminInstanceContext } from './context.types';
|
|
5
|
+
import { type AdminConfiguration } from './configuration.types';
|
|
6
|
+
export type RequiredAdminComponentName = (typeof requiredAdminComponentNames)[number];
|
|
7
|
+
export type OptionalAdminComponentName = (typeof optionalAdminComponentNames)[number] | (typeof optionalAdminPlainWrapperComponentNames)[number] | (typeof optionalAdminActionContainerComponentNames)[number];
|
|
8
|
+
export type PrefixedAdminComponent<A extends AdminComponent = AdminComponent> = `${typeof ADMIN_COMPONENT_PREFIX}${A}`;
|
|
9
|
+
export type AdminComponentMap = Record<RequiredAdminComponentName, Component> & Partial<Record<OptionalAdminComponentName, Component>>;
|
|
10
|
+
/**
|
|
11
|
+
* Prefer using AdminComponentMap instead to reduce bundle size.
|
|
12
|
+
*/
|
|
13
|
+
export type PrefixedAdminComponentMap = Record<PrefixedAdminComponent<RequiredAdminComponentName>, Component> & Partial<Record<PrefixedAdminComponent<OptionalAdminComponentName>, Component>>;
|
|
14
|
+
export type ComponentImportFunction = () => Promise<{
|
|
15
|
+
default: Component;
|
|
16
|
+
}>;
|
|
17
|
+
export interface AdminAppConfig {
|
|
18
|
+
appName: string;
|
|
19
|
+
config: AdminConfiguration;
|
|
20
|
+
context: AdminContextObject;
|
|
21
|
+
logger: PdkLogger;
|
|
22
|
+
view?: AdminView;
|
|
23
|
+
}
|
|
24
|
+
export interface AdminInstance extends Omit<AdminAppConfig, 'context'> {
|
|
25
|
+
context: Partial<AdminInstanceContext>;
|
|
26
|
+
}
|