@xyo-network/location-plugin 2.75.15 → 2.75.17
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/dist/docs.json +34 -34
- package/package.json +11 -11
- package/dist/browser/Config.cjs +0 -27
- package/dist/browser/Config.cjs.map +0 -1
- package/dist/browser/Config.js +0 -6
- package/dist/browser/Config.js.map +0 -1
- package/dist/browser/CurrentLocationPayloadSet.cjs +0 -37
- package/dist/browser/CurrentLocationPayloadSet.cjs.map +0 -1
- package/dist/browser/CurrentLocationPayloadSet.js +0 -16
- package/dist/browser/CurrentLocationPayloadSet.js.map +0 -1
- package/dist/browser/CurrentLocationWitness.cjs +0 -70
- package/dist/browser/CurrentLocationWitness.cjs.map +0 -1
- package/dist/browser/CurrentLocationWitness.js +0 -49
- package/dist/browser/CurrentLocationWitness.js.map +0 -1
- package/dist/browser/Plugin.cjs +0 -85
- package/dist/browser/Plugin.cjs.map +0 -1
- package/dist/browser/Plugin.js +0 -64
- package/dist/browser/Plugin.js.map +0 -1
- package/dist/node/Config.js +0 -31
- package/dist/node/Config.js.map +0 -1
- package/dist/node/Config.mjs +0 -6
- package/dist/node/Config.mjs.map +0 -1
- package/dist/node/CurrentLocationPayloadSet.js +0 -41
- package/dist/node/CurrentLocationPayloadSet.js.map +0 -1
- package/dist/node/CurrentLocationPayloadSet.mjs +0 -16
- package/dist/node/CurrentLocationPayloadSet.mjs.map +0 -1
- package/dist/node/CurrentLocationWitness.js +0 -75
- package/dist/node/CurrentLocationWitness.js.map +0 -1
- package/dist/node/CurrentLocationWitness.mjs +0 -50
- package/dist/node/CurrentLocationWitness.mjs.map +0 -1
- package/dist/node/Plugin.js +0 -90
- package/dist/node/Plugin.js.map +0 -1
- package/dist/node/Plugin.mjs +0 -65
- package/dist/node/Plugin.mjs.map +0 -1
package/dist/docs.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"fileName": "plugins/packages/payloadset/packages/location/src/index.ts",
|
|
17
17
|
"line": 10,
|
|
18
18
|
"character": 0,
|
|
19
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
19
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/index.ts#L10"
|
|
20
20
|
}
|
|
21
21
|
],
|
|
22
22
|
"target": 1
|
|
@@ -1591,7 +1591,7 @@
|
|
|
1591
1591
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
1592
1592
|
"line": 8,
|
|
1593
1593
|
"character": 2,
|
|
1594
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
1594
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L8"
|
|
1595
1595
|
}
|
|
1596
1596
|
],
|
|
1597
1597
|
"type": {
|
|
@@ -1613,7 +1613,7 @@
|
|
|
1613
1613
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
1614
1614
|
"line": 7,
|
|
1615
1615
|
"character": 57,
|
|
1616
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
1616
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L7"
|
|
1617
1617
|
}
|
|
1618
1618
|
]
|
|
1619
1619
|
}
|
|
@@ -1874,7 +1874,7 @@
|
|
|
1874
1874
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
1875
1875
|
"line": 11,
|
|
1876
1876
|
"character": 105,
|
|
1877
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
1877
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
1878
1878
|
}
|
|
1879
1879
|
],
|
|
1880
1880
|
"type": {
|
|
@@ -1901,7 +1901,7 @@
|
|
|
1901
1901
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
1902
1902
|
"line": 11,
|
|
1903
1903
|
"character": 103,
|
|
1904
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
1904
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
1905
1905
|
}
|
|
1906
1906
|
]
|
|
1907
1907
|
}
|
|
@@ -3437,7 +3437,7 @@
|
|
|
3437
3437
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
3438
3438
|
"line": 8,
|
|
3439
3439
|
"character": 2,
|
|
3440
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
3440
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L8"
|
|
3441
3441
|
}
|
|
3442
3442
|
],
|
|
3443
3443
|
"type": {
|
|
@@ -3459,7 +3459,7 @@
|
|
|
3459
3459
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
3460
3460
|
"line": 7,
|
|
3461
3461
|
"character": 57,
|
|
3462
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
3462
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L7"
|
|
3463
3463
|
}
|
|
3464
3464
|
]
|
|
3465
3465
|
}
|
|
@@ -3720,7 +3720,7 @@
|
|
|
3720
3720
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
3721
3721
|
"line": 11,
|
|
3722
3722
|
"character": 105,
|
|
3723
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
3723
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
3724
3724
|
}
|
|
3725
3725
|
],
|
|
3726
3726
|
"type": {
|
|
@@ -3747,7 +3747,7 @@
|
|
|
3747
3747
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
3748
3748
|
"line": 11,
|
|
3749
3749
|
"character": 103,
|
|
3750
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
3750
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
3751
3751
|
}
|
|
3752
3752
|
]
|
|
3753
3753
|
}
|
|
@@ -4580,7 +4580,7 @@
|
|
|
4580
4580
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
4581
4581
|
"line": 9,
|
|
4582
4582
|
"character": 18,
|
|
4583
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
4583
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L9"
|
|
4584
4584
|
}
|
|
4585
4585
|
],
|
|
4586
4586
|
"type": {
|
|
@@ -5024,7 +5024,7 @@
|
|
|
5024
5024
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
5025
5025
|
"line": 11,
|
|
5026
5026
|
"character": 6,
|
|
5027
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
5027
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L11"
|
|
5028
5028
|
}
|
|
5029
5029
|
],
|
|
5030
5030
|
"getSignature": {
|
|
@@ -5038,7 +5038,7 @@
|
|
|
5038
5038
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
5039
5039
|
"line": 11,
|
|
5040
5040
|
"character": 6,
|
|
5041
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
5041
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L11"
|
|
5042
5042
|
}
|
|
5043
5043
|
],
|
|
5044
5044
|
"type": {
|
|
@@ -8799,7 +8799,7 @@
|
|
|
8799
8799
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
8800
8800
|
"line": 15,
|
|
8801
8801
|
"character": 2,
|
|
8802
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
8802
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L15"
|
|
8803
8803
|
}
|
|
8804
8804
|
],
|
|
8805
8805
|
"signatures": [
|
|
@@ -8814,7 +8814,7 @@
|
|
|
8814
8814
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
8815
8815
|
"line": 15,
|
|
8816
8816
|
"character": 2,
|
|
8817
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
8817
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L15"
|
|
8818
8818
|
}
|
|
8819
8819
|
],
|
|
8820
8820
|
"type": {
|
|
@@ -9745,7 +9745,7 @@
|
|
|
9745
9745
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
9746
9746
|
"line": 28,
|
|
9747
9747
|
"character": 27,
|
|
9748
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
9748
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L28"
|
|
9749
9749
|
}
|
|
9750
9750
|
],
|
|
9751
9751
|
"signatures": [
|
|
@@ -9760,7 +9760,7 @@
|
|
|
9760
9760
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
9761
9761
|
"line": 28,
|
|
9762
9762
|
"character": 27,
|
|
9763
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
9763
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L28"
|
|
9764
9764
|
}
|
|
9765
9765
|
],
|
|
9766
9766
|
"type": {
|
|
@@ -18182,7 +18182,7 @@
|
|
|
18182
18182
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts",
|
|
18183
18183
|
"line": 8,
|
|
18184
18184
|
"character": 13,
|
|
18185
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18185
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationWitness.ts#L8"
|
|
18186
18186
|
}
|
|
18187
18187
|
],
|
|
18188
18188
|
"typeParameters": [
|
|
@@ -18237,7 +18237,7 @@
|
|
|
18237
18237
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18238
18238
|
"line": 7,
|
|
18239
18239
|
"character": 12,
|
|
18240
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18240
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L7"
|
|
18241
18241
|
}
|
|
18242
18242
|
],
|
|
18243
18243
|
"type": {
|
|
@@ -18267,7 +18267,7 @@
|
|
|
18267
18267
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18268
18268
|
"line": 8,
|
|
18269
18269
|
"character": 2,
|
|
18270
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18270
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L8"
|
|
18271
18271
|
}
|
|
18272
18272
|
],
|
|
18273
18273
|
"type": {
|
|
@@ -18291,7 +18291,7 @@
|
|
|
18291
18291
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18292
18292
|
"line": 7,
|
|
18293
18293
|
"character": 57,
|
|
18294
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18294
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L7"
|
|
18295
18295
|
}
|
|
18296
18296
|
]
|
|
18297
18297
|
}
|
|
@@ -18312,13 +18312,13 @@
|
|
|
18312
18312
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18313
18313
|
"line": 4,
|
|
18314
18314
|
"character": 12,
|
|
18315
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18315
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L4"
|
|
18316
18316
|
},
|
|
18317
18317
|
{
|
|
18318
18318
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18319
18319
|
"line": 5,
|
|
18320
18320
|
"character": 13,
|
|
18321
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18321
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L5"
|
|
18322
18322
|
}
|
|
18323
18323
|
],
|
|
18324
18324
|
"type": {
|
|
@@ -18337,7 +18337,7 @@
|
|
|
18337
18337
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18338
18338
|
"line": 11,
|
|
18339
18339
|
"character": 12,
|
|
18340
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18340
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
18341
18341
|
}
|
|
18342
18342
|
],
|
|
18343
18343
|
"type": {
|
|
@@ -18386,7 +18386,7 @@
|
|
|
18386
18386
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18387
18387
|
"line": 11,
|
|
18388
18388
|
"character": 105,
|
|
18389
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18389
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
18390
18390
|
}
|
|
18391
18391
|
],
|
|
18392
18392
|
"type": {
|
|
@@ -18413,7 +18413,7 @@
|
|
|
18413
18413
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18414
18414
|
"line": 11,
|
|
18415
18415
|
"character": 103,
|
|
18416
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18416
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
18417
18417
|
}
|
|
18418
18418
|
]
|
|
18419
18419
|
}
|
|
@@ -18436,7 +18436,7 @@
|
|
|
18436
18436
|
"fileName": "plugins/packages/payloadset/packages/location/src/CurrentLocationPayloadSet.ts",
|
|
18437
18437
|
"line": 4,
|
|
18438
18438
|
"character": 13,
|
|
18439
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18439
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/CurrentLocationPayloadSet.ts#L4"
|
|
18440
18440
|
}
|
|
18441
18441
|
],
|
|
18442
18442
|
"type": {
|
|
@@ -18461,13 +18461,13 @@
|
|
|
18461
18461
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18462
18462
|
"line": 4,
|
|
18463
18463
|
"character": 12,
|
|
18464
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18464
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L4"
|
|
18465
18465
|
},
|
|
18466
18466
|
{
|
|
18467
18467
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
18468
18468
|
"line": 5,
|
|
18469
18469
|
"character": 13,
|
|
18470
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18470
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L5"
|
|
18471
18471
|
}
|
|
18472
18472
|
],
|
|
18473
18473
|
"type": {
|
|
@@ -18486,7 +18486,7 @@
|
|
|
18486
18486
|
"fileName": "plugins/packages/payloadset/packages/location/src/Plugin.ts",
|
|
18487
18487
|
"line": 7,
|
|
18488
18488
|
"character": 13,
|
|
18489
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18489
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Plugin.ts#L7"
|
|
18490
18490
|
}
|
|
18491
18491
|
],
|
|
18492
18492
|
"signatures": [
|
|
@@ -18501,7 +18501,7 @@
|
|
|
18501
18501
|
"fileName": "plugins/packages/payloadset/packages/location/src/Plugin.ts",
|
|
18502
18502
|
"line": 7,
|
|
18503
18503
|
"character": 30,
|
|
18504
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
18504
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Plugin.ts#L7"
|
|
18505
18505
|
}
|
|
18506
18506
|
],
|
|
18507
18507
|
"type": {
|
|
@@ -20044,7 +20044,7 @@
|
|
|
20044
20044
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
20045
20045
|
"line": 8,
|
|
20046
20046
|
"character": 2,
|
|
20047
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
20047
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L8"
|
|
20048
20048
|
}
|
|
20049
20049
|
],
|
|
20050
20050
|
"type": {
|
|
@@ -20066,7 +20066,7 @@
|
|
|
20066
20066
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
20067
20067
|
"line": 7,
|
|
20068
20068
|
"character": 57,
|
|
20069
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
20069
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L7"
|
|
20070
20070
|
}
|
|
20071
20071
|
]
|
|
20072
20072
|
}
|
|
@@ -20327,7 +20327,7 @@
|
|
|
20327
20327
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
20328
20328
|
"line": 11,
|
|
20329
20329
|
"character": 105,
|
|
20330
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
20330
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
20331
20331
|
}
|
|
20332
20332
|
],
|
|
20333
20333
|
"type": {
|
|
@@ -20354,7 +20354,7 @@
|
|
|
20354
20354
|
"fileName": "plugins/packages/payloadset/packages/location/src/Config.ts",
|
|
20355
20355
|
"line": 11,
|
|
20356
20356
|
"character": 103,
|
|
20357
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/
|
|
20357
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/location/src/Config.ts#L11"
|
|
20358
20358
|
}
|
|
20359
20359
|
]
|
|
20360
20360
|
}
|
package/package.json
CHANGED
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^2.12.
|
|
14
|
-
"@xyo-network/abstract-witness": "~2.75.
|
|
15
|
-
"@xyo-network/location-payload-plugin": "~2.75.
|
|
16
|
-
"@xyo-network/module-model": "~2.75.
|
|
17
|
-
"@xyo-network/payload-model": "~2.75.
|
|
18
|
-
"@xyo-network/payloadset-plugin": "~2.75.
|
|
19
|
-
"@xyo-network/witness-model": "~2.75.
|
|
13
|
+
"@xylabs/assert": "^2.12.24",
|
|
14
|
+
"@xyo-network/abstract-witness": "~2.75.17",
|
|
15
|
+
"@xyo-network/location-payload-plugin": "~2.75.17",
|
|
16
|
+
"@xyo-network/module-model": "~2.75.17",
|
|
17
|
+
"@xyo-network/payload-model": "~2.75.17",
|
|
18
|
+
"@xyo-network/payloadset-plugin": "~2.75.17",
|
|
19
|
+
"@xyo-network/witness-model": "~2.75.17"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
23
|
-
"@xylabs/tsconfig-dom": "^3.
|
|
24
|
-
"@xylabs/tsconfig-dom-jest": "^3.
|
|
22
|
+
"@xylabs/ts-scripts-yarn3": "^3.1.9",
|
|
23
|
+
"@xylabs/tsconfig-dom": "^3.1.9",
|
|
24
|
+
"@xylabs/tsconfig-dom-jest": "^3.1.9",
|
|
25
25
|
"typescript": "^5.2.2"
|
|
26
26
|
},
|
|
27
27
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
68
68
|
},
|
|
69
69
|
"sideEffects": false,
|
|
70
|
-
"version": "2.75.
|
|
70
|
+
"version": "2.75.17"
|
|
71
71
|
}
|
package/dist/browser/Config.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Config.ts
|
|
21
|
-
var Config_exports = {};
|
|
22
|
-
__export(Config_exports, {
|
|
23
|
-
CurrentLocationWitnessConfigSchema: () => CurrentLocationWitnessConfigSchema
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Config_exports);
|
|
26
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
27
|
-
//# sourceMappingURL=Config.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,qCAAyE;","names":[]}
|
package/dist/browser/Config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";AAIO,IAAM,qCAAyE;","names":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/CurrentLocationPayloadSet.ts
|
|
21
|
-
var CurrentLocationPayloadSet_exports = {};
|
|
22
|
-
__export(CurrentLocationPayloadSet_exports, {
|
|
23
|
-
CurrentLocationPayloadSet: () => CurrentLocationPayloadSet
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(CurrentLocationPayloadSet_exports);
|
|
26
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
27
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
28
|
-
var CurrentLocationPayloadSet = {
|
|
29
|
-
optional: {
|
|
30
|
-
[import_location_payload_plugin.LocationHeadingSchema]: 1
|
|
31
|
-
},
|
|
32
|
-
required: {
|
|
33
|
-
[import_location_payload_plugin.LocationSchema]: 1
|
|
34
|
-
},
|
|
35
|
-
schema: import_payload_model.PayloadSetSchema
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=CurrentLocationPayloadSet.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationPayloadSet.ts"],"sourcesContent":["import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetPayload, PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: {\n [LocationHeadingSchema]: 1,\n },\n required: {\n [LocationSchema]: 1,\n },\n schema: PayloadSetSchema,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAAsD;AACtD,2BAAoD;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAAC,oDAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAAC,6CAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQ;AACV;","names":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/CurrentLocationPayloadSet.ts
|
|
2
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
3
|
-
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
4
|
-
var CurrentLocationPayloadSet = {
|
|
5
|
-
optional: {
|
|
6
|
-
[LocationHeadingSchema]: 1
|
|
7
|
-
},
|
|
8
|
-
required: {
|
|
9
|
-
[LocationSchema]: 1
|
|
10
|
-
},
|
|
11
|
-
schema: PayloadSetSchema
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
CurrentLocationPayloadSet
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=CurrentLocationPayloadSet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationPayloadSet.ts"],"sourcesContent":["import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetPayload, PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: {\n [LocationHeadingSchema]: 1,\n },\n required: {\n [LocationSchema]: 1,\n },\n schema: PayloadSetSchema,\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,sBAAsB;AACtD,SAA4B,wBAAwB;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAAC,qBAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAAC,cAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQ;AACV;","names":[]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/CurrentLocationWitness.ts
|
|
21
|
-
var CurrentLocationWitness_exports = {};
|
|
22
|
-
__export(CurrentLocationWitness_exports, {
|
|
23
|
-
CurrentLocationWitness: () => CurrentLocationWitness
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(CurrentLocationWitness_exports);
|
|
26
|
-
var import_assert = require("@xylabs/assert");
|
|
27
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
28
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
29
|
-
|
|
30
|
-
// src/Config.ts
|
|
31
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
32
|
-
|
|
33
|
-
// src/CurrentLocationWitness.ts
|
|
34
|
-
var CurrentLocationWitness = class extends import_abstract_witness.AbstractWitness {
|
|
35
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
36
|
-
get geolocation() {
|
|
37
|
-
return (0, import_assert.assertEx)(this.params.geolocation, "No geolocation provided");
|
|
38
|
-
}
|
|
39
|
-
getCurrentPosition() {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
this.geolocation?.getCurrentPosition(
|
|
42
|
-
(position) => {
|
|
43
|
-
resolve(position);
|
|
44
|
-
},
|
|
45
|
-
(error) => {
|
|
46
|
-
reject(error);
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
async observeHandler() {
|
|
52
|
-
const location = await this.getCurrentPosition();
|
|
53
|
-
const locationPayload = {
|
|
54
|
-
altitude: location.coords.altitude ?? void 0,
|
|
55
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
56
|
-
latitude: location.coords.latitude,
|
|
57
|
-
longitude: location.coords.longitude,
|
|
58
|
-
schema: import_location_payload_plugin.LocationSchema
|
|
59
|
-
};
|
|
60
|
-
const heading = location.coords.heading ? [
|
|
61
|
-
{
|
|
62
|
-
heading: location.coords.heading ?? void 0,
|
|
63
|
-
schema: import_location_payload_plugin.LocationHeadingSchema,
|
|
64
|
-
speed: location.coords.speed ?? void 0
|
|
65
|
-
}
|
|
66
|
-
] : [];
|
|
67
|
-
return [locationPayload, ...heading];
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=CurrentLocationWitness.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,8BAAgC;AAChC,qCAA+F;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,wCAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,eAAO,wBAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAC3D,WAAK,aAAa;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;","names":[]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// src/CurrentLocationWitness.ts
|
|
2
|
-
import { assertEx } from "@xylabs/assert";
|
|
3
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
4
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
5
|
-
|
|
6
|
-
// src/Config.ts
|
|
7
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
8
|
-
|
|
9
|
-
// src/CurrentLocationWitness.ts
|
|
10
|
-
var CurrentLocationWitness = class extends AbstractWitness {
|
|
11
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
12
|
-
get geolocation() {
|
|
13
|
-
return assertEx(this.params.geolocation, "No geolocation provided");
|
|
14
|
-
}
|
|
15
|
-
getCurrentPosition() {
|
|
16
|
-
return new Promise((resolve, reject) => {
|
|
17
|
-
this.geolocation?.getCurrentPosition(
|
|
18
|
-
(position) => {
|
|
19
|
-
resolve(position);
|
|
20
|
-
},
|
|
21
|
-
(error) => {
|
|
22
|
-
reject(error);
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
async observeHandler() {
|
|
28
|
-
const location = await this.getCurrentPosition();
|
|
29
|
-
const locationPayload = {
|
|
30
|
-
altitude: location.coords.altitude ?? void 0,
|
|
31
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
32
|
-
latitude: location.coords.latitude,
|
|
33
|
-
longitude: location.coords.longitude,
|
|
34
|
-
schema: LocationSchema
|
|
35
|
-
};
|
|
36
|
-
const heading = location.coords.heading ? [
|
|
37
|
-
{
|
|
38
|
-
heading: location.coords.heading ?? void 0,
|
|
39
|
-
schema: LocationHeadingSchema,
|
|
40
|
-
speed: location.coords.speed ?? void 0
|
|
41
|
-
}
|
|
42
|
-
] : [];
|
|
43
|
-
return [locationPayload, ...heading];
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
CurrentLocationWitness
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=CurrentLocationWitness.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAiC,uBAAwC,sBAAsB;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAC3D,WAAK,aAAa;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;","names":[]}
|
package/dist/browser/Plugin.cjs
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Plugin.ts
|
|
21
|
-
var Plugin_exports = {};
|
|
22
|
-
__export(Plugin_exports, {
|
|
23
|
-
LocationPlugin: () => LocationPlugin
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Plugin_exports);
|
|
26
|
-
var import_location_payload_plugin2 = require("@xyo-network/location-payload-plugin");
|
|
27
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
28
|
-
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
29
|
-
|
|
30
|
-
// src/CurrentLocationWitness.ts
|
|
31
|
-
var import_assert = require("@xylabs/assert");
|
|
32
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
33
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
34
|
-
|
|
35
|
-
// src/Config.ts
|
|
36
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
37
|
-
|
|
38
|
-
// src/CurrentLocationWitness.ts
|
|
39
|
-
var CurrentLocationWitness = class extends import_abstract_witness.AbstractWitness {
|
|
40
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
41
|
-
get geolocation() {
|
|
42
|
-
return (0, import_assert.assertEx)(this.params.geolocation, "No geolocation provided");
|
|
43
|
-
}
|
|
44
|
-
getCurrentPosition() {
|
|
45
|
-
return new Promise((resolve, reject) => {
|
|
46
|
-
this.geolocation?.getCurrentPosition(
|
|
47
|
-
(position) => {
|
|
48
|
-
resolve(position);
|
|
49
|
-
},
|
|
50
|
-
(error) => {
|
|
51
|
-
reject(error);
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
async observeHandler() {
|
|
57
|
-
const location = await this.getCurrentPosition();
|
|
58
|
-
const locationPayload = {
|
|
59
|
-
altitude: location.coords.altitude ?? void 0,
|
|
60
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
61
|
-
latitude: location.coords.latitude,
|
|
62
|
-
longitude: location.coords.longitude,
|
|
63
|
-
schema: import_location_payload_plugin.LocationSchema
|
|
64
|
-
};
|
|
65
|
-
const heading = location.coords.heading ? [
|
|
66
|
-
{
|
|
67
|
-
heading: location.coords.heading ?? void 0,
|
|
68
|
-
schema: import_location_payload_plugin.LocationHeadingSchema,
|
|
69
|
-
speed: location.coords.speed ?? void 0
|
|
70
|
-
}
|
|
71
|
-
] : [];
|
|
72
|
-
return [locationPayload, ...heading];
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// src/Plugin.ts
|
|
77
|
-
var LocationPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
78
|
-
{ required: { [import_location_payload_plugin2.LocationSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
79
|
-
{
|
|
80
|
-
witness: async (params) => {
|
|
81
|
-
return await CurrentLocationWitness.create(params);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
//# sourceMappingURL=Plugin.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CurrentLocationWitness } from './CurrentLocationWitness'\n\nexport const LocationPlugin = () =>\n createPayloadSetWitnessPlugin<CurrentLocationWitness>(\n { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await CurrentLocationWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,kCAA+B;AAC/B,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,qCAA+F;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,wCAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,eAAO,wBAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAC3D,WAAK,aAAa;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ADzCO,IAAM,iBAAiB,UAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,8CAAc,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":["import_location_payload_plugin"]}
|
package/dist/browser/Plugin.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// src/Plugin.ts
|
|
2
|
-
import { LocationSchema as LocationSchema2 } from "@xyo-network/location-payload-plugin";
|
|
3
|
-
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
4
|
-
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
5
|
-
|
|
6
|
-
// src/CurrentLocationWitness.ts
|
|
7
|
-
import { assertEx } from "@xylabs/assert";
|
|
8
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
9
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
10
|
-
|
|
11
|
-
// src/Config.ts
|
|
12
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
13
|
-
|
|
14
|
-
// src/CurrentLocationWitness.ts
|
|
15
|
-
var CurrentLocationWitness = class extends AbstractWitness {
|
|
16
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
17
|
-
get geolocation() {
|
|
18
|
-
return assertEx(this.params.geolocation, "No geolocation provided");
|
|
19
|
-
}
|
|
20
|
-
getCurrentPosition() {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
this.geolocation?.getCurrentPosition(
|
|
23
|
-
(position) => {
|
|
24
|
-
resolve(position);
|
|
25
|
-
},
|
|
26
|
-
(error) => {
|
|
27
|
-
reject(error);
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async observeHandler() {
|
|
33
|
-
const location = await this.getCurrentPosition();
|
|
34
|
-
const locationPayload = {
|
|
35
|
-
altitude: location.coords.altitude ?? void 0,
|
|
36
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
37
|
-
latitude: location.coords.latitude,
|
|
38
|
-
longitude: location.coords.longitude,
|
|
39
|
-
schema: LocationSchema
|
|
40
|
-
};
|
|
41
|
-
const heading = location.coords.heading ? [
|
|
42
|
-
{
|
|
43
|
-
heading: location.coords.heading ?? void 0,
|
|
44
|
-
schema: LocationHeadingSchema,
|
|
45
|
-
speed: location.coords.speed ?? void 0
|
|
46
|
-
}
|
|
47
|
-
] : [];
|
|
48
|
-
return [locationPayload, ...heading];
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// src/Plugin.ts
|
|
53
|
-
var LocationPlugin = () => createPayloadSetWitnessPlugin(
|
|
54
|
-
{ required: { [LocationSchema2]: 1 }, schema: PayloadSetSchema },
|
|
55
|
-
{
|
|
56
|
-
witness: async (params) => {
|
|
57
|
-
return await CurrentLocationWitness.create(params);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
export {
|
|
62
|
-
LocationPlugin
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=Plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CurrentLocationWitness } from './CurrentLocationWitness'\n\nexport const LocationPlugin = () =>\n createPayloadSetWitnessPlugin<CurrentLocationWitness>(\n { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await CurrentLocationWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";AAAA,SAAS,kBAAAA,uBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAiC,uBAAwC,sBAAsB;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAC3D,WAAK,aAAa;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ADzCO,IAAM,iBAAiB,MAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,eAAc,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":["LocationSchema","LocationSchema"]}
|
package/dist/node/Config.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Config.ts
|
|
21
|
-
var Config_exports = {};
|
|
22
|
-
__export(Config_exports, {
|
|
23
|
-
CurrentLocationWitnessConfigSchema: () => CurrentLocationWitnessConfigSchema
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Config_exports);
|
|
26
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
CurrentLocationWitnessConfigSchema
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=Config.js.map
|
package/dist/node/Config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,qCAAyE;","names":[]}
|
package/dist/node/Config.mjs
DELETED
package/dist/node/Config.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";AAIO,IAAM,qCAAyE;","names":[]}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/CurrentLocationPayloadSet.ts
|
|
21
|
-
var CurrentLocationPayloadSet_exports = {};
|
|
22
|
-
__export(CurrentLocationPayloadSet_exports, {
|
|
23
|
-
CurrentLocationPayloadSet: () => CurrentLocationPayloadSet
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(CurrentLocationPayloadSet_exports);
|
|
26
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
27
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
28
|
-
var CurrentLocationPayloadSet = {
|
|
29
|
-
optional: {
|
|
30
|
-
[import_location_payload_plugin.LocationHeadingSchema]: 1
|
|
31
|
-
},
|
|
32
|
-
required: {
|
|
33
|
-
[import_location_payload_plugin.LocationSchema]: 1
|
|
34
|
-
},
|
|
35
|
-
schema: import_payload_model.PayloadSetSchema
|
|
36
|
-
};
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
CurrentLocationPayloadSet
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=CurrentLocationPayloadSet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationPayloadSet.ts"],"sourcesContent":["import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetPayload, PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: {\n [LocationHeadingSchema]: 1,\n },\n required: {\n [LocationSchema]: 1,\n },\n schema: PayloadSetSchema,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAAsD;AACtD,2BAAoD;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAAC,oDAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAAC,6CAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQ;AACV;","names":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/CurrentLocationPayloadSet.ts
|
|
2
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
3
|
-
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
4
|
-
var CurrentLocationPayloadSet = {
|
|
5
|
-
optional: {
|
|
6
|
-
[LocationHeadingSchema]: 1
|
|
7
|
-
},
|
|
8
|
-
required: {
|
|
9
|
-
[LocationSchema]: 1
|
|
10
|
-
},
|
|
11
|
-
schema: PayloadSetSchema
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
CurrentLocationPayloadSet
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=CurrentLocationPayloadSet.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationPayloadSet.ts"],"sourcesContent":["import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetPayload, PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: {\n [LocationHeadingSchema]: 1,\n },\n required: {\n [LocationSchema]: 1,\n },\n schema: PayloadSetSchema,\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,sBAAsB;AACtD,SAA4B,wBAAwB;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAAC,qBAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAAC,cAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQ;AACV;","names":[]}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/CurrentLocationWitness.ts
|
|
21
|
-
var CurrentLocationWitness_exports = {};
|
|
22
|
-
__export(CurrentLocationWitness_exports, {
|
|
23
|
-
CurrentLocationWitness: () => CurrentLocationWitness
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(CurrentLocationWitness_exports);
|
|
26
|
-
var import_assert = require("@xylabs/assert");
|
|
27
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
28
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
29
|
-
|
|
30
|
-
// src/Config.ts
|
|
31
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
32
|
-
|
|
33
|
-
// src/CurrentLocationWitness.ts
|
|
34
|
-
var CurrentLocationWitness = class extends import_abstract_witness.AbstractWitness {
|
|
35
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
36
|
-
get geolocation() {
|
|
37
|
-
return (0, import_assert.assertEx)(this.params.geolocation, "No geolocation provided");
|
|
38
|
-
}
|
|
39
|
-
getCurrentPosition() {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
var _a;
|
|
42
|
-
(_a = this.geolocation) == null ? void 0 : _a.getCurrentPosition(
|
|
43
|
-
(position) => {
|
|
44
|
-
resolve(position);
|
|
45
|
-
},
|
|
46
|
-
(error) => {
|
|
47
|
-
reject(error);
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
async observeHandler() {
|
|
53
|
-
const location = await this.getCurrentPosition();
|
|
54
|
-
const locationPayload = {
|
|
55
|
-
altitude: location.coords.altitude ?? void 0,
|
|
56
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
57
|
-
latitude: location.coords.latitude,
|
|
58
|
-
longitude: location.coords.longitude,
|
|
59
|
-
schema: import_location_payload_plugin.LocationSchema
|
|
60
|
-
};
|
|
61
|
-
const heading = location.coords.heading ? [
|
|
62
|
-
{
|
|
63
|
-
heading: location.coords.heading ?? void 0,
|
|
64
|
-
schema: import_location_payload_plugin.LocationHeadingSchema,
|
|
65
|
-
speed: location.coords.speed ?? void 0
|
|
66
|
-
}
|
|
67
|
-
] : [];
|
|
68
|
-
return [locationPayload, ...heading];
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
CurrentLocationWitness
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=CurrentLocationWitness.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,8BAAgC;AAChC,qCAA+F;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,wCAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,eAAO,wBAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAfjE;AAgBM,iBAAK,gBAAL,mBAAkB;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA;AAAA,IAEJ,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;","names":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// src/CurrentLocationWitness.ts
|
|
2
|
-
import { assertEx } from "@xylabs/assert";
|
|
3
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
4
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
5
|
-
|
|
6
|
-
// src/Config.ts
|
|
7
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
8
|
-
|
|
9
|
-
// src/CurrentLocationWitness.ts
|
|
10
|
-
var CurrentLocationWitness = class extends AbstractWitness {
|
|
11
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
12
|
-
get geolocation() {
|
|
13
|
-
return assertEx(this.params.geolocation, "No geolocation provided");
|
|
14
|
-
}
|
|
15
|
-
getCurrentPosition() {
|
|
16
|
-
return new Promise((resolve, reject) => {
|
|
17
|
-
var _a;
|
|
18
|
-
(_a = this.geolocation) == null ? void 0 : _a.getCurrentPosition(
|
|
19
|
-
(position) => {
|
|
20
|
-
resolve(position);
|
|
21
|
-
},
|
|
22
|
-
(error) => {
|
|
23
|
-
reject(error);
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
async observeHandler() {
|
|
29
|
-
const location = await this.getCurrentPosition();
|
|
30
|
-
const locationPayload = {
|
|
31
|
-
altitude: location.coords.altitude ?? void 0,
|
|
32
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
33
|
-
latitude: location.coords.latitude,
|
|
34
|
-
longitude: location.coords.longitude,
|
|
35
|
-
schema: LocationSchema
|
|
36
|
-
};
|
|
37
|
-
const heading = location.coords.heading ? [
|
|
38
|
-
{
|
|
39
|
-
heading: location.coords.heading ?? void 0,
|
|
40
|
-
schema: LocationHeadingSchema,
|
|
41
|
-
speed: location.coords.speed ?? void 0
|
|
42
|
-
}
|
|
43
|
-
] : [];
|
|
44
|
-
return [locationPayload, ...heading];
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
CurrentLocationWitness
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=CurrentLocationWitness.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAiC,uBAAwC,sBAAsB;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAfjE;AAgBM,iBAAK,gBAAL,mBAAkB;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA;AAAA,IAEJ,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;","names":[]}
|
package/dist/node/Plugin.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Plugin.ts
|
|
21
|
-
var Plugin_exports = {};
|
|
22
|
-
__export(Plugin_exports, {
|
|
23
|
-
LocationPlugin: () => LocationPlugin
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Plugin_exports);
|
|
26
|
-
var import_location_payload_plugin2 = require("@xyo-network/location-payload-plugin");
|
|
27
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
28
|
-
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
29
|
-
|
|
30
|
-
// src/CurrentLocationWitness.ts
|
|
31
|
-
var import_assert = require("@xylabs/assert");
|
|
32
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
33
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
34
|
-
|
|
35
|
-
// src/Config.ts
|
|
36
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
37
|
-
|
|
38
|
-
// src/CurrentLocationWitness.ts
|
|
39
|
-
var CurrentLocationWitness = class extends import_abstract_witness.AbstractWitness {
|
|
40
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
41
|
-
get geolocation() {
|
|
42
|
-
return (0, import_assert.assertEx)(this.params.geolocation, "No geolocation provided");
|
|
43
|
-
}
|
|
44
|
-
getCurrentPosition() {
|
|
45
|
-
return new Promise((resolve, reject) => {
|
|
46
|
-
var _a;
|
|
47
|
-
(_a = this.geolocation) == null ? void 0 : _a.getCurrentPosition(
|
|
48
|
-
(position) => {
|
|
49
|
-
resolve(position);
|
|
50
|
-
},
|
|
51
|
-
(error) => {
|
|
52
|
-
reject(error);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
async observeHandler() {
|
|
58
|
-
const location = await this.getCurrentPosition();
|
|
59
|
-
const locationPayload = {
|
|
60
|
-
altitude: location.coords.altitude ?? void 0,
|
|
61
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
62
|
-
latitude: location.coords.latitude,
|
|
63
|
-
longitude: location.coords.longitude,
|
|
64
|
-
schema: import_location_payload_plugin.LocationSchema
|
|
65
|
-
};
|
|
66
|
-
const heading = location.coords.heading ? [
|
|
67
|
-
{
|
|
68
|
-
heading: location.coords.heading ?? void 0,
|
|
69
|
-
schema: import_location_payload_plugin.LocationHeadingSchema,
|
|
70
|
-
speed: location.coords.speed ?? void 0
|
|
71
|
-
}
|
|
72
|
-
] : [];
|
|
73
|
-
return [locationPayload, ...heading];
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// src/Plugin.ts
|
|
78
|
-
var LocationPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
79
|
-
{ required: { [import_location_payload_plugin2.LocationSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
80
|
-
{
|
|
81
|
-
witness: async (params) => {
|
|
82
|
-
return await CurrentLocationWitness.create(params);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
-
0 && (module.exports = {
|
|
88
|
-
LocationPlugin
|
|
89
|
-
});
|
|
90
|
-
//# sourceMappingURL=Plugin.js.map
|
package/dist/node/Plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CurrentLocationWitness } from './CurrentLocationWitness'\n\nexport const LocationPlugin = () =>\n createPayloadSetWitnessPlugin<CurrentLocationWitness>(\n { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await CurrentLocationWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,kCAA+B;AAC/B,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,qCAA+F;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,wCAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,eAAO,wBAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAfjE;AAgBM,iBAAK,gBAAL,mBAAkB;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA;AAAA,IAEJ,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ADzCO,IAAM,iBAAiB,UAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,8CAAc,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":["import_location_payload_plugin"]}
|
package/dist/node/Plugin.mjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// src/Plugin.ts
|
|
2
|
-
import { LocationSchema as LocationSchema2 } from "@xyo-network/location-payload-plugin";
|
|
3
|
-
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
4
|
-
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
5
|
-
|
|
6
|
-
// src/CurrentLocationWitness.ts
|
|
7
|
-
import { assertEx } from "@xylabs/assert";
|
|
8
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
9
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
10
|
-
|
|
11
|
-
// src/Config.ts
|
|
12
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
13
|
-
|
|
14
|
-
// src/CurrentLocationWitness.ts
|
|
15
|
-
var CurrentLocationWitness = class extends AbstractWitness {
|
|
16
|
-
static configSchemas = [CurrentLocationWitnessConfigSchema];
|
|
17
|
-
get geolocation() {
|
|
18
|
-
return assertEx(this.params.geolocation, "No geolocation provided");
|
|
19
|
-
}
|
|
20
|
-
getCurrentPosition() {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
var _a;
|
|
23
|
-
(_a = this.geolocation) == null ? void 0 : _a.getCurrentPosition(
|
|
24
|
-
(position) => {
|
|
25
|
-
resolve(position);
|
|
26
|
-
},
|
|
27
|
-
(error) => {
|
|
28
|
-
reject(error);
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async observeHandler() {
|
|
34
|
-
const location = await this.getCurrentPosition();
|
|
35
|
-
const locationPayload = {
|
|
36
|
-
altitude: location.coords.altitude ?? void 0,
|
|
37
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
38
|
-
latitude: location.coords.latitude,
|
|
39
|
-
longitude: location.coords.longitude,
|
|
40
|
-
schema: LocationSchema
|
|
41
|
-
};
|
|
42
|
-
const heading = location.coords.heading ? [
|
|
43
|
-
{
|
|
44
|
-
heading: location.coords.heading ?? void 0,
|
|
45
|
-
schema: LocationHeadingSchema,
|
|
46
|
-
speed: location.coords.speed ?? void 0
|
|
47
|
-
}
|
|
48
|
-
] : [];
|
|
49
|
-
return [locationPayload, ...heading];
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/Plugin.ts
|
|
54
|
-
var LocationPlugin = () => createPayloadSetWitnessPlugin(
|
|
55
|
-
{ required: { [LocationSchema2]: 1 }, schema: PayloadSetSchema },
|
|
56
|
-
{
|
|
57
|
-
witness: async (params) => {
|
|
58
|
-
return await CurrentLocationWitness.create(params);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
export {
|
|
63
|
-
LocationPlugin
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=Plugin.mjs.map
|
package/dist/node/Plugin.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CurrentLocationWitness } from './CurrentLocationWitness'\n\nexport const LocationPlugin = () =>\n createPayloadSetWitnessPlugin<CurrentLocationWitness>(\n { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await CurrentLocationWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [CurrentLocationWitnessConfigSchema]\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[] = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n"],"mappings":";AAAA,SAAS,kBAAAA,uBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAiC,uBAAwC,sBAAsB;;;ACExF,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAfjE;AAgBM,iBAAK,gBAAL,mBAAkB;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA;AAAA,IAEJ,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ADzCO,IAAM,iBAAiB,MAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,eAAc,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":["LocationSchema","LocationSchema"]}
|