starti.app 1.0.12 → 1.0.14
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 +18 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/package.json +3 -3
- package/umd/main.js +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# starti.app API
|
|
2
|
+
|
|
3
|
+
## When should I use this package?
|
|
4
|
+
|
|
5
|
+
You've bought a [start.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
|
+
`npm install starti.app@1.0.12`
|
|
15
|
+
|
|
16
|
+
2) Add the following line to your HTML file:
|
|
17
|
+
`<script crossorigin src="https://unpkg.com/starti.app@1.0.12/umd/main.js"></script>`
|
|
18
|
+
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export default class startiapp {
|
|
|
8
8
|
static QrScanner: IQrScanner;
|
|
9
9
|
/** Access to push notifications using Firebase. */
|
|
10
10
|
static PushNotification: IPushNotification;
|
|
11
|
-
/**
|
|
11
|
+
/** When all integrations in the app are ready we should call initialize(). */
|
|
12
|
+
static onIntegrationsAreReady?: () => void;
|
|
13
|
+
/** Call this method to initialize the starti.app API integration. This method should be called AFTER all integrations are ready (see onIntegrationsAreReady). */
|
|
12
14
|
static initialize(): void;
|
|
13
15
|
}
|
package/dist/index.js
CHANGED
|
@@ -6,12 +6,14 @@ const qrscanner_1 = require("./qrscanner");
|
|
|
6
6
|
const untypedWindow = window;
|
|
7
7
|
untypedWindow.appIntegrationsAreReady = () => {
|
|
8
8
|
app_1.App.setStartiappIsLoaded();
|
|
9
|
+
if (startiapp.onIntegrationsAreReady)
|
|
10
|
+
startiapp.onIntegrationsAreReady();
|
|
9
11
|
};
|
|
10
12
|
untypedWindow.App = app_1.App;
|
|
11
13
|
untypedWindow.QrScanner = qrscanner_1.QrScanner;
|
|
12
14
|
untypedWindow.PushNotification = pushnotification_1.PushNotification;
|
|
13
15
|
class startiapp {
|
|
14
|
-
/** Call this method to initialize the starti.app API integration. */
|
|
16
|
+
/** Call this method to initialize the starti.app API integration. This method should be called AFTER all integrations are ready (see onIntegrationsAreReady). */
|
|
15
17
|
static initialize() {
|
|
16
18
|
if (app_1.App.isStartiappLoaded())
|
|
17
19
|
// @ts-ignore
|
|
@@ -25,3 +27,4 @@ startiapp.App = app_1.App;
|
|
|
25
27
|
startiapp.QrScanner = qrscanner_1.QrScanner;
|
|
26
28
|
/** Access to push notifications using Firebase. */
|
|
27
29
|
startiapp.PushNotification = pushnotification_1.PushNotification;
|
|
30
|
+
untypedWindow.startiapp = startiapp;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starti.app",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "starti.app",
|
|
3
|
+
"version": "1.0.14",
|
|
4
|
+
"description": "Use this package for easy communication with the starti.app API.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
"build:prod": "webpack --mode=production --node-env=production",
|
|
22
22
|
"watch": "webpack --watch"
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
package/umd/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0,t.App=((i=class{static setStartiappIsLoaded(){this.startiappIsLoaded=!0}static isStartiappLoaded(){return this.startiappIsLoaded}static setAppUrl(e){AppIntegration.setAppUrl(e)}static version(){return new Promise(((e,t)=>{this.resolveString=e,AppIntegration.version()}))}static appInForegroundEventRecievedEvent(){this.onAppInForeground&&this.onAppInForeground()}static versionResult(e){this.resolveString(e)}}).startiappIsLoaded=!1,i)},681:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0,t.PushNotification=class{static initialize(){return new Promise(((e,t)=>{this.resolveBoolean=e,PushNotificationIntegration.initialize()}))}static initializeResult(e){this.resolveBoolean(e)}static getLastPublishedToken(){return new Promise(((e,t)=>{this.resolveString=e,PushNotificationIntegration.getLastPublishedToken()}))}static getLastPublishedTokenResult(e){this.resolveString(e)}static tokenReceivedEvent(e){this.onTokenReceived&&this.onTokenReceived(e)}static notificationReceivedEvent(e){this.onNotificationReceived&&this.onNotificationReceived(e)}}},952:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0,t.QrScanner=class{static scan(){return new Promise(((e,t)=>{this.resolve=e;try{const t=window.QrScannerIntegration;if(!t)return void e("Scanner virker kun i starti.app");t.startQrCodeScanner()}catch(e){t(e)}}))}static qrResultRecievedEvent(e){this.resolve(e)}}}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0,t.App=((i=class{static setStartiappIsLoaded(){this.startiappIsLoaded=!0}static isStartiappLoaded(){return this.startiappIsLoaded}static setAppUrl(e){AppIntegration.setAppUrl(e)}static version(){return new Promise(((e,t)=>{this.resolveString=e,AppIntegration.version()}))}static appInForegroundEventRecievedEvent(){this.onAppInForeground&&this.onAppInForeground()}static versionResult(e){this.resolveString(e)}}).startiappIsLoaded=!1,i)},681:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0,t.PushNotification=class{static initialize(){return new Promise(((e,t)=>{this.resolveBoolean=e,PushNotificationIntegration.initialize()}))}static initializeResult(e){this.resolveBoolean(e)}static getLastPublishedToken(){return new Promise(((e,t)=>{this.resolveString=e,PushNotificationIntegration.getLastPublishedToken()}))}static getLastPublishedTokenResult(e){this.resolveString(e)}static tokenReceivedEvent(e){this.onTokenReceived&&this.onTokenReceived(e)}static notificationReceivedEvent(e){this.onNotificationReceived&&this.onNotificationReceived(e)}}},952:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0,t.QrScanner=class{static scan(){return new Promise(((e,t)=>{this.resolve=e;try{const t=window.QrScannerIntegration;if(!t)return void e("Scanner virker kun i starti.app");t.startQrCodeScanner()}catch(e){t(e)}}))}static qrResultRecievedEvent(e){this.resolve(e)}}}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=i(752),o=i(681),r=i(952),s=window;s.appIntegrationsAreReady=()=>{t.App.setStartiappIsLoaded(),a.onIntegrationsAreReady&&a.onIntegrationsAreReady()},s.App=t.App,s.QrScanner=r.QrScanner,s.PushNotification=o.PushNotification;class a{static initialize(){t.App.isStartiappLoaded()&&AppIntegration.webAppIsReady()}}e.default=a,a.App=t.App,a.QrScanner=r.QrScanner,a.PushNotification=o.PushNotification,s.startiapp=a})(),n})()));
|