@myparcel-dev/sdk 4.1.1 → 5.0.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.
Files changed (65) hide show
  1. package/README.md +2 -2
  2. package/lib/createMyParcelSdk.d.ts +8 -4
  3. package/lib/createPrivateSdk.d.ts +5 -4
  4. package/lib/createPublicSdk.d.ts +5 -4
  5. package/lib/endpoints/private/account-messages/DeleteAccountMessage.d.ts +3 -2
  6. package/lib/endpoints/private/account-messages/GetAccountMessages.d.ts +3 -2
  7. package/lib/endpoints/private/accounts/Account.types.d.ts +5 -4
  8. package/lib/endpoints/private/accounts/GetAccount.d.ts +3 -2
  9. package/lib/endpoints/private/accounts/GetAccounts.d.ts +3 -2
  10. package/lib/endpoints/private/accounts/PutAccount.d.ts +4 -3
  11. package/lib/endpoints/private/api-key/GetApiKeys.d.ts +3 -2
  12. package/lib/endpoints/private/api-key/PostApiKeys.d.ts +4 -3
  13. package/lib/endpoints/private/carrier-options/CarrierOption.types.d.ts +3 -2
  14. package/lib/endpoints/private/carrier-options/DeleteCarrierOptions.d.ts +3 -2
  15. package/lib/endpoints/private/carrier-options/GetCarrierOptions.d.ts +3 -2
  16. package/lib/endpoints/private/carrier-options/PostCarrierOptions.d.ts +4 -3
  17. package/lib/endpoints/private/carrier-options/PutCarrierOptions.d.ts +4 -3
  18. package/lib/endpoints/private/locations/GetLocations.d.ts +3 -2
  19. package/lib/endpoints/private/shipments/GetShipment.d.ts +3 -2
  20. package/lib/endpoints/private/shipments/GetShipments.d.ts +4 -3
  21. package/lib/endpoints/private/shipments/PostShipments.d.ts +4 -3
  22. package/lib/endpoints/private/shipments/Shipment.types.d.ts +4 -4
  23. package/lib/endpoints/private/shops/GetShop.d.ts +3 -2
  24. package/lib/endpoints/private/shops/PostShop.d.ts +4 -3
  25. package/lib/endpoints/private/shops/PostShopDuplicate.d.ts +4 -3
  26. package/lib/endpoints/private/shops/PutShop.d.ts +4 -3
  27. package/lib/endpoints/private/shops/Shop.types.d.ts +2 -1
  28. package/lib/endpoints/private/shops/index.d.ts +1 -1
  29. package/lib/endpoints/private/subscription-capabilities/GetSubscriptionCapabilities.d.ts +4 -3
  30. package/lib/endpoints/private/subscription-capabilities/SubscriptionCapability.types.d.ts +3 -2
  31. package/lib/endpoints/private/subscriptions/DeleteSubscription.d.ts +3 -2
  32. package/lib/endpoints/private/subscriptions/GetSubscriptions.d.ts +3 -2
  33. package/lib/endpoints/private/subscriptions/PatchSubscriptions.d.ts +4 -3
  34. package/lib/endpoints/private/subscriptions/PostSubscriptions.d.ts +4 -3
  35. package/lib/endpoints/private/system-country-codes/GetSystemCountryCodes.d.ts +3 -2
  36. package/lib/endpoints/private/system-country-codes/SystemCountryCodes.types.d.ts +2 -1
  37. package/lib/endpoints/private/system-messages/GetSystemMessages.d.ts +3 -2
  38. package/lib/endpoints/private/track-traces/GetTrackAndTraceByShipment.d.ts +3 -2
  39. package/lib/endpoints/private/track-traces/TrackTraces.types.d.ts +5 -4
  40. package/lib/endpoints/private/webhook-subscriptions/DeleteWebhookSubscriptions.d.ts +3 -2
  41. package/lib/endpoints/private/webhook-subscriptions/GetWebhookSubscriptions.d.ts +3 -2
  42. package/lib/endpoints/private/webhook-subscriptions/PostWebhookSubscriptions.d.ts +4 -3
  43. package/lib/endpoints/public/carriers/Carrier.types.d.ts +2 -1
  44. package/lib/endpoints/public/carriers/GetCarrier.d.ts +4 -3
  45. package/lib/endpoints/public/carriers/GetCarriers.d.ts +3 -2
  46. package/lib/endpoints/public/delivery-options/DeliveryOption.types.d.ts +4 -4
  47. package/lib/endpoints/public/delivery-options/GetDeliveryOptions.d.ts +6 -5
  48. package/lib/endpoints/public/pickup-locations/GetPickupLocations.d.ts +4 -3
  49. package/lib/endpoints/public/pickup-locations/PickupLocation.types.d.ts +3 -2
  50. package/lib/index.cjs +1 -1
  51. package/lib/index.js +154 -118
  52. package/lib/model/client/AbstractClient.d.ts +15 -4
  53. package/lib/model/client/AbstractClient.types.d.ts +9 -3
  54. package/lib/model/client/FetchClient.d.ts +2 -1
  55. package/lib/model/client/helper/addParameters.d.ts +4 -3
  56. package/lib/model/client/middleware/Interceptors.d.ts +8 -0
  57. package/lib/model/client/middleware/Interceptors.unit.spec.d.ts +1 -0
  58. package/lib/model/client/middleware/middleware.types.d.ts +1 -0
  59. package/lib/model/endpoint/AbstractEndpoint.d.ts +3 -2
  60. package/lib/model/endpoint/AbstractEndpoint.types.d.ts +4 -3
  61. package/lib/model/endpoint/AbstractPrivateEndpoint.d.ts +3 -2
  62. package/lib/model/endpoint/AbstractPublicEndpoint.d.ts +2 -1
  63. package/lib/model/exception/ApiException.d.ts +2 -1
  64. package/package.json +15 -16
  65. package/lib/endpoints/private/shipments/PatchShipment.d.ts +0 -21
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @myparcel/sdk
1
+ # @myparcel-dev/sdk
2
2
 
3
- [![npm](https://img.shields.io/npm/v/@myparcel/sdk?labelColor=27272A&logoColor=FFFFFF&style=for-the-badge&color=CC3534&logo=npm)](https://www.npmjs.com/package/@myparcel/sdk/)
3
+ [![npm](https://img.shields.io/npm/v/@myparcel-dev/sdk?labelColor=27272A&logoColor=FFFFFF&style=for-the-badge&color=CC3534&logo=npm)](https://www.npmjs.com/package/@myparcel-dev/sdk/)
4
4
  [![GitHub release (latest by date)](https://img.shields.io/github/v/release/myparcelnl/js-sdk?labelColor=27272A&style=for-the-badge)](https://github.com/myparcelnl/js-sdk/releases)
5
5
  [![codecov](https://codecov.io/gh/myparcelnl/js-sdk/graph/badge.svg?token=sdNcLRMAEn)](https://codecov.io/gh/myparcelnl/js-sdk)
6
6
 
@@ -1,8 +1,12 @@
1
- import { type AbstractEndpoint } from './model/endpoint/AbstractEndpoint';
2
- import { type EndpointResponse, type Options } from './model/client/AbstractClient.types';
3
- import { type AbstractClient } from './model/client/AbstractClient';
1
+ import { AbstractEndpoint } from './model/endpoint/AbstractEndpoint';
2
+ import { EndpointResponse, Options } from './model/client/AbstractClient.types';
3
+ import { AbstractClient } from './model/client/AbstractClient';
4
+
4
5
  type EndpointMethod<E extends AbstractEndpoint> = (options?: Options<E>) => Promise<EndpointResponse<E>>;
5
- export type MyParcelSdk<E extends AbstractEndpoint> = {
6
+ export type MyParcelSdk<E extends AbstractEndpoint> = MyParcelSdkEndpoints<E> & {
7
+ client: AbstractClient;
8
+ };
9
+ type MyParcelSdkEndpoints<E extends AbstractEndpoint> = {
6
10
  [K in E['name']]: EndpointMethod<Extract<E, {
7
11
  name: K;
8
12
  }>>;
@@ -1,7 +1,8 @@
1
- import { type AbstractPrivateEndpoint } from './model/endpoint/AbstractPrivateEndpoint';
2
- import { type AbstractClient } from './model/client/AbstractClient';
3
- import { type MyParcelSdk } from './createMyParcelSdk';
1
+ import { AbstractPrivateEndpoint } from './model/endpoint/AbstractPrivateEndpoint';
2
+ import { AbstractClient } from './model/client/AbstractClient';
3
+ import { MyParcelSdk } from './createMyParcelSdk';
4
+
4
5
  /**
5
6
  * Create a private SDK which requires an Authorization header on all its endpoints.
6
7
  */
7
- export declare const createPrivateSdk: <E extends AbstractPrivateEndpoint<import("./model").EndpointDefinition>>(client: AbstractClient, endpoints: E[]) => MyParcelSdk<E>;
8
+ export declare const createPrivateSdk: <E extends AbstractPrivateEndpoint>(client: AbstractClient, endpoints: E[]) => MyParcelSdk<E>;
@@ -1,7 +1,8 @@
1
- import { type AbstractPublicEndpoint } from './model/endpoint/AbstractPublicEndpoint';
2
- import { type AbstractClient } from './model/client/AbstractClient';
3
- import { type MyParcelSdk } from './createMyParcelSdk';
1
+ import { AbstractPublicEndpoint } from './model/endpoint/AbstractPublicEndpoint';
2
+ import { AbstractClient } from './model/client/AbstractClient';
3
+ import { MyParcelSdk } from './createMyParcelSdk';
4
+
4
5
  /**
5
6
  * Create a public SDK which does not require Authorization headers and can be used in a browser.
6
7
  */
7
- export declare const createPublicSdk: <E extends AbstractPublicEndpoint<import("./model").EndpointDefinition>>(client: AbstractClient, endpoints: E[]) => MyParcelSdk<E>;
8
+ export declare const createPublicSdk: <E extends AbstractPublicEndpoint>(client: AbstractClient, endpoints: E[]) => MyParcelSdk<E>;
@@ -1,6 +1,7 @@
1
+ import { HttpMethod } from '../../../types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type DeleteAccountMessageDefinition = CreateDefinition<{
5
6
  name: typeof DeleteAccountMessage.name;
6
7
  path: {
@@ -1,6 +1,7 @@
1
+ import { MyParcelAccountMessage } from './AccountMessages.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type MyParcelAccountMessage } from './AccountMessages.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetAccountMessagesDefinition = CreateDefinition<{
5
6
  name: typeof GetAccountMessages.name;
6
7
  parameters: {
@@ -1,7 +1,8 @@
1
- import { type PlatformId } from '@myparcel-dev/constants';
2
- import { type Address } from '../../../types/common.types';
3
- import { type PaginationParameters, type IntBoolean, type Price } from '../../../types';
4
- import { type MyParcelShop } from '../shops/Shop.types';
1
+ import { PlatformId } from '@myparcel-dev/constants';
2
+ import { Address } from '../../../types/common.types';
3
+ import { PaginationParameters, IntBoolean, Price } from '../../../types';
4
+ import { MyParcelShop } from '../shops/Shop.types';
5
+
5
6
  export interface AccountAdditionalInfo {
6
7
  ecommerce_platform: string;
7
8
  phone: string;
@@ -1,6 +1,7 @@
1
+ import { MyParcelAccount } from './Account.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type MyParcelAccount } from './Account.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetAccountDefinition = CreateDefinition<{
5
6
  name: typeof GetAccount.name;
6
7
  path: {
@@ -1,5 +1,6 @@
1
- import { type GetAccountsParams, type MyParcelAccount } from './Account.types';
2
- import { AbstractPrivateEndpoint, type CreateDefinition, type PaginatedResponse } from '../../../model';
1
+ import { GetAccountsParams, MyParcelAccount } from './Account.types';
2
+ import { AbstractPrivateEndpoint, CreateDefinition, PaginatedResponse } from '../../../model';
3
+
3
4
  type GetAccountsDefinition = CreateDefinition<{
4
5
  name: typeof GetAccounts.name;
5
6
  parameters: GetAccountsParams;
@@ -1,7 +1,8 @@
1
+ import { MyParcelAccount } from './Account.types';
2
+ import { HttpMethod } from '../../../types';
1
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types';
4
- import { type MyParcelAccount } from './Account.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PutAccountDefinition = CreateDefinition<{
6
7
  name: typeof PutAccount.name;
7
8
  path: {
@@ -1,6 +1,7 @@
1
+ import { MyParcelApiKey } from './ApiKey.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type MyParcelApiKey } from './ApiKey.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetApiKeysDefinition = CreateDefinition<{
5
6
  name: typeof GetApiKeys.name;
6
7
  response: MyParcelApiKey[];
@@ -1,7 +1,8 @@
1
- import { type ApiKeyPostData, type MyParcelApiKey } from './ApiKey.types';
1
+ import { ApiKeyPostData, MyParcelApiKey } from './ApiKey.types';
2
+ import { HttpMethod } from '../../../types';
2
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
- import { type HttpMethod } from '../../../types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PostApiKeyDefinition = CreateDefinition<{
6
7
  name: typeof PostApiKeys.name;
7
8
  body: ApiKeyPostData[];
@@ -1,5 +1,6 @@
1
- import { type CarrierId, type CarrierName } from '@myparcel-dev/constants';
2
- import { type IntBoolean } from '../../../types';
1
+ import { CarrierId, CarrierName } from '@myparcel-dev/constants';
2
+ import { IntBoolean } from '../../../types';
3
+
3
4
  export type MyParcelCarrierOption = {
4
5
  api_key: string;
5
6
  carrier: {
@@ -1,6 +1,7 @@
1
- import { type HttpMethod } from '../../../types';
1
+ import { HttpMethod } from '../../../types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type DeleteCarrierOptionsDefinition = CreateDefinition<{
5
6
  name: typeof DeleteCarrierOptions.name;
6
7
  path: {
@@ -1,6 +1,7 @@
1
- import { type MyParcelCarrierOption, type CarrierOptionsParameters } from './CarrierOption.types';
1
+ import { MyParcelCarrierOption, CarrierOptionsParameters } from './CarrierOption.types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetCarrierOptionsDefinition = CreateDefinition<{
5
6
  name: typeof GetCarrierOptions.name;
6
7
  path: {
@@ -1,7 +1,8 @@
1
- import { type HttpMethod } from '../../../types';
1
+ import { CarrierOptionPostData } from './CarrierOption.types';
2
+ import { HttpMethod } from '../../../types';
2
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CarrierOptionPostData } from './CarrierOption.types';
4
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PostCarrierOptionsDefinition = CreateDefinition<{
6
7
  name: typeof PostCarrierOptions.name;
7
8
  body: CarrierOptionPostData[];
@@ -1,7 +1,8 @@
1
- import { type CarrierOptionPutData } from './CarrierOption.types';
2
- import { type HttpMethod } from '../../../types';
1
+ import { CarrierOptionPutData } from './CarrierOption.types';
2
+ import { HttpMethod } from '../../../types';
3
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
4
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PutCarrierOptionsDefinition = CreateDefinition<{
6
7
  name: typeof PutCarrierOptions.name;
7
8
  path: {
@@ -1,6 +1,7 @@
1
- import { type LocationParameters, type MyParcelLocation } from './Location.types';
1
+ import { LocationParameters, MyParcelLocation } from './Location.types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetLocationsDefinition = CreateDefinition<{
5
6
  name: typeof GetLocations.name;
6
7
  parameters: LocationParameters;
@@ -1,6 +1,7 @@
1
1
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type MyParcelShipment } from '../..';
2
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { MyParcelShipment } from '../..';
4
+
4
5
  type GetShipmentDefinition = CreateDefinition<{
5
6
  name: typeof GetShipment.name;
6
7
  path: {
@@ -1,7 +1,8 @@
1
- import { type PaginationParameters } from '../../../types';
1
+ import { PaginationParameters } from '../../../types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition, type PaginatedResponse } from '../../../model/endpoint/AbstractEndpoint.types';
4
- import { type MyParcelShipment } from '../..';
3
+ import { CreateDefinition, PaginatedResponse } from '../../../model/endpoint/AbstractEndpoint.types';
4
+ import { MyParcelShipment } from '../..';
5
+
5
6
  type Parameters = PaginationParameters & {
6
7
  carrier?: number;
7
8
  hidden?: boolean;
@@ -1,7 +1,8 @@
1
- import { type HttpMethod, type RequestHeaders } from '../../../types/request.types';
1
+ import { HttpMethod, RequestHeaders } from '../../../types/request.types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
- import { type PostedShipmentReference, type ShipmentPostData } from './Shipment.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+ import { PostedShipmentReference, ShipmentPostData } from './Shipment.types';
5
+
5
6
  type PostShipmentsDefinition = CreateDefinition<{
6
7
  name: typeof PostShipments.name;
7
8
  body: ShipmentPostData[];
@@ -1,6 +1,6 @@
1
- import { type CarrierId, type CustomsDeclarationContents, type DeliveryTypeId, type PackageTypeId, type ShipmentStatus } from '@myparcel-dev/constants';
2
- import { type Address, type AddressWithContactDetails, type RetailLocation } from '../../../types';
3
- import { type IntBoolean, type Price, type WithRequired } from '../../../types';
1
+ import { CarrierId, CustomsDeclarationContents, DeliveryTypeId, PackageTypeId, ShipmentStatus } from '@myparcel-dev/constants';
2
+ import { AddressWithContactDetails, RetailLocation, IntBoolean, Price, WithRequired } from '../../../types';
3
+
4
4
  export interface PostedShipmentReference {
5
5
  id: number;
6
6
  reference_identifier: string;
@@ -88,7 +88,7 @@ export interface ShipmentPostData {
88
88
  options?: ShipmentOptions;
89
89
  physical_properties?: PhysicalProperties;
90
90
  pickup?: ShipmentPickup | null;
91
- recipient: WithRequired<Address, 'number'> | WithRequired<Address, 'street'>;
91
+ recipient: WithRequired<AddressWithContactDetails, 'number'> | WithRequired<AddressWithContactDetails, 'street'>;
92
92
  reference_identifier?: number | string;
93
93
  shop_id?: number;
94
94
  status?: ShipmentStatus;
@@ -1,6 +1,7 @@
1
+ import { MyParcelShop } from './Shop.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type MyParcelShop } from './Shop.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetShopDefinition = CreateDefinition<{
5
6
  name: typeof GetShop.name;
6
7
  path: {
@@ -1,7 +1,8 @@
1
+ import { MyParcelShop } from './Shop.types';
2
+ import { HttpMethod } from '../../../types/request.types';
1
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types/request.types';
4
- import { type MyParcelShop } from './Shop.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PostShopDefinition = CreateDefinition<{
6
7
  name: typeof PostShop.name;
7
8
  body: MyParcelShop[];
@@ -1,7 +1,8 @@
1
+ import { DuplicateShop } from './Shop.types';
2
+ import { HttpMethod } from '../../../types/request.types';
1
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types/request.types';
4
- import { type DuplicateShop } from './Shop.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PostShopDuplicateDefinition = CreateDefinition<{
6
7
  name: typeof PostShopDuplicate.name;
7
8
  body: DuplicateShop[];
@@ -1,7 +1,8 @@
1
+ import { MyParcelShop } from './Shop.types';
2
+ import { HttpMethod } from '../../../types/request.types';
1
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types/request.types';
4
- import { type MyParcelShop } from './Shop.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PutShopDefinition = CreateDefinition<{
6
7
  name: typeof PutShop.name;
7
8
  body: MyParcelShop[];
@@ -1,4 +1,5 @@
1
- import { type Address, type IntBoolean } from '../../../types';
1
+ import { Address, IntBoolean } from '../../../types';
2
+
2
3
  export interface ShopBranding {
3
4
  accent_color: string;
4
5
  enable_returns: boolean;
@@ -1,5 +1,5 @@
1
1
  export * from './GetShop';
2
2
  export * from './PostShop';
3
+ export * from './PostShopDuplicate';
3
4
  export * from './PutShop';
4
5
  export * from './Shop.types';
5
- export * from './PostShopDuplicate';
@@ -1,7 +1,8 @@
1
+ import { SubscriptionCapability } from './SubscriptionCapability.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type SubscriptionType } from '../subscriptions/Subscriptions.types';
4
- import { type SubscriptionCapability } from './SubscriptionCapability.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+ import { SubscriptionType } from '../subscriptions/Subscriptions.types';
5
+
5
6
  type GetSubscriptionsCapabilitiesDefinition = CreateDefinition<{
6
7
  name: typeof GetSubscriptionsCapabilities.name;
7
8
  parameters: {
@@ -1,5 +1,6 @@
1
- import { type SubscriptionProductId, type SubscriptionTier, type SubscriptionTierName, type SubscriptionType } from '../subscriptions/Subscriptions.types';
2
- import { type Price } from '../../../types';
1
+ import { Price } from '../../../types';
2
+ import { SubscriptionProductId, SubscriptionTier, SubscriptionTierName, SubscriptionType } from '../subscriptions/Subscriptions.types';
3
+
3
4
  export type DashboardSlug = 'shipments' | 'returns' | 'webshops' | 'shipments-weekly' | 'returns-weekly' | 'webshops-weekly' | 'transit-time' | 'surcharges' | 'cases' | 'shipments-t2' | 'returns-t2' | 'webshops-t2' | 'transit-time-t2' | 'surcharges-t2' | 'cases-t2' | 'finance-t2' | 'shortcoming-t2' | 'shipments-t3' | 'returns-t3' | 'webshops-t3' | 'transit-time-t3' | 'surcharges-t3' | 'cases-t3' | 'finance-t3' | 'shortcoming-t3';
4
5
  export interface SubscriptionConfiguration {
5
6
  dashboard_slugs: string[];
@@ -1,6 +1,7 @@
1
- import { type HttpMethod } from '../../../types';
1
+ import { HttpMethod } from '../../../types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type DeleteSubscriptionDefinition = CreateDefinition<{
5
6
  name: typeof DeleteSubscription.name;
6
7
  path: {
@@ -1,6 +1,7 @@
1
- import { type MyParcelSubscription, type SubscriptionPostData } from './Subscriptions.types';
1
+ import { MyParcelSubscription, SubscriptionPostData } from './Subscriptions.types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetSubscriptionsDefinition = CreateDefinition<{
5
6
  name: typeof GetSubscriptions.name;
6
7
  parameters: {
@@ -1,7 +1,8 @@
1
+ import { SubscriptionPatchData } from './Subscriptions.types';
2
+ import { HttpMethod } from '../../../types';
1
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types';
4
- import { type SubscriptionPatchData } from './Subscriptions.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PatchSubscriptionsDefinition = CreateDefinition<{
6
7
  name: typeof PatchSubscriptions.name;
7
8
  body: SubscriptionPatchData[];
@@ -1,7 +1,8 @@
1
- import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types';
4
1
  import { SubscriptionPostData } from './Subscriptions.types';
2
+ import { HttpMethod } from '../../../types';
3
+ import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PostSubscriptionsDefinition = CreateDefinition<{
6
7
  name: typeof PostSubscriptions.name;
7
8
  body: SubscriptionPostData[];
@@ -1,6 +1,7 @@
1
- import { type SystemCountryCodesPerCountry, type GetSystemCountryCodesParams } from './SystemCountryCodes.types';
1
+ import { SystemCountryCodesPerCountry, GetSystemCountryCodesParams } from './SystemCountryCodes.types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetSystemCountryCodesDefinition = CreateDefinition<{
5
6
  name: typeof GetSystemCountryCodes.name;
6
7
  parameters: GetSystemCountryCodesParams;
@@ -1,4 +1,5 @@
1
- import { type CarrierId } from '@myparcel-dev/constants';
1
+ import { CarrierId } from '@myparcel-dev/constants';
2
+
2
3
  export interface SystemCountryCode {
3
4
  label: string;
4
5
  region: string;
@@ -1,6 +1,7 @@
1
+ import { MyParcelSystemMessage } from './SystemMessage.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type MyParcelSystemMessage } from './SystemMessage.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetSystemMessagesDefinition = CreateDefinition<{
5
6
  name: typeof GetSystemMessages.name;
6
7
  response: MyParcelSystemMessage[];
@@ -1,6 +1,7 @@
1
+ import { TrackAndTrace } from './TrackTraces.types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type TrackAndTrace } from './TrackTraces.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetTrackAndTraceDefinition = CreateDefinition<{
5
6
  name: typeof GetTrackAndTrace.name;
6
7
  response: TrackAndTrace[];
@@ -1,7 +1,8 @@
1
- import { type Address, type AddressWithContactDetails } from '../../../types';
2
- import { type CarrierId } from '@myparcel-dev/constants';
3
- import { type PickupLocation } from '../../public';
4
- import { type ShipmentOptions } from '../shipments';
1
+ import { CarrierId } from '@myparcel-dev/constants';
2
+ import { ShipmentOptions } from '../shipments';
3
+ import { Address, AddressWithContactDetails } from '../../../types';
4
+ import { PickupLocation } from '../../public';
5
+
5
6
  export interface PartnerTrackTraceLink {
6
7
  barcode: string;
7
8
  uri: string;
@@ -1,6 +1,7 @@
1
+ import { HttpMethod } from '../../../types';
1
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type DeleteWebhookSubscriptionsDefinition = CreateDefinition<{
5
6
  name: typeof DeleteWebhookSubscriptions.name;
6
7
  path: {
@@ -1,6 +1,7 @@
1
- import { type MyParcelWebhook, type WebhookSubscriptionParameters } from './Webhook.types';
1
+ import { MyParcelWebhook, WebhookSubscriptionParameters } from './Webhook.types';
2
2
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+
4
5
  type GetWebhookSubscriptionsDefinition = CreateDefinition<{
5
6
  name: typeof GetWebhookSubscriptions.name;
6
7
  parameters: WebhookSubscriptionParameters;
@@ -1,7 +1,8 @@
1
+ import { MyParcelWebhook } from './Webhook.types';
2
+ import { HttpMethod } from '../../../types';
1
3
  import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type HttpMethod } from '../../../types';
4
- import { type MyParcelWebhook } from './Webhook.types';
4
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
5
+
5
6
  type PostWebhookSubscriptionsDefinition = CreateDefinition<{
6
7
  name: typeof PostWebhookSubscriptions.name;
7
8
  body: MyParcelWebhook[];
@@ -1,4 +1,5 @@
1
- import { type CarrierId, type CarrierName } from '@myparcel-dev/constants';
1
+ import { CarrierId, CarrierName } from '@myparcel-dev/constants';
2
+
2
3
  export interface Carrier {
3
4
  id: CarrierId;
4
5
  name: CarrierName;
@@ -1,7 +1,8 @@
1
- import { type CarrierNameOrId } from '@myparcel-dev/constants';
1
+ import { CarrierNameOrId } from '@myparcel-dev/constants';
2
2
  import { AbstractPublicEndpoint } from '../../../model/endpoint/AbstractPublicEndpoint';
3
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
- import { type Carrier } from './Carrier.types';
3
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
4
+ import { Carrier } from './Carrier.types';
5
+
5
6
  export type GetCarrierDefinition = CreateDefinition<{
6
7
  name: typeof GetCarrier.name;
7
8
  path: {
@@ -1,6 +1,7 @@
1
1
  import { AbstractPublicEndpoint } from '../../../model/endpoint/AbstractPublicEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type Carrier } from './Carrier.types';
2
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { Carrier } from './Carrier.types';
4
+
4
5
  export type GetCarriersDefinition = CreateDefinition<{
5
6
  name: typeof GetCarriers.name;
6
7
  response: Carrier[];
@@ -1,6 +1,7 @@
1
- import { type DeliveryTypeName, type PackageTypeName, type ShipmentOptionName } from '@myparcel-dev/constants';
2
- import { type EnumSchema, type Timestamp } from '../../../types';
3
- interface PossibleShipmentOption {
1
+ import { DeliveryTypeName, PackageTypeName, ShipmentOptionName } from '@myparcel-dev/constants';
2
+ import { EnumSchema, Timestamp } from '../../../types';
3
+
4
+ export interface PossibleShipmentOption {
4
5
  name: ShipmentOptionName;
5
6
  schema: EnumSchema<boolean>;
6
7
  }
@@ -19,4 +20,3 @@ export interface DeliveryTimeFrame<Type = 'start' | 'end'> {
19
20
  date_time: Timestamp;
20
21
  type: Type;
21
22
  }
22
- export {};
@@ -1,9 +1,10 @@
1
- import { type CarrierNameOrId, type DeliveryTypeId, type PackageTypeName, type PlatformNameOrId } from '@myparcel-dev/constants';
2
- import { type RequestHeaders } from '../../../types/request.types';
3
- import { type WithRequired } from '../../../types/global.types';
1
+ import { CarrierNameOrId, DeliveryTypeId, PackageTypeName, PlatformNameOrId } from '@myparcel-dev/constants';
2
+ import { RequestHeaders } from '../../../types/request.types';
3
+ import { WithRequired } from '../../../types/global.types';
4
4
  import { AbstractPublicEndpoint } from '../../../model/endpoint/AbstractPublicEndpoint';
5
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
6
- import { type DeliveryOption } from './DeliveryOption.types';
5
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
6
+ import { DeliveryOption } from './DeliveryOption.types';
7
+
7
8
  type Parameters = {
8
9
  carrier: CarrierNameOrId;
9
10
  cc: string;
@@ -1,7 +1,8 @@
1
1
  import { AbstractPublicEndpoint } from '../../../model/endpoint/AbstractPublicEndpoint';
2
- import { type CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
- import { type PickupLocation } from './PickupLocation.types';
4
- import { type DeliveryOptionsParameters } from '../..';
2
+ import { CreateDefinition } from '../../../model/endpoint/AbstractEndpoint.types';
3
+ import { PickupLocation } from './PickupLocation.types';
4
+ import { DeliveryOptionsParameters } from '../..';
5
+
5
6
  export type GetPickupLocationsDefinition = CreateDefinition<{
6
7
  name: typeof GetPickupLocations.name;
7
8
  parameters: DeliveryOptionsParameters;