@jumpgroup/laravel-tools 3.3.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.
Files changed (78) hide show
  1. package/.claude/settings.local.json +59 -0
  2. package/README.md +378 -0
  3. package/bin/groups/cache.js +52 -0
  4. package/bin/groups/database.js +105 -0
  5. package/bin/groups/forge.js +272 -0
  6. package/bin/groups/local.js +78 -0
  7. package/bin/groups/media.js +110 -0
  8. package/bin/tools.js +23 -0
  9. package/docs/Changelog.md +267 -0
  10. package/docs/TODO.md +167 -0
  11. package/docs/releases/release_0.0.1.md +116 -0
  12. package/docs/releases/release_0.0.2.md +88 -0
  13. package/docs/releases/release_0.0.3.md +58 -0
  14. package/docs/releases/release_0.0.4.md +128 -0
  15. package/docs/releases/release_0.0.5.md +77 -0
  16. package/docs/releases/release_0.0.6.md +80 -0
  17. package/docs/releases/release_1.0.0.md +61 -0
  18. package/docs/releases/release_1.0.1.md +18 -0
  19. package/docs/releases/release_1.0.2.md +18 -0
  20. package/docs/releases/release_1.0.3.md +19 -0
  21. package/docs/releases/release_1.1.0.md +18 -0
  22. package/docs/releases/release_1.1.1.md +17 -0
  23. package/docs/releases/release_1.1.2.md +18 -0
  24. package/docs/releases/release_1.1.3.md +21 -0
  25. package/docs/releases/release_1.1.4.md +18 -0
  26. package/docs/releases/release_1.1.5.md +18 -0
  27. package/docs/releases/release_1.1.6.md +21 -0
  28. package/docs/releases/release_1.1.7.md +17 -0
  29. package/docs/releases/release_2.0.0.md +192 -0
  30. package/docs/releases/release_2.0.1.md +53 -0
  31. package/docs/releases/release_2.0.2.md +55 -0
  32. package/docs/releases/release_2.0.3.md +69 -0
  33. package/docs/releases/release_2.1.0.md +59 -0
  34. package/docs/releases/release_2.2.0.md +83 -0
  35. package/docs/releases/release_2.2.1.md +36 -0
  36. package/docs/releases/release_2.2.2.md +57 -0
  37. package/docs/releases/release_2.2.3.md +39 -0
  38. package/docs/releases/release_2.2.4.md +75 -0
  39. package/docs/releases/release_2.2.5.md +69 -0
  40. package/docs/releases/release_3.0.0.md +87 -0
  41. package/docs/releases/release_3.0.1.md +65 -0
  42. package/docs/releases/release_3.1.0.md +90 -0
  43. package/docs/releases/release_3.2.0.md +74 -0
  44. package/docs/releases/release_3.3.0.md +72 -0
  45. package/package.json +35 -0
  46. package/src/aws/bucket.js +287 -0
  47. package/src/aws/cloudfront.js +433 -0
  48. package/src/aws/config.js +39 -0
  49. package/src/aws/iam.js +189 -0
  50. package/src/cache.js +49 -0
  51. package/src/database.js +315 -0
  52. package/src/forge/client.js +43 -0
  53. package/src/forge/config.js +33 -0
  54. package/src/forge/provisioning.js +191 -0
  55. package/src/forge/servers.js +27 -0
  56. package/src/forge/sites.js +93 -0
  57. package/src/google/groupMembers.js +35 -0
  58. package/src/google/utilities.js +39 -0
  59. package/src/local/doctor.js +214 -0
  60. package/src/local/setup.js +398 -0
  61. package/src/media.js +143 -0
  62. package/src/stub/docker/mysql/my.cnf +6 -0
  63. package/src/stub/docker/php/local.ini +4 -0
  64. package/src/stub/docker/traefik/dynamic_conf.yml +4 -0
  65. package/src/stub/docker/traefik/traefik.yml +24 -0
  66. package/src/stub/docker-compose/php8.0/docker-compose.yml +78 -0
  67. package/src/stub/docker-compose/php8.1/docker-compose.yml +78 -0
  68. package/src/stub/docker-compose/php8.2/docker-compose.yml +78 -0
  69. package/src/stub/docker-compose/php8.3/docker-compose.yml +78 -0
  70. package/src/stub/docker-compose/php8.4/docker-compose.yml +78 -0
  71. package/src/stub/docker-compose.yml +78 -0
  72. package/src/utilities/command.js +137 -0
  73. package/src/utilities/dateUtils.js +7 -0
  74. package/src/utilities/fileUtils.js +36 -0
  75. package/src/utilities/google-drive.js +69 -0
  76. package/src/utilities/pathUtils.js +15 -0
  77. package/src/utilities/userInput.js +28 -0
  78. package/src/utilities/utilities.js +57 -0
@@ -0,0 +1,192 @@
1
+ # Release 2.0.0 — AWS media stack (S3 + CloudFront)
2
+
3
+ **Date:** 2026-04-07
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Adds a new `media` command group focused on project media delivery through AWS.
10
+ The feature is designed around a private S3 bucket fronted by CloudFront, with
11
+ an Origin Access Control (OAC) and a dedicated IAM user for application uploads.
12
+
13
+ This is not a generic AWS provisioning layer. It is a project-scoped media setup
14
+ flow that assumes one logical media bucket and one logical CloudFront
15
+ distribution per Laravel project, both identified by the `site` tag.
16
+
17
+ ---
18
+
19
+ ## Commands added
20
+
21
+ | Command | What it does |
22
+ |---------|-------------|
23
+ | `media setup-general` | Full setup/reconcile flow: bucket, CloudFront, bucket policy, IAM user, env updates |
24
+ | `media setup-iam` | Creates or rotates the project media IAM user credentials |
25
+ | `media s3 list` | Lists S3 buckets and their `site` tag |
26
+ | `media s3 get --tag <tag>` | Finds S3 bucket(s) by exact `site` tag |
27
+ | `media cloudfront list` | Lists CloudFront distributions and their `site` tag |
28
+ | `media cloudfront get --tag <tag>` | Finds the CloudFront distribution by exact `site` tag |
29
+ | `media cloudfront setup` | Creates or reconciles the CloudFront distribution for a project and ensures S3 read access |
30
+
31
+ ---
32
+
33
+ ## Architecture
34
+
35
+ The media stack now follows this model:
36
+
37
+ - S3 bucket: private
38
+ - Bucket ownership: `BucketOwnerEnforced`
39
+ - Public access block: fully enabled
40
+ - CloudFront origin: S3 REST endpoint
41
+ - Access model: CloudFront OAC with SigV4 signing
42
+ - Bucket policy: grants `s3:GetObject` only to the specific CloudFront distribution
43
+ - Application credentials: dedicated IAM user per project
44
+
45
+ This avoids the previous ambiguous middle ground between a public bucket and a
46
+ private bucket. Uploaded objects are expected to stay private in S3 and be read
47
+ through CloudFront.
48
+
49
+ ---
50
+
51
+ ## Files added
52
+
53
+ ### `bin/groups/media.js`
54
+ CLI-only layer for the new `media` command group.
55
+
56
+ Subcommands:
57
+ - `setup-general`
58
+ - `setup-iam`
59
+ - `s3 list`
60
+ - `s3 get`
61
+ - `cloudfront list`
62
+ - `cloudfront get`
63
+ - `cloudfront setup`
64
+
65
+ ### `src/aws/config.js`
66
+ AWS runtime configuration helpers:
67
+ - profile resolution from `AWS_PROFILE` (fallback: `default`)
68
+ - region resolution from `AWS_REGION` / `AWS_DEFAULT_REGION` (fallback: `eu-central-1`)
69
+ - CloudFront region resolution (fallback: `us-east-1`)
70
+ - credentials loading through the shared AWS config/credentials file
71
+ - AWS account ID lookup through STS `GetCallerIdentity`
72
+
73
+ ### `src/aws/bucket.js`
74
+ S3-specific media logic:
75
+ - bucket creation for `${projectName}-media`
76
+ - bucket existence checks
77
+ - tagging via `site=<projectName>`
78
+ - enforcement of private bucket posture
79
+ - bucket listing / lookup helpers
80
+ - merge-safe CloudFront bucket policy application
81
+
82
+ `applyCloudFrontReadPolicy(...)` is intentionally idempotent:
83
+ - reads the current bucket policy if present
84
+ - removes only the statement for the same distribution
85
+ - preserves unrelated statements
86
+ - writes the merged result back
87
+
88
+ ### `src/aws/cloudfront.js`
89
+ CloudFront-specific media logic:
90
+ - distribution listing with tag resolution
91
+ - strict lookup by exact `site` tag
92
+ - OAC discovery/creation
93
+ - distribution creation for the project bucket
94
+ - reconciliation of existing distributions so the expected bucket origin uses OAC
95
+ - standalone `cloudfront setup` flow that also ensures the S3 bucket read policy exists
96
+
97
+ Important constraint:
98
+ - distribution lookup is now strict by `site` tag
99
+ - if multiple distributions share the same tag, the command fails and requires manual cleanup
100
+
101
+ ### `src/aws/iam.js`
102
+ IAM-specific media logic:
103
+ - ensures the project media user exists
104
+ - writes/updates the inline media policy
105
+ - tags the user with `site=<projectName>`
106
+ - rotates access keys safely
107
+
108
+ Safe key rotation behavior:
109
+ - if 0 keys exist: create one
110
+ - if 1 key exists: create the new key first, then delete the old one
111
+ - if 2 keys exist: fail safely and require manual intervention
112
+
113
+ ### `src/media.js`
114
+ Orchestration layer for the higher-level flows:
115
+
116
+ **`setupMediaStack(projectName, options)`**
117
+ 1. creates or reconciles the S3 bucket
118
+ 2. creates or reconciles the CloudFront distribution
119
+ 3. applies the CloudFront-specific S3 bucket policy
120
+ 4. creates/rotates IAM credentials
121
+ 5. updates `.env.example`
122
+ 6. pushes credentials to `secret-fetcher` if configured
123
+
124
+ **`setupMediaIam(projectName, cloudfrontId)`**
125
+ 1. resolves the distribution by project tag when needed
126
+ 2. creates/rotates the media IAM user
127
+ 3. pushes credentials to `secret-fetcher` if configured
128
+
129
+ ---
130
+
131
+ ## Integration with local setup
132
+
133
+ `local setup-project` now asks whether the AWS media stack should also be configured.
134
+
135
+ If confirmed, the command:
136
+ - uses the normalized project name
137
+ - launches `setupMediaStack(...)`
138
+ - updates `.env.example` with the resulting media values
139
+
140
+ If skipped, the media stack can be configured later with:
141
+
142
+ ```bash
143
+ laravel-tools media setup-general
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Environment variables written
149
+
150
+ When media setup runs with env updates enabled, `.env.example` is enriched with:
151
+
152
+ ```env
153
+ AWS_DEFAULT_REGION=
154
+ AWS_BUCKET=
155
+ AWS_URL=
156
+ CLOUDFRONT_DISTRIBUTION_ID=
157
+ CLOUDFRONT_DOMAIN=
158
+ S3_SITE_BUCKET=
159
+ S3_UPLOADS_BUCKET_URL=
160
+ ```
161
+
162
+ These values are derived from the actual AWS resources created or resolved by
163
+ the tool.
164
+
165
+ ---
166
+
167
+ ## Secret fetcher integration
168
+
169
+ If `.secret-fetcher` exists in the target project root, the generated media IAM
170
+ credentials are pushed through `@jumpgroup/secret-fetcher` under `env=site`.
171
+
172
+ This allows the AWS access key pair to join the project's existing secret flow
173
+ instead of remaining only in terminal output.
174
+
175
+ ---
176
+
177
+ ## Operational notes
178
+
179
+ - The tool assumes valid local AWS credentials already exist in the shared AWS profile files.
180
+ - S3 bucket naming is deterministic: `${APP_NAME}-media`.
181
+ - CloudFront resources are matched by exact `site` tag, not by fuzzy name/domain heuristics.
182
+ - `media cloudfront setup` requires the bucket to exist first.
183
+ - The implementation is designed to be rerunnable without recreating resources unnecessarily.
184
+
185
+ ---
186
+
187
+ ## Impact
188
+
189
+ - Laravel projects now have a first-party media setup path inside `laravel-tools`
190
+ - The local project bootstrap can optionally provision media infrastructure during setup
191
+ - The storage/CDN model is now documented and consistent:
192
+ private S3 + CloudFront OAC + dedicated media IAM user
@@ -0,0 +1,53 @@
1
+ # Release 2.0.1 — Dry-run fix for S3 bucket policy setup
2
+
3
+ **Date:** 2026-04-07
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Hotfix release for the new AWS media stack introduced in `2.0.0`.
10
+
11
+ The initial media implementation included dry-run support, but one path in the
12
+ S3 bucket policy setup still performed real AWS-side read logic before exiting.
13
+ That weakened the guarantee that a dry-run should be non-invasive.
14
+
15
+ `2.0.1` fixes that behavior.
16
+
17
+ ---
18
+
19
+ ## Fixed
20
+
21
+ - `applyCloudFrontReadPolicy(...)` now short-circuits immediately when `dryRun`
22
+ is enabled
23
+ - the dry-run log message is emitted before any bucket policy read/merge logic
24
+ - media dry-runs no longer attempt to inspect or update the current S3 bucket
25
+ policy while simulating CloudFront read access setup
26
+
27
+ ---
28
+
29
+ ## Files changed
30
+
31
+ ### `src/aws/bucket.js`
32
+ The dry-run branch for CloudFront bucket policy application was moved earlier in
33
+ the function.
34
+
35
+ Before this fix:
36
+ - the function still built the S3 client
37
+ - resolved policy data
38
+ - and reached real bucket-policy handling code before returning
39
+
40
+ After this fix:
41
+ - the function detects `dryRun` up front
42
+ - prints the dry-run message
43
+ - returns immediately without entering the AWS policy read/write path
44
+
45
+ ---
46
+
47
+ ## Impact
48
+
49
+ - `media` dry-runs are more trustworthy
50
+ - developers can simulate media stack reconciliation without touching bucket
51
+ policy state
52
+ - the dry-run contract is now more consistent with the rest of the AWS setup flow
53
+
@@ -0,0 +1,55 @@
1
+ # Release 2.0.2 — Dry-run fix for IAM access key setup
2
+
3
+ **Date:** 2026-04-07
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Second hotfix on top of the AWS media stack rollout.
10
+
11
+ After `2.0.1`, one more dry-run inconsistency remained in the IAM credential
12
+ flow: when the target media user did not exist yet, the dry-run path could
13
+ still drift into real access-key listing assumptions.
14
+
15
+ `2.0.2` fixes that edge case so IAM dry-runs behave coherently for both:
16
+ - existing media users
17
+ - brand-new media users
18
+
19
+ ---
20
+
21
+ ## Fixed
22
+
23
+ - dry-run credential rotation now handles the "user does not exist yet" case explicitly
24
+ - the IAM flow now returns deterministic placeholder access key values for a
25
+ brand-new user during dry-run
26
+ - unnecessary dependency on real `ListAccessKeys` behavior was removed from
27
+ that creation path
28
+
29
+ ---
30
+
31
+ ## Files changed
32
+
33
+ ### `src/aws/iam.js`
34
+ `rotateAccessKeysSafely(...)` now accepts the caller's knowledge about whether
35
+ the IAM user already exists.
36
+
37
+ Behavior after the fix:
38
+ - if `dryRun` is enabled and the user does not exist yet:
39
+ - no real key listing is attempted
40
+ - placeholder credentials are returned immediately
41
+ - if `dryRun` is enabled and the user already exists:
42
+ - the existing dry-run-safe rotation logic still applies
43
+
44
+ The higher-level IAM setup flow now passes `userExists` into the rotation
45
+ function so the dry-run branch can make the correct decision.
46
+
47
+ ---
48
+
49
+ ## Impact
50
+
51
+ - `media setup-iam` dry-runs are now stable for first-time project setup
52
+ - full media stack dry-runs produce predictable credential output even before
53
+ the IAM user exists
54
+ - the AWS dry-run story is more internally consistent across S3 and IAM paths
55
+
@@ -0,0 +1,69 @@
1
+ # Release 2.0.3 — Reduced AWS API usage in dry-run mode
2
+
3
+ **Date:** 2026-04-07
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Third hotfix after the AWS media stack rollout.
10
+
11
+ The previous dry-run fixes made the media flow safer, but some preview paths
12
+ were still performing avoidable AWS read operations before switching into
13
+ simulation mode.
14
+
15
+ `2.0.3` tightens that behavior further so dry-runs stay closer to the intended
16
+ "preview only" contract and consume fewer AWS API calls.
17
+
18
+ ---
19
+
20
+ ## Changed
21
+
22
+ - dry-run distribution setup now bypasses strict CloudFront lookup against the
23
+ live account
24
+ - dry-run IAM setup now avoids resolving the real CloudFront distribution when
25
+ no explicit ID is provided
26
+ - a deterministic simulated CloudFront ID is generated for dry-run IAM flows
27
+ that still need a distribution identifier
28
+
29
+ ---
30
+
31
+ ## Files changed
32
+
33
+ ### `src/aws/cloudfront.js`
34
+ `resolveOrCreateDistributionForProject(...)` now checks `dryRun` before trying
35
+ to find an existing tagged distribution.
36
+
37
+ Behavior after the change:
38
+ - if `dryRun` is enabled:
39
+ - the function goes directly through the simulated distribution creation path
40
+ - no strict CloudFront lookup is performed first
41
+ - if `dryRun` is disabled:
42
+ - existing behavior remains unchanged
43
+ - real distribution lookup/reconciliation still happens
44
+
45
+ ### `src/media.js`
46
+ The IAM setup flow now treats dry-run as a first-class branch when no
47
+ CloudFront ID was passed.
48
+
49
+ Behavior after the change:
50
+ - non-dry-run:
51
+ - resolve the real CloudFront distribution by project tag as before
52
+ - dry-run:
53
+ - skip the real lookup
54
+ - synthesize a predictable ID in the form `DRYRUN-{projectName}`
55
+ - continue the credential simulation flow using that placeholder
56
+
57
+ This keeps dry-run output deterministic without requiring extra AWS reads.
58
+
59
+ ---
60
+
61
+ ## Impact
62
+
63
+ - media dry-runs make fewer AWS API calls
64
+ - preview flows are faster and less noisy
65
+ - dry-run behavior is more consistent across:
66
+ - distribution setup
67
+ - bucket policy simulation
68
+ - IAM credential simulation
69
+
@@ -0,0 +1,59 @@
1
+ # Release 2.1.0 — Database hardening and safer remote import
2
+
3
+ **Date:** 2026-04-08
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This release improves reliability and operator safety in the `database` command
10
+ group, especially for remote import workflows.
11
+
12
+ The focus is practical hardening:
13
+ - safer execution flow for remote imports
14
+ - dry-run preview support across database operations
15
+ - clearer failure handling and rollback guidance
16
+
17
+ ---
18
+
19
+ ## Added
20
+
21
+ - `--dry-run` support for:
22
+ - `database remote-export`
23
+ - `database local-import`
24
+ - `database local-export`
25
+ - `database remote-import`
26
+
27
+ Dry-run now prints the commands that would run and avoids mutating local/remote
28
+ database state.
29
+
30
+ ---
31
+
32
+ ## Remote import safety improvements
33
+
34
+ `database remote-import` now includes explicit safety rails:
35
+
36
+ - confirmation prompt before executing the remote import
37
+ - prompt asking whether to create a pre-import backup of the remote database
38
+ - automatic rollback command hint when import fails and backup exists
39
+ - post-import health check (`SELECT 1`) on remote database
40
+ - remote temporary dump cleanup only after successful import flow
41
+
42
+ This reduces the chance of destructive mistakes and gives a clear recovery path
43
+ for less experienced operators.
44
+
45
+ ---
46
+
47
+ ## Files changed
48
+
49
+ - `bin/groups/database.js`
50
+ - `src/database.js`
51
+
52
+ ---
53
+
54
+ ## Impact
55
+
56
+ - safer remote DB operations for day-to-day team usage
57
+ - better preview capability before running critical commands
58
+ - clearer incident handling path on failed remote imports
59
+
@@ -0,0 +1,83 @@
1
+ # Release 2.2.0 — `local doctor` diagnostics command
2
+
3
+ **Date:** 2026-04-08
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Adds `local doctor`, a fast diagnostics command designed to help teammates
10
+ quickly understand why a local Laravel setup is not ready.
11
+
12
+ The command provides a structured report with actionable pass/warn/fail checks
13
+ instead of failing late inside setup commands.
14
+
15
+ ---
16
+
17
+ ## Added
18
+
19
+ - New command:
20
+
21
+ ```bash
22
+ laravel-tools local doctor
23
+ ```
24
+
25
+ - CLI wiring in local command group
26
+ - README usage and behavior documentation
27
+
28
+ ---
29
+
30
+ ## What `local doctor` checks
31
+
32
+ 1. Key project files:
33
+ - `.env.example`
34
+ - `.secret-fetcher`
35
+ - `.env`
36
+ - `docker-compose.yml`
37
+ - `docker/certs/site.test.pem`
38
+ - `docker/certs/site.key`
39
+ - `laravel-tools.yml`
40
+
41
+ 2. Minimal `.env.example` required keys:
42
+ - `APP_NAME`
43
+ - `APP_URL`
44
+ - `ASSETS_URL`
45
+ - `DB_DATABASE` or `DB_NAME`
46
+ - `DB_USERNAME`
47
+ - `DB_PASSWORD`
48
+
49
+ 3. Local prerequisites:
50
+ - `docker compose`
51
+ - `mkcert`
52
+ - `composer`
53
+ - `sudo`
54
+
55
+ 4. Runtime state:
56
+ - Docker daemon reachability
57
+ - `${APP_NAME}-api` container state
58
+ - `${APP_NAME}-mysql` container state
59
+
60
+ ---
61
+
62
+ ## Behavior
63
+
64
+ - Report is printed with `ok`, `warning`, and `fail` statuses
65
+ - Command exits with non-zero status when blocking failures are found
66
+ - Warnings are shown for non-blocking but important setup gaps
67
+
68
+ ---
69
+
70
+ ## Files changed
71
+
72
+ - `src/local/doctor.js` (new)
73
+ - `bin/groups/local.js`
74
+ - `README.md`
75
+
76
+ ---
77
+
78
+ ## Impact
79
+
80
+ - Faster onboarding and troubleshooting for colleagues less familiar with the stack
81
+ - Earlier detection of missing setup prerequisites
82
+ - Fewer failed setup attempts caused by hidden local-state issues
83
+
@@ -0,0 +1,36 @@
1
+ # Release 2.2.1 — Documentazione versioni precedenti
2
+
3
+ **Date:** 2026-04-08
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Release di manutenzione documentazione: aggiunge le release note e le voci
10
+ di Changelog mancanti per le versioni `2.1.0` e `2.2.0`, garantendo
11
+ traceabilità completa della storia del progetto.
12
+
13
+ ---
14
+
15
+ ## Changed
16
+
17
+ - `docs/Changelog.md` aggiornato con le voci `2.1.0` e `2.2.0`
18
+ - `docs/releases/release_2.1.0.md` aggiunto
19
+ - `docs/releases/release_2.2.0.md` aggiunto
20
+ - `README.md` aggiornato per allineamento con lo stato corrente
21
+
22
+ ---
23
+
24
+ ## Files changed
25
+
26
+ - `README.md`
27
+ - `docs/Changelog.md`
28
+ - `docs/releases/release_2.1.0.md` (nuovo)
29
+ - `docs/releases/release_2.2.0.md` (nuovo)
30
+
31
+ ---
32
+
33
+ ## Impact
34
+
35
+ - Nessun impatto funzionale
36
+ - Storia delle release ora completa e consultabile dal `docs/` del repository
@@ -0,0 +1,57 @@
1
+ # Release 2.2.2 — Dynamic team lookup per operazioni DB
2
+
3
+ **Date:** 2026-04-08
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Migliora la selezione del nome utente nelle operazioni di database:
10
+ invece di una lista hardcoded, il tool ora tenta di recuperare i membri
11
+ del team tecnico via API JumpGroup, cadendo in fallback sulla lista locale
12
+ solo se la chiamata non è disponibile.
13
+
14
+ Aggiunge anche la domanda esplicita "vuoi attribuire il dump a un utente?"
15
+ prima di mostrare la selezione, rendendo l'operazione opzionale.
16
+
17
+ ---
18
+
19
+ ## Added
20
+
21
+ - `src/google/utilities.js` (nuovo):
22
+ - `getLocalKeys()` — legge `groupKey`/`groupSecret` da `.secret-fetcher`
23
+ - `getPeopleName()` — recupera i membri di `tech@jumpgroup.it` via API e
24
+ restituisce i firstname come `{ name, value }` per `@inquirer/select`
25
+
26
+ - `src/google/groupMembers.js` (nuovo):
27
+ - `getMembersOfGroupEmail()` — chiama l'API Gmail Group Alias interna
28
+ per ottenere i membri di un gruppo
29
+
30
+ ---
31
+
32
+ ## Changed
33
+
34
+ - `getUserName()` in `src/utilities/utilities.js`:
35
+ - Aggiunge conferma opzionale ("Do you want to add a User name to the DB?")
36
+ prima della selezione; se l'utente risponde no, restituisce `null`
37
+ - Tenta il recupero dinamico dei nomi dal team via `getPeopleName()`;
38
+ in caso di errore stampa un avviso e usa la lista locale come fallback
39
+ - Lista `TEAM_MEMBERS` aggiornata: aggiunti `anto` e `giulia`, rimosso `meg`
40
+
41
+ ---
42
+
43
+ ## Files changed
44
+
45
+ - `src/google/groupMembers.js` (nuovo)
46
+ - `src/google/utilities.js` (nuovo)
47
+ - `src/utilities/utilities.js`
48
+
49
+ ---
50
+
51
+ ## Impact
52
+
53
+ - La lista utenti nei dump DB è sempre aggiornata senza richiedere modifiche
54
+ al codice quando il team cambia
55
+ - Il fallback locale garantisce che l'operazione funzioni anche senza
56
+ connettività all'API interna
57
+ - L'attribuzione del nome è ora esplicitamente opzionale
@@ -0,0 +1,39 @@
1
+ # Release 2.2.3 — Fix crash CloudFront su OAC duplicato
2
+
3
+ **Date:** 2026-04-08
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Corregge un crash in `getOriginAccessControlByName` causato da una
10
+ discrepanza tra la struttura degli oggetti restituiti dall'API CloudFront
11
+ durante il listing degli OAC e quella usata durante la creazione.
12
+
13
+ ---
14
+
15
+ ## Fixed
16
+
17
+ - `getOriginAccessControlByName` in `src/aws/cloudfront.js`:
18
+ - L'accesso a `item.OriginAccessControl?.Name` falliva su oggetti restituiti
19
+ da `ListOriginAccessControls`, che espongono i campi direttamente
20
+ sull'elemento (es. `item.Name`) anziché annidati in `OriginAccessControl`
21
+ - Il risultato veniva ora normalizzato esplicitamente alla shape attesa dal
22
+ resto del codice (`Id`, `Name`, `Description`, `SigningProtocol`,
23
+ `SigningBehavior`, `OriginAccessControlOriginType`), eliminando accessi
24
+ a campi undefined e il conseguente crash
25
+
26
+ ---
27
+
28
+ ## Files changed
29
+
30
+ - `src/aws/cloudfront.js`
31
+
32
+ ---
33
+
34
+ ## Impact
35
+
36
+ - `media setup-general` e `media cloudfront setup` non crashano più
37
+ quando un OAC con lo stesso nome esiste già nell'account AWS
38
+ - Il rilevamento dell'OAC esistente è ora affidabile per la logica
39
+ di idempotenza dei comandi media