@hubs101/js-api-skd-client 1.0.10272 → 1.0.10275

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 CHANGED
@@ -1,28 +1,28 @@
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
- \*\*First init or initWithToken needs to be called in order to have authentication setup.
20
-
21
- ## Creating new release
22
-
23
- 1. Commit al changes to git.
24
- 2. Prepare build: `npm run build`
25
- 3. Create new patch version run: `npm version patch`
26
- 4. Publish package to NPM: `npm publish`
27
-
28
- 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
+ \*\*First init or initWithToken needs to be called in order to have authentication setup.
20
+
21
+ ## Creating new release
22
+
23
+ 1. Commit al changes to git.
24
+ 2. Prepare build: `npm run build`
25
+ 3. Create new patch version run: `npm version patch`
26
+ 4. Publish package to NPM: `npm publish`
27
+
28
+ All in one publish alternative run: `npm run new-version`
@@ -45,6 +45,7 @@ export declare const _unpinDocument: (basePath: string, token: string, eventId:
45
45
  export declare const _pinExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<boolean>;
46
46
  export declare const _unpinExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<boolean>;
47
47
  export declare const _fetchEventGroups: (basePath: string, token: string, eventId: string) => Promise<GroupServerResponse[]>;
48
+ export declare const _checkBooking: (basePath: string, body: any, lang: string) => Promise<any>;
48
49
  export declare const _fetchMyBookings: (basePath: string, token: string) => Promise<ResponsePaginationType<Booking>>;
49
50
  export declare const _assignTicket: (basePath: string, token: string, bookingId: string, ticketId: string, data: any) => Promise<any>;
50
51
  export declare const _fetchTicketDetails: (basePath: string, eventId: string, profileId: string, access: string) => Promise<ResponsePaginationType<BookingDetails>>;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports._fetchEventBookings = exports._acceptInternTicket = exports._acceptTicket = exports._fetchTicketDetails = exports._assignTicket = exports._fetchMyBookings = exports._fetchEventGroups = exports._unpinExhibition = exports._pinExhibition = exports._unpinDocument = exports._pinDocument = exports._reportExhibitionAction = exports._deleteDocument = exports._updateDocument = exports._createDocument = exports._assignDocumentToEvent = exports._fetchEventDocuments = exports._fetchUserRegistrationsEvents = exports._fetchEventStreams = exports._fetchEventLocations = exports._deleteLocation = exports._updateLocation = exports._createLocation = exports._fetchExhibitionDetails = exports._deleteDiscount = exports._updateDiscount = exports._createDiscount = exports._fetchEventDiscounts = exports._deleteTicket = exports._updateTicket = exports._createTicket = exports._deleteOption = exports._updateOption = exports._createOption = exports._deleteGroup = exports._updateGroup = exports._createGroup = exports._importAgenda = exports._fetchAttendeesAvailabilities = exports._updateEventTemplates = exports._fetchEventTemplates = exports._fetchEventNotifications = exports._sendSingleNotification = exports._sendNotification = exports._fetchEventDetails = exports._fetchExhibitions = exports._fetchEventsForAccount = exports._fetchTickets = exports._fetchAccounts = exports._fetchEventRegistrations = void 0;
13
- exports._deleteExhibition = exports._updateExhibition = exports._importExhibition = exports._createExhibition = exports._fetchMyExhibitions = exports._fetchAllExhibitions = exports._deleteStream = exports._updateStream = exports._createStream = exports._fetchYoutubeContent = exports._fetchZoomContent = exports._createEvent = exports._unassignPaymentAccount = exports._assignPaymentAccount = exports._fetchEventOptions = exports._fetchEventTickets = exports._updateEvent = exports._deletePage = exports._updatePage = exports._createPage = exports._fetchEventPages = exports._updateAccountWithFiles = exports._fetchMySessions = exports._fetchEditableEvents = exports._fetchSpeakers = exports._fetchAccountDetails = exports._eventInvitationRegistration = exports._createFreeTrialAccount = exports._fetchEventOrderedTickets = void 0;
12
+ exports._acceptInternTicket = exports._acceptTicket = exports._fetchTicketDetails = exports._assignTicket = exports._fetchMyBookings = exports._checkBooking = exports._fetchEventGroups = exports._unpinExhibition = exports._pinExhibition = exports._unpinDocument = exports._pinDocument = exports._reportExhibitionAction = exports._deleteDocument = exports._updateDocument = exports._createDocument = exports._assignDocumentToEvent = exports._fetchEventDocuments = exports._fetchUserRegistrationsEvents = exports._fetchEventStreams = exports._fetchEventLocations = exports._deleteLocation = exports._updateLocation = exports._createLocation = exports._fetchExhibitionDetails = exports._deleteDiscount = exports._updateDiscount = exports._createDiscount = exports._fetchEventDiscounts = exports._deleteTicket = exports._updateTicket = exports._createTicket = exports._deleteOption = exports._updateOption = exports._createOption = exports._deleteGroup = exports._updateGroup = exports._createGroup = exports._importAgenda = exports._fetchAttendeesAvailabilities = exports._updateEventTemplates = exports._fetchEventTemplates = exports._fetchEventNotifications = exports._sendSingleNotification = exports._sendNotification = exports._fetchEventDetails = exports._fetchExhibitions = exports._fetchEventsForAccount = exports._fetchTickets = exports._fetchAccounts = exports._fetchEventRegistrations = void 0;
13
+ exports._deleteExhibition = exports._updateExhibition = exports._importExhibition = exports._createExhibition = exports._fetchMyExhibitions = exports._fetchAllExhibitions = exports._deleteStream = exports._updateStream = exports._createStream = exports._fetchYoutubeContent = exports._fetchZoomContent = exports._createEvent = exports._unassignPaymentAccount = exports._assignPaymentAccount = exports._fetchEventOptions = exports._fetchEventTickets = exports._updateEvent = exports._deletePage = exports._updatePage = exports._createPage = exports._fetchEventPages = exports._updateAccountWithFiles = exports._fetchMySessions = exports._fetchEditableEvents = exports._fetchSpeakers = exports._fetchAccountDetails = exports._eventInvitationRegistration = exports._createFreeTrialAccount = exports._fetchEventOrderedTickets = exports._fetchEventBookings = void 0;
14
14
  const api_1 = require("../../utils/api");
15
15
  const base_1 = require("../../utils/base");
16
16
  const _fetchEventRegistrations = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
@@ -292,6 +292,12 @@ const _fetchEventGroups = (basePath, token, eventId) => __awaiter(void 0, void 0
292
292
  return groups;
293
293
  });
294
294
  exports._fetchEventGroups = _fetchEventGroups;
295
+ const _checkBooking = (basePath, body, lang) => __awaiter(void 0, void 0, void 0, function* () {
296
+ const base = (0, base_1.getBasePath)(basePath);
297
+ const response = yield (0, api_1.postRequestWE)(`${base.BOOKINGS}/bookings/check?lang=${lang}`, body);
298
+ return response;
299
+ });
300
+ exports._checkBooking = _checkBooking;
295
301
  const _fetchMyBookings = (basePath, token) => __awaiter(void 0, void 0, void 0, function* () {
296
302
  const base = (0, base_1.getBasePath)(basePath);
297
303
  const response = yield (0, api_1.getRequest)(`${base.USERS}/bookings?limit=2000`, token);
package/lib/index.js CHANGED
@@ -140,7 +140,11 @@ 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 fetchEventOrderedTickets = react_1.default.useCallback((eventId) => __awaiter(this, void 0, void 0, function* () {
143
+ const checkBooking = (0, react_1.useCallback)((body, lang) => __awaiter(this, void 0, void 0, function* () {
144
+ (0, api_1.validateConfig)(config);
145
+ return (0, event_1._fetchEventOrderedTickets)(config.baseUrl, body, lang);
146
+ }), [config, config.baseUrl, config.token]);
147
+ const fetchEventOrderedTickets = (0, react_1.useCallback)((eventId) => __awaiter(this, void 0, void 0, function* () {
144
148
  (0, api_1.validateConfig)(config);
145
149
  return (0, event_1._fetchEventOrderedTickets)(config.baseUrl, config.token, eventId);
146
150
  }), [config, config.baseUrl, config.token]);
@@ -811,6 +815,7 @@ function EventAPIProvider(props) {
811
815
  pinExhibition,
812
816
  unpinExhibition,
813
817
  fetchEventGroups,
818
+ checkBooking,
814
819
  fetchEventOrderedTickets,
815
820
  acceptInternTicket,
816
821
  fetchTickets,
@@ -993,6 +998,7 @@ exports.BaseAPI = {
993
998
  pinExhibition: event_1._pinExhibition,
994
999
  unpinExhibition: event_1._unpinExhibition,
995
1000
  fetchEventGroups: event_1._fetchEventGroups,
1001
+ checkBooking: event_1._checkBooking,
996
1002
  fetchEventOrderedTickets: event_1._fetchEventOrderedTickets,
997
1003
  acceptInternTicket: event_1._acceptInternTicket,
998
1004
  fetchTickets: event_1._fetchTickets,
@@ -84,6 +84,7 @@ export type BaseAPIType = {
84
84
  unpinExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<boolean>;
85
85
  getPublicRegistrationForm: (basePath: string, eventId: string) => Promise<any>;
86
86
  fetchEventGroups: (basePath: string, token: string, eventId: string) => Promise<GroupServerResponse[]>;
87
+ checkBooking: (basePath: string, body: any, lang: string) => Promise<any>;
87
88
  fetchEventOrderedTickets: (basePath: string, token: string, eventId: string) => Promise<any>;
88
89
  acceptInternTicket: (basePath: string, token: string, ticketId: string, body: any) => Promise<any>;
89
90
  fetchTickets: (basePath: string, token: string) => Promise<ResponsePaginationType<BookingDetails>>;
@@ -281,6 +282,7 @@ export type EventAPIType = {
281
282
  pinExhibition: (exhibitionId: string) => Promise<boolean>;
282
283
  unpinExhibition: (exhibitionId: string) => Promise<boolean>;
283
284
  fetchEventGroups: (eventId: string) => Promise<GroupServerResponse[]>;
285
+ checkBooking: (body: any, lang: string) => Promise<any>;
284
286
  fetchEventOrderedTickets: (eventId: string) => Promise<any>;
285
287
  acceptInternTicket: (ticketId: string, body: any) => Promise<any>;
286
288
  fetchTickets: () => Promise<ResponsePaginationType<BookingDetails>>;
package/lib/utils/base.js CHANGED
@@ -60,7 +60,7 @@ const getBasePath = (basePath) => {
60
60
  STREAMS: `${authorizedBasePath}/streams`,
61
61
  ACCOUNT_TRIAL: `${unauthorizedBasePath}/accounts/trial`,
62
62
  INVITATION: `${unauthorizedBasePath}/invitation`,
63
- PUBLIC_INVITATIONS: `${publicBasePath}/invitations`,
63
+ PUBLIC_INVITATIONS: `${unauthorizedBasePath}/invitations`,
64
64
  PUBLIC_TICKETS: `${publicBasePath}/tickets`,
65
65
  BOOKINGS: `${authorizedBasePath}/bookings`,
66
66
  });
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
- {
2
- "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10272",
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
- }
1
+ {
2
+ "name": "@hubs101/js-api-skd-client",
3
+ "version": "1.0.10275",
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
+ }