@alva-ai/toolkit 0.14.1-beta.0 → 0.15.1-beta.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/dist/browser.global.js +3 -3
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +162 -1
- package/dist/cli.js +659 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +156 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +163 -2
- package/dist/index.d.ts +163 -2
- package/dist/index.js +154 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -188,6 +188,12 @@ interface CronjobCreateRequest {
|
|
|
188
188
|
push_notify?: boolean;
|
|
189
189
|
/** Override per-cronjob V8 heap limit (MB). Valid range 1–2046. */
|
|
190
190
|
max_heap_size_mb?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Run the cronjob under a restricted service-account identity (an SA id
|
|
193
|
+
* owned by the caller) instead of the owner (#602). Omitted ⇒ runs as owner.
|
|
194
|
+
* A string: SA ids are snowflake int64s that overflow JS number precision.
|
|
195
|
+
*/
|
|
196
|
+
run_as_user_id?: string;
|
|
191
197
|
}
|
|
192
198
|
interface Cronjob {
|
|
193
199
|
id: number;
|
|
@@ -199,6 +205,11 @@ interface Cronjob {
|
|
|
199
205
|
push_notify: boolean;
|
|
200
206
|
/** Per-cronjob V8 heap cap (MB). null when using the server default. */
|
|
201
207
|
max_heap_size_mb: number | null;
|
|
208
|
+
/**
|
|
209
|
+
* SA id the cronjob runs as, or "0" when it runs as the owner (#602).
|
|
210
|
+
* A string: snowflake int64 ids overflow JS number precision.
|
|
211
|
+
*/
|
|
212
|
+
run_as_user_id: string;
|
|
202
213
|
created_at: string;
|
|
203
214
|
updated_at: string;
|
|
204
215
|
}
|
|
@@ -218,6 +229,12 @@ interface CronjobUpdateRequest {
|
|
|
218
229
|
push_notify?: boolean;
|
|
219
230
|
/** Override per-cronjob V8 heap limit (MB). Valid range 1–2046. */
|
|
220
231
|
max_heap_size_mb?: number;
|
|
232
|
+
/**
|
|
233
|
+
* Re-point the cronjob at a service-account identity, or "0" to clear it back
|
|
234
|
+
* to the owner (#602). Omitted ⇒ run_as unchanged.
|
|
235
|
+
* A string: SA ids are snowflake int64s that overflow JS number precision.
|
|
236
|
+
*/
|
|
237
|
+
run_as_user_id?: string;
|
|
221
238
|
}
|
|
222
239
|
interface CronjobRunsListParams {
|
|
223
240
|
cronjob_id: number;
|
|
@@ -290,6 +307,56 @@ interface FeedDeleteRequest {
|
|
|
290
307
|
/** Numeric feed id to delete. */
|
|
291
308
|
id: number;
|
|
292
309
|
}
|
|
310
|
+
type FeedListStatus = 'active' | 'paused' | 'all';
|
|
311
|
+
interface FeedListParams {
|
|
312
|
+
/** Page size, default 50, max 100 server-side. */
|
|
313
|
+
limit?: number;
|
|
314
|
+
/** Opaque cursor token from the previous page. */
|
|
315
|
+
cursor?: string;
|
|
316
|
+
/** Runtime status filter; defaults to active on the gateway. */
|
|
317
|
+
status?: FeedListStatus;
|
|
318
|
+
}
|
|
319
|
+
interface FeedListItem {
|
|
320
|
+
/** Numeric feed id encoded as a string, matching the gateway response. */
|
|
321
|
+
id: string;
|
|
322
|
+
name: string;
|
|
323
|
+
/** Feed runtime status. */
|
|
324
|
+
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | (string & {});
|
|
325
|
+
cron_expression?: string;
|
|
326
|
+
total_runs: number;
|
|
327
|
+
used_by_total: number;
|
|
328
|
+
}
|
|
329
|
+
interface FeedListResponse {
|
|
330
|
+
feeds: FeedListItem[];
|
|
331
|
+
next_cursor?: string;
|
|
332
|
+
has_more: boolean;
|
|
333
|
+
}
|
|
334
|
+
interface AutomationInspectRequest {
|
|
335
|
+
/** Numeric automation id. Currently the same underlying feed id. */
|
|
336
|
+
id: number;
|
|
337
|
+
}
|
|
338
|
+
interface AutomationInspectResponse {
|
|
339
|
+
/** Numeric automation id encoded as a string, matching the gateway response. */
|
|
340
|
+
id: string;
|
|
341
|
+
/** Backing feed id encoded as a string. */
|
|
342
|
+
feed_id: string;
|
|
343
|
+
name: string;
|
|
344
|
+
description?: string;
|
|
345
|
+
/** Automation runtime status. */
|
|
346
|
+
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | (string & {});
|
|
347
|
+
cron_expression?: string;
|
|
348
|
+
total_runs: number;
|
|
349
|
+
/**
|
|
350
|
+
* Backend product-flow registry id. Null for ordinary non-flow automations.
|
|
351
|
+
*/
|
|
352
|
+
flow_id: string | null;
|
|
353
|
+
/**
|
|
354
|
+
* Absolute ALFS config path for caller-owned product-flow automations.
|
|
355
|
+
* Null for ordinary automations and product-flow automations not owned by
|
|
356
|
+
* the caller.
|
|
357
|
+
*/
|
|
358
|
+
flow_config_path: string | null;
|
|
359
|
+
}
|
|
293
360
|
interface FeedStatusUpdateRequest {
|
|
294
361
|
/** Numeric feed id to stop/resume. */
|
|
295
362
|
id: number;
|
|
@@ -298,7 +365,7 @@ interface FeedStatusUpdateResponse {
|
|
|
298
365
|
/** Echoed feed id (string form, matching gateway response). */
|
|
299
366
|
id: string;
|
|
300
367
|
/** Feed runtime status after the update. */
|
|
301
|
-
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | string;
|
|
368
|
+
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | (string & {});
|
|
302
369
|
}
|
|
303
370
|
interface FeedDeleteResponse {
|
|
304
371
|
/** Echoed feed id (string form, matching gateway response). */
|
|
@@ -850,6 +917,27 @@ interface ChannelGroupSubscriptionMutationResponse {
|
|
|
850
917
|
admin: ChannelGroupAdminInfo | null;
|
|
851
918
|
subscriptions: ChannelGroupSubscription[];
|
|
852
919
|
}
|
|
920
|
+
interface ServiceAccount {
|
|
921
|
+
id: string;
|
|
922
|
+
display_name: string;
|
|
923
|
+
username: string;
|
|
924
|
+
parent_user_id: string;
|
|
925
|
+
created_at?: number;
|
|
926
|
+
}
|
|
927
|
+
interface ServiceAccountCreateRequest {
|
|
928
|
+
display_name: string;
|
|
929
|
+
}
|
|
930
|
+
interface ServiceAccountCreateResponse {
|
|
931
|
+
service_account: ServiceAccount;
|
|
932
|
+
}
|
|
933
|
+
interface ServiceAccountListResponse {
|
|
934
|
+
service_accounts: ServiceAccount[];
|
|
935
|
+
}
|
|
936
|
+
interface ServiceAccountGrantRequest {
|
|
937
|
+
id: string;
|
|
938
|
+
path: string;
|
|
939
|
+
permission: string;
|
|
940
|
+
}
|
|
853
941
|
|
|
854
942
|
declare class FsResource {
|
|
855
943
|
private client;
|
|
@@ -923,6 +1011,25 @@ declare class DeployResource {
|
|
|
923
1011
|
}): Promise<CronjobRunLogsResponse>;
|
|
924
1012
|
}
|
|
925
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* Service-account lifecycle: create a restricted run-as identity, list/delete
|
|
1016
|
+
* the ones you own, and grant/revoke its ALFS paths. Set the resulting id as
|
|
1017
|
+
* `--run-as-service-account` on a UDF or cronjob to run it under that scoped
|
|
1018
|
+
* identity (billing/audit stay with you). See the service-accounts skill
|
|
1019
|
+
* reference. Owner-gated by the backend — an SA cannot manage SAs.
|
|
1020
|
+
*/
|
|
1021
|
+
declare class ServiceAccountResource {
|
|
1022
|
+
private client;
|
|
1023
|
+
constructor(client: AlvaClient);
|
|
1024
|
+
create(params: ServiceAccountCreateRequest): Promise<ServiceAccountCreateResponse>;
|
|
1025
|
+
list(): Promise<ServiceAccountListResponse>;
|
|
1026
|
+
delete(params: {
|
|
1027
|
+
id: string;
|
|
1028
|
+
}): Promise<void>;
|
|
1029
|
+
grant(params: ServiceAccountGrantRequest): Promise<void>;
|
|
1030
|
+
revoke(params: ServiceAccountGrantRequest): Promise<void>;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
926
1033
|
declare class ReleaseResource {
|
|
927
1034
|
private client;
|
|
928
1035
|
constructor(client: AlvaClient);
|
|
@@ -938,6 +1045,10 @@ declare class ReleaseResource {
|
|
|
938
1045
|
declare class FeedResource {
|
|
939
1046
|
private client;
|
|
940
1047
|
constructor(client: AlvaClient);
|
|
1048
|
+
/**
|
|
1049
|
+
* List feeds owned by the caller. Backed by GET /api/v1/feed.
|
|
1050
|
+
*/
|
|
1051
|
+
list(params?: FeedListParams): Promise<FeedListResponse>;
|
|
941
1052
|
/**
|
|
942
1053
|
* Stop a feed's producer cronjob. This pauses future scheduled runs while
|
|
943
1054
|
* preserving the feed and its existing data.
|
|
@@ -962,6 +1073,24 @@ declare class FeedResource {
|
|
|
962
1073
|
delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
|
|
963
1074
|
}
|
|
964
1075
|
|
|
1076
|
+
/**
|
|
1077
|
+
* Product-facing automation API. Backed by the existing feed/release gateway
|
|
1078
|
+
* surfaces while those lower-level names remain on the wire for compatibility.
|
|
1079
|
+
*/
|
|
1080
|
+
declare class AutomationResource {
|
|
1081
|
+
private client;
|
|
1082
|
+
constructor(client: AlvaClient);
|
|
1083
|
+
list(params?: FeedListParams): Promise<FeedListResponse>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Inspect one automation. Backed by GET /api/v1/automation/:id.
|
|
1086
|
+
*/
|
|
1087
|
+
inspect(params: AutomationInspectRequest): Promise<AutomationInspectResponse>;
|
|
1088
|
+
stop(params: FeedStatusUpdateRequest): Promise<FeedStatusUpdateResponse>;
|
|
1089
|
+
resume(params: FeedStatusUpdateRequest): Promise<FeedStatusUpdateResponse>;
|
|
1090
|
+
delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
|
|
1091
|
+
publish(params: FeedReleaseRequest): Promise<FeedReleaseResponse>;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
965
1094
|
/** Playbook visibility states understood by the gateway. */
|
|
966
1095
|
type PlaybookVisibility = 'public' | 'private' | 'paid';
|
|
967
1096
|
interface SetVisibilityParams {
|
|
@@ -1416,6 +1545,25 @@ declare class SubscriptionsResource {
|
|
|
1416
1545
|
unsubscribeBatch(params: UnsubscribeBatchParams): Promise<UnsubscribeBatchResponse>;
|
|
1417
1546
|
}
|
|
1418
1547
|
|
|
1548
|
+
/**
|
|
1549
|
+
* Product-facing alert API. The current transport still calls the legacy
|
|
1550
|
+
* subscription and notification-history endpoints.
|
|
1551
|
+
*/
|
|
1552
|
+
declare class AlertsResource {
|
|
1553
|
+
private client;
|
|
1554
|
+
constructor(client: AlvaClient);
|
|
1555
|
+
list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
|
|
1556
|
+
enableAutomation(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
|
|
1557
|
+
disableAutomation(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
|
|
1558
|
+
enablePlaybook(params: PushSubscriptionPlaybookParams): Promise<SubscribePlaybookResponse>;
|
|
1559
|
+
disablePlaybook(params: PushSubscriptionPlaybookParams): Promise<UnsubscribeResponse>;
|
|
1560
|
+
disableBatch(params: UnsubscribeBatchParams): Promise<UnsubscribeBatchResponse>;
|
|
1561
|
+
historyAutomation(params: NotificationListParams): Promise<FeedNotificationListResponse>;
|
|
1562
|
+
historyPlaybook(params: NotificationListParams): Promise<PlaybookNotificationListResponse>;
|
|
1563
|
+
preferences(): Promise<NotificationPreferencesResponse>;
|
|
1564
|
+
updatePreference(params: NotificationPreferenceUpdateParams): Promise<NotificationPreferenceUpdateResponse>;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1419
1567
|
/**
|
|
1420
1568
|
* Group push subscriptions for an external channel session.
|
|
1421
1569
|
*
|
|
@@ -1455,6 +1603,13 @@ interface RegisterFunctionParams {
|
|
|
1455
1603
|
entry_script_path: string;
|
|
1456
1604
|
params_schema?: string;
|
|
1457
1605
|
allow_charges?: boolean;
|
|
1606
|
+
/**
|
|
1607
|
+
* Run invocations of this function under a restricted service-account
|
|
1608
|
+
* identity (an SA id owned by the caller) instead of the owner (#602).
|
|
1609
|
+
* Omitted ⇒ runs as the owner. A string: SA ids are snowflake int64s that
|
|
1610
|
+
* overflow JS number precision.
|
|
1611
|
+
*/
|
|
1612
|
+
run_as_user_id?: string;
|
|
1458
1613
|
}
|
|
1459
1614
|
interface RegisterFunctionResponse {
|
|
1460
1615
|
function?: PlaybookFunction;
|
|
@@ -1573,8 +1728,10 @@ declare class AlvaClient {
|
|
|
1573
1728
|
private _fs?;
|
|
1574
1729
|
private _run?;
|
|
1575
1730
|
private _deploy?;
|
|
1731
|
+
private _serviceAccount?;
|
|
1576
1732
|
private _release?;
|
|
1577
1733
|
private _feed?;
|
|
1734
|
+
private _automation?;
|
|
1578
1735
|
private _playbooks?;
|
|
1579
1736
|
private _secrets?;
|
|
1580
1737
|
private _sdk?;
|
|
@@ -1590,6 +1747,7 @@ declare class AlvaClient {
|
|
|
1590
1747
|
private _notifications?;
|
|
1591
1748
|
private _notificationPreferences?;
|
|
1592
1749
|
private _subscriptions?;
|
|
1750
|
+
private _alerts?;
|
|
1593
1751
|
private _channelGroupSubscriptions?;
|
|
1594
1752
|
private _feedback?;
|
|
1595
1753
|
private _functions?;
|
|
@@ -1598,8 +1756,10 @@ declare class AlvaClient {
|
|
|
1598
1756
|
get fs(): FsResource;
|
|
1599
1757
|
get run(): RunResource;
|
|
1600
1758
|
get deploy(): DeployResource;
|
|
1759
|
+
get serviceAccount(): ServiceAccountResource;
|
|
1601
1760
|
get release(): ReleaseResource;
|
|
1602
1761
|
get feed(): FeedResource;
|
|
1762
|
+
get automation(): AutomationResource;
|
|
1603
1763
|
get playbooks(): PlaybooksResource;
|
|
1604
1764
|
get secrets(): SecretsResource;
|
|
1605
1765
|
get sdk(): SdkDocsResource;
|
|
@@ -1615,6 +1775,7 @@ declare class AlvaClient {
|
|
|
1615
1775
|
get notifications(): NotificationsResource;
|
|
1616
1776
|
get notificationPreferences(): NotificationPreferencesResource;
|
|
1617
1777
|
get subscriptions(): SubscriptionsResource;
|
|
1778
|
+
get alerts(): AlertsResource;
|
|
1618
1779
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1619
1780
|
get feedback(): FeedbackResource;
|
|
1620
1781
|
get functions(): FunctionsResource;
|