@swan-admin/swan-ai-measurements 1.1.4 → 1.1.5
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/custom.js +4 -2
- package/dist/esm/custom.js +5 -3
- package/dist/fileUpload.js +2 -2
- package/package.json +1 -1
- package/src/custom.ts +47 -19
package/dist/custom.js
CHANGED
|
@@ -19,12 +19,14 @@ class Custom {
|
|
|
19
19
|
headers: { "X-Api-Key": this.#accessKey },
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
;
|
|
23
22
|
getCustomCustomerConfig = (store_url) => {
|
|
24
23
|
if ((0, utils_js_1.checkParameters)(store_url) === false) {
|
|
25
24
|
throw new Error(constants_js_1.REQUIRED_MESSAGE);
|
|
26
25
|
}
|
|
27
|
-
return axios_1.default.get(`${(0, utils_js_1.getUrl)({
|
|
26
|
+
return axios_1.default.get(`${(0, utils_js_1.getUrl)({
|
|
27
|
+
urlName: constants_js_1.APP_AUTH_BASE_URL,
|
|
28
|
+
stagingUrl: this.#stagingUrl,
|
|
29
|
+
})}${constants_js_1.API_ENDPOINTS.CUSTOM_CUSTOMER}`, {
|
|
28
30
|
params: { store_url },
|
|
29
31
|
headers: { "X-Api-Key": this.#accessKey },
|
|
30
32
|
});
|
package/dist/esm/custom.js
CHANGED
|
@@ -11,7 +11,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
11
11
|
};
|
|
12
12
|
var _Custom_accessKey, _Custom_stagingUrl;
|
|
13
13
|
import axios from "axios";
|
|
14
|
-
import { API_ENDPOINTS, APP_AUTH_BASE_URL, REQUIRED_MESSAGE } from "./constants.js";
|
|
14
|
+
import { API_ENDPOINTS, APP_AUTH_BASE_URL, REQUIRED_MESSAGE, } from "./constants.js";
|
|
15
15
|
import { checkParameters, getUrl } from "./utils.js";
|
|
16
16
|
class Custom {
|
|
17
17
|
constructor(accessKey, stagingUrl = false) {
|
|
@@ -21,7 +21,10 @@ class Custom {
|
|
|
21
21
|
if (checkParameters(store_url) === false) {
|
|
22
22
|
throw new Error(REQUIRED_MESSAGE);
|
|
23
23
|
}
|
|
24
|
-
return axios.get(`${getUrl({
|
|
24
|
+
return axios.get(`${getUrl({
|
|
25
|
+
urlName: APP_AUTH_BASE_URL,
|
|
26
|
+
stagingUrl: __classPrivateFieldGet(this, _Custom_stagingUrl, "f"),
|
|
27
|
+
})}${API_ENDPOINTS.CUSTOM_CUSTOMER}`, {
|
|
25
28
|
params: { store_url },
|
|
26
29
|
headers: { "X-Api-Key": __classPrivateFieldGet(this, _Custom_accessKey, "f") },
|
|
27
30
|
});
|
|
@@ -43,7 +46,6 @@ class Custom {
|
|
|
43
46
|
headers: { "X-Api-Key": __classPrivateFieldGet(this, _Custom_accessKey, "f") },
|
|
44
47
|
});
|
|
45
48
|
}
|
|
46
|
-
;
|
|
47
49
|
}
|
|
48
50
|
_Custom_accessKey = new WeakMap(), _Custom_stagingUrl = new WeakMap();
|
|
49
51
|
export default Custom;
|
package/dist/fileUpload.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const axios_1 = __importDefault(require("axios"));
|
|
7
7
|
const constants_js_1 = require("./constants.js");
|
|
8
8
|
const utils_js_1 = require("./utils.js");
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const Uppy = require("fix-esm").require("@uppy/core");
|
|
10
|
+
const AwsS3Multipart = require("fix-esm").require("@uppy/aws-s3-multipart");
|
|
11
11
|
class FileUpload {
|
|
12
12
|
#uppyIns;
|
|
13
13
|
#accessKey;
|
package/package.json
CHANGED
package/src/custom.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import axios, { AxiosResponse } from "axios";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
API_ENDPOINTS,
|
|
4
|
+
APP_AUTH_BASE_URL,
|
|
5
|
+
REQUIRED_MESSAGE,
|
|
6
|
+
} from "./constants.js";
|
|
3
7
|
import { checkParameters, getUrl } from "./utils.js";
|
|
4
8
|
|
|
5
9
|
class Custom {
|
|
@@ -10,30 +14,54 @@ class Custom {
|
|
|
10
14
|
this.#stagingUrl = stagingUrl;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
|
-
createCustomer(payload: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
createCustomer(payload: {
|
|
18
|
+
name: string;
|
|
19
|
+
storeUrl: string;
|
|
20
|
+
location: string;
|
|
21
|
+
email: string;
|
|
22
|
+
emailsTier_1: string;
|
|
23
|
+
emailsTier_2: string;
|
|
24
|
+
}): Promise<AxiosResponse<any>> {
|
|
25
|
+
return axios.post(
|
|
26
|
+
`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${
|
|
27
|
+
API_ENDPOINTS.CREATE_CUSTOMER
|
|
28
|
+
}`,
|
|
29
|
+
{
|
|
30
|
+
payload,
|
|
31
|
+
headers: { "X-Api-Key": this.#accessKey },
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
19
35
|
|
|
20
|
-
getCustomCustomerConfig: (store_url: string) => Promise<AxiosResponse<any>> =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
getCustomCustomerConfig: (store_url: string) => Promise<AxiosResponse<any>> =
|
|
37
|
+
(store_url: string) => {
|
|
38
|
+
if (checkParameters(store_url) === false) {
|
|
39
|
+
throw new Error(REQUIRED_MESSAGE);
|
|
40
|
+
}
|
|
41
|
+
return axios.get(
|
|
42
|
+
`${getUrl({
|
|
43
|
+
urlName: APP_AUTH_BASE_URL,
|
|
44
|
+
stagingUrl: this.#stagingUrl,
|
|
45
|
+
})}${API_ENDPOINTS.CUSTOM_CUSTOMER}`,
|
|
46
|
+
{
|
|
47
|
+
params: { store_url },
|
|
48
|
+
headers: { "X-Api-Key": this.#accessKey },
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
29
52
|
|
|
30
53
|
getModelUrl: (id: string) => Promise<AxiosResponse<any>> = (id: string) => {
|
|
31
54
|
if (checkParameters(id) === false) {
|
|
32
55
|
throw new Error(REQUIRED_MESSAGE);
|
|
33
56
|
}
|
|
34
|
-
return axios.get(
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
return axios.get(
|
|
58
|
+
`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${
|
|
59
|
+
API_ENDPOINTS.MODEL
|
|
60
|
+
}/${id}`,
|
|
61
|
+
{
|
|
62
|
+
headers: { "X-Api-Key": this.#accessKey },
|
|
63
|
+
}
|
|
64
|
+
);
|
|
37
65
|
};
|
|
38
66
|
}
|
|
39
67
|
|