@hubs101/js-api-skd-client 1.0.10531 → 1.0.10532
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.
|
@@ -21,6 +21,7 @@ export declare const _inviteFinanceManager: (basePath: string, token: string, ac
|
|
|
21
21
|
export declare const _deleteFinanceManager: (basePath: string, token: string, accountId: string, profileId: string) => Promise<any>;
|
|
22
22
|
export declare const _deletePaymentAccount: (basePath: string, token: string, paymentAccountId: string) => Promise<any>;
|
|
23
23
|
export declare const _fetchAccountEvents: (basePath: string, token: string, url: string) => Promise<ResponseAccountEventsType>;
|
|
24
|
+
export declare const _fetchEventsByAccount: (basePath: string, token: string, accountId: string, params?: string) => Promise<ResponseAccountEventsType>;
|
|
24
25
|
export declare const _fetchAccountGroups: (basePath: string, token: string, accountId: string, type: GroupType) => Promise<ResponsePaginationType<GroupResponseType>>;
|
|
25
26
|
export declare const _createAccountGroup: (basePath: string, token: string, accountId: string, data: GroupInputType) => Promise<GroupResponseType>;
|
|
26
27
|
export declare const _updateAccountGroup: (basePath: string, token: string, accountId: string, groupId: string, data: GroupInputType) => Promise<GroupResponseType>;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports._updatePackages = exports._deleteColocatedEvents = exports._editColocatedEvents = exports._createColocatedEvents = exports._fetchColocatedEvents = exports._updateAccountGroup = exports._createAccountGroup = exports._fetchAccountGroups = exports._fetchAccountEvents = exports._deletePaymentAccount = exports._deleteFinanceManager = exports._inviteFinanceManager = exports._confirmManagerNative = exports._confirmManager = exports._registerManagerNative = exports._registerManager = exports._deleteContentManager = exports._inviteContentManager = exports._updatePaymentAccount = exports._createPaymentAccount = exports._fetchPaymentAccounts = exports._fetchPaymentAccount = exports._sendNewPassword = exports._resetPassword = exports._logout = exports._login = void 0;
|
|
12
|
+
exports._updatePackages = exports._deleteColocatedEvents = exports._editColocatedEvents = exports._createColocatedEvents = exports._fetchColocatedEvents = exports._updateAccountGroup = exports._createAccountGroup = exports._fetchAccountGroups = exports._fetchEventsByAccount = exports._fetchAccountEvents = exports._deletePaymentAccount = exports._deleteFinanceManager = exports._inviteFinanceManager = exports._confirmManagerNative = exports._confirmManager = exports._registerManagerNative = exports._registerManager = exports._deleteContentManager = exports._inviteContentManager = exports._updatePaymentAccount = exports._createPaymentAccount = exports._fetchPaymentAccounts = exports._fetchPaymentAccount = exports._sendNewPassword = exports._resetPassword = exports._logout = exports._login = void 0;
|
|
13
13
|
const api_1 = require("../../utils/api");
|
|
14
14
|
const base_1 = require("../../utils/base");
|
|
15
15
|
const _login = (basePath, email, password) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -128,6 +128,15 @@ const _fetchAccountEvents = (basePath, token, url) => __awaiter(void 0, void 0,
|
|
|
128
128
|
return response;
|
|
129
129
|
});
|
|
130
130
|
exports._fetchAccountEvents = _fetchAccountEvents;
|
|
131
|
+
const _fetchEventsByAccount = (basePath, token, accountId, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
132
|
+
const base = (0, base_1.getBasePath)(basePath);
|
|
133
|
+
const url = params
|
|
134
|
+
? `${base.ACCOUNTS}/${accountId}/events?${params}`
|
|
135
|
+
: `${base.ACCOUNTS}/${accountId}/events`;
|
|
136
|
+
const response = yield (0, api_1.getRequest)(url, token);
|
|
137
|
+
return response;
|
|
138
|
+
});
|
|
139
|
+
exports._fetchEventsByAccount = _fetchEventsByAccount;
|
|
131
140
|
const _fetchAccountGroups = (basePath, token, accountId, type) => __awaiter(void 0, void 0, void 0, function* () {
|
|
132
141
|
const base = (0, base_1.getBasePath)(basePath);
|
|
133
142
|
const groups = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/groups?type=${type}`, token);
|
package/lib/index.js
CHANGED
|
@@ -328,6 +328,10 @@ function EventAPIProvider(props) {
|
|
|
328
328
|
(0, api_1.validateConfig)(config);
|
|
329
329
|
return (0, authentication_1._fetchAccountEvents)(config.baseUrl, config.token, url);
|
|
330
330
|
}), [config, config.baseUrl, config.token]);
|
|
331
|
+
const fetchEventsByAccount = (0, react_1.useCallback)((accountId, params) => __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
(0, api_1.validateConfig)(config);
|
|
333
|
+
return (0, authentication_1._fetchEventsByAccount)(config.baseUrl, config.token, accountId, params);
|
|
334
|
+
}), [config, config.baseUrl, config.token]);
|
|
331
335
|
const fetchEventPages = (0, react_1.useCallback)((eventId, nbPage, params) => __awaiter(this, void 0, void 0, function* () {
|
|
332
336
|
(0, api_1.validateConfig)(config);
|
|
333
337
|
return (0, event_1._fetchEventPages)(config.baseUrl, config.token, eventId, nbPage, params);
|
|
@@ -1216,6 +1220,7 @@ function EventAPIProvider(props) {
|
|
|
1216
1220
|
updatePackages,
|
|
1217
1221
|
updateAttendeeImageNative,
|
|
1218
1222
|
updateGlobalAttendeeImageNative,
|
|
1223
|
+
fetchEventsByAccount,
|
|
1219
1224
|
} }, props.children));
|
|
1220
1225
|
}
|
|
1221
1226
|
exports.EventAPIProvider = EventAPIProvider;
|
|
@@ -1448,5 +1453,6 @@ exports.BaseAPI = {
|
|
|
1448
1453
|
updatePackages: authentication_1._updatePackages,
|
|
1449
1454
|
updateAttendeeImageNative: attendee_1._updateAttendeeImageNative,
|
|
1450
1455
|
updateGlobalAttendeeImageNative: attendee_1._updateGlobalAttendeeImageNative,
|
|
1456
|
+
fetchEventsByAccount: authentication_1._fetchEventsByAccount,
|
|
1451
1457
|
};
|
|
1452
1458
|
exports.useAPIContext = EventAPIContext_1.useAPIContext;
|
package/lib/types/base.d.ts
CHANGED
|
@@ -330,6 +330,7 @@ export type BaseAPIType = {
|
|
|
330
330
|
updatePackages: (basePath: string, token: string, accountId: string, data: {
|
|
331
331
|
packages: PackageType[];
|
|
332
332
|
}) => Promise<AccountDetails>;
|
|
333
|
+
fetchEventsByAccount: (basePath: string, token: string, accountId: string, params?: string) => Promise<ResponseAccountEventsType>;
|
|
333
334
|
};
|
|
334
335
|
export type EventAPIType = {
|
|
335
336
|
config: BaseAPIConfigType;
|
|
@@ -588,6 +589,7 @@ export type EventAPIType = {
|
|
|
588
589
|
updatePackages: (accountId: string, data: {
|
|
589
590
|
packages: PackageType[];
|
|
590
591
|
}) => Promise<AccountDetails>;
|
|
592
|
+
fetchEventsByAccount: (accountId: string, params?: string) => Promise<ResponseAccountEventsType>;
|
|
591
593
|
};
|
|
592
594
|
export type BaseAPIConfigType = {
|
|
593
595
|
baseUrl?: string;
|