@shadowob/sdk 1.1.4 → 1.1.6-dev.311
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 +313 -0
- package/dist/index.d.cts +442 -14
- package/dist/index.d.ts +442 -14
- package/dist/index.js +312 -0
- package/package.json +11 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MessageMention, OAuthLinkCard, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
|
|
2
2
|
export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
|
|
3
3
|
import { Socket } from 'socket.io-client';
|
|
4
|
+
import { IRemoteAudioTrack, IRemoteVideoTrack } from 'agora-rtc-sdk-ng';
|
|
4
5
|
|
|
5
6
|
/** Message returned by the Shadow REST API and Socket.IO broadcasts */
|
|
6
7
|
interface ShadowMessage {
|
|
@@ -291,6 +292,65 @@ interface ShadowChannelJoinRequestResult {
|
|
|
291
292
|
status: ShadowChannelJoinRequestStatus;
|
|
292
293
|
requestId?: string;
|
|
293
294
|
}
|
|
295
|
+
interface ShadowVoiceParticipant {
|
|
296
|
+
id: string;
|
|
297
|
+
channelId: string;
|
|
298
|
+
userId: string;
|
|
299
|
+
uid: number;
|
|
300
|
+
screenUid: number;
|
|
301
|
+
username: string;
|
|
302
|
+
displayName: string | null;
|
|
303
|
+
avatarUrl: string | null;
|
|
304
|
+
isBot: boolean;
|
|
305
|
+
isMuted: boolean;
|
|
306
|
+
isDeafened: boolean;
|
|
307
|
+
isSpeaking: boolean;
|
|
308
|
+
isScreenSharing: boolean;
|
|
309
|
+
joinedAt: string;
|
|
310
|
+
updatedAt: string;
|
|
311
|
+
clientId: string | null;
|
|
312
|
+
}
|
|
313
|
+
interface ShadowVoiceCredentials {
|
|
314
|
+
appId: string;
|
|
315
|
+
channelId: string;
|
|
316
|
+
agoraChannelName: string;
|
|
317
|
+
uid: number;
|
|
318
|
+
screenUid: number;
|
|
319
|
+
token: string | null;
|
|
320
|
+
screenToken: string | null;
|
|
321
|
+
expiresAt: string | null;
|
|
322
|
+
}
|
|
323
|
+
interface ShadowVoiceState {
|
|
324
|
+
channelId: string;
|
|
325
|
+
agoraChannelName: string;
|
|
326
|
+
participants: ShadowVoiceParticipant[];
|
|
327
|
+
participantCount: number;
|
|
328
|
+
emptySince: string | null;
|
|
329
|
+
graceEndsAt: string | null;
|
|
330
|
+
}
|
|
331
|
+
interface ShadowVoiceJoinResult {
|
|
332
|
+
credentials: ShadowVoiceCredentials;
|
|
333
|
+
participant: ShadowVoiceParticipant;
|
|
334
|
+
state: ShadowVoiceState;
|
|
335
|
+
}
|
|
336
|
+
interface ShadowVoiceLeaveResult {
|
|
337
|
+
participant: ShadowVoiceParticipant | null;
|
|
338
|
+
state: ShadowVoiceState;
|
|
339
|
+
left?: boolean;
|
|
340
|
+
}
|
|
341
|
+
interface ShadowVoiceRenewResult {
|
|
342
|
+
credentials: ShadowVoiceCredentials;
|
|
343
|
+
state: ShadowVoiceState;
|
|
344
|
+
}
|
|
345
|
+
interface ShadowVoicePolicy {
|
|
346
|
+
agentId: string;
|
|
347
|
+
channelId: string;
|
|
348
|
+
listen: boolean;
|
|
349
|
+
autoJoin: boolean;
|
|
350
|
+
consumeAudio: boolean;
|
|
351
|
+
consumeScreenShare: boolean;
|
|
352
|
+
screenshotIntervalSeconds: number | null;
|
|
353
|
+
}
|
|
294
354
|
type ShadowServerJoinRequestStatus = 'pending' | 'approved' | 'rejected';
|
|
295
355
|
interface ShadowServerAccess {
|
|
296
356
|
server: ShadowServer;
|
|
@@ -681,6 +741,15 @@ interface PolicyChangedPayload {
|
|
|
681
741
|
serverId: string;
|
|
682
742
|
channelId?: string | null;
|
|
683
743
|
}
|
|
744
|
+
interface VoiceParticipantPayload {
|
|
745
|
+
channelId: string;
|
|
746
|
+
participant: ShadowVoiceParticipant | null;
|
|
747
|
+
state: ShadowVoiceState;
|
|
748
|
+
}
|
|
749
|
+
interface VoicePolicyUpdatedPayload {
|
|
750
|
+
channelId: string;
|
|
751
|
+
agentId: string;
|
|
752
|
+
}
|
|
684
753
|
interface ShadowFriendship {
|
|
685
754
|
id: string;
|
|
686
755
|
userId: string;
|
|
@@ -839,6 +908,8 @@ interface ShadowCommerceProductCard {
|
|
|
839
908
|
name: string;
|
|
840
909
|
summary?: string | null;
|
|
841
910
|
imageUrl?: string | null;
|
|
911
|
+
shopName?: string | null;
|
|
912
|
+
deliveryPromise?: string | null;
|
|
842
913
|
price: number;
|
|
843
914
|
currency: string;
|
|
844
915
|
productType: 'physical' | 'entitlement';
|
|
@@ -932,6 +1003,68 @@ interface ShadowEntitlement {
|
|
|
932
1003
|
sizeBytes?: number | null;
|
|
933
1004
|
previewUrl?: string | null;
|
|
934
1005
|
} | null;
|
|
1006
|
+
buyer?: {
|
|
1007
|
+
id: string;
|
|
1008
|
+
username: string;
|
|
1009
|
+
displayName?: string | null;
|
|
1010
|
+
avatarUrl?: string | null;
|
|
1011
|
+
} | null;
|
|
1012
|
+
order?: (Omit<ShadowOrder, 'items' | 'currency'> & {
|
|
1013
|
+
currency?: string | null;
|
|
1014
|
+
items?: ShadowOrder['items'];
|
|
1015
|
+
}) | null;
|
|
1016
|
+
fulfillmentJobs?: Array<Record<string, unknown>>;
|
|
1017
|
+
}
|
|
1018
|
+
interface ShadowOAuthCommerceEntitlementSummary {
|
|
1019
|
+
id: string;
|
|
1020
|
+
status: string;
|
|
1021
|
+
capability: string;
|
|
1022
|
+
resourceType: string;
|
|
1023
|
+
resourceId: string;
|
|
1024
|
+
productId?: string | null;
|
|
1025
|
+
shopId?: string | null;
|
|
1026
|
+
orderId?: string | null;
|
|
1027
|
+
offerId?: string | null;
|
|
1028
|
+
expiresAt?: string | null;
|
|
1029
|
+
}
|
|
1030
|
+
interface ShadowOAuthCommerceEntitlementAccess {
|
|
1031
|
+
allowed: boolean;
|
|
1032
|
+
status: string;
|
|
1033
|
+
reasonCode?: string | null;
|
|
1034
|
+
resourceType: string;
|
|
1035
|
+
resourceId: string;
|
|
1036
|
+
capability: string;
|
|
1037
|
+
app: {
|
|
1038
|
+
id: string;
|
|
1039
|
+
};
|
|
1040
|
+
entitlement?: ShadowOAuthCommerceEntitlementSummary | null;
|
|
1041
|
+
}
|
|
1042
|
+
interface ShadowOAuthCommerceEntitlementRedeemInput {
|
|
1043
|
+
idempotencyKey: string;
|
|
1044
|
+
resourceType?: string;
|
|
1045
|
+
resourceId?: string;
|
|
1046
|
+
capability?: string;
|
|
1047
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
1048
|
+
}
|
|
1049
|
+
interface ShadowOAuthCommerceEntitlementRedemption {
|
|
1050
|
+
appId: string;
|
|
1051
|
+
resourceType: string;
|
|
1052
|
+
resourceId: string;
|
|
1053
|
+
capability: string;
|
|
1054
|
+
idempotencyKey: string;
|
|
1055
|
+
redeemedAt: string;
|
|
1056
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
1057
|
+
}
|
|
1058
|
+
interface ShadowOAuthCommerceEntitlementRedeemResult {
|
|
1059
|
+
redeemed: true;
|
|
1060
|
+
resourceType: string;
|
|
1061
|
+
resourceId: string;
|
|
1062
|
+
capability: string;
|
|
1063
|
+
app: {
|
|
1064
|
+
id: string;
|
|
1065
|
+
};
|
|
1066
|
+
entitlement: ShadowOAuthCommerceEntitlementSummary;
|
|
1067
|
+
redemption: ShadowOAuthCommerceEntitlementRedemption;
|
|
935
1068
|
}
|
|
936
1069
|
interface ShadowEntitlementPurchaseResult {
|
|
937
1070
|
order: {
|
|
@@ -1013,6 +1146,80 @@ interface ShadowCommerceCheckoutPreview {
|
|
|
1013
1146
|
};
|
|
1014
1147
|
nextAction: 'purchase' | 'open_paid_file' | 'view_entitlement' | string;
|
|
1015
1148
|
}
|
|
1149
|
+
interface ShadowCommerceProductContext {
|
|
1150
|
+
product: ShadowProduct;
|
|
1151
|
+
shop: ShadowShop & {
|
|
1152
|
+
logoUrl?: string | null;
|
|
1153
|
+
bannerUrl?: string | null;
|
|
1154
|
+
};
|
|
1155
|
+
server: {
|
|
1156
|
+
id: string;
|
|
1157
|
+
name: string;
|
|
1158
|
+
slug?: string | null;
|
|
1159
|
+
description?: string | null;
|
|
1160
|
+
iconUrl?: string | null;
|
|
1161
|
+
bannerUrl?: string | null;
|
|
1162
|
+
ownerId?: string | null;
|
|
1163
|
+
} | null;
|
|
1164
|
+
provider: {
|
|
1165
|
+
id: string;
|
|
1166
|
+
username: string;
|
|
1167
|
+
displayName?: string | null;
|
|
1168
|
+
avatarUrl?: string | null;
|
|
1169
|
+
isBot?: boolean;
|
|
1170
|
+
} | null;
|
|
1171
|
+
buddy: {
|
|
1172
|
+
id: string;
|
|
1173
|
+
userId: string;
|
|
1174
|
+
ownerId: string;
|
|
1175
|
+
status: string;
|
|
1176
|
+
totalOnlineSeconds?: number | null;
|
|
1177
|
+
lastHeartbeat?: string | null;
|
|
1178
|
+
} | null;
|
|
1179
|
+
offer: {
|
|
1180
|
+
id: string;
|
|
1181
|
+
status: string;
|
|
1182
|
+
priceOverride?: number | null;
|
|
1183
|
+
currency: string;
|
|
1184
|
+
allowedSurfaces?: string[] | null;
|
|
1185
|
+
sellerUserId?: string | null;
|
|
1186
|
+
sellerBuddyUserId?: string | null;
|
|
1187
|
+
} | null;
|
|
1188
|
+
fulfillment: {
|
|
1189
|
+
status: string;
|
|
1190
|
+
resourceType?: string | null;
|
|
1191
|
+
resourceId?: string | null;
|
|
1192
|
+
capability?: string | null;
|
|
1193
|
+
deliverables: Array<{
|
|
1194
|
+
id: string;
|
|
1195
|
+
kind: string;
|
|
1196
|
+
resourceType?: string | null;
|
|
1197
|
+
resourceId?: string | null;
|
|
1198
|
+
deliveryTiming?: string | null;
|
|
1199
|
+
status: string;
|
|
1200
|
+
}>;
|
|
1201
|
+
};
|
|
1202
|
+
refund: {
|
|
1203
|
+
policy: string;
|
|
1204
|
+
status: string;
|
|
1205
|
+
supportPath?: string | null;
|
|
1206
|
+
};
|
|
1207
|
+
credit: {
|
|
1208
|
+
salesCount: number;
|
|
1209
|
+
avgRating: number;
|
|
1210
|
+
ratingCount: number;
|
|
1211
|
+
completedOrders: number;
|
|
1212
|
+
};
|
|
1213
|
+
links: {
|
|
1214
|
+
product: string;
|
|
1215
|
+
shop?: string | null;
|
|
1216
|
+
server?: string | null;
|
|
1217
|
+
providerProfile?: string | null;
|
|
1218
|
+
buddyProfile?: string | null;
|
|
1219
|
+
assetHome?: string | null;
|
|
1220
|
+
checkoutPreview?: string | null;
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1016
1223
|
interface ShadowPaidFileOpenResult {
|
|
1017
1224
|
grant: {
|
|
1018
1225
|
id: string;
|
|
@@ -1029,18 +1236,54 @@ interface ShadowCategory {
|
|
|
1029
1236
|
description?: string | null;
|
|
1030
1237
|
position: number;
|
|
1031
1238
|
}
|
|
1239
|
+
interface ShadowProductMedia {
|
|
1240
|
+
id?: string;
|
|
1241
|
+
type?: 'image' | 'video' | string;
|
|
1242
|
+
url: string;
|
|
1243
|
+
thumbnailUrl?: string | null;
|
|
1244
|
+
position?: number;
|
|
1245
|
+
}
|
|
1246
|
+
interface ShadowProductSku {
|
|
1247
|
+
id: string;
|
|
1248
|
+
specValues: string[];
|
|
1249
|
+
price: number;
|
|
1250
|
+
stock: number;
|
|
1251
|
+
imageUrl?: string | null;
|
|
1252
|
+
skuCode?: string | null;
|
|
1253
|
+
isActive?: boolean;
|
|
1254
|
+
}
|
|
1255
|
+
interface ShadowProductEntitlementConfig {
|
|
1256
|
+
resourceType?: string;
|
|
1257
|
+
resourceId?: string;
|
|
1258
|
+
capability?: string;
|
|
1259
|
+
durationSeconds?: number | null;
|
|
1260
|
+
renewalPeriodSeconds?: number | null;
|
|
1261
|
+
privilegeDescription?: string;
|
|
1262
|
+
}
|
|
1032
1263
|
interface ShadowProduct {
|
|
1033
1264
|
id: string;
|
|
1034
1265
|
shopId: string;
|
|
1035
1266
|
categoryId?: string | null;
|
|
1036
1267
|
name: string;
|
|
1268
|
+
slug?: string;
|
|
1269
|
+
type?: 'physical' | 'entitlement' | string;
|
|
1037
1270
|
description?: string | null;
|
|
1038
|
-
|
|
1271
|
+
summary?: string | null;
|
|
1272
|
+
price?: number;
|
|
1273
|
+
basePrice?: number;
|
|
1039
1274
|
currency: string;
|
|
1040
|
-
stock
|
|
1275
|
+
stock?: number;
|
|
1041
1276
|
status: string;
|
|
1277
|
+
specNames?: string[];
|
|
1278
|
+
tags?: string[];
|
|
1279
|
+
salesCount?: number;
|
|
1280
|
+
avgRating?: number;
|
|
1281
|
+
ratingCount?: number;
|
|
1042
1282
|
billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
|
|
1043
|
-
|
|
1283
|
+
entitlementConfig?: ShadowProductEntitlementConfig | ShadowProductEntitlementConfig[] | null;
|
|
1284
|
+
media?: ShadowProductMedia[];
|
|
1285
|
+
skus?: ShadowProductSku[];
|
|
1286
|
+
images?: string[];
|
|
1044
1287
|
createdAt: string;
|
|
1045
1288
|
}
|
|
1046
1289
|
interface ShadowCartItem {
|
|
@@ -1051,17 +1294,29 @@ interface ShadowCartItem {
|
|
|
1051
1294
|
}
|
|
1052
1295
|
interface ShadowOrder {
|
|
1053
1296
|
id: string;
|
|
1297
|
+
orderNo?: string;
|
|
1054
1298
|
shopId: string;
|
|
1055
1299
|
buyerId: string;
|
|
1056
|
-
status: string;
|
|
1300
|
+
status: 'pending' | 'paid' | 'processing' | 'shipped' | 'delivered' | 'completed' | 'cancelled' | 'refunded' | string;
|
|
1057
1301
|
totalAmount: number;
|
|
1058
1302
|
currency: string;
|
|
1059
|
-
|
|
1303
|
+
trackingNo?: string | null;
|
|
1304
|
+
buyerNote?: string | null;
|
|
1305
|
+
sellerNote?: string | null;
|
|
1306
|
+
paidAt?: string | null;
|
|
1307
|
+
shippedAt?: string | null;
|
|
1308
|
+
completedAt?: string | null;
|
|
1309
|
+
cancelledAt?: string | null;
|
|
1310
|
+
items: Array<{
|
|
1311
|
+
id?: string;
|
|
1060
1312
|
productId: string;
|
|
1061
1313
|
skuId?: string | null;
|
|
1314
|
+
productName?: string;
|
|
1315
|
+
specValues?: string[];
|
|
1062
1316
|
quantity: number;
|
|
1063
1317
|
price: number;
|
|
1064
|
-
|
|
1318
|
+
imageUrl?: string | null;
|
|
1319
|
+
}>;
|
|
1065
1320
|
createdAt: string;
|
|
1066
1321
|
}
|
|
1067
1322
|
interface ShadowReview {
|
|
@@ -1499,6 +1754,11 @@ interface ServerEventMap {
|
|
|
1499
1754
|
'channel:member-added': (payload: ChannelMemberAddedPayload) => void;
|
|
1500
1755
|
'channel:member-removed': (payload: ChannelMemberRemovedPayload) => void;
|
|
1501
1756
|
'channel:slash-commands-updated': (payload: SlashCommandsUpdatedPayload) => void;
|
|
1757
|
+
'voice:state': (payload: ShadowVoiceState) => void;
|
|
1758
|
+
'voice:participant-joined': (payload: VoiceParticipantPayload) => void;
|
|
1759
|
+
'voice:participant-left': (payload: VoiceParticipantPayload) => void;
|
|
1760
|
+
'voice:participant-updated': (payload: VoiceParticipantPayload) => void;
|
|
1761
|
+
'voice:policy-updated': (payload: VoicePolicyUpdatedPayload) => void;
|
|
1502
1762
|
'server:joined': (payload: ServerJoinedPayload) => void;
|
|
1503
1763
|
'agent:policy-changed': (payload: PolicyChangedPayload) => void;
|
|
1504
1764
|
error: (payload: {
|
|
@@ -1515,6 +1775,52 @@ interface ClientEventMap {
|
|
|
1515
1775
|
'channel:leave': (data: {
|
|
1516
1776
|
channelId: string;
|
|
1517
1777
|
}) => void;
|
|
1778
|
+
'voice:join': (data: {
|
|
1779
|
+
channelId: string;
|
|
1780
|
+
clientId?: string;
|
|
1781
|
+
muted?: boolean;
|
|
1782
|
+
deafened?: boolean;
|
|
1783
|
+
}, ack?: (res: {
|
|
1784
|
+
ok: boolean;
|
|
1785
|
+
data?: ShadowVoiceJoinResult;
|
|
1786
|
+
error?: string;
|
|
1787
|
+
code?: string;
|
|
1788
|
+
}) => void) => void;
|
|
1789
|
+
'voice:leave': (data: {
|
|
1790
|
+
channelId: string;
|
|
1791
|
+
clientId?: string | null;
|
|
1792
|
+
}, ack?: (res: {
|
|
1793
|
+
ok: boolean;
|
|
1794
|
+
data?: ShadowVoiceLeaveResult;
|
|
1795
|
+
error?: string;
|
|
1796
|
+
code?: string;
|
|
1797
|
+
}) => void) => void;
|
|
1798
|
+
'voice:state:update': (data: {
|
|
1799
|
+
channelId: string;
|
|
1800
|
+
clientId?: string | null;
|
|
1801
|
+
muted?: boolean;
|
|
1802
|
+
deafened?: boolean;
|
|
1803
|
+
speaking?: boolean;
|
|
1804
|
+
screenSharing?: boolean;
|
|
1805
|
+
}, ack?: (res: {
|
|
1806
|
+
ok: boolean;
|
|
1807
|
+
data?: unknown;
|
|
1808
|
+
error?: string;
|
|
1809
|
+
code?: string;
|
|
1810
|
+
}) => void) => void;
|
|
1811
|
+
'voice:token:renew': (data: {
|
|
1812
|
+
channelId: string;
|
|
1813
|
+
clientId?: string | null;
|
|
1814
|
+
}, ack?: (res: {
|
|
1815
|
+
ok: boolean;
|
|
1816
|
+
data?: ShadowVoiceRenewResult;
|
|
1817
|
+
error?: string;
|
|
1818
|
+
code?: string;
|
|
1819
|
+
}) => void) => void;
|
|
1820
|
+
'voice:heartbeat': (data: {
|
|
1821
|
+
channelId: string;
|
|
1822
|
+
clientId?: string | null;
|
|
1823
|
+
}) => void;
|
|
1518
1824
|
'message:send': (data: {
|
|
1519
1825
|
channelId: string;
|
|
1520
1826
|
content: string;
|
|
@@ -1805,6 +2111,37 @@ declare class ShadowClient {
|
|
|
1805
2111
|
removeChannelMember(channelId: string, userId: string): Promise<{
|
|
1806
2112
|
success: boolean;
|
|
1807
2113
|
}>;
|
|
2114
|
+
getVoiceState(channelId: string): Promise<ShadowVoiceState>;
|
|
2115
|
+
joinVoiceChannel(channelId: string, options?: {
|
|
2116
|
+
clientId?: string | null;
|
|
2117
|
+
muted?: boolean;
|
|
2118
|
+
deafened?: boolean;
|
|
2119
|
+
}): Promise<ShadowVoiceJoinResult>;
|
|
2120
|
+
renewVoiceCredentials(channelId: string, options?: {
|
|
2121
|
+
clientId?: string | null;
|
|
2122
|
+
}): Promise<ShadowVoiceRenewResult>;
|
|
2123
|
+
leaveVoiceChannel(channelId: string, options?: {
|
|
2124
|
+
clientId?: string | null;
|
|
2125
|
+
}): Promise<ShadowVoiceLeaveResult>;
|
|
2126
|
+
updateVoiceState(channelId: string, data: {
|
|
2127
|
+
clientId?: string | null;
|
|
2128
|
+
muted?: boolean;
|
|
2129
|
+
deafened?: boolean;
|
|
2130
|
+
speaking?: boolean;
|
|
2131
|
+
screenSharing?: boolean;
|
|
2132
|
+
}): Promise<{
|
|
2133
|
+
participant: unknown;
|
|
2134
|
+
state: ShadowVoiceState;
|
|
2135
|
+
}>;
|
|
2136
|
+
getVoicePolicy(channelId: string, agentId: string): Promise<ShadowVoicePolicy>;
|
|
2137
|
+
updateVoicePolicy(channelId: string, data: {
|
|
2138
|
+
agentId: string;
|
|
2139
|
+
listen?: boolean;
|
|
2140
|
+
autoJoin?: boolean;
|
|
2141
|
+
consumeAudio?: boolean;
|
|
2142
|
+
consumeScreenShare?: boolean;
|
|
2143
|
+
screenshotIntervalSeconds?: number | null;
|
|
2144
|
+
}): Promise<ShadowVoicePolicy>;
|
|
1808
2145
|
setBuddyPolicy(channelId: string, agentId: string, data: {
|
|
1809
2146
|
mentionOnly?: boolean;
|
|
1810
2147
|
reply?: boolean;
|
|
@@ -2207,6 +2544,7 @@ declare class ShadowClient {
|
|
|
2207
2544
|
products: ShadowProduct[];
|
|
2208
2545
|
}>;
|
|
2209
2546
|
getScopeNeutralProduct(productId: string): Promise<ShadowProduct>;
|
|
2547
|
+
getCommerceProductContext(productId: string): Promise<ShadowCommerceProductContext>;
|
|
2210
2548
|
getShopProduct(shopId: string, productId: string): Promise<ShadowProduct>;
|
|
2211
2549
|
createShopProduct(shopId: string, data: Partial<ShadowProduct> & Record<string, unknown>): Promise<ShadowProduct>;
|
|
2212
2550
|
updateShopProduct(shopId: string, productId: string, data: Partial<ShadowProduct> & Record<string, unknown>): Promise<ShadowProduct>;
|
|
@@ -2301,14 +2639,8 @@ declare class ShadowClient {
|
|
|
2301
2639
|
total: number;
|
|
2302
2640
|
}>;
|
|
2303
2641
|
getProduct(serverId: string, productId: string): Promise<ShadowProduct>;
|
|
2304
|
-
createProduct(serverId: string, data: {
|
|
2642
|
+
createProduct(serverId: string, data: Partial<ShadowProduct> & {
|
|
2305
2643
|
name: string;
|
|
2306
|
-
description?: string;
|
|
2307
|
-
price: number;
|
|
2308
|
-
currency?: string;
|
|
2309
|
-
stock: number;
|
|
2310
|
-
categoryId?: string;
|
|
2311
|
-
images?: string[];
|
|
2312
2644
|
}): Promise<ShadowProduct>;
|
|
2313
2645
|
updateProduct(serverId: string, productId: string, data: Partial<{
|
|
2314
2646
|
name: string;
|
|
@@ -2318,6 +2650,7 @@ declare class ShadowClient {
|
|
|
2318
2650
|
status: string;
|
|
2319
2651
|
categoryId: string | null;
|
|
2320
2652
|
images: string[];
|
|
2653
|
+
media: ShadowProduct['media'];
|
|
2321
2654
|
}>): Promise<ShadowProduct>;
|
|
2322
2655
|
deleteProduct(serverId: string, productId: string): Promise<{
|
|
2323
2656
|
success: boolean;
|
|
@@ -2338,12 +2671,14 @@ declare class ShadowClient {
|
|
|
2338
2671
|
skuId?: string;
|
|
2339
2672
|
quantity: number;
|
|
2340
2673
|
}[];
|
|
2674
|
+
buyerNote?: string;
|
|
2341
2675
|
}): Promise<ShadowOrder>;
|
|
2342
2676
|
listOrders(serverId: string): Promise<ShadowOrder[]>;
|
|
2343
2677
|
listShopOrders(serverId: string): Promise<ShadowOrder[]>;
|
|
2344
2678
|
getOrder(serverId: string, orderId: string): Promise<ShadowOrder>;
|
|
2345
2679
|
updateOrderStatus(serverId: string, orderId: string, status: string): Promise<ShadowOrder>;
|
|
2346
2680
|
cancelOrder(serverId: string, orderId: string): Promise<ShadowOrder>;
|
|
2681
|
+
completeOrder(serverId: string, orderId: string): Promise<ShadowOrder>;
|
|
2347
2682
|
getProductReviews(serverId: string, productId: string): Promise<ShadowReview[]>;
|
|
2348
2683
|
createReview(serverId: string, orderId: string, data: {
|
|
2349
2684
|
productId: string;
|
|
@@ -2547,12 +2882,20 @@ declare class ShadowClient {
|
|
|
2547
2882
|
confirmRechargePayment(paymentIntentId: string): Promise<ShadowPaymentOrder>;
|
|
2548
2883
|
getEntitlements(serverId: string): Promise<ShadowEntitlement[]>;
|
|
2549
2884
|
getAllEntitlements(): Promise<ShadowEntitlement[]>;
|
|
2885
|
+
getEntitlement(entitlementId: string): Promise<ShadowEntitlement>;
|
|
2886
|
+
getOAuthCommerceEntitlementAccess(params?: {
|
|
2887
|
+
resourceType?: string;
|
|
2888
|
+
resourceId?: string;
|
|
2889
|
+
capability?: string;
|
|
2890
|
+
}): Promise<ShadowOAuthCommerceEntitlementAccess>;
|
|
2891
|
+
redeemOAuthCommerceEntitlement(data: ShadowOAuthCommerceEntitlementRedeemInput): Promise<ShadowOAuthCommerceEntitlementRedeemResult>;
|
|
2550
2892
|
verifyEntitlement(entitlementId: string): Promise<{
|
|
2551
2893
|
active: boolean;
|
|
2552
2894
|
entitlement: Record<string, unknown>;
|
|
2553
2895
|
provisioning: ShadowEntitlementProvisioning;
|
|
2554
2896
|
}>;
|
|
2555
2897
|
cancelEntitlement(entitlementId: string, reason?: string): Promise<Record<string, unknown>>;
|
|
2898
|
+
cancelEntitlementRenewal(entitlementId: string, reason?: string): Promise<Record<string, unknown>>;
|
|
2556
2899
|
getTaskCenter(): Promise<{
|
|
2557
2900
|
tasks: ShadowTask[];
|
|
2558
2901
|
}>;
|
|
@@ -2610,6 +2953,14 @@ declare class ShadowClient {
|
|
|
2610
2953
|
items: Record<string, unknown>[];
|
|
2611
2954
|
total: number;
|
|
2612
2955
|
}>;
|
|
2956
|
+
discoverCommerce(params?: {
|
|
2957
|
+
q?: string;
|
|
2958
|
+
limit?: number;
|
|
2959
|
+
}): Promise<Record<string, unknown>>;
|
|
2960
|
+
discoverBusinessHub(params?: {
|
|
2961
|
+
q?: string;
|
|
2962
|
+
limit?: number;
|
|
2963
|
+
}): Promise<Record<string, unknown>>;
|
|
2613
2964
|
enhanceVoice(data: {
|
|
2614
2965
|
transcript: string;
|
|
2615
2966
|
language?: string;
|
|
@@ -2738,6 +3089,47 @@ declare class ShadowSocket {
|
|
|
2738
3089
|
}>;
|
|
2739
3090
|
/** Leave a channel room */
|
|
2740
3091
|
leaveChannel(channelId: string): void;
|
|
3092
|
+
joinVoiceChannel(channelId: string, options?: {
|
|
3093
|
+
clientId?: string;
|
|
3094
|
+
muted?: boolean;
|
|
3095
|
+
deafened?: boolean;
|
|
3096
|
+
}): Promise<{
|
|
3097
|
+
ok: boolean;
|
|
3098
|
+
data?: ShadowVoiceJoinResult;
|
|
3099
|
+
error?: string;
|
|
3100
|
+
code?: string;
|
|
3101
|
+
}>;
|
|
3102
|
+
leaveVoiceChannel(channelId: string, options?: {
|
|
3103
|
+
clientId?: string | null;
|
|
3104
|
+
}): Promise<{
|
|
3105
|
+
ok: boolean;
|
|
3106
|
+
data?: ShadowVoiceLeaveResult;
|
|
3107
|
+
error?: string;
|
|
3108
|
+
code?: string;
|
|
3109
|
+
}>;
|
|
3110
|
+
renewVoiceCredentials(channelId: string, options?: {
|
|
3111
|
+
clientId?: string | null;
|
|
3112
|
+
}): Promise<{
|
|
3113
|
+
ok: boolean;
|
|
3114
|
+
data?: ShadowVoiceRenewResult;
|
|
3115
|
+
error?: string;
|
|
3116
|
+
code?: string;
|
|
3117
|
+
}>;
|
|
3118
|
+
updateVoiceState(channelId: string, data: {
|
|
3119
|
+
clientId?: string | null;
|
|
3120
|
+
muted?: boolean;
|
|
3121
|
+
deafened?: boolean;
|
|
3122
|
+
speaking?: boolean;
|
|
3123
|
+
screenSharing?: boolean;
|
|
3124
|
+
}): Promise<{
|
|
3125
|
+
ok: boolean;
|
|
3126
|
+
data?: unknown;
|
|
3127
|
+
error?: string;
|
|
3128
|
+
code?: string;
|
|
3129
|
+
}>;
|
|
3130
|
+
sendVoiceHeartbeat(channelId: string, options?: {
|
|
3131
|
+
clientId?: string | null;
|
|
3132
|
+
}): void;
|
|
2741
3133
|
/** Send a message via WebSocket (text-only; for file attachments use REST) */
|
|
2742
3134
|
sendMessage(data: {
|
|
2743
3135
|
channelId: string;
|
|
@@ -2755,4 +3147,40 @@ declare class ShadowSocket {
|
|
|
2755
3147
|
updateActivity(channelId: string, activity: string | null): void;
|
|
2756
3148
|
}
|
|
2757
3149
|
|
|
2758
|
-
|
|
3150
|
+
interface ShadowVoiceConsumerOptions {
|
|
3151
|
+
client: ShadowClient;
|
|
3152
|
+
channelId: string;
|
|
3153
|
+
clientId?: string;
|
|
3154
|
+
muted?: boolean;
|
|
3155
|
+
onRemoteAudio?: (input: {
|
|
3156
|
+
uid: string | number;
|
|
3157
|
+
track: IRemoteAudioTrack;
|
|
3158
|
+
}) => void;
|
|
3159
|
+
onRemoteScreen?: (input: {
|
|
3160
|
+
uid: string | number;
|
|
3161
|
+
track: IRemoteVideoTrack;
|
|
3162
|
+
}) => void;
|
|
3163
|
+
}
|
|
3164
|
+
declare class ShadowVoiceConsumer {
|
|
3165
|
+
private options;
|
|
3166
|
+
private rtc;
|
|
3167
|
+
private screenRtc;
|
|
3168
|
+
private audioTrack;
|
|
3169
|
+
private screenTrack;
|
|
3170
|
+
private session;
|
|
3171
|
+
private readonly clientId;
|
|
3172
|
+
private tokenRenewTimer;
|
|
3173
|
+
constructor(options: ShadowVoiceConsumerOptions);
|
|
3174
|
+
get joinResult(): ShadowVoiceJoinResult | null;
|
|
3175
|
+
join(): Promise<ShadowVoiceJoinResult>;
|
|
3176
|
+
setMuted(muted: boolean): Promise<void>;
|
|
3177
|
+
startScreenShare(): Promise<void>;
|
|
3178
|
+
stopScreenShare(): Promise<void>;
|
|
3179
|
+
leave(): Promise<void>;
|
|
3180
|
+
private bindTokenRenewal;
|
|
3181
|
+
private scheduleTokenRenewal;
|
|
3182
|
+
private clearTokenRenewal;
|
|
3183
|
+
private renewTokens;
|
|
3184
|
+
}
|
|
3185
|
+
|
|
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 };
|