diff --git a/src/__snapshots__/index.spec.ts.snap b/src/__snapshots__/index.spec.ts.snap index 8d6a18f..6922115 100644 --- a/src/__snapshots__/index.spec.ts.snap +++ b/src/__snapshots__/index.spec.ts.snap @@ -36,6 +36,7 @@ exports[`module exports > exposes the correct data from index.ts 1`] = ` "PostCarrierOptions": [Function], "PostShipments": [Function], "PostShop": [Function], + "PostShopDuplicate": [Function], "PostSubscriptions": [Function], "PostWebhookSubscriptions": [Function], "PutAccount": [Function], diff --git a/src/endpoints/private/shops/PostShopDuplicate.ts b/src/endpoints/private/shops/PostShopDuplicate.ts new file mode 100644 index 0000000..5569306 --- /dev/null +++ b/src/endpoints/private/shops/PostShopDuplicate.ts @@ -0,0 +1,20 @@ +import {AbstractPrivateEndpoint} from '@/model/endpoint/AbstractPrivateEndpoint'; +import {type CreateDefinition} from '@/model/endpoint/AbstractEndpoint.types'; +import {type HttpMethod} from '@/types/request.types'; +import {type DuplicateShop} from './Shop.types'; + +type PostShopDuplicateDefinition = CreateDefinition<{ + name: typeof PostShopDuplicate.name; + body: DuplicateShop[]; + response: {ids: [{id: number}]}; +}>; + +/** + * The PostShopDuplicate endpoint is used to add a new shop. + */ +export class PostShopDuplicate extends AbstractPrivateEndpoint { + public readonly method: HttpMethod = 'POST'; + public readonly name = 'postShopDuplicate'; + public readonly path = 'shops/duplicate'; + public readonly property = 'ids'; +} diff --git a/src/endpoints/private/shops/Shop.types.ts b/src/endpoints/private/shops/Shop.types.ts index 2fb1e93..ded5cef 100644 --- a/src/endpoints/private/shops/Shop.types.ts +++ b/src/endpoints/private/shops/Shop.types.ts @@ -83,3 +83,8 @@ export interface MyParcelShop { return: ShopReturn; tracktrace: ShopTrackTrace; } + +export interface DuplicateShop { + name: string; + account_id: number; +} diff --git a/src/endpoints/private/shops/index.ts b/src/endpoints/private/shops/index.ts index 29b6c75..2708715 100644 --- a/src/endpoints/private/shops/index.ts +++ b/src/endpoints/private/shops/index.ts @@ -2,3 +2,4 @@ export * from './GetShop'; export * from './PostShop'; export * from './PutShop'; export * from './Shop.types'; +export * from './PostShopDuplicate';