@swan-admin/swan-ai-measurements 1.1.9 → 1.1.11
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 +1 -1
- package/dist/esm/custom.js +1 -1
- package/dist/esm/fileUpload.js +1 -0
- package/dist/esm/utils.js +1 -0
- package/dist/fileUpload.js +1 -0
- package/dist/utils.js +1 -0
- package/package.json +1 -1
- package/src/custom.ts +1 -1
- package/src/fileUpload.ts +1 -1
- package/src/utils.ts +1 -0
package/dist/custom.js
CHANGED
|
@@ -14,7 +14,7 @@ class Custom {
|
|
|
14
14
|
this.#stagingUrl = stagingUrl;
|
|
15
15
|
}
|
|
16
16
|
createCustomer(payload) {
|
|
17
|
-
if ((0, utils_js_1.checkParameters)(payload.name, payload.storeUrl, payload.email, payload.location)) {
|
|
17
|
+
if ((0, utils_js_1.checkParameters)(payload.name, payload.storeUrl, payload.email, payload.location) === false) {
|
|
18
18
|
throw new Error(constants_js_1.REQUIRED_MESSAGE);
|
|
19
19
|
}
|
|
20
20
|
return axios_1.default.post(`${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${constants_js_1.API_ENDPOINTS.CREATE_CUSTOMER}`, {
|
package/dist/esm/custom.js
CHANGED
|
@@ -41,7 +41,7 @@ class Custom {
|
|
|
41
41
|
__classPrivateFieldSet(this, _Custom_stagingUrl, stagingUrl, "f");
|
|
42
42
|
}
|
|
43
43
|
createCustomer(payload) {
|
|
44
|
-
if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location)) {
|
|
44
|
+
if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location) === false) {
|
|
45
45
|
throw new Error(REQUIRED_MESSAGE);
|
|
46
46
|
}
|
|
47
47
|
return axios.post(`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: __classPrivateFieldGet(this, _Custom_stagingUrl, "f") })}${API_ENDPOINTS.CREATE_CUSTOMER}`, Object.assign(Object.assign({}, payload), { headers: { "X-Api-Key": __classPrivateFieldGet(this, _Custom_accessKey, "f") } }));
|
package/dist/esm/fileUpload.js
CHANGED
|
@@ -144,6 +144,7 @@ class FileUpload {
|
|
|
144
144
|
if (!checkMetaDataValue(arrayMetaData)) {
|
|
145
145
|
throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
|
|
146
146
|
}
|
|
147
|
+
arrayMetaData = addScanType(arrayMetaData, scanId);
|
|
147
148
|
return new Promise((resolve, reject) =>
|
|
148
149
|
__awaiter(this, void 0, void 0, function* () {
|
|
149
150
|
var _b;
|
package/dist/esm/utils.js
CHANGED
|
@@ -14,6 +14,7 @@ export function fetchData(options) {
|
|
|
14
14
|
const { path, body, queryParams, baseUrl = APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, stagingUrl = false, } = options;
|
|
15
15
|
const apiUrl = `${getUrl({ urlName: baseUrl, stagingUrl: stagingUrl })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
|
|
16
16
|
try {
|
|
17
|
+
console.log(body);
|
|
17
18
|
const res = yield axios.post(apiUrl, body, { headers });
|
|
18
19
|
if (res.status >= 200 && res.status < 300) {
|
|
19
20
|
return res.data;
|
package/dist/fileUpload.js
CHANGED
|
@@ -95,6 +95,7 @@ class FileUpload {
|
|
|
95
95
|
if (!(0, utils_js_1.checkMetaDataValue)(arrayMetaData)) {
|
|
96
96
|
throw new Error(constants_js_1.REQUIRED_MESSAGE_FOR_META_DATA);
|
|
97
97
|
}
|
|
98
|
+
arrayMetaData = (0, utils_js_1.addScanType)(arrayMetaData, scanId);
|
|
98
99
|
return new Promise(async (resolve, reject) => {
|
|
99
100
|
try {
|
|
100
101
|
const res = await (0, utils_js_1.fetchData)({
|
package/dist/utils.js
CHANGED
|
@@ -10,6 +10,7 @@ async function fetchData(options) {
|
|
|
10
10
|
const { path, body, queryParams, baseUrl = constants_js_1.APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, stagingUrl = false, } = options;
|
|
11
11
|
const apiUrl = `${(0, exports.getUrl)({ urlName: baseUrl, stagingUrl: stagingUrl })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
|
|
12
12
|
try {
|
|
13
|
+
console.log(body);
|
|
13
14
|
const res = await axios_1.default.post(apiUrl, body, { headers });
|
|
14
15
|
if (res.status >= 200 && res.status < 300) {
|
|
15
16
|
return res.data;
|
package/package.json
CHANGED
package/src/custom.ts
CHANGED
|
@@ -19,7 +19,7 @@ class Custom {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
createCustomer(payload: CreateCustomer): Promise<AxiosResponse<any>> {
|
|
22
|
-
if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location)) {
|
|
22
|
+
if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location) === false) {
|
|
23
23
|
throw new Error(REQUIRED_MESSAGE);
|
|
24
24
|
}
|
|
25
25
|
return axios.post(`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${API_ENDPOINTS.CREATE_CUSTOMER}`, {
|
package/src/fileUpload.ts
CHANGED
|
@@ -116,7 +116,7 @@ export default class FileUpload {
|
|
|
116
116
|
if (!checkMetaDataValue(arrayMetaData)) {
|
|
117
117
|
throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
arrayMetaData = addScanType(arrayMetaData, scanId);
|
|
120
120
|
return new Promise(async (resolve, reject) => {
|
|
121
121
|
try {
|
|
122
122
|
const res: { key: string; uploadId: string } = await fetchData({
|
package/src/utils.ts
CHANGED
|
@@ -26,6 +26,7 @@ export async function fetchData(options: FetchDataOptions): Promise<any> {
|
|
|
26
26
|
|
|
27
27
|
const apiUrl = `${getUrl({ urlName: baseUrl, stagingUrl: stagingUrl })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
|
|
28
28
|
try {
|
|
29
|
+
console.log(body);
|
|
29
30
|
const res: AxiosResponse<any> = await axios.post(apiUrl, body, { headers });
|
|
30
31
|
if (res.status >= 200 && res.status < 300) {
|
|
31
32
|
return res.data;
|