@chrome-stats/app-pass-sdk 1.0.6 → 2.0.0
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 +6 -6
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# App Pass SDK
|
|
2
2
|
|
|
3
|
-
This SDK facilitates integration with
|
|
3
|
+
This SDK facilitates integration with App Pass for Chrome Extensions.
|
|
4
4
|
It provides methods to check App Pass status and activate App Pass.
|
|
5
|
-
For more information, see https://
|
|
5
|
+
For more information, see https://joinapppass.com/.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -60,9 +60,9 @@ if (response.status === 'ok' && response.appPassToken) {
|
|
|
60
60
|
}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
2. **Verify Token**: On your server, make a GET request to the
|
|
63
|
+
2. **Verify Token**: On your server, make a GET request to the App Pass API to validate the token.
|
|
64
64
|
|
|
65
|
-
- **Endpoint**: `https://
|
|
65
|
+
- **Endpoint**: `https://joinapppass.com/api/check-app-pass`
|
|
66
66
|
- **Method**: `GET`
|
|
67
67
|
- **Headers**:
|
|
68
68
|
- `app-pass-token`: The token received from the client.
|
|
@@ -70,7 +70,7 @@ if (response.status === 'ok' && response.appPassToken) {
|
|
|
70
70
|
**Example (Node.js/fetch)**:
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
const response = await fetch('https://
|
|
73
|
+
const response = await fetch('https://joinapppass.com/api/check-app-pass', {
|
|
74
74
|
method: 'GET',
|
|
75
75
|
headers: {
|
|
76
76
|
'app-pass-token': receivedAppPassToken
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
manageAppPass: () => manageAppPass
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
|
-
var urlBase = "https://
|
|
28
|
+
var urlBase = "https://joinapppass.com";
|
|
29
29
|
async function checkStatus() {
|
|
30
30
|
const maxAttempts = 3;
|
|
31
31
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
@@ -73,13 +73,13 @@ async function checkAppPass() {
|
|
|
73
73
|
async function activateAppPass() {
|
|
74
74
|
const res = await checkStatus();
|
|
75
75
|
await chrome.tabs.create({
|
|
76
|
-
url: `${urlBase}/
|
|
76
|
+
url: `${urlBase}/add/${encodeURIComponent(chrome.runtime.id)}`
|
|
77
77
|
});
|
|
78
78
|
return res;
|
|
79
79
|
}
|
|
80
80
|
async function manageAppPass() {
|
|
81
81
|
await chrome.tabs.create({
|
|
82
|
-
url: `${urlBase}/
|
|
82
|
+
url: `${urlBase}/mypass`
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var urlBase = "https://
|
|
2
|
+
var urlBase = "https://joinapppass.com";
|
|
3
3
|
async function checkStatus() {
|
|
4
4
|
const maxAttempts = 3;
|
|
5
5
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
@@ -47,13 +47,13 @@ async function checkAppPass() {
|
|
|
47
47
|
async function activateAppPass() {
|
|
48
48
|
const res = await checkStatus();
|
|
49
49
|
await chrome.tabs.create({
|
|
50
|
-
url: `${urlBase}/
|
|
50
|
+
url: `${urlBase}/add/${encodeURIComponent(chrome.runtime.id)}`
|
|
51
51
|
});
|
|
52
52
|
return res;
|
|
53
53
|
}
|
|
54
54
|
async function manageAppPass() {
|
|
55
55
|
await chrome.tabs.create({
|
|
56
|
-
url: `${urlBase}/
|
|
56
|
+
url: `${urlBase}/mypass`
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrome-stats/app-pass-sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "SDK for
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "SDK for App Pass integration",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|