@shadowob/sdk 1.1.6-dev.331 → 1.1.7
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/index.cjs +18 -0
- package/dist/index.d.cts +51 -4
- package/dist/index.d.ts +51 -4
- package/dist/index.js +18 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -384,6 +384,24 @@ var ShadowClient = class {
|
|
|
384
384
|
}
|
|
385
385
|
);
|
|
386
386
|
}
|
|
387
|
+
async updateServerAppAccessPolicy(serverIdOrSlug, appKey, data) {
|
|
388
|
+
return this.request(
|
|
389
|
+
`/api/servers/${serverIdOrSlug}/apps/${encodeURIComponent(appKey)}/access-policy`,
|
|
390
|
+
{
|
|
391
|
+
method: "PATCH",
|
|
392
|
+
body: JSON.stringify(data)
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
async approveServerAppCommand(serverIdOrSlug, appKey, data) {
|
|
397
|
+
return this.request(
|
|
398
|
+
`/api/servers/${serverIdOrSlug}/apps/${encodeURIComponent(appKey)}/approvals`,
|
|
399
|
+
{
|
|
400
|
+
method: "POST",
|
|
401
|
+
body: JSON.stringify(data)
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
}
|
|
387
405
|
async getServerAppSkills(serverIdOrSlug, appKey) {
|
|
388
406
|
return this.request(`/api/servers/${serverIdOrSlug}/apps/${encodeURIComponent(appKey)}/skills`);
|
|
389
407
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -124,6 +124,7 @@ interface ShadowSignedMediaUrl {
|
|
|
124
124
|
type ShadowMediaVariant = 'avatar' | 'preview' | 'banner';
|
|
125
125
|
type ShadowServerAppAction = 'read' | 'write' | 'manage' | 'delete' | 'generate';
|
|
126
126
|
type ShadowServerAppDataClass = 'public' | 'server-private' | 'channel-private' | 'financial' | 'secret' | 'cloud-secret';
|
|
127
|
+
type ShadowServerAppApprovalMode = 'none' | 'first_time' | 'every_time' | 'policy';
|
|
127
128
|
interface ShadowServerAppCommand {
|
|
128
129
|
name: string;
|
|
129
130
|
title?: string;
|
|
@@ -135,7 +136,7 @@ interface ShadowServerAppCommand {
|
|
|
135
136
|
permission: string;
|
|
136
137
|
action: ShadowServerAppAction;
|
|
137
138
|
dataClass: ShadowServerAppDataClass;
|
|
138
|
-
approvalMode?:
|
|
139
|
+
approvalMode?: ShadowServerAppApprovalMode;
|
|
139
140
|
binary?: {
|
|
140
141
|
supported?: boolean;
|
|
141
142
|
field?: string;
|
|
@@ -160,6 +161,10 @@ interface ShadowServerAppManifest {
|
|
|
160
161
|
type: 'oauth2-bearer';
|
|
161
162
|
};
|
|
162
163
|
};
|
|
164
|
+
access?: {
|
|
165
|
+
defaultPermissions?: string[];
|
|
166
|
+
defaultApprovalMode?: ShadowServerAppApprovalMode;
|
|
167
|
+
};
|
|
163
168
|
commands: ShadowServerAppCommand[];
|
|
164
169
|
skills?: Array<{
|
|
165
170
|
name: string;
|
|
@@ -185,6 +190,8 @@ interface ShadowServerAppIntegration {
|
|
|
185
190
|
iframeEntry?: string | null;
|
|
186
191
|
allowedOrigins: string[];
|
|
187
192
|
apiBaseUrl: string;
|
|
193
|
+
defaultPermissions: string[];
|
|
194
|
+
defaultApprovalMode: ShadowServerAppApprovalMode;
|
|
188
195
|
status: string;
|
|
189
196
|
installedByUserId: string;
|
|
190
197
|
createdAt: string;
|
|
@@ -200,9 +207,35 @@ interface ShadowServerAppDiscovery {
|
|
|
200
207
|
permission: string;
|
|
201
208
|
action: ShadowServerAppAction;
|
|
202
209
|
dataClass: ShadowServerAppDataClass;
|
|
203
|
-
approvalMode:
|
|
210
|
+
approvalMode: ShadowServerAppApprovalMode;
|
|
204
211
|
}>;
|
|
205
212
|
}
|
|
213
|
+
interface ShadowServerAppCommandApproval {
|
|
214
|
+
appKey: string;
|
|
215
|
+
appName: string;
|
|
216
|
+
commandName: string;
|
|
217
|
+
commandTitle: string;
|
|
218
|
+
commandDescription?: string | null;
|
|
219
|
+
permission: string;
|
|
220
|
+
action: ShadowServerAppAction;
|
|
221
|
+
dataClass: ShadowServerAppDataClass;
|
|
222
|
+
actorKind: string;
|
|
223
|
+
subjectKind: 'user' | 'buddy';
|
|
224
|
+
buddyAgentId?: string | null;
|
|
225
|
+
approvalMode: ShadowServerAppApprovalMode;
|
|
226
|
+
reason: 'not_default' | 'first_time' | 'every_time' | 'restricted' | 'policy';
|
|
227
|
+
}
|
|
228
|
+
interface ShadowServerAppCommandConsent {
|
|
229
|
+
id: string;
|
|
230
|
+
serverAppId: string;
|
|
231
|
+
appKey: string;
|
|
232
|
+
command: string;
|
|
233
|
+
permission: string;
|
|
234
|
+
subjectKind: 'user' | 'buddy';
|
|
235
|
+
subjectUserId?: string | null;
|
|
236
|
+
buddyAgentId?: string | null;
|
|
237
|
+
expiresAt?: string | null;
|
|
238
|
+
}
|
|
206
239
|
interface ShadowServerAppCatalogEntry {
|
|
207
240
|
id: string;
|
|
208
241
|
appKey: string;
|
|
@@ -2031,9 +2064,23 @@ declare class ShadowClient {
|
|
|
2031
2064
|
buddyAgentId: string;
|
|
2032
2065
|
permissions: string[];
|
|
2033
2066
|
resourceRules?: Record<string, unknown>;
|
|
2034
|
-
approvalMode?:
|
|
2067
|
+
approvalMode?: ShadowServerAppApprovalMode;
|
|
2035
2068
|
expiresAt?: string;
|
|
2036
2069
|
}): Promise<Record<string, unknown>>;
|
|
2070
|
+
updateServerAppAccessPolicy(serverIdOrSlug: string, appKey: string, data: {
|
|
2071
|
+
defaultPermissions: string[];
|
|
2072
|
+
defaultApprovalMode?: ShadowServerAppApprovalMode;
|
|
2073
|
+
}): Promise<ShadowServerAppIntegration & {
|
|
2074
|
+
grants?: Record<string, unknown>[];
|
|
2075
|
+
}>;
|
|
2076
|
+
approveServerAppCommand(serverIdOrSlug: string, appKey: string, data: {
|
|
2077
|
+
commandName: string;
|
|
2078
|
+
buddyAgentId?: string;
|
|
2079
|
+
remember?: boolean;
|
|
2080
|
+
}): Promise<{
|
|
2081
|
+
ok: true;
|
|
2082
|
+
consent: ShadowServerAppCommandConsent;
|
|
2083
|
+
}>;
|
|
2037
2084
|
getServerAppSkills(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppSkillDocument>;
|
|
2038
2085
|
createServerAppLaunch(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppLaunchContext>;
|
|
2039
2086
|
introspectServerAppToken(serverIdOrSlug: string, appKey: string, token: string): Promise<ShadowServerAppTokenIntrospection>;
|
|
@@ -3183,4 +3230,4 @@ declare class ShadowVoiceConsumer {
|
|
|
3183
3230
|
private renewTokens;
|
|
3184
3231
|
}
|
|
3185
3232
|
|
|
3186
|
-
export { type ChannelCreatedPayload, type ChannelMemberAddedPayload, type ChannelMemberRemovedPayload, type ClientEventMap, type MemberJoinPayload, type MemberLeavePayload, type MessageDeletedPayload, type PolicyChangedPayload, type PresenceActivityPayload, type PresenceChangePayload, type ReactionPayload, type ServerEventMap, type ServerJoinedPayload, type ShadowAddAgentsToServerResult, type ShadowAgentUsageSnapshotInput, type ShadowAttachment, type ShadowCartItem, type ShadowCategory, type ShadowChannel, type ShadowChannelAccess, type ShadowChannelBootstrap, type ShadowChannelJoinRequestResult, type ShadowChannelJoinRequestStatus, type ShadowChannelPolicy, type ShadowChannelSlashCommand, ShadowClient, type ShadowCloudDeploymentBackup, type ShadowCloudDeploymentRuntimeResponse, type ShadowCloudDeploymentStatus, type ShadowCloudProviderCatalog, type ShadowCloudProviderEnvVar, type ShadowCloudProviderModel, type ShadowCloudProviderProfile, type ShadowCommerceCheckoutPreview, type ShadowCommerceProductCard, type ShadowCommerceProductContext, type ShadowCommerceProductPickerGroup, type ShadowCommerceProductPickerResponse, type ShadowCommunityAsset, type ShadowCommunityAssetDefinition, type ShadowCommunityAssetGrant, type ShadowContract, type ShadowDiyCloudRun, type ShadowDiyCloudRunEvent, type ShadowDiyCloudRunStatus, type ShadowFriendship, type ShadowInteractiveActionInput, type ShadowInteractiveActionResult, type ShadowInteractiveBlock, type ShadowInteractiveResponse, type ShadowInteractiveState, type ShadowInteractiveSubmissionPending, type ShadowInviteCode, type ShadowListing, type ShadowMediaVariant, type ShadowMember, type ShadowMentionSuggestion, type ShadowMentionSuggestionTrigger, type ShadowMessage, type ShadowMessageMention, type ShadowModelProxyBilling, type ShadowModelProxyChatCompletionRequest, type ShadowModelProxyChatCompletionResponse, type ShadowModelProxyModel, type ShadowModelProxyModelsResponse, type ShadowNotification, type ShadowNotificationPreferences, type ShadowOAuthApp, type ShadowOAuthCommerceEntitlementAccess, type ShadowOAuthCommerceEntitlementRedeemInput, type ShadowOAuthCommerceEntitlementRedeemResult, type ShadowOAuthCommerceEntitlementRedemption, type ShadowOAuthCommerceEntitlementSummary, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowPaidFileOpenResult, type ShadowProduct, type ShadowProductEntitlementConfig, type ShadowProductMedia, type ShadowProductSku, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowServerAccess, type ShadowServerAppCatalogEntry, type ShadowServerAppCommand, type ShadowServerAppDiscovery, type ShadowServerAppIntegration, type ShadowServerAppLaunchContext, type ShadowServerAppManifest, type ShadowServerAppSkillDocument, type ShadowServerAppTokenIntrospection, type ShadowServerJoinRequestResult, type ShadowServerJoinRequestStatus, type ShadowSettlementLine, type ShadowShop, type ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUsageProviderSnapshot, type ShadowUser, ShadowVoiceConsumer, type ShadowVoiceConsumerOptions, type ShadowVoiceCredentials, type ShadowVoiceJoinResult, type ShadowVoiceLeaveResult, type ShadowVoiceParticipant, type ShadowVoicePolicy, type ShadowVoiceState, type ShadowWallet, type TypingPayload, type VoiceParticipantPayload, type VoicePolicyUpdatedPayload, channelRoom, threadRoom, userRoom };
|
|
3233
|
+
export { type ChannelCreatedPayload, type ChannelMemberAddedPayload, type ChannelMemberRemovedPayload, type ClientEventMap, type MemberJoinPayload, type MemberLeavePayload, type MessageDeletedPayload, type PolicyChangedPayload, type PresenceActivityPayload, type PresenceChangePayload, type ReactionPayload, type ServerEventMap, type ServerJoinedPayload, type ShadowAddAgentsToServerResult, type ShadowAgentUsageSnapshotInput, type ShadowAttachment, type ShadowCartItem, type ShadowCategory, type ShadowChannel, type ShadowChannelAccess, type ShadowChannelBootstrap, type ShadowChannelJoinRequestResult, type ShadowChannelJoinRequestStatus, type ShadowChannelPolicy, type ShadowChannelSlashCommand, ShadowClient, type ShadowCloudDeploymentBackup, type ShadowCloudDeploymentRuntimeResponse, type ShadowCloudDeploymentStatus, type ShadowCloudProviderCatalog, type ShadowCloudProviderEnvVar, type ShadowCloudProviderModel, type ShadowCloudProviderProfile, type ShadowCommerceCheckoutPreview, type ShadowCommerceProductCard, type ShadowCommerceProductContext, type ShadowCommerceProductPickerGroup, type ShadowCommerceProductPickerResponse, type ShadowCommunityAsset, type ShadowCommunityAssetDefinition, type ShadowCommunityAssetGrant, type ShadowContract, type ShadowDiyCloudRun, type ShadowDiyCloudRunEvent, type ShadowDiyCloudRunStatus, type ShadowFriendship, type ShadowInteractiveActionInput, type ShadowInteractiveActionResult, type ShadowInteractiveBlock, type ShadowInteractiveResponse, type ShadowInteractiveState, type ShadowInteractiveSubmissionPending, type ShadowInviteCode, type ShadowListing, type ShadowMediaVariant, type ShadowMember, type ShadowMentionSuggestion, type ShadowMentionSuggestionTrigger, type ShadowMessage, type ShadowMessageMention, type ShadowModelProxyBilling, type ShadowModelProxyChatCompletionRequest, type ShadowModelProxyChatCompletionResponse, type ShadowModelProxyModel, type ShadowModelProxyModelsResponse, type ShadowNotification, type ShadowNotificationPreferences, type ShadowOAuthApp, type ShadowOAuthCommerceEntitlementAccess, type ShadowOAuthCommerceEntitlementRedeemInput, type ShadowOAuthCommerceEntitlementRedeemResult, type ShadowOAuthCommerceEntitlementRedemption, type ShadowOAuthCommerceEntitlementSummary, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowPaidFileOpenResult, type ShadowProduct, type ShadowProductEntitlementConfig, type ShadowProductMedia, type ShadowProductSku, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowServerAccess, type ShadowServerAppApprovalMode, type ShadowServerAppCatalogEntry, type ShadowServerAppCommand, type ShadowServerAppCommandApproval, type ShadowServerAppCommandConsent, type ShadowServerAppDiscovery, type ShadowServerAppIntegration, type ShadowServerAppLaunchContext, type ShadowServerAppManifest, type ShadowServerAppSkillDocument, type ShadowServerAppTokenIntrospection, type ShadowServerJoinRequestResult, type ShadowServerJoinRequestStatus, type ShadowSettlementLine, type ShadowShop, type ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUsageProviderSnapshot, type ShadowUser, ShadowVoiceConsumer, type ShadowVoiceConsumerOptions, type ShadowVoiceCredentials, type ShadowVoiceJoinResult, type ShadowVoiceLeaveResult, type ShadowVoiceParticipant, type ShadowVoicePolicy, type ShadowVoiceState, type ShadowWallet, type TypingPayload, type VoiceParticipantPayload, type VoicePolicyUpdatedPayload, channelRoom, threadRoom, userRoom };
|
package/dist/index.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ interface ShadowSignedMediaUrl {
|
|
|
124
124
|
type ShadowMediaVariant = 'avatar' | 'preview' | 'banner';
|
|
125
125
|
type ShadowServerAppAction = 'read' | 'write' | 'manage' | 'delete' | 'generate';
|
|
126
126
|
type ShadowServerAppDataClass = 'public' | 'server-private' | 'channel-private' | 'financial' | 'secret' | 'cloud-secret';
|
|
127
|
+
type ShadowServerAppApprovalMode = 'none' | 'first_time' | 'every_time' | 'policy';
|
|
127
128
|
interface ShadowServerAppCommand {
|
|
128
129
|
name: string;
|
|
129
130
|
title?: string;
|
|
@@ -135,7 +136,7 @@ interface ShadowServerAppCommand {
|
|
|
135
136
|
permission: string;
|
|
136
137
|
action: ShadowServerAppAction;
|
|
137
138
|
dataClass: ShadowServerAppDataClass;
|
|
138
|
-
approvalMode?:
|
|
139
|
+
approvalMode?: ShadowServerAppApprovalMode;
|
|
139
140
|
binary?: {
|
|
140
141
|
supported?: boolean;
|
|
141
142
|
field?: string;
|
|
@@ -160,6 +161,10 @@ interface ShadowServerAppManifest {
|
|
|
160
161
|
type: 'oauth2-bearer';
|
|
161
162
|
};
|
|
162
163
|
};
|
|
164
|
+
access?: {
|
|
165
|
+
defaultPermissions?: string[];
|
|
166
|
+
defaultApprovalMode?: ShadowServerAppApprovalMode;
|
|
167
|
+
};
|
|
163
168
|
commands: ShadowServerAppCommand[];
|
|
164
169
|
skills?: Array<{
|
|
165
170
|
name: string;
|
|
@@ -185,6 +190,8 @@ interface ShadowServerAppIntegration {
|
|
|
185
190
|
iframeEntry?: string | null;
|
|
186
191
|
allowedOrigins: string[];
|
|
187
192
|
apiBaseUrl: string;
|
|
193
|
+
defaultPermissions: string[];
|
|
194
|
+
defaultApprovalMode: ShadowServerAppApprovalMode;
|
|
188
195
|
status: string;
|
|
189
196
|
installedByUserId: string;
|
|
190
197
|
createdAt: string;
|
|
@@ -200,9 +207,35 @@ interface ShadowServerAppDiscovery {
|
|
|
200
207
|
permission: string;
|
|
201
208
|
action: ShadowServerAppAction;
|
|
202
209
|
dataClass: ShadowServerAppDataClass;
|
|
203
|
-
approvalMode:
|
|
210
|
+
approvalMode: ShadowServerAppApprovalMode;
|
|
204
211
|
}>;
|
|
205
212
|
}
|
|
213
|
+
interface ShadowServerAppCommandApproval {
|
|
214
|
+
appKey: string;
|
|
215
|
+
appName: string;
|
|
216
|
+
commandName: string;
|
|
217
|
+
commandTitle: string;
|
|
218
|
+
commandDescription?: string | null;
|
|
219
|
+
permission: string;
|
|
220
|
+
action: ShadowServerAppAction;
|
|
221
|
+
dataClass: ShadowServerAppDataClass;
|
|
222
|
+
actorKind: string;
|
|
223
|
+
subjectKind: 'user' | 'buddy';
|
|
224
|
+
buddyAgentId?: string | null;
|
|
225
|
+
approvalMode: ShadowServerAppApprovalMode;
|
|
226
|
+
reason: 'not_default' | 'first_time' | 'every_time' | 'restricted' | 'policy';
|
|
227
|
+
}
|
|
228
|
+
interface ShadowServerAppCommandConsent {
|
|
229
|
+
id: string;
|
|
230
|
+
serverAppId: string;
|
|
231
|
+
appKey: string;
|
|
232
|
+
command: string;
|
|
233
|
+
permission: string;
|
|
234
|
+
subjectKind: 'user' | 'buddy';
|
|
235
|
+
subjectUserId?: string | null;
|
|
236
|
+
buddyAgentId?: string | null;
|
|
237
|
+
expiresAt?: string | null;
|
|
238
|
+
}
|
|
206
239
|
interface ShadowServerAppCatalogEntry {
|
|
207
240
|
id: string;
|
|
208
241
|
appKey: string;
|
|
@@ -2031,9 +2064,23 @@ declare class ShadowClient {
|
|
|
2031
2064
|
buddyAgentId: string;
|
|
2032
2065
|
permissions: string[];
|
|
2033
2066
|
resourceRules?: Record<string, unknown>;
|
|
2034
|
-
approvalMode?:
|
|
2067
|
+
approvalMode?: ShadowServerAppApprovalMode;
|
|
2035
2068
|
expiresAt?: string;
|
|
2036
2069
|
}): Promise<Record<string, unknown>>;
|
|
2070
|
+
updateServerAppAccessPolicy(serverIdOrSlug: string, appKey: string, data: {
|
|
2071
|
+
defaultPermissions: string[];
|
|
2072
|
+
defaultApprovalMode?: ShadowServerAppApprovalMode;
|
|
2073
|
+
}): Promise<ShadowServerAppIntegration & {
|
|
2074
|
+
grants?: Record<string, unknown>[];
|
|
2075
|
+
}>;
|
|
2076
|
+
approveServerAppCommand(serverIdOrSlug: string, appKey: string, data: {
|
|
2077
|
+
commandName: string;
|
|
2078
|
+
buddyAgentId?: string;
|
|
2079
|
+
remember?: boolean;
|
|
2080
|
+
}): Promise<{
|
|
2081
|
+
ok: true;
|
|
2082
|
+
consent: ShadowServerAppCommandConsent;
|
|
2083
|
+
}>;
|
|
2037
2084
|
getServerAppSkills(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppSkillDocument>;
|
|
2038
2085
|
createServerAppLaunch(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppLaunchContext>;
|
|
2039
2086
|
introspectServerAppToken(serverIdOrSlug: string, appKey: string, token: string): Promise<ShadowServerAppTokenIntrospection>;
|
|
@@ -3183,4 +3230,4 @@ declare class ShadowVoiceConsumer {
|
|
|
3183
3230
|
private renewTokens;
|
|
3184
3231
|
}
|
|
3185
3232
|
|
|
3186
|
-
export { type ChannelCreatedPayload, type ChannelMemberAddedPayload, type ChannelMemberRemovedPayload, type ClientEventMap, type MemberJoinPayload, type MemberLeavePayload, type MessageDeletedPayload, type PolicyChangedPayload, type PresenceActivityPayload, type PresenceChangePayload, type ReactionPayload, type ServerEventMap, type ServerJoinedPayload, type ShadowAddAgentsToServerResult, type ShadowAgentUsageSnapshotInput, type ShadowAttachment, type ShadowCartItem, type ShadowCategory, type ShadowChannel, type ShadowChannelAccess, type ShadowChannelBootstrap, type ShadowChannelJoinRequestResult, type ShadowChannelJoinRequestStatus, type ShadowChannelPolicy, type ShadowChannelSlashCommand, ShadowClient, type ShadowCloudDeploymentBackup, type ShadowCloudDeploymentRuntimeResponse, type ShadowCloudDeploymentStatus, type ShadowCloudProviderCatalog, type ShadowCloudProviderEnvVar, type ShadowCloudProviderModel, type ShadowCloudProviderProfile, type ShadowCommerceCheckoutPreview, type ShadowCommerceProductCard, type ShadowCommerceProductContext, type ShadowCommerceProductPickerGroup, type ShadowCommerceProductPickerResponse, type ShadowCommunityAsset, type ShadowCommunityAssetDefinition, type ShadowCommunityAssetGrant, type ShadowContract, type ShadowDiyCloudRun, type ShadowDiyCloudRunEvent, type ShadowDiyCloudRunStatus, type ShadowFriendship, type ShadowInteractiveActionInput, type ShadowInteractiveActionResult, type ShadowInteractiveBlock, type ShadowInteractiveResponse, type ShadowInteractiveState, type ShadowInteractiveSubmissionPending, type ShadowInviteCode, type ShadowListing, type ShadowMediaVariant, type ShadowMember, type ShadowMentionSuggestion, type ShadowMentionSuggestionTrigger, type ShadowMessage, type ShadowMessageMention, type ShadowModelProxyBilling, type ShadowModelProxyChatCompletionRequest, type ShadowModelProxyChatCompletionResponse, type ShadowModelProxyModel, type ShadowModelProxyModelsResponse, type ShadowNotification, type ShadowNotificationPreferences, type ShadowOAuthApp, type ShadowOAuthCommerceEntitlementAccess, type ShadowOAuthCommerceEntitlementRedeemInput, type ShadowOAuthCommerceEntitlementRedeemResult, type ShadowOAuthCommerceEntitlementRedemption, type ShadowOAuthCommerceEntitlementSummary, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowPaidFileOpenResult, type ShadowProduct, type ShadowProductEntitlementConfig, type ShadowProductMedia, type ShadowProductSku, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowServerAccess, type ShadowServerAppCatalogEntry, type ShadowServerAppCommand, type ShadowServerAppDiscovery, type ShadowServerAppIntegration, type ShadowServerAppLaunchContext, type ShadowServerAppManifest, type ShadowServerAppSkillDocument, type ShadowServerAppTokenIntrospection, type ShadowServerJoinRequestResult, type ShadowServerJoinRequestStatus, type ShadowSettlementLine, type ShadowShop, type ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUsageProviderSnapshot, type ShadowUser, ShadowVoiceConsumer, type ShadowVoiceConsumerOptions, type ShadowVoiceCredentials, type ShadowVoiceJoinResult, type ShadowVoiceLeaveResult, type ShadowVoiceParticipant, type ShadowVoicePolicy, type ShadowVoiceState, type ShadowWallet, type TypingPayload, type VoiceParticipantPayload, type VoicePolicyUpdatedPayload, channelRoom, threadRoom, userRoom };
|
|
3233
|
+
export { type ChannelCreatedPayload, type ChannelMemberAddedPayload, type ChannelMemberRemovedPayload, type ClientEventMap, type MemberJoinPayload, type MemberLeavePayload, type MessageDeletedPayload, type PolicyChangedPayload, type PresenceActivityPayload, type PresenceChangePayload, type ReactionPayload, type ServerEventMap, type ServerJoinedPayload, type ShadowAddAgentsToServerResult, type ShadowAgentUsageSnapshotInput, type ShadowAttachment, type ShadowCartItem, type ShadowCategory, type ShadowChannel, type ShadowChannelAccess, type ShadowChannelBootstrap, type ShadowChannelJoinRequestResult, type ShadowChannelJoinRequestStatus, type ShadowChannelPolicy, type ShadowChannelSlashCommand, ShadowClient, type ShadowCloudDeploymentBackup, type ShadowCloudDeploymentRuntimeResponse, type ShadowCloudDeploymentStatus, type ShadowCloudProviderCatalog, type ShadowCloudProviderEnvVar, type ShadowCloudProviderModel, type ShadowCloudProviderProfile, type ShadowCommerceCheckoutPreview, type ShadowCommerceProductCard, type ShadowCommerceProductContext, type ShadowCommerceProductPickerGroup, type ShadowCommerceProductPickerResponse, type ShadowCommunityAsset, type ShadowCommunityAssetDefinition, type ShadowCommunityAssetGrant, type ShadowContract, type ShadowDiyCloudRun, type ShadowDiyCloudRunEvent, type ShadowDiyCloudRunStatus, type ShadowFriendship, type ShadowInteractiveActionInput, type ShadowInteractiveActionResult, type ShadowInteractiveBlock, type ShadowInteractiveResponse, type ShadowInteractiveState, type ShadowInteractiveSubmissionPending, type ShadowInviteCode, type ShadowListing, type ShadowMediaVariant, type ShadowMember, type ShadowMentionSuggestion, type ShadowMentionSuggestionTrigger, type ShadowMessage, type ShadowMessageMention, type ShadowModelProxyBilling, type ShadowModelProxyChatCompletionRequest, type ShadowModelProxyChatCompletionResponse, type ShadowModelProxyModel, type ShadowModelProxyModelsResponse, type ShadowNotification, type ShadowNotificationPreferences, type ShadowOAuthApp, type ShadowOAuthCommerceEntitlementAccess, type ShadowOAuthCommerceEntitlementRedeemInput, type ShadowOAuthCommerceEntitlementRedeemResult, type ShadowOAuthCommerceEntitlementRedemption, type ShadowOAuthCommerceEntitlementSummary, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowPaidFileOpenResult, type ShadowProduct, type ShadowProductEntitlementConfig, type ShadowProductMedia, type ShadowProductSku, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowServerAccess, type ShadowServerAppApprovalMode, type ShadowServerAppCatalogEntry, type ShadowServerAppCommand, type ShadowServerAppCommandApproval, type ShadowServerAppCommandConsent, type ShadowServerAppDiscovery, type ShadowServerAppIntegration, type ShadowServerAppLaunchContext, type ShadowServerAppManifest, type ShadowServerAppSkillDocument, type ShadowServerAppTokenIntrospection, type ShadowServerJoinRequestResult, type ShadowServerJoinRequestStatus, type ShadowSettlementLine, type ShadowShop, type ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUsageProviderSnapshot, type ShadowUser, ShadowVoiceConsumer, type ShadowVoiceConsumerOptions, type ShadowVoiceCredentials, type ShadowVoiceJoinResult, type ShadowVoiceLeaveResult, type ShadowVoiceParticipant, type ShadowVoicePolicy, type ShadowVoiceState, type ShadowWallet, type TypingPayload, type VoiceParticipantPayload, type VoicePolicyUpdatedPayload, channelRoom, threadRoom, userRoom };
|
package/dist/index.js
CHANGED
|
@@ -341,6 +341,24 @@ var ShadowClient = class {
|
|
|
341
341
|
}
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
|
+
async updateServerAppAccessPolicy(serverIdOrSlug, appKey, data) {
|
|
345
|
+
return this.request(
|
|
346
|
+
`/api/servers/${serverIdOrSlug}/apps/${encodeURIComponent(appKey)}/access-policy`,
|
|
347
|
+
{
|
|
348
|
+
method: "PATCH",
|
|
349
|
+
body: JSON.stringify(data)
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
async approveServerAppCommand(serverIdOrSlug, appKey, data) {
|
|
354
|
+
return this.request(
|
|
355
|
+
`/api/servers/${serverIdOrSlug}/apps/${encodeURIComponent(appKey)}/approvals`,
|
|
356
|
+
{
|
|
357
|
+
method: "POST",
|
|
358
|
+
body: JSON.stringify(data)
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
}
|
|
344
362
|
async getServerAppSkills(serverIdOrSlug, appKey) {
|
|
345
363
|
return this.request(`/api/servers/${serverIdOrSlug}/apps/${encodeURIComponent(appKey)}/skills`);
|
|
346
364
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shadowob/sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Shadow SDK — typed REST client and real-time Socket.IO event listener for Shadow servers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"socket.io-client": "^4.8.1",
|
|
25
|
-
"@shadowob/shared": "1.1.
|
|
25
|
+
"@shadowob/shared": "1.1.7"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"agora-rtc-sdk-ng": "^4.24.3"
|