@code.store/arcxp-sdk-ts 3.2.0 → 4.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.
|
@@ -11,15 +11,15 @@ export type MigrateUserPayload = {
|
|
|
11
11
|
lastLoginDate?: string;
|
|
12
12
|
}[];
|
|
13
13
|
profile: {
|
|
14
|
-
firstName
|
|
15
|
-
lastName
|
|
14
|
+
firstName?: string;
|
|
15
|
+
lastName?: string;
|
|
16
16
|
secondLastName?: string;
|
|
17
|
-
displayName
|
|
17
|
+
displayName?: string;
|
|
18
18
|
gender?: 'MALE' | 'FEMALE';
|
|
19
19
|
email: string;
|
|
20
|
-
birthYear
|
|
21
|
-
birthMonth
|
|
22
|
-
birthDay
|
|
20
|
+
birthYear?: string;
|
|
21
|
+
birthMonth?: string;
|
|
22
|
+
birthDay?: string;
|
|
23
23
|
contacts: {
|
|
24
24
|
phone: string;
|
|
25
25
|
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
@@ -29,7 +29,7 @@ export type MigrateUserPayload = {
|
|
|
29
29
|
line2?: string;
|
|
30
30
|
locality: string;
|
|
31
31
|
region?: string;
|
|
32
|
-
postal
|
|
32
|
+
postal?: string;
|
|
33
33
|
country?: string;
|
|
34
34
|
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
35
35
|
}[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
|
|
2
|
-
import {
|
|
2
|
+
import { MigrateBatchSubscriptionsPayload, MigrateBatchSubscriptionsResponse } from './types';
|
|
3
3
|
export declare class ArcSales extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
|
-
migrate(
|
|
5
|
+
migrate(payload: MigrateBatchSubscriptionsPayload): Promise<MigrateBatchSubscriptionsResponse>;
|
|
6
6
|
}
|
package/dist/api/sales/index.js
CHANGED
|
@@ -4,19 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ArcSales = void 0;
|
|
7
|
-
const promises_1 = require("fs/promises");
|
|
8
7
|
const abstract_api_1 = require("../abstract-api");
|
|
9
8
|
const form_data_1 = __importDefault(require("form-data"));
|
|
10
9
|
class ArcSales extends abstract_api_1.ArcAbstractAPI {
|
|
11
10
|
constructor(options) {
|
|
12
11
|
super({ ...options, apiPath: 'sales/api/v1' });
|
|
13
12
|
}
|
|
14
|
-
async migrate(
|
|
13
|
+
async migrate(payload) {
|
|
15
14
|
const form = new form_data_1.default();
|
|
16
|
-
|
|
17
|
-
form.append('file', file, { filename: 'subs.json' });
|
|
15
|
+
form.append('file', JSON.stringify(payload), { filename: 'subs.json', contentType: 'application/json' });
|
|
18
16
|
const { data } = await this.client.post('/migrate', form, {
|
|
19
|
-
headers: {
|
|
17
|
+
headers: {
|
|
18
|
+
...form.getHeaders(),
|
|
19
|
+
},
|
|
20
20
|
});
|
|
21
21
|
return data;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/sales/index.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/sales/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAgE;AAChE,0DAAiC;AAGjC,MAAa,QAAS,SAAQ,6BAAc;IAC1C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAyC;QACrD,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAEzG,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAoC,UAAU,EAAE,IAAI,EAAE;YAC3F,OAAO,EAAE;gBACP,GAAG,IAAI,CAAC,UAAU,EAAE;aACrB;SACF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjBD,4BAiBC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type MigrateBatchSubscriptionsPayload = {
|
|
2
2
|
subscriptions: (PaidSubscription | FreeSubscription)[];
|
|
3
3
|
payments: PaymentInfo[];
|
|
4
4
|
};
|
|
5
|
+
export type MigrateBatchSubscriptionsResponse = {
|
|
6
|
+
subscriptionsInBatch?: number;
|
|
7
|
+
batchID?: string;
|
|
8
|
+
};
|
|
5
9
|
interface BaseSubscription {
|
|
6
10
|
type: string;
|
|
7
11
|
legacyID: string;
|
|
@@ -61,8 +65,4 @@ export type Refund = {
|
|
|
61
65
|
tax: number;
|
|
62
66
|
providerReference?: string;
|
|
63
67
|
};
|
|
64
|
-
export type MigrateBatchResponse = {
|
|
65
|
-
subscriptionsInBatch?: number;
|
|
66
|
-
batchID?: string;
|
|
67
|
-
};
|
|
68
68
|
export {};
|