-
Notifications
You must be signed in to change notification settings - Fork 19
/
Fantastical.js
42 lines (33 loc) · 1.01 KB
/
Fantastical.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
^https:\/\/api\.flexibits\.com\/v1\/(auth|account)\/(device|details|appstore-receipt)\/$ url script-response-body fantastical.js
hostname=api.flexibits.com
*/
let url=$request.url;
let obj=JSON.parse($response.body);
if(url.indexOf('device')!=-1){
obj.status="success";
obj.subscription={
"autorenew": true,
"expiration": "2099-12-31T16:49:37Z",
"expires": "2099-12-31T16:49:37Z"
};
obj.scope=["notify", "weather", "keyvalue-watch", "keyvalue-verification", "schedjoules", "scheduling", "account", "keyvalue", "fantastical"];
}
if(url.indexOf('details')!=-1){
obj.subscription={
"autorenew": true,
"expiration": "2099-12-31T16:49:37.000000Z",
"uuid": "f1da7c78-e964-4367-915c-886edc794959",
"subscription_type": "AppStore",
"is_expired": false,
"trial": false
};
}
if(url.indexOf('appstore-receipt')!=-1){
obj.autorenew=true;
obj.expiration="2099-12-31T16:49:37.000000Z";
obj.subscription_type="AppStore";
obj.is_expired=false;
obj.trial=false;
}
$done({body:JSON.stringify(obj)});