@hasna/events 0.1.16 → 0.1.18
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.
- package/README.md +28 -3
- package/dist/app-event.js +13 -13
- package/dist/catalog.js +12 -12
- package/dist/cli/index.js +552 -54
- package/dist/commander.js +490 -25
- package/dist/durable.js +520 -37
- package/dist/filter.js +2 -2
- package/dist/index.js +539 -80
- package/dist/signing.js +5 -5
- package/dist/ssrf.js +222 -0
- package/dist/storage.js +126 -28
- package/dist/transports.js +359 -5
- package/package.json +7 -3
- package/types/app-home.d.ts +42 -0
- package/types/cli-webhook-policy.d.ts +8 -0
- package/types/durable.d.ts +2 -0
- package/types/index.d.ts +1 -0
- package/types/ssrf.d.ts +59 -0
- package/types/storage.d.ts +2 -2
- package/types/transports.d.ts +23 -0
package/README.md
CHANGED
|
@@ -8,8 +8,19 @@ This package is local-first. By default it stores JSON files under `~/.hasna/eve
|
|
|
8
8
|
- `events.json`
|
|
9
9
|
- `deliveries.json`
|
|
10
10
|
|
|
11
|
-
The
|
|
12
|
-
|
|
11
|
+
The data home is resolved through the shared `@hasna/paths` resolver, in this order:
|
|
12
|
+
|
|
13
|
+
1. The CLI `--dir` flag (highest precedence);
|
|
14
|
+
2. the exact-app `HASNA_EVENTS_DIR` override, then the legacy
|
|
15
|
+
`HASNA_EVENTS_HOME` fallback;
|
|
16
|
+
3. the `@hasna/paths`-resolved XDG data home (`HASNA_DATA_HOME`/`~/.local/share/hasna/events`),
|
|
17
|
+
adopted once `HASNA_DATA_HOME` is set or the store has been physically migrated there
|
|
18
|
+
(`events.json` exists at that home);
|
|
19
|
+
4. the legacy `~/.hasna/events` default.
|
|
20
|
+
|
|
21
|
+
Nothing moves on its own: the package keeps reading and writing whichever home is
|
|
22
|
+
effective, and the legacy `~/.hasna/events` stays effective until an operator opts into
|
|
23
|
+
the XDG layout or the store is migrated to it.
|
|
13
24
|
|
|
14
25
|
## Storage Runtime Contract
|
|
15
26
|
|
|
@@ -458,7 +469,10 @@ const events = new EventsClient({
|
|
|
458
469
|
|
|
459
470
|
## CLI
|
|
460
471
|
|
|
461
|
-
The package exposes `events` and `hasna-events`.
|
|
472
|
+
The package exposes `events` and `hasna-events`. `hasna-events` is a
|
|
473
|
+
**deprecated alias** of `events` (same entrypoint, kept for npm parity with
|
|
474
|
+
0.1.15); new usage should call `events` directly, and the alias is scheduled
|
|
475
|
+
for removal in a future major release (hasna/apps#1602).
|
|
462
476
|
|
|
463
477
|
Global options must come before the command group:
|
|
464
478
|
|
|
@@ -480,6 +494,17 @@ events channels match ops
|
|
|
480
494
|
events channels remove ops
|
|
481
495
|
```
|
|
482
496
|
|
|
497
|
+
`channels test` exits with code 1 when delivery fails and code 0 when delivery
|
|
498
|
+
succeeds or is skipped by `--honor-filters`. Its JSON delivery result and human
|
|
499
|
+
status output are preserved in either case.
|
|
500
|
+
|
|
501
|
+
The standalone CLI and default embedded Commander commands deny private webhook
|
|
502
|
+
targets unless the administrator sets `HASNA_EVENTS_ALLOW_PRIVATE_WEBHOOK_TARGETS`
|
|
503
|
+
to a comma-separated list of exact hostnames or IP addresses. For an intentional
|
|
504
|
+
local receiver, set `HASNA_EVENTS_ALLOW_PRIVATE_WEBHOOK_TARGETS=127.0.0.1`.
|
|
505
|
+
This setting does not change SDK defaults or override an embedded host's custom
|
|
506
|
+
`createClient` policy. Redirects and DNS results still undergo target validation.
|
|
507
|
+
|
|
483
508
|
Field filters can match nested `data` or `metadata` values. Plain
|
|
484
509
|
`--data`/`--metadata` values are strings, which keeps ids and slugs such as
|
|
485
510
|
`001` intact. Use `--data-json` or `--metadata-json` for typed JSON predicates.
|
package/dist/app-event.js
CHANGED
|
@@ -365,18 +365,18 @@ function requireTimestamp(value, key, issues) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
export {
|
|
368
|
-
|
|
369
|
-
APP_EVENT_V1_MAX_REFS,
|
|
370
|
-
APP_EVENT_V1_MAX_SUMMARY_LENGTH,
|
|
371
|
-
APP_EVENT_V1_MAX_TARGETS,
|
|
372
|
-
APP_EVENT_V1_METADATA_KEY,
|
|
373
|
-
APP_EVENT_V1_SCHEMA_VERSION,
|
|
374
|
-
AppEventReplaySafetyError,
|
|
375
|
-
AppEventValidationError,
|
|
376
|
-
appEventV1FromEventEnvelope,
|
|
377
|
-
appEventV1ReplayIdentity,
|
|
378
|
-
appEventV1ToEventInput,
|
|
379
|
-
assertAppEventV1,
|
|
368
|
+
validateAppEventV1,
|
|
380
369
|
assertAppEventV1ReplaySafe,
|
|
381
|
-
|
|
370
|
+
assertAppEventV1,
|
|
371
|
+
appEventV1ToEventInput,
|
|
372
|
+
appEventV1ReplayIdentity,
|
|
373
|
+
appEventV1FromEventEnvelope,
|
|
374
|
+
AppEventValidationError,
|
|
375
|
+
AppEventReplaySafetyError,
|
|
376
|
+
APP_EVENT_V1_SCHEMA_VERSION,
|
|
377
|
+
APP_EVENT_V1_METADATA_KEY,
|
|
378
|
+
APP_EVENT_V1_MAX_TARGETS,
|
|
379
|
+
APP_EVENT_V1_MAX_SUMMARY_LENGTH,
|
|
380
|
+
APP_EVENT_V1_MAX_REFS,
|
|
381
|
+
APP_EVENT_V1_MAX_DATA_BYTES
|
|
382
382
|
};
|
package/dist/catalog.js
CHANGED
|
@@ -175,17 +175,17 @@ function registerDistributionEventTypes(catalog = defaultEventTypeCatalog) {
|
|
|
175
175
|
return catalog;
|
|
176
176
|
}
|
|
177
177
|
export {
|
|
178
|
-
|
|
179
|
-
DISTRIBUTION_EVENT_TYPES,
|
|
180
|
-
EventTypeCatalog,
|
|
181
|
-
EventValidationError,
|
|
182
|
-
createDistributionEventDefinitions,
|
|
183
|
-
defaultEventTypeCatalog,
|
|
184
|
-
registerDistributionEventTypes,
|
|
185
|
-
validateAnnouncementSentData,
|
|
186
|
-
validateAppInstalledData,
|
|
187
|
-
validateFeedbackCreatedData,
|
|
188
|
-
validateFeedbackTriagedData,
|
|
178
|
+
validateRolloutData,
|
|
189
179
|
validateReleasePublishedData,
|
|
190
|
-
|
|
180
|
+
validateFeedbackTriagedData,
|
|
181
|
+
validateFeedbackCreatedData,
|
|
182
|
+
validateAppInstalledData,
|
|
183
|
+
validateAnnouncementSentData,
|
|
184
|
+
registerDistributionEventTypes,
|
|
185
|
+
defaultEventTypeCatalog,
|
|
186
|
+
createDistributionEventDefinitions,
|
|
187
|
+
EventValidationError,
|
|
188
|
+
EventTypeCatalog,
|
|
189
|
+
DISTRIBUTION_EVENT_TYPES,
|
|
190
|
+
DISTRIBUTION_EVENT_CONTRACT_SCHEMAS
|
|
191
191
|
};
|