@faable/deploy-sdk 1.0.21 → 1.2.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.
@@ -1,4 +1,15 @@
1
1
  import { FaableApi, ApiParams } from "@faable/sdk-base";
2
+ import { AppTraffic } from "./api/api-types.js";
3
+ export interface AppTrafficQuery {
4
+ /** Unix seconds; defaults to 24h ago. */
5
+ from?: number;
6
+ /** Unix seconds; defaults to now. */
7
+ to?: number;
8
+ /** Transfer-series bucket width in seconds; defaults to 1h. */
9
+ interval?: number;
10
+ /** Restrict to a single deployment; omit for all of the app's traffic. */
11
+ deployment_id?: string;
12
+ }
2
13
  export declare class DeployApi extends FaableApi {
3
14
  constructor(params?: ApiParams);
4
15
  getDeployment(id: string): Promise<{
@@ -8,12 +19,14 @@ export declare class DeployApi extends FaableApi {
8
19
  image?: string;
9
20
  github_commit?: string;
10
21
  github_ref?: string;
22
+ github_actor?: string;
23
+ github_commit_message?: string;
11
24
  status: import("./index.js").components["schemas"]["DeploymentStatus"];
12
25
  metadata: {
13
26
  [key: string]: unknown;
14
27
  };
15
28
  createdAt: string;
16
- updatedAt: string;
29
+ updatedAt?: string;
17
30
  }>;
18
31
  getApp(id: string): Promise<{
19
32
  id: string;
@@ -35,7 +48,7 @@ export declare class DeployApi extends FaableApi {
35
48
  [key: string]: unknown;
36
49
  };
37
50
  createdAt: string;
38
- updatedAt: string;
51
+ updatedAt?: string;
39
52
  }>;
40
53
  listApps(): {
41
54
  all: () => Promise<{
@@ -58,7 +71,7 @@ export declare class DeployApi extends FaableApi {
58
71
  [key: string]: unknown;
59
72
  };
60
73
  createdAt: string;
61
- updatedAt: string;
74
+ updatedAt?: string;
62
75
  }[]>;
63
76
  first: () => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
64
77
  id: string;
@@ -80,7 +93,7 @@ export declare class DeployApi extends FaableApi {
80
93
  [key: string]: unknown;
81
94
  };
82
95
  createdAt: string;
83
- updatedAt: string;
96
+ updatedAt?: string;
84
97
  }>>;
85
98
  pass: (params?: {
86
99
  cursor?: string;
@@ -105,7 +118,7 @@ export declare class DeployApi extends FaableApi {
105
118
  [key: string]: unknown;
106
119
  };
107
120
  createdAt: string;
108
- updatedAt: string;
121
+ updatedAt?: string;
109
122
  }>>;
110
123
  };
111
124
  updateStatus<T>(id: string, data: T): Promise<any>;
@@ -123,7 +136,7 @@ export declare class DeployApi extends FaableApi {
123
136
  [key: string]: unknown;
124
137
  };
125
138
  createdAt: string;
126
- updatedAt: string;
139
+ updatedAt?: string;
127
140
  }[]>;
128
141
  first: () => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
129
142
  id: string;
@@ -138,7 +151,7 @@ export declare class DeployApi extends FaableApi {
138
151
  [key: string]: unknown;
139
152
  };
140
153
  createdAt: string;
141
- updatedAt: string;
154
+ updatedAt?: string;
142
155
  }>>;
143
156
  pass: (params?: {
144
157
  cursor?: string;
@@ -156,7 +169,7 @@ export declare class DeployApi extends FaableApi {
156
169
  [key: string]: unknown;
157
170
  };
158
171
  createdAt: string;
159
- updatedAt: string;
172
+ updatedAt?: string;
160
173
  }>>;
161
174
  };
162
175
  listDomains(): {
@@ -172,7 +185,7 @@ export declare class DeployApi extends FaableApi {
172
185
  [key: string]: unknown;
173
186
  };
174
187
  createdAt: string;
175
- updatedAt: string;
188
+ updatedAt?: string;
176
189
  }[]>;
177
190
  first: () => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
178
191
  id: string;
@@ -186,7 +199,7 @@ export declare class DeployApi extends FaableApi {
186
199
  [key: string]: unknown;
187
200
  };
188
201
  createdAt: string;
189
- updatedAt: string;
202
+ updatedAt?: string;
190
203
  }>>;
191
204
  pass: (params?: {
192
205
  cursor?: string;
@@ -203,7 +216,7 @@ export declare class DeployApi extends FaableApi {
203
216
  [key: string]: unknown;
204
217
  };
205
218
  createdAt: string;
206
- updatedAt: string;
219
+ updatedAt?: string;
207
220
  }>>;
208
221
  };
209
222
  listDeployments(): Promise<{
@@ -213,12 +226,15 @@ export declare class DeployApi extends FaableApi {
213
226
  image?: string;
214
227
  github_commit?: string;
215
228
  github_ref?: string;
229
+ github_actor?: string;
230
+ github_commit_message?: string;
216
231
  status: import("./index.js").components["schemas"]["DeploymentStatus"];
217
232
  metadata: {
218
233
  [key: string]: unknown;
219
234
  };
220
235
  createdAt: string;
221
- updatedAt: string;
236
+ updatedAt?: string;
222
237
  }>;
238
+ getAppTraffic(id: string, query?: AppTrafficQuery): Promise<AppTraffic>;
223
239
  }
224
240
  //# sourceMappingURL=FaableDeployApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FaableDeployApi.d.ts","sourceRoot":"","sources":["../src/FaableDeployApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGxD,qBAAa,SAAU,SAAQ,SAAS;gBAC1B,MAAM,CAAC,EAAE,SAAS;IAO9B,aAAa,CAAC,EAAE,EAAE,MAAM;;;;;;;gBAsBg0rB,0CAAsB;;;;;;;IAnB92rB,MAAM,CAAC,EAAE,EAAE,MAAM;;;;;;;;iBAmB67lB,0CAAsB;;;;gBAAgc,0CAAsB;;;;;;;;;;IAhB17mB,QAAQ;;;;;;;;;qBAgBs8lB,0CAAsB;;;;oBAAgc,0CAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAfz6mB,CAAC;oBAA0B,CAAC;;;;;;;;;qBAei6lB,0CAAsB;;;;oBAAgc,0CAAsB;;;;;;;;;;;IAb17mB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAGnC,WAAW,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBALL,CAAC;oBAA0B,CAAC;;;;;;;;;;;;;;;;;IAQ7C,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBARM,CAAC;oBAA0B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;;;;;;;;;;;;;IA0B1B,eAAe;;;;;;;;;gBAYmuwB,0CAAsB;;;;;;;IATxwwB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,eAAoB;CAQtD"}
@@ -27,4 +27,16 @@ export class DeployApi extends FaableApi {
27
27
  listDeployments() {
28
28
  return this.fetcher.get(`/deployment`);
29
29
  }
30
+ getAppTraffic(id, query = {}) {
31
+ const params = {};
32
+ if (query.from != null)
33
+ params.from = String(query.from);
34
+ if (query.to != null)
35
+ params.to = String(query.to);
36
+ if (query.interval != null)
37
+ params.interval = String(query.interval);
38
+ if (query.deployment_id != null)
39
+ params.deployment_id = query.deployment_id;
40
+ return this.fetcher.get(`/app/${id}/traffic`, { params });
41
+ }
30
42
  }
@@ -16,4 +16,60 @@ export type EventDomainCreate = components["schemas"]["EventDomainCreate"];
16
16
  export type EventDomainUpdate = components["schemas"]["EventDomainUpdate"];
17
17
  export type EventDomainDelete = components["schemas"]["EventDomainDelete"];
18
18
  export type EventDeploymentStatusUpdate = components["schemas"]["EventDeploymentUpdate"];
19
+ /**
20
+ * Per-app HTTP traffic metrics returned by `GET /app/{id}/traffic`.
21
+ *
22
+ * Hand-maintained until the OpenAPI types are regenerated (the API now ships
23
+ * an `AppTraffic` schema); keep in sync with
24
+ * `api/src/deploy/app/api/traffic.ts`.
25
+ */
26
+ export interface AppTraffic {
27
+ range: {
28
+ from: number;
29
+ to: number;
30
+ interval: number;
31
+ };
32
+ top_endpoints: Array<{
33
+ path: string;
34
+ requests: number;
35
+ req_bytes: number;
36
+ resp_bytes: number;
37
+ }>;
38
+ status_codes: Array<{
39
+ status: number;
40
+ requests: number;
41
+ }>;
42
+ methods: Array<{
43
+ method: string;
44
+ requests: number;
45
+ }>;
46
+ transfer: Array<{
47
+ ts: string;
48
+ inbound_bytes: number;
49
+ outbound_bytes: number;
50
+ requests: number;
51
+ p50_ms: number;
52
+ p95_ms: number;
53
+ }>;
54
+ /** Backend (origin) status codes — the app's own response, not the edge's. */
55
+ origin_status_codes: Array<{
56
+ status: number;
57
+ requests: number;
58
+ }>;
59
+ /** Backend latency percentiles (ms) over backend-served requests. */
60
+ latency: {
61
+ p50: number;
62
+ p95: number;
63
+ p99: number;
64
+ samples: number;
65
+ };
66
+ top_referrers: Array<{
67
+ referer: string;
68
+ requests: number;
69
+ }>;
70
+ top_user_agents: Array<{
71
+ user_agent: string;
72
+ requests: number;
73
+ }>;
74
+ }
19
75
  //# sourceMappingURL=api-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-types.d.ts","sourceRoot":"","sources":["../../src/api/api-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/C,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC7E,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACzE,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;AACrD,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;AAErD,MAAM,MAAM,4BAA4B,GACtC,UAAU,CAAC,SAAS,CAAC,CAAC,yBAAyB,CAAC,CAAC;AACnD,MAAM,MAAM,sBAAsB,GAChC,UAAU,CAAC,SAAS,CAAC,CAAC,u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