washday-sdk 0.0.54 → 0.0.55
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 +1 -0
- package/dist/api/staff/delete.js +2 -1
- package/dist/api/staff/get.js +18 -2
- package/dist/api/staff/post.js +2 -2
- package/dist/api/stores/post.js +0 -4
- package/package.json +1 -1
- package/src/api/index.ts +2 -1
- package/src/api/staff/delete.ts +2 -1
- package/src/api/staff/get.ts +14 -2
- package/src/api/staff/post.ts +2 -2
- package/src/api/stores/post.ts +0 -5
package/dist/api/index.js
CHANGED
|
@@ -66,6 +66,7 @@ WashdayClient.prototype.stripe = {
|
|
|
66
66
|
};
|
|
67
67
|
WashdayClient.prototype.staff = {
|
|
68
68
|
getStoreStaff: get_5.getStoreStaff,
|
|
69
|
+
getStoreStaffById: get_5.getStoreStaffById,
|
|
69
70
|
updateStoreStaffById: put_3.updateStoreStaffById,
|
|
70
71
|
createStoreStaff: post_2.createStoreStaff,
|
|
71
72
|
deleteStoreStaffById: delete_1.deleteStoreStaffById,
|
package/dist/api/staff/delete.js
CHANGED
|
@@ -14,13 +14,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.deleteStoreStaffById = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
|
|
17
18
|
const deleteStoreStaffById = function (storeId, staffId) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
try {
|
|
20
21
|
const config = {
|
|
21
22
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
23
|
};
|
|
23
|
-
const response = yield axiosInstance_1.default.delete(
|
|
24
|
+
const response = yield axiosInstance_1.default.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
|
|
24
25
|
return response;
|
|
25
26
|
}
|
|
26
27
|
catch (error) {
|
package/dist/api/staff/get.js
CHANGED
|
@@ -12,15 +12,16 @@ 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.getStoreStaff = void 0;
|
|
15
|
+
exports.getStoreStaffById = exports.getStoreStaff = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
|
|
17
18
|
const getStoreStaff = function (storeId, queryParams) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
try {
|
|
20
21
|
const config = {
|
|
21
22
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
23
|
};
|
|
23
|
-
const response = yield axiosInstance_1.default.get(
|
|
24
|
+
const response = yield axiosInstance_1.default.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
|
|
24
25
|
return response;
|
|
25
26
|
}
|
|
26
27
|
catch (error) {
|
|
@@ -30,3 +31,18 @@ const getStoreStaff = function (storeId, queryParams) {
|
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
33
|
exports.getStoreStaff = getStoreStaff;
|
|
34
|
+
const getStoreStaffById = function (storeId, staffId) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
const config = {
|
|
38
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
|
+
};
|
|
40
|
+
return yield axiosInstance_1.default.get(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error('Error fetching getStoreStaffById:', error);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.getStoreStaffById = getStoreStaffById;
|
package/dist/api/staff/post.js
CHANGED
|
@@ -14,14 +14,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.createStoreStaff = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
-
const
|
|
17
|
+
const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
|
|
18
18
|
const createStoreStaff = function (storeId, data) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
try {
|
|
21
21
|
const config = {
|
|
22
22
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
23
|
};
|
|
24
|
-
const response = yield axiosInstance_1.default.post(
|
|
24
|
+
const response = yield axiosInstance_1.default.post(`${GET_SET_STAFF(storeId)}`, data, config);
|
|
25
25
|
return response;
|
|
26
26
|
}
|
|
27
27
|
catch (error) {
|
package/dist/api/stores/post.js
CHANGED
|
@@ -14,11 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.createStoreImage = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
-
const GET_SET_STORES = 'api/store';
|
|
18
17
|
const GET_SET_STORE_IMAGE = 'api/store-image';
|
|
19
|
-
const REQUEST_PARAMS = {
|
|
20
|
-
token: 'LOGGED_USER_TOKEN',
|
|
21
|
-
};
|
|
22
18
|
const createStoreImage = function (data) {
|
|
23
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
20
|
try {
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { getCountries } from "./countries/get";
|
|
|
7
7
|
import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
|
|
8
8
|
import { bulkUpdate } from "./products/put";
|
|
9
9
|
import { deleteStoreStaffById } from "./staff/delete";
|
|
10
|
-
import { getStoreStaff } from "./staff/get";
|
|
10
|
+
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";
|
|
@@ -82,6 +82,7 @@ WashdayClient.prototype.stripe = {
|
|
|
82
82
|
|
|
83
83
|
WashdayClient.prototype.staff = {
|
|
84
84
|
getStoreStaff: getStoreStaff,
|
|
85
|
+
getStoreStaffById: getStoreStaffById,
|
|
85
86
|
updateStoreStaffById: updateStoreStaffById,
|
|
86
87
|
createStoreStaff: createStoreStaff,
|
|
87
88
|
deleteStoreStaffById: deleteStoreStaffById,
|
package/src/api/staff/delete.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
|
+
const GET_SET_STAFF = (storeId: string) => `api/store/${storeId}/staff`;
|
|
3
4
|
|
|
4
5
|
export const deleteStoreStaffById = async function (this: WashdayClientInstance, storeId: string, staffId: string): Promise<any> {
|
|
5
6
|
try {
|
|
6
7
|
const config = {
|
|
7
8
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
8
9
|
};
|
|
9
|
-
const response = await axiosInstance.delete(
|
|
10
|
+
const response = await axiosInstance.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
|
|
10
11
|
return response;
|
|
11
12
|
} catch (error) {
|
|
12
13
|
console.error('Error fetching getStoreStaff:', error);
|
package/src/api/staff/get.ts
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
|
-
import { IStore } from "../../interfaces/Store";
|
|
4
3
|
|
|
4
|
+
const GET_SET_STAFF = (storeId: string) => `api/store/${storeId}/staff`;
|
|
5
5
|
|
|
6
6
|
export const getStoreStaff = async function (this: WashdayClientInstance, storeId: string, queryParams?: string): Promise<any> {
|
|
7
7
|
try {
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.get(
|
|
11
|
+
const response = await axiosInstance.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getStoreStaff:', error);
|
|
15
15
|
throw error;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
+
|
|
19
|
+
export const getStoreStaffById = async function (this: WashdayClientInstance, storeId: string, staffId: string): Promise<any> {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
|
+
};
|
|
24
|
+
return await axiosInstance.get(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('Error fetching getStoreStaffById:', error);
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
};
|
package/src/api/staff/post.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const GET_SET_STAFF = (storeId: string) => `api/store/${storeId}/staff`;
|
|
5
5
|
|
|
6
6
|
export const createStoreStaff = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
|
|
7
7
|
try {
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.post(
|
|
11
|
+
const response = await axiosInstance.post(`${GET_SET_STAFF(storeId)}`, data, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching createStoreImage:', error);
|
package/src/api/stores/post.ts
CHANGED
|
@@ -2,13 +2,8 @@ import { WashdayClientInstance } from "../../interfaces/Api";
|
|
|
2
2
|
import { IStore } from "../../interfaces/Store";
|
|
3
3
|
import axiosInstance from "../axiosInstance";
|
|
4
4
|
|
|
5
|
-
const GET_SET_STORES = 'api/store';
|
|
6
5
|
const GET_SET_STORE_IMAGE = 'api/store-image';
|
|
7
6
|
|
|
8
|
-
const REQUEST_PARAMS = {
|
|
9
|
-
token: 'LOGGED_USER_TOKEN',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
7
|
export const createStoreImage = async function (this: WashdayClientInstance, data: any): Promise<any> {
|
|
13
8
|
try {
|
|
14
9
|
const config = {
|