@hubs101/js-api-skd-client 1.0.10496 → 1.0.10498
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/lib/api/authentication/types.d.ts +1 -0
- package/lib/index.js +17 -7
- package/lib/utils/api.js +1 -0
- package/lib/utils/base.js +4 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/lib/utils/api.js
CHANGED
|
@@ -311,6 +311,7 @@ const postFilesAndDataRequest = (url, payload, files, token, method) => __awaite
|
|
|
311
311
|
throw new Error("Sorry you don't have enough access. Please make sure you have the correct right access.");
|
|
312
312
|
}
|
|
313
313
|
if (data.status === 400 && data.invalid_fields) {
|
|
314
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
314
315
|
throw new Error((_a = Object.values(data === null || data === void 0 ? void 0 : data.invalid_fields)) === null || _a === void 0 ? void 0 : _a.join(", "));
|
|
315
316
|
}
|
|
316
317
|
const isSuccess = (data === null || data === void 0 ? void 0 : data.status) >= 200 && (data === null || data === void 0 ? void 0 : data.status) <= 299;
|
package/lib/utils/base.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.getBasePath = void 0;
|
|
|
4
4
|
const getBasePath = (basePath) => {
|
|
5
5
|
const authorizedBasePath = `${basePath}/api/v1`;
|
|
6
6
|
const unauthorizedBasePath = `${basePath}/v1`;
|
|
7
|
-
const publicBasePath = `${basePath}
|
|
7
|
+
const publicBasePath = `${basePath}`;
|
|
8
8
|
return Object.freeze({
|
|
9
9
|
ACCOUNTS: `${authorizedBasePath}/accounts`,
|
|
10
10
|
PORTFOLIOS: `${authorizedBasePath}/portfolios`,
|
|
@@ -56,17 +56,17 @@ const getBasePath = (basePath) => {
|
|
|
56
56
|
TICKETS: `${authorizedBasePath}/tickets`,
|
|
57
57
|
DISCOUNTS: `${authorizedBasePath}/discounts`,
|
|
58
58
|
PAYMENT_ACCOUNTS: `${authorizedBasePath}/payment-accounts`,
|
|
59
|
-
PUBLIC_EVENTS: basePath ? `${publicBasePath}/events` : "/public/events",
|
|
60
59
|
STREAMS: `${authorizedBasePath}/streams`,
|
|
61
60
|
ACCOUNT_TRIAL: `${unauthorizedBasePath}/accounts/trial`,
|
|
62
61
|
INVITATION: `${unauthorizedBasePath}/invitation`,
|
|
63
62
|
PUBLIC_INVITATIONS: `${unauthorizedBasePath}/invitations`,
|
|
64
|
-
PUBLIC_TICKETS: `${publicBasePath}/tickets`,
|
|
65
63
|
BOOKINGS: `${authorizedBasePath}/bookings`,
|
|
66
64
|
PUBLIC_BOOKINGS: `${unauthorizedBasePath}/bookings`,
|
|
67
|
-
PUBLIC_GROUPS: `${publicBasePath}/groups`,
|
|
68
65
|
ACTIONS_EVENTS: `${authorizedBasePath}/actions/events`,
|
|
69
66
|
ACTIONS_ATTENDEE: `${authorizedBasePath}/actions/attendees`,
|
|
67
|
+
PUBLIC_TICKETS: `${publicBasePath}/tickets`,
|
|
68
|
+
PUBLIC_GROUPS: `${publicBasePath}/groups`,
|
|
69
|
+
PUBLIC_EVENTS: basePath ? `${publicBasePath}/events` : "/events",
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
exports.getBasePath = getBasePath;
|