washday-sdk 0.0.52 → 0.0.53
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 +25 -14
- package/dist/api/staff/delete.js +32 -0
- package/dist/api/staff/get.js +32 -0
- package/dist/api/staff/post.js +33 -0
- package/dist/api/staff/put.js +32 -0
- package/package.json +1 -1
- package/src/api/index.ts +12 -0
- package/src/api/staff/delete.ts +15 -0
- package/src/api/staff/get.ts +17 -0
- package/src/api/staff/post.ts +17 -0
- package/src/api/staff/put.ts +16 -0
package/dist/api/index.js
CHANGED
|
@@ -6,11 +6,15 @@ const put_1 = require("./companies/put");
|
|
|
6
6
|
const get_2 = require("./countries/get");
|
|
7
7
|
const get_3 = require("./customers/get");
|
|
8
8
|
const put_2 = require("./products/put");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
9
|
+
const delete_1 = require("./staff/delete");
|
|
10
|
+
const get_4 = require("./staff/get");
|
|
11
|
+
const post_2 = require("./staff/post");
|
|
12
|
+
const put_3 = require("./staff/put");
|
|
13
|
+
const get_5 = require("./stores/get");
|
|
14
|
+
const post_3 = require("./stores/post");
|
|
15
|
+
const put_4 = require("./stores/put");
|
|
16
|
+
const post_4 = require("./stripe/post");
|
|
17
|
+
const put_5 = require("./users/put");
|
|
14
18
|
const WashdayClient = function WashdayClient(apiToken) {
|
|
15
19
|
this.apiToken = apiToken;
|
|
16
20
|
WashdayClient.prototype.customers.apiToken = apiToken;
|
|
@@ -20,23 +24,24 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
20
24
|
WashdayClient.prototype.countries.apiToken = apiToken;
|
|
21
25
|
WashdayClient.prototype.companies.apiToken = apiToken;
|
|
22
26
|
WashdayClient.prototype.stripe.apiToken = apiToken;
|
|
27
|
+
WashdayClient.prototype.staff.apiToken = apiToken;
|
|
23
28
|
};
|
|
24
29
|
WashdayClient.prototype.customers = {
|
|
25
30
|
getCustomerById: get_3.getCustomerById,
|
|
26
31
|
getCustomerHighlightsById: get_3.getCustomerHighlightsById
|
|
27
32
|
};
|
|
28
33
|
WashdayClient.prototype.stores = {
|
|
29
|
-
getStores:
|
|
30
|
-
getStoreById:
|
|
31
|
-
updateStoreById:
|
|
32
|
-
createStoreImage:
|
|
33
|
-
getStoreReviewLink:
|
|
34
|
+
getStores: get_5.getStores,
|
|
35
|
+
getStoreById: get_5.getStoreById,
|
|
36
|
+
updateStoreById: put_4.updateStoreById,
|
|
37
|
+
createStoreImage: post_3.createStoreImage,
|
|
38
|
+
getStoreReviewLink: get_5.getStoreReviewLink
|
|
34
39
|
};
|
|
35
40
|
WashdayClient.prototype.products = {
|
|
36
41
|
bulkUpdate: put_2.bulkUpdate,
|
|
37
42
|
};
|
|
38
43
|
WashdayClient.prototype.users = {
|
|
39
|
-
updateUserById:
|
|
44
|
+
updateUserById: put_5.updateUserById,
|
|
40
45
|
};
|
|
41
46
|
WashdayClient.prototype.countries = {
|
|
42
47
|
getCountries: get_2.getCountries,
|
|
@@ -50,8 +55,14 @@ WashdayClient.prototype.companies = {
|
|
|
50
55
|
updateCFDIOrgLogo: post_1.updateCFDIOrgLogo
|
|
51
56
|
};
|
|
52
57
|
WashdayClient.prototype.stripe = {
|
|
53
|
-
createCreateSuscriptionCheckoutSession:
|
|
54
|
-
createCFDISuscrptionCheckoutSession:
|
|
55
|
-
createCustomerPortalSession:
|
|
58
|
+
createCreateSuscriptionCheckoutSession: post_4.createCreateSuscriptionCheckoutSession,
|
|
59
|
+
createCFDISuscrptionCheckoutSession: post_4.createCFDISuscrptionCheckoutSession,
|
|
60
|
+
createCustomerPortalSession: post_4.createCustomerPortalSession
|
|
61
|
+
};
|
|
62
|
+
WashdayClient.prototype.staff = {
|
|
63
|
+
getStoreStaff: get_4.getStoreStaff,
|
|
64
|
+
updateStoreStaffById: put_3.updateStoreStaffById,
|
|
65
|
+
createStoreStaff: post_2.createStoreStaff,
|
|
66
|
+
deleteStoreStaffById: delete_1.deleteStoreStaffById,
|
|
56
67
|
};
|
|
57
68
|
exports.default = WashdayClient;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.deleteStoreStaffById = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const deleteStoreStaffById = function (storeId, staffId) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
try {
|
|
20
|
+
const config = {
|
|
21
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
|
+
};
|
|
23
|
+
const response = yield axiosInstance_1.default.delete(`api/store/${storeId}/staff/${staffId}`, config);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.deleteStoreStaffById = deleteStoreStaffById;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getStoreStaff = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const getStoreStaff = function (storeId, queryParams) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
try {
|
|
20
|
+
const config = {
|
|
21
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
|
+
};
|
|
23
|
+
const response = yield axiosInstance_1.default.get(`api/store/${storeId}/staff?${queryParams}`, config);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.getStoreStaff = getStoreStaff;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createStoreStaff = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const GET_SET_STORES = 'api/store';
|
|
18
|
+
const createStoreStaff = function (storeId, data) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
|
+
};
|
|
24
|
+
const response = yield axiosInstance_1.default.post(`api/store/${storeId}/staff`, data, config);
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Error fetching createStoreImage:', error);
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.createStoreStaff = createStoreStaff;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.updateStoreStaffById = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const updateStoreStaffById = function (storeId, data) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
try {
|
|
20
|
+
const config = {
|
|
21
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
|
+
};
|
|
23
|
+
const response = yield axiosInstance_1.default.put(`api/store/${storeId}/staff`, data, config);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error fetching getStoreById:', error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.updateStoreStaffById = updateStoreStaffById;
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } fr
|
|
|
5
5
|
import { getCountries } from "./countries/get";
|
|
6
6
|
import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
|
|
7
7
|
import { bulkUpdate } from "./products/put";
|
|
8
|
+
import { deleteStoreStaffById } from "./staff/delete";
|
|
9
|
+
import { getStoreStaff } from "./staff/get";
|
|
10
|
+
import { createStoreStaff } from "./staff/post";
|
|
11
|
+
import { updateStoreStaffById } from "./staff/put";
|
|
8
12
|
import { getStoreById, getStoreReviewLink, getStores } from "./stores/get";
|
|
9
13
|
import { createStoreImage } from "./stores/post";
|
|
10
14
|
import { updateStoreById } from "./stores/put";
|
|
@@ -26,6 +30,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
26
30
|
WashdayClient.prototype.countries.apiToken = apiToken;
|
|
27
31
|
WashdayClient.prototype.companies.apiToken = apiToken;
|
|
28
32
|
WashdayClient.prototype.stripe.apiToken = apiToken;
|
|
33
|
+
WashdayClient.prototype.staff.apiToken = apiToken;
|
|
29
34
|
} as any;
|
|
30
35
|
|
|
31
36
|
WashdayClient.prototype.customers = {
|
|
@@ -69,4 +74,11 @@ WashdayClient.prototype.stripe = {
|
|
|
69
74
|
createCustomerPortalSession: createCustomerPortalSession
|
|
70
75
|
};
|
|
71
76
|
|
|
77
|
+
WashdayClient.prototype.staff = {
|
|
78
|
+
getStoreStaff: getStoreStaff,
|
|
79
|
+
updateStoreStaffById: updateStoreStaffById,
|
|
80
|
+
createStoreStaff: createStoreStaff,
|
|
81
|
+
deleteStoreStaffById: deleteStoreStaffById,
|
|
82
|
+
};
|
|
83
|
+
|
|
72
84
|
export default WashdayClient;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
|
+
|
|
4
|
+
export const deleteStoreStaffById = async function (this: WashdayClientInstance, storeId: string, staffId: string): Promise<any> {
|
|
5
|
+
try {
|
|
6
|
+
const config = {
|
|
7
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
8
|
+
};
|
|
9
|
+
const response = await axiosInstance.delete(`api/store/${storeId}/staff/${staffId}`, config);
|
|
10
|
+
return response;
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
|
+
import { IStore } from "../../interfaces/Store";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const getStoreStaff = async function (this: WashdayClientInstance, storeId: string, queryParams?: string): Promise<any> {
|
|
7
|
+
try {
|
|
8
|
+
const config = {
|
|
9
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
|
+
};
|
|
11
|
+
const response = await axiosInstance.get(`api/store/${storeId}/staff?${queryParams}`, config);
|
|
12
|
+
return response;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
|
+
|
|
4
|
+
const GET_SET_STORES = 'api/store';
|
|
5
|
+
|
|
6
|
+
export const createStoreStaff = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
|
|
7
|
+
try {
|
|
8
|
+
const config = {
|
|
9
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
|
+
};
|
|
11
|
+
const response = await axiosInstance.post(`api/store/${storeId}/staff`, data, config);
|
|
12
|
+
return response;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error('Error fetching createStoreImage:', error);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import { IStore } from "../../interfaces/Store";
|
|
3
|
+
import axiosInstance from "../axiosInstance";
|
|
4
|
+
|
|
5
|
+
export const updateStoreStaffById = async function (this: WashdayClientInstance, storeId: string, data: IStore): Promise<any> {
|
|
6
|
+
try {
|
|
7
|
+
const config = {
|
|
8
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
|
+
};
|
|
10
|
+
const response = await axiosInstance.put(`api/store/${storeId}/staff`, data, config);
|
|
11
|
+
return response;
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error('Error fetching getStoreById:', error);
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
};
|