mawsitsit 0.1.14 → 0.1.16
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/README.md +1 -0
- data/ext/mawsitsit/src/parser/manipulators.rs +13 -5
- data/ext/mawsitsit/src/parser/parser.rs +0 -5
- data/lib/mawsitsit/version.rb +1 -1
- data/var/lever_test_2.json +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a409ba1e16eda39bf247662dd591410836837762c72df925f61d569880382f5
|
|
4
|
+
data.tar.gz: d942012dc8c5f52661085261af7ec0061da9f573b0c393c5a04026dcef1c578c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 450000bc0efef62b75fef2a5527addf42579479052bc8a5b58797e628bf37ca86b0a8e1af00078ef69daa60fc235eedea39d4c0c2b6b5c3d76ecd80139334d62
|
|
7
|
+
data.tar.gz: c39f153097cae9612732d6dea3f090c551a7e15e6d700d30b1c6b055c8ed7d006aeedd9da94d27e22b229f32efa86dec1bd2a37b6be59e05ebdf9efc257b7808
|
data/README.md
CHANGED
|
@@ -141,8 +141,10 @@ pub fn like_lever(_args: &Value) -> Value {
|
|
|
141
141
|
for value in arr {
|
|
142
142
|
if let Value::Object(map) = value {
|
|
143
143
|
if let Some(Value::Array(fields)) = map.get("fields") {
|
|
144
|
+
let mut num = 0;
|
|
144
145
|
for field in fields {
|
|
145
|
-
process_field(field, &mut new_appl);
|
|
146
|
+
process_field(field, &mut new_appl, "customQuestions", Some(num));
|
|
147
|
+
num += 1;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
}
|
|
@@ -152,7 +154,7 @@ pub fn like_lever(_args: &Value) -> Value {
|
|
|
152
154
|
if let Some(Value::Array(arr)) = map.get("personalInformation") {
|
|
153
155
|
for value in arr {
|
|
154
156
|
if let Value::Object(_) = value {
|
|
155
|
-
process_field(value, &mut new_appl);
|
|
157
|
+
process_field(value, &mut new_appl, "personalInformation", None);
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
}
|
|
@@ -160,7 +162,7 @@ pub fn like_lever(_args: &Value) -> Value {
|
|
|
160
162
|
if let Some(Value::Array(arr)) = map.get("urls") {
|
|
161
163
|
for value in arr {
|
|
162
164
|
if let Value::Object(_) = value {
|
|
163
|
-
process_field(value, &mut new_appl);
|
|
165
|
+
process_field(value, &mut new_appl, "urls", None);
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
168
|
}
|
|
@@ -177,12 +179,18 @@ pub fn like_lever(_args: &Value) -> Value {
|
|
|
177
179
|
serde_json::Value::Array(new_appl)
|
|
178
180
|
}
|
|
179
181
|
|
|
180
|
-
fn process_field(value: &Value, new_appl: &mut Vec<serde_json::Value>) {
|
|
182
|
+
fn process_field(value: &Value, new_appl: &mut Vec<serde_json::Value>, ext_prefix: &str, ext_suffix: Option<u32>) {
|
|
181
183
|
let question = value.get("text").and_then(Value::as_str).unwrap_or("Unknown question");
|
|
182
184
|
let question_type = value.get("type").and_then(Value::as_str).unwrap_or("Unknown type");
|
|
183
185
|
let ext_id = value.get("id").or_else(|| value.get("name"))
|
|
184
186
|
.and_then(Value::as_str)
|
|
185
|
-
.map(|s|
|
|
187
|
+
.map(|s| {
|
|
188
|
+
if let Some(suffix) = ext_suffix {
|
|
189
|
+
format!("lever__{}__{}__{}",ext_prefix, s, suffix)
|
|
190
|
+
} else {
|
|
191
|
+
format!("lever__{}__{}",ext_prefix, s)
|
|
192
|
+
}
|
|
193
|
+
})
|
|
186
194
|
.unwrap_or("Unknown question".to_string());
|
|
187
195
|
let required = value.get("required").and_then(Value::as_bool).unwrap_or(false);
|
|
188
196
|
let answer_options = value.get("options").and_then(Value::as_array).map(|array| {
|
|
@@ -216,11 +216,6 @@ impl JsonToJson {
|
|
|
216
216
|
}
|
|
217
217
|
*value = task_res;
|
|
218
218
|
} else {
|
|
219
|
-
let bin_spl:Vec<&str>= bin[0].split(".").collect();
|
|
220
|
-
if bin_spl[0] == "ignore" {
|
|
221
|
-
*value = bin[0].clone().into();
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
219
|
*value = reference
|
|
225
220
|
.get_by_path(value_str)
|
|
226
221
|
.map_or_else(|| serde_json::Value::Null, |v| v.clone().into());
|
data/lib/mawsitsit/version.rb
CHANGED
data/var/lever_test_2.json
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"city": "data.categories.allLocations-<flatten>",
|
|
26
26
|
"address": null,
|
|
27
27
|
"view_count": null,
|
|
28
|
-
"created_at":
|
|
29
|
-
"updated_at":
|
|
28
|
+
"created_at": "ignore.data.createdAt",
|
|
29
|
+
"updated_at": "ignore.data.updatedAt",
|
|
30
30
|
"applications_count": null,
|
|
31
31
|
"employer_rating": null,
|
|
32
32
|
"job_notifications": null,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mawsitsit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Hummel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|