@alva-ai/toolkit 0.9.5 → 0.11.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 +2 -2
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.js +164 -80
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +60 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -33
- package/dist/index.d.ts +70 -33
- package/dist/index.js +60 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -573,6 +573,25 @@ interface NotificationPreferenceUpdateParams {
|
|
|
573
573
|
interface NotificationPreferenceUpdateResponse {
|
|
574
574
|
setting: NotificationPreference;
|
|
575
575
|
}
|
|
576
|
+
interface SubmitFeedbackRequest {
|
|
577
|
+
/** Defaults to "agent_detected" on the server. */
|
|
578
|
+
source?: 'agent_detected' | 'user_reported' | 'system_detected' | string;
|
|
579
|
+
/** Defaults to "other" on the server. */
|
|
580
|
+
category?: 'api_error' | 'data_quality' | 'docs' | 'runtime' | 'auth' | 'billing' | 'other' | string;
|
|
581
|
+
/** Defaults to "medium" on the server. */
|
|
582
|
+
severity?: 'low' | 'medium' | 'high' | 'critical' | string;
|
|
583
|
+
summary: string;
|
|
584
|
+
details?: string;
|
|
585
|
+
/** Optional structured diagnostics; omit unless the agent has useful metadata. */
|
|
586
|
+
evidence?: Record<string, unknown>;
|
|
587
|
+
/** Optional structured session metadata; omit unless relevant to triage. */
|
|
588
|
+
context?: Record<string, unknown>;
|
|
589
|
+
}
|
|
590
|
+
interface SubmitFeedbackResponse {
|
|
591
|
+
feedback_id: number;
|
|
592
|
+
notion_page_id: string;
|
|
593
|
+
notion_url: string;
|
|
594
|
+
}
|
|
576
595
|
/**
|
|
577
596
|
* Identifies the asset a personal push subscription is keyed to.
|
|
578
597
|
* `PLAYBOOK` is the only target supported today; `FEED` is reserved for
|
|
@@ -626,17 +645,27 @@ interface PushSubscriptionListResponse {
|
|
|
626
645
|
/** Empty when there is no next page. */
|
|
627
646
|
next_cursor?: string;
|
|
628
647
|
}
|
|
629
|
-
interface
|
|
630
|
-
|
|
648
|
+
interface PlaybookFollow {
|
|
649
|
+
id: string;
|
|
650
|
+
user_id: string;
|
|
651
|
+
playbook_id: string;
|
|
652
|
+
created_at_ms: number;
|
|
653
|
+
updated_at_ms: number;
|
|
654
|
+
}
|
|
655
|
+
interface SubscribePlaybookResponse {
|
|
656
|
+
/** The follow row created (or confirmed) by the cascade subscribe. */
|
|
657
|
+
follow: PlaybookFollow;
|
|
658
|
+
/** Feed ids whose alert this subscribe enabled (push-enabled automations). */
|
|
659
|
+
subscribed_feed_ids: string[];
|
|
631
660
|
/** Canonical alfs path: `/alva/home/<username>/playbooks/<name>`. */
|
|
632
661
|
playbook_path: string;
|
|
633
662
|
}
|
|
634
|
-
interface
|
|
663
|
+
interface SubscribeFeedResponse {
|
|
635
664
|
subscription: PushSubscription;
|
|
636
665
|
/** Canonical alfs path: `/alva/home/<username>/feeds/<name>`. */
|
|
637
666
|
feed_path: string;
|
|
638
667
|
}
|
|
639
|
-
interface
|
|
668
|
+
interface UnsubscribeResponse {
|
|
640
669
|
ok: true;
|
|
641
670
|
}
|
|
642
671
|
type ChannelGroupSubscriptionTargetType = 'feed' | 'playbook';
|
|
@@ -948,6 +977,7 @@ declare class DataSkillsResource {
|
|
|
948
977
|
interface PlaybookSkillSummary {
|
|
949
978
|
username: string;
|
|
950
979
|
name: string;
|
|
980
|
+
display_name: string;
|
|
951
981
|
description: string;
|
|
952
982
|
tags: string[];
|
|
953
983
|
creator_uid: number;
|
|
@@ -1110,46 +1140,45 @@ declare class NotificationPreferencesResource {
|
|
|
1110
1140
|
}
|
|
1111
1141
|
|
|
1112
1142
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
* DM/web push for a target. Independent of social follow:
|
|
1143
|
+
* Subscriptions — subscribe the caller to playbooks and feeds.
|
|
1115
1144
|
*
|
|
1116
|
-
* - `subscribePlaybook`
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1145
|
+
* - `subscribePlaybook` is a CASCADE: it follows the playbook AND enables
|
|
1146
|
+
* personal push for every push-enabled automation of its latest release,
|
|
1147
|
+
* in one call. `unsubscribePlaybook` reverses both (unfollow + disable
|
|
1148
|
+
* all of the playbook's push alerts).
|
|
1149
|
+
* - `subscribeFeed` / `unsubscribeFeed` toggle personal push for ONE feed
|
|
1150
|
+
* (a single automation's alert) without touching the playbook follow.
|
|
1120
1151
|
*
|
|
1121
|
-
* Backed by alva-gateway REST
|
|
1122
|
-
* `pkg/schema/push_subscription.graphql`).
|
|
1152
|
+
* Backed by alva-gateway REST under `/api/v1/subscriptions/...`.
|
|
1123
1153
|
*/
|
|
1124
|
-
declare class
|
|
1154
|
+
declare class SubscriptionsResource {
|
|
1125
1155
|
private client;
|
|
1126
1156
|
constructor(client: AlvaClient);
|
|
1127
1157
|
/**
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1158
|
+
* Subscribe to a playbook `(username, name)`: follow it and enable alerts
|
|
1159
|
+
* on all its push-enabled automations. Idempotent. Auth: the caller must be
|
|
1160
|
+
* able to read the playbook — public passes; paid requires an active unlock;
|
|
1161
|
+
* private requires owner/admin.
|
|
1132
1162
|
*/
|
|
1133
|
-
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1163
|
+
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<SubscribePlaybookResponse>;
|
|
1134
1164
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1165
|
+
* Unsubscribe from a playbook `(username, name)`: unfollow it and disable
|
|
1166
|
+
* all of its push alerts for the caller. Idempotent.
|
|
1137
1167
|
*/
|
|
1138
|
-
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1168
|
+
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<UnsubscribeResponse>;
|
|
1139
1169
|
/**
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
* push per playbook context. Idempotent.
|
|
1170
|
+
* Subscribe to one feed `(username, name)` — enable personal push for that
|
|
1171
|
+
* single automation's alerts, regardless of which playbook(s) consume it.
|
|
1172
|
+
* Does NOT follow any playbook. Idempotent.
|
|
1144
1173
|
*/
|
|
1145
|
-
subscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1174
|
+
subscribeFeed(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
|
|
1146
1175
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
* Idempotent.
|
|
1176
|
+
* Unsubscribe from one feed `(username, name)` — disable that automation's
|
|
1177
|
+
* alerts for the caller. Idempotent.
|
|
1149
1178
|
*/
|
|
1150
|
-
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1179
|
+
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
|
|
1151
1180
|
/**
|
|
1152
|
-
* List the caller's currently active
|
|
1181
|
+
* List the caller's currently active subscriptions.
|
|
1153
1182
|
* Results are cursor-paginated.
|
|
1154
1183
|
*/
|
|
1155
1184
|
list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
|
|
@@ -1171,6 +1200,12 @@ declare class ChannelGroupSubscriptionsResource {
|
|
|
1171
1200
|
unsubscribe(params: ChannelGroupSubscriptionMutationParams): Promise<ChannelGroupSubscriptionMutationResponse>;
|
|
1172
1201
|
}
|
|
1173
1202
|
|
|
1203
|
+
declare class FeedbackResource {
|
|
1204
|
+
private client;
|
|
1205
|
+
constructor(client: AlvaClient);
|
|
1206
|
+
submit(params: SubmitFeedbackRequest): Promise<SubmitFeedbackResponse>;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1174
1209
|
interface RequestOptions {
|
|
1175
1210
|
query?: Record<string, unknown>;
|
|
1176
1211
|
body?: unknown;
|
|
@@ -1211,8 +1246,9 @@ declare class AlvaClient {
|
|
|
1211
1246
|
private _arraysJwt?;
|
|
1212
1247
|
private _notifications?;
|
|
1213
1248
|
private _notificationPreferences?;
|
|
1214
|
-
private
|
|
1249
|
+
private _subscriptions?;
|
|
1215
1250
|
private _channelGroupSubscriptions?;
|
|
1251
|
+
private _feedback?;
|
|
1216
1252
|
constructor(config: AlvaClientConfig);
|
|
1217
1253
|
get fs(): FsResource;
|
|
1218
1254
|
get run(): RunResource;
|
|
@@ -1233,8 +1269,9 @@ declare class AlvaClient {
|
|
|
1233
1269
|
get arraysJwt(): ArraysJwtResource;
|
|
1234
1270
|
get notifications(): NotificationsResource;
|
|
1235
1271
|
get notificationPreferences(): NotificationPreferencesResource;
|
|
1236
|
-
get
|
|
1272
|
+
get subscriptions(): SubscriptionsResource;
|
|
1237
1273
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1274
|
+
get feedback(): FeedbackResource;
|
|
1238
1275
|
_requireAuth(): void;
|
|
1239
1276
|
_request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
|
|
1240
1277
|
}
|
|
@@ -1360,4 +1397,4 @@ declare const installPlaybookRuntime: (targetWindow?: Window) => void;
|
|
|
1360
1397
|
/** SDK version, injected at build time from package.json. */
|
|
1361
1398
|
declare const VERSION: string;
|
|
1362
1399
|
|
|
1363
|
-
export { AlvaClient, type AlvaClientConfig, AlvaError, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, type FeedDeleteRequest, type FeedDeleteResponse, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, udf };
|
|
1400
|
+
export { AlvaClient, type AlvaClientConfig, AlvaError, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, type FeedDeleteRequest, type FeedDeleteResponse, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type PlaybookSkillFile, type PlaybookSkillFileMeta, type PlaybookSkillMeta, type PlaybookSkillSummary, type PlaybookSkillTagEntry, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, udf };
|
package/dist/index.d.ts
CHANGED
|
@@ -573,6 +573,25 @@ interface NotificationPreferenceUpdateParams {
|
|
|
573
573
|
interface NotificationPreferenceUpdateResponse {
|
|
574
574
|
setting: NotificationPreference;
|
|
575
575
|
}
|
|
576
|
+
interface SubmitFeedbackRequest {
|
|
577
|
+
/** Defaults to "agent_detected" on the server. */
|
|
578
|
+
source?: 'agent_detected' | 'user_reported' | 'system_detected' | string;
|
|
579
|
+
/** Defaults to "other" on the server. */
|
|
580
|
+
category?: 'api_error' | 'data_quality' | 'docs' | 'runtime' | 'auth' | 'billing' | 'other' | string;
|
|
581
|
+
/** Defaults to "medium" on the server. */
|
|
582
|
+
severity?: 'low' | 'medium' | 'high' | 'critical' | string;
|
|
583
|
+
summary: string;
|
|
584
|
+
details?: string;
|
|
585
|
+
/** Optional structured diagnostics; omit unless the agent has useful metadata. */
|
|
586
|
+
evidence?: Record<string, unknown>;
|
|
587
|
+
/** Optional structured session metadata; omit unless relevant to triage. */
|
|
588
|
+
context?: Record<string, unknown>;
|
|
589
|
+
}
|
|
590
|
+
interface SubmitFeedbackResponse {
|
|
591
|
+
feedback_id: number;
|
|
592
|
+
notion_page_id: string;
|
|
593
|
+
notion_url: string;
|
|
594
|
+
}
|
|
576
595
|
/**
|
|
577
596
|
* Identifies the asset a personal push subscription is keyed to.
|
|
578
597
|
* `PLAYBOOK` is the only target supported today; `FEED` is reserved for
|
|
@@ -626,17 +645,27 @@ interface PushSubscriptionListResponse {
|
|
|
626
645
|
/** Empty when there is no next page. */
|
|
627
646
|
next_cursor?: string;
|
|
628
647
|
}
|
|
629
|
-
interface
|
|
630
|
-
|
|
648
|
+
interface PlaybookFollow {
|
|
649
|
+
id: string;
|
|
650
|
+
user_id: string;
|
|
651
|
+
playbook_id: string;
|
|
652
|
+
created_at_ms: number;
|
|
653
|
+
updated_at_ms: number;
|
|
654
|
+
}
|
|
655
|
+
interface SubscribePlaybookResponse {
|
|
656
|
+
/** The follow row created (or confirmed) by the cascade subscribe. */
|
|
657
|
+
follow: PlaybookFollow;
|
|
658
|
+
/** Feed ids whose alert this subscribe enabled (push-enabled automations). */
|
|
659
|
+
subscribed_feed_ids: string[];
|
|
631
660
|
/** Canonical alfs path: `/alva/home/<username>/playbooks/<name>`. */
|
|
632
661
|
playbook_path: string;
|
|
633
662
|
}
|
|
634
|
-
interface
|
|
663
|
+
interface SubscribeFeedResponse {
|
|
635
664
|
subscription: PushSubscription;
|
|
636
665
|
/** Canonical alfs path: `/alva/home/<username>/feeds/<name>`. */
|
|
637
666
|
feed_path: string;
|
|
638
667
|
}
|
|
639
|
-
interface
|
|
668
|
+
interface UnsubscribeResponse {
|
|
640
669
|
ok: true;
|
|
641
670
|
}
|
|
642
671
|
type ChannelGroupSubscriptionTargetType = 'feed' | 'playbook';
|
|
@@ -948,6 +977,7 @@ declare class DataSkillsResource {
|
|
|
948
977
|
interface PlaybookSkillSummary {
|
|
949
978
|
username: string;
|
|
950
979
|
name: string;
|
|
980
|
+
display_name: string;
|
|
951
981
|
description: string;
|
|
952
982
|
tags: string[];
|
|
953
983
|
creator_uid: number;
|
|
@@ -1110,46 +1140,45 @@ declare class NotificationPreferencesResource {
|
|
|
1110
1140
|
}
|
|
1111
1141
|
|
|
1112
1142
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
* DM/web push for a target. Independent of social follow:
|
|
1143
|
+
* Subscriptions — subscribe the caller to playbooks and feeds.
|
|
1115
1144
|
*
|
|
1116
|
-
* - `subscribePlaybook`
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1145
|
+
* - `subscribePlaybook` is a CASCADE: it follows the playbook AND enables
|
|
1146
|
+
* personal push for every push-enabled automation of its latest release,
|
|
1147
|
+
* in one call. `unsubscribePlaybook` reverses both (unfollow + disable
|
|
1148
|
+
* all of the playbook's push alerts).
|
|
1149
|
+
* - `subscribeFeed` / `unsubscribeFeed` toggle personal push for ONE feed
|
|
1150
|
+
* (a single automation's alert) without touching the playbook follow.
|
|
1120
1151
|
*
|
|
1121
|
-
* Backed by alva-gateway REST
|
|
1122
|
-
* `pkg/schema/push_subscription.graphql`).
|
|
1152
|
+
* Backed by alva-gateway REST under `/api/v1/subscriptions/...`.
|
|
1123
1153
|
*/
|
|
1124
|
-
declare class
|
|
1154
|
+
declare class SubscriptionsResource {
|
|
1125
1155
|
private client;
|
|
1126
1156
|
constructor(client: AlvaClient);
|
|
1127
1157
|
/**
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1158
|
+
* Subscribe to a playbook `(username, name)`: follow it and enable alerts
|
|
1159
|
+
* on all its push-enabled automations. Idempotent. Auth: the caller must be
|
|
1160
|
+
* able to read the playbook — public passes; paid requires an active unlock;
|
|
1161
|
+
* private requires owner/admin.
|
|
1132
1162
|
*/
|
|
1133
|
-
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1163
|
+
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<SubscribePlaybookResponse>;
|
|
1134
1164
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1165
|
+
* Unsubscribe from a playbook `(username, name)`: unfollow it and disable
|
|
1166
|
+
* all of its push alerts for the caller. Idempotent.
|
|
1137
1167
|
*/
|
|
1138
|
-
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1168
|
+
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<UnsubscribeResponse>;
|
|
1139
1169
|
/**
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
* push per playbook context. Idempotent.
|
|
1170
|
+
* Subscribe to one feed `(username, name)` — enable personal push for that
|
|
1171
|
+
* single automation's alerts, regardless of which playbook(s) consume it.
|
|
1172
|
+
* Does NOT follow any playbook. Idempotent.
|
|
1144
1173
|
*/
|
|
1145
|
-
subscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1174
|
+
subscribeFeed(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
|
|
1146
1175
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
* Idempotent.
|
|
1176
|
+
* Unsubscribe from one feed `(username, name)` — disable that automation's
|
|
1177
|
+
* alerts for the caller. Idempotent.
|
|
1149
1178
|
*/
|
|
1150
|
-
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1179
|
+
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
|
|
1151
1180
|
/**
|
|
1152
|
-
* List the caller's currently active
|
|
1181
|
+
* List the caller's currently active subscriptions.
|
|
1153
1182
|
* Results are cursor-paginated.
|
|
1154
1183
|
*/
|
|
1155
1184
|
list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
|
|
@@ -1171,6 +1200,12 @@ declare class ChannelGroupSubscriptionsResource {
|
|
|
1171
1200
|
unsubscribe(params: ChannelGroupSubscriptionMutationParams): Promise<ChannelGroupSubscriptionMutationResponse>;
|
|
1172
1201
|
}
|
|
1173
1202
|
|
|
1203
|
+
declare class FeedbackResource {
|
|
1204
|
+
private client;
|
|
1205
|
+
constructor(client: AlvaClient);
|
|
1206
|
+
submit(params: SubmitFeedbackRequest): Promise<SubmitFeedbackResponse>;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1174
1209
|
interface RequestOptions {
|
|
1175
1210
|
query?: Record<string, unknown>;
|
|
1176
1211
|
body?: unknown;
|
|
@@ -1211,8 +1246,9 @@ declare class AlvaClient {
|
|
|
1211
1246
|
private _arraysJwt?;
|
|
1212
1247
|
private _notifications?;
|
|
1213
1248
|
private _notificationPreferences?;
|
|
1214
|
-
private
|
|
1249
|
+
private _subscriptions?;
|
|
1215
1250
|
private _channelGroupSubscriptions?;
|
|
1251
|
+
private _feedback?;
|
|
1216
1252
|
constructor(config: AlvaClientConfig);
|
|
1217
1253
|
get fs(): FsResource;
|
|
1218
1254
|
get run(): RunResource;
|
|
@@ -1233,8 +1269,9 @@ declare class AlvaClient {
|
|
|
1233
1269
|
get arraysJwt(): ArraysJwtResource;
|
|
1234
1270
|
get notifications(): NotificationsResource;
|
|
1235
1271
|
get notificationPreferences(): NotificationPreferencesResource;
|
|
1236
|
-
get
|
|
1272
|
+
get subscriptions(): SubscriptionsResource;
|
|
1237
1273
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1274
|
+
get feedback(): FeedbackResource;
|
|
1238
1275
|
_requireAuth(): void;
|
|
1239
1276
|
_request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
|
|
1240
1277
|
}
|
|
@@ -1360,4 +1397,4 @@ declare const installPlaybookRuntime: (targetWindow?: Window) => void;
|
|
|
1360
1397
|
/** SDK version, injected at build time from package.json. */
|
|
1361
1398
|
declare const VERSION: string;
|
|
1362
1399
|
|
|
1363
|
-
export { AlvaClient, type AlvaClientConfig, AlvaError, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, type FeedDeleteRequest, type FeedDeleteResponse, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, udf };
|
|
1400
|
+
export { AlvaClient, type AlvaClientConfig, AlvaError, type ChannelGroupAdminInfo, type ChannelGroupCallerInfo, type ChannelGroupSubscription, type ChannelGroupSubscriptionContextResponse, type ChannelGroupSubscriptionListResponse, type ChannelGroupSubscriptionMutationParams, type ChannelGroupSubscriptionMutationResponse, type ChannelGroupSubscriptionSessionParams, type ChannelGroupSubscriptionTarget, type ChannelGroupSubscriptionTargetType, type FeedDeleteRequest, type FeedDeleteResponse, type FsChmodParams, type FsCopyParams, type FsEntry, type FsGrantParams, type FsMkdirParams, type FsRawWriteParams, type FsReadParams, type FsReaddirParams, type FsReaddirResponse, type FsReadlinkParams, type FsRemoveParams, type FsRenameParams, type FsRevokeParams, type FsStat, type FsSymlinkParams, type FsWriteParams, type FsWriteResponse, type NotificationPreference, type NotificationPreferenceKey, type NotificationPreferenceUpdateParams, type NotificationPreferenceUpdateResponse, type NotificationPreferencesResponse, PBSV_UPDATE_MESSAGE, type PlaybookSkillFile, type PlaybookSkillFileMeta, type PlaybookSkillMeta, type PlaybookSkillSummary, type PlaybookSkillTagEntry, type SkillDoc, type SkillEndpointMetadata, type SkillEndpointTier, type SkillMetadata, type SkillSummary, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type TrendingPlaybookItem, type TrendingPlaybooksDir, type TrendingPlaybooksParams, type TrendingPlaybooksResponse, type TrendingPlaybooksSort, UDF_AUTH_REQUIRED_MESSAGE, UDF_CONSENT_REQUEST_MESSAGE, UDF_CONSENT_RESPONSE_MESSAGE, type UdfApi, UdfAuthRequiredError, type UdfButtonEventDetail, type UdfButtonOptions, UdfConsentDeniedError, UdfConsentRequiredError, UdfConsentTimeoutError, type UdfDescriptor, UdfError, UdfExecutionError, UdfFunctionDisabledError, UdfFunctionNotFoundError, UdfInsufficientCredits, type UdfInvokeResponse, UdfPidMismatchError, UdfRateLimitedError, UdfTokenExpiredError, UdfTokenInvalidError, UdfTransportError, VERSION, getViewerToken, installPlaybookRuntime, mapUdfErrorResponse, playbookIdFromToken, udf };
|
package/dist/index.js
CHANGED
|
@@ -1652,6 +1652,17 @@ function metadataSummaryForSkill(skill) {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
|
|
1654
1654
|
// src/resources/playbookSkills.ts
|
|
1655
|
+
function normalizePlaybookSkillSummary(raw) {
|
|
1656
|
+
return {
|
|
1657
|
+
username: raw.username,
|
|
1658
|
+
name: raw.name,
|
|
1659
|
+
display_name: raw.display_name,
|
|
1660
|
+
description: raw.description,
|
|
1661
|
+
tags: raw.tags,
|
|
1662
|
+
creator_uid: raw.creator_uid,
|
|
1663
|
+
updated_at: raw.updated_at
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1655
1666
|
function parsePlaybookSkillId(s) {
|
|
1656
1667
|
const parts = s.split("/");
|
|
1657
1668
|
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
@@ -1675,7 +1686,7 @@ var PlaybookSkillsResource = class {
|
|
|
1675
1686
|
const res = await this.client._request("GET", "/api/v1/skills", {
|
|
1676
1687
|
query
|
|
1677
1688
|
});
|
|
1678
|
-
return { skills: res.data ?? [] };
|
|
1689
|
+
return { skills: (res.data ?? []).map(normalizePlaybookSkillSummary) };
|
|
1679
1690
|
}
|
|
1680
1691
|
async tags() {
|
|
1681
1692
|
const res = await this.client._request(
|
|
@@ -1700,7 +1711,10 @@ var PlaybookSkillsResource = class {
|
|
|
1700
1711
|
0
|
|
1701
1712
|
);
|
|
1702
1713
|
}
|
|
1703
|
-
return
|
|
1714
|
+
return {
|
|
1715
|
+
...normalizePlaybookSkillSummary(meta),
|
|
1716
|
+
files: meta.files ?? []
|
|
1717
|
+
};
|
|
1704
1718
|
}
|
|
1705
1719
|
async file(id, path) {
|
|
1706
1720
|
const { username, name } = parsePlaybookSkillId(id);
|
|
@@ -2011,66 +2025,56 @@ var NotificationPreferencesResource = class {
|
|
|
2011
2025
|
}
|
|
2012
2026
|
};
|
|
2013
2027
|
|
|
2014
|
-
// src/resources/
|
|
2015
|
-
var
|
|
2028
|
+
// src/resources/subscriptions.ts
|
|
2029
|
+
var SubscriptionsResource = class {
|
|
2016
2030
|
constructor(client) {
|
|
2017
2031
|
this.client = client;
|
|
2018
2032
|
}
|
|
2019
2033
|
client;
|
|
2020
2034
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2023
|
-
*
|
|
2024
|
-
*
|
|
2035
|
+
* Subscribe to a playbook `(username, name)`: follow it and enable alerts
|
|
2036
|
+
* on all its push-enabled automations. Idempotent. Auth: the caller must be
|
|
2037
|
+
* able to read the playbook — public passes; paid requires an active unlock;
|
|
2038
|
+
* private requires owner/admin.
|
|
2025
2039
|
*/
|
|
2026
2040
|
async subscribePlaybook(params) {
|
|
2027
2041
|
this.client._requireAuth();
|
|
2028
|
-
const path = `/api/v1/
|
|
2042
|
+
const path = `/api/v1/subscriptions/playbook/${encodeURIComponent(params.username)}/${encodeURIComponent(params.name)}`;
|
|
2029
2043
|
return this.client._request(
|
|
2030
2044
|
"POST",
|
|
2031
2045
|
path
|
|
2032
2046
|
);
|
|
2033
2047
|
}
|
|
2034
2048
|
/**
|
|
2035
|
-
*
|
|
2036
|
-
*
|
|
2049
|
+
* Unsubscribe from a playbook `(username, name)`: unfollow it and disable
|
|
2050
|
+
* all of its push alerts for the caller. Idempotent.
|
|
2037
2051
|
*/
|
|
2038
2052
|
async unsubscribePlaybook(params) {
|
|
2039
2053
|
this.client._requireAuth();
|
|
2040
|
-
const path = `/api/v1/
|
|
2041
|
-
return this.client._request(
|
|
2042
|
-
"DELETE",
|
|
2043
|
-
path
|
|
2044
|
-
);
|
|
2054
|
+
const path = `/api/v1/subscriptions/playbook/${encodeURIComponent(params.username)}/${encodeURIComponent(params.name)}`;
|
|
2055
|
+
return this.client._request("DELETE", path);
|
|
2045
2056
|
}
|
|
2046
2057
|
/**
|
|
2047
|
-
*
|
|
2048
|
-
*
|
|
2049
|
-
*
|
|
2050
|
-
* push per playbook context. Idempotent.
|
|
2058
|
+
* Subscribe to one feed `(username, name)` — enable personal push for that
|
|
2059
|
+
* single automation's alerts, regardless of which playbook(s) consume it.
|
|
2060
|
+
* Does NOT follow any playbook. Idempotent.
|
|
2051
2061
|
*/
|
|
2052
2062
|
async subscribeFeed(params) {
|
|
2053
2063
|
this.client._requireAuth();
|
|
2054
|
-
const path = `/api/v1/
|
|
2055
|
-
return this.client._request(
|
|
2056
|
-
"POST",
|
|
2057
|
-
path
|
|
2058
|
-
);
|
|
2064
|
+
const path = `/api/v1/subscriptions/feed/${encodeURIComponent(params.username)}/${encodeURIComponent(params.name)}`;
|
|
2065
|
+
return this.client._request("POST", path);
|
|
2059
2066
|
}
|
|
2060
2067
|
/**
|
|
2061
|
-
*
|
|
2062
|
-
* Idempotent.
|
|
2068
|
+
* Unsubscribe from one feed `(username, name)` — disable that automation's
|
|
2069
|
+
* alerts for the caller. Idempotent.
|
|
2063
2070
|
*/
|
|
2064
2071
|
async unsubscribeFeed(params) {
|
|
2065
2072
|
this.client._requireAuth();
|
|
2066
|
-
const path = `/api/v1/
|
|
2067
|
-
return this.client._request(
|
|
2068
|
-
"DELETE",
|
|
2069
|
-
path
|
|
2070
|
-
);
|
|
2073
|
+
const path = `/api/v1/subscriptions/feed/${encodeURIComponent(params.username)}/${encodeURIComponent(params.name)}`;
|
|
2074
|
+
return this.client._request("DELETE", path);
|
|
2071
2075
|
}
|
|
2072
2076
|
/**
|
|
2073
|
-
* List the caller's currently active
|
|
2077
|
+
* List the caller's currently active subscriptions.
|
|
2074
2078
|
* Results are cursor-paginated.
|
|
2075
2079
|
*/
|
|
2076
2080
|
async list(params = {}) {
|
|
@@ -2080,7 +2084,7 @@ var PushSubscriptionsResource = class {
|
|
|
2080
2084
|
query.first = String(params.first);
|
|
2081
2085
|
}
|
|
2082
2086
|
if (params.cursor) query.cursor = params.cursor;
|
|
2083
|
-
return this.client._request("GET", "/api/v1/me/
|
|
2087
|
+
return this.client._request("GET", "/api/v1/me/subscriptions", {
|
|
2084
2088
|
query
|
|
2085
2089
|
});
|
|
2086
2090
|
}
|
|
@@ -2149,6 +2153,20 @@ function idLiteral(value) {
|
|
|
2149
2153
|
return value;
|
|
2150
2154
|
}
|
|
2151
2155
|
|
|
2156
|
+
// src/resources/feedback.ts
|
|
2157
|
+
var FeedbackResource = class {
|
|
2158
|
+
constructor(client) {
|
|
2159
|
+
this.client = client;
|
|
2160
|
+
}
|
|
2161
|
+
client;
|
|
2162
|
+
async submit(params) {
|
|
2163
|
+
this.client._requireAuth();
|
|
2164
|
+
return this.client._request("POST", "/api/v1/feedback", {
|
|
2165
|
+
body: params
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2152
2170
|
// src/client.ts
|
|
2153
2171
|
var DEFAULT_BASE_URL = "https://api-llm.prd.alva.ai";
|
|
2154
2172
|
var DEFAULT_ARRAYS_BASE_URL = "https://data-tools.prd.space.id";
|
|
@@ -2180,8 +2198,9 @@ var AlvaClient = class {
|
|
|
2180
2198
|
_arraysJwt;
|
|
2181
2199
|
_notifications;
|
|
2182
2200
|
_notificationPreferences;
|
|
2183
|
-
|
|
2201
|
+
_subscriptions;
|
|
2184
2202
|
_channelGroupSubscriptions;
|
|
2203
|
+
_feedback;
|
|
2185
2204
|
constructor(config) {
|
|
2186
2205
|
this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
2187
2206
|
this.arraysBaseUrl = config.arraysBaseUrl ?? DEFAULT_ARRAYS_BASE_URL;
|
|
@@ -2249,12 +2268,15 @@ var AlvaClient = class {
|
|
|
2249
2268
|
get notificationPreferences() {
|
|
2250
2269
|
return this._notificationPreferences ??= new NotificationPreferencesResource(this);
|
|
2251
2270
|
}
|
|
2252
|
-
get
|
|
2253
|
-
return this.
|
|
2271
|
+
get subscriptions() {
|
|
2272
|
+
return this._subscriptions ??= new SubscriptionsResource(this);
|
|
2254
2273
|
}
|
|
2255
2274
|
get channelGroupSubscriptions() {
|
|
2256
2275
|
return this._channelGroupSubscriptions ??= new ChannelGroupSubscriptionsResource(this);
|
|
2257
2276
|
}
|
|
2277
|
+
get feedback() {
|
|
2278
|
+
return this._feedback ??= new FeedbackResource(this);
|
|
2279
|
+
}
|
|
2258
2280
|
_requireAuth() {
|
|
2259
2281
|
if (!this.pbsvToken && !this.viewer_token && !this.apiKey) {
|
|
2260
2282
|
throw new AlvaError(
|
|
@@ -2739,7 +2761,7 @@ var installPlaybookRuntime = (targetWindow) => {
|
|
|
2739
2761
|
};
|
|
2740
2762
|
|
|
2741
2763
|
// src/index.ts
|
|
2742
|
-
var VERSION = true ? "0.
|
|
2764
|
+
var VERSION = true ? "0.11.1" : "dev";
|
|
2743
2765
|
export {
|
|
2744
2766
|
AlvaClient,
|
|
2745
2767
|
AlvaError,
|