@scalemule/sdk 0.0.57 → 0.0.59
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 +50 -0
- package/dist/index.d.mts +345 -1
- package/dist/index.d.ts +345 -1
- package/dist/index.js +264 -18
- package/dist/index.mjs +258 -18
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -183,6 +183,56 @@ MIME type and exposes a single hook for chat composers. See
|
|
|
183
183
|
for the decision tree (fast vs safe policy modes, private vs public visibility,
|
|
184
184
|
anti-patterns).
|
|
185
185
|
|
|
186
|
+
## Social and Policy
|
|
187
|
+
|
|
188
|
+
Use `sm.social` for graph primitives and `sm.socialPolicy` for privacy,
|
|
189
|
+
abuse-prevention, contact-request routing, block/report state, and audit-backed
|
|
190
|
+
decisions. Apps should not duplicate policy rules locally; ask the policy
|
|
191
|
+
service for a decision and let `effective_allowed`, `effective_decision`, and
|
|
192
|
+
`route` drive the UI.
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
const actor = { identity_id: personIdentityId, identity_type: 'person', user_id }
|
|
196
|
+
const target = { identity_id: businessIdentityId, identity_type: 'business', account_id }
|
|
197
|
+
|
|
198
|
+
const { data: decision, error } = await sm.socialPolicy.decideFollow(actor, target, {
|
|
199
|
+
appKey: 'coralmeet',
|
|
200
|
+
context: { context_type: 'personshare', context_id: shareId },
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
if (error) {
|
|
204
|
+
// Show retry/failure state.
|
|
205
|
+
} else if (decision!.effective_allowed) {
|
|
206
|
+
await sm.social.follow(targetUserId)
|
|
207
|
+
} else {
|
|
208
|
+
// Show decision.ui_message or route to a request/report flow.
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
For direct service integrations, use:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
await sm.socialPolicy.decide({
|
|
216
|
+
app_key: 'coralmeet',
|
|
217
|
+
actor,
|
|
218
|
+
target,
|
|
219
|
+
action: 'message_direct',
|
|
220
|
+
context: { conversation_id },
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
await sm.socialPolicy.block({
|
|
224
|
+
blocker_identity_id: actor.identity_id,
|
|
225
|
+
blocked_identity_id: target.identity_id,
|
|
226
|
+
reason: 'spam',
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
await sm.socialPolicy.report({
|
|
230
|
+
reporter_identity_id: actor.identity_id,
|
|
231
|
+
reported_identity_id: target.identity_id,
|
|
232
|
+
reason: 'spam',
|
|
233
|
+
})
|
|
234
|
+
```
|
|
235
|
+
|
|
186
236
|
## Storage
|
|
187
237
|
|
|
188
238
|
Use this for plain files that don't need image optimization or video
|
package/dist/index.d.mts
CHANGED
|
@@ -260,6 +260,13 @@ interface ClientContext {
|
|
|
260
260
|
deviceFingerprint?: string;
|
|
261
261
|
/** HTTP Referer header from the end-user's request */
|
|
262
262
|
referrer?: string;
|
|
263
|
+
/**
|
|
264
|
+
* End-user anonymous visitor ID, forwarded as `x-anonymous-id`. Set on
|
|
265
|
+
* unauthenticated requests so the backend can link the visitor's pre-auth
|
|
266
|
+
* activity to a registered user on login/register. Populated automatically
|
|
267
|
+
* by `extractClientContext()` when the upstream request carries the header.
|
|
268
|
+
*/
|
|
269
|
+
anonymousId?: string;
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
/**
|
|
@@ -331,6 +338,84 @@ declare function extractClientContext(request: IncomingRequestLike): ClientConte
|
|
|
331
338
|
*/
|
|
332
339
|
declare function buildClientContextHeaders(context: ClientContext | undefined): Record<string, string>;
|
|
333
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Anonymous-ID Contract (Shared)
|
|
343
|
+
*
|
|
344
|
+
* Single source of truth for the visitor's anonymous ID across every
|
|
345
|
+
* ScaleMule client package (`@scalemule/sdk`, `@scalemule/nextjs`, future
|
|
346
|
+
* react-native, etc).
|
|
347
|
+
*
|
|
348
|
+
* Why this lives here, in `@scalemule/sdk`:
|
|
349
|
+
* The platform contract is the HTTP header `x-anonymous-id`. The backend
|
|
350
|
+
* (`ms/scalemule-auth/src/handlers/register.rs`, `login.rs`, `oauth.rs`)
|
|
351
|
+
* reads that header to link anonymous activity to a newly registered user.
|
|
352
|
+
* If two packages disagree on the localStorage key they read/write, the
|
|
353
|
+
* visitor's analytics events and their `x-anonymous-id` header don't
|
|
354
|
+
* match, and the link pipeline attributes events to the wrong identity.
|
|
355
|
+
* Past drift: `@scalemule/nextjs` minted its own ID under `sm_anonymous_id`
|
|
356
|
+
* while this package wrote `scalemule_anonymous_id`. This module collapses
|
|
357
|
+
* that into one helper everyone calls.
|
|
358
|
+
*
|
|
359
|
+
* Migration:
|
|
360
|
+
* `ensureAnonymousId()` reads canonical first, falls back to the legacy
|
|
361
|
+
* key, and dual-writes both during the rollout window. The dual-write +
|
|
362
|
+
* legacy-read can be retired once every maintained `@scalemule/nextjs`
|
|
363
|
+
* consumer has been on a fixed version in production for two release
|
|
364
|
+
* cycles. Tracked in code by the comment near `LEGACY_ANONYMOUS_ID_KEYS`.
|
|
365
|
+
*/
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Canonical browser storage keys owned by `@scalemule/sdk`. Other packages
|
|
369
|
+
* MUST import these rather than redeclare their own strings.
|
|
370
|
+
*/
|
|
371
|
+
declare const STORAGE_KEYS: {
|
|
372
|
+
readonly SESSION: "scalemule_session";
|
|
373
|
+
readonly USER_ID: "scalemule_user_id";
|
|
374
|
+
readonly WORKSPACE_ID: "scalemule_workspace_id";
|
|
375
|
+
readonly ANONYMOUS_ID: "scalemule_anonymous_id";
|
|
376
|
+
readonly SESSION_POOL: "scalemule_session_pool";
|
|
377
|
+
readonly ACTIVE_ACCOUNT: "scalemule_active_account";
|
|
378
|
+
readonly KNOWN_ACCOUNTS: "scalemule_known_accounts";
|
|
379
|
+
readonly OFFLINE_QUEUE: "scalemule_offline_queue";
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Legacy anonymous-ID keys read for migration. Drop entries from this list
|
|
383
|
+
* once we're confident no shipping client still writes them.
|
|
384
|
+
*
|
|
385
|
+
* - `sm_anonymous_id`: previously minted by the `useAnalytics` hook in
|
|
386
|
+
* `@scalemule/nextjs` versions prior to the consolidation.
|
|
387
|
+
*/
|
|
388
|
+
declare const LEGACY_ANONYMOUS_ID_KEYS: readonly string[];
|
|
389
|
+
/** UUIDv4 generator with a graceful fallback for environments without `crypto.randomUUID`. */
|
|
390
|
+
declare function generateAnonymousId(): string;
|
|
391
|
+
/**
|
|
392
|
+
* Sync-style read of the canonical anonymous-ID without minting.
|
|
393
|
+
*
|
|
394
|
+
* Returns `null` if storage hasn't been touched yet. Useful when you want
|
|
395
|
+
* to check "is there already a cached ID" without triggering an async
|
|
396
|
+
* write. For the create-if-missing path, use `ensureAnonymousId()`.
|
|
397
|
+
*/
|
|
398
|
+
declare function readAnonymousId(storage: StorageAdapter): Promise<string | null>;
|
|
399
|
+
/**
|
|
400
|
+
* Read-or-create the anonymous ID with legacy-key migration and dual-write.
|
|
401
|
+
*
|
|
402
|
+
* Algorithm:
|
|
403
|
+
* 1. Read canonical key — if present, return it (no writes).
|
|
404
|
+
* 2. Read any legacy key — if present, promote it: write to canonical AND
|
|
405
|
+
* keep the legacy key in step with it so a stale tab running old code
|
|
406
|
+
* doesn't desync. Return the value.
|
|
407
|
+
* 3. No ID exists — mint a new UUID, dual-write canonical + legacy keys,
|
|
408
|
+
* return it.
|
|
409
|
+
*
|
|
410
|
+
* Concurrent callers against the same storage adapter are single-flighted
|
|
411
|
+
* — the second caller receives the same promise as the first.
|
|
412
|
+
*
|
|
413
|
+
* Idempotent. Safe to call on every request that needs the header. If you
|
|
414
|
+
* cache the result in memory on the client, you can avoid the storage
|
|
415
|
+
* round-trip after the first call.
|
|
416
|
+
*/
|
|
417
|
+
declare function ensureAnonymousId(storage: StorageAdapter): Promise<string>;
|
|
418
|
+
|
|
334
419
|
declare class ScaleMuleClient {
|
|
335
420
|
private apiKey;
|
|
336
421
|
private applicationId;
|
|
@@ -346,6 +431,7 @@ declare class ScaleMuleClient {
|
|
|
346
431
|
private offlineQueue;
|
|
347
432
|
private workspaceId;
|
|
348
433
|
private anonymousId;
|
|
434
|
+
private anonymousIdPromise;
|
|
349
435
|
private multiSessionEnabled;
|
|
350
436
|
private sessionPool;
|
|
351
437
|
private accountSwitcherEnabled;
|
|
@@ -365,7 +451,25 @@ declare class ScaleMuleClient {
|
|
|
365
451
|
getApplicationId(): string | null;
|
|
366
452
|
getUserId(): string | null;
|
|
367
453
|
isAuthenticated(): boolean;
|
|
454
|
+
/**
|
|
455
|
+
* Sync accessor for the cached anonymous ID. Returns `null` until either
|
|
456
|
+
* `initialize()` has run or `ensureAnonymousId()` has been awaited at
|
|
457
|
+
* least once. Use `ensureAnonymousId()` if you need a guaranteed value.
|
|
458
|
+
*/
|
|
368
459
|
getAnonymousId(): string | null;
|
|
460
|
+
/**
|
|
461
|
+
* Lazy-mint or cache-then-return the anonymous ID.
|
|
462
|
+
*
|
|
463
|
+
* Always returns a usable string. Callers that need to attach the
|
|
464
|
+
* `x-anonymous-id` header before `initialize()` has completed (rare —
|
|
465
|
+
* usually only the very first unauthenticated request from a freshly
|
|
466
|
+
* constructed client) should `await` this rather than relying on
|
|
467
|
+
* `getAnonymousId()`.
|
|
468
|
+
*
|
|
469
|
+
* Concurrent callers receive the same in-flight promise — no risk of
|
|
470
|
+
* two simultaneous first requests minting two distinct IDs.
|
|
471
|
+
*/
|
|
472
|
+
ensureAnonymousId(): Promise<string>;
|
|
369
473
|
isMultiSessionEnabled(): boolean;
|
|
370
474
|
/** Get all accounts in the session pool */
|
|
371
475
|
getSessionPool(): SessionPoolEntry[];
|
|
@@ -2665,6 +2769,245 @@ declare class SocialService extends ServiceModule {
|
|
|
2665
2769
|
}): Promise<ApiResponse<Comment>>;
|
|
2666
2770
|
}
|
|
2667
2771
|
|
|
2772
|
+
/**
|
|
2773
|
+
* Social Policy Service Module
|
|
2774
|
+
*
|
|
2775
|
+
* Thin SDK wrapper for scalemule-social-policy. The SDK exposes decisions,
|
|
2776
|
+
* settings, relationships, contact requests, blocks, mutes, reports, and
|
|
2777
|
+
* policy packs; policy rules remain server-owned.
|
|
2778
|
+
*/
|
|
2779
|
+
|
|
2780
|
+
type SocialPolicyIdentityType = 'person' | 'business' | 'workspace' | 'customer' | string;
|
|
2781
|
+
interface SocialPolicyIdentity {
|
|
2782
|
+
identity_id: string;
|
|
2783
|
+
identity_type: SocialPolicyIdentityType;
|
|
2784
|
+
user_id?: string | null;
|
|
2785
|
+
account_id?: string | null;
|
|
2786
|
+
}
|
|
2787
|
+
interface SocialPolicyContext {
|
|
2788
|
+
context_type?: string | null;
|
|
2789
|
+
context_id?: string | null;
|
|
2790
|
+
workspace_id?: string | null;
|
|
2791
|
+
conversation_id?: string | null;
|
|
2792
|
+
customer_space_id?: string | null;
|
|
2793
|
+
content_id?: string | null;
|
|
2794
|
+
}
|
|
2795
|
+
type SocialPolicyAction = 'message_direct' | 'message_request' | 'connect_request' | 'business_inquiry' | 'view_profile' | 'search_discover' | 'space_invite' | 'follow' | 'block' | 'report' | 'mute' | string;
|
|
2796
|
+
type SocialPolicyDecision = 'allow' | 'allow_with_warning' | 'route_to_requests' | 'route_to_business_inbox' | 'request_required' | 'deny_blocked' | 'throttle' | 'deny_policy' | string;
|
|
2797
|
+
interface SocialPolicyDecisionRequest {
|
|
2798
|
+
app_key?: string | null;
|
|
2799
|
+
account_id?: string | null;
|
|
2800
|
+
policy_pack?: string | null;
|
|
2801
|
+
actor: SocialPolicyIdentity;
|
|
2802
|
+
target: SocialPolicyIdentity;
|
|
2803
|
+
action: SocialPolicyAction;
|
|
2804
|
+
context?: SocialPolicyContext;
|
|
2805
|
+
metadata?: Record<string, unknown> | null;
|
|
2806
|
+
}
|
|
2807
|
+
interface SocialPolicyBatchDecisionTarget {
|
|
2808
|
+
identity_id: string;
|
|
2809
|
+
identity_type: SocialPolicyIdentityType;
|
|
2810
|
+
context?: SocialPolicyContext;
|
|
2811
|
+
}
|
|
2812
|
+
interface SocialPolicyBatchDecisionRequest {
|
|
2813
|
+
app_key?: string | null;
|
|
2814
|
+
account_id?: string | null;
|
|
2815
|
+
policy_pack?: string | null;
|
|
2816
|
+
actor: SocialPolicyIdentity;
|
|
2817
|
+
actions: SocialPolicyAction[];
|
|
2818
|
+
targets: SocialPolicyBatchDecisionTarget[];
|
|
2819
|
+
metadata?: Record<string, unknown> | null;
|
|
2820
|
+
}
|
|
2821
|
+
interface SocialPolicyDecisionLimits {
|
|
2822
|
+
remaining_today: number;
|
|
2823
|
+
reset_at: string;
|
|
2824
|
+
}
|
|
2825
|
+
interface SocialPolicyDecisionResponse {
|
|
2826
|
+
decision: SocialPolicyDecision;
|
|
2827
|
+
effective_decision: SocialPolicyDecision;
|
|
2828
|
+
allowed: boolean;
|
|
2829
|
+
effective_allowed: boolean;
|
|
2830
|
+
reason: string;
|
|
2831
|
+
policy_pack: string;
|
|
2832
|
+
policy_version: string;
|
|
2833
|
+
rollout_mode: 'shadow' | 'report_only' | 'enforce' | string;
|
|
2834
|
+
would_have_denied: boolean;
|
|
2835
|
+
route?: string | null;
|
|
2836
|
+
ui_message?: string | null;
|
|
2837
|
+
limits?: SocialPolicyDecisionLimits | null;
|
|
2838
|
+
requirements: string[];
|
|
2839
|
+
audit_id: string;
|
|
2840
|
+
}
|
|
2841
|
+
interface SocialPolicyBatchDecisionItem {
|
|
2842
|
+
action: SocialPolicyAction;
|
|
2843
|
+
target_identity_id: string;
|
|
2844
|
+
decision: SocialPolicyDecisionResponse;
|
|
2845
|
+
}
|
|
2846
|
+
interface SocialPolicyBatchDecisionResponse {
|
|
2847
|
+
decisions: SocialPolicyBatchDecisionItem[];
|
|
2848
|
+
}
|
|
2849
|
+
interface SocialPolicySettings {
|
|
2850
|
+
identity_id: string;
|
|
2851
|
+
policy_pack: string;
|
|
2852
|
+
profile_visibility: string;
|
|
2853
|
+
search_visibility: string;
|
|
2854
|
+
direct_message_policy: string;
|
|
2855
|
+
contact_request_policy: string;
|
|
2856
|
+
follow_policy: string;
|
|
2857
|
+
business_contact_policy: string;
|
|
2858
|
+
presence_visibility: string;
|
|
2859
|
+
}
|
|
2860
|
+
interface SocialPolicyUpdateSettingsRequest {
|
|
2861
|
+
account_id?: string | null;
|
|
2862
|
+
policy_pack?: string | null;
|
|
2863
|
+
profile_visibility?: string | null;
|
|
2864
|
+
search_visibility?: string | null;
|
|
2865
|
+
direct_message_policy?: string | null;
|
|
2866
|
+
contact_request_policy?: string | null;
|
|
2867
|
+
follow_policy?: string | null;
|
|
2868
|
+
business_contact_policy?: string | null;
|
|
2869
|
+
presence_visibility?: string | null;
|
|
2870
|
+
relationship_visibility?: string | null;
|
|
2871
|
+
mention_policy?: string | null;
|
|
2872
|
+
comment_policy?: string | null;
|
|
2873
|
+
invite_policy?: string | null;
|
|
2874
|
+
}
|
|
2875
|
+
interface SocialPolicyRelationshipRequest {
|
|
2876
|
+
account_id?: string | null;
|
|
2877
|
+
actor_identity_id: string;
|
|
2878
|
+
target_identity_id: string;
|
|
2879
|
+
relationship_type: string;
|
|
2880
|
+
direction?: string | null;
|
|
2881
|
+
status?: string | null;
|
|
2882
|
+
source_context_type?: string | null;
|
|
2883
|
+
source_context_id?: string | null;
|
|
2884
|
+
metadata?: Record<string, unknown> | null;
|
|
2885
|
+
}
|
|
2886
|
+
interface SocialPolicyRelationship {
|
|
2887
|
+
id: string;
|
|
2888
|
+
actor_identity_id: string;
|
|
2889
|
+
target_identity_id: string;
|
|
2890
|
+
relationship_type: string;
|
|
2891
|
+
status: string;
|
|
2892
|
+
}
|
|
2893
|
+
interface SocialPolicyRelationshipQuery {
|
|
2894
|
+
account_id?: string | null;
|
|
2895
|
+
identity_id?: string | null;
|
|
2896
|
+
relationship_type?: string | null;
|
|
2897
|
+
}
|
|
2898
|
+
interface SocialPolicyContactRequestRequest {
|
|
2899
|
+
account_id?: string | null;
|
|
2900
|
+
actor_identity_id: string;
|
|
2901
|
+
target_identity_id: string;
|
|
2902
|
+
request_type: string;
|
|
2903
|
+
intro_message?: string | null;
|
|
2904
|
+
context_type?: string | null;
|
|
2905
|
+
context_id?: string | null;
|
|
2906
|
+
metadata?: Record<string, unknown> | null;
|
|
2907
|
+
}
|
|
2908
|
+
interface SocialPolicyContactRequest {
|
|
2909
|
+
id: string;
|
|
2910
|
+
status: string;
|
|
2911
|
+
}
|
|
2912
|
+
interface SocialPolicyContactRequestQuery {
|
|
2913
|
+
account_id?: string | null;
|
|
2914
|
+
identity_id: string;
|
|
2915
|
+
status?: string | null;
|
|
2916
|
+
}
|
|
2917
|
+
interface SocialPolicyContactRequestListItem {
|
|
2918
|
+
id: string;
|
|
2919
|
+
actor_identity_id: string;
|
|
2920
|
+
target_identity_id: string;
|
|
2921
|
+
request_type: string;
|
|
2922
|
+
intro_message?: string | null;
|
|
2923
|
+
context_type?: string | null;
|
|
2924
|
+
context_id?: string | null;
|
|
2925
|
+
status: string;
|
|
2926
|
+
created_at: string;
|
|
2927
|
+
}
|
|
2928
|
+
interface SocialPolicyBlockRequest {
|
|
2929
|
+
account_id?: string | null;
|
|
2930
|
+
blocker_identity_id: string;
|
|
2931
|
+
blocked_identity_id: string;
|
|
2932
|
+
scope?: string | null;
|
|
2933
|
+
reason?: string | null;
|
|
2934
|
+
metadata?: Record<string, unknown> | null;
|
|
2935
|
+
}
|
|
2936
|
+
interface SocialPolicyUnblockRequest {
|
|
2937
|
+
account_id?: string | null;
|
|
2938
|
+
blocker_identity_id: string;
|
|
2939
|
+
blocked_identity_id: string;
|
|
2940
|
+
scope?: string | null;
|
|
2941
|
+
}
|
|
2942
|
+
interface SocialPolicyMuteRequest {
|
|
2943
|
+
account_id?: string | null;
|
|
2944
|
+
actor_identity_id: string;
|
|
2945
|
+
target_identity_id: string;
|
|
2946
|
+
context_type?: string | null;
|
|
2947
|
+
context_id?: string | null;
|
|
2948
|
+
metadata?: Record<string, unknown> | null;
|
|
2949
|
+
}
|
|
2950
|
+
interface SocialPolicyReportRequest {
|
|
2951
|
+
account_id?: string | null;
|
|
2952
|
+
reporter_identity_id: string;
|
|
2953
|
+
reported_identity_id: string;
|
|
2954
|
+
context_type?: string | null;
|
|
2955
|
+
context_id?: string | null;
|
|
2956
|
+
reason: string;
|
|
2957
|
+
details?: string | null;
|
|
2958
|
+
}
|
|
2959
|
+
interface SocialPolicyPolicyPack {
|
|
2960
|
+
id: string;
|
|
2961
|
+
version: string;
|
|
2962
|
+
rollout_mode: string;
|
|
2963
|
+
}
|
|
2964
|
+
declare class SocialPolicyService extends ServiceModule {
|
|
2965
|
+
protected basePath: string;
|
|
2966
|
+
decide(request: SocialPolicyDecisionRequest, options?: RequestOptions): Promise<ApiResponse<SocialPolicyDecisionResponse>>;
|
|
2967
|
+
batchDecide(request: SocialPolicyBatchDecisionRequest, options?: RequestOptions): Promise<ApiResponse<SocialPolicyBatchDecisionResponse>>;
|
|
2968
|
+
decideAction(action: SocialPolicyAction, actor: SocialPolicyIdentity, target: SocialPolicyIdentity, options?: {
|
|
2969
|
+
appKey?: string | null;
|
|
2970
|
+
accountId?: string | null;
|
|
2971
|
+
policyPack?: string | null;
|
|
2972
|
+
context?: SocialPolicyContext;
|
|
2973
|
+
metadata?: Record<string, unknown> | null;
|
|
2974
|
+
requestOptions?: RequestOptions;
|
|
2975
|
+
}): Promise<ApiResponse<SocialPolicyDecisionResponse>>;
|
|
2976
|
+
decideFollow(actor: SocialPolicyIdentity, target: SocialPolicyIdentity, options?: Parameters<SocialPolicyService['decideAction']>[3]): Promise<ApiResponse<SocialPolicyDecisionResponse>>;
|
|
2977
|
+
decideDirectMessage(actor: SocialPolicyIdentity, target: SocialPolicyIdentity, options?: Parameters<SocialPolicyService['decideAction']>[3]): Promise<ApiResponse<SocialPolicyDecisionResponse>>;
|
|
2978
|
+
decideContactRequest(actor: SocialPolicyIdentity, target: SocialPolicyIdentity, options?: Parameters<SocialPolicyService['decideAction']>[3]): Promise<ApiResponse<SocialPolicyDecisionResponse>>;
|
|
2979
|
+
getSettings(identityId: string, options?: RequestOptions): Promise<ApiResponse<SocialPolicySettings>>;
|
|
2980
|
+
updateSettings(identityId: string, request: SocialPolicyUpdateSettingsRequest, options?: RequestOptions): Promise<ApiResponse<SocialPolicySettings>>;
|
|
2981
|
+
createRelationship(request: SocialPolicyRelationshipRequest, options?: RequestOptions): Promise<ApiResponse<SocialPolicyRelationship>>;
|
|
2982
|
+
listRelationships(params?: SocialPolicyRelationshipQuery, options?: RequestOptions): Promise<ApiResponse<SocialPolicyRelationship[]>>;
|
|
2983
|
+
deleteRelationship(relationshipId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
2984
|
+
deleted: boolean;
|
|
2985
|
+
}>>;
|
|
2986
|
+
createContactRequest(request: SocialPolicyContactRequestRequest, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequest>>;
|
|
2987
|
+
listContactRequestInbox(params: SocialPolicyContactRequestQuery, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequestListItem[]>>;
|
|
2988
|
+
listContactRequestSent(params: SocialPolicyContactRequestQuery, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequestListItem[]>>;
|
|
2989
|
+
acceptContactRequest(requestId: string, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequest>>;
|
|
2990
|
+
ignoreContactRequest(requestId: string, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequest>>;
|
|
2991
|
+
declineContactRequest(requestId: string, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequest>>;
|
|
2992
|
+
reportContactRequest(requestId: string, options?: RequestOptions): Promise<ApiResponse<SocialPolicyContactRequest>>;
|
|
2993
|
+
block(request: SocialPolicyBlockRequest, options?: RequestOptions): Promise<ApiResponse<{
|
|
2994
|
+
blocked: boolean;
|
|
2995
|
+
}>>;
|
|
2996
|
+
unblock(request: SocialPolicyUnblockRequest, options?: RequestOptions): Promise<ApiResponse<{
|
|
2997
|
+
unblocked: boolean;
|
|
2998
|
+
}>>;
|
|
2999
|
+
mute(request: SocialPolicyMuteRequest, options?: RequestOptions): Promise<ApiResponse<{
|
|
3000
|
+
muted: boolean;
|
|
3001
|
+
}>>;
|
|
3002
|
+
unmute(request: SocialPolicyMuteRequest, options?: RequestOptions): Promise<ApiResponse<{
|
|
3003
|
+
unmuted: boolean;
|
|
3004
|
+
}>>;
|
|
3005
|
+
report(request: SocialPolicyReportRequest, options?: RequestOptions): Promise<ApiResponse<{
|
|
3006
|
+
reported: boolean;
|
|
3007
|
+
}>>;
|
|
3008
|
+
listPolicyPacks(options?: RequestOptions): Promise<ApiResponse<SocialPolicyPolicyPack[]>>;
|
|
3009
|
+
}
|
|
3010
|
+
|
|
2668
3011
|
/**
|
|
2669
3012
|
* Referrals Service Module
|
|
2670
3013
|
*
|
|
@@ -6894,6 +7237,7 @@ declare class ScaleMule {
|
|
|
6894
7237
|
readonly chat: ChatService;
|
|
6895
7238
|
readonly conference: ConferenceService;
|
|
6896
7239
|
readonly social: SocialService;
|
|
7240
|
+
readonly socialPolicy: SocialPolicyService;
|
|
6897
7241
|
readonly referrals: ReferralsService;
|
|
6898
7242
|
readonly billing: BillingService;
|
|
6899
7243
|
readonly analytics: AnalyticsService;
|
|
@@ -6996,4 +7340,4 @@ declare class ScaleMule {
|
|
|
6996
7340
|
getClient(): ScaleMuleClient;
|
|
6997
7341
|
}
|
|
6998
7342
|
|
|
6999
|
-
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
7343
|
+
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|