@hubs101/js-api-skd-client 1.0.10280 → 1.0.10282
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 +28 -28
- package/lib/api/event/index.js +1 -1
- package/lib/constants/api.d.ts +2 -0
- package/lib/constants/api.js +2 -0
- package/lib/types/base.d.ts +1 -0
- package/lib/utils/base.js +1 -0
- package/package.json +55 -55
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`
|
package/lib/api/event/index.js
CHANGED
|
@@ -294,7 +294,7 @@ const _fetchEventGroups = (basePath, token, eventId) => __awaiter(void 0, void 0
|
|
|
294
294
|
exports._fetchEventGroups = _fetchEventGroups;
|
|
295
295
|
const _checkBooking = (basePath, body, lang) => __awaiter(void 0, void 0, void 0, function* () {
|
|
296
296
|
const base = (0, base_1.getBasePath)(basePath);
|
|
297
|
-
const response = yield (0, api_1.
|
|
297
|
+
const response = yield (0, api_1.postRequest)(`${base.PUBLIC_BOOKINGS}/check?lang=${lang}`, body);
|
|
298
298
|
return response;
|
|
299
299
|
});
|
|
300
300
|
exports._checkBooking = _checkBooking;
|
package/lib/constants/api.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare const API_PROD_PATH: Readonly<{
|
|
|
60
60
|
ACCOUNT_TRIAL: `${string}/accounts/trial`;
|
|
61
61
|
INVITATION: `${string}/invitation`;
|
|
62
62
|
BOOKINGS: `${string}/bookings`;
|
|
63
|
+
PUBLIC_BOOKINGS: `${string}/bookings`;
|
|
63
64
|
}>;
|
|
64
65
|
export declare const API_STAGE_PATH: Readonly<{
|
|
65
66
|
ACCOUNTS: `${string}/accounts`;
|
|
@@ -112,6 +113,7 @@ export declare const API_STAGE_PATH: Readonly<{
|
|
|
112
113
|
ACCOUNT_TRIAL: `${string}/accounts/trial`;
|
|
113
114
|
INVITATION: `${string}/invitation`;
|
|
114
115
|
BOOKINGS: `${string}/bookings`;
|
|
116
|
+
PUBLIC_BOOKINGS: `${string}/bookings`;
|
|
115
117
|
}>;
|
|
116
118
|
export declare const ACTION_NAME: {
|
|
117
119
|
readonly VIEW: "view";
|
package/lib/constants/api.js
CHANGED
|
@@ -62,6 +62,7 @@ exports.API_PROD_PATH = Object.freeze({
|
|
|
62
62
|
ACCOUNT_TRIAL: `${exports.UNAUTHORIZED_PRODUCTION_URL}/accounts/trial`,
|
|
63
63
|
INVITATION: `${exports.UNAUTHORIZED_PRODUCTION_URL}/invitation`,
|
|
64
64
|
BOOKINGS: `${exports.PRODUCTION_URL}/bookings`,
|
|
65
|
+
PUBLIC_BOOKINGS: `${exports.UNAUTHORIZED_PRODUCTION_URL}/bookings`,
|
|
65
66
|
});
|
|
66
67
|
exports.API_STAGE_PATH = Object.freeze({
|
|
67
68
|
ACCOUNTS: `${exports.STAGING_URL}/accounts`,
|
|
@@ -114,6 +115,7 @@ exports.API_STAGE_PATH = Object.freeze({
|
|
|
114
115
|
ACCOUNT_TRIAL: `${exports.UNAUTHORIZED_STAGING_URL}/accounts/trial`,
|
|
115
116
|
INVITATION: `${exports.UNAUTHORIZED_STAGING_URL}/invitation`,
|
|
116
117
|
BOOKINGS: `${exports.STAGING_URL}/bookings`,
|
|
118
|
+
PUBLIC_BOOKINGS: `${exports.UNAUTHORIZED_STAGING_URL}/bookings`,
|
|
117
119
|
});
|
|
118
120
|
exports.ACTION_NAME = {
|
|
119
121
|
VIEW: "view",
|
package/lib/types/base.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export type ClientBase = {
|
|
|
67
67
|
PUBLIC_INVITATIONS: string;
|
|
68
68
|
PUBLIC_TICKETS: string;
|
|
69
69
|
BOOKINGS: string;
|
|
70
|
+
PUBLIC_BOOKINGS: string;
|
|
70
71
|
};
|
|
71
72
|
export type BaseAPIType = {
|
|
72
73
|
fetchEventRegistrations: (basePath: string, token: string, eventId: string) => Promise<EventRegistration[]>;
|
package/lib/utils/base.js
CHANGED
|
@@ -63,6 +63,7 @@ const getBasePath = (basePath) => {
|
|
|
63
63
|
PUBLIC_INVITATIONS: `${unauthorizedBasePath}/invitations`,
|
|
64
64
|
PUBLIC_TICKETS: `${publicBasePath}/tickets`,
|
|
65
65
|
BOOKINGS: `${authorizedBasePath}/bookings`,
|
|
66
|
+
PUBLIC_BOOKINGS: `${unauthorizedBasePath}/bookings`,
|
|
66
67
|
});
|
|
67
68
|
};
|
|
68
69
|
exports.getBasePath = getBasePath;
|
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.10282",
|
|
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
|
+
}
|