@hubs101/js-api-skd-client 1.0.10252 → 1.0.10255
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/README.md +29 -29
- package/lib/api/authentication/index.js +4 -4
- package/lib/api/public/index.d.ts +1 -0
- package/lib/api/public/index.js +10 -1
- package/lib/index.js +5 -0
- package/lib/types/base.d.ts +2 -0
- package/package.json +55 -55
package/README.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
## API Doc
|
|
2
|
-
|
|
3
|
-
[API Documentation](https://github.com/We-Conect/event-app-api/blob/main/src/README.md)
|
|
4
|
-
|
|
5
|
-
## Using BaseAPI, stateless
|
|
6
|
-
|
|
7
|
-
Used before initWithToken
|
|
8
|
-
`BaseAPI.login(basePath, username, password)`
|
|
9
|
-
|
|
10
|
-
Accessing API via stateless interface:
|
|
11
|
-
`BaseAPI.fetchAttendees(basePath, token, eventID)`
|
|
12
|
-
|
|
13
|
-
## Using EventAPIProvider
|
|
14
|
-
|
|
15
|
-
1. Wrap app with Provider:
|
|
16
|
-
`import { EventAPIProvider } from '@hubs101/js-api-skd-client';`
|
|
17
|
-
2. Access api via hook:
|
|
18
|
-
` const { fetchAttendees } = useAPIContext();`
|
|
19
|
-
|
|
20
|
-
\*\*First init or initWithToken needs to be called in order to have authentication setup.
|
|
21
|
-
|
|
22
|
-
## Creating new release
|
|
23
|
-
|
|
24
|
-
1. Commit al changes to git.
|
|
25
|
-
2. Prepare build: `npm run build`
|
|
26
|
-
3. Create new patch version run: `npm version patch`
|
|
27
|
-
4. Publish package to NPM: `npm publish`
|
|
28
|
-
|
|
29
|
-
All in one publish alternative run: `npm run new-version`
|
|
1
|
+
## API Doc
|
|
2
|
+
|
|
3
|
+
[API Documentation](https://github.com/We-Conect/event-app-api/blob/main/src/README.md)
|
|
4
|
+
|
|
5
|
+
## Using BaseAPI, stateless
|
|
6
|
+
|
|
7
|
+
Used before initWithToken
|
|
8
|
+
`BaseAPI.login(basePath, username, password)`
|
|
9
|
+
|
|
10
|
+
Accessing API via stateless interface:
|
|
11
|
+
`BaseAPI.fetchAttendees(basePath, token, eventID)`
|
|
12
|
+
|
|
13
|
+
## Using EventAPIProvider
|
|
14
|
+
|
|
15
|
+
1. Wrap app with Provider:
|
|
16
|
+
`import { EventAPIProvider } from '@hubs101/js-api-skd-client';`
|
|
17
|
+
2. Access api via hook:
|
|
18
|
+
` const { fetchAttendees } = useAPIContext();`
|
|
19
|
+
|
|
20
|
+
\*\*First init or initWithToken needs to be called in order to have authentication setup.
|
|
21
|
+
|
|
22
|
+
## Creating new release
|
|
23
|
+
|
|
24
|
+
1. Commit al changes to git.
|
|
25
|
+
2. Prepare build: `npm run build`
|
|
26
|
+
3. Create new patch version run: `npm version patch`
|
|
27
|
+
4. Publish package to NPM: `npm publish`
|
|
28
|
+
|
|
29
|
+
All in one publish alternative run: `npm run new-version`
|
|
@@ -71,7 +71,7 @@ const _updatePaymentAccount = (basePath, token, paymentAccountId, data) => __awa
|
|
|
71
71
|
exports._updatePaymentAccount = _updatePaymentAccount;
|
|
72
72
|
const _inviteContentManager = (basePath, token, accountId, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
73
|
const base = (0, base_1.getBasePath)(basePath);
|
|
74
|
-
const response = yield (0, api_1.postRequestWE)(`${base.
|
|
74
|
+
const response = yield (0, api_1.postRequestWE)(`${base.ACCOUNTS}/${accountId}/managers/content-managers`, data, token);
|
|
75
75
|
return response;
|
|
76
76
|
});
|
|
77
77
|
exports._inviteContentManager = _inviteContentManager;
|
|
@@ -83,19 +83,19 @@ const _deleteContentManager = (basePath, token, accountId, profileId) => __await
|
|
|
83
83
|
exports._deleteContentManager = _deleteContentManager;
|
|
84
84
|
const _registerManager = (basePath, token, accountId, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
85
|
const base = (0, base_1.getBasePath)(basePath);
|
|
86
|
-
const response = yield (0, api_1.postRequestWE)(`${base.
|
|
86
|
+
const response = yield (0, api_1.postRequestWE)(`${base.ACCOUNTS}/${accountId}/managers/content-managers`, data, token);
|
|
87
87
|
return response;
|
|
88
88
|
});
|
|
89
89
|
exports._registerManager = _registerManager;
|
|
90
90
|
const _confirmManager = (basePath, token, accountId, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
91
91
|
const base = (0, base_1.getBasePath)(basePath);
|
|
92
|
-
const response = yield (0, api_1.postRequestWE)(`${base.
|
|
92
|
+
const response = yield (0, api_1.postRequestWE)(`${base.PUBLIC_INVITATIONS}/accounts/${accountId}/managers/confirm`, data, token);
|
|
93
93
|
return response;
|
|
94
94
|
});
|
|
95
95
|
exports._confirmManager = _confirmManager;
|
|
96
96
|
const _inviteFinanceManager = (basePath, token, accountId, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
97
|
const base = (0, base_1.getBasePath)(basePath);
|
|
98
|
-
const response = yield (0, api_1.postRequestWE)(`${base.
|
|
98
|
+
const response = yield (0, api_1.postRequestWE)(`${base.ACCOUNTS}/${accountId}/managers/finances`, data, token);
|
|
99
99
|
return response;
|
|
100
100
|
});
|
|
101
101
|
exports._inviteFinanceManager = _inviteFinanceManager;
|
|
@@ -4,3 +4,4 @@ import { PublicEventItem, ResponsePaginationType } from "./types";
|
|
|
4
4
|
export declare const _fetchAllPublicEvents: (basePath: string, nbPage?: number, params?: string) => Promise<ResponsePaginationType<PublicEventItem>>;
|
|
5
5
|
export declare const _fetchPublicExhibitions: (basePath: string, eventId: string, nbPage?: number, params?: string) => Promise<ResponsePaginationType<Exhibition>>;
|
|
6
6
|
export declare const _fetchPublicAgenda: (basePath: string, eventId: string, nbPage?: number, params?: string) => Promise<ResponsePaginationType<Session>>;
|
|
7
|
+
export declare const _getPublicRegistrationForm: (basePath: string, eventId: string) => Promise<any>;
|
package/lib/api/public/index.js
CHANGED
|
@@ -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._fetchPublicAgenda = exports._fetchPublicExhibitions = exports._fetchAllPublicEvents = void 0;
|
|
12
|
+
exports._getPublicRegistrationForm = exports._fetchPublicAgenda = exports._fetchPublicExhibitions = exports._fetchAllPublicEvents = void 0;
|
|
13
13
|
const api_1 = require("../../utils/api");
|
|
14
14
|
const base_1 = require("../../utils/base");
|
|
15
15
|
const _fetchAllPublicEvents = (basePath, nbPage, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -51,3 +51,12 @@ const _fetchPublicAgenda = (basePath, eventId, nbPage, params) => __awaiter(void
|
|
|
51
51
|
return agenda;
|
|
52
52
|
});
|
|
53
53
|
exports._fetchPublicAgenda = _fetchPublicAgenda;
|
|
54
|
+
const _getPublicRegistrationForm = (basePath, eventId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
const base = (0, base_1.getBasePath)(basePath);
|
|
56
|
+
const configUrl = () => {
|
|
57
|
+
return `${base.PUBLIC_EVENTS}/${eventId}/registration-form`;
|
|
58
|
+
};
|
|
59
|
+
const data = yield (0, api_1.getRequest)(configUrl());
|
|
60
|
+
return data;
|
|
61
|
+
});
|
|
62
|
+
exports._getPublicRegistrationForm = _getPublicRegistrationForm;
|
package/lib/index.js
CHANGED
|
@@ -140,6 +140,10 @@ function EventAPIProvider(props) {
|
|
|
140
140
|
(0, api_1.validateConfig)(config);
|
|
141
141
|
return (0, event_1._fetchEventGroups)(config.baseUrl, config.token, eventId);
|
|
142
142
|
}), [config, config.baseUrl, config.token]);
|
|
143
|
+
const getPublicRegistrationForm = (0, react_1.useCallback)((eventId) => __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
(0, api_1.validateConfig)(config);
|
|
145
|
+
return (0, public_1._getPublicRegistrationForm)(config.baseUrl, eventId);
|
|
146
|
+
}), [config, config.baseUrl, config.token]);
|
|
143
147
|
const fetchMyBookings = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
144
148
|
(0, api_1.validateConfig)(config);
|
|
145
149
|
return (0, event_1._fetchMyBookings)(config.baseUrl, config.token);
|
|
@@ -968,6 +972,7 @@ exports.BaseAPI = {
|
|
|
968
972
|
pinExhibition: event_1._pinExhibition,
|
|
969
973
|
unpinExhibition: event_1._unpinExhibition,
|
|
970
974
|
fetchEventGroups: event_1._fetchEventGroups,
|
|
975
|
+
getPublicRegistrationForm: public_1._getPublicRegistrationForm,
|
|
971
976
|
fetchMyBookings: event_1._fetchMyBookings,
|
|
972
977
|
assignTicket: event_1._assignTicket,
|
|
973
978
|
acceptTicket: event_1._acceptTicket,
|
package/lib/types/base.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export type BaseAPIType = {
|
|
|
82
82
|
unpinDocument: (basePath: string, token: string, eventId: string, documentId: string) => Promise<boolean>;
|
|
83
83
|
pinExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<boolean>;
|
|
84
84
|
unpinExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<boolean>;
|
|
85
|
+
getPublicRegistrationForm: (basePath: string, eventId: string) => Promise<any>;
|
|
85
86
|
fetchEventGroups: (basePath: string, token: string, eventId: string) => Promise<GroupServerResponse[]>;
|
|
86
87
|
fetchMyBookings: (basePath: string, token: string) => Promise<ResponsePaginationType<Booking>>;
|
|
87
88
|
assignTicket: (basePath: string, token: string, bookingId: string, ticketId: string, data: any) => Promise<any>;
|
|
@@ -276,6 +277,7 @@ export type EventAPIType = {
|
|
|
276
277
|
pinExhibition: (exhibitionId: string) => Promise<boolean>;
|
|
277
278
|
unpinExhibition: (exhibitionId: string) => Promise<boolean>;
|
|
278
279
|
fetchEventGroups: (eventId: string) => Promise<GroupServerResponse[]>;
|
|
280
|
+
getPublicRegistrationForm: (eventId: string) => Promise<any>;
|
|
279
281
|
fetchMyBookings: () => Promise<ResponsePaginationType<Booking>>;
|
|
280
282
|
assignTicket: (bookingId: string, ticketId: string, data: any) => Promise<any>;
|
|
281
283
|
acceptTicket: (ticketId: string, access: string, body: any) => Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@hubs101/js-api-skd-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"author": "Liveware",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "jest --config jestconfig.json",
|
|
7
|
-
"build": "tsc",
|
|
8
|
-
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.ts\"",
|
|
9
|
-
"lint": "tslint -p tsconfig.json",
|
|
10
|
-
"prepare": "npm run build",
|
|
11
|
-
"prepublishOnly": "npm test && npm run lint",
|
|
12
|
-
"preversion": "npm run lint",
|
|
13
|
-
"version": "npm run format && git add -A src",
|
|
14
|
-
"postversion": "git push && git push --tags",
|
|
15
|
-
"new-version": "git pull && npm run build && git commit -m
|
|
16
|
-
},
|
|
17
|
-
"meta": {},
|
|
18
|
-
"description": "Package for easy access to Event App API",
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/We-Conect/hubs101-js-api-skd-client.git"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"We-Conect",
|
|
25
|
-
"Liveware",
|
|
26
|
-
"EventApp"
|
|
27
|
-
],
|
|
28
|
-
"license": "ISC",
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@types/react": "*",
|
|
31
|
-
"react": "^18.2.0"
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"react": "^18.2.0"
|
|
35
|
-
},
|
|
36
|
-
"main": "lib/index",
|
|
37
|
-
"react-native": "lib/index",
|
|
38
|
-
"types": "lib/index.d.ts",
|
|
39
|
-
"source": "src/index",
|
|
40
|
-
"directories": {
|
|
41
|
-
"test": "test"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@types/jest": "^29.5.0",
|
|
45
|
-
"jest": "^29.5.0",
|
|
46
|
-
"prettier": "^2.8.7",
|
|
47
|
-
"ts-jest": "^29.1.0",
|
|
48
|
-
"tslint": "^6.1.3",
|
|
49
|
-
"tslint-config-prettier": "^1.18.0",
|
|
50
|
-
"typescript": "^5.0.4"
|
|
51
|
-
},
|
|
52
|
-
"files": [
|
|
53
|
-
"lib/**/*"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@hubs101/js-api-skd-client",
|
|
3
|
+
"version": "1.0.10255",
|
|
4
|
+
"author": "Liveware",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "jest --config jestconfig.json",
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.ts\"",
|
|
9
|
+
"lint": "tslint -p tsconfig.json",
|
|
10
|
+
"prepare": "npm run build",
|
|
11
|
+
"prepublishOnly": "npm test && npm run lint",
|
|
12
|
+
"preversion": "npm run lint",
|
|
13
|
+
"version": "npm run format && git add -A src",
|
|
14
|
+
"postversion": "git push && git push --tags",
|
|
15
|
+
"new-version": "git pull && npm run build && git commit -m 'update api' -a --no-verify && npm version patch && npm publish"
|
|
16
|
+
},
|
|
17
|
+
"meta": {},
|
|
18
|
+
"description": "Package for easy access to Event App API",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/We-Conect/hubs101-js-api-skd-client.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"We-Conect",
|
|
25
|
+
"Liveware",
|
|
26
|
+
"EventApp"
|
|
27
|
+
],
|
|
28
|
+
"license": "ISC",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@types/react": "*",
|
|
31
|
+
"react": "^18.2.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^18.2.0"
|
|
35
|
+
},
|
|
36
|
+
"main": "lib/index",
|
|
37
|
+
"react-native": "lib/index",
|
|
38
|
+
"types": "lib/index.d.ts",
|
|
39
|
+
"source": "src/index",
|
|
40
|
+
"directories": {
|
|
41
|
+
"test": "test"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/jest": "^29.5.0",
|
|
45
|
+
"jest": "^29.5.0",
|
|
46
|
+
"prettier": "^2.8.7",
|
|
47
|
+
"ts-jest": "^29.1.0",
|
|
48
|
+
"tslint": "^6.1.3",
|
|
49
|
+
"tslint-config-prettier": "^1.18.0",
|
|
50
|
+
"typescript": "^5.0.4"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"lib/**/*"
|
|
54
|
+
]
|
|
55
|
+
}
|