washday-sdk 0.0.56 → 0.0.58
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.js +3 -1
- package/dist/api/stores/post.js +18 -1
- package/dist/api/stores/put.js +17 -1
- package/package.json +2 -2
- package/src/api/index.ts +5 -3
- package/src/api/stores/post.ts +14 -0
- package/src/api/stores/put.ts +14 -0
package/dist/api/index.js
CHANGED
|
@@ -35,9 +35,11 @@ WashdayClient.prototype.customers = {
|
|
|
35
35
|
WashdayClient.prototype.stores = {
|
|
36
36
|
getStores: get_6.getStores,
|
|
37
37
|
getStoreById: get_6.getStoreById,
|
|
38
|
+
createStore: post_3.createStore,
|
|
38
39
|
updateStoreById: put_4.updateStoreById,
|
|
39
40
|
createStoreImage: post_3.createStoreImage,
|
|
40
|
-
getStoreReviewLink: get_6.getStoreReviewLink
|
|
41
|
+
getStoreReviewLink: get_6.getStoreReviewLink,
|
|
42
|
+
deleteStoreById: put_4.deleteStoreById,
|
|
41
43
|
};
|
|
42
44
|
WashdayClient.prototype.products = {
|
|
43
45
|
bulkUpdate: put_2.bulkUpdate,
|
package/dist/api/stores/post.js
CHANGED
|
@@ -12,9 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.createStoreImage = void 0;
|
|
15
|
+
exports.createStore = exports.createStoreImage = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
17
|
const GET_SET_STORE_IMAGE = 'api/store-image';
|
|
18
|
+
const GET_SET_STORES = 'api/store';
|
|
18
19
|
const createStoreImage = function (data) {
|
|
19
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
21
|
try {
|
|
@@ -31,3 +32,19 @@ const createStoreImage = function (data) {
|
|
|
31
32
|
});
|
|
32
33
|
};
|
|
33
34
|
exports.createStoreImage = createStoreImage;
|
|
35
|
+
const createStore = function (data) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
try {
|
|
38
|
+
const config = {
|
|
39
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
40
|
+
};
|
|
41
|
+
const response = yield axiosInstance_1.default.post(`${GET_SET_STORES}`, data, config);
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error('Error fetching createStore:', error);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.createStore = createStore;
|
package/dist/api/stores/put.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.updateStoreById = void 0;
|
|
15
|
+
exports.deleteStoreById = exports.updateStoreById = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
17
|
const GET_SET_STORES = 'api/store';
|
|
18
18
|
const REQUEST_PARAMS = {
|
|
@@ -34,3 +34,19 @@ const updateStoreById = function (storeId, data) {
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
exports.updateStoreById = updateStoreById;
|
|
37
|
+
const deleteStoreById = function (storeId) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
const config = {
|
|
41
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
42
|
+
};
|
|
43
|
+
const response = yield axiosInstance_1.default.delete(`${GET_SET_STORES}/${storeId}`, config);
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error('Error fetching deleteStoreById:', error);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
exports.deleteStoreById = deleteStoreById;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "washday-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"description": "Washday utilities functions and API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"
|
|
9
|
+
"publishVersion": "npm run build && npm publish --access public"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"washday"
|
package/src/api/index.ts
CHANGED
|
@@ -11,8 +11,8 @@ import { getStoreStaff, getStoreStaffById } from "./staff/get";
|
|
|
11
11
|
import { createStoreStaff } from "./staff/post";
|
|
12
12
|
import { updateStoreStaffById } from "./staff/put";
|
|
13
13
|
import { getStoreById, getStoreReviewLink, getStores } from "./stores/get";
|
|
14
|
-
import { createStoreImage } from "./stores/post";
|
|
15
|
-
import { updateStoreById } from "./stores/put";
|
|
14
|
+
import { createStore, createStoreImage } from "./stores/post";
|
|
15
|
+
import { deleteStoreById, updateStoreById } from "./stores/put";
|
|
16
16
|
import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "./stripe/post";
|
|
17
17
|
import { updateUserById } from "./users/put";
|
|
18
18
|
|
|
@@ -43,9 +43,11 @@ WashdayClient.prototype.customers = {
|
|
|
43
43
|
WashdayClient.prototype.stores = {
|
|
44
44
|
getStores: getStores,
|
|
45
45
|
getStoreById: getStoreById,
|
|
46
|
+
createStore: createStore,
|
|
46
47
|
updateStoreById: updateStoreById,
|
|
47
48
|
createStoreImage: createStoreImage,
|
|
48
|
-
getStoreReviewLink: getStoreReviewLink
|
|
49
|
+
getStoreReviewLink: getStoreReviewLink,
|
|
50
|
+
deleteStoreById: deleteStoreById,
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
|
package/src/api/stores/post.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IStore } from "../../interfaces/Store";
|
|
|
3
3
|
import axiosInstance from "../axiosInstance";
|
|
4
4
|
|
|
5
5
|
const GET_SET_STORE_IMAGE = 'api/store-image';
|
|
6
|
+
const GET_SET_STORES = 'api/store';
|
|
6
7
|
|
|
7
8
|
export const createStoreImage = async function (this: WashdayClientInstance, data: any): Promise<any> {
|
|
8
9
|
try {
|
|
@@ -15,4 +16,17 @@ export const createStoreImage = async function (this: WashdayClientInstance, dat
|
|
|
15
16
|
console.error('Error fetching createStoreImage:', error);
|
|
16
17
|
throw error;
|
|
17
18
|
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const createStore = async function (this: WashdayClientInstance, data: any): Promise<any> {
|
|
22
|
+
try {
|
|
23
|
+
const config = {
|
|
24
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
25
|
+
};
|
|
26
|
+
const response = await axiosInstance.post(`${GET_SET_STORES}`, data, config);
|
|
27
|
+
return response;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error('Error fetching createStore:', error);
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
18
32
|
};
|
package/src/api/stores/put.ts
CHANGED
|
@@ -18,4 +18,18 @@ export const updateStoreById = async function (this: WashdayClientInstance, stor
|
|
|
18
18
|
console.error('Error fetching getStoreById:', error);
|
|
19
19
|
throw error;
|
|
20
20
|
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export const deleteStoreById = async function (this: WashdayClientInstance, storeId: string): Promise<any> {
|
|
25
|
+
try {
|
|
26
|
+
const config = {
|
|
27
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
28
|
+
};
|
|
29
|
+
const response = await axiosInstance.delete(`${GET_SET_STORES}/${storeId}`, config);
|
|
30
|
+
return response;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('Error fetching deleteStoreById:', error);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
21
35
|
};
|