@code.store/arcxp-sdk-ts 5.1.1 → 5.1.2

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.
@@ -1,6 +1,6 @@
1
1
  import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';
2
- import type { MigrateBatchSubscriptionsPayload, MigrateBatchSubscriptionsResponse } from './types.js';
2
+ import type { MigrateBatchSubscriptionsParams, MigrateBatchSubscriptionsPayload, MigrateBatchSubscriptionsResponse } from './types.js';
3
3
  export declare class ArcSales extends ArcAbstractAPI {
4
4
  constructor(options: ArcAPIOptions);
5
- migrate(payload: MigrateBatchSubscriptionsPayload): Promise<MigrateBatchSubscriptionsResponse>;
5
+ migrate(params: MigrateBatchSubscriptionsParams, payload: MigrateBatchSubscriptionsPayload): Promise<MigrateBatchSubscriptionsResponse>;
6
6
  }
@@ -1,8 +1,12 @@
1
1
  import type { UserAttribute } from '../identity/types';
2
+ import type { Website } from '../../types/ans-types';
2
3
  export type MigrateBatchSubscriptionsPayload = {
3
4
  subscriptions: (PaidSubscription | FreeSubscription | SharedSubscription | LinkedSubscription)[];
4
5
  payments: PaymentInfo[];
5
6
  };
7
+ export type MigrateBatchSubscriptionsParams = {
8
+ site: Website;
9
+ };
6
10
  export type MigrateBatchSubscriptionsResponse = {
7
11
  subscriptionsInBatch?: number;
8
12
  batchID?: string;
package/dist/index.cjs CHANGED
@@ -710,10 +710,11 @@ class ArcSales extends ArcAbstractAPI {
710
710
  constructor(options) {
711
711
  super({ ...options, apiPath: 'sales/api/v1' });
712
712
  }
713
- async migrate(payload) {
713
+ async migrate(params, payload) {
714
714
  const form = new FormData();
715
715
  form.append('file', JSON.stringify(payload), { filename: 'subs.json', contentType: 'application/json' });
716
716
  const { data } = await this.client.post('/migrate', form, {
717
+ params,
717
718
  headers: {
718
719
  ...form.getHeaders(),
719
720
  },