agl 43.6.0 → 43.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +27 -0
- package/dist_serve/bundle.js +1801 -1783
- package/dist_serve/bundle.js.map +2 -2
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/aglapi/interfaces.d.ts +35 -0
- package/dist_ts/aglapi/interfaces.js +9 -1
- package/dist_ts/classes.accountsactions.d.ts +3 -1
- package/dist_ts/classes.accountsactions.js +17 -1
- package/dist_ts/classes.apnsclient.d.ts +97 -0
- package/dist_ts/classes.apnsclient.js +363 -0
- package/dist_ts/classes.authmodels.js +19 -6
- package/dist_ts/classes.authstore.js +15 -2
- package/dist_ts/classes.cli.js +8 -1
- package/dist_ts/classes.controller.d.ts +33 -6
- package/dist_ts/classes.controller.js +254 -12
- package/dist_ts/classes.controllerdevices.d.ts +35 -7
- package/dist_ts/classes.controllerdevices.js +86 -13
- package/dist_ts/classes.controllerpush.d.ts +111 -0
- package/dist_ts/classes.controllerpush.js +299 -0
- package/dist_ts/classes.fcmclient.d.ts +78 -0
- package/dist_ts/classes.fcmclient.js +278 -0
- package/dist_ts/classes.inbox.d.ts +10 -2
- package/dist_ts/classes.inbox.js +9 -2
- package/dist_ts/classes.inferencerouter.d.ts +21 -3
- package/dist_ts/classes.inferencerouter.js +40 -17
- package/dist_ts/classes.inferenceservice.js +2 -2
- package/dist_ts/classes.mcpclient.d.ts +5 -0
- package/dist_ts/classes.mcpclient.js +18 -6
- package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -0
- package/dist_ts/classes.mcpcontrollerhost.js +19 -1
- package/dist_ts/classes.mcpvalidation.js +4 -1
- package/dist_ts/classes.mcpworkercaller.d.ts +6 -0
- package/dist_ts/classes.mcpworkercaller.js +26 -4
- package/dist_ts/classes.pushdelivery.d.ts +115 -0
- package/dist_ts/classes.pushdelivery.js +311 -0
- package/dist_ts/classes.pushhandover.d.ts +46 -0
- package/dist_ts/classes.pushhandover.js +131 -0
- package/dist_ts/classes.pushregistrations.d.ts +96 -0
- package/dist_ts/classes.pushregistrations.js +263 -0
- package/dist_ts/classes.pushsettings.d.ts +125 -0
- package/dist_ts/classes.pushsettings.js +377 -0
- package/dist_ts/classes.workercallers.d.ts +73 -2
- package/dist_ts/classes.workercallers.js +354 -43
- package/dist_ts/driver/classes.directreports.d.ts +5 -0
- package/dist_ts/driver/classes.directreports.js +3 -2
- package/dist_ts/fleet/classes.workerlaunches.d.ts +6 -4
- package/dist_ts/fleet/classes.workerlaunches.js +10 -9
- package/dist_ts/fleet/classes.workers.d.ts +12 -2
- package/dist_ts/fleet/classes.workers.js +82 -2
- package/dist_ts/functions.deviceapi.d.ts +23 -3
- package/dist_ts/functions.deviceapi.js +41 -3
- package/dist_ts/functions.inferencecli.js +2 -1
- package/dist_ts/functions.pushcli.d.ts +43 -0
- package/dist_ts/functions.pushcli.js +201 -0
- package/dist_ts/functions.pushcredentials.d.ts +53 -0
- package/dist_ts/functions.pushcredentials.js +111 -0
- package/dist_ts/functions.pushwire.d.ts +8 -0
- package/dist_ts/functions.pushwire.js +83 -0
- package/dist_ts/functions.remotecli.d.ts +2 -2
- package/dist_ts/functions.remotecli.js +4 -4
- package/dist_ts/functions.workercallervalidation.js +3 -2
- package/dist_ts/functions.workerprocessproof.d.ts +12 -0
- package/dist_ts/functions.workerprocessproof.js +32 -1
- package/dist_ts/interfaces.auth.d.ts +27 -3
- package/dist_ts/interfaces.auth.js +10 -1
- package/dist_ts/interfaces.lifecycle.d.ts +7 -1
- package/dist_ts/interfaces.push.d.ts +69 -0
- package/dist_ts/interfaces.push.js +25 -0
- package/dist_ts/plugins.d.ts +5 -2
- package/dist_ts/plugins.js +7 -3
- package/dist_ts_authswitch/authority-contract.d.ts +26 -0
- package/dist_ts_authswitch/authority-contract.js +1 -1
- package/dist_ts_authswitch/authority-overview.d.ts +8 -0
- package/dist_ts_authswitch/authority-overview.js +10 -4
- package/dist_ts_authswitch/authority-placement.d.ts +16 -9
- package/dist_ts_authswitch/authority-placement.js +10 -7
- package/dist_ts_authswitch/authority-priority.d.ts +20 -0
- package/dist_ts_authswitch/authority-priority.js +21 -0
- package/dist_ts_authswitch/classes.authoritybroker.d.ts +7 -0
- package/dist_ts_authswitch/classes.authoritybroker.js +26 -2
- package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
- package/dist_ts_authswitch/classes.authoritycli.js +43 -3
- package/dist_ts_authswitch/classes.authorityclient.d.ts +6 -1
- package/dist_ts_authswitch/classes.authorityclient.js +12 -4
- package/dist_ts_authswitch/classes.authoritydaemon.js +7 -1
- package/dist_ts_authswitch/classes.authoritydatabase.d.ts +6 -0
- package/dist_ts_authswitch/classes.authoritydatabase.js +13 -2
- package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
- package/dist_ts_authswitch/classes.authoritymodels.js +17 -8
- package/dist_ts_interfaces/devices.d.ts +178 -2
- package/dist_ts_interfaces/devices.js +24 -2
- package/dist_ts_interfaces/index.d.ts +1 -0
- package/dist_ts_interfaces/index.js +2 -1
- package/dist_ts_interfaces/mcprequests.d.ts +3 -2
- package/dist_ts_interfaces/mcprequests.js +3 -1
- package/dist_ts_interfaces/push.d.ts +166 -0
- package/dist_ts_interfaces/push.js +24 -0
- package/dist_ts_interfaces/requests.accounts.d.ts +19 -0
- package/dist_ts_interfaces/requests.accounts.js +1 -1
- package/dist_ts_interfaces/requests.d.ts +2 -2
- package/dist_ts_interfaces/requests.js +1 -1
- package/dist_ts_interfaces/workercallers.d.ts +43 -3
- package/docs/authswitch.md +25 -0
- package/package.json +1 -1
- package/readme.md +93 -16
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/aglapi/interfaces.ts +8 -0
- package/ts/classes.accountsactions.ts +25 -0
- package/ts/classes.apnsclient.ts +389 -0
- package/ts/classes.authmodels.ts +21 -5
- package/ts/classes.authstore.ts +14 -1
- package/ts/classes.cli.ts +7 -0
- package/ts/classes.controller.ts +277 -10
- package/ts/classes.controllerdevices.ts +94 -12
- package/ts/classes.controllerpush.ts +351 -0
- package/ts/classes.fcmclient.ts +292 -0
- package/ts/classes.inbox.ts +13 -2
- package/ts/classes.inferencerouter.ts +61 -16
- package/ts/classes.inferenceservice.ts +1 -1
- package/ts/classes.mcpclient.ts +20 -5
- package/ts/classes.mcpcontrollerhost.ts +20 -0
- package/ts/classes.mcpvalidation.ts +2 -0
- package/ts/classes.mcpworkercaller.ts +24 -2
- package/ts/classes.pushdelivery.ts +378 -0
- package/ts/classes.pushhandover.ts +98 -0
- package/ts/classes.pushregistrations.ts +244 -0
- package/ts/classes.pushsettings.ts +428 -0
- package/ts/classes.workercallers.ts +329 -37
- package/ts/driver/classes.directreports.ts +7 -1
- package/ts/fleet/classes.workerlaunches.ts +9 -7
- package/ts/fleet/classes.workers.ts +65 -2
- package/ts/functions.deviceapi.ts +52 -2
- package/ts/functions.inferencecli.ts +1 -0
- package/ts/functions.pushcli.ts +212 -0
- package/ts/functions.pushcredentials.ts +129 -0
- package/ts/functions.pushwire.ts +106 -0
- package/ts/functions.remotecli.ts +3 -2
- package/ts/functions.workercallervalidation.ts +2 -1
- package/ts/functions.workerprocessproof.ts +34 -0
- package/ts/interfaces.auth.ts +27 -3
- package/ts/interfaces.lifecycle.ts +7 -1
- package/ts/interfaces.push.ts +78 -0
- package/ts/plugins.ts +6 -1
- package/ts_authswitch/authority-contract.ts +21 -0
- package/ts_authswitch/authority-overview.ts +19 -5
- package/ts_authswitch/authority-placement.ts +18 -10
- package/ts_authswitch/authority-priority.ts +25 -0
- package/ts_authswitch/classes.authoritybroker.ts +26 -1
- package/ts_authswitch/classes.authoritycli.ts +48 -2
- package/ts_authswitch/classes.authorityclient.ts +14 -4
- package/ts_authswitch/classes.authoritydaemon.ts +8 -1
- package/ts_authswitch/classes.authoritydatabase.ts +11 -1
- package/ts_authswitch/classes.authoritymodels.ts +17 -6
- package/ts_authswitch/readme.md +1 -1
- package/ts_interfaces/devices.schema.json +327 -0
- package/ts_interfaces/devices.ts +206 -1
- package/ts_interfaces/index.ts +1 -0
- package/ts_interfaces/mcprequests.ts +3 -0
- package/ts_interfaces/push.ts +162 -0
- package/ts_interfaces/requests.accounts.ts +17 -0
- package/ts_interfaces/requests.ts +2 -0
- package/ts_interfaces/workercallers.ts +34 -2
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/accounts.plugins.ts +4 -2
- package/ts_web/classes.accountsreadmodel.ts +36 -2
- package/ts_web/elements.accounts.ts +48 -0
|
@@ -634,6 +634,71 @@
|
|
|
634
634
|
"additionalProperties": false
|
|
635
635
|
}
|
|
636
636
|
},
|
|
637
|
+
{
|
|
638
|
+
"name": "IReq_DevicePushRegister",
|
|
639
|
+
"method": "device.push.register",
|
|
640
|
+
"description": "Registers this device for notifications of what comes into the Inbox, and with `reports` of the direct reports' results too: one registration per device, which the next one replaces, so an app registers again with its current token on every connect. Taken also while the host holds no credential to send with (the answer's `available` says so). The token stays on the host: no answer, event or log repeats it. Scope `device`. Since protocol 1.4.",
|
|
641
|
+
"request": {
|
|
642
|
+
"type": "object",
|
|
643
|
+
"properties": {
|
|
644
|
+
"platform": {
|
|
645
|
+
"$ref": "#/components/schemas/TDevicePushPlatform"
|
|
646
|
+
},
|
|
647
|
+
"token": {
|
|
648
|
+
"type": "string",
|
|
649
|
+
"description": "APNs: the device token as lowercase hex, 32 to 100 bytes. FCM: the registration token as the Firebase SDK hands it, 1 to 1024 characters of letters, digits, `_`, `-` and `:`."
|
|
650
|
+
},
|
|
651
|
+
"environment": {
|
|
652
|
+
"$ref": "#/components/schemas/TDevicePushEnvironment",
|
|
653
|
+
"description": "APNs only, and required there: the environment the token belongs to."
|
|
654
|
+
},
|
|
655
|
+
"reports": {
|
|
656
|
+
"type": "boolean",
|
|
657
|
+
"description": "Whether to notify the direct reports' results too."
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
"required": [
|
|
661
|
+
"platform",
|
|
662
|
+
"token",
|
|
663
|
+
"reports"
|
|
664
|
+
],
|
|
665
|
+
"additionalProperties": false
|
|
666
|
+
},
|
|
667
|
+
"response": {
|
|
668
|
+
"type": "object",
|
|
669
|
+
"properties": {
|
|
670
|
+
"push": {
|
|
671
|
+
"$ref": "#/components/schemas/IDeviceHostPush"
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
"required": [
|
|
675
|
+
"push"
|
|
676
|
+
],
|
|
677
|
+
"additionalProperties": false,
|
|
678
|
+
"description": "The registration as `device.host.get` shows it."
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
"name": "IReq_DevicePushUnregister",
|
|
683
|
+
"method": "device.push.unregister",
|
|
684
|
+
"description": "Ends this device's registration: the host sends it no notification from then on. `removed` says whether it held one. Scope `device`. Since protocol 1.4.",
|
|
685
|
+
"request": {
|
|
686
|
+
"type": "object",
|
|
687
|
+
"additionalProperties": false
|
|
688
|
+
},
|
|
689
|
+
"response": {
|
|
690
|
+
"type": "object",
|
|
691
|
+
"properties": {
|
|
692
|
+
"removed": {
|
|
693
|
+
"type": "boolean"
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
"required": [
|
|
697
|
+
"removed"
|
|
698
|
+
],
|
|
699
|
+
"additionalProperties": false
|
|
700
|
+
}
|
|
701
|
+
},
|
|
637
702
|
{
|
|
638
703
|
"name": "IReq_DeviceQuestionReply",
|
|
639
704
|
"method": "device.question.reply",
|
|
@@ -1908,6 +1973,10 @@
|
|
|
1908
1973
|
"lastSeenAt": {
|
|
1909
1974
|
"type": "integer",
|
|
1910
1975
|
"description": "Unix milliseconds of its last authenticated connection, kept to about five minutes."
|
|
1976
|
+
},
|
|
1977
|
+
"push": {
|
|
1978
|
+
"$ref": "#/components/schemas/IDeviceHostPush",
|
|
1979
|
+
"description": "Its notifications, while it is registered for them; absent while it is not. Since protocol 1.4."
|
|
1911
1980
|
}
|
|
1912
1981
|
},
|
|
1913
1982
|
"required": [
|
|
@@ -1971,6 +2040,34 @@
|
|
|
1971
2040
|
"additionalProperties": false,
|
|
1972
2041
|
"description": "The host reached through a TLS reverse proxy the owner runs. Since protocol 1.3."
|
|
1973
2042
|
},
|
|
2043
|
+
"IDeviceHostPush": {
|
|
2044
|
+
"type": "object",
|
|
2045
|
+
"properties": {
|
|
2046
|
+
"reports": {
|
|
2047
|
+
"type": "boolean",
|
|
2048
|
+
"description": "Whether the device asked for direct report results too, besides what waits in the Inbox."
|
|
2049
|
+
},
|
|
2050
|
+
"previews": {
|
|
2051
|
+
"type": "boolean",
|
|
2052
|
+
"description": "Whether notifications carry previews: where an item lives, what it asks and its id (`IDevicePushInboxData`). One setting for every device of the host, which only the owner changes on the host; off unless the owner turns it on."
|
|
2053
|
+
},
|
|
2054
|
+
"available": {
|
|
2055
|
+
"type": "boolean",
|
|
2056
|
+
"description": "Whether the host can send the device notifications now: it holds a credential for the device's platform that Apple or Google did not refuse. While it does not, the registration stays and nothing is sent until the owner sets the credential on the host."
|
|
2057
|
+
},
|
|
2058
|
+
"lastFailure": {
|
|
2059
|
+
"$ref": "#/components/schemas/IDevicePushFailure",
|
|
2060
|
+
"description": "The last notification to the device that did not go out, while none went out after it."
|
|
2061
|
+
}
|
|
2062
|
+
},
|
|
2063
|
+
"required": [
|
|
2064
|
+
"reports",
|
|
2065
|
+
"previews",
|
|
2066
|
+
"available"
|
|
2067
|
+
],
|
|
2068
|
+
"additionalProperties": false,
|
|
2069
|
+
"description": "The notifications a device registered for, as the host sends them: never its token. Since protocol 1.4."
|
|
2070
|
+
},
|
|
1974
2071
|
"IDeviceHostUnavailable": {
|
|
1975
2072
|
"type": "object",
|
|
1976
2073
|
"properties": {
|
|
@@ -2624,6 +2721,175 @@
|
|
|
2624
2721
|
"additionalProperties": false,
|
|
2625
2722
|
"description": "The usage window an account's room is bound by, as its last reading states it. Since protocol 1.3."
|
|
2626
2723
|
},
|
|
2724
|
+
"IDevicePushClearData": {
|
|
2725
|
+
"type": "object",
|
|
2726
|
+
"properties": {
|
|
2727
|
+
"type": {
|
|
2728
|
+
"type": "string",
|
|
2729
|
+
"const": "clear"
|
|
2730
|
+
},
|
|
2731
|
+
"keys": {
|
|
2732
|
+
"type": "string",
|
|
2733
|
+
"description": "The keys of the notifications to remove, separated by single spaces."
|
|
2734
|
+
},
|
|
2735
|
+
"badge": {
|
|
2736
|
+
"type": "string",
|
|
2737
|
+
"description": "The number of items in the Inbox now, in decimal: the app's badge."
|
|
2738
|
+
}
|
|
2739
|
+
},
|
|
2740
|
+
"required": [
|
|
2741
|
+
"type",
|
|
2742
|
+
"keys",
|
|
2743
|
+
"badge"
|
|
2744
|
+
],
|
|
2745
|
+
"additionalProperties": false,
|
|
2746
|
+
"description": "Items left the Inbox: remove their notifications (Android cancels them by tag; on iOS it is a background push, which the system may hold back, so an app also matches its notifications against `device.inbox.list` on every connect). Since protocol 1.4."
|
|
2747
|
+
},
|
|
2748
|
+
"IDevicePushFailure": {
|
|
2749
|
+
"type": "object",
|
|
2750
|
+
"properties": {
|
|
2751
|
+
"at": {
|
|
2752
|
+
"type": "integer",
|
|
2753
|
+
"description": "Unix milliseconds of the failed send."
|
|
2754
|
+
},
|
|
2755
|
+
"reason": {
|
|
2756
|
+
"$ref": "#/components/schemas/TDevicePushFailureReason"
|
|
2757
|
+
}
|
|
2758
|
+
},
|
|
2759
|
+
"required": [
|
|
2760
|
+
"at",
|
|
2761
|
+
"reason"
|
|
2762
|
+
],
|
|
2763
|
+
"additionalProperties": false,
|
|
2764
|
+
"description": "A notification to the device that did not go out. Since protocol 1.4."
|
|
2765
|
+
},
|
|
2766
|
+
"IDevicePushInboxData": {
|
|
2767
|
+
"type": "object",
|
|
2768
|
+
"properties": {
|
|
2769
|
+
"type": {
|
|
2770
|
+
"type": "string",
|
|
2771
|
+
"const": "inbox"
|
|
2772
|
+
},
|
|
2773
|
+
"key": {
|
|
2774
|
+
"type": "string",
|
|
2775
|
+
"description": "The notification's key: base64url of HMAC-SHA256 under the registration's own random salt over the item's id. It names nothing, and the same item has the same key for as long as the registration stands, across restarts of the host, so a notification sent again replaces the one shown (iOS: `apns-collapse-id`; Android: the notification's tag), and a `clear` removes it."
|
|
2776
|
+
},
|
|
2777
|
+
"kind": {
|
|
2778
|
+
"$ref": "#/components/schemas/TDeviceInboxKind"
|
|
2779
|
+
},
|
|
2780
|
+
"badge": {
|
|
2781
|
+
"type": "string",
|
|
2782
|
+
"description": "The number of items in the Inbox after this one came, in decimal: the app's badge (iOS: also `aps.badge`)."
|
|
2783
|
+
},
|
|
2784
|
+
"body": {
|
|
2785
|
+
"type": "string",
|
|
2786
|
+
"description": "Previews off: `devicePushSentences` for the kind. Previews on: the item's title, one line of at most 280 characters."
|
|
2787
|
+
},
|
|
2788
|
+
"title": {
|
|
2789
|
+
"type": "string",
|
|
2790
|
+
"description": "Previews on only: where the item lives, such as the session's name, `Driver` or the ticket's key and title."
|
|
2791
|
+
},
|
|
2792
|
+
"itemId": {
|
|
2793
|
+
"type": "string",
|
|
2794
|
+
"description": "Previews on only: the item's id, as `device.inbox.list` names it."
|
|
2795
|
+
}
|
|
2796
|
+
},
|
|
2797
|
+
"required": [
|
|
2798
|
+
"type",
|
|
2799
|
+
"key",
|
|
2800
|
+
"kind",
|
|
2801
|
+
"badge",
|
|
2802
|
+
"body"
|
|
2803
|
+
],
|
|
2804
|
+
"additionalProperties": false,
|
|
2805
|
+
"description": "One Inbox item that came: an alert (iOS: thread `inbox`, interruption level `active`; Android: channel Inbox). With previews off it says only the kind's fixed sentence; with previews on also where the item lives, what it asks and its id. Tapping it opens the Inbox. Since protocol 1.4."
|
|
2806
|
+
},
|
|
2807
|
+
"IDevicePushReportData": {
|
|
2808
|
+
"type": "object",
|
|
2809
|
+
"properties": {
|
|
2810
|
+
"type": {
|
|
2811
|
+
"type": "string",
|
|
2812
|
+
"const": "report"
|
|
2813
|
+
},
|
|
2814
|
+
"key": {
|
|
2815
|
+
"type": "string",
|
|
2816
|
+
"description": "As an item's key, over the report's name: a newer result of the same report replaces the older one."
|
|
2817
|
+
},
|
|
2818
|
+
"body": {
|
|
2819
|
+
"type": "string",
|
|
2820
|
+
"description": "Previews off: `devicePushReportSentence`. Previews on: the `result:` line."
|
|
2821
|
+
},
|
|
2822
|
+
"title": {
|
|
2823
|
+
"type": "string",
|
|
2824
|
+
"description": "Previews on only: the report's name."
|
|
2825
|
+
}
|
|
2826
|
+
},
|
|
2827
|
+
"required": [
|
|
2828
|
+
"type",
|
|
2829
|
+
"key",
|
|
2830
|
+
"body"
|
|
2831
|
+
],
|
|
2832
|
+
"additionalProperties": false,
|
|
2833
|
+
"description": "A direct report's new `result:` line, sent only to a registration with `reports` (iOS: thread `reports`, interruption level `passive`; Android: channel Reports, low importance). It leaves the badge alone: a result waits for nobody. Since protocol 1.4."
|
|
2834
|
+
},
|
|
2835
|
+
"IDevicePushSummaryData": {
|
|
2836
|
+
"type": "object",
|
|
2837
|
+
"properties": {
|
|
2838
|
+
"type": {
|
|
2839
|
+
"type": "string",
|
|
2840
|
+
"const": "summary"
|
|
2841
|
+
},
|
|
2842
|
+
"key": {
|
|
2843
|
+
"type": "string",
|
|
2844
|
+
"description": "The registration's one summary key, the same for every summary, so a later summary replaces an earlier one."
|
|
2845
|
+
},
|
|
2846
|
+
"count": {
|
|
2847
|
+
"type": "string",
|
|
2848
|
+
"description": "The number of items that came, in decimal."
|
|
2849
|
+
},
|
|
2850
|
+
"badge": {
|
|
2851
|
+
"type": "string",
|
|
2852
|
+
"description": "The number of items in the Inbox, in decimal: the app's badge."
|
|
2853
|
+
},
|
|
2854
|
+
"body": {
|
|
2855
|
+
"type": "string",
|
|
2856
|
+
"description": "`devicePushSummarySentence`."
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2859
|
+
"required": [
|
|
2860
|
+
"type",
|
|
2861
|
+
"key",
|
|
2862
|
+
"count",
|
|
2863
|
+
"badge",
|
|
2864
|
+
"body"
|
|
2865
|
+
],
|
|
2866
|
+
"additionalProperties": false,
|
|
2867
|
+
"description": "More than four items came at once: one notification says so (iOS: thread `inbox`, level `active`; Android: channel Inbox) instead of one per item, with no item's kind, place or id. Since protocol 1.4."
|
|
2868
|
+
},
|
|
2869
|
+
"IDevicePushTestData": {
|
|
2870
|
+
"type": "object",
|
|
2871
|
+
"properties": {
|
|
2872
|
+
"type": {
|
|
2873
|
+
"type": "string",
|
|
2874
|
+
"const": "test"
|
|
2875
|
+
},
|
|
2876
|
+
"key": {
|
|
2877
|
+
"type": "string",
|
|
2878
|
+
"description": "The registration's one test key, the same for every test, so a later test replaces an earlier one."
|
|
2879
|
+
},
|
|
2880
|
+
"body": {
|
|
2881
|
+
"type": "string",
|
|
2882
|
+
"description": "`devicePushTestSentence`."
|
|
2883
|
+
}
|
|
2884
|
+
},
|
|
2885
|
+
"required": [
|
|
2886
|
+
"type",
|
|
2887
|
+
"key",
|
|
2888
|
+
"body"
|
|
2889
|
+
],
|
|
2890
|
+
"additionalProperties": false,
|
|
2891
|
+
"description": "The owner's test notification, which the owner sends on the host to see that notifications reach the device (iOS: thread `inbox`, interruption level `active`; Android: channel Inbox). It names no item and leaves the badge alone; tapping it opens the Inbox. Since protocol 1.4."
|
|
2892
|
+
},
|
|
2627
2893
|
"IDeviceQuestion": {
|
|
2628
2894
|
"type": "object",
|
|
2629
2895
|
"properties": {
|
|
@@ -3937,6 +4203,20 @@
|
|
|
3937
4203
|
],
|
|
3938
4204
|
"description": "One thing that waits for the owner. Since protocol 1.2."
|
|
3939
4205
|
},
|
|
4206
|
+
"TDeviceInboxKind": {
|
|
4207
|
+
"type": "string",
|
|
4208
|
+
"enum": [
|
|
4209
|
+
"permission",
|
|
4210
|
+
"question",
|
|
4211
|
+
"elicitation",
|
|
4212
|
+
"native_wait",
|
|
4213
|
+
"driver",
|
|
4214
|
+
"deploy_go",
|
|
4215
|
+
"window_go",
|
|
4216
|
+
"ticket_question"
|
|
4217
|
+
],
|
|
4218
|
+
"description": "What an Inbox item is, in the order the Inbox lists the kinds: a permission, a question, an MCP form, a wait the harness shows in its own client, the driver's `needs input:` turn, a deploy plan's go, a maintenance window's go, a ticket question. Since protocol 1.2."
|
|
4219
|
+
},
|
|
3940
4220
|
"TDeviceInboxWhere": {
|
|
3941
4221
|
"anyOf": [
|
|
3942
4222
|
{
|
|
@@ -4044,6 +4324,53 @@
|
|
|
4044
4324
|
],
|
|
4045
4325
|
"description": "Whether a pool's account takes new work now, or why not. Since protocol 1.3."
|
|
4046
4326
|
},
|
|
4327
|
+
"TDevicePushData": {
|
|
4328
|
+
"anyOf": [
|
|
4329
|
+
{
|
|
4330
|
+
"$ref": "#/components/schemas/IDevicePushInboxData"
|
|
4331
|
+
},
|
|
4332
|
+
{
|
|
4333
|
+
"$ref": "#/components/schemas/IDevicePushSummaryData"
|
|
4334
|
+
},
|
|
4335
|
+
{
|
|
4336
|
+
"$ref": "#/components/schemas/IDevicePushReportData"
|
|
4337
|
+
},
|
|
4338
|
+
{
|
|
4339
|
+
"$ref": "#/components/schemas/IDevicePushTestData"
|
|
4340
|
+
},
|
|
4341
|
+
{
|
|
4342
|
+
"$ref": "#/components/schemas/IDevicePushClearData"
|
|
4343
|
+
}
|
|
4344
|
+
],
|
|
4345
|
+
"description": "What a notification from the host carries, the same for both platforms, each value a string because FCM data carries only strings: FCM sends it as a data-only message's `data` (the Android app builds the notification itself), APNs as the payload's `agl` object beside `aps` (an alert push for `inbox`, `summary`, `report` and `test`, a background push for `clear`). No notification carries a session's or a ticket's id with previews off. A later minor may add keys and types: an app ignores keys it does not know, and a notification whose `type` it does not know, except an iOS alert push, which the system presents from `aps` without running the app. Since protocol 1.4."
|
|
4346
|
+
},
|
|
4347
|
+
"TDevicePushEnvironment": {
|
|
4348
|
+
"type": "string",
|
|
4349
|
+
"enum": [
|
|
4350
|
+
"sandbox",
|
|
4351
|
+
"production"
|
|
4352
|
+
],
|
|
4353
|
+
"description": "The APNs environment a device token belongs to: `sandbox` for a development build, else `production`. Since protocol 1.4."
|
|
4354
|
+
},
|
|
4355
|
+
"TDevicePushFailureReason": {
|
|
4356
|
+
"type": "string",
|
|
4357
|
+
"enum": [
|
|
4358
|
+
"credential_refused",
|
|
4359
|
+
"refused",
|
|
4360
|
+
"rate_limited",
|
|
4361
|
+
"service_failed",
|
|
4362
|
+
"unreachable"
|
|
4363
|
+
],
|
|
4364
|
+
"description": "Why a notification to a device did not go out: `credential_refused`, Apple or Google refused the host's credential for the platform, and the host sends nothing on it until the owner sets the credential again; `refused`, the push service refused the notification itself; `rate_limited`, it asked the host to send less; `service_failed`, it failed the request; `unreachable`, the host could not reach it. A later minor may add a reason: an app shows one it does not know as a failure without a named cause. Since protocol 1.4."
|
|
4365
|
+
},
|
|
4366
|
+
"TDevicePushPlatform": {
|
|
4367
|
+
"type": "string",
|
|
4368
|
+
"enum": [
|
|
4369
|
+
"apns",
|
|
4370
|
+
"fcm"
|
|
4371
|
+
],
|
|
4372
|
+
"description": "The push service a device registers its token with: Apple's (APNs) or Firebase Cloud Messaging. Since protocol 1.4."
|
|
4373
|
+
},
|
|
4047
4374
|
"TDeviceRefusalCode": {
|
|
4048
4375
|
"type": "string",
|
|
4049
4376
|
"enum": [
|
package/ts_interfaces/devices.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
|
|
18
18
|
|
|
19
19
|
/** The device protocol this controller speaks. */
|
|
20
|
-
export const deviceProtocolVersion = { major: 1, minor:
|
|
20
|
+
export const deviceProtocolVersion = { major: 1, minor: 4 } as const;
|
|
21
21
|
|
|
22
22
|
/** The scheme of a pairing payload: `agl-pair:?origin=<https origin>&controller=<controller id>&code=<base64url>`. */
|
|
23
23
|
export const devicePairingScheme = 'agl-pair' as const;
|
|
@@ -809,8 +809,177 @@ export interface IDeviceHostDevice {
|
|
|
809
809
|
* @asType integer
|
|
810
810
|
*/
|
|
811
811
|
lastSeenAt?: number;
|
|
812
|
+
/** Its notifications, while it is registered for them; absent while it is not. Since protocol 1.4. */
|
|
813
|
+
push?: IDeviceHostPush;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/** The push service a device registers its token with: Apple's (APNs) or Firebase Cloud Messaging. Since protocol 1.4. */
|
|
817
|
+
export type TDevicePushPlatform = 'apns' | 'fcm';
|
|
818
|
+
|
|
819
|
+
/** The APNs environment a device token belongs to: `sandbox` for a development build, else `production`. Since protocol 1.4. */
|
|
820
|
+
export type TDevicePushEnvironment = 'sandbox' | 'production';
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Why a notification to a device did not go out: `credential_refused`, Apple or Google refused the host's credential
|
|
824
|
+
* for the platform, and the host sends nothing on it until the owner sets the credential again; `refused`, the push
|
|
825
|
+
* service refused the notification itself; `rate_limited`, it asked the host to send less; `service_failed`, it failed
|
|
826
|
+
* the request; `unreachable`, the host could not reach it. A later minor may add a reason: an app shows one it does not
|
|
827
|
+
* know as a failure without a named cause. Since protocol 1.4.
|
|
828
|
+
*/
|
|
829
|
+
export type TDevicePushFailureReason = 'credential_refused' | 'refused' | 'rate_limited' | 'service_failed' | 'unreachable';
|
|
830
|
+
|
|
831
|
+
/** A notification to the device that did not go out. Since protocol 1.4. */
|
|
832
|
+
export interface IDevicePushFailure {
|
|
833
|
+
/**
|
|
834
|
+
* Unix milliseconds of the failed send.
|
|
835
|
+
* @asType integer
|
|
836
|
+
*/
|
|
837
|
+
at: number;
|
|
838
|
+
reason: TDevicePushFailureReason;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* The notifications a device registered for, as the host sends them: never its token. Since protocol 1.4.
|
|
843
|
+
*/
|
|
844
|
+
export interface IDeviceHostPush {
|
|
845
|
+
/** Whether the device asked for direct report results too, besides what waits in the Inbox. */
|
|
846
|
+
reports: boolean;
|
|
847
|
+
/**
|
|
848
|
+
* Whether notifications carry previews: where an item lives, what it asks and its id (`IDevicePushInboxData`). One
|
|
849
|
+
* setting for every device of the host, which only the owner changes on the host; off unless the owner turns it on.
|
|
850
|
+
*/
|
|
851
|
+
previews: boolean;
|
|
852
|
+
/**
|
|
853
|
+
* Whether the host can send the device notifications now: it holds a credential for the device's platform that Apple
|
|
854
|
+
* or Google did not refuse. While it does not, the registration stays and nothing is sent until the owner sets the
|
|
855
|
+
* credential on the host.
|
|
856
|
+
*/
|
|
857
|
+
available: boolean;
|
|
858
|
+
/** The last notification to the device that did not go out, while none went out after it. */
|
|
859
|
+
lastFailure?: IDevicePushFailure;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* A notification's text with previews off for an item of each kind: one fixed sentence that says only the kind.
|
|
864
|
+
* Since protocol 1.4.
|
|
865
|
+
*/
|
|
866
|
+
export const devicePushSentences: Readonly<Record<TDeviceInboxKind, string>> = {
|
|
867
|
+
permission: 'A session waits for your permission.',
|
|
868
|
+
question: 'A session asks you a question.',
|
|
869
|
+
elicitation: 'A session asks you to fill in a form.',
|
|
870
|
+
native_wait: 'A session waits for you on the host.',
|
|
871
|
+
driver: 'The driver needs your input.',
|
|
872
|
+
deploy_go: 'A deploy waits for your go.',
|
|
873
|
+
window_go: 'A maintenance window waits for your go.',
|
|
874
|
+
ticket_question: 'A ticket asks you a question.',
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
/** A summary notification's text. Since protocol 1.4. */
|
|
878
|
+
export const devicePushSummarySentence = 'New items wait for you in the Inbox.';
|
|
879
|
+
|
|
880
|
+
/** A direct report's notification text with previews off. Since protocol 1.4. */
|
|
881
|
+
export const devicePushReportSentence = 'A direct report has a new result.';
|
|
882
|
+
|
|
883
|
+
/** The text of the owner's test notification. Since protocol 1.4. */
|
|
884
|
+
export const devicePushTestSentence = 'Push from AGL works.';
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* One Inbox item that came: an alert (iOS: thread `inbox`, interruption level `active`; Android: channel Inbox). With
|
|
888
|
+
* previews off it says only the kind's fixed sentence; with previews on also where the item lives, what it asks and
|
|
889
|
+
* its id. Tapping it opens the Inbox. Since protocol 1.4.
|
|
890
|
+
*/
|
|
891
|
+
export interface IDevicePushInboxData {
|
|
892
|
+
type: 'inbox';
|
|
893
|
+
/**
|
|
894
|
+
* The notification's key: base64url of HMAC-SHA256 under the registration's own random salt over the item's id. It
|
|
895
|
+
* names nothing, and the same item has the same key for as long as the registration stands, across restarts of the
|
|
896
|
+
* host, so a notification sent again replaces the one shown (iOS: `apns-collapse-id`; Android: the notification's
|
|
897
|
+
* tag), and a `clear` removes it.
|
|
898
|
+
*/
|
|
899
|
+
key: string;
|
|
900
|
+
kind: TDeviceInboxKind;
|
|
901
|
+
/** The number of items in the Inbox after this one came, in decimal: the app's badge (iOS: also `aps.badge`). */
|
|
902
|
+
badge: string;
|
|
903
|
+
/** Previews off: `devicePushSentences` for the kind. Previews on: the item's title, one line of at most 280 characters. */
|
|
904
|
+
body: string;
|
|
905
|
+
/** Previews on only: where the item lives, such as the session's name, `Driver` or the ticket's key and title. */
|
|
906
|
+
title?: string;
|
|
907
|
+
/** Previews on only: the item's id, as `device.inbox.list` names it. */
|
|
908
|
+
itemId?: string;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* More than four items came at once: one notification says so (iOS: thread `inbox`, level `active`; Android: channel
|
|
913
|
+
* Inbox) instead of one per item, with no item's kind, place or id. Since protocol 1.4.
|
|
914
|
+
*/
|
|
915
|
+
export interface IDevicePushSummaryData {
|
|
916
|
+
type: 'summary';
|
|
917
|
+
/** The registration's one summary key, the same for every summary, so a later summary replaces an earlier one. */
|
|
918
|
+
key: string;
|
|
919
|
+
/** The number of items that came, in decimal. */
|
|
920
|
+
count: string;
|
|
921
|
+
/** The number of items in the Inbox, in decimal: the app's badge. */
|
|
922
|
+
badge: string;
|
|
923
|
+
/** `devicePushSummarySentence`. */
|
|
924
|
+
body: string;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* A direct report's new `result:` line, sent only to a registration with `reports` (iOS: thread `reports`,
|
|
929
|
+
* interruption level `passive`; Android: channel Reports, low importance). It leaves the badge alone: a result waits
|
|
930
|
+
* for nobody. Since protocol 1.4.
|
|
931
|
+
*/
|
|
932
|
+
export interface IDevicePushReportData {
|
|
933
|
+
type: 'report';
|
|
934
|
+
/** As an item's key, over the report's name: a newer result of the same report replaces the older one. */
|
|
935
|
+
key: string;
|
|
936
|
+
/** Previews off: `devicePushReportSentence`. Previews on: the `result:` line. */
|
|
937
|
+
body: string;
|
|
938
|
+
/** Previews on only: the report's name. */
|
|
939
|
+
title?: string;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* The owner's test notification, which the owner sends on the host to see that notifications reach the device (iOS:
|
|
944
|
+
* thread `inbox`, interruption level `active`; Android: channel Inbox). It names no item and leaves the badge alone;
|
|
945
|
+
* tapping it opens the Inbox. Since protocol 1.4.
|
|
946
|
+
*/
|
|
947
|
+
export interface IDevicePushTestData {
|
|
948
|
+
type: 'test';
|
|
949
|
+
/** The registration's one test key, the same for every test, so a later test replaces an earlier one. */
|
|
950
|
+
key: string;
|
|
951
|
+
/** `devicePushTestSentence`. */
|
|
952
|
+
body: string;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Items left the Inbox: remove their notifications (Android cancels them by tag; on iOS it is a background push, which
|
|
957
|
+
* the system may hold back, so an app also matches its notifications against `device.inbox.list` on every connect).
|
|
958
|
+
* Since protocol 1.4.
|
|
959
|
+
*/
|
|
960
|
+
export interface IDevicePushClearData {
|
|
961
|
+
type: 'clear';
|
|
962
|
+
/** The keys of the notifications to remove, separated by single spaces. */
|
|
963
|
+
keys: string;
|
|
964
|
+
/** The number of items in the Inbox now, in decimal: the app's badge. */
|
|
965
|
+
badge: string;
|
|
812
966
|
}
|
|
813
967
|
|
|
968
|
+
/**
|
|
969
|
+
* What a notification from the host carries, the same for both platforms, each value a string because FCM data carries
|
|
970
|
+
* only strings: FCM sends it as a data-only message's `data` (the Android app builds the notification itself), APNs as
|
|
971
|
+
* the payload's `agl` object beside `aps` (an alert push for `inbox`, `summary`, `report` and `test`, a background push
|
|
972
|
+
* for `clear`). No notification carries a session's or a ticket's id with previews off. A later minor may add keys and
|
|
973
|
+
* types: an app ignores keys it does not know, and a notification whose `type` it does not know, except an iOS alert
|
|
974
|
+
* push, which the system presents from `aps` without running the app. Since protocol 1.4.
|
|
975
|
+
*/
|
|
976
|
+
export type TDevicePushData =
|
|
977
|
+
| IDevicePushInboxData
|
|
978
|
+
| IDevicePushSummaryData
|
|
979
|
+
| IDevicePushReportData
|
|
980
|
+
| IDevicePushTestData
|
|
981
|
+
| IDevicePushClearData;
|
|
982
|
+
|
|
814
983
|
/**
|
|
815
984
|
* Why a section was not read: `not_running`, what answers it does not run now (the configuration service the deploy
|
|
816
985
|
* monitor reads, the inference proxy or the accounts service; it may be starting); `outdated`, it runs a release this
|
|
@@ -1493,6 +1662,40 @@ export interface IReq_DeviceHostGet extends implementsTR<ITypedRequest, IReq_Dev
|
|
|
1493
1662
|
};
|
|
1494
1663
|
}
|
|
1495
1664
|
|
|
1665
|
+
/**
|
|
1666
|
+
* Registers this device for notifications of what comes into the Inbox, and with `reports` of the direct reports'
|
|
1667
|
+
* results too: one registration per device, which the next one replaces, so an app registers again with its current
|
|
1668
|
+
* token on every connect. Taken also while the host holds no credential to send with (the answer's `available` says
|
|
1669
|
+
* so). The token stays on the host: no answer, event or log repeats it. Scope `device`. Since protocol 1.4.
|
|
1670
|
+
*/
|
|
1671
|
+
export interface IReq_DevicePushRegister extends implementsTR<ITypedRequest, IReq_DevicePushRegister> {
|
|
1672
|
+
method: 'device.push.register';
|
|
1673
|
+
request: {
|
|
1674
|
+
platform: TDevicePushPlatform;
|
|
1675
|
+
/**
|
|
1676
|
+
* APNs: the device token as lowercase hex, 32 to 100 bytes. FCM: the registration token as the Firebase SDK hands
|
|
1677
|
+
* it, 1 to 1024 characters of letters, digits, `_`, `-` and `:`.
|
|
1678
|
+
*/
|
|
1679
|
+
token: string;
|
|
1680
|
+
/** APNs only, and required there: the environment the token belongs to. */
|
|
1681
|
+
environment?: TDevicePushEnvironment;
|
|
1682
|
+
/** Whether to notify the direct reports' results too. */
|
|
1683
|
+
reports: boolean;
|
|
1684
|
+
};
|
|
1685
|
+
/** The registration as `device.host.get` shows it. */
|
|
1686
|
+
response: { push: IDeviceHostPush };
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Ends this device's registration: the host sends it no notification from then on. `removed` says whether it held one.
|
|
1691
|
+
* Scope `device`. Since protocol 1.4.
|
|
1692
|
+
*/
|
|
1693
|
+
export interface IReq_DevicePushUnregister extends implementsTR<ITypedRequest, IReq_DevicePushUnregister> {
|
|
1694
|
+
method: 'device.push.unregister';
|
|
1695
|
+
request: {};
|
|
1696
|
+
response: { removed: boolean };
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1496
1699
|
/**
|
|
1497
1700
|
* One column of the shared board, as the browser's board shows its cards: the tasks (an epic and its subtasks show on
|
|
1498
1701
|
* their task's card in the browser; a device opens them with `device.ticket.get`), in the column's order, `limit` from
|
|
@@ -1634,6 +1837,8 @@ export const deviceMethods = [
|
|
|
1634
1837
|
'device.directreports.list',
|
|
1635
1838
|
'device.directreport.message',
|
|
1636
1839
|
'device.host.get',
|
|
1840
|
+
'device.push.register',
|
|
1841
|
+
'device.push.unregister',
|
|
1637
1842
|
'device.board.list',
|
|
1638
1843
|
'device.ticket.get',
|
|
1639
1844
|
'device.ticket.comment',
|
package/ts_interfaces/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { controllerMcpTicketMethods, type TControllerMcpTicketTypedRequest } fro
|
|
|
5
5
|
import { controllerMcpFleetMethods, type TControllerMcpFleetTypedRequest } from './requests.fleet.js';
|
|
6
6
|
import { controllerMcpSessionFeedMethods, type TControllerMcpSessionFeedTypedRequest } from './sessionfeed.js';
|
|
7
7
|
import { controllerMcpDeployMethods, type TControllerMcpDeployTypedRequest } from './deployments.js';
|
|
8
|
+
import { controllerMcpPushMethods, type TControllerMcpPushTypedRequest } from './push.js';
|
|
8
9
|
import * as plugins from './plugins.js';
|
|
9
10
|
import type { IProxyCapacityAnswer, IProxyCapacityRequest } from './proxycapacity.js';
|
|
10
11
|
import type { IReq_ControllerMcpWorkerEnroll, IWorkerCallerSubject } from './workercallers.js';
|
|
@@ -68,6 +69,7 @@ export const controllerMcpMethods = [
|
|
|
68
69
|
...controllerMcpFleetWorkerMethods,
|
|
69
70
|
...controllerMcpSessionFeedMethods,
|
|
70
71
|
...controllerMcpDeployMethods,
|
|
72
|
+
...controllerMcpPushMethods,
|
|
71
73
|
'agl.mcp.worker.enroll',
|
|
72
74
|
] as const;
|
|
73
75
|
export type TControllerMcpMethod = (typeof controllerMcpMethods)[number];
|
|
@@ -492,6 +494,7 @@ export type TControllerMcpTypedRequest =
|
|
|
492
494
|
| TControllerMcpFleetWorkerTypedRequest
|
|
493
495
|
| TControllerMcpSessionFeedTypedRequest
|
|
494
496
|
| TControllerMcpDeployTypedRequest
|
|
497
|
+
| TControllerMcpPushTypedRequest
|
|
495
498
|
| IReq_ControllerMcpSettingsGet
|
|
496
499
|
| IReq_ControllerMcpSettingsUpdate
|
|
497
500
|
| TControllerMcpWorkspaceTypedRequest
|