@amigo-ai/platform-sdk 0.1.0 → 0.2.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.
Files changed (149) hide show
  1. package/README.md +114 -2
  2. package/dist/core/branded-types.js +1 -0
  3. package/dist/core/branded-types.js.map +1 -1
  4. package/dist/core/errors.js +43 -3
  5. package/dist/core/errors.js.map +1 -1
  6. package/dist/core/openapi-client.js +60 -48
  7. package/dist/core/openapi-client.js.map +1 -1
  8. package/dist/core/rate-limit.js +13 -0
  9. package/dist/core/rate-limit.js.map +1 -0
  10. package/dist/core/webhooks.js +17 -0
  11. package/dist/core/webhooks.js.map +1 -0
  12. package/dist/generated/api.js +2 -0
  13. package/dist/{types → generated}/api.js.map +1 -1
  14. package/dist/index.cjs +1668 -371
  15. package/dist/index.cjs.map +4 -4
  16. package/dist/index.js +59 -43
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +1658 -371
  19. package/dist/index.mjs.map +4 -4
  20. package/dist/resources/actions.js +52 -0
  21. package/dist/resources/actions.js.map +1 -0
  22. package/dist/resources/agents.js +30 -30
  23. package/dist/resources/agents.js.map +1 -1
  24. package/dist/resources/analytics.js +34 -15
  25. package/dist/resources/analytics.js.map +1 -1
  26. package/dist/resources/api-keys.js +17 -19
  27. package/dist/resources/api-keys.js.map +1 -1
  28. package/dist/resources/audit.js +35 -0
  29. package/dist/resources/audit.js.map +1 -0
  30. package/dist/resources/base.js +12 -44
  31. package/dist/resources/base.js.map +1 -1
  32. package/dist/resources/billing.js +35 -7
  33. package/dist/resources/billing.js.map +1 -1
  34. package/dist/resources/calls.js +25 -9
  35. package/dist/resources/calls.js.map +1 -1
  36. package/dist/resources/compliance.js +19 -0
  37. package/dist/resources/compliance.js.map +1 -0
  38. package/dist/resources/context-graphs.js +46 -18
  39. package/dist/resources/context-graphs.js.map +1 -1
  40. package/dist/resources/data-sources.js +30 -12
  41. package/dist/resources/data-sources.js.map +1 -1
  42. package/dist/resources/functions.js +42 -0
  43. package/dist/resources/functions.js.map +1 -0
  44. package/dist/resources/integrations.js +32 -15
  45. package/dist/resources/integrations.js.map +1 -1
  46. package/dist/resources/memory.js +13 -4
  47. package/dist/resources/memory.js.map +1 -1
  48. package/dist/resources/operators.js +102 -0
  49. package/dist/resources/operators.js.map +1 -0
  50. package/dist/resources/personas.js +31 -0
  51. package/dist/resources/personas.js.map +1 -0
  52. package/dist/resources/phone-numbers.js +31 -16
  53. package/dist/resources/phone-numbers.js.map +1 -1
  54. package/dist/resources/recordings.js +19 -0
  55. package/dist/resources/recordings.js.map +1 -0
  56. package/dist/resources/review-queue.js +94 -0
  57. package/dist/resources/review-queue.js.map +1 -0
  58. package/dist/resources/safety.js +31 -0
  59. package/dist/resources/safety.js.map +1 -0
  60. package/dist/resources/services.js +18 -12
  61. package/dist/resources/services.js.map +1 -1
  62. package/dist/resources/settings.js +50 -24
  63. package/dist/resources/settings.js.map +1 -1
  64. package/dist/resources/simulations.js +23 -17
  65. package/dist/resources/simulations.js.map +1 -1
  66. package/dist/resources/skills.js +22 -16
  67. package/dist/resources/skills.js.map +1 -1
  68. package/dist/resources/triggers.js +51 -0
  69. package/dist/resources/triggers.js.map +1 -0
  70. package/dist/resources/webhook-destinations.js +44 -0
  71. package/dist/resources/webhook-destinations.js.map +1 -0
  72. package/dist/resources/workspaces.js +24 -38
  73. package/dist/resources/workspaces.js.map +1 -1
  74. package/dist/resources/world.js +58 -60
  75. package/dist/resources/world.js.map +1 -1
  76. package/dist/types/core/branded-types.d.ts +3 -0
  77. package/dist/types/core/branded-types.d.ts.map +1 -1
  78. package/dist/types/core/errors.d.ts +3 -0
  79. package/dist/types/core/errors.d.ts.map +1 -1
  80. package/dist/types/core/openapi-client.d.ts +13 -5
  81. package/dist/types/core/openapi-client.d.ts.map +1 -1
  82. package/dist/types/core/rate-limit.d.ts +8 -0
  83. package/dist/types/core/rate-limit.d.ts.map +1 -0
  84. package/dist/types/core/webhooks.d.ts +9 -0
  85. package/dist/types/core/webhooks.d.ts.map +1 -0
  86. package/dist/types/generated/api.d.ts +35120 -0
  87. package/dist/types/generated/api.d.ts.map +1 -0
  88. package/dist/types/index.d.ts +45 -43
  89. package/dist/types/index.d.ts.map +1 -1
  90. package/dist/types/resources/actions.d.ts +158 -0
  91. package/dist/types/resources/actions.d.ts.map +1 -0
  92. package/dist/types/resources/agents.d.ts +70 -22
  93. package/dist/types/resources/agents.d.ts.map +1 -1
  94. package/dist/types/resources/analytics.d.ts +100 -118
  95. package/dist/types/resources/analytics.d.ts.map +1 -1
  96. package/dist/types/resources/api-keys.d.ts +36 -7
  97. package/dist/types/resources/api-keys.d.ts.map +1 -1
  98. package/dist/types/resources/audit.d.ts +70 -0
  99. package/dist/types/resources/audit.d.ts.map +1 -0
  100. package/dist/types/resources/base.d.ts +13 -13
  101. package/dist/types/resources/base.d.ts.map +1 -1
  102. package/dist/types/resources/billing.d.ts +52 -12
  103. package/dist/types/resources/billing.d.ts.map +1 -1
  104. package/dist/types/resources/calls.d.ts +89 -35
  105. package/dist/types/resources/calls.d.ts.map +1 -1
  106. package/dist/types/resources/compliance.d.ts +45 -0
  107. package/dist/types/resources/compliance.d.ts.map +1 -0
  108. package/dist/types/resources/context-graphs.d.ts +77 -14
  109. package/dist/types/resources/context-graphs.d.ts.map +1 -1
  110. package/dist/types/resources/data-sources.d.ts +105 -9
  111. package/dist/types/resources/data-sources.d.ts.map +1 -1
  112. package/dist/types/resources/functions.d.ts +46 -0
  113. package/dist/types/resources/functions.d.ts.map +1 -0
  114. package/dist/types/resources/integrations.d.ts +83 -12
  115. package/dist/types/resources/integrations.d.ts.map +1 -1
  116. package/dist/types/resources/memory.d.ts +26 -73
  117. package/dist/types/resources/memory.d.ts.map +1 -1
  118. package/dist/types/resources/operators.d.ts +157 -0
  119. package/dist/types/resources/operators.d.ts.map +1 -0
  120. package/dist/types/resources/personas.d.ts +60 -0
  121. package/dist/types/resources/personas.d.ts.map +1 -0
  122. package/dist/types/resources/phone-numbers.d.ts +70 -10
  123. package/dist/types/resources/phone-numbers.d.ts.map +1 -1
  124. package/dist/types/resources/recordings.d.ts +29 -0
  125. package/dist/types/resources/recordings.d.ts.map +1 -0
  126. package/dist/types/resources/review-queue.d.ts +184 -0
  127. package/dist/types/resources/review-queue.d.ts.map +1 -0
  128. package/dist/types/resources/safety.d.ts +57 -0
  129. package/dist/types/resources/safety.d.ts.map +1 -0
  130. package/dist/types/resources/services.d.ts +85 -5
  131. package/dist/types/resources/services.d.ts.map +1 -1
  132. package/dist/types/resources/settings.d.ts +79 -78
  133. package/dist/types/resources/settings.d.ts.map +1 -1
  134. package/dist/types/resources/simulations.d.ts +41 -12
  135. package/dist/types/resources/simulations.d.ts.map +1 -1
  136. package/dist/types/resources/skills.d.ts +131 -6
  137. package/dist/types/resources/skills.d.ts.map +1 -1
  138. package/dist/types/resources/triggers.d.ts +129 -0
  139. package/dist/types/resources/triggers.d.ts.map +1 -0
  140. package/dist/types/resources/webhook-destinations.d.ts +75 -0
  141. package/dist/types/resources/webhook-destinations.d.ts.map +1 -0
  142. package/dist/types/resources/workspaces.d.ts +60 -15
  143. package/dist/types/resources/workspaces.d.ts.map +1 -1
  144. package/dist/types/resources/world.d.ts +152 -143
  145. package/dist/types/resources/world.d.ts.map +1 -1
  146. package/package.json +6 -3
  147. package/dist/types/api.js +0 -12
  148. package/dist/types/types/api.d.ts +0 -739
  149. package/dist/types/types/api.d.ts.map +0 -1
@@ -1,111 +1,4 @@
1
1
  import { WorkspaceScopedResource } from './base.js';
2
- /** A metric value paired with its period-over-period change */
3
- export interface MetricWithDelta {
4
- value: number | null;
5
- delta_pct: number | null;
6
- }
7
- export interface AnalyticsQueryParams {
8
- /** Shorthand period, e.g. "7d", "30d" */
9
- period?: string;
10
- start_date?: string;
11
- end_date?: string;
12
- agent_id?: string;
13
- }
14
- export interface AnalyticsDashboard {
15
- call_volume: MetricWithDelta;
16
- avg_quality: MetricWithDelta;
17
- avg_ttfb_ms: MetricWithDelta;
18
- escalation_rate: MetricWithDelta;
19
- tool_success_rate: MetricWithDelta;
20
- avg_duration_s: MetricWithDelta;
21
- period_days: number;
22
- }
23
- export interface CallAnalytics {
24
- workspace_id: string;
25
- period_start: string;
26
- period_end: string;
27
- total_calls: number;
28
- total_duration_seconds: number;
29
- avg_duration_seconds: number;
30
- calls_by_date: Array<{
31
- date: string;
32
- count: number;
33
- }>;
34
- }
35
- export interface AgentAnalytics {
36
- agent_id: string;
37
- agent_name: string;
38
- total_calls: number;
39
- completed_calls: number;
40
- avg_duration_seconds: number;
41
- completion_rate: number;
42
- }
43
- export interface AgentAnalyticsResponse {
44
- agents: AgentAnalytics[];
45
- period: string;
46
- }
47
- export interface CallQualityMetrics {
48
- avg_sentiment: number | null;
49
- positive_pct: number;
50
- negative_pct: number;
51
- neutral_pct: number;
52
- avg_transcription_confidence: number | null;
53
- flagged_calls: number;
54
- }
55
- export interface EmotionTrends {
56
- data: Array<{
57
- date: string;
58
- emotions: Record<string, number>;
59
- }>;
60
- }
61
- export interface LatencyMetrics {
62
- avg_ttfb_ms: number;
63
- p50_ttfb_ms: number;
64
- p95_ttfb_ms: number;
65
- avg_response_ms: number;
66
- p95_response_ms: number;
67
- }
68
- export interface ToolPerformance {
69
- tool_name: string;
70
- call_count: number;
71
- success_rate: number;
72
- avg_latency_ms: number;
73
- }
74
- export interface DataQualityMetrics {
75
- completeness_score: number;
76
- duplicate_rate: number;
77
- missing_canonical_id_pct: number;
78
- stale_entities: number;
79
- }
80
- export interface AdvancedCallStats {
81
- abandonment_rate: number;
82
- transfer_rate: number;
83
- avg_silence_pct: number;
84
- avg_interruptions: number;
85
- by_hour_of_day: Array<{
86
- hour: number;
87
- count: number;
88
- }>;
89
- by_day_of_week: Array<{
90
- day: string;
91
- count: number;
92
- }>;
93
- }
94
- export interface CallComparison {
95
- period_a: {
96
- start: string;
97
- end: string;
98
- calls: number;
99
- conversion_rate: number;
100
- };
101
- period_b: {
102
- start: string;
103
- end: string;
104
- calls: number;
105
- conversion_rate: number;
106
- };
107
- change_pct: Record<string, number>;
108
- }
109
2
  /**
110
3
  * Analytics — aggregate metrics about calls, agents, quality, and usage.
111
4
  */
@@ -113,27 +6,114 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
113
6
  /** High-level dashboard summary — pass `days` (default: 7) for the lookback window */
114
7
  getDashboard(params?: {
115
8
  days?: number;
116
- }): Promise<AnalyticsDashboard>;
9
+ }): Promise<{
10
+ [key: string]: unknown;
11
+ }>;
117
12
  /** Call volume and duration metrics */
118
- getCalls(params?: AnalyticsQueryParams): Promise<CallAnalytics>;
13
+ getCalls(params?: {
14
+ days?: number;
15
+ date_from?: string | null;
16
+ date_to?: string | null;
17
+ interval?: '1h' | '1d' | '1w';
18
+ service_id?: string | null;
19
+ }): Promise<{
20
+ workspace_id: string;
21
+ period_start: string;
22
+ period_end: string;
23
+ total_calls: number;
24
+ total_duration_seconds: number;
25
+ avg_duration_seconds: number;
26
+ calls_by_date: {
27
+ [key: string]: unknown;
28
+ }[];
29
+ }>;
119
30
  /** Per-agent performance breakdown */
120
31
  getAgents(params?: {
121
32
  period?: string;
122
- }): Promise<AgentAnalyticsResponse>;
33
+ }): Promise<{
34
+ agents: import("../index.js").components["schemas"]["AgentAnalyticsEntry"][];
35
+ period?: string | null;
36
+ }>;
123
37
  /** Call quality — sentiment, transcription confidence, flagged calls */
124
- getCallQuality(params?: AnalyticsQueryParams): Promise<CallQualityMetrics>;
38
+ getCallQuality(params?: {
39
+ days?: number;
40
+ date_from?: string | null;
41
+ date_to?: string | null;
42
+ interval?: '1h' | '1d' | '1w';
43
+ service_id?: string | null;
44
+ }): Promise<{
45
+ [key: string]: unknown;
46
+ }>;
125
47
  /** Emotion trend data over time */
126
- getEmotionTrends(params?: AnalyticsQueryParams): Promise<EmotionTrends>;
48
+ getEmotionTrends(params?: {
49
+ days?: number;
50
+ date_from?: string | null;
51
+ date_to?: string | null;
52
+ interval?: '1h' | '1d' | '1w';
53
+ service_id?: string | null;
54
+ }): Promise<{
55
+ [key: string]: unknown;
56
+ }>;
127
57
  /** Voice pipeline latency metrics (TTFB, response time) */
128
- getLatency(params?: AnalyticsQueryParams): Promise<LatencyMetrics>;
58
+ getLatency(params?: {
59
+ days?: number;
60
+ date_from?: string | null;
61
+ date_to?: string | null;
62
+ interval?: '1h' | '1d' | '1w';
63
+ service_id?: string | null;
64
+ }): Promise<{
65
+ [key: string]: unknown;
66
+ }>;
129
67
  /** Tool call performance — success rates and latency per tool */
130
- getToolPerformance(params?: AnalyticsQueryParams): Promise<ToolPerformance[]>;
68
+ getToolPerformance(params?: {
69
+ days?: number;
70
+ }): Promise<{
71
+ [key: string]: unknown;
72
+ }>;
131
73
  /** Data quality metrics for the workspace world model */
132
- getDataQuality(params?: AnalyticsQueryParams): Promise<DataQualityMetrics>;
74
+ getDataQuality(params?: {
75
+ days?: number;
76
+ }): Promise<{
77
+ workspace_id: string;
78
+ period_start: string;
79
+ period_end: string;
80
+ confidence_distribution: import("../index.js").components["schemas"]["ConfidenceBucket"][];
81
+ confidence_by_source: {
82
+ [key: string]: import("../index.js").components["schemas"]["ConfidenceBucket"][];
83
+ };
84
+ review_pipeline: {
85
+ [key: string]: unknown;
86
+ };
87
+ timeseries: {
88
+ [key: string]: unknown;
89
+ }[];
90
+ total_events: number;
91
+ }>;
133
92
  /** Usage summary — API requests, call minutes, storage */
134
- getUsage(params?: AnalyticsQueryParams): Promise<Record<string, unknown>>;
93
+ getUsage(params?: {
94
+ days?: number;
95
+ date_from?: string | null;
96
+ date_to?: string | null;
97
+ interval?: '1h' | '1d' | '1w';
98
+ service_id?: string | null;
99
+ direction?: string | null;
100
+ }): Promise<{
101
+ workspace_id: string;
102
+ period_start: string;
103
+ period_end: string;
104
+ buckets: import("../index.js").components["schemas"]["UsageBucket"][];
105
+ total_events: number;
106
+ }>;
135
107
  /** Advanced call statistics (abandonment, transfers, silence, hour-of-day) */
136
- getAdvancedCallStats(params?: AnalyticsQueryParams): Promise<AdvancedCallStats>;
108
+ getAdvancedCallStats(params?: {
109
+ days?: number;
110
+ date_from?: string | null;
111
+ date_to?: string | null;
112
+ interval?: '1h' | '1d' | '1w';
113
+ service_id?: string | null;
114
+ }): Promise<{
115
+ [key: string]: unknown;
116
+ }>;
137
117
  /** Compare two time periods side by side */
138
118
  compareCallPeriods(params: {
139
119
  current_from: string;
@@ -141,6 +121,8 @@ export declare class AnalyticsResource extends WorkspaceScopedResource {
141
121
  previous_from: string;
142
122
  previous_to: string;
143
123
  service_id?: string;
144
- }): Promise<CallComparison>;
124
+ }): Promise<{
125
+ [key: string]: unknown;
126
+ }>;
145
127
  }
146
128
  //# sourceMappingURL=analytics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/resources/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAc,MAAM,WAAW,CAAA;AAM/D,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAMD,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,eAAe,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,eAAe,EAAE,eAAe,CAAA;IAChC,iBAAiB,EAAE,eAAe,CAAA;IAClC,cAAc,EAAE,eAAe,CAAA;IAC/B,WAAW,EAAE,MAAM,CAAA;CACpB;AAMD,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,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MAAM,CAAA;QACpB,UAAU,EAAE,MAAM,CAAA;QAClB,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB;;;CAOF"}
@@ -1,4 +1,4 @@
1
- import type { ApiKey, CreateApiKeyRequest, CreateApiKeyResponse, RotateApiKeyResponse, AuthMeResponse, PaginatedResponse } from '../types/api.js';
1
+ import type { components } from '../generated/api.js';
2
2
  import type { ApiKeyId } from '../core/branded-types.js';
3
3
  import { WorkspaceScopedResource } from './base.js';
4
4
  import type { ListParams } from '../core/utils.js';
@@ -13,16 +13,45 @@ export declare class ApiKeysResource extends WorkspaceScopedResource {
13
13
  * Get info about the currently authenticated API key.
14
14
  * Does not require a workspace ID in the path.
15
15
  */
16
- me(): Promise<AuthMeResponse>;
16
+ me(): Promise<{
17
+ workspace_id: string;
18
+ key_id: string;
19
+ name: string | null;
20
+ expires_at: string;
21
+ expires_in_seconds: number;
22
+ }>;
17
23
  /** Create a new API key */
18
- create(body: CreateApiKeyRequest): Promise<CreateApiKeyResponse>;
24
+ create(body: components['schemas']['CreateApiKeyRequest']): Promise<{
25
+ key_id: string;
26
+ api_key: string;
27
+ name: string | null;
28
+ role: string;
29
+ permissions: string[];
30
+ expires_at: string;
31
+ created_by_entity_id: string | null;
32
+ created_by_credential_id: string | null;
33
+ }>;
19
34
  /** List API keys in the workspace */
20
- list(params?: ListParams): Promise<PaginatedResponse<ApiKey>>;
21
- /** Get a specific API key */
22
- get(keyId: ApiKeyId | string): Promise<ApiKey>;
35
+ list(params?: ListParams & {
36
+ mine_only?: boolean;
37
+ }): Promise<{
38
+ items: components["schemas"]["ApiKeyResponse"][];
39
+ has_more: boolean;
40
+ continuation_token?: number | null;
41
+ total?: number | null;
42
+ }>;
23
43
  /** Revoke an API key */
24
44
  revoke(keyId: ApiKeyId | string): Promise<void>;
25
45
  /** Rotate an API key — invalidates the old key and issues a new one */
26
- rotate(keyId: ApiKeyId | string): Promise<RotateApiKeyResponse>;
46
+ rotate(keyId: ApiKeyId | string, body: components['schemas']['RotateApiKeyRequest']): Promise<{
47
+ key_id: string;
48
+ api_key: string;
49
+ name: string | null;
50
+ role: string;
51
+ permissions: string[];
52
+ expires_at: string;
53
+ created_by_entity_id: string | null;
54
+ created_by_credential_id: string | null;
55
+ }>;
27
56
  }
28
57
  //# sourceMappingURL=api-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAc,MAAM,WAAW,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,uBAAuB;IAC1D;;;OAGG;IACG,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC;IAOnC,2BAA2B;IACrB,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOtE,qCAAqC;IAC/B,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAInE,6BAA6B;IACvB,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIpD,wBAAwB;IAClB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,uEAAuE;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAGtE"}
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,uBAAuB;IAC1D;;;OAGG;IACG,EAAE;;;;;;;IAIR,2BAA2B;IACrB,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;IAS/D,qCAAqC;IAC/B,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;eAyBo1/Z,qBAAsB;;;;;IAjBl6/Z,wBAAwB;IAClB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrD,uEAAuE;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;CAQ1F"}
@@ -0,0 +1,70 @@
1
+ import type { components } from '../generated/api.js';
2
+ import { WorkspaceScopedResource } from './base.js';
3
+ export interface ListAuditParams {
4
+ service?: string | null;
5
+ action?: string | null;
6
+ actor_entity_id?: string | null;
7
+ resource_type?: string | null;
8
+ resource_id?: string | null;
9
+ phi_only?: boolean;
10
+ date_from?: string | null;
11
+ date_to?: string | null;
12
+ limit?: number;
13
+ offset?: number;
14
+ }
15
+ export interface PhiAccessParams {
16
+ entity_id?: string | null;
17
+ date_from?: string | null;
18
+ date_to?: string | null;
19
+ limit?: number;
20
+ offset?: number;
21
+ }
22
+ export interface EntityAccessLogParams {
23
+ date_from?: string | null;
24
+ date_to?: string | null;
25
+ limit?: number;
26
+ offset?: number;
27
+ }
28
+ export declare class AuditResource extends WorkspaceScopedResource {
29
+ list(params?: ListAuditParams): Promise<{
30
+ events: components["schemas"]["src__routes__audit__AuditEventResponse"][];
31
+ total: number;
32
+ limit: number;
33
+ offset: number;
34
+ has_more: boolean;
35
+ }>;
36
+ getSummary(params?: {
37
+ date_from?: string | null;
38
+ date_to?: string | null;
39
+ }): Promise<{
40
+ total_events: number;
41
+ phi_access_events: number;
42
+ unique_actors: number;
43
+ services_with_events: number;
44
+ }>;
45
+ getPhiAccess(params?: PhiAccessParams): Promise<{
46
+ events: components["schemas"]["src__routes__audit__AuditEventResponse"][];
47
+ total: number;
48
+ limit: number;
49
+ offset: number;
50
+ has_more: boolean;
51
+ }>;
52
+ createExport(body: components['schemas']['AuditExportRequest']): Promise<{
53
+ export_id: string;
54
+ s3_key: string;
55
+ row_count: number;
56
+ download_url: string;
57
+ created_at: string;
58
+ }>;
59
+ listExports(): Promise<{
60
+ exports: components["schemas"]["AuditExportListItem"][];
61
+ }>;
62
+ getEntityAccessLog(entityId: string, params?: EntityAccessLogParams): Promise<{
63
+ events: components["schemas"]["src__routes__audit__AuditEventResponse"][];
64
+ total: number;
65
+ limit: number;
66
+ offset: number;
67
+ has_more: boolean;
68
+ }>;
69
+ }
70
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/resources/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAEhE,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,e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sB;;IARtvgO,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB;gBAQu7+N,qBAAsB;;;;;;CADvh/N"}
@@ -1,18 +1,18 @@
1
1
  /**
2
- * Base class for all workspace-scoped resources.
3
- * Handles URL construction, auth headers, and error conversion.
2
+ * Base class for workspace-scoped resources.
3
+ *
4
+ * Uses the openapi-fetch client (with auth + error + retry middleware)
5
+ * injected from AmigoClient. Resources call typed HTTP methods that
6
+ * flow through the middleware chain automatically.
4
7
  */
5
- export interface ResourceConfig {
6
- apiKey: string;
7
- baseUrl: string;
8
- workspaceId: string;
9
- }
8
+ import type { Client } from 'openapi-fetch';
9
+ import type { paths } from '../generated/api.js';
10
+ import { extractData } from '../core/utils.js';
11
+ export type PlatformFetch = Client<paths>;
10
12
  export declare abstract class WorkspaceScopedResource {
11
- protected readonly config: ResourceConfig;
12
- constructor(config: ResourceConfig);
13
- protected get headers(): Record<string, string>;
14
- protected workspaceUrl(path: string): string;
15
- protected fetch<T>(path: string, init?: RequestInit): Promise<T>;
13
+ protected readonly client: PlatformFetch;
14
+ protected readonly workspaceId: string;
15
+ constructor(client: PlatformFetch, workspaceId: string);
16
16
  }
17
- export declare function buildQuery(params?: any): string;
17
+ export { extractData };
18
18
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/resources/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,8BAAsB,uBAAuB;IAC/B,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc;gBAAtB,MAAM,EAAE,cAAc;IAErD,SAAS,KAAK,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAK9C;IAED,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;cAI5B,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;CAe3E;AAGD,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,MAAM,CAW/C"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/resources/base.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;AAEzC,8BAAsB,uBAAuB;IAEzC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa;IACxC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM;gBADnB,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM;CAEzC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,19 +1,59 @@
1
- import type { UsageSummary, Invoice, PaginatedResponse } from '../types/api.js';
2
1
  import { WorkspaceScopedResource } from './base.js';
3
- export interface UsageQueryParams {
4
- start_date?: string;
5
- end_date?: string;
2
+ import type { ListParams } from '../core/utils.js';
3
+ export interface ListInvoicesParams extends ListParams {
4
+ status?: 'draft' | 'sent' | 'paid' | 'void';
5
+ date_from?: string;
6
+ date_to?: string;
7
+ }
8
+ export interface UsageTrendsParams {
9
+ days?: number;
10
+ date_from?: string;
11
+ date_to?: string;
12
+ meter_key?: string;
6
13
  }
7
14
  /**
8
- * Billing — usage summaries and invoices.
15
+ * Billing — dashboard, usage summaries, invoices, and usage trends.
9
16
  */
10
17
  export declare class BillingResource extends WorkspaceScopedResource {
11
- /** Get usage summary for a time period */
12
- getUsage(params?: UsageQueryParams): Promise<UsageSummary>;
13
- /** List invoices */
14
- listInvoices(params?: {
15
- limit?: number;
16
- continuation_token?: number;
17
- }): Promise<PaginatedResponse<Invoice>>;
18
+ /** Get composite billing dashboard KPIs, period comparison, top meters, invoice summary */
19
+ getDashboard(): Promise<{
20
+ workspace_id: string;
21
+ current_period_total: number;
22
+ previous_period_total: number | null;
23
+ delta_pct: number | null;
24
+ top_meters: import("../index.js").components["schemas"]["MeterSummary"][];
25
+ invoice_status_summary: {
26
+ [key: string]: number;
27
+ };
28
+ period_start: string | null;
29
+ period_end: string | null;
30
+ }>;
31
+ /** Get usage summary for the workspace */
32
+ getUsage(): Promise<{
33
+ [key: string]: unknown;
34
+ }>;
35
+ /** Get usage time-series per meter for trend charts */
36
+ getUsageTrends(params?: UsageTrendsParams): Promise<{
37
+ period_start: string;
38
+ period_end: string;
39
+ meter_key: string;
40
+ value: number;
41
+ unit: string;
42
+ }[]>;
43
+ /** List invoices for the workspace */
44
+ listInvoices(params?: ListInvoicesParams): Promise<{
45
+ items: import("../index.js").components["schemas"]["InvoiceItem"][];
46
+ has_more: boolean;
47
+ continuation_token?: number | null;
48
+ total?: number | null;
49
+ }>;
50
+ /** Get invoice detail */
51
+ getInvoice(invoiceId: string): Promise<{
52
+ [key: string]: unknown;
53
+ }>;
54
+ /** Get presigned S3 URL for invoice PDF download */
55
+ getInvoicePdf(invoiceId: string): Promise<{
56
+ [key: string]: unknown;
57
+ }>;
18
58
  }
19
59
  //# sourceMappingURL=billing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../src/resources/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,EAAE,uBAAuB,EAAc,MAAM,WAAW,CAAA;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EA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