update apple store order status

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2020-12-15 10:30:28 +01:00
parent 9a87e42437
commit 3724cc7fe7
No known key found for this signature in database
GPG key ID: 69DE3C3C097DB7F7

View file

@ -1,7 +1,7 @@
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: shopping-cart;
// Version 1.1.3
// Version 1.1.4
const cacheMinutes = 60 * 2
const today = new Date()
@ -10,16 +10,19 @@ const h = 5
const debug = false
if (config.widgetFamily === 'small') {
width = 100
width = 200
} else {
width = 300
width = 400
}
////////////////////////////////////////////////////////////
let widgetInputRAW = args.widgetParameter;
let widgetInput;
if (widgetInputRAW !== null) {
widgetInput = widgetInputRAW.toString().trim().split(';')
widgetInput = widgetInputRAW.toString().trim().split(';').map(v => v.trim())
if (!/^[A-Za-z][0-9]+/.test(widgetInput[0])) {
throw new Error('Invalid ordernumber format: "' + widgetInput[0] + '"')
}
if (widgetInput[2] && !/^[\d]+$/.test(widgetInput[2])) {
throw new Error('Third parameter has to be a number')
}