aegis-platform-sdk 0.1.0 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0 — 2026-07-08
4
+
5
+ F5 — Hardening. No breaking API changes; new default behaviors noted below.
6
+
7
+ - **Retry/backoff** (new default behavior): transient failures (network
8
+ errors, timeouts, 429/502/503/504) are retried with exponential backoff +
9
+ full jitter — GET/HEAD only, 2 retries. Configure via `retry` option
10
+ (`{retries, baseDelayMs, maxDelayMs, retryPost}`); `{retries: 0}` disables.
11
+ - **Automatic JWT refresh**: `auth.login` now captures the refresh token; on
12
+ a 401 the client rotates it via `POST /auth/refresh` (single-flight) and
13
+ retries the request once. A rejected refresh clears the token (no loops).
14
+ Seed manually via `refreshToken` option / `setRefreshToken()`; explicit
15
+ `auth.refresh(token)` added.
16
+ - **Per-method generics**: 510 resource methods now accept a type parameter —
17
+ `client.geo.nodes<GeoNodesOut>()` instead of `as unknown as` casts
18
+ (`T = Json` default keeps all existing code compiling).
19
+ - All resource classes and their option types are exported from the package
20
+ root (typed params in consumer code + full typedoc coverage).
21
+ - `npm run docs` (typedoc) + `examples/` (OSDK-token server usage, browser
22
+ proxy mode with SSE).
23
+ - 12 new tests (177 total).
24
+
25
+ ## 0.4.0 — 2026-07-08
26
+
27
+ F3 (OSDK codegen CLI) + F4 groundwork (proxy-mode, dogfooded in security-app).
28
+
29
+ - **`aegis-osdk` CLI** (`npx aegis-osdk generate|manifest`): fetches
30
+ `GET /ontology/osdk/generate?lang=typescript|python` from a live deployment
31
+ and writes the typed module; prints the contract version. Proven live against
32
+ a real AEGIS backend (generated module passes strict `tsc`).
33
+ - **`asOsdkClient(client)`** adapter — bridges `AegisClient` to the `OSDKClient`
34
+ `{get, post}` contract expected by generated modules.
35
+ - **Proxy mode** (cookie-auth frontends like security-app): relative `baseUrl`
36
+ (e.g. `/api`, resolved against the browser origin) + `fetchInit` option
37
+ (`{credentials: "include", cache: "no-store"}` merged into every request,
38
+ including `stream()`).
39
+ - `geo.referenceLayers()` / `geo.referenceLayer(id, {uf, municipio})` — gap
40
+ found while dogfooding (endpoints existed in the backend but in neither SDK).
41
+ - 12 new tests (165 total).
42
+
43
+ ## 0.3.0 — 2026-07-08
44
+
45
+ F1.5 (full parity closure) + F2 (SSE streaming). **Every Python SDK module now has a TS mirror.**
46
+
47
+ - **Domain**: `atlas` (layers + KML import + evaluator), `briefing`, `cctv` (streams/detections/recordings/exports/bookmarks/GCPs/LPR hotlist, raw m3u8 playlist), `edge` (pairing/fleet version), `video` (streams/detections/tags/soak/exports), `comunicados`, `campaign.briefing`.
48
+ - **Collaboration/apps**: `forms`, `appShell` (banner/footer/user-menu/sidenav/homepage), `groups` (alias of `iam.groups`), `projects` (move + constraints), `organizations`, `spaces`, `solutions` (design/materialize/diagrams/teardown/marketplace), `workspaces` (+versions/navigation/promotions/kiosk), `workspaceUpdates`, `marketplace` (v23 storefront + install wizard).
49
+ - **Versioned surfaces**: `platformV22` (action-log, notepad templates, quiver, variable transforms, usage), `platformV23` (aip-logic, action-types, assist, pipeline, quiver, connectors, automate, health, contour, vertex, repos, object-sets, carbon, styles incl. multipart logo upload), `platformV24` (flat: rules, checkpoints, expectations, change requests, scenarios, object-set search-around/aggregate, …), `platformV25` (machinery, branch protection, kiosk, analyst threads, dataset rollback/snapshot/limits, freshness, code scan, evals), `platformV26` (promotions, object/core views, capacity, listeners, scanner, monitoring, health checks, media versions, insight, peers, run history).
50
+ - **Static catalogs**: full IAM permission catalog (`NAV_PERMISSIONS`/`CAPABILITY_PERMISSIONS`/`PermissionKey` union, `isSystemPermission`) and the OSDK `APPLICATIONS` catalog (7 apps) with `validateApplication`.
51
+ - **F2 — SSE**: `client.stream(path)` async iterator + spec-compliant `parseSseStream` (chunk-boundary safe, CRLF, comments, sticky id/retry); errors map through the exception hierarchy.
52
+ - Transport: multipart `form` option; array query params (repeated keys).
53
+ - 60 new tests (153 total).
54
+
55
+ ## 0.2.0 — 2026-07-08
56
+
57
+ F1 — resource parity, 27 new client surfaces (mirror of Python SDK v0.10.0):
58
+
59
+ - **Reading**: `geo`, `mapTemplates` (incl. `exportSvg` raw-SVG), `media`, `docs`, `pages`, `dossier` (async start → poll), `timeseries`.
60
+ - **Operational**: `alerts` (feeds/watches/geofences/shares/routes/inbox + escalate/channels), `alarms`, `events` (pipeline + DLQ, ids-XOR-all guard), `connectors` (incl. two-step `register`), `pipelines`, `chat`, `notepad`.
61
+ - **Governance**: `lineage`, `accessAudit`, `markings` (+categories/eligibility), `resourceMarkings`, `propertyMarkings`, `rowPolicies`, `erasure` (preview/forget), `retention`, `guestTokens`.
62
+ - **Platform**: `workshop` (briefings/dossiers/covs/widgetCatalog), `compute` (providers/releases/vision + per-provider `control()` plane), `inference` (complete/chat/chatWithRag/models/collections/auditTrail), `codegen`, `correlation`, `situational`, `merge`.
63
+ - Client-side classification helpers: `maxLevel`, `validateInvariant`, `ClassificationInvariantViolation` (mirror of `aegis.classification`).
64
+ - 64 new tests (93 total).
65
+
66
+ Deliberate deviations from Python (documented in `docs/PLAN.md`): the stdout-based
67
+ `aegis.maps` builder is sandbox-IDE-only and was not ported (only `MapTemplates` HTTP
68
+ surface); `inference` is a client resource here instead of a functional namespace.
69
+
3
70
  ## 0.1.0 — 2026-07-08
4
71
 
5
72
  First cut of the TypeScript SDK, mirroring `aegis-platform-sdk` (Python) v0.10.0.
package/README.md CHANGED
@@ -70,6 +70,15 @@ try {
70
70
  | `client.functions` | Code Functions: CRUD, `invoke`, tests, publish, versions, pull requests + CI |
71
71
  | `client.codeRepositories` | repos, branches, CI, merge |
72
72
  | `client.datasets` | datasets, branches, transactions (begin/commit/abort), merges, classification, markings |
73
+ | `client.geo` / `mapTemplates` / `media` / `docs` / `pages` / `dossier` / `timeseries` | reading & consumption surfaces |
74
+ | `client.alerts` / `alarms` / `events` / `connectors` / `pipelines` / `chat` / `notepad` | operational surfaces |
75
+ | `client.lineage` / `accessAudit` / `markings` / `resourceMarkings` / `propertyMarkings` / `rowPolicies` / `erasure` / `retention` / `guestTokens` | governance surfaces |
76
+ | `client.workshop` / `compute` / `inference` / `codegen` / `correlation` / `situational` / `merge` | platform surfaces |
77
+ | `client.atlas` / `briefing` / `cctv` / `edge` / `video` / `comunicados` / `campaign` | domain surfaces |
78
+ | `client.forms` / `appShell` / `groups` / `projects` / `organizations` / `spaces` / `solutions` / `workspaces` / `workspaceUpdates` / `marketplace` | collaboration & apps |
79
+ | `client.platformV22` … `client.platformV26` | versioned platform surfaces |
80
+ | `client.stream(path)` | SSE async iterator (task progress, AIP streaming) |
81
+ | `NAV_PERMISSIONS` / `CAPABILITY_PERMISSIONS` / `APPLICATIONS` | static permission + OSDK app catalogs |
73
82
 
74
83
  Anything not wrapped yet is reachable via the escape hatch:
75
84
 
@@ -79,6 +88,35 @@ const rows = await client.request("GET", "/entities/aggregate", {
79
88
  });
80
89
  ```
81
90
 
91
+ ## Hardening (1.0)
92
+
93
+ - **Typed results**: `client.geo.nodes<GeoNodesOut>()` — every direct method
94
+ takes a type parameter (default `Json`).
95
+ - **Retry/backoff**: transient failures (network, timeout, 429/5xx-gateway)
96
+ retried on GET/HEAD with jittered exponential backoff — tune via
97
+ `retry: { retries, baseDelayMs, maxDelayMs, retryPost }`.
98
+ - **Auto JWT refresh**: after `auth.login`, a 401 rotates the refresh token
99
+ and retries once, transparently.
100
+
101
+ ## OSDK codegen CLI
102
+
103
+ ```bash
104
+ npx aegis-osdk generate --lang typescript # typed module from the LIVE ontology
105
+ npx aegis-osdk manifest # raw manifest JSON
106
+ ```
107
+
108
+ Auth via `AEGIS_API_URL`/`AEGIS_TOKEN` or `--base-url`/`--token`. Wire the
109
+ generated module with `asOsdkClient(client)`.
110
+
111
+ ## Proxy mode (cookie-auth frontends)
112
+
113
+ ```ts
114
+ const aegis = new AegisClient({
115
+ baseUrl: "/api", // relative — resolved against the browser origin
116
+ fetchInit: { credentials: "include", cache: "no-store" },
117
+ });
118
+ ```
119
+
82
120
  ## Claude Code skill
83
121
 
84
122
  The npm package ships a Claude Code skill under `skills/aegis-sdk/`. In an