@amigo-ai/platform-sdk 0.6.1 → 0.7.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/api.md CHANGED
@@ -52,6 +52,8 @@ Notes:
52
52
  - Pagination and response helpers: `paginate`, `buildLastResponse`, `extractRequestId`
53
53
  - Response and hook types: `PaginatedList`, `ListParams`, `LastResponseInfo`, `ResponseMetadata`, `WithResponseMetadata`, `AmigoResponse`, `RetryOptions`, `RateLimitInfo`, `ClientHooks`, `RequestHookContext`, `ResponseHookContext`, `ErrorHookContext`
54
54
  - Generated OpenAPI types: `paths`, `components`, `operations`
55
+ - Generated API types are produced with `npm run gen-types` from the committed `openapi.json` snapshot.
56
+ - The generated OpenAPI types may include spec-only endpoints that do not yet have resource wrappers; use the low-level `GET`/`POST`/`PUT`/`PATCH`/`DELETE` helpers for those operations until a dedicated resource is added. Current spec-only groups include `/use-cases` and `/voicemail`.
55
57
 
56
58
  ## Resources
57
59
 
@@ -271,6 +273,13 @@ All workspace-scoped resources also expose `withOptions(options)`.
271
273
  - `recommend`
272
274
  - `getIntelligence`
273
275
 
276
+ ### `metrics`
277
+
278
+ - `listLatest`
279
+ - `getCatalog`
280
+ - `getValues`
281
+ - `getTrend`
282
+
274
283
  ### `settings`
275
284
 
276
285
  - `voice.get`
package/dist/index.cjs CHANGED
@@ -2212,6 +2212,48 @@ var SimulationsResource = class extends WorkspaceScopedResource {
2212
2212
  }
2213
2213
  };
2214
2214
 
2215
+ // src/resources/metrics.ts
2216
+ var MetricsResource = class extends WorkspaceScopedResource {
2217
+ /** List the latest value for each metric in the workspace */
2218
+ async listLatest() {
2219
+ return extractData(
2220
+ await this.client.GET("/v1/{workspace_id}/metrics", {
2221
+ params: { path: { workspace_id: this.workspaceId } }
2222
+ })
2223
+ );
2224
+ }
2225
+ /** List available built-in and custom metric definitions */
2226
+ async getCatalog() {
2227
+ return extractData(
2228
+ await this.client.GET("/v1/{workspace_id}/metrics/catalog", {
2229
+ params: { path: { workspace_id: this.workspaceId } }
2230
+ })
2231
+ );
2232
+ }
2233
+ /** Get stored values for one metric key, optionally bounded by time range */
2234
+ async getValues(metricKey, params) {
2235
+ return extractData(
2236
+ await this.client.GET("/v1/{workspace_id}/metrics/{metric_key}", {
2237
+ params: {
2238
+ path: { workspace_id: this.workspaceId, metric_key: metricKey },
2239
+ query: params
2240
+ }
2241
+ })
2242
+ );
2243
+ }
2244
+ /** Get a recent time-series trend for one metric key */
2245
+ async getTrend(metricKey, params) {
2246
+ return extractData(
2247
+ await this.client.GET("/v1/{workspace_id}/metrics/{metric_key}/trend", {
2248
+ params: {
2249
+ path: { workspace_id: this.workspaceId, metric_key: metricKey },
2250
+ query: params
2251
+ }
2252
+ })
2253
+ );
2254
+ }
2255
+ };
2256
+
2215
2257
  // src/resources/settings.ts
2216
2258
  var SettingsResource = class extends WorkspaceScopedResource {
2217
2259
  voice = {
@@ -3115,6 +3157,7 @@ var AmigoClient = class _AmigoClient {
3115
3157
  integrations;
3116
3158
  analytics;
3117
3159
  simulations;
3160
+ metrics;
3118
3161
  settings;
3119
3162
  billing;
3120
3163
  memory;
@@ -3206,6 +3249,7 @@ var AmigoClient = class _AmigoClient {
3206
3249
  mutable.integrations = new IntegrationsResource(client, workspaceId2);
3207
3250
  mutable.analytics = new AnalyticsResource(client, workspaceId2);
3208
3251
  mutable.simulations = new SimulationsResource(client, workspaceId2);
3252
+ mutable.metrics = new MetricsResource(client, workspaceId2);
3209
3253
  mutable.settings = new SettingsResource(client, workspaceId2);
3210
3254
  mutable.billing = new BillingResource(client, workspaceId2);
3211
3255
  mutable.memory = new MemoryResource(client, workspaceId2);