@expressms/smartapp-sdk 1.12.0-alpha.4 → 1.12.0-alpha.6

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.
Files changed (60) hide show
  1. package/build/main/index.d.ts +9 -9
  2. package/build/main/index.js +24 -56
  3. package/build/main/lib/client/index.d.ts +14 -3
  4. package/build/main/lib/client/index.js +39 -9
  5. package/build/main/lib/devices/bluetooth.d.ts +52 -0
  6. package/build/main/lib/devices/bluetooth.js +160 -0
  7. package/build/main/lib/devices/gps.d.ts +5 -0
  8. package/build/main/lib/devices/gps.js +20 -0
  9. package/build/main/lib/devices/index.d.ts +5 -0
  10. package/build/main/lib/devices/index.js +35 -0
  11. package/build/main/lib/devices/nfc.d.ts +6 -0
  12. package/build/main/lib/devices/nfc.js +24 -0
  13. package/build/main/lib/helpers/helpers.d.ts +0 -1
  14. package/build/main/lib/helpers/helpers.js +2 -12
  15. package/build/main/lib/logging/index.js +5 -9
  16. package/build/main/lib/notification/index.d.ts +1 -2
  17. package/build/main/lib/notification/index.js +1 -1
  18. package/build/main/lib/routing/index.d.ts +6 -7
  19. package/build/main/lib/routing/index.js +2 -2
  20. package/build/main/types/bridge.d.ts +7 -32
  21. package/build/main/types/bridge.js +8 -4
  22. package/build/main/types/devices.d.ts +53 -0
  23. package/build/main/types/devices.js +3 -0
  24. package/build/main/types/index.d.ts +1 -0
  25. package/build/main/types/index.js +2 -1
  26. package/build/module/index.d.ts +9 -9
  27. package/build/module/index.js +10 -10
  28. package/build/module/lib/client/index.d.ts +14 -3
  29. package/build/module/lib/client/index.js +37 -8
  30. package/build/module/lib/devices/bluetooth.d.ts +52 -0
  31. package/build/module/lib/devices/bluetooth.js +148 -0
  32. package/build/module/lib/devices/gps.d.ts +5 -0
  33. package/build/module/lib/devices/gps.js +13 -0
  34. package/build/module/lib/devices/index.d.ts +5 -0
  35. package/build/module/lib/devices/index.js +6 -0
  36. package/build/module/lib/devices/nfc.d.ts +6 -0
  37. package/build/module/lib/devices/nfc.js +17 -0
  38. package/build/module/lib/helpers/helpers.d.ts +0 -1
  39. package/build/module/lib/helpers/helpers.js +1 -10
  40. package/build/module/lib/logging/index.js +4 -8
  41. package/build/module/lib/notification/index.d.ts +1 -2
  42. package/build/module/lib/notification/index.js +2 -3
  43. package/build/module/lib/routing/index.d.ts +6 -7
  44. package/build/module/lib/routing/index.js +7 -8
  45. package/build/module/types/bridge.d.ts +7 -32
  46. package/build/module/types/bridge.js +8 -4
  47. package/build/module/types/devices.d.ts +53 -0
  48. package/build/module/types/devices.js +2 -0
  49. package/build/module/types/index.d.ts +1 -0
  50. package/build/module/types/index.js +2 -1
  51. package/build/umd/index.js +222 -98
  52. package/package.json +1 -1
  53. package/build/main/lib/proxy/index.d.ts +0 -35
  54. package/build/main/lib/proxy/index.js +0 -102
  55. package/build/main/types/proxy.d.ts +0 -40
  56. package/build/main/types/proxy.js +0 -3
  57. package/build/module/lib/proxy/index.d.ts +0 -35
  58. package/build/module/lib/proxy/index.js +0 -91
  59. package/build/module/types/proxy.d.ts +0 -40
  60. package/build/module/types/proxy.js +0 -2
@@ -1,35 +0,0 @@
1
- import { CookieItem, StatusResponse } from '../../types';
2
- import { GetCredentialsResponse, WebCommandsPipeline } from '../../types/proxy';
3
- /**
4
- * Set cookies for web resouce. It's needed for SSO auth cases.
5
- * @param cookies List of cookie strings !with domains!
6
- * @returns Promise that'll be fullfilled with SmartApp list on success, otherwise rejected with reason
7
- */
8
- export declare const setWebResourceCookies: (cookies: CookieItem[]) => Promise<StatusResponse>;
9
- /**
10
- * Allow WebView то open links inside, not in external browser
11
- * @param domains List domains without schema
12
- * @returns Promise that'll be fullfilled with SmartApp list on success, otherwise rejected with reason
13
- */
14
- export declare const setAllowedNavigationDomains: (domains: string[]) => Promise<StatusResponse>;
15
- /**
16
- * DRAFT: Get saved credentials of web resource
17
- * @returns Promise that'll be fullfilled with credentials on success, otherwise rejected with reason
18
- */
19
- export declare const getCredentials: () => Promise<GetCredentialsResponse>;
20
- /**
21
- * DRAFT: Save credentials of web resource
22
- * @param login User login
23
- * @param password User pass
24
- * @returns Promise that'll be fullfilled with credentials on success, otherwise rejected with reason
25
- */
26
- export declare const setCredentials: ({ login, password }: {
27
- login: string;
28
- password: string;
29
- }) => Promise<StatusResponse>;
30
- /**
31
- * Run pipeline for manipulating web resource
32
- * @param pipeline Pipeline with jobs & command
33
- * @returns Promise that'll be fullfilled
34
- */
35
- export declare const runWebCommandsPipeline: (pipeline: WebCommandsPipeline) => Promise<StatusResponse>;
@@ -1,91 +0,0 @@
1
- import bridge from '@expressms/smartapp-bridge';
2
- import { ERROR_CODES, METHODS } from '../../types';
3
- /**
4
- * Set cookies for web resouce. It's needed for SSO auth cases.
5
- * @param cookies List of cookie strings !with domains!
6
- * @returns Promise that'll be fullfilled with SmartApp list on success, otherwise rejected with reason
7
- */
8
- export const setWebResourceCookies = (cookies) => {
9
- if (!bridge)
10
- return Promise.reject(ERROR_CODES.NO_BRIDGE);
11
- return bridge
12
- .sendClientEvent({
13
- method: METHODS.SET_WEB_RESOURCE_COOKIES,
14
- params: {
15
- cookies,
16
- },
17
- })
18
- .then(event => event);
19
- };
20
- /**
21
- * Allow WebView то open links inside, not in external browser
22
- * @param domains List domains without schema
23
- * @returns Promise that'll be fullfilled with SmartApp list on success, otherwise rejected with reason
24
- */
25
- export const setAllowedNavigationDomains = (domains) => {
26
- if (!bridge)
27
- return Promise.reject(ERROR_CODES.NO_BRIDGE);
28
- return bridge
29
- .sendClientEvent({
30
- method: METHODS.SET_ALLOWED_NAVIGATION_DOMAINS,
31
- params: {
32
- domains,
33
- },
34
- timeout: 1000,
35
- })
36
- .then(event => event);
37
- };
38
- /**
39
- * DRAFT: Get saved credentials of web resource
40
- * @returns Promise that'll be fullfilled with credentials on success, otherwise rejected with reason
41
- */
42
- export const getCredentials = () => {
43
- if (!bridge)
44
- return Promise.reject(ERROR_CODES.NO_BRIDGE);
45
- return bridge
46
- .sendClientEvent({
47
- method: METHODS.GET_CREDENTIALS,
48
- params: {},
49
- timeout: 10_000,
50
- })
51
- .then(event => event);
52
- };
53
- /**
54
- * DRAFT: Save credentials of web resource
55
- * @param login User login
56
- * @param password User pass
57
- * @returns Promise that'll be fullfilled with credentials on success, otherwise rejected with reason
58
- */
59
- export const setCredentials = ({ login, password }) => {
60
- if (!bridge)
61
- return Promise.reject(ERROR_CODES.NO_BRIDGE);
62
- return bridge
63
- .sendClientEvent({
64
- method: METHODS.SET_CREDENTIALS,
65
- params: {
66
- login,
67
- password,
68
- },
69
- timeout: 10_000,
70
- })
71
- .then(event => event);
72
- };
73
- /**
74
- * Run pipeline for manipulating web resource
75
- * @param pipeline Pipeline with jobs & command
76
- * @returns Promise that'll be fullfilled
77
- */
78
- export const runWebCommandsPipeline = (pipeline) => {
79
- if (!bridge)
80
- return Promise.reject(ERROR_CODES.NO_BRIDGE);
81
- return bridge
82
- .sendClientEvent({
83
- method: METHODS.RUN_WEB_COMMANDS_PIPELINE,
84
- params: {
85
- pipeline,
86
- },
87
- timeout: 1000,
88
- })
89
- .then(event => event);
90
- };
91
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL3Byb3h5L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sTUFBTSxNQUFNLDRCQUE0QixDQUFBO0FBQy9DLE9BQU8sRUFBYyxXQUFXLEVBQUUsT0FBTyxFQUFrQixNQUFNLGFBQWEsQ0FBQTtBQUc5RTs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE1BQU0scUJBQXFCLEdBQUcsQ0FBQyxPQUFxQixFQUEyQixFQUFFO0lBQ3RGLElBQUksQ0FBQyxNQUFNO1FBQUUsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxTQUFTLENBQ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ridge/build/main/types/eventEmitter';
2
- import { STATUS } from './bridge';
3
- export interface GetCredentialsResponse extends Omit<EmitterEventPayload, 'payload'> {
4
- payload: {
5
- status: STATUS;
6
- errorCode?: string | null;
7
- credentials: {
8
- login: string;
9
- password: string;
10
- };
11
- };
12
- }
13
- export type WebCommandSearchElement = {
14
- type: 'search_element';
15
- xpath: string;
16
- };
17
- export type WebCommandSetInputValue = {
18
- type: 'set_input_value';
19
- xpath: string;
20
- value: string;
21
- };
22
- export type WebCommandClickElement = {
23
- type: 'click_element';
24
- xpath: string;
25
- };
26
- export type WebCommandOpenUrl = {
27
- type: 'open_url';
28
- value: string;
29
- };
30
- export type WebCommand = WebCommandSearchElement | WebCommandSetInputValue | WebCommandClickElement | WebCommandOpenUrl;
31
- export interface WebCommandsJob {
32
- commands: Array<WebCommand>;
33
- interval: number;
34
- retryCount: number;
35
- onSuccess: Array<WebCommandsJob>;
36
- onError: {
37
- command: WebCommand;
38
- } | null;
39
- }
40
- export type WebCommandsPipeline = Array<WebCommandsJob>;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJveHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHlwZXMvcHJveHkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9