starti.app 1.0.39-alpha.3 → 1.0.40
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 +27 -27
- package/dist/app.d.ts +43 -43
- package/dist/app.js +99 -99
- package/dist/biometrics.d.ts +32 -32
- package/dist/biometrics.js +175 -175
- package/dist/clientUser.d.ts +11 -11
- package/dist/clientUser.js +42 -41
- package/dist/config.d.ts +2 -1
- package/dist/config.js +5 -4
- package/dist/index.d.ts +23 -23
- package/dist/index.js +66 -63
- package/dist/nfc.d.ts +15 -15
- package/dist/nfc.js +68 -68
- package/dist/pushnotification.d.ts +17 -17
- package/dist/pushnotification.js +104 -104
- package/dist/qrscanner.d.ts +16 -16
- package/dist/qrscanner.js +40 -40
- package/dist/services/ui-service.d.ts +16 -0
- package/dist/services/ui-service.js +75 -0
- package/package.json +24 -24
- package/umd/main.js +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# starti.app API
|
|
2
|
-
|
|
3
|
-
## When should I use this package?
|
|
4
|
-
|
|
5
|
-
You've bought a [starti.app](https://starti.app) and want to integrate your website and the app.
|
|
6
|
-
|
|
7
|
-
This package allows you to talk to the app using an easy API.
|
|
8
|
-
|
|
9
|
-
## How do I get started
|
|
10
|
-
|
|
11
|
-
Add the package to your project in one of two ways:
|
|
12
|
-
|
|
13
|
-
1) Add the package using npm:
|
|
14
|
-
```
|
|
15
|
-
npm install starti.app
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
2) Add the following to your HTML file:
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
<script
|
|
22
|
-
crossorigin
|
|
23
|
-
src="https://unpkg.com/starti.app@1.0.12/umd/main.js">
|
|
24
|
-
</script>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Remember to update the version number (set to 1.0.12 above) to the latest version.
|
|
1
|
+
# starti.app API
|
|
2
|
+
|
|
3
|
+
## When should I use this package?
|
|
4
|
+
|
|
5
|
+
You've bought a [starti.app](https://starti.app) and want to integrate your website and the app.
|
|
6
|
+
|
|
7
|
+
This package allows you to talk to the app using an easy API.
|
|
8
|
+
|
|
9
|
+
## How do I get started
|
|
10
|
+
|
|
11
|
+
Add the package to your project in one of two ways:
|
|
12
|
+
|
|
13
|
+
1) Add the package using npm:
|
|
14
|
+
```
|
|
15
|
+
npm install starti.app
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2) Add the following to your HTML file:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
<script
|
|
22
|
+
crossorigin
|
|
23
|
+
src="https://unpkg.com/starti.app@1.0.12/umd/main.js">
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Remember to update the version number (set to 1.0.12 above) to the latest version.
|
package/dist/app.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
export declare const App: IApp;
|
|
2
|
-
declare type AppEvents = "appInForeground" | "navigatingPage";
|
|
3
|
-
export interface IApp {
|
|
4
|
-
/** Request the user reviews the app. */
|
|
5
|
-
requestReview: () => void;
|
|
6
|
-
/** Downloads the given file. */
|
|
7
|
-
downloadFile: (url: string, fileName: string) => void;
|
|
8
|
-
/** Are the site running inside starti.app? Returns false if the site is loaded in a normal browser. */
|
|
9
|
-
isStartiappLoaded(): boolean;
|
|
10
|
-
/** Use this method to control which URL the app load when it is initialized. */
|
|
11
|
-
setAppUrl: (url: string) => void;
|
|
12
|
-
/** Use this method to reset the app to the default URL. */
|
|
13
|
-
resetAppUrl(): void;
|
|
14
|
-
/** Returns the version number of the app (eg. 1.0.0). */
|
|
15
|
-
version(): Promise<string>;
|
|
16
|
-
/** Returns the apps brand ID (eg. 'abc'). */
|
|
17
|
-
brandId(): Promise<string>;
|
|
18
|
-
/** Returns the ID-string of the current device. */
|
|
19
|
-
deviceId(): Promise<string>;
|
|
20
|
-
/** Opens the given URL in the default browser. */
|
|
21
|
-
openExternalBrowser: (url: string) => void;
|
|
22
|
-
/** Show statusbar */
|
|
23
|
-
showStatusBar(): void;
|
|
24
|
-
/** Hide statusbar */
|
|
25
|
-
hideStatusBar(): void;
|
|
26
|
-
/** Changes the background color of safe area */
|
|
27
|
-
setSafeAreaBackgroundColor(color: string): Promise<boolean>;
|
|
28
|
-
/** Disable screen rotation */
|
|
29
|
-
disableScreenRotation(): void;
|
|
30
|
-
/** Enable screen rotation */
|
|
31
|
-
enableScreenRotation(): void;
|
|
32
|
-
/** Listen for events */
|
|
33
|
-
addEventListener(type: AppEvents, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
34
|
-
/** Remove event listener */
|
|
35
|
-
removeEventListener(type: AppEvents, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
36
|
-
/** Get internal domains */
|
|
37
|
-
getInternalDomains(): Promise<string[]>;
|
|
38
|
-
/** Add internal domain */
|
|
39
|
-
addInternalDomain(domain: string): void;
|
|
40
|
-
/** Remove internal domain */
|
|
41
|
-
removeInternalDomain(domain: string): void;
|
|
42
|
-
}
|
|
43
|
-
export {};
|
|
1
|
+
export declare const App: IApp;
|
|
2
|
+
declare type AppEvents = "appInForeground" | "navigatingPage";
|
|
3
|
+
export interface IApp {
|
|
4
|
+
/** Request the user reviews the app. */
|
|
5
|
+
requestReview: () => void;
|
|
6
|
+
/** Downloads the given file. */
|
|
7
|
+
downloadFile: (url: string, fileName: string) => void;
|
|
8
|
+
/** Are the site running inside starti.app? Returns false if the site is loaded in a normal browser. */
|
|
9
|
+
isStartiappLoaded(): boolean;
|
|
10
|
+
/** Use this method to control which URL the app load when it is initialized. */
|
|
11
|
+
setAppUrl: (url: string) => void;
|
|
12
|
+
/** Use this method to reset the app to the default URL. */
|
|
13
|
+
resetAppUrl(): void;
|
|
14
|
+
/** Returns the version number of the app (eg. 1.0.0). */
|
|
15
|
+
version(): Promise<string>;
|
|
16
|
+
/** Returns the apps brand ID (eg. 'abc'). */
|
|
17
|
+
brandId(): Promise<string>;
|
|
18
|
+
/** Returns the ID-string of the current device. */
|
|
19
|
+
deviceId(): Promise<string>;
|
|
20
|
+
/** Opens the given URL in the default browser. */
|
|
21
|
+
openExternalBrowser: (url: string) => void;
|
|
22
|
+
/** Show statusbar */
|
|
23
|
+
showStatusBar(): void;
|
|
24
|
+
/** Hide statusbar */
|
|
25
|
+
hideStatusBar(): void;
|
|
26
|
+
/** Changes the background color of safe area */
|
|
27
|
+
setSafeAreaBackgroundColor(color: string): Promise<boolean>;
|
|
28
|
+
/** Disable screen rotation */
|
|
29
|
+
disableScreenRotation(): void;
|
|
30
|
+
/** Enable screen rotation */
|
|
31
|
+
enableScreenRotation(): void;
|
|
32
|
+
/** Listen for events */
|
|
33
|
+
addEventListener(type: AppEvents, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
34
|
+
/** Remove event listener */
|
|
35
|
+
removeEventListener(type: AppEvents, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
36
|
+
/** Get internal domains */
|
|
37
|
+
getInternalDomains(): Promise<string[]>;
|
|
38
|
+
/** Add internal domain */
|
|
39
|
+
addInternalDomain(domain: string): void;
|
|
40
|
+
/** Remove internal domain */
|
|
41
|
+
removeInternalDomain(domain: string): void;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
package/dist/app.js
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.App = void 0;
|
|
4
|
-
exports.App = new class extends EventTarget {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.startiappIsLoaded = false;
|
|
8
|
-
}
|
|
9
|
-
setStartiappIsLoaded() {
|
|
10
|
-
this.startiappIsLoaded = true;
|
|
11
|
-
}
|
|
12
|
-
isStartiappLoaded() {
|
|
13
|
-
return this.startiappIsLoaded;
|
|
14
|
-
}
|
|
15
|
-
setAppUrl(url) {
|
|
16
|
-
AppIntegration.setAppUrl(url);
|
|
17
|
-
}
|
|
18
|
-
resetAppUrl() {
|
|
19
|
-
AppIntegration.resetAppUrl();
|
|
20
|
-
}
|
|
21
|
-
appInForegroundEventRecievedEvent() {
|
|
22
|
-
this.dispatchEvent(new CustomEvent('appInForeground'));
|
|
23
|
-
}
|
|
24
|
-
openExternalBrowser(url) {
|
|
25
|
-
AppIntegration.openBrowser(url);
|
|
26
|
-
}
|
|
27
|
-
downloadFile(url, fileName) {
|
|
28
|
-
AppIntegration.download(url, fileName);
|
|
29
|
-
}
|
|
30
|
-
brandId() {
|
|
31
|
-
return new Promise((resolve, reject) => {
|
|
32
|
-
this.resolveBrandId = resolve;
|
|
33
|
-
AppIntegration.brandId();
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
requestReview() {
|
|
37
|
-
AppIntegration.requestReview();
|
|
38
|
-
}
|
|
39
|
-
deviceId() {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
this.resolveDeviceId = resolve;
|
|
42
|
-
AppIntegration.deviceId();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
version() {
|
|
46
|
-
return new Promise((resolve, reject) => {
|
|
47
|
-
this.resolveVersion = resolve;
|
|
48
|
-
AppIntegration.version();
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
getInternalDomains() {
|
|
52
|
-
return new Promise((resolve, reject) => {
|
|
53
|
-
this.resolveGetInternalDomains = resolve;
|
|
54
|
-
AppIntegration.getInternalDomains();
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
addInternalDomain(domain) {
|
|
58
|
-
AppIntegration.addInternalDomain(domain);
|
|
59
|
-
}
|
|
60
|
-
removeInternalDomain(domain) {
|
|
61
|
-
AppIntegration.removeInternalDomain(domain);
|
|
62
|
-
}
|
|
63
|
-
showStatusBar() {
|
|
64
|
-
AppIntegration.showStatusBar();
|
|
65
|
-
}
|
|
66
|
-
hideStatusBar() {
|
|
67
|
-
AppIntegration.hideStatusBar();
|
|
68
|
-
}
|
|
69
|
-
setSafeAreaBackgroundColor(color) {
|
|
70
|
-
return new Promise((resolve, reject) => {
|
|
71
|
-
this.resolveSetSafeAreaBackgroundColor = resolve;
|
|
72
|
-
AppIntegration.setSafeAreaBackgroundColor(color);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
disableScreenRotation() {
|
|
76
|
-
AppIntegration.disableScreenRotation();
|
|
77
|
-
}
|
|
78
|
-
enableScreenRotation() {
|
|
79
|
-
AppIntegration.enableScreenRotation();
|
|
80
|
-
}
|
|
81
|
-
brandIdResult(result) {
|
|
82
|
-
this.resolveBrandId(result);
|
|
83
|
-
}
|
|
84
|
-
versionResult(result) {
|
|
85
|
-
this.resolveVersion(result);
|
|
86
|
-
}
|
|
87
|
-
deviceIdResult(result) {
|
|
88
|
-
this.resolveDeviceId(result);
|
|
89
|
-
}
|
|
90
|
-
setSafeAreaBackgroundColorResult(result) {
|
|
91
|
-
this.resolveSetSafeAreaBackgroundColor(result);
|
|
92
|
-
}
|
|
93
|
-
navigatingPageEvent(result) {
|
|
94
|
-
this.dispatchEvent(new CustomEvent('navigatingPage', { detail: result }));
|
|
95
|
-
}
|
|
96
|
-
getInternalDomainsResult(result) {
|
|
97
|
-
this.resolveGetInternalDomains(result);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.App = void 0;
|
|
4
|
+
exports.App = new class extends EventTarget {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.startiappIsLoaded = false;
|
|
8
|
+
}
|
|
9
|
+
setStartiappIsLoaded() {
|
|
10
|
+
this.startiappIsLoaded = true;
|
|
11
|
+
}
|
|
12
|
+
isStartiappLoaded() {
|
|
13
|
+
return this.startiappIsLoaded;
|
|
14
|
+
}
|
|
15
|
+
setAppUrl(url) {
|
|
16
|
+
AppIntegration.setAppUrl(url);
|
|
17
|
+
}
|
|
18
|
+
resetAppUrl() {
|
|
19
|
+
AppIntegration.resetAppUrl();
|
|
20
|
+
}
|
|
21
|
+
appInForegroundEventRecievedEvent() {
|
|
22
|
+
this.dispatchEvent(new CustomEvent('appInForeground'));
|
|
23
|
+
}
|
|
24
|
+
openExternalBrowser(url) {
|
|
25
|
+
AppIntegration.openBrowser(url);
|
|
26
|
+
}
|
|
27
|
+
downloadFile(url, fileName) {
|
|
28
|
+
AppIntegration.download(url, fileName);
|
|
29
|
+
}
|
|
30
|
+
brandId() {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
this.resolveBrandId = resolve;
|
|
33
|
+
AppIntegration.brandId();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
requestReview() {
|
|
37
|
+
AppIntegration.requestReview();
|
|
38
|
+
}
|
|
39
|
+
deviceId() {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
this.resolveDeviceId = resolve;
|
|
42
|
+
AppIntegration.deviceId();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
version() {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
this.resolveVersion = resolve;
|
|
48
|
+
AppIntegration.version();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
getInternalDomains() {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
this.resolveGetInternalDomains = resolve;
|
|
54
|
+
AppIntegration.getInternalDomains();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
addInternalDomain(domain) {
|
|
58
|
+
AppIntegration.addInternalDomain(domain);
|
|
59
|
+
}
|
|
60
|
+
removeInternalDomain(domain) {
|
|
61
|
+
AppIntegration.removeInternalDomain(domain);
|
|
62
|
+
}
|
|
63
|
+
showStatusBar() {
|
|
64
|
+
AppIntegration.showStatusBar();
|
|
65
|
+
}
|
|
66
|
+
hideStatusBar() {
|
|
67
|
+
AppIntegration.hideStatusBar();
|
|
68
|
+
}
|
|
69
|
+
setSafeAreaBackgroundColor(color) {
|
|
70
|
+
return new Promise((resolve, reject) => {
|
|
71
|
+
this.resolveSetSafeAreaBackgroundColor = resolve;
|
|
72
|
+
AppIntegration.setSafeAreaBackgroundColor(color);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
disableScreenRotation() {
|
|
76
|
+
AppIntegration.disableScreenRotation();
|
|
77
|
+
}
|
|
78
|
+
enableScreenRotation() {
|
|
79
|
+
AppIntegration.enableScreenRotation();
|
|
80
|
+
}
|
|
81
|
+
brandIdResult(result) {
|
|
82
|
+
this.resolveBrandId(result);
|
|
83
|
+
}
|
|
84
|
+
versionResult(result) {
|
|
85
|
+
this.resolveVersion(result);
|
|
86
|
+
}
|
|
87
|
+
deviceIdResult(result) {
|
|
88
|
+
this.resolveDeviceId(result);
|
|
89
|
+
}
|
|
90
|
+
setSafeAreaBackgroundColorResult(result) {
|
|
91
|
+
this.resolveSetSafeAreaBackgroundColor(result);
|
|
92
|
+
}
|
|
93
|
+
navigatingPageEvent(result) {
|
|
94
|
+
this.dispatchEvent(new CustomEvent('navigatingPage', { detail: result }));
|
|
95
|
+
}
|
|
96
|
+
getInternalDomainsResult(result) {
|
|
97
|
+
this.resolveGetInternalDomains(result);
|
|
98
|
+
}
|
|
99
|
+
};
|
package/dist/biometrics.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export declare const Biometrics: IBiometrics;
|
|
2
|
-
declare type BiometricsEvents = "";
|
|
3
|
-
export interface IBiometrics {
|
|
4
|
-
/** Start scanning for biometrics */
|
|
5
|
-
scan(title: string, reason: string): Promise<boolean>;
|
|
6
|
-
/** Get the type of biometrics used */
|
|
7
|
-
getAuthenticationType(): Promise<string>;
|
|
8
|
-
/** Set the content to be secured */
|
|
9
|
-
setSecuredContent(content: string | object | number): void;
|
|
10
|
-
/** Get the secured content */
|
|
11
|
-
setUsernameAndPassword(username: string, password: string): void;
|
|
12
|
-
/** Get the username and password */
|
|
13
|
-
getUsernameAndPassword(scanTitle?: string, scanReason?: string): Promise<{
|
|
14
|
-
username: string;
|
|
15
|
-
password: string;
|
|
16
|
-
}>;
|
|
17
|
-
/** Has username and password stored */
|
|
18
|
-
hasUsernameAndPassword(): Promise<boolean>;
|
|
19
|
-
/** Remove the username and password */
|
|
20
|
-
removeUsernameAndPassword(): void;
|
|
21
|
-
/** Get the secured content */
|
|
22
|
-
getSecuredContent(title: string, reason: string): Promise<object>;
|
|
23
|
-
/** Check if there is any secured content */
|
|
24
|
-
hasSecuredContent(): Promise<boolean>;
|
|
25
|
-
/** Remove the secured content */
|
|
26
|
-
removeSecuredContent(): void;
|
|
27
|
-
/** Listen for biometrics events */
|
|
28
|
-
addEventListener(type: BiometricsEvents, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
29
|
-
/** Remove a biometrics event listener */
|
|
30
|
-
removeEventListener(type: BiometricsEvents, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
1
|
+
export declare const Biometrics: IBiometrics;
|
|
2
|
+
declare type BiometricsEvents = "";
|
|
3
|
+
export interface IBiometrics {
|
|
4
|
+
/** Start scanning for biometrics */
|
|
5
|
+
scan(title: string, reason: string): Promise<boolean>;
|
|
6
|
+
/** Get the type of biometrics used */
|
|
7
|
+
getAuthenticationType(): Promise<string>;
|
|
8
|
+
/** Set the content to be secured */
|
|
9
|
+
setSecuredContent(content: string | object | number): void;
|
|
10
|
+
/** Get the secured content */
|
|
11
|
+
setUsernameAndPassword(username: string, password: string): void;
|
|
12
|
+
/** Get the username and password */
|
|
13
|
+
getUsernameAndPassword(scanTitle?: string, scanReason?: string): Promise<{
|
|
14
|
+
username: string;
|
|
15
|
+
password: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** Has username and password stored */
|
|
18
|
+
hasUsernameAndPassword(): Promise<boolean>;
|
|
19
|
+
/** Remove the username and password */
|
|
20
|
+
removeUsernameAndPassword(): void;
|
|
21
|
+
/** Get the secured content */
|
|
22
|
+
getSecuredContent(title: string, reason: string): Promise<object>;
|
|
23
|
+
/** Check if there is any secured content */
|
|
24
|
+
hasSecuredContent(): Promise<boolean>;
|
|
25
|
+
/** Remove the secured content */
|
|
26
|
+
removeSecuredContent(): void;
|
|
27
|
+
/** Listen for biometrics events */
|
|
28
|
+
addEventListener(type: BiometricsEvents, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
29
|
+
/** Remove a biometrics event listener */
|
|
30
|
+
removeEventListener(type: BiometricsEvents, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|