@hubs101/js-api-skd-client 1.0.10250 → 1.0.10252
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/event/index.js +1 -1
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/api.js +2 -2
- 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`
|
package/lib/api/event/index.js
CHANGED
|
@@ -113,7 +113,7 @@ const _createOption = (basePath, token, data) => __awaiter(void 0, void 0, void
|
|
|
113
113
|
exports._createOption = _createOption;
|
|
114
114
|
const _updateOption = (basePath, token, optionId, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
115
115
|
const base = (0, base_1.getBasePath)(basePath);
|
|
116
|
-
const response = yield (0, api_1.putRequest)(`${base.OPTIONS}/${optionId}`, token, data);
|
|
116
|
+
const response = yield (0, api_1.putRequest)(`${base.OPTIONS}/${optionId}`, token, data, false);
|
|
117
117
|
return response;
|
|
118
118
|
});
|
|
119
119
|
exports._updateOption = _updateOption;
|
package/lib/utils/api.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const postRequestSimple: (url: string, body?: any, headers?: any)
|
|
|
6
6
|
export declare const getRequestSimple: (url: string, token?: string, headers?: any) => Promise<string>;
|
|
7
7
|
export declare const deleteRequest: (url: string, body: any, token: string, headers?: any) => Promise<any>;
|
|
8
8
|
export declare const postFileRequest: (url: string, file: any, param: string, token: string) => Promise<any>;
|
|
9
|
-
export declare const putRequest: (url: string, token: string, body: any) => Promise<any>;
|
|
9
|
+
export declare const putRequest: (url: string, token: string, body: any, withoutStatus?: boolean) => Promise<any>;
|
|
10
10
|
export declare const patchRequest: (url: string, token: string, body: any) => Promise<any>;
|
|
11
11
|
export declare const getRequest: (url: string, token?: string, headers?: any) => Promise<any>;
|
|
12
12
|
export declare const getFormRequest: (url: string, token: string, body: any, headers?: any) => Promise<any>;
|
package/lib/utils/api.js
CHANGED
|
@@ -163,7 +163,7 @@ const postFileRequest = (url, file, param, token) => __awaiter(void 0, void 0, v
|
|
|
163
163
|
return data === null || data === void 0 ? void 0 : data.result;
|
|
164
164
|
});
|
|
165
165
|
exports.postFileRequest = postFileRequest;
|
|
166
|
-
const putRequest = (url, token, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
166
|
+
const putRequest = (url, token, body, withoutStatus = true) => __awaiter(void 0, void 0, void 0, function* () {
|
|
167
167
|
let form;
|
|
168
168
|
if (body) {
|
|
169
169
|
form = new FormData();
|
|
@@ -189,7 +189,7 @@ const putRequest = (url, token, body) => __awaiter(void 0, void 0, void 0, funct
|
|
|
189
189
|
throw { invalid_fields: data.invalid_fields };
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
if ((data === null || data === void 0 ? void 0 : data.result) && typeof (data === null || data === void 0 ? void 0 : data.result) !== "string") {
|
|
192
|
+
if ((data === null || data === void 0 ? void 0 : data.result) && typeof (data === null || data === void 0 ? void 0 : data.result) !== "string" && withoutStatus) {
|
|
193
193
|
return data === null || data === void 0 ? void 0 : data.result;
|
|
194
194
|
}
|
|
195
195
|
return data;
|
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.10252",
|
|
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
|
+
}
|