@cdot65/prisma-airs-sdk 0.19.0 → 0.20.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.
- package/README.md +16 -3
- package/dist/index.cjs +1167 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3524 -381
- package/dist/index.d.ts +3524 -381
- package/dist/index.js +1085 -194
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="docs-site/static/img/logo
|
|
2
|
+
<img src="https://raw.githubusercontent.com/cdot65/prisma-airs-sdk/main/docs-site/static/img/logo.svg" alt="Prisma AIRS SDK shield with terminal and spectrum" width="320" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# prisma-airs-sdk
|
|
@@ -82,6 +82,12 @@ and returns the highest revision. `getByName()` returns the highest revision for
|
|
|
82
82
|
|
|
83
83
|
`AIGatewayClient` covers the SCM-managed Prisma AIRS **AI Gateway** — runtime telemetry and configuration across two planes behind one credential set: a data plane (`/ai_gw/v2`, telemetry + workspace-scoped config) and an admin plane (`/ai_gw/admin/v2`, organisation-level config). Twelve sub-clients: `telemetry`, `workspaces`, `configs`, `guardrails`, `providers`, `apiKeys` (data plane) and `integrations`, `mcpIntegrations`, `deployments`, `plugins`, `organisations`, `auditLogs` (admin plane).
|
|
84
84
|
|
|
85
|
+
All AI Gateway write bodies have exported Zod schemas and inferred TypeScript types. Validation
|
|
86
|
+
happens before OAuth and network access; partial updates reject empty bodies. The package also
|
|
87
|
+
exports typed routing/provider configuration, deterministic known-value catalogs,
|
|
88
|
+
`buildDottedObject()` / `setDottedValue()` for CLI-style nested settings, and operation-scoped
|
|
89
|
+
secret metadata used by SDK debug redaction.
|
|
90
|
+
|
|
85
91
|
### SCM role grants
|
|
86
92
|
|
|
87
93
|
The two planes authorize against **different SCM role scopes** — a service account needs both, or half the API returns 403:
|
|
@@ -113,12 +119,19 @@ export PANW_AI_GW_TSG_ID=1234567890
|
|
|
113
119
|
`PANW_AI_GW_*` vars fall back to `PANW_MGMT_*` when unset, so existing management credentials work as-is.
|
|
114
120
|
|
|
115
121
|
```ts
|
|
116
|
-
import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
|
|
122
|
+
import { AIGatewayClient, buildDottedObject } from '@cdot65/prisma-airs-sdk';
|
|
117
123
|
|
|
118
124
|
const gw = new AIGatewayClient();
|
|
125
|
+
const workspace = (await gw.workspaces.list()).data[0];
|
|
119
126
|
|
|
120
|
-
const cost = await gw.telemetry.cost({ workspaceSlug:
|
|
127
|
+
const cost = await gw.telemetry.cost({ workspaceSlug: workspace.slug, days: 7 });
|
|
121
128
|
console.log(`$${(cost.data.total / 100).toFixed(2)}`); // cost is returned in cents
|
|
129
|
+
|
|
130
|
+
const routing = buildDottedObject([
|
|
131
|
+
{ path: 'retry.attempts', value: 3 },
|
|
132
|
+
{ path: 'strategy.mode', value: 'fallback' },
|
|
133
|
+
]);
|
|
134
|
+
await gw.configs.create({ name: 'vertex-routing', workspace_id: workspace.id, config: routing });
|
|
122
135
|
```
|
|
123
136
|
|
|
124
137
|
## Documentation
|