eco-helpers 3.0.25 → 3.0.27

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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -1
  3. data/eco-helpers.gemspec +1 -1
  4. data/lib/eco/api/common/loaders/base.rb +13 -1
  5. data/lib/eco/api/common/loaders/case_base.rb +1 -1
  6. data/lib/eco/api/common/loaders/error_handler.rb +1 -1
  7. data/lib/eco/api/common/loaders/parser.rb +2 -2
  8. data/lib/eco/api/common/loaders/policy.rb +1 -1
  9. data/lib/eco/api/common/loaders/use_case.rb +1 -1
  10. data/lib/eco/api/common/people/default_parsers/archived_parser.rb +19 -0
  11. data/lib/eco/api/common/people/default_parsers/boolean_parser.rb +4 -4
  12. data/lib/eco/api/common/people/default_parsers/date_parser.rb +3 -3
  13. data/lib/eco/api/common/people/default_parsers/freemium_parser.rb +6 -6
  14. data/lib/eco/api/common/people/default_parsers/login_providers_parser.rb +3 -3
  15. data/lib/eco/api/common/people/default_parsers/multi_parser.rb +4 -4
  16. data/lib/eco/api/common/people/default_parsers/policy_groups_parser.rb +9 -6
  17. data/lib/eco/api/common/people/default_parsers/send_invites_parser.rb +6 -5
  18. data/lib/eco/api/common/people/default_parsers/xls_parser.rb +2 -2
  19. data/lib/eco/api/common/people/default_parsers.rb +1 -0
  20. data/lib/eco/api/common/people/entries.rb +16 -15
  21. data/lib/eco/api/common/people/person_entry.rb +53 -37
  22. data/lib/eco/api/common/people/person_parser.rb +8 -6
  23. data/lib/eco/api/common/session/logger/channels.rb +1 -1
  24. data/lib/eco/api/common/session/logger.rb +2 -2
  25. data/lib/eco/api/common/session/mailer/aws_provider.rb +3 -2
  26. data/lib/eco/api/common/session/mailer/provider_base.rb +6 -2
  27. data/lib/eco/api/common/session/mailer/sendgrid_provider.rb +9 -9
  28. data/lib/eco/api/common/session/mailer.rb +8 -3
  29. data/lib/eco/api/common/session/sftp.rb +2 -2
  30. data/lib/eco/api/common/version_patches/object.rb +2 -1
  31. data/lib/eco/api/custom/mailer.rb +1 -1
  32. data/lib/eco/api/error/handlers.rb +3 -3
  33. data/lib/eco/api/error.rb +17 -17
  34. data/lib/eco/api/microcases/people/apply_changes/set_account/account_excluded.rb +3 -11
  35. data/lib/eco/api/microcases/people/apply_changes/set_core/core_excluded.rb +4 -1
  36. data/lib/eco/api/microcases/people/manage/search.rb +3 -1
  37. data/lib/eco/api/organization/people.rb +1 -0
  38. data/lib/eco/api/policies.rb +2 -2
  39. data/lib/eco/api/session/batch/job.rb +2 -2
  40. data/lib/eco/api/session/batch/launcher.rb +4 -5
  41. data/lib/eco/api/session/batch/searcher.rb +4 -4
  42. data/lib/eco/api/session/config/api.rb +2 -2
  43. data/lib/eco/api/session/config/apis/enviro_spaces.rb +3 -3
  44. data/lib/eco/api/session/config/apis/space_helpers.rb +4 -4
  45. data/lib/eco/api/session/config/apis.rb +1 -1
  46. data/lib/eco/api/session/config/post_launch.rb +7 -4
  47. data/lib/eco/api/session/config/sftp.rb +1 -1
  48. data/lib/eco/api/session/config/tagtree.rb +1 -1
  49. data/lib/eco/api/session/config/workflow.rb +4 -4
  50. data/lib/eco/api/session/config.rb +25 -24
  51. data/lib/eco/api/session.rb +4 -4
  52. data/lib/eco/api/usecases/base_io/validations.rb +4 -3
  53. data/lib/eco/api/usecases/cli/option.rb +5 -2
  54. data/lib/eco/api/usecases/default/people/amend/clear_abilities_case.rb +2 -2
  55. data/lib/eco/api/usecases/default/people/amend/restore_db_case.rb +16 -9
  56. data/lib/eco/api/usecases/default/people/treat/analyse_people_case.rb +20 -20
  57. data/lib/eco/api/usecases/default.rb +5 -5
  58. data/lib/eco/api/usecases/default_cases/to_csv_case.rb +8 -8
  59. data/lib/eco/api/usecases/default_cases/upsert_case.rb +4 -4
  60. data/lib/eco/api/usecases/graphql/helpers/base.rb +1 -1
  61. data/lib/eco/api/usecases/graphql/helpers/location/base/tree_tracking.rb +5 -1
  62. data/lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/commandable.rb +2 -1
  63. data/lib/eco/api/usecases/graphql/helpers/location/command/result.rb +3 -3
  64. data/lib/eco/api/usecases/graphql/helpers/location/command.rb +3 -0
  65. data/lib/eco/api/usecases/graphql/samples/location/command/dsl.rb +2 -2
  66. data/lib/eco/api/usecases/graphql/samples/location/command/service/tree_update.rb +9 -3
  67. data/lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/inputable.rb +5 -4
  68. data/lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing.rb +5 -2
  69. data/lib/eco/api/usecases/graphql/samples/location/service/tree_diff.rb +3 -3
  70. data/lib/eco/api/usecases/graphql/utils/sftp.rb +1 -1
  71. data/lib/eco/api/usecases/lib/{file_pattern.rb → files/file_pattern.rb} +5 -1
  72. data/lib/eco/api/usecases/lib/{sftp.rb → files/sftp.rb} +27 -16
  73. data/lib/eco/api/usecases/lib/files.rb +7 -0
  74. data/lib/eco/api/usecases/lib.rb +1 -2
  75. data/lib/eco/api/usecases/ooze_cases/export_register_case.rb +5 -5
  76. data/lib/eco/api/usecases/ooze_samples/helpers/exportable_ooze.rb +14 -11
  77. data/lib/eco/api/usecases/ooze_samples/helpers_migration/copying.rb +14 -23
  78. data/lib/eco/api/usecases/ooze_samples/helpers_migration/typed_fields_pairing.rb +49 -27
  79. data/lib/eco/api/usecases/ooze_samples/ooze_base_case.rb +9 -9
  80. data/lib/eco/api/usecases/ooze_samples/ooze_run_base_case.rb +1 -1
  81. data/lib/eco/api/usecases/ooze_samples/register_export_case.rb +25 -17
  82. data/lib/eco/api/usecases/ooze_samples/register_migration_case.rb +41 -24
  83. data/lib/eco/api/usecases/ooze_samples/register_update_case.rb +16 -15
  84. data/lib/eco/api/usecases/samples/drivers/cli/sftp_cli.rb +15 -15
  85. data/lib/eco/api/usecases/samples/drivers/cli/url_pull_cli.rb +5 -5
  86. data/lib/eco/api/usecases/samples/drivers/sftp_sample.rb +2 -2
  87. data/lib/eco/api/usecases/use_case.rb +6 -6
  88. data/lib/eco/api/usecases/use_case_chain/chaining.rb +6 -6
  89. data/lib/eco/api/usecases/use_case_chain.rb +4 -4
  90. data/lib/eco/api/usecases/use_case_io.rb +2 -1
  91. data/lib/eco/api/usecases.rb +9 -9
  92. data/lib/eco/cli/config/options_set.rb +4 -4
  93. data/lib/eco/cli/config/use_cases.rb +3 -3
  94. data/lib/eco/cli/scripting/argument.rb +1 -1
  95. data/lib/eco/cli_default/input.rb +9 -9
  96. data/lib/eco/cli_default/options.rb +125 -100
  97. data/lib/eco/cli_default/people.rb +3 -3
  98. data/lib/eco/cli_default/usecases.rb +83 -83
  99. data/lib/eco/cli_default/workflow.rb +7 -7
  100. data/lib/eco/data/files/helpers.rb +3 -3
  101. data/lib/eco/data/fuzzy_match/result.rb +69 -26
  102. data/lib/eco/data/fuzzy_match/results.rb +10 -10
  103. data/lib/eco/data/fuzzy_match/score.rb +13 -8
  104. data/lib/eco/data/fuzzy_match.rb +65 -48
  105. data/lib/eco/data/locations/node_base/treeify.rb +13 -11
  106. data/lib/eco/data/mapper.rb +4 -4
  107. data/lib/eco/language/auxiliar_logger.rb +4 -4
  108. data/lib/eco/language/delegation/const_delegator.rb +64 -0
  109. data/lib/eco/language/delegation/const_lookup_hooks.rb +81 -0
  110. data/lib/eco/language/delegation/delegated_class.rb +84 -0
  111. data/lib/eco/language/delegation.rb +8 -0
  112. data/lib/eco/language/klass/when_inherited.rb +1 -0
  113. data/lib/eco/language/methods/delegate_missing.rb +1 -0
  114. data/lib/eco/language/models/class_helpers.rb +25 -23
  115. data/lib/eco/language/models/collection.rb +12 -2
  116. data/lib/eco/language.rb +1 -0
  117. data/lib/eco/version.rb +1 -1
  118. metadata +12 -6
@@ -1,6 +1,6 @@
1
1
  ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
2
- cnf.options_set do |options_set, options| # rubocop:disable Metrics/BlockLength
3
- options_set.add("--help", "Offers a HELP") do |options, session|
2
+ cnf.options_set do |options_set, top_opts| # rubocop:disable Metrics/BlockLength
3
+ options_set.add('--help', 'Offers a HELP') do |options, _sess|
4
4
  conf = ASSETS.cli.config
5
5
 
6
6
  active = proc do |opt|
@@ -11,71 +11,78 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
11
11
  refine || there
12
12
  end
13
13
 
14
- if (hpf = active.call("-filters"))
14
+ if (hpf = active.call('-filters'))
15
15
  puts conf.people_filters.help(refine: hpf)
16
16
  end
17
17
 
18
- if (hif = active.call("-input-filters"))
18
+ if (hif = active.call('-input-filters'))
19
19
  puts conf.input_filters.help(refine: hif)
20
20
  end
21
21
 
22
- if (ho = active.call("-options"))
22
+ if (ho = active.call('-options'))
23
23
  puts conf.options_set.help(refine: ho)
24
24
  end
25
25
 
26
- if (huc = active.call("-usecases"))
26
+ if (huc = active.call('-usecases'))
27
27
  puts conf.usecases.help(refine: huc)
28
28
  end
29
29
 
30
30
  help_str = [
31
- "Please specify one of the below:",
32
- " -filters to display available filters on people",
33
- " -input-filters to display available filters on input data",
34
- " -options to dislpay available options",
35
- " -usecases to display available usecases",
36
- "TIPS:",
37
- " * You may specify the usecase to know its specific options by: -usecase_name --help -options",
38
- " * You may specify a refinement to show specific information only: --help -usecases tags"
31
+ 'Please specify one of the below:',
32
+ ' -filters to display available filters on people',
33
+ ' -input-filters to display available filters on input data',
34
+ ' -options to dislpay available options',
35
+ ' -usecases to display available usecases',
36
+ 'TIPS:',
37
+ ' * You may specify the usecase to know its specific options by: -usecase_name --help -options',
38
+ ' * You may specify a refinement to show specific information only: --help -usecases tags'
39
39
  ].join("\n")
40
40
 
41
41
  puts help_str unless hpf || hif || ho || huc
42
42
  exit
43
43
  end
44
44
 
45
- desc = "Redirect Standard Ouput to file"
46
- options_set.add("-stdout", desc) do |options, session|
47
- file = SCR.get_arg("-stdout", with_param: true) || "output.txt"
48
- $stdout.reopen(file, "w+")
45
+ desc = 'Deprecated: used to be used to avoid reloading people after launch'
46
+ top_opts[:end_get] = true
47
+ options_set.add('-no-get', desc) do |options|
48
+ options[:end_get] = false
49
+ end
50
+
51
+ desc = 'Redirect Standard Ouput to file'
52
+ options_set.add('-stdout', desc) do |_opts, _sess|
53
+ file = SCR.get_arg('-stdout', with_param: true) || 'output.txt'
54
+ $stdout.reopen(file, 'w+')
49
55
  end
50
56
 
51
- desc = "Skips the check of the headers"
52
- options_set.add("-skip-header-check", desc) do |options, session|
57
+ desc = 'Skips the check of the headers'
58
+ options_set.add('-skip-header-check', desc) do |options, _sess|
53
59
  options.deep_merge!(input: {header_check: {skip: true}})
54
60
  end
55
61
 
56
- desc = "It requires the order of the headers to be as expected (exact match required)"
57
- options_set.add("-header-order-check", desc) do |options, session|
62
+ desc = 'It requires the order of the headers to be as expected (exact match required)'
63
+ options_set.add('-header-order-check', desc) do |options, _sess|
58
64
  options.deep_merge!(input: {header_check: {order: true}})
59
65
  end
60
66
 
61
- desc = "It raises an exception if any header issues are detected"
62
- options_set.add("-require-valid-header", desc) do |options, session|
67
+ desc = 'It raises an exception if any header issues are detected'
68
+ options_set.add('-require-valid-header', desc) do |options, _sess|
63
69
  options.deep_merge!(input: {header_check: {must_be_valid: true}})
64
70
  end
65
71
 
66
- desc = "Fix the current session to work with this schema"
67
- options_set.add("-schema-id", desc) do |options, session|
68
- sch_name = SCR.get_arg("-schema-id", with_param: true)
72
+ desc = 'Fix the current session to work with this schema'
73
+ options_set.add('-schema-id', desc) do |options, session|
74
+ sch_name = SCR.get_arg('-schema-id', with_param: true)
69
75
  sch_id = session.schemas.to_id(sch_name)
70
76
 
71
77
  unless sch_id
72
- msg = "You need to specify a correct schema id or name. "
78
+ msg = 'You need to specify a correct schema id or name. '
73
79
  msg << "'#{sch_name}' does not exist. Correct options are: "
74
- msg << session.schemas.map(&:name).join(", ")
80
+ msg << session.schemas.map(&:name).join(', ')
75
81
 
76
82
  session.log(:error) { msg }
77
83
  exit(1)
78
84
  end
85
+
79
86
  options.deep_merge!(people: {filter: {details: {schema_id: sch_id}}})
80
87
  session.log(:info) {
81
88
  "Setting schema #{session.schemas.to_name(sch_id)}"
@@ -83,29 +90,29 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
83
90
  session.schema = sch_id
84
91
  end
85
92
 
86
- desc = "Used to be used to specify the input file or folder when using -get-partial. "
87
- desc << "It can also be useful to obtain `-get-partial` of people base on `:export` use cases (i.e. -people-to-csv)"
88
- options_set.add("-entries-from", desc) do |options, session|
93
+ desc = 'Used to be used to specify the input file or folder when using -get-partial. '
94
+ desc << 'It can also be useful to obtain `-get-partial` of people base on `:export` use cases (i.e. -people-to-csv)'
95
+ options_set.add('-entries-from', desc) do |options, _sess|
89
96
  options.deep_merge!(input: {entries_from: true})
90
97
  end
91
98
 
92
- desc = "Used to specify the input file encoding"
93
- options_set.add("-input-encoding", desc) do |options, session|
94
- if encoding = SCR.get_arg("-input-encoding", with_param: true)
99
+ desc = 'Used to specify the input file encoding'
100
+ options_set.add('-input-encoding', desc) do |options, _sess|
101
+ if encoding = SCR.get_arg('-input-encoding', with_param: true)
95
102
  options.deep_merge!(input: {file: {encoding: encoding}})
96
103
  end
97
104
  end
98
105
 
99
- desc = "Do not load any people for this run."
100
- options_set.add("-no-people", desc) do |options, session|
106
+ desc = 'Do not load any people for this run.'
107
+ options_set.add('-no-people', desc) do |options, _sess|
101
108
  options.deep_merge!(people: {
102
109
  get: false
103
110
  })
104
111
  end
105
112
 
106
- desc = "Used to only get the people from the input file. "
107
- desc << "It will also include their current and new supervisors."
108
- options_set.add("-get-partial", desc) do |options, session|
113
+ desc = 'Used to only get the people from the input file. '
114
+ desc << 'It will also include their current and new supervisors.'
115
+ options_set.add('-get-partial', desc) do |options, _sess|
109
116
  options.deep_merge!(people: {
110
117
  get: {
111
118
  from: :remote,
@@ -114,8 +121,8 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
114
121
  })
115
122
  end
116
123
 
117
- desc = "Locally cache all the people manager by retrieving from the server"
118
- options_set.add("-get-people", desc) do |options, session|
124
+ desc = 'Locally cache all the people manager by retrieving from the server'
125
+ options_set.add('-get-people', desc) do |options, _sess|
119
126
  options.deep_merge!(people: {
120
127
  get: {
121
128
  from: :remote,
@@ -125,14 +132,14 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
125
132
  end
126
133
 
127
134
  desc = "Saves the requests's body even though running in dry-run (-simulate)"
128
- options_set.add("-save-requests", desc) do |options, session|
135
+ options_set.add('-save-requests', desc) do |options, _sess|
129
136
  options.deep_merge!(requests: {backup: true})
130
137
  end
131
138
 
132
- desc = "Used to specify the cache file of people to be used. "
133
- desc << "It is useful to use as people reference those stored in cached file diffrent to the last one."
134
- options_set.add("-people-from-backup", desc) do |options, session|
135
- file = SCR.get_file("-people-from-backup", required: true, should_exist: true)
139
+ desc = 'Used to specify the cache file of people to be used. '
140
+ desc << 'It is useful to use as people reference those stored in cached file diffrent to the last one.'
141
+ options_set.add('-people-from-backup', desc) do |options, _sess|
142
+ file = SCR.get_file('-people-from-backup', required: true, should_exist: true)
136
143
  options.deep_merge!(people: {
137
144
  get: {
138
145
  from: :local,
@@ -142,31 +149,31 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
142
149
  })
143
150
  end
144
151
 
145
- desc = "Used to export to a csv the final people (after processing). "
146
- desc << "It is useful analyse the data after a -dry-run (-simulate)."
147
- options_set.add("-processed-people-to-csv", desc) do |options, session|
148
- file = SCR.get_file("-processed-people-to-csv", required: true, should_exist: false)
152
+ desc = 'Used to export to a csv the final people (after processing). '
153
+ desc << 'It is useful analyse the data after a -dry-run (-simulate).'
154
+ options_set.add('-processed-people-to-csv', desc) do |options, _sess|
155
+ file = SCR.get_file('-processed-people-to-csv', required: true, should_exist: false)
149
156
  options.deep_merge!(report: {people: {csv: file}})
150
157
  end
151
158
 
152
- desc = "Runs in dry-run (no requests sent to server)"
153
- options_set.add(["-dry-run", "-simulate"], desc) do |options, session|
159
+ desc = 'Runs in dry-run (no requests sent to server)'
160
+ options_set.add(['-dry-run', '-simulate'], desc) do |options, session|
154
161
  options[:dry_run] = true
155
162
  options[:simulate] = true
156
163
  session.config.dry_run!
157
164
  end
158
165
 
159
- desc = "Specifies the target API key space (i.e. uat, dev, etc.). "
160
- desc << "Use with CAUTION !!!"
161
- options_set.add('-space', desc) do |options, session|
162
- next unless space = SCR.get_arg('-space', with_param: true)
166
+ desc = 'Specifies the target API key space (i.e. uat, dev, etc.). '
167
+ desc << 'Use with CAUTION !!!'
168
+ options_set.add('-space', desc) do |options, _sess|
169
+ next unless (space = SCR.get_arg('-space', with_param: true))
163
170
 
164
171
  options.deep_merge!(api: {space: space.to_sym})
165
172
  end
166
173
 
167
174
  desc = "It specifies the type of batch to be used (default: ':batch')"
168
- options_set.add("-batch-mode", desc) do |options, session|
169
- mode_in = SCR.get_arg("-batch-mode", with_param: true)
175
+ options_set.add('-batch-mode', desc) do |options, session|
176
+ mode_in = SCR.get_arg('-batch-mode', with_param: true)
170
177
  mode_str = mode_in.to_s.downcase
171
178
  mode_sym = %i[batch job].find do |md|
172
179
  next true if md.to_s == mode_str
@@ -184,108 +191,126 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
184
191
  options.deep_merge!(workflow: {batch: {mode: mode_sym}})
185
192
  end
186
193
 
187
- desc = "Runs runs post_launch cases even if in dry-run"
188
- options_set.add("-run-postlaunch", desc) do |options, session|
194
+ desc = 'Runs runs post_launch cases even if in dry-run'
195
+ options_set.add('-run-postlaunch', desc) do |options, _sess|
189
196
  options.deep_merge!(post_launch: {run: true})
190
197
  end
191
198
 
192
- desc = "(careful with this option) This will include everybody as part of the update (including those that are api excluded). "
193
- desc << "Only launch with this option when only api excluded people are included in your update."
194
- options_set.add("-include-excluded", desc) do |options|
199
+ desc = '(careful with this option) This will include everybody as part of the update '
200
+ desc << '(including those that are api excluded). '
201
+ desc << 'Only launch with this option when only api excluded people are included in your update.'
202
+ options_set.add('-include-excluded', desc) do |options|
195
203
  options.deep_merge!(include: {excluded: true})
196
204
  end
197
205
 
198
- desc = "Includes in API updates ONLY people that evaluate true as people excluded from periodic upates."
199
- options_set.add("-include-only-excluded", desc) do |options|
206
+ desc = 'Includes in API updates ONLY people that evaluate true as people excluded from periodic upates.'
207
+ options_set.add('-include-only-excluded', desc) do |options|
200
208
  options.deep_merge!(include: {excluded: {only: true}})
201
209
  end
202
210
 
203
- desc = "Ignores threshold limitations on requests for this session (skip batch belt)"
204
- options_set.add("-skip-batch-policy", desc) do |options|
211
+ desc = 'Ignores threshold limitations on requests for this session (skip batch belt)'
212
+ options_set.add('-skip-batch-policy', desc) do |options|
205
213
  options.deep_merge!(skip: {batch_policy: true})
206
214
  end
207
215
 
208
- desc = "Will not run the api policies defined for the enviro"
209
- options_set.add("-skip-api-policies", desc) do |options|
216
+ desc = 'Will not run the api policies defined for the enviro'
217
+ options_set.add('-skip-api-policies', desc) do |options|
210
218
  options.deep_merge!(skip: {api_policies: true})
211
219
  end
212
220
 
213
- options_set.add("-feed-only-stats", "Shows only stats when giving feedback") do |options|
221
+ options_set.add('-feed-only-stats', 'Shows only stats when giving feedback') do |options|
214
222
  options.deep_merge!(feedback: {only_stats: true})
215
223
  end
216
224
 
217
- desc = "Deprecated: used to be used to avoid reloading people after launch"
218
- options[:end_get] = true
219
- options_set.add("-no-get", desc) do |options|
220
- options[:end_get] = false
221
- end
222
-
223
225
  desc = "Force search mode to 'strict' when pairing input entries with existing people."
224
- desc << " Besides id and external_id it will not try to find by email unless external_id is not specified"
225
- options_set.add("-search-strict", desc) do |options|
226
+ desc << ' Besides id and external_id it will not try to find by email unless external_id is not specified'
227
+ options_set.add('-search-strict', desc) do |options|
226
228
  options.deep_merge!(search: {strict: true})
227
229
  end
228
230
 
229
- desc = "Search mode that will try to find people using email when id and external_id have failed"
230
- desc << " This option could identify existing people by their email addresses"
231
- desc << " (it should not be used in orgs where multiple people usually have the same email address)"
232
- options_set.add("-search-soft", desc) do |options|
231
+ desc = 'Search mode that will try to find people using email when id and external_id have failed'
232
+ desc << ' This option could identify existing people by their email addresses'
233
+ desc << ' (it should not be used in orgs where multiple people usually have the same email address)'
234
+ options_set.add('-search-soft', desc) do |options|
233
235
  options.deep_merge!(search: {
234
236
  soft: true,
235
237
  strict: false
236
238
  })
237
239
  end
238
240
 
239
- desc = "Prevent email to be sent (experimental)"
240
- options_set.add("-no-email", desc) do |options|
241
+ desc = 'Prevent email to be sent (experimental)'
242
+ options_set.add('-no-email', desc) do |options|
241
243
  options.deep_merge!(workflow: {no_email: true})
242
244
  end
243
245
 
244
- desc = "Silence notifications on account creation or invites"
245
- options_set.add(["-no-invites", "-exclude-invites"], desc) do |options|
246
+ desc = 'Silence notifications on account creation or invites'
247
+ options_set.add(['-no-invites', '-exclude-invites'], desc) do |options|
246
248
  options.merge!(send_invites: false)
247
249
  end
248
250
  desc = "People with account will be reinvited if they haven't accepted the invitation"
249
- options_set.add("-send-invites", desc) do |options|
251
+ options_set.add('-send-invites', desc) do |options|
250
252
  options.merge!(send_invites: true)
251
253
  end
252
254
 
253
- options_set.add("-exclude-core", "Core input data is not used on the update") do |options|
255
+ # EXCLUDE CORE
256
+
257
+ options_set.add('-exclude-core', 'Core input data is not used on the update') do |options|
254
258
  options.deep_merge!(exclude: {core: true})
255
259
  end
256
- options_set.add("-exclude-filter-tags", "filter_tags is not set with the input data") do |options|
260
+
261
+ options_set.add('-exclude-filter-tags', 'filter_tags is not set with the input data') do |options|
257
262
  options.deep_merge!(exclude: {filter_tags: true})
258
263
  end
259
- options_set.add("-exclude-external-id", "external_id is not set with the input data") do |options|
264
+
265
+ options_set.add('-exclude-external-id', 'external_id is not set with the input data') do |options|
260
266
  options.deep_merge!(exclude: {external_id: true})
261
267
  end
262
- options_set.add("-exclude-supervisor", "supervisor_id is not set with the input data") do |options|
268
+
269
+ options_set.add('-exclude-supervisor', 'supervisor_id is not set with the input data') do |options|
263
270
  options.deep_merge!(exclude: {supervisor: true})
264
271
  end
265
- options_set.add("-exclude-email", "email is not set with the input data") do |options|
272
+
273
+ options_set.add('-exclude-email', 'email is not set with the input data') do |options|
266
274
  options.deep_merge!(exclude: {email: true})
267
275
  end
268
- options_set.add("-exclude-name", "name is not set with the input data") do |options|
276
+
277
+ options_set.add('-exclude-name', 'name is not set with the input data') do |options|
269
278
  options.deep_merge!(exclude: {name: true})
270
279
  end
271
280
 
272
- options_set.add("-exclude-details", "Details are not set with the input data") do |options|
281
+ desc = 'contractor org will not be set'
282
+ options_set.add(['-exclude-contractor-organization', '-exclude-contractor-entity'], desc) do |options, _sess|
283
+ options.deep_merge!(exclude: {contractor_organization_id: true})
284
+ end
285
+
286
+ options_set.add('-exclude-archived', 'archived flag will not be changed') do |options, _sess|
287
+ options.deep_merge!(exclude: {archived: true})
288
+ end
289
+
290
+ # EXCLUDE DETAILS
291
+
292
+ options_set.add('-exclude-details', 'Details are not set with the input data') do |options|
273
293
  options.deep_merge!(exclude: {details: true})
274
294
  end
275
295
 
276
- options_set.add("-exclude-account", "Account is not set with the input data") do |options|
296
+ # EXCLUDE ACCOUNT
297
+
298
+ options_set.add('-exclude-account', 'Account is not set with the input data') do |options|
277
299
  options.deep_merge!(exclude: {account: true})
278
300
  end
279
- options_set.add("-exclude-policy-groups", "policy_group_ids is not set with the input data") do |options|
301
+
302
+ options_set.add('-exclude-policy-groups', 'policy_group_ids is not set with the input data') do |options|
280
303
  options.deep_merge!(exclude: {policy_groups: true})
281
304
  end
282
- options_set.add("-default-tag", "default_tag is not set with the input data") do |options|
305
+
306
+ options_set.add('-default-tag', 'default_tag is not set with the input data') do |options|
283
307
  options.deep_merge!(exclude: {default_tag: true})
284
308
  end
285
- options_set.add("-exclude-abilities", "permissions_custom is not set with the input data") do |options|
309
+ options_set.add('-exclude-abilities', 'permissions_custom is not set with the input data') do |options|
286
310
  options.deep_merge!(exclude: {abilities: true})
287
311
  end
288
- options_set.add("-exclude-login-providers", "login_provider_ids is not set with the input data") do |options|
312
+
313
+ options_set.add('-exclude-login-providers', 'login_provider_ids is not set with the input data') do |options|
289
314
  options.deep_merge!(exclude: {login_providers: true})
290
315
  end
291
316
  end
@@ -80,13 +80,13 @@ class Eco::CliDefault::People < Eco::API::Common::Loaders::CliConfig
80
80
  def optimize_get_partial!(input)
81
81
  return unless get_partial?
82
82
 
83
- msg = "To use -get-partial (partial updates), you need to use -entries-from"
83
+ msg = 'To use -get-partial (partial updates), you need to use -entries-from'
84
84
  raise msg unless input.is_a?(Enumerable)
85
85
 
86
86
  return unless input.count > MAX_GET_PARTIAL
87
87
 
88
- msg = "(Optimization) "
89
- msg << "Switching from partial to full people download. "
88
+ msg = '(Optimization) '
89
+ msg << 'Switching from partial to full people download. '
90
90
  msg << "Input (#{input.count}) surpases MAX_GET_PARTIAL "
91
91
  msg << "(#{MAX_GET_PARTIAL}) entries."
92
92
  session.log(:info) { msg }