@code.store/arcxp-sdk-ts 5.1.1 → 5.1.3
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/dist/api/index.d.ts +2 -1
- package/dist/api/sales/index.d.ts +6 -2
- package/dist/api/sales/types.d.ts +14 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { ArcProtoCenter } from './photo-center/index.js';
|
|
|
12
12
|
import { ArcRedirect } from './redirect/index.js';
|
|
13
13
|
import { ArcRetailEvents } from './retail-events/index.js';
|
|
14
14
|
import { ArcDeveloperRetail } from './developer-retail/index.js';
|
|
15
|
-
import { ArcSales } from './sales/index.js';
|
|
15
|
+
import { ArcSales, ArcSalesV2 } from './sales/index.js';
|
|
16
16
|
import { ArcSigningService } from './signing-service/index.js';
|
|
17
17
|
import { ArcSite } from './site/index.js';
|
|
18
18
|
import { ArcTags } from './tags/index.js';
|
|
@@ -25,6 +25,7 @@ export declare const ArcAPI: (options: ArcAPIOptions) => {
|
|
|
25
25
|
Redirect: ArcRedirect;
|
|
26
26
|
MigrationCenter: ArcMigrationCenter;
|
|
27
27
|
Sales: ArcSales;
|
|
28
|
+
SalesV2: ArcSalesV2;
|
|
28
29
|
Site: ArcSite;
|
|
29
30
|
Websked: ArcWebsked;
|
|
30
31
|
Content: ArcContent;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';
|
|
2
|
-
import type { MigrateBatchSubscriptionsPayload, MigrateBatchSubscriptionsResponse } from './types.js';
|
|
2
|
+
import type { CreateEnterpriseGroupPayload, CreateEnterpriseGroupResponse, 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
|
+
}
|
|
7
|
+
export declare class ArcSalesV2 extends ArcAbstractAPI {
|
|
8
|
+
constructor(options: ArcAPIOptions);
|
|
9
|
+
createEnterpriseGroup(payload: CreateEnterpriseGroupPayload): Promise<CreateEnterpriseGroupResponse>;
|
|
6
10
|
}
|
|
@@ -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;
|
|
@@ -79,4 +83,14 @@ export type Refund = {
|
|
|
79
83
|
tax: number;
|
|
80
84
|
providerReference?: string;
|
|
81
85
|
};
|
|
86
|
+
export type CreateEnterpriseGroupPayload = {
|
|
87
|
+
name: string;
|
|
88
|
+
sku: string;
|
|
89
|
+
};
|
|
90
|
+
export type CreateEnterpriseGroupResponse = {
|
|
91
|
+
name: string;
|
|
92
|
+
sku: string;
|
|
93
|
+
nonceExpirationInDays: number;
|
|
94
|
+
id: number;
|
|
95
|
+
};
|
|
82
96
|
export {};
|
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
|
},
|
|
@@ -721,6 +722,15 @@ class ArcSales extends ArcAbstractAPI {
|
|
|
721
722
|
return data;
|
|
722
723
|
}
|
|
723
724
|
}
|
|
725
|
+
class ArcSalesV2 extends ArcAbstractAPI {
|
|
726
|
+
constructor(options) {
|
|
727
|
+
super({ ...options, apiPath: 'sales/api/v2' });
|
|
728
|
+
}
|
|
729
|
+
async createEnterpriseGroup(payload) {
|
|
730
|
+
const { data } = await this.client.post('/subscriptions/enterprise', payload);
|
|
731
|
+
return data;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
724
734
|
|
|
725
735
|
class ArcSigningService extends ArcAbstractAPI {
|
|
726
736
|
constructor(options) {
|
|
@@ -853,6 +863,7 @@ const ArcAPI = (options) => {
|
|
|
853
863
|
Redirect: new ArcRedirect(options),
|
|
854
864
|
MigrationCenter: new ArcMigrationCenter(options),
|
|
855
865
|
Sales: new ArcSales(options),
|
|
866
|
+
SalesV2: new ArcSalesV2(options),
|
|
856
867
|
Site: new ArcSite(options),
|
|
857
868
|
Websked: new ArcWebsked(options),
|
|
858
869
|
Content: new ArcContent(options),
|