holivia 0.7.0 → 0.8.0

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: 61c8a59293a0b4cfb43dca7bad3c64694c75582875dff6198efea295712a1477
4
- data.tar.gz: 9795ce32e8ada6e69eeedbb24549f711120ec6caa491d89fb86605bd2ecbb4a2
3
+ metadata.gz: 37fbbbbc00a19fce307307f0d0d0465383b83759a1bbb30977131edfff1c3a98
4
+ data.tar.gz: 0241e8e1ece96ea66fdabe38c188e2914f071a26d225a778a6373c1a5c74fb64
5
5
  SHA512:
6
- metadata.gz: 8e68ebf330b241d4eae1d048d415adb2f6f6b551d63bed270e0ab17610535672e323a26a4c85b904e338613d48b87f88f59a9920866fc6f9dd3299229907f348
7
- data.tar.gz: 9b431f54025a5420fada21b6769063b06f1da5e02cb1b5e09dc1b28bcadc534847758441fad1090b945c412c99fe9aeb24ae8c433792eaad2e4a69aba6a5c186
6
+ metadata.gz: b310a7ef0b2f389a796a352d60455b33798c796821577623686b6658030d7716d4b7445fbac599630f5cf39d0ddc5db3c32d2ac3930dde8ec5692b37b3f300a8
7
+ data.tar.gz: 13a99d2b9dd8e0b27e2bc3ad941d9e7756f8b629d30b347f13785f818f58db8df1c460fed7518b6b458a9752323028ed67e0325ab8448a8da39fd09f76884044
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.0] - 2026-07-07
4
+
5
+ - Add `holivia intervention` commands for HR intervention catalog CRUD, publishing, schema discovery, and cover image uploads
6
+
3
7
  ## [0.7.0] - 2026-07-02
4
8
 
5
9
  - Add `holivia communication` commands for communication library CRUD, publishing, schema discovery, and document/cover uploads
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Ruby client and command-line interface for the Holivia API.
4
4
 
5
- The `holivia` executable is primarily used to manage Holivia backoffice data from the terminal: environments, authentication, selfcare content, objectives, communication library items, and appointment diagnostics.
5
+ The `holivia` executable is primarily used to manage Holivia backoffice data from the terminal: environments, authentication, selfcare content, objectives, communication library items, HR intervention catalog items, and appointment diagnostics.
6
6
 
7
7
  Coding agents can use [`SKILL.md`](SKILL.md) as a downloadable usage guide for operating this CLI safely.
8
8
 
@@ -189,6 +189,41 @@ Publish it:
189
189
  holivia communication publish 123
190
190
  ```
191
191
 
192
+ Discover intervention catalog enum values and locales:
193
+
194
+ ```bash
195
+ holivia intervention schema
196
+ ```
197
+
198
+ List intervention catalog items:
199
+
200
+ ```bash
201
+ holivia intervention index --locale fr --state published --category audit_diagnose
202
+ ```
203
+
204
+ Create an intervention item:
205
+
206
+ ```bash
207
+ holivia intervention create \
208
+ --locale fr \
209
+ --title "Manager burnout workshop" \
210
+ --intervention-type workshop \
211
+ --category raise_awareness_train \
212
+ --duration 90_min \
213
+ --short-outcome "Spot warning signs" \
214
+ --short-outcome "Choose support routines" \
215
+ --long-outcome "Map team risks" \
216
+ --modality online \
217
+ --audience managers \
218
+ --cover-image cover.png
219
+ ```
220
+
221
+ Publish it:
222
+
223
+ ```bash
224
+ holivia intervention publish 123
225
+ ```
226
+
192
227
  ## Files And Uploads
193
228
 
194
229
  Selfcare create and update commands can upload images with `--image <path>`.
@@ -207,6 +242,8 @@ Compose is JSON-only. To attach an image to a composed content tree, update the
207
242
 
208
243
  Communication item create and update commands upload the required document with `--document <path>` and can upload or replace the cover image with `--cover-image <path>`.
209
244
 
245
+ Intervention item create and update commands can upload or replace the cover image with `--cover-image <path>`.
246
+
210
247
  ## Development
211
248
 
212
249
  After checking out the repo, run:
data/SKILL.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use this skill when you need to operate the Holivia API through the `holivia` command-line tool.
4
4
 
5
- The CLI manages Holivia backoffice data: environments, authentication, selfcare contents, objectives, selfcare-objective associations, and appointment video diagnostics.
5
+ The CLI manages Holivia backoffice data: environments, authentication, selfcare contents, objectives, selfcare-objective associations, HR intervention catalog items, and appointment video diagnostics.
6
6
 
7
7
  ## Preconditions
8
8
 
@@ -18,6 +18,7 @@ Use `holivia` in examples below. If working from a checkout before installation,
18
18
  - Never print, store, or commit passwords, access tokens, refresh tokens, or files under `~/.holivia/credentials.*.json`.
19
19
  - Prefer interactive `holivia login` when a human can enter credentials. Use `--password` only when the user explicitly provides it for automation.
20
20
  - Before creating or updating content, run `holivia selfcare schema` and use its returned enum values and permitted item params as the source of truth.
21
+ - Before creating or updating intervention catalog items, run `holivia intervention schema` and use its returned enum values and locales as the source of truth.
21
22
  - For destructive actions such as `holivia env remove` or `holivia selfcare objective delete`, confirm the target environment and ID first unless the user explicitly requested that exact action.
22
23
  - Treat all command output as JSON except informational commands such as `holivia env`, `holivia env list`, `holivia login`, `holivia logout`, `holivia version`, and `holivia --help`.
23
24
 
@@ -130,6 +131,14 @@ Use the schema response for:
130
131
  - objective tiers
131
132
  - item-specific permitted params
132
133
 
134
+ For intervention catalog work, discover the live schema first:
135
+
136
+ ```bash
137
+ holivia intervention schema
138
+ ```
139
+
140
+ Use the schema response for intervention types, modalities, audiences, durations, categories, states, and locales.
141
+
133
142
  ## Selfcare Content
134
143
 
135
144
  List contents:
@@ -269,6 +278,68 @@ holivia objective show 123
269
278
 
270
279
  Objective translated fields are returned in the default locale, currently `fr`.
271
280
 
281
+ ## Intervention Items
282
+
283
+ List intervention catalog items:
284
+
285
+ ```bash
286
+ holivia intervention index --locale fr --state published
287
+ ```
288
+
289
+ Filter by catalog metadata:
290
+
291
+ ```bash
292
+ holivia intervention index --query burnout --category raise_awareness_train --intervention-type workshop
293
+ ```
294
+
295
+ Show one intervention item:
296
+
297
+ ```bash
298
+ holivia intervention show 123
299
+ ```
300
+
301
+ Create an intervention item:
302
+
303
+ ```bash
304
+ holivia intervention create \
305
+ --locale fr \
306
+ --title "Manager burnout workshop" \
307
+ --intervention-type workshop \
308
+ --category raise_awareness_train \
309
+ --duration 90_min \
310
+ --short-outcome "Spot warning signs" \
311
+ --short-outcome "Choose support routines" \
312
+ --long-outcome "Map team risks" \
313
+ --modality online \
314
+ --audience managers \
315
+ --cover-image cover.png
316
+ ```
317
+
318
+ Create or update from JSON for complex multiline text:
319
+
320
+ ```bash
321
+ printf '{"locale":"fr","title":"Team audit","intervention_type":"audit","category":"audit_diagnose","modalities":["online"],"audience":["hr"]}' | holivia intervention create
322
+ ```
323
+
324
+ Update one localized item:
325
+
326
+ ```bash
327
+ holivia intervention update 123 --title "Updated title" --modality in_person
328
+ ```
329
+
330
+ Publish or unpublish one localized item:
331
+
332
+ ```bash
333
+ holivia intervention publish 123
334
+ holivia intervention unpublish 123
335
+ ```
336
+
337
+ Delete one localized item:
338
+
339
+ ```bash
340
+ holivia intervention delete 123
341
+ ```
342
+
272
343
  ## Selfcare Objective Associations
273
344
 
274
345
  List associations:
@@ -333,6 +404,7 @@ Before making API changes:
333
404
 
334
405
  - Run `holivia env` and verify the active URL/environment.
335
406
  - Run `holivia selfcare schema` before selfcare create/update/compose work.
407
+ - Run `holivia intervention schema` before intervention create/update work.
336
408
  - Use existing IDs from list/show commands or explicit user input.
337
409
  - Prefer draft states unless the user explicitly requests publishing.
338
410
  - Use JSON files or stdin for complex payloads.
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Holivia
4
4
  class CLI
5
- module Help
5
+ module Help # rubocop:disable Metrics/ModuleLength
6
6
  HELP_TEXT = <<~HELP
7
7
  HOLIVIA CLI
8
8
  ===========
@@ -60,6 +60,18 @@ module Holivia
60
60
  holivia communication delete <id> Delete a communication item
61
61
  holivia communication schema Show allowed document_types and locales
62
62
 
63
+ Intervention Items:
64
+ holivia intervention index [--page N --per-page N --query TEXT --locale LOCALE --state STATE
65
+ --category KEY --translation-group-id UUID --intervention-type TYPE]
66
+ List HR intervention catalog items
67
+ holivia intervention schema Show allowed intervention enum values and locales
68
+ holivia intervention show <id> Show one intervention item
69
+ holivia intervention create [options] Create one localized intervention item
70
+ holivia intervention update <id> [options] Update one localized intervention item
71
+ holivia intervention publish <id> Publish one intervention item
72
+ holivia intervention unpublish <id> Unpublish one intervention item
73
+ holivia intervention delete <id> Delete one localized intervention item
74
+
63
75
  Appointments:
64
76
  holivia appointment video-diagnostics <id> Show video diagnostics for an appointment
65
77
 
@@ -102,6 +114,7 @@ module Holivia
102
114
  Accepted image formats: JPEG, PNG, WebP, GIF. Max size: 5 MB.
103
115
  Communication uploads use --document <path> and optional --cover-image <path>.
104
116
  The API validates accepted communication upload formats and file sizes.
117
+ Intervention cover images use --cover-image <path> on intervention create/update.
105
118
  Compose is JSON-only — to attach an image to a composed tree, PATCH the returned id:
106
119
  holivia selfcare update <id> --image <path>
107
120
 
@@ -114,6 +127,8 @@ module Holivia
114
127
  Run holivia selfcare schema to get current allowed values for all enums
115
128
  and item types with their permitted params. Always use this over hardcoded
116
129
  values — it is the source of truth.
130
+ Run holivia intervention schema before creating or updating intervention items
131
+ to discover current intervention enum values and locales.
117
132
 
118
133
  Version:
119
134
  holivia version Print version
data/lib/holivia/cli.rb CHANGED
@@ -11,6 +11,7 @@ require_relative "commands/item"
11
11
  require_relative "commands/objective"
12
12
  require_relative "commands/appointment"
13
13
  require_relative "commands/communication_item"
14
+ require_relative "commands/intervention_item"
14
15
 
15
16
  module Holivia
16
17
  class CLI
@@ -24,6 +25,7 @@ module Holivia
24
25
  when "objective" then Commands::Objective.route(args)
25
26
  when "appointment" then Commands::Appointment.route(args)
26
27
  when "communication" then Commands::CommunicationItem.route(args)
28
+ when "intervention" then Commands::InterventionItem.route(args)
27
29
  when "version", "--version", "-v" then puts "holivia #{Holivia::VERSION}"
28
30
  when "--help", "-h", nil then puts Help::HELP_TEXT
29
31
  else warn "Unknown command: #{command}"
@@ -0,0 +1,152 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module Holivia
6
+ module Commands
7
+ class InterventionItem < Base # rubocop:disable Metrics/ClassLength
8
+ BASE_PATH = "/api/v1/backoffice/intervention_items"
9
+ IMAGE_MIME_TYPES = {
10
+ ".gif" => "image/gif",
11
+ ".jpeg" => "image/jpeg",
12
+ ".jpg" => "image/jpeg",
13
+ ".png" => "image/png",
14
+ ".webp" => "image/webp"
15
+ }.freeze
16
+
17
+ def self.route(args) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength
18
+ subcommand = args.shift
19
+ case subcommand
20
+ when "index" then new.index(args)
21
+ when "schema" then new.schema(args)
22
+ when "show" then new.show(args)
23
+ when "create" then new.create(args)
24
+ when "update" then new.update(args)
25
+ when "publish" then new.publish(args)
26
+ when "unpublish" then new.unpublish(args)
27
+ when "delete" then new.delete(args)
28
+ else warn "Unknown intervention command: #{subcommand}"
29
+ exit 1
30
+ end
31
+ end
32
+
33
+ def index(args = []) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
34
+ params = {}
35
+ OptionParser.new do |opts|
36
+ opts.banner = "Usage: holivia intervention index [options]"
37
+ opts.on("--page N", Integer) { |v| params[:page] = v }
38
+ opts.on("--per-page N", Integer) { |v| params[:per_page] = v }
39
+ opts.on("--query TEXT") { |v| params[:query] = v }
40
+ opts.on("--locale LOCALE") { |v| params[:locale] = v }
41
+ opts.on("--state STATE") { |v| params[:state] = v }
42
+ opts.on("--category CATEGORY") { |v| params[:category] = v }
43
+ opts.on("--translation-group-id UUID") { |v| params[:translation_group_id] = v }
44
+ opts.on("--intervention-type TYPE") { |v| params[:intervention_type] = v }
45
+ end.parse!(args)
46
+
47
+ output(client.get(BASE_PATH, params: params))
48
+ end
49
+
50
+ def schema(_args = [])
51
+ output(client.get("#{BASE_PATH}/schema"))
52
+ end
53
+
54
+ def show(args = [])
55
+ id = args.shift
56
+ abort "Usage: holivia intervention show <id>" unless id
57
+
58
+ output(client.get("#{BASE_PATH}/#{id}"))
59
+ end
60
+
61
+ def create(args = [])
62
+ options = {}
63
+ OptionParser.new do |opts|
64
+ opts.banner = "Usage: holivia intervention create [options]"
65
+ add_write_options(opts, options)
66
+ end.parse!(args)
67
+ options = options.merge(piped_json)
68
+
69
+ abort "No options provided. Use --help for usage." if options.empty?
70
+ output(client.post(BASE_PATH, body: build_body(options)))
71
+ end
72
+
73
+ def update(args = [])
74
+ id = args.shift
75
+ abort "Usage: holivia intervention update <id> [options]" unless id
76
+
77
+ options = {}
78
+ OptionParser.new do |opts|
79
+ opts.banner = "Usage: holivia intervention update <id> [options]"
80
+ add_write_options(opts, options)
81
+ end.parse!(args)
82
+ options = options.merge(piped_json)
83
+
84
+ abort "No options provided. Use --help for usage." if options.empty?
85
+ output(client.patch("#{BASE_PATH}/#{id}", body: build_body(options)))
86
+ end
87
+
88
+ def publish(args = [])
89
+ transition(args, "publish")
90
+ end
91
+
92
+ def unpublish(args = [])
93
+ transition(args, "unpublish")
94
+ end
95
+
96
+ def delete(args = [])
97
+ id = args.shift
98
+ abort "Usage: holivia intervention delete <id>" unless id
99
+
100
+ client.delete("#{BASE_PATH}/#{id}")
101
+ output(deleted: true, id: id.to_i)
102
+ end
103
+
104
+ private
105
+
106
+ def add_write_options(opts, options) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
107
+ opts.on("--translation-group-id UUID") { |v| options[:translation_group_id] = v }
108
+ opts.on("--locale LOCALE") { |v| options[:locale] = v }
109
+ opts.on("--title TITLE") { |v| options[:title] = v }
110
+ opts.on("--description DESC") { |v| options[:description] = v }
111
+ opts.on("--program PROGRAM") { |v| options[:program] = v }
112
+ opts.on("--intervention-type TYPE") { |v| options[:intervention_type] = v }
113
+ opts.on("--duration DURATION") { |v| options[:duration] = v }
114
+ opts.on("--category CATEGORY") { |v| options[:category] = v }
115
+ opts.on("--short-outcome TEXT") { |v| append_array_value(options, :short_outcomes, v) }
116
+ opts.on("--long-outcome TEXT") { |v| append_array_value(options, :long_outcomes, v) }
117
+ opts.on("--modality MODALITY") { |v| append_array_value(options, :modalities, v) }
118
+ opts.on("--audience AUDIENCE") { |v| append_array_value(options, :audience, v) }
119
+ opts.on("--cover-image FILE") { |v| options[:cover_image] = v }
120
+ end
121
+
122
+ def append_array_value(options, key, value)
123
+ options[key] ||= []
124
+ options[key] << value
125
+ end
126
+
127
+ def transition(args, event)
128
+ id = args.shift
129
+ abort "Usage: holivia intervention #{event} <id>" unless id
130
+
131
+ output(client.patch("#{BASE_PATH}/#{id}/#{event}"))
132
+ end
133
+
134
+ def build_body(options)
135
+ options = options.dup
136
+ attach_cover_image(options)
137
+ options
138
+ end
139
+
140
+ def attach_cover_image(options)
141
+ path = options[:cover_image]
142
+ return unless path
143
+
144
+ options[:cover_image] = Faraday::Multipart::FilePart.new(path, detect_mime(path))
145
+ end
146
+
147
+ def detect_mime(path)
148
+ IMAGE_MIME_TYPES.fetch(File.extname(path).downcase, "application/octet-stream")
149
+ end
150
+ end
151
+ end
152
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Holivia
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holivia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Holivia
@@ -68,6 +68,7 @@ files:
68
68
  - lib/holivia/commands/communication_item.rb
69
69
  - lib/holivia/commands/env.rb
70
70
  - lib/holivia/commands/format.rb
71
+ - lib/holivia/commands/intervention_item.rb
71
72
  - lib/holivia/commands/item.rb
72
73
  - lib/holivia/commands/objective.rb
73
74
  - lib/holivia/commands/selfcare.rb