@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.
- package/README.md +2 -2
- package/lib/createMyParcelSdk.d.ts +8 -4
- package/lib/createPrivateSdk.d.ts +5 -4
- package/lib/createPublicSdk.d.ts +5 -4
- package/lib/endpoints/private/account-messages/DeleteAccountMessage.d.ts +3 -2
- package/lib/endpoints/private/account-messages/GetAccountMessages.d.ts +3 -2
- package/lib/endpoints/private/accounts/Account.types.d.ts +5 -4
- package/lib/endpoints/private/accounts/GetAccount.d.ts +3 -2
- package/lib/endpoints/private/accounts/GetAccounts.d.ts +3 -2
- package/lib/endpoints/private/accounts/PutAccount.d.ts +4 -3
- package/lib/endpoints/private/api-key/GetApiKeys.d.ts +3 -2
- package/lib/endpoints/private/api-key/PostApiKeys.d.ts +4 -3
- package/lib/endpoints/private/carrier-options/CarrierOption.types.d.ts +3 -2
- package/lib/endpoints/private/carrier-options/DeleteCarrierOptions.d.ts +3 -2
- package/lib/endpoints/private/carrier-options/GetCarrierOptions.d.ts +3 -2
- package/lib/endpoints/private/carrier-options/PostCarrierOptions.d.ts +4 -3
- package/lib/endpoints/private/carrier-options/PutCarrierOptions.d.ts +4 -3
- package/lib/endpoints/private/locations/GetLocations.d.ts +3 -2
- package/lib/endpoints/private/shipments/GetShipment.d.ts +3 -2
- package/lib/endpoints/private/shipments/GetShipments.d.ts +4 -3
- package/lib/endpoints/private/shipments/PostShipments.d.ts +4 -3
- package/lib/endpoints/private/shipments/Shipment.types.d.ts +4 -4
- package/lib/endpoints/private/shops/GetShop.d.ts +3 -2
- package/lib/endpoints/private/shops/PostShop.d.ts +4 -3
- package/lib/endpoints/private/shops/PostShopDuplicate.d.ts +4 -3
- package/lib/endpoints/private/shops/PutShop.d.ts +4 -3
- package/lib/endpoints/private/shops/Shop.types.d.ts +2 -1
- package/lib/endpoints/private/shops/index.d.ts +1 -1
- package/lib/endpoints/private/subscription-capabilities/GetSubscriptionCapabilities.d.ts +4 -3
- package/lib/endpoints/private/subscription-capabilities/SubscriptionCapability.types.d.ts +3 -2
- package/lib/endpoints/private/subscriptions/DeleteSubscription.d.ts +3 -2
- package/lib/endpoints/private/subscriptions/GetSubscriptions.d.ts +3 -2
- package/lib/endpoints/private/subscriptions/PatchSubscriptions.d.ts +4 -3
- package/lib/endpoints/private/subscriptions/PostSubscriptions.d.ts +4 -3
- package/lib/endpoints/private/system-country-codes/GetSystemCountryCodes.d.ts +3 -2
- package/lib/endpoints/private/system-country-codes/SystemCountryCodes.types.d.ts +2 -1
- package/lib/endpoints/private/system-messages/GetSystemMessages.d.ts +3 -2
- package/lib/endpoints/private/track-traces/GetTrackAndTraceByShipment.d.ts +3 -2
- package/lib/endpoints/private/track-traces/TrackTraces.types.d.ts +5 -4
- package/lib/endpoints/private/webhook-subscriptions/DeleteWebhookSubscriptions.d.ts +3 -2
- package/lib/endpoints/private/webhook-subscriptions/GetWebhookSubscriptions.d.ts +3 -2
- package/lib/endpoints/private/webhook-subscriptions/PostWebhookSubscriptions.d.ts +4 -3
- package/lib/endpoints/public/carriers/Carrier.types.d.ts +2 -1
- package/lib/endpoints/public/carriers/GetCarrier.d.ts +4 -3
- package/lib/endpoints/public/carriers/GetCarriers.d.ts +3 -2
- package/lib/endpoints/public/delivery-options/DeliveryOption.types.d.ts +4 -4
- package/lib/endpoints/public/delivery-options/GetDeliveryOptions.d.ts +6 -5
- package/lib/endpoints/public/pickup-locations/GetPickupLocations.d.ts +4 -3
- package/lib/endpoints/public/pickup-locations/PickupLocation.types.d.ts +3 -2
- package/lib/index.cjs +1 -1
- package/lib/index.js +154 -118
- package/lib/model/client/AbstractClient.d.ts +15 -4
- package/lib/model/client/AbstractClient.types.d.ts +9 -3
- package/lib/model/client/FetchClient.d.ts +2 -1
- package/lib/model/client/helper/addParameters.d.ts +4 -3
- package/lib/model/client/middleware/Interceptors.d.ts +8 -0
- package/lib/model/client/middleware/Interceptors.unit.spec.d.ts +1 -0
- package/lib/model/client/middleware/middleware.types.d.ts +1 -0
- package/lib/model/endpoint/AbstractEndpoint.d.ts +3 -2
- package/lib/model/endpoint/AbstractEndpoint.types.d.ts +4 -3
- package/lib/model/endpoint/AbstractPrivateEndpoint.d.ts +3 -2
- package/lib/model/endpoint/AbstractPublicEndpoint.d.ts +2 -1
- package/lib/model/exception/ApiException.d.ts +2 -1
- package/package.json +15 -16
- 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
|
-
[](https://www.npmjs.com/package/@myparcel/sdk/)
|
|
3
|
+
[](https://www.npmjs.com/package/@myparcel-dev/sdk/)
|
|
4
4
|
[](https://github.com/myparcelnl/js-sdk/releases)
|
|
5
5
|
[](https://codecov.io/gh/myparcelnl/js-sdk)
|
|
6
6
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
8
|
+
export declare const createPrivateSdk: <E extends AbstractPrivateEndpoint>(client: AbstractClient, endpoints: E[]) => MyParcelSdk<E>;
|
package/lib/createPublicSdk.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
2
|
-
import { AbstractPrivateEndpoint,
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
1
|
+
import { ApiKeyPostData, MyParcelApiKey } from './ApiKey.types';
|
|
2
|
+
import { HttpMethod } from '../../../types';
|
|
2
3
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
4
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
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 {
|
|
1
|
+
import { HttpMethod } from '../../../types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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 {
|
|
1
|
+
import { MyParcelCarrierOption, CarrierOptionsParameters } from './CarrierOption.types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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 {
|
|
1
|
+
import { CarrierOptionPostData } from './CarrierOption.types';
|
|
2
|
+
import { HttpMethod } from '../../../types';
|
|
2
3
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
4
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
1
|
+
import { CarrierOptionPutData } from './CarrierOption.types';
|
|
2
|
+
import { HttpMethod } from '../../../types';
|
|
3
3
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
4
|
-
import {
|
|
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 {
|
|
1
|
+
import { LocationParameters, MyParcelLocation } from './Location.types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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 {
|
|
3
|
-
import {
|
|
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 {
|
|
1
|
+
import { PaginationParameters } from '../../../types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
1
|
+
import { HttpMethod, RequestHeaders } from '../../../types/request.types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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<
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
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,7 +1,8 @@
|
|
|
1
|
+
import { SubscriptionCapability } from './SubscriptionCapability.types';
|
|
1
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
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 {
|
|
1
|
+
import { HttpMethod } from '../../../types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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 {
|
|
1
|
+
import { MyParcelSubscription, SubscriptionPostData } from './Subscriptions.types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
1
|
+
import { SystemCountryCodesPerCountry, GetSystemCountryCodesParams } from './SystemCountryCodes.types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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,6 +1,7 @@
|
|
|
1
|
+
import { MyParcelSystemMessage } from './SystemMessage.types';
|
|
1
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
2
|
-
import {
|
|
3
|
-
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
3
|
-
|
|
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 {
|
|
1
|
+
import { MyParcelWebhook, WebhookSubscriptionParameters } from './Webhook.types';
|
|
2
2
|
import { AbstractPrivateEndpoint } from '../../../model/endpoint/AbstractPrivateEndpoint';
|
|
3
|
-
import {
|
|
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 {
|
|
3
|
-
|
|
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,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CarrierNameOrId } from '@myparcel-dev/constants';
|
|
2
2
|
import { AbstractPublicEndpoint } from '../../../model/endpoint/AbstractPublicEndpoint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
3
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 {
|
|
6
|
-
import {
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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;
|