mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad458be961 |
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
build
|
||||||
|
scripts
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: [
|
||||||
|
'@typescript-eslint',
|
||||||
|
],
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
node: true
|
||||||
|
}
|
||||||
|
};
|
||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
FROM node:24-alpine
|
FROM node:16-alpine
|
||||||
|
|
||||||
# Create app directories
|
# Create app directories
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
COPY package.json package-lock.json tsconfig.json eslint.config.mjs Readme.md /usr/src/app/
|
COPY package.json package-lock.json tsconfig.json .eslintignore .eslintrc.js Readme.md /usr/src/app/
|
||||||
COPY src/ /usr/src/app/src/
|
COPY src/ /usr/src/app/src/
|
||||||
COPY scripts/ /usr/src/app/scripts/
|
COPY scripts/ /usr/src/app/scripts/
|
||||||
COPY other/ /usr/src/app/other/
|
COPY other/ /usr/src/app/other/
|
||||||
|
|||||||
+1
-6
@@ -96,14 +96,10 @@ Use this to unlock all features for one user for a specified duration.
|
|||||||
|
|
||||||
### request
|
### request
|
||||||
|
|
||||||
request properties: ``purchaseToken``, ``purchaseId`` and ``dryRun``
|
request properties: ``purchaseToken`` and ``purchaseId``
|
||||||
|
|
||||||
- ``purchasetoken`` is a string which the client shows at the purchase screen
|
- ``purchasetoken`` is a string which the client shows at the purchase screen
|
||||||
- ``purchaseId`` is the ID that is used at the bill
|
- ``purchaseId`` is the ID that is used at the bill
|
||||||
- ``dryRun`` is a boolean
|
|
||||||
- setting true will skip the actual unlocking
|
|
||||||
- false will add a four week tolerance to the token expiry to permit checking now and unlocking later
|
|
||||||
- ``type`` is a string and must be ``year``, ``month`` or ``unpaid14``
|
|
||||||
|
|
||||||
### response
|
### response
|
||||||
|
|
||||||
@@ -124,7 +120,6 @@ The response contains the following properties:
|
|||||||
- optional object
|
- optional object
|
||||||
- should be shown to the support
|
- should be shown to the support
|
||||||
- ``wasAlreadyExecuted`` (boolean, set if and only if ``ok`` is true)
|
- ``wasAlreadyExecuted`` (boolean, set if and only if ``ok`` is true)
|
||||||
- ``mail`` (string, set if and only if ``ok`` is true)
|
|
||||||
|
|
||||||
If the request was malformed: HTTP status code 400 Bad Request
|
If the request was malformed: HTTP status code 400 Bad Request
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,6 @@ If a whitelist was configured and the mail address is not within it: ``{"mailAdd
|
|||||||
|
|
||||||
If a blacklist was configured and the mail server is within it: ``{"mailServerBlacklisted": true}``
|
If a blacklist was configured and the mail server is within it: ``{"mailServerBlacklisted": true}``
|
||||||
|
|
||||||
If a temporarily blacklist was configured and the mail server is within it (used in case of known mail delivery issues): ``{"mailServerBlacklistedTemporarily": true}``
|
|
||||||
|
|
||||||
If the client is suspicious: ``{"blockedForIntegrityReasons": true}``
|
|
||||||
|
|
||||||
On success: a object with a ``mailLoginToken`` of the type string
|
On success: a object with a ``mailLoginToken`` of the type string
|
||||||
|
|
||||||
#### example response
|
#### example response
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ Use this before a purchase to check if a purchase is possible.
|
|||||||
|
|
||||||
see [this JSON schema](../schema/candopurchaserequest.md)
|
see [this JSON schema](../schema/candopurchaserequest.md)
|
||||||
|
|
||||||
Note that ``type`` is not used at all.
|
|
||||||
|
|
||||||
### response
|
### response
|
||||||
|
|
||||||
On a invalid request body: HTTP status code 400 Bad request
|
On a invalid request body: HTTP status code 400 Bad request
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": [
|
"required": [
|
||||||
"deviceAuthToken"
|
"deviceAuthToken",
|
||||||
|
"type"
|
||||||
],
|
],
|
||||||
"definitions": {},
|
"definitions": {},
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
|
|||||||
+57
-5
@@ -130,8 +130,6 @@
|
|||||||
|
|
||||||
* [SerializedMarkTaskPendingAction](./serializedapplogicaction-definitions-serializedmarktaskpendingaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedMarkTaskPendingAction`
|
* [SerializedMarkTaskPendingAction](./serializedapplogicaction-definitions-serializedmarktaskpendingaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedMarkTaskPendingAction`
|
||||||
|
|
||||||
* [SerializedPingAction](./serializedapplogicaction-definitions-serializedpingaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction`
|
|
||||||
|
|
||||||
* [SerializedRemoveCategoryAppsAction](./serializedparentaction-definitions-serializedremovecategoryappsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction`
|
* [SerializedRemoveCategoryAppsAction](./serializedparentaction-definitions-serializedremovecategoryappsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction`
|
||||||
|
|
||||||
* [SerializedRemoveInstalledAppsAction](./serializedapplogicaction-definitions-serializedremoveinstalledappsaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction`
|
* [SerializedRemoveInstalledAppsAction](./serializedapplogicaction-definitions-serializedremoveinstalledappsaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction`
|
||||||
@@ -240,8 +238,6 @@
|
|||||||
|
|
||||||
* [ServerKeyResponse](./serverdatastatus-definitions-serverkeyresponse.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerKeyResponse`
|
* [ServerKeyResponse](./serverdatastatus-definitions-serverkeyresponse.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerKeyResponse`
|
||||||
|
|
||||||
* [ServerPing](./serverdatastatus-definitions-serverping.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerPing`
|
|
||||||
|
|
||||||
* [ServerSessionDurationItem](./serverdatastatus-definitions-serversessiondurationitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerSessionDurationItem`
|
* [ServerSessionDurationItem](./serverdatastatus-definitions-serversessiondurationitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerSessionDurationItem`
|
||||||
|
|
||||||
* [ServerTimeLimitRule](./serverdatastatus-definitions-servertimelimitrule.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerTimeLimitRule`
|
* [ServerTimeLimitRule](./serverdatastatus-definitions-servertimelimitrule.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerTimeLimitRule`
|
||||||
@@ -274,6 +270,14 @@
|
|||||||
|
|
||||||
* [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-devicesdetail.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/devicesDetail`
|
* [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-devicesdetail.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/devicesDetail`
|
||||||
|
|
||||||
|
* [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-apps.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/apps`
|
||||||
|
|
||||||
|
* [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-categories.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/categories`
|
||||||
|
|
||||||
|
* [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-devicesdetail.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/devicesDetail`
|
||||||
|
|
||||||
|
* [Untitled object in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items`
|
||||||
|
|
||||||
* [Untitled object in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items`
|
* [Untitled object in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items`
|
||||||
|
|
||||||
### Arrays
|
### Arrays
|
||||||
@@ -302,6 +306,32 @@
|
|||||||
|
|
||||||
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded`
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddinstalledappsaction-properties-apps.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddInstalledAppsAction/properties/apps`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items-properties-as.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items/properties/as`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items-properties-as-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items/properties/as/items`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items-properties-sdl.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items/properties/sdl`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items-properties-sdl-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items/properties/sdl/items`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedremoveinstalledappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction/properties/packageNames`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-removed.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/removed`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-removed-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/removed/items`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedaddcategoryappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddCategoryAppsAction/properties/packageNames`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedremovecategoryappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction/properties/packageNames`
|
||||||
|
|
||||||
|
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedupdatecategorysortingaction-properties-categoryids.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategorySortingAction/properties/categoryIds`
|
||||||
|
|
||||||
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedaddcategoryappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddCategoryAppsAction/properties/packageNames`
|
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedaddcategoryappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddCategoryAppsAction/properties/packageNames`
|
||||||
|
|
||||||
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedremovecategoryappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction/properties/packageNames`
|
* [Untitled array in SerializedParentAction](./serializedparentaction-definitions-serializedremovecategoryappsaction-properties-packagenames.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction/properties/packageNames`
|
||||||
@@ -350,7 +380,29 @@
|
|||||||
|
|
||||||
* [Untitled array in ServerDataStatus](./serverdatastatus-properties-kr.md) – `https://timelimit.io/ServerDataStatus#/properties/kr`
|
* [Untitled array in ServerDataStatus](./serverdatastatus-properties-kr.md) – `https://timelimit.io/ServerDataStatus#/properties/kr`
|
||||||
|
|
||||||
* [Untitled array in ServerDataStatus](./serverdatastatus-properties-pings.md) – `https://timelimit.io/ServerDataStatus#/properties/pings`
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-u2fdata-properties-d.md) – `https://timelimit.io/ServerDataStatus#/definitions/U2fData/properties/d`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverdevicelist-properties-data.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceList/properties/data`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverinstalledappsdata-properties-apps.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/apps`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverinstalledappsdata-properties-activities.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/activities`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedcategorybasedata-properties-atw.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/atw`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedcategoryassignedapps-properties-apps.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryAssignedApps/properties/apps`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedcategoryusedtimes-properties-times.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes/properties/times`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedcategoryusedtimes-properties-sessiondurations.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes/properties/sessionDurations`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedtimelimitrules-properties-rules.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedTimeLimitRules/properties/rules`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serverupdatedcategorytasks-properties-tasks.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryTasks/properties/tasks`
|
||||||
|
|
||||||
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-serveruserlist-properties-data.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUserList/properties/data`
|
||||||
|
|
||||||
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-u2fdata-properties-d.md) – `https://timelimit.io/ServerDataStatus#/definitions/U2fData/properties/d`
|
* [Untitled array in ServerDataStatus](./serverdatastatus-definitions-u2fdata-properties-d.md) – `https://timelimit.io/ServerDataStatus#/definitions/U2fData/properties/d`
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/definitions/SerializedMarkTaskPendingAction"
|
"$ref": "#/definitions/SerializedMarkTaskPendingAction"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$ref": "#/definitions/SerializedPingAction"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/SerializedUpdateInstalledAppsAction"
|
"$ref": "#/definitions/SerializedUpdateInstalledAppsAction"
|
||||||
},
|
},
|
||||||
@@ -312,43 +309,6 @@
|
|||||||
],
|
],
|
||||||
"title": "SerializedMarkTaskPendingAction"
|
"title": "SerializedMarkTaskPendingAction"
|
||||||
},
|
},
|
||||||
"SerializedPingAction": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"PING"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"deviceId": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"event": {
|
|
||||||
"$ref": "#/definitions/PingEvent"
|
|
||||||
},
|
|
||||||
"token": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"deviceId",
|
|
||||||
"event",
|
|
||||||
"token",
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
"title": "SerializedPingAction"
|
|
||||||
},
|
|
||||||
"PingEvent": {
|
|
||||||
"enum": [
|
|
||||||
"clear",
|
|
||||||
"ping",
|
|
||||||
"pong"
|
|
||||||
],
|
|
||||||
"type": "string",
|
|
||||||
"title": "PingEvent"
|
|
||||||
},
|
|
||||||
"SerializedUpdateInstalledAppsAction": {
|
"SerializedUpdateInstalledAppsAction": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -410,9 +410,6 @@
|
|||||||
},
|
},
|
||||||
"perDay": {
|
"perDay": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
|
||||||
"e": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
@@ -1461,9 +1458,6 @@
|
|||||||
},
|
},
|
||||||
"perDay": {
|
"perDay": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
|
||||||
"e": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|||||||
@@ -67,12 +67,6 @@
|
|||||||
"$ref": "#/definitions/ServerKeyResponse"
|
"$ref": "#/definitions/ServerKeyResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pings": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/ServerPing"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dh": {
|
"dh": {
|
||||||
"$ref": "#/definitions/ServerDhKey"
|
"$ref": "#/definitions/ServerDhKey"
|
||||||
},
|
},
|
||||||
@@ -933,31 +927,6 @@
|
|||||||
],
|
],
|
||||||
"title": "ServerKeyResponse"
|
"title": "ServerKeyResponse"
|
||||||
},
|
},
|
||||||
"ServerPing": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"deviceId": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"token": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"enum": [
|
|
||||||
"ping",
|
|
||||||
"pong"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"deviceId",
|
|
||||||
"token",
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
"title": "ServerPing"
|
|
||||||
},
|
|
||||||
"ServerDhKey": {
|
"ServerDhKey": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ https://timelimit.io/CanDoPurchaseRequest
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :---------------------------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :---------------------------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type) | `string` | Optional | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-type.md "https://timelimit.io/CanDoPurchaseRequest#/properties/type") |
|
| [type](#type) | `string` | Required | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-type.md "https://timelimit.io/CanDoPurchaseRequest#/properties/type") |
|
||||||
| [deviceAuthToken](#deviceauthtoken) | `string` | Required | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-deviceauthtoken.md "https://timelimit.io/CanDoPurchaseRequest#/properties/deviceAuthToken") |
|
| [deviceAuthToken](#deviceauthtoken) | `string` | Required | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-deviceauthtoken.md "https://timelimit.io/CanDoPurchaseRequest#/properties/deviceAuthToken") |
|
||||||
|
|
||||||
## type
|
## type
|
||||||
@@ -27,7 +27,7 @@ https://timelimit.io/CanDoPurchaseRequest
|
|||||||
|
|
||||||
`type`
|
`type`
|
||||||
|
|
||||||
* is optional
|
* is required
|
||||||
|
|
||||||
* Type: `string`
|
* Type: `string`
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
# PingEvent Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedAppLogicAction#/definitions/PingEvent
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## PingEvent Type
|
|
||||||
|
|
||||||
`string` ([PingEvent](serializedapplogicaction-definitions-pingevent.md))
|
|
||||||
|
|
||||||
## PingEvent Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :-------- | :---------- |
|
|
||||||
| `"clear"` | |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
# Untitled string in SerializedAppLogicAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/deviceId
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## deviceId Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
# PingEvent Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/event
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## event Type
|
|
||||||
|
|
||||||
`string` ([PingEvent](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md))
|
|
||||||
|
|
||||||
## event Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :-------- | :---------- |
|
|
||||||
| `"clear"` | |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
# Untitled string in SerializedAppLogicAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/token
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## token Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
# Untitled string in SerializedAppLogicAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/type
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## type Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## type Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :------- | :---------- |
|
|
||||||
| `"PING"` | |
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
# SerializedPingAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
|
||||||
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## SerializedPingAction Type
|
|
||||||
|
|
||||||
`object` ([SerializedPingAction](serializedapplogicaction-definitions-serializedpingaction.md))
|
|
||||||
|
|
||||||
# SerializedPingAction Properties
|
|
||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
|
||||||
| :-------------------- | :------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| [type](#type) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/type") |
|
|
||||||
| [deviceId](#deviceid) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-deviceid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/deviceId") |
|
|
||||||
| [event](#event) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/event") |
|
|
||||||
| [token](#token) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-token.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/token") |
|
|
||||||
|
|
||||||
## type
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`type`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/type")
|
|
||||||
|
|
||||||
### type Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
### type Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :------- | :---------- |
|
|
||||||
| `"PING"` | |
|
|
||||||
|
|
||||||
## deviceId
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`deviceId`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-deviceid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/deviceId")
|
|
||||||
|
|
||||||
### deviceId Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## event
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`event`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string` ([PingEvent](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md))
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/event")
|
|
||||||
|
|
||||||
### event Type
|
|
||||||
|
|
||||||
`string` ([PingEvent](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md))
|
|
||||||
|
|
||||||
### event Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :-------- | :---------- |
|
|
||||||
| `"clear"` | |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
|
|
||||||
## token
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`token`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-token.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/token")
|
|
||||||
|
|
||||||
### token Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
@@ -30,8 +30,6 @@ any of
|
|||||||
|
|
||||||
* [SerializedMarkTaskPendingAction](serializedapplogicaction-definitions-serializedmarktaskpendingaction.md "check type definition")
|
* [SerializedMarkTaskPendingAction](serializedapplogicaction-definitions-serializedmarktaskpendingaction.md "check type definition")
|
||||||
|
|
||||||
* [SerializedPingAction](serializedapplogicaction-definitions-serializedpingaction.md "check type definition")
|
|
||||||
|
|
||||||
* [SerializedUpdateInstalledAppsAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction.md "check type definition")
|
* [SerializedUpdateInstalledAppsAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction.md "check type definition")
|
||||||
|
|
||||||
* [SerializedRemoveInstalledAppsAction](serializedapplogicaction-definitions-serializedremoveinstalledappsaction.md "check type definition")
|
* [SerializedRemoveInstalledAppsAction](serializedapplogicaction-definitions-serializedremoveinstalledappsaction.md "check type definition")
|
||||||
@@ -690,122 +688,6 @@ Reference this group by using
|
|||||||
|
|
||||||
`string`
|
`string`
|
||||||
|
|
||||||
## Definitions group SerializedPingAction
|
|
||||||
|
|
||||||
Reference this group by using
|
|
||||||
|
|
||||||
```json
|
|
||||||
{"$ref":"https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction"}
|
|
||||||
```
|
|
||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
|
||||||
| :-------------------- | :------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| [type](#type-7) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/type") |
|
|
||||||
| [deviceId](#deviceid) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-deviceid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/deviceId") |
|
|
||||||
| [event](#event) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/event") |
|
|
||||||
| [token](#token) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-token.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/token") |
|
|
||||||
|
|
||||||
### type
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`type`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/type")
|
|
||||||
|
|
||||||
#### type Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
#### type Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :------- | :---------- |
|
|
||||||
| `"PING"` | |
|
|
||||||
|
|
||||||
### deviceId
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`deviceId`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-deviceid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/deviceId")
|
|
||||||
|
|
||||||
#### deviceId Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
### event
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`event`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string` ([PingEvent](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md))
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/event")
|
|
||||||
|
|
||||||
#### event Type
|
|
||||||
|
|
||||||
`string` ([PingEvent](serializedapplogicaction-definitions-serializedpingaction-properties-pingevent.md))
|
|
||||||
|
|
||||||
#### event Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :-------- | :---------- |
|
|
||||||
| `"clear"` | |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
|
|
||||||
### token
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`token`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedpingaction-properties-token.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedPingAction/properties/token")
|
|
||||||
|
|
||||||
#### token Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## Definitions group PingEvent
|
|
||||||
|
|
||||||
Reference this group by using
|
|
||||||
|
|
||||||
```json
|
|
||||||
{"$ref":"https://timelimit.io/SerializedAppLogicAction#/definitions/PingEvent"}
|
|
||||||
```
|
|
||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
|
||||||
| :------- | :--- | :------- | :------- | :--------- |
|
|
||||||
|
|
||||||
## Definitions group SerializedUpdateInstalledAppsAction
|
## Definitions group SerializedUpdateInstalledAppsAction
|
||||||
|
|
||||||
Reference this group by using
|
Reference this group by using
|
||||||
@@ -816,7 +698,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :-------------- | :-------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :-------------- | :-------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-8) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/type") |
|
| [type](#type-7) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/type") |
|
||||||
| [b](#b) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-b.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/b") |
|
| [b](#b) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-b.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/b") |
|
||||||
| [d](#d-1) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-d.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/d") |
|
| [d](#d-1) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-d.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/d") |
|
||||||
| [w](#w) | `boolean` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-w.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/w") |
|
| [w](#w) | `boolean` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateinstalledappsaction-properties-w.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateInstalledAppsAction/properties/w") |
|
||||||
@@ -911,7 +793,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :---------------------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :---------------------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-9) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedremoveinstalledappsaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction/properties/type") |
|
| [type](#type-8) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedremoveinstalledappsaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction/properties/type") |
|
||||||
| [packageNames](#packagenames) | `array` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedremoveinstalledappsaction-properties-packagenames.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction/properties/packageNames") |
|
| [packageNames](#packagenames) | `array` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedremoveinstalledappsaction-properties-packagenames.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction/properties/packageNames") |
|
||||||
|
|
||||||
### type
|
### type
|
||||||
@@ -968,9 +850,9 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :-------------------------- | :------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :-------------------------- | :------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-10) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/type") |
|
| [type](#type-9) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/type") |
|
||||||
| [dsn](#dsn-1) | `number` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-dsn.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/dsn") |
|
| [dsn](#dsn-1) | `number` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-dsn.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/dsn") |
|
||||||
| [deviceId](#deviceid-1) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-deviceid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/deviceId") |
|
| [deviceId](#deviceid) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-deviceid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/deviceId") |
|
||||||
| [categoryId](#categoryid-1) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-categoryid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/categoryId") |
|
| [categoryId](#categoryid-1) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-categoryid.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/categoryId") |
|
||||||
| [dataType](#datatype) | `number` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-datatype.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/dataType") |
|
| [dataType](#datatype) | `number` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-datatype.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/dataType") |
|
||||||
| [tempKey](#tempkey-1) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-tempkey.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/tempKey") |
|
| [tempKey](#tempkey-1) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsendkeyrequestaction-properties-tempkey.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSendKeyRequestAction/properties/tempKey") |
|
||||||
@@ -1120,7 +1002,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :--------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :--------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-11) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsignoutatdeviceaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSignOutAtDeviceAction/properties/type") |
|
| [type](#type-10) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedsignoutatdeviceaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSignOutAtDeviceAction/properties/type") |
|
||||||
|
|
||||||
### type
|
### type
|
||||||
|
|
||||||
@@ -1158,7 +1040,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :--------------- | :------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :--------------- | :------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-12) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serialiezdtrieddisablingdeviceadminaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerialiezdTriedDisablingDeviceAdminAction/properties/type") |
|
| [type](#type-11) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serialiezdtrieddisablingdeviceadminaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerialiezdTriedDisablingDeviceAdminAction/properties/type") |
|
||||||
|
|
||||||
### type
|
### type
|
||||||
|
|
||||||
@@ -1196,7 +1078,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :-------------------------------- | :------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :-------------------------------- | :------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-13) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/type") |
|
| [type](#type-12) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/type") |
|
||||||
| [removed](#removed) | `array` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-removed.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/removed") |
|
| [removed](#removed) | `array` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-removed.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/removed") |
|
||||||
| [updatedOrAdded](#updatedoradded) | `array` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded") |
|
| [updatedOrAdded](#updatedoradded) | `array` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded") |
|
||||||
|
|
||||||
@@ -1348,7 +1230,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :---------------------------------------------------------- | :-------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :---------------------------------------------------------- | :-------- | :------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-14) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/type") |
|
| [type](#type-13) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/type") |
|
||||||
| [protectionLevel](#protectionlevel) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-protectionlevel.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/protectionLevel") |
|
| [protectionLevel](#protectionlevel) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-protectionlevel.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/protectionLevel") |
|
||||||
| [usageStats](#usagestats) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-usagestats.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/usageStats") |
|
| [usageStats](#usagestats) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-usagestats.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/usageStats") |
|
||||||
| [notificationAccess](#notificationaccess) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-notificationaccess.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/notificationAccess") |
|
| [notificationAccess](#notificationaccess) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-notificationaccess.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/notificationAccess") |
|
||||||
@@ -1636,7 +1518,7 @@ Reference this group by using
|
|||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :--------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :--------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [type](#type-15) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializeduploaddevicepublickeyaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUploadDevicePublicKeyAction/properties/type") |
|
| [type](#type-14) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializeduploaddevicepublickeyaction-properties-type.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUploadDevicePublicKeyAction/properties/type") |
|
||||||
| [key](#key) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializeduploaddevicepublickeyaction-properties-key.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUploadDevicePublicKeyAction/properties/key") |
|
| [key](#key) | `string` | Required | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializeduploaddevicepublickeyaction-properties-key.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUploadDevicePublicKeyAction/properties/key") |
|
||||||
|
|
||||||
### type
|
### type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# EncryptableParentPassword Schema
|
# EncryptableParentPassword Schema
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
https://timelimit.io/SerializedParentAction#/definitions/EncryptableParentPassword
|
https://timelimit.io/SerializedParentAction#/definitions/SerializedSetChildPasswordAction/properties/newPassword
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@ https://timelimit.io/SerializedParentAction#/definitions/EncryptableParentPasswo
|
|||||||
| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------------------ |
|
| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------------------ |
|
||||||
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
||||||
|
|
||||||
## EncryptableParentPassword Type
|
## newPassword Type
|
||||||
|
|
||||||
`object` ([EncryptableParentPassword](serializedparentaction-definitions-encryptableparentpassword.md))
|
`object` ([EncryptableParentPassword](serializedparentaction-definitions-encryptableparentpassword.md))
|
||||||
|
|
||||||
# EncryptableParentPassword Properties
|
# newPassword Properties
|
||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
| Property | Type | Required | Nullable | Defined by |
|
||||||
| :------------------------ | :-------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :------------------------ | :-------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
|||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
# Untitled number in SerializedParentAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/e
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## e Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
@@ -28,7 +28,6 @@ https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule
|
|||||||
| [dur](#dur) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/dur") |
|
| [dur](#dur) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/dur") |
|
||||||
| [pause](#pause) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/pause") |
|
| [pause](#pause) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/pause") |
|
||||||
| [perDay](#perday) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/perDay") |
|
| [perDay](#perday) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/perDay") |
|
||||||
| [e](#e) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/e") |
|
|
||||||
|
|
||||||
## ruleId
|
## ruleId
|
||||||
|
|
||||||
@@ -209,21 +208,3 @@ https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule
|
|||||||
### perDay Type
|
### perDay Type
|
||||||
|
|
||||||
`boolean`
|
`boolean`
|
||||||
|
|
||||||
## e
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`e`
|
|
||||||
|
|
||||||
* is optional
|
|
||||||
|
|
||||||
* Type: `number`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/e")
|
|
||||||
|
|
||||||
### e Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
|
|||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
# Untitled number in SerializedParentAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/e
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## e Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
# Untitled number in SerializedParentAction Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/expiresAt
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## expiresAt Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
@@ -28,7 +28,6 @@ https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelim
|
|||||||
| [dur](#dur) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/dur") |
|
| [dur](#dur) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/dur") |
|
||||||
| [pause](#pause) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/pause") |
|
| [pause](#pause) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/pause") |
|
||||||
| [perDay](#perday) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/perDay") |
|
| [perDay](#perday) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/perDay") |
|
||||||
| [e](#e) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/e") |
|
|
||||||
|
|
||||||
## type
|
## type
|
||||||
|
|
||||||
@@ -217,21 +216,3 @@ https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelim
|
|||||||
### perDay Type
|
### perDay Type
|
||||||
|
|
||||||
`boolean`
|
`boolean`
|
||||||
|
|
||||||
## e
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`e`
|
|
||||||
|
|
||||||
* is optional
|
|
||||||
|
|
||||||
* Type: `number`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/e")
|
|
||||||
|
|
||||||
### e Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
|
|||||||
@@ -899,7 +899,6 @@ Reference this group by using
|
|||||||
| [dur](#dur) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/dur") |
|
| [dur](#dur) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/dur") |
|
||||||
| [pause](#pause) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/pause") |
|
| [pause](#pause) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/pause") |
|
||||||
| [perDay](#perday) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/perDay") |
|
| [perDay](#perday) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/perDay") |
|
||||||
| [e](#e) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/e") |
|
|
||||||
|
|
||||||
### ruleId
|
### ruleId
|
||||||
|
|
||||||
@@ -1081,24 +1080,6 @@ Reference this group by using
|
|||||||
|
|
||||||
`boolean`
|
`boolean`
|
||||||
|
|
||||||
### e
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`e`
|
|
||||||
|
|
||||||
* is optional
|
|
||||||
|
|
||||||
* Type: `number`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedParentAction](serializedparentaction-definitions-serializedtimelimitrule-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule/properties/e")
|
|
||||||
|
|
||||||
#### e Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
|
|
||||||
## Definitions group SerializedDeleteCategoryAction
|
## Definitions group SerializedDeleteCategoryAction
|
||||||
|
|
||||||
Reference this group by using
|
Reference this group by using
|
||||||
@@ -4416,7 +4397,6 @@ Reference this group by using
|
|||||||
| [dur](#dur-1) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/dur") |
|
| [dur](#dur-1) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-dur.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/dur") |
|
||||||
| [pause](#pause-1) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/pause") |
|
| [pause](#pause-1) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-pause.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/pause") |
|
||||||
| [perDay](#perday-1) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/perDay") |
|
| [perDay](#perday-1) | `boolean` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-perday.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/perDay") |
|
||||||
| [e](#e-1) | `number` | Optional | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/e") |
|
|
||||||
|
|
||||||
### type
|
### type
|
||||||
|
|
||||||
@@ -4606,24 +4586,6 @@ Reference this group by using
|
|||||||
|
|
||||||
`boolean`
|
`boolean`
|
||||||
|
|
||||||
### e
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`e`
|
|
||||||
|
|
||||||
* is optional
|
|
||||||
|
|
||||||
* Type: `number`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatetimelimitruleaction-properties-e.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction/properties/e")
|
|
||||||
|
|
||||||
#### e Type
|
|
||||||
|
|
||||||
`number`
|
|
||||||
|
|
||||||
## Definitions group SerializedUpdateUserFlagsAction
|
## Definitions group SerializedUpdateUserFlagsAction
|
||||||
|
|
||||||
Reference this group by using
|
Reference this group by using
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# Untitled string in ServerDataStatus Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/deviceId
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## deviceId Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# Untitled string in ServerDataStatus Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/token
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## token Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
# Untitled string in ServerDataStatus Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/type
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## type Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## type Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :------- | :---------- |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
# ServerPing Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/ServerDataStatus#/definitions/ServerPing
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## ServerPing Type
|
|
||||||
|
|
||||||
`object` ([ServerPing](serverdatastatus-definitions-serverping.md))
|
|
||||||
|
|
||||||
# ServerPing Properties
|
|
||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
|
||||||
| :-------------------- | :------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| [deviceId](#deviceid) | `string` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverping-properties-deviceid.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/deviceId") |
|
|
||||||
| [token](#token) | `string` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverping-properties-token.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/token") |
|
|
||||||
| [type](#type) | `string` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverping-properties-type.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/type") |
|
|
||||||
|
|
||||||
## deviceId
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`deviceId`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverping-properties-deviceid.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/deviceId")
|
|
||||||
|
|
||||||
### deviceId Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## token
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`token`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverping-properties-token.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/token")
|
|
||||||
|
|
||||||
### token Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## type
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`type`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverping-properties-type.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/type")
|
|
||||||
|
|
||||||
### type Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
### type Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :------- | :---------- |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# Untitled array in ServerDataStatus Schema
|
|
||||||
|
|
||||||
```txt
|
|
||||||
https://timelimit.io/ServerDataStatus#/properties/pings
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
|
||||||
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
|
||||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
|
||||||
|
|
||||||
## pings Type
|
|
||||||
|
|
||||||
`object[]` ([ServerPing](serverdatastatus-definitions-serverping.md))
|
|
||||||
@@ -30,7 +30,6 @@ https://timelimit.io/ServerDataStatus
|
|||||||
| [users](#users) | `object` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serveruserlist.md "https://timelimit.io/ServerDataStatus#/properties/users") |
|
| [users](#users) | `object` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serveruserlist.md "https://timelimit.io/ServerDataStatus#/properties/users") |
|
||||||
| [krq](#krq) | `array` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-properties-krq.md "https://timelimit.io/ServerDataStatus#/properties/krq") |
|
| [krq](#krq) | `array` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-properties-krq.md "https://timelimit.io/ServerDataStatus#/properties/krq") |
|
||||||
| [kr](#kr) | `array` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-properties-kr.md "https://timelimit.io/ServerDataStatus#/properties/kr") |
|
| [kr](#kr) | `array` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-properties-kr.md "https://timelimit.io/ServerDataStatus#/properties/kr") |
|
||||||
| [pings](#pings) | `array` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-properties-pings.md "https://timelimit.io/ServerDataStatus#/properties/pings") |
|
|
||||||
| [dh](#dh) | `object` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdhkey.md "https://timelimit.io/ServerDataStatus#/properties/dh") |
|
| [dh](#dh) | `object` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdhkey.md "https://timelimit.io/ServerDataStatus#/properties/dh") |
|
||||||
| [u2f](#u2f) | `object` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-u2fdata.md "https://timelimit.io/ServerDataStatus#/properties/u2f") |
|
| [u2f](#u2f) | `object` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-u2fdata.md "https://timelimit.io/ServerDataStatus#/properties/u2f") |
|
||||||
| [fullVersion](#fullversion) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-properties-fullversion.md "https://timelimit.io/ServerDataStatus#/properties/fullVersion") |
|
| [fullVersion](#fullversion) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-properties-fullversion.md "https://timelimit.io/ServerDataStatus#/properties/fullVersion") |
|
||||||
@@ -253,24 +252,6 @@ https://timelimit.io/ServerDataStatus
|
|||||||
|
|
||||||
`object[]` ([ServerKeyResponse](serverdatastatus-definitions-serverkeyresponse.md))
|
`object[]` ([ServerKeyResponse](serverdatastatus-definitions-serverkeyresponse.md))
|
||||||
|
|
||||||
## pings
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`pings`
|
|
||||||
|
|
||||||
* is optional
|
|
||||||
|
|
||||||
* Type: `object[]` ([ServerPing](serverdatastatus-definitions-serverping.md))
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-properties-pings.md "https://timelimit.io/ServerDataStatus#/properties/pings")
|
|
||||||
|
|
||||||
### pings Type
|
|
||||||
|
|
||||||
`object[]` ([ServerPing](serverdatastatus-definitions-serverping.md))
|
|
||||||
|
|
||||||
## dh
|
## dh
|
||||||
|
|
||||||
|
|
||||||
@@ -3468,83 +3449,6 @@ Reference this group by using
|
|||||||
|
|
||||||
`string`
|
`string`
|
||||||
|
|
||||||
## Definitions group ServerPing
|
|
||||||
|
|
||||||
Reference this group by using
|
|
||||||
|
|
||||||
```json
|
|
||||||
{"$ref":"https://timelimit.io/ServerDataStatus#/definitions/ServerPing"}
|
|
||||||
```
|
|
||||||
|
|
||||||
| Property | Type | Required | Nullable | Defined by |
|
|
||||||
| :---------------------- | :------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| [deviceId](#deviceid-4) | `string` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverping-properties-deviceid.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/deviceId") |
|
|
||||||
| [token](#token) | `string` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverping-properties-token.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/token") |
|
|
||||||
| [type](#type-2) | `string` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverping-properties-type.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/type") |
|
|
||||||
|
|
||||||
### deviceId
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`deviceId`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverping-properties-deviceid.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/deviceId")
|
|
||||||
|
|
||||||
#### deviceId Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
### token
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`token`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverping-properties-token.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/token")
|
|
||||||
|
|
||||||
#### token Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
### type
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`type`
|
|
||||||
|
|
||||||
* is required
|
|
||||||
|
|
||||||
* Type: `string`
|
|
||||||
|
|
||||||
* cannot be null
|
|
||||||
|
|
||||||
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverping-properties-type.md "https://timelimit.io/ServerDataStatus#/definitions/ServerPing/properties/type")
|
|
||||||
|
|
||||||
#### type Type
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
#### type Constraints
|
|
||||||
|
|
||||||
**enum**: the value of this property must be equal to one of the following values:
|
|
||||||
|
|
||||||
| Value | Explanation |
|
|
||||||
| :------- | :---------- |
|
|
||||||
| `"ping"` | |
|
|
||||||
| `"pong"` | |
|
|
||||||
|
|
||||||
## Definitions group ServerDhKey
|
## Definitions group ServerDhKey
|
||||||
|
|
||||||
Reference this group by using
|
Reference this group by using
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
import eslint from '@eslint/js';
|
|
||||||
import { defineConfig } from 'eslint/config';
|
|
||||||
import tseslint from 'typescript-eslint';
|
|
||||||
|
|
||||||
export default defineConfig(
|
|
||||||
eslint.configs.recommended,
|
|
||||||
tseslint.configs.recommended,
|
|
||||||
{
|
|
||||||
ignores: ['build', 'scripts']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-unused-vars': ['warn', { caughtErrors: 'none' }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
Generated
+7688
-3693
File diff suppressed because it is too large
Load Diff
+15
-12
@@ -6,10 +6,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./build/index.js",
|
"start": "node ./build/index.js",
|
||||||
"test": "node scripts/test-launch-with-different-databases.js",
|
"test": "node scripts/test-launch-with-different-databases.js",
|
||||||
"lint": "eslint .",
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
||||||
"build": "npm run build:clean && npm run build:json && npm run build:ts && npm run lint && npm run build:doc",
|
"build": "npm run build:clean && npm run build:json && npm run build:ts && npm run lint && npm run build:doc",
|
||||||
"build:clean": "rm -rf build",
|
"build:clean": "rimraf build",
|
||||||
"build:json": "node ./scripts/build-schemas.js",
|
"build:json": "node ./scripts/build-schemas.js",
|
||||||
"build:ts": "tsc",
|
"build:ts": "tsc",
|
||||||
"build:doc": "npm run build:doc:json",
|
"build:doc": "npm run build:doc:json",
|
||||||
@@ -29,8 +29,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/timelimit.io/timelimit-server-2018#README",
|
"homepage": "https://gitlab.com/timelimit.io/timelimit-server-2018#README",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@adobe/jsonschema2md": "^8.0.8",
|
"@adobe/jsonschema2md": "^7.0.0",
|
||||||
"@eslint/js": "^10.0.1",
|
|
||||||
"@types/basic-auth": "^1.1.3",
|
"@types/basic-auth": "^1.1.3",
|
||||||
"@types/body-parser": "^1.19.0",
|
"@types/body-parser": "^1.19.0",
|
||||||
"@types/ejs": "^3.1.0",
|
"@types/ejs": "^3.1.0",
|
||||||
@@ -39,13 +38,16 @@
|
|||||||
"@types/lodash": "^4.14.166",
|
"@types/lodash": "^4.14.166",
|
||||||
"@types/node": "^16.11.59",
|
"@types/node": "^16.11.59",
|
||||||
"@types/nodemailer": "^6.4.4",
|
"@types/nodemailer": "^6.4.4",
|
||||||
"eslint": "^10.0.1",
|
"@types/umzug": "^2.3.0",
|
||||||
"typescript": "^5.5.4",
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
||||||
"typescript-eslint": "^8.56.0",
|
"@typescript-eslint/parser": "^5.10.0",
|
||||||
|
"eslint": "^8.7.0",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"typescript": "^4.4.4",
|
||||||
"typescript-json-schema": "^0.52.0"
|
"typescript-json-schema": "^0.52.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^8.18.0",
|
"ajv": "^7.0.2",
|
||||||
"basic-auth": "^2.0.1",
|
"basic-auth": "^2.0.1",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"ejs": "^3.1.5",
|
"ejs": "^3.1.5",
|
||||||
@@ -55,15 +57,16 @@
|
|||||||
"jose": "^4.9.3",
|
"jose": "^4.9.3",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mariadb": "^2.5.2",
|
"mariadb": "^2.5.2",
|
||||||
"nodemailer": "^8.0.4",
|
"nodemailer": "^6.7.2",
|
||||||
"pg": "^8.5.1",
|
"pg": "^8.5.1",
|
||||||
"pg-hstore": "^2.3.3",
|
"pg-hstore": "^2.3.3",
|
||||||
"rate-limiter-flexible": "^2.1.15",
|
"rate-limiter-flexible": "^2.1.15",
|
||||||
"sequelize": "^6.25.5",
|
"sequelize": "^6.25.5",
|
||||||
"socket.io": "^4.0.1",
|
"socket.io": "^4.0.1",
|
||||||
"umzug": "^3.8.1"
|
"sqlite3": "^4.0.0",
|
||||||
|
"umzug": "^2.3.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"sqlite3": "npm:@vscode/sqlite3@^5.1.12-vscode"
|
"sqlite3": "^5.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -58,9 +58,7 @@ const allTypes = [
|
|||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
required: true,
|
required: true,
|
||||||
noExtraProps: true,
|
noExtraProps: true
|
||||||
// otherwise it finds errors in dependencies that we don't care about
|
|
||||||
ignoreErrors: true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const compilerOptions = {
|
const compilerOptions = {
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ const { spawnAsync } = require('../process.js')
|
|||||||
const { sleep } = require('../sleep.js')
|
const { sleep } = require('../sleep.js')
|
||||||
|
|
||||||
async function startMariadb() {
|
async function startMariadb() {
|
||||||
const osUsername = require('os').userInfo().username
|
|
||||||
|
|
||||||
try { await mkdirAsync(tempDir) } catch (ex) {/* ignore */}
|
try { await mkdirAsync(tempDir) } catch (ex) {/* ignore */}
|
||||||
|
|
||||||
const instanceDir = resolve(tempDir, generateShortToken())
|
const instanceDir = resolve(tempDir, generateShortToken())
|
||||||
@@ -62,12 +60,12 @@ async function startMariadb() {
|
|||||||
|
|
||||||
for (command of commands) {
|
for (command of commands) {
|
||||||
console.log(command)
|
console.log(command)
|
||||||
await spawnAsync('mysql', ['-S', socketPath, '-u', osUsername, '-e', command], { stdio: 'inherit' })
|
await spawnAsync('mysql', ['-S', socketPath, '-u', 'root', '-e', command], { stdio: 'inherit' })
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shutdown: () => {
|
shutdown: () => {
|
||||||
spawnAsync('mysql', ['-S', socketPath, '-u', osUsername, '-e', 'SHUTDOWN;'], { stdio: 'inherit' }).catch((ex) => {
|
spawnAsync('mysql', ['-S', socketPath, '-u', 'root', '-e', 'SHUTDOWN;'], { stdio: 'inherit' }).catch((ex) => {
|
||||||
console.warn(ex)
|
console.warn(ex)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ async function startPostgres() {
|
|||||||
const password = generateToken() // this database accepts anything
|
const password = generateToken() // this database accepts anything
|
||||||
|
|
||||||
await spawnAsync('createuser', ['-h', socketDir, username], { stdio: 'inherit' })
|
await spawnAsync('createuser', ['-h', socketDir, username], { stdio: 'inherit' })
|
||||||
await spawnAsync('createdb', ['-h', socketDir, '--owner', username, database], { stdio: 'inherit' })
|
await spawnAsync('createdb', ['-h', socketDir, database], { stdio: 'inherit' })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shutdown: () => task.kill('SIGINT'),
|
shutdown: () => task.kill('SIGINT'),
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -78,7 +78,6 @@ export { UpdateTimelimitRuleAction } from './updatetimelimitrule'
|
|||||||
export { UpdateUserFlagsAction } from './updateuserflags'
|
export { UpdateUserFlagsAction } from './updateuserflags'
|
||||||
export { UpdateUserLimitLoginCategory } from './updateuserlimitlogincategory'
|
export { UpdateUserLimitLoginCategory } from './updateuserlimitlogincategory'
|
||||||
export { MarkTaskPendingAction } from './marktaskpendingaction'
|
export { MarkTaskPendingAction } from './marktaskpendingaction'
|
||||||
export { PingAction } from './ping'
|
|
||||||
export { DeleteChildTaskAction } from './deletechildtaskaction'
|
export { DeleteChildTaskAction } from './deletechildtaskaction'
|
||||||
export { UpdateChildTaskAction } from './updatechildtaskaction'
|
export { UpdateChildTaskAction } from './updatechildtaskaction'
|
||||||
export { ReviewChildTaskAction } from './reviewchildtaskaction'
|
export { ReviewChildTaskAction } from './reviewchildtaskaction'
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { AppLogicAction } from './basetypes'
|
|
||||||
import { assertIdWithinFamily } from './meta/util'
|
|
||||||
|
|
||||||
const actionType = 'PingAction'
|
|
||||||
|
|
||||||
export class PingAction extends AppLogicAction {
|
|
||||||
readonly deviceId: string
|
|
||||||
readonly event: PingEvent
|
|
||||||
readonly token: string
|
|
||||||
|
|
||||||
constructor ({ deviceId, event, token }: {
|
|
||||||
deviceId: string
|
|
||||||
event: PingEvent
|
|
||||||
token: string
|
|
||||||
}) {
|
|
||||||
super()
|
|
||||||
|
|
||||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
|
||||||
assertIdWithinFamily({ actionType, field: 'token', value: token })
|
|
||||||
|
|
||||||
this.deviceId = deviceId
|
|
||||||
this.event = event
|
|
||||||
this.token = token
|
|
||||||
}
|
|
||||||
|
|
||||||
static parse = ({ deviceId, event, token }: SerializedPingAction) => (
|
|
||||||
new PingAction({ deviceId, event, token })
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SerializedPingAction {
|
|
||||||
type: 'PING'
|
|
||||||
deviceId: string
|
|
||||||
event: PingEvent
|
|
||||||
token: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type PingEvent = 'ping' | 'pong' | 'clear'
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -24,7 +24,6 @@ import { ForceSyncAction, SerializedForceSyncAction } from '../forcesync'
|
|||||||
import { ReplyToKeyRequestAction, SerializedReplyToKeyRequestAction } from '../replytokeyrequest'
|
import { ReplyToKeyRequestAction, SerializedReplyToKeyRequestAction } from '../replytokeyrequest'
|
||||||
import { MarkTaskPendingAction, SerializedMarkTaskPendingAction } from '../marktaskpendingaction'
|
import { MarkTaskPendingAction, SerializedMarkTaskPendingAction } from '../marktaskpendingaction'
|
||||||
import { UnknownActionTypeException } from '../meta/exception'
|
import { UnknownActionTypeException } from '../meta/exception'
|
||||||
import { PingAction, SerializedPingAction } from '../ping'
|
|
||||||
import { UpdateInstalledAppsAction, SerializedUpdateInstalledAppsAction } from '../updateinstalledapps'
|
import { UpdateInstalledAppsAction, SerializedUpdateInstalledAppsAction } from '../updateinstalledapps'
|
||||||
import { RemoveInstalledAppsAction, SerializedRemoveInstalledAppsAction } from '../removeinstalledapps'
|
import { RemoveInstalledAppsAction, SerializedRemoveInstalledAppsAction } from '../removeinstalledapps'
|
||||||
import { SendKeyRequestAction, SerializedSendKeyRequestAction } from '../sendkeyrequest'
|
import { SendKeyRequestAction, SerializedSendKeyRequestAction } from '../sendkeyrequest'
|
||||||
@@ -42,7 +41,6 @@ export type SerializedAppLogicAction =
|
|||||||
SerializedForceSyncAction |
|
SerializedForceSyncAction |
|
||||||
SerializedReplyToKeyRequestAction |
|
SerializedReplyToKeyRequestAction |
|
||||||
SerializedMarkTaskPendingAction |
|
SerializedMarkTaskPendingAction |
|
||||||
SerializedPingAction |
|
|
||||||
SerializedUpdateInstalledAppsAction |
|
SerializedUpdateInstalledAppsAction |
|
||||||
SerializedRemoveInstalledAppsAction |
|
SerializedRemoveInstalledAppsAction |
|
||||||
SerializedSendKeyRequestAction |
|
SerializedSendKeyRequestAction |
|
||||||
@@ -67,8 +65,6 @@ export const parseAppLogicAction = (serialized: SerializedAppLogicAction): AppLo
|
|||||||
return ReplyToKeyRequestAction.parse(serialized)
|
return ReplyToKeyRequestAction.parse(serialized)
|
||||||
} else if (serialized.type === 'MARK_TASK_PENDING') {
|
} else if (serialized.type === 'MARK_TASK_PENDING') {
|
||||||
return MarkTaskPendingAction.parse(serialized)
|
return MarkTaskPendingAction.parse(serialized)
|
||||||
} else if (serialized.type === 'PING') {
|
|
||||||
return PingAction.parse(serialized)
|
|
||||||
} else if (serialized.type === 'UPDATE_INSTALLED_APPS') {
|
} else if (serialized.type === 'UPDATE_INSTALLED_APPS') {
|
||||||
return UpdateInstalledAppsAction.parse(serialized)
|
return UpdateInstalledAppsAction.parse(serialized)
|
||||||
} else if (serialized.type === 'REMOVE_INSTALLED_APPS') {
|
} else if (serialized.type === 'REMOVE_INSTALLED_APPS') {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -32,12 +32,11 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
|||||||
readonly sessionDurationMilliseconds: number
|
readonly sessionDurationMilliseconds: number
|
||||||
readonly sessionPauseMilliseconds: number
|
readonly sessionPauseMilliseconds: number
|
||||||
readonly perDay: boolean
|
readonly perDay: boolean
|
||||||
readonly expiresAt?: number
|
|
||||||
|
|
||||||
constructor ({
|
constructor ({
|
||||||
ruleId, maximumTimeInMillis, dayMask, applyToExtraTimeUsage,
|
ruleId, maximumTimeInMillis, dayMask, applyToExtraTimeUsage,
|
||||||
start, end, sessionDurationMilliseconds, sessionPauseMilliseconds,
|
start, end, sessionDurationMilliseconds, sessionPauseMilliseconds,
|
||||||
perDay, expiresAt
|
perDay
|
||||||
}: {
|
}: {
|
||||||
ruleId: string
|
ruleId: string
|
||||||
maximumTimeInMillis: number
|
maximumTimeInMillis: number
|
||||||
@@ -48,7 +47,6 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
|||||||
sessionDurationMilliseconds: number
|
sessionDurationMilliseconds: number
|
||||||
sessionPauseMilliseconds: number
|
sessionPauseMilliseconds: number
|
||||||
perDay: boolean
|
perDay: boolean
|
||||||
expiresAt?: number
|
|
||||||
}) {
|
}) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
@@ -61,7 +59,6 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
|||||||
this.sessionDurationMilliseconds = sessionDurationMilliseconds
|
this.sessionDurationMilliseconds = sessionDurationMilliseconds
|
||||||
this.sessionPauseMilliseconds = sessionPauseMilliseconds
|
this.sessionPauseMilliseconds = sessionPauseMilliseconds
|
||||||
this.perDay = perDay
|
this.perDay = perDay
|
||||||
this.expiresAt = expiresAt
|
|
||||||
|
|
||||||
assertIdWithinFamily({ actionType, field: 'ruleId', value: ruleId })
|
assertIdWithinFamily({ actionType, field: 'ruleId', value: ruleId })
|
||||||
|
|
||||||
@@ -95,17 +92,9 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
|||||||
staticMessage: 'session duration lesser than zero'
|
staticMessage: 'session duration lesser than zero'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expiresAt !== undefined) {
|
|
||||||
assertSafeInteger({ actionType, field: 'expiresAt', value: expiresAt })
|
|
||||||
|
|
||||||
if (expiresAt <= 0) {
|
|
||||||
throwOutOfRange({ actionType, field: 'expiresAt', value: expiresAt })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static parse = ({ ruleId, time, days, extraTime, start, end, dur, pause, perDay, e }: SerializedUpdateTimelimitRuleAction) => (
|
static parse = ({ ruleId, time, days, extraTime, start, end, dur, pause, perDay }: SerializedUpdateTimelimitRuleAction) => (
|
||||||
new UpdateTimelimitRuleAction({
|
new UpdateTimelimitRuleAction({
|
||||||
ruleId,
|
ruleId,
|
||||||
maximumTimeInMillis: time,
|
maximumTimeInMillis: time,
|
||||||
@@ -115,8 +104,7 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
|||||||
end: end ?? MinuteOfDay.MAX,
|
end: end ?? MinuteOfDay.MAX,
|
||||||
sessionDurationMilliseconds: dur ?? 0,
|
sessionDurationMilliseconds: dur ?? 0,
|
||||||
sessionPauseMilliseconds: pause ?? 0,
|
sessionPauseMilliseconds: pause ?? 0,
|
||||||
perDay: perDay ?? false,
|
perDay: perDay ?? false
|
||||||
expiresAt: e
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -132,5 +120,4 @@ export interface SerializedUpdateTimelimitRuleAction {
|
|||||||
dur?: number
|
dur?: number
|
||||||
pause?: number
|
pause?: number
|
||||||
perDay?: boolean
|
perDay?: boolean
|
||||||
e?: number
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-18
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -140,23 +140,15 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
|||||||
if (
|
if (
|
||||||
typeof req.body !== 'object' ||
|
typeof req.body !== 'object' ||
|
||||||
typeof req.body.purchaseToken !== 'string' ||
|
typeof req.body.purchaseToken !== 'string' ||
|
||||||
typeof req.body.purchaseId !== 'string' ||
|
typeof req.body.purchaseId !== 'string'
|
||||||
typeof req.body.dryRun !== 'boolean' ||
|
|
||||||
typeof req.body.type !== 'string'
|
|
||||||
) {
|
) {
|
||||||
throw new BadRequest()
|
throw new BadRequest()
|
||||||
}
|
}
|
||||||
|
|
||||||
const purchaseToken: string = req.body.purchaseToken
|
const purchaseToken: string = req.body.purchaseToken
|
||||||
const purchaseId: string = req.body.purchaseId
|
const purchaseId: string = req.body.purchaseId
|
||||||
const dryRun: boolean = req.body.dryRun
|
|
||||||
const type: string = req.body.type
|
|
||||||
|
|
||||||
if (type !== 'month' && type !== 'year' && type !== 'unpaid14') {
|
const tokenContent = await verifyIdentitifyToken(purchaseToken)
|
||||||
throw new BadRequest()
|
|
||||||
}
|
|
||||||
|
|
||||||
const tokenContent = await verifyIdentitifyToken(purchaseToken, dryRun)
|
|
||||||
|
|
||||||
if (tokenContent.purpose !== 'purchase') {
|
if (tokenContent.purpose !== 'purchase') {
|
||||||
res.json({ ok: false, error: 'token invalid', detail: 'wrong purpose' })
|
res.json({ ok: false, error: 'token invalid', detail: 'wrong purpose' })
|
||||||
@@ -234,10 +226,7 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
|||||||
error: 'family not found'
|
error: 'family not found'
|
||||||
}
|
}
|
||||||
|
|
||||||
const canDoPurchase = canDoNextPurchase({
|
const canDoPurchase = canDoNextPurchase({ fullVersionUntil: parseInt(familyEntry.fullVersionUntil) })
|
||||||
fullVersionUntil: parseInt(familyEntry.fullVersionUntil),
|
|
||||||
fullVersionDebts: parseInt(familyEntry.fullVersionDebts),
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!canDoPurchase) {
|
if (!canDoPurchase) {
|
||||||
const lastPurchase = await database.purchase.findOne({
|
const lastPurchase = await database.purchase.findOne({
|
||||||
@@ -261,18 +250,16 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dryRun) {
|
|
||||||
await addPurchase({
|
await addPurchase({
|
||||||
database,
|
database,
|
||||||
familyId: tokenContent.familyId,
|
familyId: tokenContent.familyId,
|
||||||
type,
|
type: 'year',
|
||||||
service: 'directpurchase',
|
service: 'directpurchase',
|
||||||
transactionId: purchaseId,
|
transactionId: purchaseId,
|
||||||
websocket,
|
websocket,
|
||||||
transaction
|
transaction
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ok: true,
|
ok: true,
|
||||||
|
|||||||
+7
-10
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -37,16 +37,16 @@ export const createPurchaseRouter = ({ database, websocket }: {
|
|||||||
const router = Router()
|
const router = Router()
|
||||||
|
|
||||||
router.post('/can-do-purchase', json(), async (req, res, next) => {
|
router.post('/can-do-purchase', json(), async (req, res, next) => {
|
||||||
|
if (!areGooglePlayPaymentsPossible) {
|
||||||
|
res.json({ canDoPurchase: 'no because not supported by the server' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!isCanDoPurchaseRequest(req.body)) {
|
if (!isCanDoPurchaseRequest(req.body)) {
|
||||||
throw new BadRequest()
|
throw new BadRequest()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.body.type === 'googleplay' && !areGooglePlayPaymentsPossible) {
|
|
||||||
res.json({ canDoPurchase: 'no because not supported by the server' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const result: boolean = await database.transaction(async (transaction) => {
|
const result: boolean = await database.transaction(async (transaction) => {
|
||||||
const familyEntry = await requireFamilyEntry({
|
const familyEntry = await requireFamilyEntry({
|
||||||
database,
|
database,
|
||||||
@@ -54,10 +54,7 @@ export const createPurchaseRouter = ({ database, websocket }: {
|
|||||||
transaction
|
transaction
|
||||||
})
|
})
|
||||||
|
|
||||||
return canDoNextPurchase({
|
return canDoNextPurchase({ fullVersionUntil: parseInt(familyEntry.fullVersionUntil, 10) })
|
||||||
fullVersionUntil: parseInt(familyEntry.fullVersionUntil, 10),
|
|
||||||
fullVersionDebts: parseInt(familyEntry.fullVersionDebts, 10),
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
|||||||
+1
-1
@@ -113,7 +113,7 @@ export interface CreateRegisterDeviceTokenRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface CanDoPurchaseRequest {
|
export interface CanDoPurchaseRequest {
|
||||||
type?: 'googleplay' | 'any'
|
type: 'googleplay' | 'any'
|
||||||
deviceAuthToken: string
|
deviceAuthToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-69
@@ -409,9 +409,6 @@ const definitions = {
|
|||||||
},
|
},
|
||||||
"perDay": {
|
"perDay": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
|
||||||
"e": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
@@ -1420,9 +1417,6 @@ const definitions = {
|
|||||||
},
|
},
|
||||||
"perDay": {
|
"perDay": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
|
||||||
"e": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
@@ -1759,41 +1753,6 @@ const definitions = {
|
|||||||
"type"
|
"type"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"SerializedPingAction": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"PING"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"deviceId": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"event": {
|
|
||||||
"$ref": "#/definitions/PingEvent"
|
|
||||||
},
|
|
||||||
"token": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"deviceId",
|
|
||||||
"event",
|
|
||||||
"token",
|
|
||||||
"type"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"PingEvent": {
|
|
||||||
"enum": [
|
|
||||||
"clear",
|
|
||||||
"ping",
|
|
||||||
"pong"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"SerializedUpdateInstalledAppsAction": {
|
"SerializedUpdateInstalledAppsAction": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -2850,30 +2809,6 @@ const definitions = {
|
|||||||
"tempKey"
|
"tempKey"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ServerPing": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"deviceId": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"token": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"enum": [
|
|
||||||
"ping",
|
|
||||||
"pong"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"deviceId",
|
|
||||||
"token",
|
|
||||||
"type"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ServerDhKey": {
|
"ServerDhKey": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -3272,9 +3207,6 @@ export const isSerializedAppLogicAction: (value: unknown) => value is Serialized
|
|||||||
{
|
{
|
||||||
"$ref": "#/definitions/SerializedMarkTaskPendingAction"
|
"$ref": "#/definitions/SerializedMarkTaskPendingAction"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$ref": "#/definitions/SerializedPingAction"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/SerializedUpdateInstalledAppsAction"
|
"$ref": "#/definitions/SerializedUpdateInstalledAppsAction"
|
||||||
},
|
},
|
||||||
@@ -3353,7 +3285,8 @@ export const isCanDoPurchaseRequest: (value: unknown) => value is CanDoPurchaseR
|
|||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": [
|
"required": [
|
||||||
"deviceAuthToken"
|
"deviceAuthToken",
|
||||||
|
"type"
|
||||||
],
|
],
|
||||||
"definitions": definitions,
|
"definitions": definitions,
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -26,7 +26,7 @@ export const config = {
|
|||||||
expireTimeRounding: 1000 * 60 * 15
|
expireTimeRounding: 1000 * 60 * 15
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculateExpireTime(now: bigint): bigint {
|
export function calculateExpireTime(now: bigint): BigInt {
|
||||||
const expireBaseTime = now + BigInt(config.expireDelay)
|
const expireBaseTime = now + BigInt(config.expireDelay)
|
||||||
const expireTime = expireBaseTime - expireBaseTime % BigInt(config.expireTimeRounding) + BigInt(config.expireTimeRounding)
|
const expireTime = expireBaseTime - expireBaseTime % BigInt(config.expireTimeRounding) + BigInt(config.expireTimeRounding)
|
||||||
|
|
||||||
|
|||||||
+3
-20
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -37,13 +37,8 @@ export interface FamilyAttributesVersion3 {
|
|||||||
u2fKeysVersion: string
|
u2fKeysVersion: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FamilyAttributesVersion4 {
|
|
||||||
fullVersionDebts: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type FamilyAttributes = FamilyAttributesVersion1 &
|
export type FamilyAttributes = FamilyAttributesVersion1 &
|
||||||
FamilyAttributesVersion2 & FamilyAttributesVersion3 &
|
FamilyAttributesVersion2 & FamilyAttributesVersion3
|
||||||
FamilyAttributesVersion4
|
|
||||||
|
|
||||||
export type FamilyModel = Sequelize.Model<FamilyAttributes> & FamilyAttributes
|
export type FamilyModel = Sequelize.Model<FamilyAttributes> & FamilyAttributes
|
||||||
export type FamilyModelStatic = typeof Sequelize.Model & {
|
export type FamilyModelStatic = typeof Sequelize.Model & {
|
||||||
@@ -81,22 +76,10 @@ export const attributesVersion3: SequelizeAttributes<FamilyAttributesVersion3> =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const attributesVersion4: SequelizeAttributes<FamilyAttributesVersion4> = {
|
|
||||||
fullVersionDebts: {
|
|
||||||
type: Sequelize.BIGINT,
|
|
||||||
allowNull: false,
|
|
||||||
defaultValue: 0,
|
|
||||||
validate: {
|
|
||||||
min: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<FamilyAttributes> = {
|
export const attributes: SequelizeAttributes<FamilyAttributes> = {
|
||||||
...attributesVersion1,
|
...attributesVersion1,
|
||||||
...attributesVersion2,
|
...attributesVersion2,
|
||||||
...attributesVersion3,
|
...attributesVersion3
|
||||||
...attributesVersion4
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createFamilyModel = (sequelize: Sequelize.Sequelize): FamilyModelStatic => sequelize.define('Family', attributes) as FamilyModelStatic
|
export const createFamilyModel = (sequelize: Sequelize.Sequelize): FamilyModelStatic => sequelize.define('Family', attributes) as FamilyModelStatic
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -33,7 +33,6 @@ import { createKeyResponseModel, KeyResponseModelStatic } from './keyresponse'
|
|||||||
import { createMailLoginTokenModel, MailLoginTokenModelStatic } from './maillogintoken'
|
import { createMailLoginTokenModel, MailLoginTokenModelStatic } from './maillogintoken'
|
||||||
import { createUmzug } from './migration/umzug'
|
import { createUmzug } from './migration/umzug'
|
||||||
import { createOldDeviceModel, OldDeviceModelStatic } from './olddevice'
|
import { createOldDeviceModel, OldDeviceModelStatic } from './olddevice'
|
||||||
import { createPingModel, PingModelStatic } from './ping'
|
|
||||||
import { createPurchaseModel, PurchaseModelStatic } from './purchase'
|
import { createPurchaseModel, PurchaseModelStatic } from './purchase'
|
||||||
import { createSessionDurationModel, SessionDurationModelStatic } from './sessionduration'
|
import { createSessionDurationModel, SessionDurationModelStatic } from './sessionduration'
|
||||||
import { createTimelimitRuleModel, TimelimitRuleModelStatic } from './timelimitrule'
|
import { createTimelimitRuleModel, TimelimitRuleModelStatic } from './timelimitrule'
|
||||||
@@ -62,7 +61,6 @@ export interface Database {
|
|||||||
keyResponse: KeyResponseModelStatic
|
keyResponse: KeyResponseModelStatic
|
||||||
mailLoginToken: MailLoginTokenModelStatic
|
mailLoginToken: MailLoginTokenModelStatic
|
||||||
oldDevice: OldDeviceModelStatic
|
oldDevice: OldDeviceModelStatic
|
||||||
ping: PingModelStatic
|
|
||||||
purchase: PurchaseModelStatic
|
purchase: PurchaseModelStatic
|
||||||
sessionDuration: SessionDurationModelStatic
|
sessionDuration: SessionDurationModelStatic
|
||||||
timelimitRule: TimelimitRuleModelStatic
|
timelimitRule: TimelimitRuleModelStatic
|
||||||
@@ -99,7 +97,6 @@ const createDatabase = (sequelize: Sequelize.Sequelize): Database => ({
|
|||||||
keyResponse: createKeyResponseModel(sequelize),
|
keyResponse: createKeyResponseModel(sequelize),
|
||||||
mailLoginToken: createMailLoginTokenModel(sequelize),
|
mailLoginToken: createMailLoginTokenModel(sequelize),
|
||||||
oldDevice: createOldDeviceModel(sequelize),
|
oldDevice: createOldDeviceModel(sequelize),
|
||||||
ping: createPingModel(sequelize),
|
|
||||||
purchase: createPurchaseModel(sequelize),
|
purchase: createPurchaseModel(sequelize),
|
||||||
sessionDuration: createSessionDurationModel(sequelize),
|
sessionDuration: createSessionDurationModel(sequelize),
|
||||||
timelimitRule: createTimelimitRuleModel(sequelize),
|
timelimitRule: createTimelimitRuleModel(sequelize),
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
|
||||||
import { attributesVersion4 as ruleAttributes } from '../../timelimitrule'
|
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
|
||||||
await sequelize.transaction({
|
|
||||||
type: Transaction.TYPES.EXCLUSIVE
|
|
||||||
}, async (transaction) => {
|
|
||||||
await queryInterface.addColumn('TimelimitRules', 'expiresAt', {
|
|
||||||
...ruleAttributes.expiresAt
|
|
||||||
}, {
|
|
||||||
transaction
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
|
||||||
await sequelize.transaction({
|
|
||||||
type: Transaction.TYPES.EXCLUSIVE
|
|
||||||
}, async (transaction) => {
|
|
||||||
await queryInterface.removeColumn('TimelimitRules', 'expiresAt', { transaction })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
|
||||||
await sequelize.transaction({
|
|
||||||
type: Transaction.TYPES.EXCLUSIVE
|
|
||||||
}, async (transaction) => {
|
|
||||||
const dialect = sequelize.getDialect()
|
|
||||||
const isMysql = dialect === 'mysql' || dialect === 'mariadb'
|
|
||||||
|
|
||||||
if (isMysql) {
|
|
||||||
await sequelize.query(
|
|
||||||
'CREATE TABLE `Pings` ' +
|
|
||||||
'(`familyId` VARCHAR(10) NOT NULL,' +
|
|
||||||
'`receiverDeviceId` VARCHAR(6) NOT NULL,' +
|
|
||||||
'`senderDeviceId` VARCHAR(6) NOT NULL,' +
|
|
||||||
'`type` INTEGER NOT NULL,' +
|
|
||||||
'`token` VARCHAR(6) NOT NULL,' +
|
|
||||||
'PRIMARY KEY (`familyId`, `receiverDeviceId`, `senderDeviceId`, `type`),' +
|
|
||||||
'FOREIGN KEY (`familyId`, `receiverDeviceId`) REFERENCES `Devices` (`familyId`, `deviceId`) ON UPDATE CASCADE ON DELETE CASCADE,' +
|
|
||||||
'FOREIGN KEY (`familyId`, `senderDeviceId`) REFERENCES `Devices` (`familyId`, `deviceId`) ON UPDATE CASCADE ON DELETE CASCADE' +
|
|
||||||
')',
|
|
||||||
{ transaction }
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
await sequelize.query(
|
|
||||||
'CREATE TABLE "Pings" ' +
|
|
||||||
'("familyId" VARCHAR(10) NOT NULL,' +
|
|
||||||
'"receiverDeviceId" VARCHAR(6) NOT NULL,' +
|
|
||||||
'"senderDeviceId" VARCHAR(6) NOT NULL,' +
|
|
||||||
'"type" INTEGER NOT NULL,' +
|
|
||||||
'"token" VARCHAR(6) NOT NULL,' +
|
|
||||||
'PRIMARY KEY ("familyId", "receiverDeviceId", "senderDeviceId", "type"),' +
|
|
||||||
'FOREIGN KEY ("familyId", "receiverDeviceId") REFERENCES "Devices" ("familyId", "deviceId") ON UPDATE CASCADE ON DELETE CASCADE,' +
|
|
||||||
'FOREIGN KEY ("familyId", "senderDeviceId") REFERENCES "Devices" ("familyId", "deviceId") ON UPDATE CASCADE ON DELETE CASCADE' +
|
|
||||||
')',
|
|
||||||
{ transaction }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
await queryInterface.addIndex('Pings', ['familyId', 'senderDeviceId'], { transaction })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
|
||||||
await sequelize.transaction({
|
|
||||||
type: Transaction.TYPES.EXCLUSIVE
|
|
||||||
}, async (transaction) => {
|
|
||||||
await queryInterface.dropTable('Pings', { transaction })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
|
||||||
import { attributesVersion4 as familyAttributes } from '../../family'
|
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
|
||||||
await sequelize.transaction({
|
|
||||||
type: Transaction.TYPES.EXCLUSIVE
|
|
||||||
}, async (transaction) => {
|
|
||||||
await queryInterface.addColumn('Families', 'fullVersionDebts', {
|
|
||||||
...familyAttributes.fullVersionDebts
|
|
||||||
}, {
|
|
||||||
transaction
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
|
||||||
await sequelize.transaction({
|
|
||||||
type: Transaction.TYPES.EXCLUSIVE
|
|
||||||
}, async (transaction) => {
|
|
||||||
await queryInterface.removeColumn('Families', 'fullVersionDebts', { transaction })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -17,26 +17,18 @@
|
|||||||
|
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { Sequelize } from 'sequelize'
|
import { Sequelize } from 'sequelize'
|
||||||
import { Umzug, SequelizeStorage } from 'umzug'
|
import * as Umzug from 'umzug'
|
||||||
|
|
||||||
export const createUmzug = (sequelize: Sequelize) => (
|
export const createUmzug = (sequelize: Sequelize) => (
|
||||||
new Umzug({
|
new Umzug({
|
||||||
storage: new SequelizeStorage({ sequelize }),
|
storage: 'sequelize',
|
||||||
|
storageOptions: {
|
||||||
|
sequelize
|
||||||
|
},
|
||||||
migrations: {
|
migrations: {
|
||||||
glob: resolve(__dirname, '../../../build/database/migration/migrations/*.js'),
|
params: [sequelize.getQueryInterface(), sequelize],
|
||||||
resolve: ({ name, path }) => {
|
path: resolve(__dirname, '../../../build/database/migration/migrations'),
|
||||||
if (!path) throw new Error()
|
pattern: /^\d+[\w-]+\.js$/
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
||||||
const migration = require(path)
|
|
||||||
|
|
||||||
return {
|
|
||||||
name,
|
|
||||||
up: async () => migration.up(sequelize.getQueryInterface(), sequelize),
|
|
||||||
down: async () => migration.down(sequelize.getQueryInterface(), sequelize),
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
},
|
|
||||||
logger: console
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as Sequelize from 'sequelize'
|
|
||||||
import { familyIdColumn, idWithinFamilyColumn } from './columns'
|
|
||||||
import { SequelizeAttributes } from './types'
|
|
||||||
|
|
||||||
export interface PingAttributes {
|
|
||||||
familyId: string
|
|
||||||
receiverDeviceId: string
|
|
||||||
senderDeviceId: string
|
|
||||||
type: number
|
|
||||||
token: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const types = {
|
|
||||||
ping: 1,
|
|
||||||
pong: 2,
|
|
||||||
all: [1, 2]
|
|
||||||
}
|
|
||||||
|
|
||||||
export type PingModel = Sequelize.Model<PingAttributes> & PingAttributes
|
|
||||||
export type PingModelStatic = typeof Sequelize.Model & {
|
|
||||||
new (values?: object, options?: Sequelize.BuildOptions): PingModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<PingAttributes> = {
|
|
||||||
familyId: {
|
|
||||||
...familyIdColumn,
|
|
||||||
primaryKey: true
|
|
||||||
},
|
|
||||||
receiverDeviceId: {
|
|
||||||
...idWithinFamilyColumn,
|
|
||||||
primaryKey: true
|
|
||||||
},
|
|
||||||
senderDeviceId: {
|
|
||||||
...idWithinFamilyColumn,
|
|
||||||
primaryKey: true
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Sequelize.INTEGER,
|
|
||||||
allowNull: false,
|
|
||||||
validate: {
|
|
||||||
isIn: [types.all]
|
|
||||||
},
|
|
||||||
primaryKey: true
|
|
||||||
},
|
|
||||||
token: {
|
|
||||||
...idWithinFamilyColumn
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const createPingModel = (sequelize: Sequelize.Sequelize): PingModelStatic => sequelize.define('Ping', attributes) as PingModelStatic
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -23,7 +23,7 @@ export interface PurchaseAttributes {
|
|||||||
familyId: string
|
familyId: string
|
||||||
service: 'googleplay' | 'directpurchase'
|
service: 'googleplay' | 'directpurchase'
|
||||||
transactionId: string
|
transactionId: string
|
||||||
type: 'month' | 'year' | 'unpaid14'
|
type: 'month' | 'year'
|
||||||
loggedAt: string
|
loggedAt: string
|
||||||
previousFullVersionEndTime: string
|
previousFullVersionEndTime: string
|
||||||
newFullVersionEndTime: string
|
newFullVersionEndTime: string
|
||||||
@@ -44,7 +44,7 @@ export const attributes: SequelizeAttributes<PurchaseAttributes> = {
|
|||||||
type: Sequelize.STRING,
|
type: Sequelize.STRING,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
type: createEnumColumn(['month', 'year', 'unpaid14']),
|
type: createEnumColumn(['month', 'year']),
|
||||||
loggedAt: { ...timestampColumn },
|
loggedAt: { ...timestampColumn },
|
||||||
previousFullVersionEndTime: { ...timestampColumn },
|
previousFullVersionEndTime: { ...timestampColumn },
|
||||||
newFullVersionEndTime: { ...timestampColumn }
|
newFullVersionEndTime: { ...timestampColumn }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2021 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -41,13 +41,8 @@ interface TimelimitRuleAttributesVersion3 {
|
|||||||
perDay: number
|
perDay: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TimelimitRuleAttributesVersion4 {
|
|
||||||
expiresAt: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
type TimelimitRuleAttributes = TimelimitRuleAttributesVersion1 &
|
type TimelimitRuleAttributes = TimelimitRuleAttributesVersion1 &
|
||||||
TimelimitRuleAttributesVersion2 & TimelimitRuleAttributesVersion3 &
|
TimelimitRuleAttributesVersion2 & TimelimitRuleAttributesVersion3
|
||||||
TimelimitRuleAttributesVersion4
|
|
||||||
|
|
||||||
export type TimelimitRuleModel = Sequelize.Model<TimelimitRuleAttributes> & TimelimitRuleAttributes
|
export type TimelimitRuleModel = Sequelize.Model<TimelimitRuleAttributes> & TimelimitRuleAttributes
|
||||||
export type TimelimitRuleModelStatic = typeof Sequelize.Model & {
|
export type TimelimitRuleModelStatic = typeof Sequelize.Model & {
|
||||||
@@ -142,22 +137,10 @@ export const attributesVersion3: SequelizeAttributes<TimelimitRuleAttributesVers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const attributesVersion4: SequelizeAttributes<TimelimitRuleAttributesVersion4> = {
|
|
||||||
expiresAt: {
|
|
||||||
type: Sequelize.BIGINT,
|
|
||||||
validate: {
|
|
||||||
min: 1
|
|
||||||
},
|
|
||||||
allowNull: true,
|
|
||||||
defaultValue: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<TimelimitRuleAttributes> = {
|
export const attributes: SequelizeAttributes<TimelimitRuleAttributes> = {
|
||||||
...attributesVersion1,
|
...attributesVersion1,
|
||||||
...attributesVersion2,
|
...attributesVersion2,
|
||||||
...attributesVersion3,
|
...attributesVersion3
|
||||||
...attributesVersion4
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createTimelimitRuleModel = (sequelize: Sequelize.Sequelize): TimelimitRuleModelStatic => sequelize.define('TimelimitRule', attributes) as TimelimitRuleModelStatic
|
export const createTimelimitRuleModel = (sequelize: Sequelize.Sequelize): TimelimitRuleModelStatic => sequelize.define('TimelimitRule', attributes) as TimelimitRuleModelStatic
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -82,8 +82,7 @@ export async function createFamily ({
|
|||||||
fullVersionUntil: (Date.now() + 1000 * 60 * 60 * 24 * 14).toString(10),
|
fullVersionUntil: (Date.now() + 1000 * 60 * 60 * 24 * 14).toString(10),
|
||||||
hasFullVersion: true,
|
hasFullVersion: true,
|
||||||
nextServerKeyRequestSeq: '1',
|
nextServerKeyRequestSeq: '1',
|
||||||
u2fKeysVersion: generateVersionId(),
|
u2fKeysVersion: generateVersionId()
|
||||||
fullVersionDebts: '0'
|
|
||||||
}, { transaction })
|
}, { transaction })
|
||||||
|
|
||||||
// create parent user
|
// create parent user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -21,14 +21,13 @@ import { notifyClientsAboutChangesDelayed } from '../../function/websocket'
|
|||||||
import { WebsocketApi } from '../../websocket'
|
import { WebsocketApi } from '../../websocket'
|
||||||
|
|
||||||
const day = 1000 * 60 * 60 * 24
|
const day = 1000 * 60 * 60 * 24
|
||||||
const week = day * 7
|
|
||||||
const month = day * 31
|
const month = day * 31
|
||||||
const year = day * 366
|
const year = day * 366
|
||||||
|
|
||||||
export const addPurchase = async ({ database, familyId, type, service, transactionId, websocket, transaction }: {
|
export const addPurchase = async ({ database, familyId, type, service, transactionId, websocket, transaction }: {
|
||||||
database: Database
|
database: Database
|
||||||
familyId: string
|
familyId: string
|
||||||
type: 'month' | 'year' | 'unpaid14'
|
type: 'month' | 'year'
|
||||||
service: 'googleplay' | 'directpurchase'
|
service: 'googleplay' | 'directpurchase'
|
||||||
transactionId: string
|
transactionId: string
|
||||||
websocket: WebsocketApi
|
websocket: WebsocketApi
|
||||||
@@ -58,42 +57,11 @@ export const addPurchase = async ({ database, familyId, type, service, transacti
|
|||||||
}
|
}
|
||||||
|
|
||||||
const previousFullVersionEndTime = familyEntry.fullVersionUntil
|
const previousFullVersionEndTime = familyEntry.fullVersionUntil
|
||||||
const previousFullVersionDebts = parseInt(familyEntry.fullVersionDebts, 10)
|
|
||||||
|
|
||||||
if (type === 'month' || type === 'year') {
|
const newFullVersionUntil = Math.max(parseInt(familyEntry.fullVersionUntil, 10), Date.now()) + (type === 'year' ? year : month)
|
||||||
const typeDuration = type === 'year' ? year : month
|
|
||||||
|
|
||||||
if (typeDuration > previousFullVersionDebts) {
|
|
||||||
const newFullVersionUntil = Math.max(parseInt(familyEntry.fullVersionUntil, 10), Date.now()) + typeDuration - previousFullVersionDebts
|
|
||||||
|
|
||||||
familyEntry.fullVersionUntil = newFullVersionUntil.toString(10)
|
familyEntry.fullVersionUntil = newFullVersionUntil.toString(10)
|
||||||
familyEntry.fullVersionDebts = '0'
|
|
||||||
familyEntry.hasFullVersion = true
|
familyEntry.hasFullVersion = true
|
||||||
} else {
|
|
||||||
familyEntry.fullVersionDebts = (previousFullVersionDebts - typeDuration).toString(10)
|
|
||||||
}
|
|
||||||
} else if (type === 'unpaid14') {
|
|
||||||
const debtsAdd = 2 * week
|
|
||||||
const debtsMax = 3 * week
|
|
||||||
|
|
||||||
const newDebts = Math.min(debtsMax, previousFullVersionDebts + debtsAdd)
|
|
||||||
|
|
||||||
if (newDebts <= previousFullVersionDebts) {
|
|
||||||
// do not save anything
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const durationToAdd = newDebts - previousFullVersionDebts
|
|
||||||
|
|
||||||
const newFullVersionUntil = Math.max(parseInt(familyEntry.fullVersionUntil, 10), Date.now()) + durationToAdd
|
|
||||||
|
|
||||||
familyEntry.fullVersionUntil = newFullVersionUntil.toString(10)
|
|
||||||
familyEntry.fullVersionDebts = newDebts.toString(10)
|
|
||||||
familyEntry.hasFullVersion = true
|
|
||||||
} else {
|
|
||||||
throw new Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
await familyEntry.save({ transaction })
|
await familyEntry.save({ transaction })
|
||||||
|
|
||||||
@@ -104,7 +72,7 @@ export const addPurchase = async ({ database, familyId, type, service, transacti
|
|||||||
type,
|
type,
|
||||||
loggedAt: Date.now().toString(10),
|
loggedAt: Date.now().toString(10),
|
||||||
previousFullVersionEndTime,
|
previousFullVersionEndTime,
|
||||||
newFullVersionEndTime: familyEntry.fullVersionUntil
|
newFullVersionEndTime: newFullVersionUntil.toString(10)
|
||||||
}, {
|
}, {
|
||||||
transaction
|
transaction
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -15,9 +15,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const canDoNextPurchase = ({ fullVersionUntil, fullVersionDebts }: {
|
export const canDoNextPurchase = ({ fullVersionUntil }: {fullVersionUntil: number}) => (
|
||||||
fullVersionUntil: number
|
fullVersionUntil < (Date.now() + 1000 * 60 * 60 * 24 * 31) // 31 days
|
||||||
fullVersionDebts: number
|
|
||||||
}) => (
|
|
||||||
(fullVersionUntil - fullVersionDebts) < (Date.now() + 1000 * 60 * 60 * 24 * 31) // 31 days
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -43,7 +43,7 @@ export const requireFamilyEntry = async ({ database, deviceAuthToken, transactio
|
|||||||
where: {
|
where: {
|
||||||
familyId: deviceEntry.familyId
|
familyId: deviceEntry.familyId
|
||||||
},
|
},
|
||||||
attributes: ['fullVersionUntil', 'fullVersionDebts'],
|
attributes: ['fullVersionUntil'],
|
||||||
transaction
|
transaction
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -52,8 +52,7 @@ export const requireFamilyEntry = async ({ database, deviceAuthToken, transactio
|
|||||||
}
|
}
|
||||||
|
|
||||||
const familyEntry = {
|
const familyEntry = {
|
||||||
fullVersionUntil: familyEntryUnsafe.fullVersionUntil,
|
fullVersionUntil: familyEntryUnsafe.fullVersionUntil
|
||||||
fullVersionDebts: familyEntryUnsafe.fullVersionDebts,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return familyEntry
|
return familyEntry
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -89,6 +89,7 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
|||||||
addUsedTimeForADifferentUserThanTheCurrentUserOfTheDevice = true
|
addUsedTimeForADifferentUserThanTheCurrentUserOfTheDevice = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-inner-declarations
|
||||||
async function handle (start: number, end: number) {
|
async function handle (start: number, end: number) {
|
||||||
const lengthInMinutes = (end - start) + 1
|
const lengthInMinutes = (end - start) + 1
|
||||||
const lengthInMs = lengthInMinutes * 1000 * 60
|
const lengthInMs = lengthInMinutes * 1000 * 60
|
||||||
@@ -214,10 +215,10 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
|||||||
|
|
||||||
const fittingDurationItemsLastUsageFiltered =
|
const fittingDurationItemsLastUsageFiltered =
|
||||||
hasTrustedTimestamp ?
|
hasTrustedTimestamp ?
|
||||||
fittingDurationItems.filter((it) => (
|
fittingDurationItems.filter((it) => {
|
||||||
action.trustedTimestamp - item.timeToAdd <=
|
action.trustedTimestamp - item.timeToAdd <=
|
||||||
parseInt(it.lastUsage, 10) + it.sessionPauseDuration - tolerance
|
parseInt(it.lastUsage, 10) + it.sessionPauseDuration - tolerance
|
||||||
)) : fittingDurationItems
|
}) : fittingDurationItems
|
||||||
|
|
||||||
return fittingDurationItemsLastUsageFiltered
|
return fittingDurationItemsLastUsageFiltered
|
||||||
.map((it) => it.lastSessionDuration)
|
.map((it) => it.lastSessionDuration)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -23,7 +23,6 @@ import {
|
|||||||
FinishKeyRequestAction,
|
FinishKeyRequestAction,
|
||||||
ForceSyncAction,
|
ForceSyncAction,
|
||||||
MarkTaskPendingAction,
|
MarkTaskPendingAction,
|
||||||
PingAction,
|
|
||||||
ReplyToKeyRequestAction,
|
ReplyToKeyRequestAction,
|
||||||
RemoveInstalledAppsAction,
|
RemoveInstalledAppsAction,
|
||||||
SendKeyRequestAction,
|
SendKeyRequestAction,
|
||||||
@@ -42,7 +41,6 @@ import { dispatchAddUsedTimeVersion2 } from './addusedtime2'
|
|||||||
import { dispatchFinishKeyRequestAction } from './finishkeyrequest'
|
import { dispatchFinishKeyRequestAction } from './finishkeyrequest'
|
||||||
import { dispatchForceSyncAction } from './forcesync'
|
import { dispatchForceSyncAction } from './forcesync'
|
||||||
import { dispatchMarkTaskPendingAction } from './marktaskpendingaction'
|
import { dispatchMarkTaskPendingAction } from './marktaskpendingaction'
|
||||||
import { dispatchPingAction } from './ping'
|
|
||||||
import { dispatchReplyToKeyRequestAction } from './replytokeyrequest'
|
import { dispatchReplyToKeyRequestAction } from './replytokeyrequest'
|
||||||
import { dispatchSendKeyRequestAction } from './sendkeyrequest'
|
import { dispatchSendKeyRequestAction } from './sendkeyrequest'
|
||||||
import { dispatchSignOutAtDevice } from './signoutatdevice'
|
import { dispatchSignOutAtDevice } from './signoutatdevice'
|
||||||
@@ -69,8 +67,6 @@ export const dispatchAppLogicAction = async ({ action, deviceId, cache, eventHan
|
|||||||
await dispatchForceSyncAction({ deviceId, action, cache })
|
await dispatchForceSyncAction({ deviceId, action, cache })
|
||||||
} else if (action instanceof MarkTaskPendingAction) {
|
} else if (action instanceof MarkTaskPendingAction) {
|
||||||
await dispatchMarkTaskPendingAction({ deviceId, action, cache })
|
await dispatchMarkTaskPendingAction({ deviceId, action, cache })
|
||||||
} else if (action instanceof PingAction) {
|
|
||||||
await dispatchPingAction({ deviceId, action, cache })
|
|
||||||
} else if (action instanceof ReplyToKeyRequestAction) {
|
} else if (action instanceof ReplyToKeyRequestAction) {
|
||||||
await dispatchReplyToKeyRequestAction({ deviceId, action, cache, eventHandler })
|
await dispatchReplyToKeyRequestAction({ deviceId, action, cache, eventHandler })
|
||||||
} else if (action instanceof RemoveInstalledAppsAction) {
|
} else if (action instanceof RemoveInstalledAppsAction) {
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { PingAction } from '../../../../action'
|
|
||||||
import { types as pingTypes } from '../../../../database/ping'
|
|
||||||
import { Cache } from '../cache'
|
|
||||||
|
|
||||||
export async function dispatchPingAction ({ action, cache, deviceId }: {
|
|
||||||
deviceId: string
|
|
||||||
action: PingAction
|
|
||||||
cache: Cache
|
|
||||||
}) {
|
|
||||||
// handle insertion
|
|
||||||
if (action.event === 'ping' || action.event === 'pong') {
|
|
||||||
let type
|
|
||||||
|
|
||||||
if (action.event === 'ping') type = pingTypes.ping
|
|
||||||
else if (action.event === 'pong') type = pingTypes.pong
|
|
||||||
else throw new Error()
|
|
||||||
|
|
||||||
// delete any previous ping/pong
|
|
||||||
await cache.database.ping.destroy({
|
|
||||||
where: {
|
|
||||||
familyId: cache.familyId,
|
|
||||||
receiverDeviceId: action.deviceId,
|
|
||||||
senderDeviceId: deviceId,
|
|
||||||
type: type
|
|
||||||
},
|
|
||||||
transaction: cache.transaction
|
|
||||||
})
|
|
||||||
|
|
||||||
// insert
|
|
||||||
await cache.database.ping.create({
|
|
||||||
familyId: cache.familyId,
|
|
||||||
receiverDeviceId: action.deviceId,
|
|
||||||
senderDeviceId: deviceId,
|
|
||||||
type,
|
|
||||||
token: action.token
|
|
||||||
}, {
|
|
||||||
transaction: cache.transaction
|
|
||||||
})
|
|
||||||
|
|
||||||
// notify
|
|
||||||
cache.incrementTargetedTriggeredSyncLevel(action.deviceId, 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
// handle deleting
|
|
||||||
if (action.event === 'pong' || action.event === 'clear') {
|
|
||||||
await cache.database.ping.destroy({
|
|
||||||
where: {
|
|
||||||
familyId: cache.familyId,
|
|
||||||
receiverDeviceId: deviceId,
|
|
||||||
senderDeviceId: action.deviceId,
|
|
||||||
token: action.token
|
|
||||||
},
|
|
||||||
transaction: cache.transaction
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -48,8 +48,7 @@ export const dispatchChildChangePassword = async ({ action, childUserId, cache }
|
|||||||
|
|
||||||
{
|
{
|
||||||
const clear = cache.getSecondPasswordHashOfChild.cache.clear
|
const clear = cache.getSecondPasswordHashOfChild.cache.clear
|
||||||
|
clear && clear()
|
||||||
if (clear) clear()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.invalidiateUserList = true
|
cache.invalidiateUserList = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -55,8 +55,7 @@ export async function dispatchChangeParentPassword ({ action, cache }: {
|
|||||||
|
|
||||||
{
|
{
|
||||||
const clear = cache.getSecondPasswordHashOfParent.cache.clear
|
const clear = cache.getSecondPasswordHashOfParent.cache.clear
|
||||||
|
clear && clear()
|
||||||
if (clear) clear()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.invalidiateUserList = true
|
cache.invalidiateUserList = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -55,8 +55,7 @@ export async function dispatchCreateTimeLimitRule ({ action, cache, fromChildSel
|
|||||||
endMinuteOfDay: action.rule.end,
|
endMinuteOfDay: action.rule.end,
|
||||||
sessionDurationMilliseconds: action.rule.sessionDurationMilliseconds,
|
sessionDurationMilliseconds: action.rule.sessionDurationMilliseconds,
|
||||||
sessionPauseMilliseconds: action.rule.sessionPauseMilliseconds,
|
sessionPauseMilliseconds: action.rule.sessionPauseMilliseconds,
|
||||||
perDay: action.rule.perDay ? 1 : 0,
|
perDay: action.rule.perDay ? 1 : 0
|
||||||
expiresAt: action.rule.expiresAt ? action.rule.expiresAt.toString() : null
|
|
||||||
}, { transaction: cache.transaction })
|
}, { transaction: cache.transaction })
|
||||||
|
|
||||||
cache.categoriesWithModifiedTimeLimitRules.add(action.rule.categoryId)
|
cache.categoriesWithModifiedTimeLimitRules.add(action.rule.categoryId)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -47,8 +47,7 @@ export async function dispatchSetChildPassword ({ action, cache }: {
|
|||||||
|
|
||||||
{
|
{
|
||||||
const clear = cache.getSecondPasswordHashOfChild.cache.clear
|
const clear = cache.getSecondPasswordHashOfChild.cache.clear
|
||||||
|
clear && clear()
|
||||||
if (clear) clear()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.invalidiateUserList = true
|
cache.invalidiateUserList = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -67,9 +67,6 @@ export async function dispatchUpdateTimelimitRule ({
|
|||||||
const wasSessionDurationLimitationEnabled =
|
const wasSessionDurationLimitationEnabled =
|
||||||
ruleEntry.sessionPauseMilliseconds > 0 && ruleEntry.sessionDurationMilliseconds > 0
|
ruleEntry.sessionPauseMilliseconds > 0 && ruleEntry.sessionDurationMilliseconds > 0
|
||||||
|
|
||||||
const isSessionDurationLimitationEnabled =
|
|
||||||
action.sessionPauseMilliseconds > 0 && action.sessionDurationMilliseconds > 0
|
|
||||||
|
|
||||||
const countOldAffectedDays = Array(7)
|
const countOldAffectedDays = Array(7)
|
||||||
.fill(0)
|
.fill(0)
|
||||||
.reduce((sum, _, index) => sum + ((ruleEntry.dayMaskAsBitmask >> index) & 1), 0)
|
.reduce((sum, _, index) => sum + ((ruleEntry.dayMaskAsBitmask >> index) & 1), 0)
|
||||||
@@ -81,12 +78,10 @@ export async function dispatchUpdateTimelimitRule ({
|
|||||||
action.start <= ruleEntry.startMinuteOfDay &&
|
action.start <= ruleEntry.startMinuteOfDay &&
|
||||||
action.end >= ruleEntry.endMinuteOfDay &&
|
action.end >= ruleEntry.endMinuteOfDay &&
|
||||||
(!wasSessionDurationLimitationEnabled || (
|
(!wasSessionDurationLimitationEnabled || (
|
||||||
isSessionDurationLimitationEnabled &&
|
|
||||||
action.sessionDurationMilliseconds <= ruleEntry.sessionDurationMilliseconds &&
|
action.sessionDurationMilliseconds <= ruleEntry.sessionDurationMilliseconds &&
|
||||||
action.sessionPauseMilliseconds >= ruleEntry.sessionPauseMilliseconds
|
action.sessionPauseMilliseconds >= ruleEntry.sessionPauseMilliseconds
|
||||||
)) &&
|
)) &&
|
||||||
(!action.perDay || ruleEntry.perDay || countOldAffectedDays <= 1) &&
|
(!action.perDay || ruleEntry.perDay || countOldAffectedDays <= 1)
|
||||||
(action.expiresAt === undefined || (ruleEntry.expiresAt !== null && action.expiresAt >= parseInt(ruleEntry.expiresAt, 10)))
|
|
||||||
|
|
||||||
if (!isAtLeastAsStrictAsPreviously) {
|
if (!isAtLeastAsStrictAsPreviously) {
|
||||||
throw new CanNotRelaxRestrictionsSelfLimitException()
|
throw new CanNotRelaxRestrictionsSelfLimitException()
|
||||||
@@ -101,7 +96,6 @@ export async function dispatchUpdateTimelimitRule ({
|
|||||||
ruleEntry.sessionDurationMilliseconds = action.sessionDurationMilliseconds
|
ruleEntry.sessionDurationMilliseconds = action.sessionDurationMilliseconds
|
||||||
ruleEntry.sessionPauseMilliseconds = action.sessionPauseMilliseconds
|
ruleEntry.sessionPauseMilliseconds = action.sessionPauseMilliseconds
|
||||||
ruleEntry.perDay = action.perDay ? 1 : 0
|
ruleEntry.perDay = action.perDay ? 1 : 0
|
||||||
ruleEntry.expiresAt = action.expiresAt ? action.expiresAt.toString() : null
|
|
||||||
|
|
||||||
await ruleEntry.save({ transaction: cache.transaction })
|
await ruleEntry.save({ transaction: cache.transaction })
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { createHash } from 'crypto'
|
|
||||||
|
|
||||||
const updateMessage =
|
|
||||||
'Please update the TimeLimit App to the latest release. ' +
|
|
||||||
'In your current version, synchronization and purchases may not work as expected.' +
|
|
||||||
'\n\n' +
|
|
||||||
'Bitte die TimeLimit-App aktualisieren. ' +
|
|
||||||
'Mit der momentan installierten Version kann es zu Einschränkungen bei der Synchronisation und bei Käufen kommen.'
|
|
||||||
|
|
||||||
export function getCampaign({ familyId, isClient750OrNewer }: {
|
|
||||||
familyId: string
|
|
||||||
isClient750OrNewer: boolean
|
|
||||||
}): string | undefined {
|
|
||||||
const now = Date.now()
|
|
||||||
|
|
||||||
const campaigns = [
|
|
||||||
{
|
|
||||||
enable: !isClient750OrNewer,
|
|
||||||
seed: 'Q05NwM4nyUfiYg6K', // require('crypto').randomBytes(12).toString('base64')
|
|
||||||
startTime: 1784160000000, // new Date('2026-07-16').valueOf()
|
|
||||||
endTime: 1785369600000, // new Date('2026-07-30').valueOf()
|
|
||||||
startPercentage: 0,
|
|
||||||
endPercentage: 10,
|
|
||||||
message: updateMessage,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
for (const campaign of campaigns) {
|
|
||||||
if (!campaign.enable) continue
|
|
||||||
if (now < campaign.startTime) continue
|
|
||||||
|
|
||||||
const progress = Math.min((now - campaign.startTime) / (campaign.endTime - campaign.startTime), 1)
|
|
||||||
const chanceInPercent = campaign.startPercentage + progress * (campaign.endPercentage - campaign.startPercentage)
|
|
||||||
|
|
||||||
const hasher = createHash('SHA3-224')
|
|
||||||
|
|
||||||
hasher.update(campaign.seed, 'base64')
|
|
||||||
hasher.update(familyId)
|
|
||||||
|
|
||||||
const hash = hasher.digest().readUInt32BE(0)
|
|
||||||
const match = hash < chanceInPercent * Math.pow(2, 32) / 100
|
|
||||||
|
|
||||||
if (match) return campaign.message
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -45,8 +45,7 @@ export async function getRules ({ database, transaction, categoryIdsToSyncRules,
|
|||||||
'endMinuteOfDay',
|
'endMinuteOfDay',
|
||||||
'sessionDurationMilliseconds',
|
'sessionDurationMilliseconds',
|
||||||
'sessionPauseMilliseconds',
|
'sessionPauseMilliseconds',
|
||||||
'perDay',
|
'perDay'
|
||||||
'expiresAt'
|
|
||||||
],
|
],
|
||||||
transaction
|
transaction
|
||||||
})).map((item) => ({
|
})).map((item) => ({
|
||||||
@@ -59,8 +58,7 @@ export async function getRules ({ database, transaction, categoryIdsToSyncRules,
|
|||||||
endMinuteOfDay: item.endMinuteOfDay,
|
endMinuteOfDay: item.endMinuteOfDay,
|
||||||
sessionDurationMilliseconds: item.sessionDurationMilliseconds,
|
sessionDurationMilliseconds: item.sessionDurationMilliseconds,
|
||||||
sessionPauseMilliseconds: item.sessionPauseMilliseconds,
|
sessionPauseMilliseconds: item.sessionPauseMilliseconds,
|
||||||
perDay: item.perDay,
|
perDay: item.perDay
|
||||||
expiresAt: item.expiresAt ? parseInt(item.expiresAt, 10) : undefined
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const getCategoryRulesVersion = (categoryId: string) => (
|
const getCategoryRulesVersion = (categoryId: string) => (
|
||||||
@@ -78,8 +76,7 @@ export async function getRules ({ database, transaction, categoryIdsToSyncRules,
|
|||||||
end: item.endMinuteOfDay,
|
end: item.endMinuteOfDay,
|
||||||
session: item.sessionDurationMilliseconds,
|
session: item.sessionDurationMilliseconds,
|
||||||
pause: item.sessionPauseMilliseconds,
|
pause: item.sessionPauseMilliseconds,
|
||||||
perDay: item.perDay !== 0 ? true : false,
|
perDay: item.perDay !== 0 ? true : false
|
||||||
e: item.expiresAt
|
|
||||||
})),
|
})),
|
||||||
version: getCategoryRulesVersion(categoryId)
|
version: getCategoryRulesVersion(categoryId)
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -22,7 +22,6 @@ import { getStatusMessage } from '../../../function/statusmessage'
|
|||||||
import { ClientDataStatus } from '../../../object/clientdatastatus'
|
import { ClientDataStatus } from '../../../object/clientdatastatus'
|
||||||
import { ServerDataStatus } from '../../../object/serverdatastatus'
|
import { ServerDataStatus } from '../../../object/serverdatastatus'
|
||||||
import { EventHandler } from '../../../monitoring/eventhandler'
|
import { EventHandler } from '../../../monitoring/eventhandler'
|
||||||
import { getCampaign } from './campaign'
|
|
||||||
import {
|
import {
|
||||||
getCategoryAssignedApps, getCategoryBaseDatas, getCategoryDataToSync,
|
getCategoryAssignedApps, getCategoryBaseDatas, getCategoryDataToSync,
|
||||||
getRules, getTasks, getUsedTimes
|
getRules, getTasks, getUsedTimes
|
||||||
@@ -31,7 +30,6 @@ import { getDeviceDetailList } from './device-detail'
|
|||||||
import { getDeviceList } from './device-list'
|
import { getDeviceList } from './device-list'
|
||||||
import { getDeviceDhKeys } from './dh-keys'
|
import { getDeviceDhKeys } from './dh-keys'
|
||||||
import { getFamilyEntry } from './family-entry'
|
import { getFamilyEntry } from './family-entry'
|
||||||
import { getPings } from './pings'
|
|
||||||
import { getUserList } from './user-list'
|
import { getUserList } from './user-list'
|
||||||
import { getKeyRequests } from './key-requests'
|
import { getKeyRequests } from './key-requests'
|
||||||
import { getKeyResponses } from './key-responses'
|
import { getKeyResponses } from './key-responses'
|
||||||
@@ -54,20 +52,13 @@ export const generateServerDataStatus = async ({
|
|||||||
const doesClientSupportCryptoApps = clientLevel >= 4
|
const doesClientSupportCryptoApps = clientLevel >= 4
|
||||||
const doesClientSupportDh = clientLevel >= 5
|
const doesClientSupportDh = clientLevel >= 5
|
||||||
const doesClientSupportU2f = clientLevel >= 6
|
const doesClientSupportU2f = clientLevel >= 6
|
||||||
const doesClientSupportPing = clientLevel >= 7
|
|
||||||
const isClient750OrNewer = clientLevel >= 8 // first release in the post gplay time
|
|
||||||
|
|
||||||
const message: string | undefined =
|
|
||||||
await getStatusMessage({ database, transaction }) ||
|
|
||||||
getCampaign({ familyId, isClient750OrNewer }) ||
|
|
||||||
undefined
|
|
||||||
|
|
||||||
const result: ServerDataStatus = {
|
const result: ServerDataStatus = {
|
||||||
fullVersion: config.alwaysPro ? 1 : (
|
fullVersion: config.alwaysPro ? 1 : (
|
||||||
familyEntry.hasFullVersion ? parseInt(familyEntry.fullVersionUntil, 10) : 0
|
familyEntry.hasFullVersion ? parseInt(familyEntry.fullVersionUntil, 10) : 0
|
||||||
),
|
),
|
||||||
message,
|
message: await getStatusMessage({ database, transaction }) || undefined,
|
||||||
apiLevel: 9
|
apiLevel: 7
|
||||||
}
|
}
|
||||||
|
|
||||||
if (familyEntry.deviceListVersion !== clientStatus.devices) {
|
if (familyEntry.deviceListVersion !== clientStatus.devices) {
|
||||||
@@ -169,14 +160,5 @@ export const generateServerDataStatus = async ({
|
|||||||
}) || undefined
|
}) || undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doesClientSupportPing) {
|
|
||||||
result.pings = await getPings({
|
|
||||||
database,
|
|
||||||
transaction,
|
|
||||||
familyEntry,
|
|
||||||
deviceId
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* server component for the TimeLimit App
|
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as Sequelize from 'sequelize'
|
|
||||||
import { Database } from '../../../database'
|
|
||||||
import { types as pingTypes } from '../../../database/ping'
|
|
||||||
import { ServerPing } from '../../../object/serverdatastatus'
|
|
||||||
import { FamilyEntry } from './family-entry'
|
|
||||||
|
|
||||||
export async function getPings ({
|
|
||||||
database, transaction, familyEntry, deviceId
|
|
||||||
}: {
|
|
||||||
database: Database
|
|
||||||
transaction: Sequelize.Transaction
|
|
||||||
familyEntry: FamilyEntry
|
|
||||||
deviceId: string
|
|
||||||
}): Promise<Array<ServerPing>> {
|
|
||||||
const savedData = await database.ping.findAll({
|
|
||||||
where: {
|
|
||||||
familyId: familyEntry.familyId,
|
|
||||||
receiverDeviceId: deviceId,
|
|
||||||
},
|
|
||||||
attributes: ['senderDeviceId', 'type', 'token'],
|
|
||||||
transaction
|
|
||||||
})
|
|
||||||
|
|
||||||
return savedData.map((row) => ({
|
|
||||||
deviceId: row.senderDeviceId,
|
|
||||||
type: convertType(row.type),
|
|
||||||
token: row.token
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
function convertType(type: number): 'ping' | 'pong' {
|
|
||||||
if (type === pingTypes.ping) return 'ping'
|
|
||||||
else if (type === pingTypes.pong) return 'pong'
|
|
||||||
else throw new Error()
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -29,12 +29,11 @@ export class TimelimitRule {
|
|||||||
readonly sessionDurationMilliseconds: number
|
readonly sessionDurationMilliseconds: number
|
||||||
readonly sessionPauseMilliseconds: number
|
readonly sessionPauseMilliseconds: number
|
||||||
readonly perDay: boolean
|
readonly perDay: boolean
|
||||||
readonly expiresAt?: number
|
|
||||||
|
|
||||||
constructor ({
|
constructor ({
|
||||||
ruleId, categoryId, maxTimeInMillis, dayMask, applyToExtraTimeUsage,
|
ruleId, categoryId, maxTimeInMillis, dayMask, applyToExtraTimeUsage,
|
||||||
start, end, sessionDurationMilliseconds, sessionPauseMilliseconds,
|
start, end, sessionDurationMilliseconds, sessionPauseMilliseconds,
|
||||||
perDay, expiresAt
|
perDay
|
||||||
}: {
|
}: {
|
||||||
ruleId: string
|
ruleId: string
|
||||||
categoryId: string
|
categoryId: string
|
||||||
@@ -46,7 +45,6 @@ export class TimelimitRule {
|
|||||||
sessionDurationMilliseconds: number
|
sessionDurationMilliseconds: number
|
||||||
sessionPauseMilliseconds: number
|
sessionPauseMilliseconds: number
|
||||||
perDay: boolean
|
perDay: boolean
|
||||||
expiresAt?: number
|
|
||||||
}) {
|
}) {
|
||||||
this.ruleId = ruleId
|
this.ruleId = ruleId
|
||||||
this.categoryId = categoryId
|
this.categoryId = categoryId
|
||||||
@@ -58,7 +56,6 @@ export class TimelimitRule {
|
|||||||
this.sessionDurationMilliseconds = sessionDurationMilliseconds
|
this.sessionDurationMilliseconds = sessionDurationMilliseconds
|
||||||
this.sessionPauseMilliseconds = sessionPauseMilliseconds
|
this.sessionPauseMilliseconds = sessionPauseMilliseconds
|
||||||
this.perDay = perDay
|
this.perDay = perDay
|
||||||
this.expiresAt = expiresAt
|
|
||||||
|
|
||||||
assertIdWithinFamily(ruleId)
|
assertIdWithinFamily(ruleId)
|
||||||
assertIdWithinFamily(categoryId)
|
assertIdWithinFamily(categoryId)
|
||||||
@@ -91,14 +88,6 @@ export class TimelimitRule {
|
|||||||
if (sessionDurationMilliseconds < 0 || sessionPauseMilliseconds < 0) {
|
if (sessionDurationMilliseconds < 0 || sessionPauseMilliseconds < 0) {
|
||||||
throw new ParseTimeLimitRuleException()
|
throw new ParseTimeLimitRuleException()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expiresAt !== undefined) {
|
|
||||||
if (!Number.isSafeInteger(expiresAt)) throw new ParseTimeLimitRuleException()
|
|
||||||
|
|
||||||
if (expiresAt <= 0) {
|
|
||||||
throw new ParseTimeLimitRuleException()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize = (): SerializedTimeLimitRule => ({
|
serialize = (): SerializedTimeLimitRule => ({
|
||||||
@@ -110,11 +99,10 @@ export class TimelimitRule {
|
|||||||
start: this.start,
|
start: this.start,
|
||||||
end: this.end,
|
end: this.end,
|
||||||
pause: this.sessionPauseMilliseconds,
|
pause: this.sessionPauseMilliseconds,
|
||||||
dur: this.sessionDurationMilliseconds,
|
dur: this.sessionDurationMilliseconds
|
||||||
e: this.expiresAt
|
|
||||||
})
|
})
|
||||||
|
|
||||||
static parse = ({ ruleId, categoryId, time, days, extraTime, start, end, dur, pause, perDay, e }: SerializedTimeLimitRule) => (
|
static parse = ({ ruleId, categoryId, time, days, extraTime, start, end, dur, pause, perDay }: SerializedTimeLimitRule) => (
|
||||||
new TimelimitRule({
|
new TimelimitRule({
|
||||||
ruleId,
|
ruleId,
|
||||||
categoryId,
|
categoryId,
|
||||||
@@ -125,8 +113,7 @@ export class TimelimitRule {
|
|||||||
end: end ?? MinuteOfDay.MAX,
|
end: end ?? MinuteOfDay.MAX,
|
||||||
sessionDurationMilliseconds: dur ?? 0,
|
sessionDurationMilliseconds: dur ?? 0,
|
||||||
sessionPauseMilliseconds: pause ?? 0,
|
sessionPauseMilliseconds: pause ?? 0,
|
||||||
perDay: perDay ?? false,
|
perDay: perDay ?? false
|
||||||
expiresAt: e
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -142,7 +129,6 @@ export interface SerializedTimeLimitRule {
|
|||||||
dur?: number
|
dur?: number
|
||||||
pause?: number
|
pause?: number
|
||||||
perDay?: boolean
|
perDay?: boolean
|
||||||
e?: number // expiresAt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ParseTimeLimitRuleException extends Error {}
|
export class ParseTimeLimitRuleException extends Error {}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -34,7 +34,6 @@ export interface ServerDataStatus {
|
|||||||
users?: ServerUserList // newUserList
|
users?: ServerUserList // newUserList
|
||||||
krq?: Array<ServerKeyRequest> // pendingKeyRequests
|
krq?: Array<ServerKeyRequest> // pendingKeyRequests
|
||||||
kr?: Array<ServerKeyResponse> // keyResponses
|
kr?: Array<ServerKeyResponse> // keyResponses
|
||||||
pings?: Array<ServerPing>
|
|
||||||
dh?: ServerDhKey // Diffie Hellman
|
dh?: ServerDhKey // Diffie Hellman
|
||||||
u2f?: U2fData
|
u2f?: U2fData
|
||||||
fullVersion: number // fullVersionUntil
|
fullVersion: number // fullVersionUntil
|
||||||
@@ -258,12 +257,6 @@ export interface ServerKeyResponse {
|
|||||||
signature: string
|
signature: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ServerPing {
|
|
||||||
deviceId: string
|
|
||||||
token: string
|
|
||||||
type: 'ping' | 'pong'
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ServerDhKey {
|
export interface ServerDhKey {
|
||||||
v: string // version
|
v: string // version
|
||||||
k: string // key, base64
|
k: string // key, base64
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -33,15 +33,12 @@ export async function createIdentityToken({ purpose, familyId, userId, mail }: I
|
|||||||
.join('\n')
|
.join('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function verifyIdentitifyToken(token: string, dryRun: boolean): Promise<IdentityTokenPayload> {
|
export async function verifyIdentitifyToken(token: string): Promise<IdentityTokenPayload> {
|
||||||
try {
|
try {
|
||||||
const { payload } = await jwtVerify(
|
const { payload } = await jwtVerify(
|
||||||
Buffer.from(token, 'base64').toString('ascii'),
|
Buffer.from(token, 'base64').toString('ascii'),
|
||||||
getSignSecret(),
|
getSignSecret(),
|
||||||
{
|
{ algorithms: ['HS512'] }
|
||||||
algorithms: ['HS512'],
|
|
||||||
clockTolerance: dryRun ? 0 : '4w',
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!isIdentityTokenPayload(payload)) throw new BadPayloadException()
|
if (!isIdentityTokenPayload(payload)) throw new BadPayloadException()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2026 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -56,7 +56,7 @@ export const createWebsocketHandler = ({ connectedDevicesManager, database }: {
|
|||||||
|
|
||||||
const importantSyncForAllListener = () => {
|
const importantSyncForAllListener = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (socket.connected) socket.emit('should sync', { isImportant: true })
|
socket.connected && socket.emit('should sync', { isImportant: true })
|
||||||
}, Math.random() * 1000 * 60 /* wait up to one minute */)
|
}, Math.random() * 1000 * 60 /* wait up to one minute */)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -11,8 +11,7 @@
|
|||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true
|
||||||
"skipLibCheck": true
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src/**/*"
|
"./src/**/*"
|
||||||
|
|||||||
Reference in New Issue
Block a user