@alva-ai/toolkit 0.9.5 → 0.11.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/README.md +2 -2
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.js +78 -80
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +42 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -33
- package/dist/index.d.ts +43 -33
- package/dist/index.js +42 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -626,17 +626,27 @@ interface PushSubscriptionListResponse {
|
|
|
626
626
|
/** Empty when there is no next page. */
|
|
627
627
|
next_cursor?: string;
|
|
628
628
|
}
|
|
629
|
-
interface
|
|
630
|
-
|
|
629
|
+
interface PlaybookFollow {
|
|
630
|
+
id: string;
|
|
631
|
+
user_id: string;
|
|
632
|
+
playbook_id: string;
|
|
633
|
+
created_at_ms: number;
|
|
634
|
+
updated_at_ms: number;
|
|
635
|
+
}
|
|
636
|
+
interface SubscribePlaybookResponse {
|
|
637
|
+
/** The follow row created (or confirmed) by the cascade subscribe. */
|
|
638
|
+
follow: PlaybookFollow;
|
|
639
|
+
/** Feed ids whose alert this subscribe enabled (push-enabled automations). */
|
|
640
|
+
subscribed_feed_ids: string[];
|
|
631
641
|
/** Canonical alfs path: `/alva/home/<username>/playbooks/<name>`. */
|
|
632
642
|
playbook_path: string;
|
|
633
643
|
}
|
|
634
|
-
interface
|
|
644
|
+
interface SubscribeFeedResponse {
|
|
635
645
|
subscription: PushSubscription;
|
|
636
646
|
/** Canonical alfs path: `/alva/home/<username>/feeds/<name>`. */
|
|
637
647
|
feed_path: string;
|
|
638
648
|
}
|
|
639
|
-
interface
|
|
649
|
+
interface UnsubscribeResponse {
|
|
640
650
|
ok: true;
|
|
641
651
|
}
|
|
642
652
|
type ChannelGroupSubscriptionTargetType = 'feed' | 'playbook';
|
|
@@ -948,6 +958,7 @@ declare class DataSkillsResource {
|
|
|
948
958
|
interface PlaybookSkillSummary {
|
|
949
959
|
username: string;
|
|
950
960
|
name: string;
|
|
961
|
+
display_name: string;
|
|
951
962
|
description: string;
|
|
952
963
|
tags: string[];
|
|
953
964
|
creator_uid: number;
|
|
@@ -1110,46 +1121,45 @@ declare class NotificationPreferencesResource {
|
|
|
1110
1121
|
}
|
|
1111
1122
|
|
|
1112
1123
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
* DM/web push for a target. Independent of social follow:
|
|
1124
|
+
* Subscriptions — subscribe the caller to playbooks and feeds.
|
|
1115
1125
|
*
|
|
1116
|
-
* - `subscribePlaybook`
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1126
|
+
* - `subscribePlaybook` is a CASCADE: it follows the playbook AND enables
|
|
1127
|
+
* personal push for every push-enabled automation of its latest release,
|
|
1128
|
+
* in one call. `unsubscribePlaybook` reverses both (unfollow + disable
|
|
1129
|
+
* all of the playbook's push alerts).
|
|
1130
|
+
* - `subscribeFeed` / `unsubscribeFeed` toggle personal push for ONE feed
|
|
1131
|
+
* (a single automation's alert) without touching the playbook follow.
|
|
1120
1132
|
*
|
|
1121
|
-
* Backed by alva-gateway REST
|
|
1122
|
-
* `pkg/schema/push_subscription.graphql`).
|
|
1133
|
+
* Backed by alva-gateway REST under `/api/v1/subscriptions/...`.
|
|
1123
1134
|
*/
|
|
1124
|
-
declare class
|
|
1135
|
+
declare class SubscriptionsResource {
|
|
1125
1136
|
private client;
|
|
1126
1137
|
constructor(client: AlvaClient);
|
|
1127
1138
|
/**
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1139
|
+
* Subscribe to a playbook `(username, name)`: follow it and enable alerts
|
|
1140
|
+
* on all its push-enabled automations. Idempotent. Auth: the caller must be
|
|
1141
|
+
* able to read the playbook — public passes; paid requires an active unlock;
|
|
1142
|
+
* private requires owner/admin.
|
|
1132
1143
|
*/
|
|
1133
|
-
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1144
|
+
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<SubscribePlaybookResponse>;
|
|
1134
1145
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1146
|
+
* Unsubscribe from a playbook `(username, name)`: unfollow it and disable
|
|
1147
|
+
* all of its push alerts for the caller. Idempotent.
|
|
1137
1148
|
*/
|
|
1138
|
-
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1149
|
+
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<UnsubscribeResponse>;
|
|
1139
1150
|
/**
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
* push per playbook context. Idempotent.
|
|
1151
|
+
* Subscribe to one feed `(username, name)` — enable personal push for that
|
|
1152
|
+
* single automation's alerts, regardless of which playbook(s) consume it.
|
|
1153
|
+
* Does NOT follow any playbook. Idempotent.
|
|
1144
1154
|
*/
|
|
1145
|
-
subscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1155
|
+
subscribeFeed(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
|
|
1146
1156
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
* Idempotent.
|
|
1157
|
+
* Unsubscribe from one feed `(username, name)` — disable that automation's
|
|
1158
|
+
* alerts for the caller. Idempotent.
|
|
1149
1159
|
*/
|
|
1150
|
-
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1160
|
+
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
|
|
1151
1161
|
/**
|
|
1152
|
-
* List the caller's currently active
|
|
1162
|
+
* List the caller's currently active subscriptions.
|
|
1153
1163
|
* Results are cursor-paginated.
|
|
1154
1164
|
*/
|
|
1155
1165
|
list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
|
|
@@ -1211,7 +1221,7 @@ declare class AlvaClient {
|
|
|
1211
1221
|
private _arraysJwt?;
|
|
1212
1222
|
private _notifications?;
|
|
1213
1223
|
private _notificationPreferences?;
|
|
1214
|
-
private
|
|
1224
|
+
private _subscriptions?;
|
|
1215
1225
|
private _channelGroupSubscriptions?;
|
|
1216
1226
|
constructor(config: AlvaClientConfig);
|
|
1217
1227
|
get fs(): FsResource;
|
|
@@ -1233,7 +1243,7 @@ declare class AlvaClient {
|
|
|
1233
1243
|
get arraysJwt(): ArraysJwtResource;
|
|
1234
1244
|
get notifications(): NotificationsResource;
|
|
1235
1245
|
get notificationPreferences(): NotificationPreferencesResource;
|
|
1236
|
-
get
|
|
1246
|
+
get subscriptions(): SubscriptionsResource;
|
|
1237
1247
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1238
1248
|
_requireAuth(): void;
|
|
1239
1249
|
_request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
|
|
@@ -1360,4 +1370,4 @@ declare const installPlaybookRuntime: (targetWindow?: Window) => void;
|
|
|
1360
1370
|
/** SDK version, injected at build time from package.json. */
|
|
1361
1371
|
declare const VERSION: string;
|
|
1362
1372
|
|
|
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 };
|
|
1373
|
+
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 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
|
@@ -626,17 +626,27 @@ interface PushSubscriptionListResponse {
|
|
|
626
626
|
/** Empty when there is no next page. */
|
|
627
627
|
next_cursor?: string;
|
|
628
628
|
}
|
|
629
|
-
interface
|
|
630
|
-
|
|
629
|
+
interface PlaybookFollow {
|
|
630
|
+
id: string;
|
|
631
|
+
user_id: string;
|
|
632
|
+
playbook_id: string;
|
|
633
|
+
created_at_ms: number;
|
|
634
|
+
updated_at_ms: number;
|
|
635
|
+
}
|
|
636
|
+
interface SubscribePlaybookResponse {
|
|
637
|
+
/** The follow row created (or confirmed) by the cascade subscribe. */
|
|
638
|
+
follow: PlaybookFollow;
|
|
639
|
+
/** Feed ids whose alert this subscribe enabled (push-enabled automations). */
|
|
640
|
+
subscribed_feed_ids: string[];
|
|
631
641
|
/** Canonical alfs path: `/alva/home/<username>/playbooks/<name>`. */
|
|
632
642
|
playbook_path: string;
|
|
633
643
|
}
|
|
634
|
-
interface
|
|
644
|
+
interface SubscribeFeedResponse {
|
|
635
645
|
subscription: PushSubscription;
|
|
636
646
|
/** Canonical alfs path: `/alva/home/<username>/feeds/<name>`. */
|
|
637
647
|
feed_path: string;
|
|
638
648
|
}
|
|
639
|
-
interface
|
|
649
|
+
interface UnsubscribeResponse {
|
|
640
650
|
ok: true;
|
|
641
651
|
}
|
|
642
652
|
type ChannelGroupSubscriptionTargetType = 'feed' | 'playbook';
|
|
@@ -948,6 +958,7 @@ declare class DataSkillsResource {
|
|
|
948
958
|
interface PlaybookSkillSummary {
|
|
949
959
|
username: string;
|
|
950
960
|
name: string;
|
|
961
|
+
display_name: string;
|
|
951
962
|
description: string;
|
|
952
963
|
tags: string[];
|
|
953
964
|
creator_uid: number;
|
|
@@ -1110,46 +1121,45 @@ declare class NotificationPreferencesResource {
|
|
|
1110
1121
|
}
|
|
1111
1122
|
|
|
1112
1123
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
* DM/web push for a target. Independent of social follow:
|
|
1124
|
+
* Subscriptions — subscribe the caller to playbooks and feeds.
|
|
1115
1125
|
*
|
|
1116
|
-
* - `subscribePlaybook`
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1126
|
+
* - `subscribePlaybook` is a CASCADE: it follows the playbook AND enables
|
|
1127
|
+
* personal push for every push-enabled automation of its latest release,
|
|
1128
|
+
* in one call. `unsubscribePlaybook` reverses both (unfollow + disable
|
|
1129
|
+
* all of the playbook's push alerts).
|
|
1130
|
+
* - `subscribeFeed` / `unsubscribeFeed` toggle personal push for ONE feed
|
|
1131
|
+
* (a single automation's alert) without touching the playbook follow.
|
|
1120
1132
|
*
|
|
1121
|
-
* Backed by alva-gateway REST
|
|
1122
|
-
* `pkg/schema/push_subscription.graphql`).
|
|
1133
|
+
* Backed by alva-gateway REST under `/api/v1/subscriptions/...`.
|
|
1123
1134
|
*/
|
|
1124
|
-
declare class
|
|
1135
|
+
declare class SubscriptionsResource {
|
|
1125
1136
|
private client;
|
|
1126
1137
|
constructor(client: AlvaClient);
|
|
1127
1138
|
/**
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1139
|
+
* Subscribe to a playbook `(username, name)`: follow it and enable alerts
|
|
1140
|
+
* on all its push-enabled automations. Idempotent. Auth: the caller must be
|
|
1141
|
+
* able to read the playbook — public passes; paid requires an active unlock;
|
|
1142
|
+
* private requires owner/admin.
|
|
1132
1143
|
*/
|
|
1133
|
-
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1144
|
+
subscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<SubscribePlaybookResponse>;
|
|
1134
1145
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1146
|
+
* Unsubscribe from a playbook `(username, name)`: unfollow it and disable
|
|
1147
|
+
* all of its push alerts for the caller. Idempotent.
|
|
1137
1148
|
*/
|
|
1138
|
-
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<
|
|
1149
|
+
unsubscribePlaybook(params: PushSubscriptionPlaybookParams): Promise<UnsubscribeResponse>;
|
|
1139
1150
|
/**
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
* push per playbook context. Idempotent.
|
|
1151
|
+
* Subscribe to one feed `(username, name)` — enable personal push for that
|
|
1152
|
+
* single automation's alerts, regardless of which playbook(s) consume it.
|
|
1153
|
+
* Does NOT follow any playbook. Idempotent.
|
|
1144
1154
|
*/
|
|
1145
|
-
subscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1155
|
+
subscribeFeed(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
|
|
1146
1156
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
* Idempotent.
|
|
1157
|
+
* Unsubscribe from one feed `(username, name)` — disable that automation's
|
|
1158
|
+
* alerts for the caller. Idempotent.
|
|
1149
1159
|
*/
|
|
1150
|
-
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<
|
|
1160
|
+
unsubscribeFeed(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
|
|
1151
1161
|
/**
|
|
1152
|
-
* List the caller's currently active
|
|
1162
|
+
* List the caller's currently active subscriptions.
|
|
1153
1163
|
* Results are cursor-paginated.
|
|
1154
1164
|
*/
|
|
1155
1165
|
list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
|
|
@@ -1211,7 +1221,7 @@ declare class AlvaClient {
|
|
|
1211
1221
|
private _arraysJwt?;
|
|
1212
1222
|
private _notifications?;
|
|
1213
1223
|
private _notificationPreferences?;
|
|
1214
|
-
private
|
|
1224
|
+
private _subscriptions?;
|
|
1215
1225
|
private _channelGroupSubscriptions?;
|
|
1216
1226
|
constructor(config: AlvaClientConfig);
|
|
1217
1227
|
get fs(): FsResource;
|
|
@@ -1233,7 +1243,7 @@ declare class AlvaClient {
|
|
|
1233
1243
|
get arraysJwt(): ArraysJwtResource;
|
|
1234
1244
|
get notifications(): NotificationsResource;
|
|
1235
1245
|
get notificationPreferences(): NotificationPreferencesResource;
|
|
1236
|
-
get
|
|
1246
|
+
get subscriptions(): SubscriptionsResource;
|
|
1237
1247
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1238
1248
|
_requireAuth(): void;
|
|
1239
1249
|
_request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
|
|
@@ -1360,4 +1370,4 @@ declare const installPlaybookRuntime: (targetWindow?: Window) => void;
|
|
|
1360
1370
|
/** SDK version, injected at build time from package.json. */
|
|
1361
1371
|
declare const VERSION: string;
|
|
1362
1372
|
|
|
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 };
|
|
1373
|
+
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 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
|
}
|
|
@@ -2180,7 +2184,7 @@ var AlvaClient = class {
|
|
|
2180
2184
|
_arraysJwt;
|
|
2181
2185
|
_notifications;
|
|
2182
2186
|
_notificationPreferences;
|
|
2183
|
-
|
|
2187
|
+
_subscriptions;
|
|
2184
2188
|
_channelGroupSubscriptions;
|
|
2185
2189
|
constructor(config) {
|
|
2186
2190
|
this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
@@ -2249,8 +2253,8 @@ var AlvaClient = class {
|
|
|
2249
2253
|
get notificationPreferences() {
|
|
2250
2254
|
return this._notificationPreferences ??= new NotificationPreferencesResource(this);
|
|
2251
2255
|
}
|
|
2252
|
-
get
|
|
2253
|
-
return this.
|
|
2256
|
+
get subscriptions() {
|
|
2257
|
+
return this._subscriptions ??= new SubscriptionsResource(this);
|
|
2254
2258
|
}
|
|
2255
2259
|
get channelGroupSubscriptions() {
|
|
2256
2260
|
return this._channelGroupSubscriptions ??= new ChannelGroupSubscriptionsResource(this);
|
|
@@ -2739,7 +2743,7 @@ var installPlaybookRuntime = (targetWindow) => {
|
|
|
2739
2743
|
};
|
|
2740
2744
|
|
|
2741
2745
|
// src/index.ts
|
|
2742
|
-
var VERSION = true ? "0.
|
|
2746
|
+
var VERSION = true ? "0.11.0" : "dev";
|
|
2743
2747
|
export {
|
|
2744
2748
|
AlvaClient,
|
|
2745
2749
|
AlvaError,
|