mawsitsit 0.1.13 → 0.1.14
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.
- checksums.yaml +4 -4
- data/Cargo.lock +37 -38
- data/ext/mawsitsit/Cargo.toml +0 -1
- data/ext/mawsitsit/src/parser/manipulators.rs +9 -2
- data/ext/mawsitsit/src/parser/parser.rs +3 -0
- data/ext/mawsitsit/src/parser/utils/helpers.rs +1 -5
- data/lib/mawsitsit/version.rb +1 -1
- data/var/destination.json +1 -1
- data/var/test_1.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6bf107f10254c4381ea6ddb43804bab677e9d21652f88979c92aee21efe85bf0
|
|
4
|
+
data.tar.gz: cae9847e3ed605ab6c9323883b4b04577455a42f52b3e27bc4f2305a39616122
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 287bc58ab99f97a3f0c78c7ac71f558e5d3d40dafff21e7bcd41fdc08f3ddce1cbc2d152dd9cf035f332c5b97ad62f222d1d61016bde01ccaf68433e9716d7e4
|
|
7
|
+
data.tar.gz: 61dfc1aec419c9e2665d71551bdcaf57bebf5e590a08e6a982d4ad413c6a82cc60af51451d8a1f942f552aa10f8c6060360f3bddf4f8684c947825d57183117e
|
data/Cargo.lock
CHANGED
|
@@ -49,7 +49,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
|
|
|
49
49
|
dependencies = [
|
|
50
50
|
"proc-macro2",
|
|
51
51
|
"quote",
|
|
52
|
-
"syn 2.0.
|
|
52
|
+
"syn 2.0.68",
|
|
53
53
|
]
|
|
54
54
|
|
|
55
55
|
[[package]]
|
|
@@ -91,7 +91,7 @@ version = "0.69.4"
|
|
|
91
91
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
92
92
|
checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
|
|
93
93
|
dependencies = [
|
|
94
|
-
"bitflags 2.
|
|
94
|
+
"bitflags 2.6.0",
|
|
95
95
|
"cexpr",
|
|
96
96
|
"clang-sys",
|
|
97
97
|
"itertools",
|
|
@@ -102,7 +102,7 @@ dependencies = [
|
|
|
102
102
|
"regex",
|
|
103
103
|
"rustc-hash",
|
|
104
104
|
"shlex",
|
|
105
|
-
"syn 2.0.
|
|
105
|
+
"syn 2.0.68",
|
|
106
106
|
]
|
|
107
107
|
|
|
108
108
|
[[package]]
|
|
@@ -113,9 +113,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
|
113
113
|
|
|
114
114
|
[[package]]
|
|
115
115
|
name = "bitflags"
|
|
116
|
-
version = "2.
|
|
116
|
+
version = "2.6.0"
|
|
117
117
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
-
checksum = "
|
|
118
|
+
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
|
119
119
|
|
|
120
120
|
[[package]]
|
|
121
121
|
name = "bumpalo"
|
|
@@ -131,9 +131,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
|
|
|
131
131
|
|
|
132
132
|
[[package]]
|
|
133
133
|
name = "cc"
|
|
134
|
-
version = "1.0.
|
|
134
|
+
version = "1.0.101"
|
|
135
135
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
-
checksum = "
|
|
136
|
+
checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d"
|
|
137
137
|
|
|
138
138
|
[[package]]
|
|
139
139
|
name = "cexpr"
|
|
@@ -193,9 +193,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
|
|
|
193
193
|
|
|
194
194
|
[[package]]
|
|
195
195
|
name = "either"
|
|
196
|
-
version = "1.
|
|
196
|
+
version = "1.13.0"
|
|
197
197
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
198
|
-
checksum = "
|
|
198
|
+
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
|
199
199
|
|
|
200
200
|
[[package]]
|
|
201
201
|
name = "encoding_rs"
|
|
@@ -345,7 +345,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
|
|
|
345
345
|
dependencies = [
|
|
346
346
|
"proc-macro2",
|
|
347
347
|
"quote",
|
|
348
|
-
"syn 2.0.
|
|
348
|
+
"syn 2.0.68",
|
|
349
349
|
]
|
|
350
350
|
|
|
351
351
|
[[package]]
|
|
@@ -620,9 +620,9 @@ dependencies = [
|
|
|
620
620
|
|
|
621
621
|
[[package]]
|
|
622
622
|
name = "lazy_static"
|
|
623
|
-
version = "1.
|
|
623
|
+
version = "1.5.0"
|
|
624
624
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
625
|
-
checksum = "
|
|
625
|
+
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
|
626
626
|
|
|
627
627
|
[[package]]
|
|
628
628
|
name = "lazycell"
|
|
@@ -638,9 +638,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
|
|
638
638
|
|
|
639
639
|
[[package]]
|
|
640
640
|
name = "libloading"
|
|
641
|
-
version = "0.8.
|
|
641
|
+
version = "0.8.4"
|
|
642
642
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
643
|
-
checksum = "
|
|
643
|
+
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
|
|
644
644
|
dependencies = [
|
|
645
645
|
"cfg-if",
|
|
646
646
|
"windows-targets 0.52.5",
|
|
@@ -664,9 +664,9 @@ dependencies = [
|
|
|
664
664
|
|
|
665
665
|
[[package]]
|
|
666
666
|
name = "log"
|
|
667
|
-
version = "0.4.
|
|
667
|
+
version = "0.4.22"
|
|
668
668
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
669
|
-
checksum = "
|
|
669
|
+
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
|
670
670
|
|
|
671
671
|
[[package]]
|
|
672
672
|
name = "magnus"
|
|
@@ -688,7 +688,7 @@ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
|
|
|
688
688
|
dependencies = [
|
|
689
689
|
"proc-macro2",
|
|
690
690
|
"quote",
|
|
691
|
-
"syn 2.0.
|
|
691
|
+
"syn 2.0.68",
|
|
692
692
|
]
|
|
693
693
|
|
|
694
694
|
[[package]]
|
|
@@ -696,7 +696,6 @@ name = "mawsitsit"
|
|
|
696
696
|
version = "0.1.0"
|
|
697
697
|
dependencies = [
|
|
698
698
|
"async-recursion",
|
|
699
|
-
"base64",
|
|
700
699
|
"chrono",
|
|
701
700
|
"exitfailure",
|
|
702
701
|
"futures",
|
|
@@ -815,7 +814,7 @@ version = "0.10.64"
|
|
|
815
814
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
816
815
|
checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f"
|
|
817
816
|
dependencies = [
|
|
818
|
-
"bitflags 2.
|
|
817
|
+
"bitflags 2.6.0",
|
|
819
818
|
"cfg-if",
|
|
820
819
|
"foreign-types",
|
|
821
820
|
"libc",
|
|
@@ -832,7 +831,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
|
|
832
831
|
dependencies = [
|
|
833
832
|
"proc-macro2",
|
|
834
833
|
"quote",
|
|
835
|
-
"syn 2.0.
|
|
834
|
+
"syn 2.0.68",
|
|
836
835
|
]
|
|
837
836
|
|
|
838
837
|
[[package]]
|
|
@@ -899,7 +898,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
|
|
|
899
898
|
dependencies = [
|
|
900
899
|
"proc-macro2",
|
|
901
900
|
"quote",
|
|
902
|
-
"syn 2.0.
|
|
901
|
+
"syn 2.0.68",
|
|
903
902
|
]
|
|
904
903
|
|
|
905
904
|
[[package]]
|
|
@@ -959,7 +958,7 @@ dependencies = [
|
|
|
959
958
|
"quote",
|
|
960
959
|
"regex",
|
|
961
960
|
"shell-words",
|
|
962
|
-
"syn 2.0.
|
|
961
|
+
"syn 2.0.68",
|
|
963
962
|
]
|
|
964
963
|
|
|
965
964
|
[[package]]
|
|
@@ -974,7 +973,7 @@ version = "0.5.2"
|
|
|
974
973
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
975
974
|
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
|
|
976
975
|
dependencies = [
|
|
977
|
-
"bitflags 2.
|
|
976
|
+
"bitflags 2.6.0",
|
|
978
977
|
]
|
|
979
978
|
|
|
980
979
|
[[package]]
|
|
@@ -1082,7 +1081,7 @@ version = "0.38.34"
|
|
|
1082
1081
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1083
1082
|
checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
|
|
1084
1083
|
dependencies = [
|
|
1085
|
-
"bitflags 2.
|
|
1084
|
+
"bitflags 2.6.0",
|
|
1086
1085
|
"errno",
|
|
1087
1086
|
"libc",
|
|
1088
1087
|
"linux-raw-sys",
|
|
@@ -1156,7 +1155,7 @@ version = "2.11.0"
|
|
|
1156
1155
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1157
1156
|
checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0"
|
|
1158
1157
|
dependencies = [
|
|
1159
|
-
"bitflags 2.
|
|
1158
|
+
"bitflags 2.6.0",
|
|
1160
1159
|
"core-foundation",
|
|
1161
1160
|
"core-foundation-sys",
|
|
1162
1161
|
"libc",
|
|
@@ -1196,14 +1195,14 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
|
|
|
1196
1195
|
dependencies = [
|
|
1197
1196
|
"proc-macro2",
|
|
1198
1197
|
"quote",
|
|
1199
|
-
"syn 2.0.
|
|
1198
|
+
"syn 2.0.68",
|
|
1200
1199
|
]
|
|
1201
1200
|
|
|
1202
1201
|
[[package]]
|
|
1203
1202
|
name = "serde_json"
|
|
1204
|
-
version = "1.0.
|
|
1203
|
+
version = "1.0.118"
|
|
1205
1204
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1206
|
-
checksum = "
|
|
1205
|
+
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
|
|
1207
1206
|
dependencies = [
|
|
1208
1207
|
"itoa",
|
|
1209
1208
|
"ryu",
|
|
@@ -1287,9 +1286,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
|
|
|
1287
1286
|
|
|
1288
1287
|
[[package]]
|
|
1289
1288
|
name = "subtle"
|
|
1290
|
-
version = "2.6.
|
|
1289
|
+
version = "2.6.1"
|
|
1291
1290
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1292
|
-
checksum = "
|
|
1291
|
+
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|
1293
1292
|
|
|
1294
1293
|
[[package]]
|
|
1295
1294
|
name = "syn"
|
|
@@ -1304,9 +1303,9 @@ dependencies = [
|
|
|
1304
1303
|
|
|
1305
1304
|
[[package]]
|
|
1306
1305
|
name = "syn"
|
|
1307
|
-
version = "2.0.
|
|
1306
|
+
version = "2.0.68"
|
|
1308
1307
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1309
|
-
checksum = "
|
|
1308
|
+
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
|
|
1310
1309
|
dependencies = [
|
|
1311
1310
|
"proc-macro2",
|
|
1312
1311
|
"quote",
|
|
@@ -1387,14 +1386,14 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
|
|
|
1387
1386
|
dependencies = [
|
|
1388
1387
|
"proc-macro2",
|
|
1389
1388
|
"quote",
|
|
1390
|
-
"syn 2.0.
|
|
1389
|
+
"syn 2.0.68",
|
|
1391
1390
|
]
|
|
1392
1391
|
|
|
1393
1392
|
[[package]]
|
|
1394
1393
|
name = "tinyvec"
|
|
1395
|
-
version = "1.6.
|
|
1394
|
+
version = "1.6.1"
|
|
1396
1395
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1397
|
-
checksum = "
|
|
1396
|
+
checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82"
|
|
1398
1397
|
dependencies = [
|
|
1399
1398
|
"tinyvec_macros",
|
|
1400
1399
|
]
|
|
@@ -1432,7 +1431,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
|
|
|
1432
1431
|
dependencies = [
|
|
1433
1432
|
"proc-macro2",
|
|
1434
1433
|
"quote",
|
|
1435
|
-
"syn 2.0.
|
|
1434
|
+
"syn 2.0.68",
|
|
1436
1435
|
]
|
|
1437
1436
|
|
|
1438
1437
|
[[package]]
|
|
@@ -1607,7 +1606,7 @@ dependencies = [
|
|
|
1607
1606
|
"once_cell",
|
|
1608
1607
|
"proc-macro2",
|
|
1609
1608
|
"quote",
|
|
1610
|
-
"syn 2.0.
|
|
1609
|
+
"syn 2.0.68",
|
|
1611
1610
|
"wasm-bindgen-shared",
|
|
1612
1611
|
]
|
|
1613
1612
|
|
|
@@ -1641,7 +1640,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
|
|
|
1641
1640
|
dependencies = [
|
|
1642
1641
|
"proc-macro2",
|
|
1643
1642
|
"quote",
|
|
1644
|
-
"syn 2.0.
|
|
1643
|
+
"syn 2.0.68",
|
|
1645
1644
|
"wasm-bindgen-backend",
|
|
1646
1645
|
"wasm-bindgen-shared",
|
|
1647
1646
|
]
|
data/ext/mawsitsit/Cargo.toml
CHANGED
|
@@ -40,8 +40,15 @@ pub async fn like_fetch(args: &str, ftch: &str) -> Value {
|
|
|
40
40
|
let mut input : HashMap<&str,&str> = HashMap::new();
|
|
41
41
|
input.insert(ftch_list[4], new_args.as_str());
|
|
42
42
|
let result = fetch(ftch_list[0], ftch_list[1], ftch_list[3], input).await;
|
|
43
|
-
let
|
|
44
|
-
|
|
43
|
+
let result = match result {
|
|
44
|
+
Ok(res) => JsonValue::new(res),
|
|
45
|
+
Err(_err) => JsonValue::null(),
|
|
46
|
+
};
|
|
47
|
+
let final_value = result
|
|
48
|
+
.get_by_path(ftch_list[5])
|
|
49
|
+
.map_or(serde_json::Value::Null, |v| v.clone());
|
|
50
|
+
|
|
51
|
+
final_value
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
pub fn like_lambda(_args: &str, _enm: &str) -> Value {
|
|
@@ -16,6 +16,9 @@ impl JsonValue {
|
|
|
16
16
|
pub fn new(value: serde_json::Value) -> JsonValue {
|
|
17
17
|
JsonValue { value }
|
|
18
18
|
}
|
|
19
|
+
pub fn null() -> JsonValue {
|
|
20
|
+
JsonValue { value: serde_json::Value::Null }
|
|
21
|
+
}
|
|
19
22
|
pub fn get_by_path(&self, path: &str) -> Option<&Value> {
|
|
20
23
|
let mut current = &self.value;
|
|
21
24
|
for key in path.split('.') {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
use reqwest::{Client, Method};
|
|
2
2
|
use std::collections::HashMap;
|
|
3
|
-
use base64::encode;
|
|
4
3
|
use magnus::Value as RubyValue;
|
|
5
4
|
use serde_json::{Map, Value as SerdeValue};
|
|
6
5
|
|
|
@@ -25,11 +24,8 @@ pub async fn fetch(
|
|
|
25
24
|
let mut request = client.request(method, url);
|
|
26
25
|
request = request.header("accept", "application/json")
|
|
27
26
|
.header("content-type", "application/json");
|
|
28
|
-
|
|
29
27
|
request = request.body(serde_json::to_string(&input)?);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let auth_header = format!("Basic {}", encode(api_key));
|
|
28
|
+
let auth_header = format!("Basic {}", api_key);
|
|
33
29
|
request = request.header("authorization", auth_header);
|
|
34
30
|
let response = request.send().await?;
|
|
35
31
|
let json = response.json().await?;
|
data/lib/mawsitsit/version.rb
CHANGED
data/var/destination.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"latitude": null,
|
|
23
23
|
"country_code": null,
|
|
24
24
|
"postal_code": null,
|
|
25
|
-
"city": "results.locationIds.primaryLocationId-<fetch|https://api.ashbyhq.com/location.info,POST,JSON,
|
|
25
|
+
"city": "results.locationIds.primaryLocationId-<fetch|https://api.ashbyhq.com/location.info,POST,JSON,OTRiZWZhM2U0ODRmYmZhMTJhZTY5MjlmODFjOWIyODllYzM3ZTNhNjA3MjQ3M2M2ZGJkZjI5OTJlYjZjNWNjZjo=,locationId,results.name>",
|
|
26
26
|
"address": null,
|
|
27
27
|
"view_count": null,
|
|
28
28
|
"created_at": "results.publishedDate",
|
data/var/test_1.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"latitude": null,
|
|
23
23
|
"country_code": null,
|
|
24
24
|
"postal_code": null,
|
|
25
|
-
"city": "results.locationIds.primaryLocationId-<fetch|https://api.ashbyhq.com/location.info,POST,JSON,
|
|
25
|
+
"city": "results.locationIds.primaryLocationId-<fetch|https://api.ashbyhq.com/location.info,POST,JSON,OTRiZWZhM2U0ODRmYmZhMTJhZTY5MjlmODFjOWIyODllYzM3ZTNhNjA3MjQ3M2M2ZGJkZjI5OTJlYjZjNWNjZjo=,locationId,results.name>",
|
|
26
26
|
"address": null,
|
|
27
27
|
"view_count": null,
|
|
28
28
|
"created_at": "results.publishedDate",
|