mawsitsit 0.1.10 → 0.1.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9eca57f6d8ca22c2848d6a17c59577f96166064a14bad4e4b8937c01f13f3cdb
4
- data.tar.gz: fca35437202318693a90de8abc4ec438d68a97065bb9b84bf140b4f3315f2738
3
+ metadata.gz: 13d6796c67206b0f552f9551fa5aefde1c3eb96a8e1aee3de6b777246e1d78e9
4
+ data.tar.gz: b7a8de632bc9006744e9f29ca1548051acf3743f0af53d1d062364c3e09af0b4
5
5
  SHA512:
6
- metadata.gz: f6ba432869c1aa4d2b4ecbcd84fb97442b0dd2f55a0c1038a05563660374f23050131cb882e6ea82da72fa2bcf433067cda453a4edac2087912547ab69846ae4
7
- data.tar.gz: ab9fc396cbd8cab2a081bd8c6a5edf4eaa2e82e2d9ca627f37b03fe75464eee8a7b66cd562823deda64ca5c80de321763ad3968bcf938b115f4156ae7906ce8b
6
+ metadata.gz: '080ed2ee076ebdd1a971bb44686b9e112aa860464331bc7dc1c7520094a05525ddc668b73774983a96d95cd2f2ae983de1526d31dc058c1c72fe14a894f91ad6'
7
+ data.tar.gz: f8e0194501ae5fb49075de6fce8a6c9cb9481da604094e931113b6c7f8d790658b3db425cca424efe85f10c2e3e2cbe97d7152af61e5a724db432c7aa0507f67
@@ -4,7 +4,6 @@ use serde_json::{Map, Value};
4
4
  use std::collections::HashMap;
5
5
  use serde_json::Value::Null;
6
6
  use crate::parser::parser::JsonValue;
7
-
8
7
  use super::utils::application_option::parse_ashby_type;
9
8
  pub fn like_enum(args: &str, enm: &str) -> Value {
10
9
  let enm_list = str_vec(enm, ",");
@@ -61,34 +60,34 @@ pub fn like_ashby(_args: &Value) -> Value {
61
60
  .and_then(Value::as_bool)
62
61
  .unwrap_or(false);
63
62
 
63
+ let answer_options: Option<Vec<String>> = map.get("field")
64
+ .and_then(|field| field.get("selectableValues"))
65
+ .and_then(Value::as_array)
66
+ .map(|array| {
67
+ array.iter()
68
+ .filter_map(|item| item.get("value").and_then(Value::as_str))
69
+ .map(|s| format!("{}", s))
70
+ .collect()
71
+ });
72
+
73
+
64
74
  let app_option = ApplicationOption::new(
65
75
  question.to_string(),
66
76
  parse_ashby_type(question_type).unwrap(),
67
77
  Some(ext_id.to_string()),
68
- None,
78
+ answer_options,
69
79
  required,
70
80
  );
71
81
 
72
82
  new_appl.push(app_option.to_json());
73
-
74
-
75
-
76
83
  }
77
-
78
84
  }
79
-
80
-
81
85
 
82
86
  }
83
87
  _ => {
84
88
  println!("The provided Value is no Array.");
85
89
  }
86
90
  }
87
-
88
-
89
-
90
-
91
-
92
91
 
93
92
  }
94
93
  _ => {
@@ -1,5 +1,19 @@
1
1
  use std::fmt;
2
2
  use serde_json::{json, Value};
3
+
4
+
5
+ #[derive(Debug)]
6
+ pub enum ParseError {
7
+ InvalidType,
8
+ }
9
+
10
+ impl fmt::Display for ParseError {
11
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
12
+ write!(f, "Ashby Application Option Type is not represented in QuestionType")
13
+ }
14
+ }
15
+ impl std::error::Error for ParseError {}
16
+
3
17
  #[derive(Debug)]
4
18
  pub enum QuestionType {
5
19
  YesNo,
@@ -53,7 +67,7 @@ impl std::str::FromStr for QuestionType {
53
67
  }
54
68
  }
55
69
 
56
- pub fn parse_ashby_type(input: &str) -> Result<QuestionType, ()> {
70
+ pub fn parse_ashby_type(input: &str) -> Result<QuestionType, ParseError> {
57
71
  match input {
58
72
  "String" => Ok(QuestionType::ShortText),
59
73
  "Email" => Ok(QuestionType::ShortText),
@@ -67,7 +81,8 @@ pub fn parse_ashby_type(input: &str) -> Result<QuestionType, ()> {
67
81
  "Phone" => Ok(QuestionType::ShortText),
68
82
  "Score" => Ok(QuestionType::ShortText),
69
83
  "SocialLink" => Ok(QuestionType::Link),
70
- _ => Err(()),
84
+ "Location" => Ok(QuestionType::Location),
85
+ _ => Err(ParseError::InvalidType),
71
86
  }
72
87
  }
73
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mawsitsit
4
- VERSION = "0.1.10"
4
+ VERSION = "0.1.12"
5
5
  end
@@ -0,0 +1,3 @@
1
+
2
+ [ZoneTransfer]
3
+ ZoneId=3
@@ -0,0 +1,95 @@
1
+ {
2
+ "job_slug": "048d1c18-f791-49a3-bf8d-744de22aa140",
3
+ "job_status": "listed",
4
+ "referrer_url": "https://jobs.ashbyhq.com/demo.embloy/048d1c18-f791-49a3-bf8d-744de22aa140",
5
+ "title": "Director of Platform Engineering",
6
+ "position": "Director of Platform Engineering",
7
+ "description": "<p>Example org is a leading software company. Example org allows real-time collaboration on important example workflows. Founded in 2012 we have over 10,000 customers worldwide and are backed by fantastic investors such as Example Capital. <a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"http://example.com/\">Example has raised its Series C and is valued at $750 million dollars. </a></p><p>This example role will be part of an example team and will report to the example manager. The new hire plays a critical role in various example workflows.</p><p></p><h1>What you'll do</h1><ul><li><p>Participate in example meetings</p></li><li><p>Lead example initiatives</p></li><li><p>Recruit new team members to example team</p></li><li><p>Mentor and develop existing team members</p></li></ul><p></p><h1>Requirements</h1><ul><li><p>Experience writing good example job descriptions</p></li><li><p>Other exemplary skills</p></li><li><p>3-5 years prior experience in this role</p></li><li><p>Motivation</p></li><li><p>Great english language skills</p></li></ul><p></p><h1>Why you might want to work with us</h1><ul><li><p>We take care of you and your family with comprehensive health, vision, and dental insurance.</p></li><li><p>We're serious about food. Free catered lunch every day, and a fully stocked kitchen with occasional snack appearances from our Japanese office. Healthy and not-so-healthy options are available, as are foods for those with dietary restrictions.</p></li><li><p>You're excited to work on a product that will impact almost any consumer, almost anywhere.</p></li><li><p>We dress casually. If you want, you can wear slippers in the office. You should see the creative collection our team has built.</p></li><li><p>We believe in a culture of learning, and want to keep building our skills, experiences, and capabilities.</p></li><li><p>We offer flexible work schedules. We trust our team to know how they will do their best work.</p></li><li><p>We're family friendly. We want our teammates to focus on what they need to when they need to.</p></li><li><p>We offer very competitive compensation, including equity in Standard, to each one of our employees.</p></li></ul><p></p><p>Example org provides equal employment opportunities (EEO) to all employees and applicants for employment without regard to race, color, religion, sex, national origin, age, disability, genetics, sexual orientation, gender identity, or gender expression. We are committed to a diverse and inclusive workforce and welcome people from all backgrounds, experiences, perspectives, and abilities. </p><p></p><p>Do you have further questions about this role? Reach out to our talent team at example@example.com.<br /></p>",
8
+ "city": "San Francisco",
9
+ "created_at": "2024-05-21",
10
+ "updated_at": "2024-06-21T12:44:39.392Z",
11
+ "application_options_attributes": [
12
+ {
13
+ "question": "Name",
14
+ "question_type": "short_text",
15
+ "required": true,
16
+ "ext_id": "ashby___systemfield_name"
17
+ },
18
+ {
19
+ "question": "Email",
20
+ "question_type": "short_text",
21
+ "required": true,
22
+ "ext_id": "ashby___systemfield_email"
23
+ },
24
+ {
25
+ "question": "File",
26
+ "question_type": "file",
27
+ "required": true,
28
+ "ext_id": "ashby___systemfield_resume"
29
+ },
30
+ {
31
+ "question": "This is a long answer",
32
+ "question_type": "long_text",
33
+ "required": false,
34
+ "ext_id": "ashby__366f6c65-dd63-41d3-ba41-2d41d9ba79cc"
35
+ },
36
+ {
37
+ "question":"Your phone number",
38
+ "question_type": "short_text",
39
+ "required": false,
40
+ "ext_id": "ashby__593dcce1-ef32-4064-924c-669fc4f986aa"
41
+ },
42
+ {
43
+ "question":"MC Question",
44
+ "question_type": "single_choice",
45
+ "required": true,
46
+ "ext_id": "ashby__8ec0c342-3610-4199-8864-919a88a90656",
47
+ "options": ["a1", "a2", "a3", "a4"]
48
+ },
49
+ {
50
+ "question":"SC Question",
51
+ "question_type": "multiple_choice",
52
+ "required": true,
53
+ "ext_id": "ashby__8ec0c342-3610-4199-8864-919a88a90656",
54
+ "options": ["s1", "s2", "s3"]
55
+ },
56
+ {
57
+ "question":"Number question",
58
+ "question_type": "number",
59
+ "required": false,
60
+ "ext_id": "ashby__f8cf2a01-a9e4-4044-a175-f39ab4fb753c"
61
+ },
62
+ {
63
+ "question":"Location",
64
+ "question_type": "location",
65
+ "required": false,
66
+ "ext_id": "ashby___systemfield_location"
67
+ },
68
+ {
69
+ "question":"Upload a Video",
70
+ "question_type": "file",
71
+ "required": false,
72
+ "ext_id": "ashby__fa91d2fc-c086-43de-9fb4-3755f0bf436c"
73
+ },
74
+ {
75
+ "question":"Location 2",
76
+ "question_type": "location",
77
+ "required": false,
78
+ "ext_id": "ashby__3ae7c1ae-0825-4cd7-b35c-3af9b501209e"
79
+ },
80
+ {
81
+ "question":"Date Question",
82
+ "question_type": "date",
83
+ "required": false,
84
+ "ext_id": "ashby__0b478e5d-ef31-41d6-8462-70cb373681f4"
85
+ },
86
+ {
87
+ "question":"Yes No Question",
88
+ "question_type": "yes_no",
89
+ "required": false,
90
+ "ext_id": "66007d32-2e25-47a5-833d-81903995d68e"
91
+ }
92
+
93
+ ]
94
+
95
+ }
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mawsitsit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Hummel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-21 00:00:00.000000000 Z
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - jan.hummel@de.embloy.com
16
16
  executables: []
@@ -44,16 +44,18 @@ files:
44
44
  - var/expected.json
45
45
  - var/expected_test_1.identifier
46
46
  - var/expected_test_1.json
47
+ - var/expected_test_2.identifier
48
+ - var/expected_test_2.json
47
49
  - var/origin.Identifier
48
50
  - var/origin.json
49
51
  - var/test_1.identifier
50
52
  - var/test_1.json
51
- homepage: https://github.com/Embloy/Embloy-Parser
53
+ homepage: https://github.com/Embloy/Maw-sit-sit/
52
54
  licenses: []
53
55
  metadata:
54
- homepage_uri: https://github.com/Embloy/Embloy-Parser
55
- source_code_uri: https://github.com/Embloy/Embloy-Parser
56
- post_install_message:
56
+ homepage_uri: https://github.com/Embloy/Maw-sit-sit/
57
+ source_code_uri: https://github.com/Embloy/Maw-sit-sit/
58
+ post_install_message:
57
59
  rdoc_options: []
58
60
  require_paths:
59
61
  - lib
@@ -68,8 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
70
  - !ruby/object:Gem::Version
69
71
  version: 3.3.11
70
72
  requirements: []
71
- rubygems_version: 3.5.11
72
- signing_key:
73
+ rubygems_version: 3.5.13
74
+ signing_key:
73
75
  specification_version: 4
74
76
  summary: Super flexible data parser optimized for API integrations
75
77
  test_files: []