@webitel/api-services 0.0.111 → 0.0.112

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "make-all": "npm run gen:api && npm version patch && (npm run build:types || true) && (npm run format:all || true) && npm run publish-lib",
7
7
  "gen:api": "npm run gen:api:convert-openapi && npm run gen:api:format-openapi && orval && npm run gen:api:typedoc && npm run gen:api:cleanup",
8
- "publish-lib": "npm publish --access public",
8
+ "publish-lib": "npm publish --access public --tag latest",
9
9
  "gen:api:convert-openapi": "npx api-spec-converter --from=swagger_2 --to=openapi_3 --syntax=yaml https://raw.githubusercontent.com/webitel/protos/main/swagger/api.json > swagger.yaml",
10
10
  "gen:api:format-openapi": "npx openapi-format swagger.yaml -o formatted-openapi.yaml",
11
11
  "gen:api:typedoc": "npx typedoc",
@@ -42,3 +42,4 @@ export * from './wtTypes/adjunctTypes/adjunctTypes';
42
42
  export * from './wtTypes/sysTypes/sysTypes';
43
43
  export * from './wtTypes/typeExtensions/typeExtensions';
44
44
  export * from './сontacts';
45
+ export * from './userSettings/userSettings'
@@ -0,0 +1,38 @@
1
+ import { UserSettingsApiFactory } from 'webitel-sdk';
2
+
3
+ import {
4
+ getDefaultInstance,
5
+ getDefaultOpenAPIConfig,
6
+ } from '../../defaults';
7
+ import {
8
+ applyTransform,
9
+ notify,
10
+ } from '../../transformers';
11
+
12
+ const instance = getDefaultInstance();
13
+ const configuration = getDefaultOpenAPIConfig();
14
+
15
+ const service = UserSettingsApiFactory(configuration, '', instance);
16
+
17
+ const getUserSettings = async ({ key }) => {
18
+ try {
19
+ const response = await service.getUserSettings(key);
20
+ return response.data
21
+ } catch (err) {
22
+ throw applyTransform(err, [notify]);
23
+ }
24
+ };
25
+
26
+ const setUserSettings = async ({ key, value }) => {
27
+ try {
28
+ const response = await service.setUserSettings(key, value);
29
+ return response.data
30
+ } catch (err) {
31
+ throw applyTransform(err, [notify]);
32
+ }
33
+ };
34
+
35
+ export const UserSettingsAPI = {
36
+ get: getUserSettings,
37
+ set: setUserSettings,
38
+ };
@@ -41,3 +41,4 @@ export * from './wtTypes/adjunctTypes/adjunctTypes';
41
41
  export * from './wtTypes/sysTypes/sysTypes';
42
42
  export * from './wtTypes/typeExtensions/typeExtensions';
43
43
  export * from './сontacts';
44
+ export * from './userSettings/userSettings';
@@ -0,0 +1,9 @@
1
+ export declare const UserSettingsAPI: {
2
+ get: ({ key }: {
3
+ key: any;
4
+ }) => Promise<ApiUserSetting>;
5
+ set: ({ key, value }: {
6
+ key: any;
7
+ value: any;
8
+ }) => Promise<ApiUserSetting>;
9
+ };