holivia 0.7.0 → 0.8.1

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: a26d0c9d308b30ee2ecf2834ecb8f0dce84eb6b7ba0e561f31c0e53fa4804ccf
4
+ data.tar.gz: 62d2c94d7d97c14d7b25d89b64cb4344795451997cecee800d54bea575b9a25f
5
5
  SHA512:
6
- metadata.gz: 8e68ebf330b241d4eae1d048d415adb2f6f6b551d63bed270e0ab17610535672e323a26a4c85b904e338613d48b87f88f59a9920866fc6f9dd3299229907f348
7
- data.tar.gz: 9b431f54025a5420fada21b6769063b06f1da5e02cb1b5e09dc1b28bcadc534847758441fad1090b945c412c99fe9aeb24ae8c433792eaad2e4a69aba6a5c186
6
+ metadata.gz: 69c8e4423d087b1fbdb94927524a97889a7afd67daa28c5db3553b67a0b2171c24fd2198f06f6003556ef08353b15d54aede4dd7f818ef9f25d5514057e837e8
7
+ data.tar.gz: 4123d6b7749b3942c29c214d7b22b5286e73434037fb6ce6fb4a3b40a9aa5497df7b8bc645e13c3cdeb13a1680201505aa4e971ea3027c10fd90f4780c714dd2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.1] - 2026-07-08
4
+
5
+ - Add provider filtering and write support to `holivia intervention` commands
6
+
7
+ ## [0.8.0] - 2026-07-07
8
+
9
+ - Add `holivia intervention` commands for HR intervention catalog CRUD, publishing, schema discovery, and cover image uploads
10
+
3
11
  ## [0.7.0] - 2026-07-02
4
12
 
5
13
  - 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,48 @@ Publish it:
189
189
  holivia communication publish 123
190
190
  ```
191
191
 
192
+ Discover intervention catalog enum values, providers, 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
+ Filter intervention catalog items by provider:
205
+
206
+ ```bash
207
+ holivia intervention index --locale fr --provider wpo --state published
208
+ ```
209
+
210
+ Create an intervention item:
211
+
212
+ ```bash
213
+ holivia intervention create \
214
+ --locale fr \
215
+ --provider wpo \
216
+ --title "Manager burnout workshop" \
217
+ --intervention-type workshop \
218
+ --category raise_awareness_train \
219
+ --duration 90_min \
220
+ --short-outcome "Spot warning signs" \
221
+ --short-outcome "Choose support routines" \
222
+ --long-outcome "Map team risks" \
223
+ --modality online \
224
+ --audience managers \
225
+ --cover-image cover.png
226
+ ```
227
+
228
+ Publish it:
229
+
230
+ ```bash
231
+ holivia intervention publish 123
232
+ ```
233
+
192
234
  ## Files And Uploads
193
235
 
194
236
  Selfcare create and update commands can upload images with `--image <path>`.
@@ -207,6 +249,8 @@ Compose is JSON-only. To attach an image to a composed content tree, update the
207
249
 
208
250
  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
251
 
252
+ Intervention item create and update commands can upload or replace the cover image with `--cover-image <path>`.
253
+
210
254
  ## Development
211
255
 
212
256
  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, providers, modalities, audiences, durations, categories, states, and locales.
141
+
133
142
  ## Selfcare Content
134
143
 
135
144
  List contents:
@@ -269,6 +278,75 @@ 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 provider:
290
+
291
+ ```bash
292
+ holivia intervention index --locale fr --provider wpo --state published
293
+ ```
294
+
295
+ Filter by catalog metadata:
296
+
297
+ ```bash
298
+ holivia intervention index --query burnout --provider wpo --category raise_awareness_train --intervention-type workshop
299
+ ```
300
+
301
+ Show one intervention item:
302
+
303
+ ```bash
304
+ holivia intervention show 123
305
+ ```
306
+
307
+ Create an intervention item:
308
+
309
+ ```bash
310
+ holivia intervention create \
311
+ --locale fr \
312
+ --provider wpo \
313
+ --title "Manager burnout workshop" \
314
+ --intervention-type workshop \
315
+ --category raise_awareness_train \
316
+ --duration 90_min \
317
+ --short-outcome "Spot warning signs" \
318
+ --short-outcome "Choose support routines" \
319
+ --long-outcome "Map team risks" \
320
+ --modality online \
321
+ --audience managers \
322
+ --cover-image cover.png
323
+ ```
324
+
325
+ Create or update from JSON for complex multiline text:
326
+
327
+ ```bash
328
+ printf '{"locale":"fr","provider":"wpo","title":"Team audit","intervention_type":"audit","category":"audit_diagnose","modalities":["online"],"audience":["hr"]}' | holivia intervention create
329
+ ```
330
+
331
+ Update one localized item:
332
+
333
+ ```bash
334
+ holivia intervention update 123 --provider holivia --title "Updated title" --modality in_person
335
+ ```
336
+
337
+ Publish or unpublish one localized item:
338
+
339
+ ```bash
340
+ holivia intervention publish 123
341
+ holivia intervention unpublish 123
342
+ ```
343
+
344
+ Delete one localized item:
345
+
346
+ ```bash
347
+ holivia intervention delete 123
348
+ ```
349
+
272
350
  ## Selfcare Objective Associations
273
351
 
274
352
  List associations:
@@ -333,6 +411,7 @@ Before making API changes:
333
411
 
334
412
  - Run `holivia env` and verify the active URL/environment.
335
413
  - Run `holivia selfcare schema` before selfcare create/update/compose work.
414
+ - Run `holivia intervention schema` before intervention create/update work.
336
415
  - Use existing IDs from list/show commands or explicit user input.
337
416
  - Prefer draft states unless the user explicitly requests publishing.
338
417
  - 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,19 @@ 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
+ --provider PROVIDER --category KEY --translation-group-id UUID
66
+ --intervention-type TYPE]
67
+ List HR intervention catalog items
68
+ holivia intervention schema Show allowed intervention enum values, providers, and locales
69
+ holivia intervention show <id> Show one intervention item
70
+ holivia intervention create [options] Create one localized intervention item
71
+ holivia intervention update <id> [options] Update one localized intervention item
72
+ holivia intervention publish <id> Publish one intervention item
73
+ holivia intervention unpublish <id> Unpublish one intervention item
74
+ holivia intervention delete <id> Delete one localized intervention item
75
+
63
76
  Appointments:
64
77
  holivia appointment video-diagnostics <id> Show video diagnostics for an appointment
65
78
 
@@ -102,6 +115,7 @@ module Holivia
102
115
  Accepted image formats: JPEG, PNG, WebP, GIF. Max size: 5 MB.
103
116
  Communication uploads use --document <path> and optional --cover-image <path>.
104
117
  The API validates accepted communication upload formats and file sizes.
118
+ Intervention cover images use --cover-image <path> on intervention create/update.
105
119
  Compose is JSON-only — to attach an image to a composed tree, PATCH the returned id:
106
120
  holivia selfcare update <id> --image <path>
107
121
 
@@ -114,6 +128,8 @@ module Holivia
114
128
  Run holivia selfcare schema to get current allowed values for all enums
115
129
  and item types with their permitted params. Always use this over hardcoded
116
130
  values — it is the source of truth.
131
+ Run holivia intervention schema before creating or updating intervention items
132
+ to discover current intervention enum values and locales.
117
133
 
118
134
  Version:
119
135
  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,154 @@
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("--provider PROVIDER") { |v| params[:provider] = v }
42
+ opts.on("--state STATE") { |v| params[:state] = v }
43
+ opts.on("--category CATEGORY") { |v| params[:category] = v }
44
+ opts.on("--translation-group-id UUID") { |v| params[:translation_group_id] = v }
45
+ opts.on("--intervention-type TYPE") { |v| params[:intervention_type] = v }
46
+ end.parse!(args)
47
+
48
+ output(client.get(BASE_PATH, params: params))
49
+ end
50
+
51
+ def schema(_args = [])
52
+ output(client.get("#{BASE_PATH}/schema"))
53
+ end
54
+
55
+ def show(args = [])
56
+ id = args.shift
57
+ abort "Usage: holivia intervention show <id>" unless id
58
+
59
+ output(client.get("#{BASE_PATH}/#{id}"))
60
+ end
61
+
62
+ def create(args = [])
63
+ options = {}
64
+ OptionParser.new do |opts|
65
+ opts.banner = "Usage: holivia intervention create [options]"
66
+ add_write_options(opts, options)
67
+ end.parse!(args)
68
+ options = options.merge(piped_json)
69
+
70
+ abort "No options provided. Use --help for usage." if options.empty?
71
+ output(client.post(BASE_PATH, body: build_body(options)))
72
+ end
73
+
74
+ def update(args = [])
75
+ id = args.shift
76
+ abort "Usage: holivia intervention update <id> [options]" unless id
77
+
78
+ options = {}
79
+ OptionParser.new do |opts|
80
+ opts.banner = "Usage: holivia intervention update <id> [options]"
81
+ add_write_options(opts, options)
82
+ end.parse!(args)
83
+ options = options.merge(piped_json)
84
+
85
+ abort "No options provided. Use --help for usage." if options.empty?
86
+ output(client.patch("#{BASE_PATH}/#{id}", body: build_body(options)))
87
+ end
88
+
89
+ def publish(args = [])
90
+ transition(args, "publish")
91
+ end
92
+
93
+ def unpublish(args = [])
94
+ transition(args, "unpublish")
95
+ end
96
+
97
+ def delete(args = [])
98
+ id = args.shift
99
+ abort "Usage: holivia intervention delete <id>" unless id
100
+
101
+ client.delete("#{BASE_PATH}/#{id}")
102
+ output(deleted: true, id: id.to_i)
103
+ end
104
+
105
+ private
106
+
107
+ def add_write_options(opts, options) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
108
+ opts.on("--translation-group-id UUID") { |v| options[:translation_group_id] = v }
109
+ opts.on("--locale LOCALE") { |v| options[:locale] = v }
110
+ opts.on("--provider PROVIDER") { |v| options[:provider] = v }
111
+ opts.on("--title TITLE") { |v| options[:title] = v }
112
+ opts.on("--description DESC") { |v| options[:description] = v }
113
+ opts.on("--program PROGRAM") { |v| options[:program] = v }
114
+ opts.on("--intervention-type TYPE") { |v| options[:intervention_type] = v }
115
+ opts.on("--duration DURATION") { |v| options[:duration] = v }
116
+ opts.on("--category CATEGORY") { |v| options[:category] = v }
117
+ opts.on("--short-outcome TEXT") { |v| append_array_value(options, :short_outcomes, v) }
118
+ opts.on("--long-outcome TEXT") { |v| append_array_value(options, :long_outcomes, v) }
119
+ opts.on("--modality MODALITY") { |v| append_array_value(options, :modalities, v) }
120
+ opts.on("--audience AUDIENCE") { |v| append_array_value(options, :audience, v) }
121
+ opts.on("--cover-image FILE") { |v| options[:cover_image] = v }
122
+ end
123
+
124
+ def append_array_value(options, key, value)
125
+ options[key] ||= []
126
+ options[key] << value
127
+ end
128
+
129
+ def transition(args, event)
130
+ id = args.shift
131
+ abort "Usage: holivia intervention #{event} <id>" unless id
132
+
133
+ output(client.patch("#{BASE_PATH}/#{id}/#{event}"))
134
+ end
135
+
136
+ def build_body(options)
137
+ options = options.dup
138
+ attach_cover_image(options)
139
+ options
140
+ end
141
+
142
+ def attach_cover_image(options)
143
+ path = options[:cover_image]
144
+ return unless path
145
+
146
+ options[:cover_image] = Faraday::Multipart::FilePart.new(path, detect_mime(path))
147
+ end
148
+
149
+ def detect_mime(path)
150
+ IMAGE_MIME_TYPES.fetch(File.extname(path).downcase, "application/octet-stream")
151
+ end
152
+ end
153
+ end
154
+ 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.1"
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.1
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