fix: JSON url, iterate non_subscriptions, do not define $request and $response
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const storageKeyName = "rc_rewrite_ddata";
|
const storageKeyName = "rc_rewrite_data";
|
||||||
const jobTitle = "update_rc";
|
const jobTitle = "update_rc";
|
||||||
const notificationTitle = "Update RevenueCat JSON"
|
const notificationTitle = "Update RevenueCat JSON"
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ let URL = "";
|
|||||||
// URL = "https://stackoverflow.com/questions/38708550/difference-between-return-await-promise-and-return-promise"
|
// URL = "https://stackoverflow.com/questions/38708550/difference-between-return-await-promise-and-return-promise"
|
||||||
// URL = "http://localhost:8000/rc_rewrite_data.json";
|
// URL = "http://localhost:8000/rc_rewrite_data.json";
|
||||||
// URL = "https://api.jsonbin.io/v3/qs/651be8b30574da7622b3b246";
|
// URL = "https://api.jsonbin.io/v3/qs/651be8b30574da7622b3b246";
|
||||||
URL = "https://git.ykz.app/PorridgePi/json/raw/branch/main/rc_rewrite_data.json";
|
URL = "https://git.ykz.app/PorridgePi/qx/raw/branch/main/rc_rewrite_data.json";
|
||||||
// URL = "https://porridgepi.github.io/json/rc_rewrite_data.json"
|
// URL = "https://porridgepi.github.io/json/rc_rewrite_data.json"
|
||||||
|
|
||||||
requestOpts = {
|
requestOpts = {
|
||||||
@@ -205,7 +205,7 @@ async function onResponse(context, url, request, response) {
|
|||||||
"purchase_date": "2020-01-01T00:00:00Z"
|
"purchase_date": "2020-01-01T00:00:00Z"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const i of rewriteItem.new_other_purchases) {
|
for (const i of rewriteItem.new_non_subscriptions) {
|
||||||
body.subscriber.other_purchases[i] = {
|
body.subscriber.other_purchases[i] = {
|
||||||
purchase_date: "2020-01-01T00:00:00Z"
|
purchase_date: "2020-01-01T00:00:00Z"
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ async function onResponse(context, url, request, response) {
|
|||||||
response.statusCode = 200;
|
response.statusCode = 200;
|
||||||
response.statusPhrase = "OK";
|
response.statusPhrase = "OK";
|
||||||
response.headers["Content-Type"] = "application/json";
|
response.headers["Content-Type"] = "application/json";
|
||||||
console.log(response.body);
|
console.log(JSON.stringify(response.body));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,9 +233,6 @@ async function onResponse(context, url, request, response) {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var $request, $response;
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log("Starting...");
|
console.log("Starting...");
|
||||||
if (isSurge || isQuanX) {
|
if (isSurge || isQuanX) {
|
||||||
|
|||||||
Reference in New Issue
Block a user