@amityco/ts-sdk 7.22.1-91aedde.0 → 7.22.1-a2fdd03.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,23 @@ export declare const enum MembershipAcceptanceTypeEnum {
5
5
  AUTOMATIC = "automatic",
6
6
  INVITATION = "invitation"
7
7
  }
8
+ export declare enum AmityAutoSubscription {
9
+ CHAT = "chat",
10
+ NETWORK = "network",
11
+ LIVESTREAM = "livestream",
12
+ BLOCK = "block"
13
+ }
8
14
  declare global {
9
15
  namespace Amity {
10
16
  type Logger = (topic: string, ...args: any[]) => void;
11
17
  type MembershipAcceptanceType = MembershipAcceptanceTypeEnum;
18
+ type AutoSubscription = AmityAutoSubscription;
19
+ type AutoSubscriptionState = {
20
+ feature: Amity.AutoSubscription;
21
+ isActive: boolean;
22
+ isSystem: boolean;
23
+ topicCount: number;
24
+ };
12
25
  const enum TokenTerminationReason {
13
26
  GLOBAL_BAN = "globalBan",
14
27
  USER_DELETED = "userDeleted",
@@ -43,6 +56,7 @@ declare global {
43
56
  use: () => void;
44
57
  accessTokenExpiryWatcher: () => Amity.Unsubscriber;
45
58
  getFeedSettings: () => Promise<Amity.FeedSettings>;
59
+ getCoreUserSettings: () => Promise<Amity.CoreUserSettings>;
46
60
  getSocialSettings: () => Promise<Amity.SocialSettings>;
47
61
  getChatSettings: () => Promise<Amity.ChatSettings>;
48
62
  getMessagePreviewSetting: (refresh?: boolean) => Promise<Amity.MessagePreviewSetting>;
@@ -126,6 +140,9 @@ declare global {
126
140
  userPrivacySetting: 'public' | 'private';
127
141
  membershipAcceptance: Amity.MembershipAcceptanceType;
128
142
  };
143
+ type CoreUserSettings = {
144
+ isAllowUpdateDisplayName: boolean;
145
+ };
129
146
  type ProductCatalogueSetting = {
130
147
  product: {
131
148
  enabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/client.ts"],"names":[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C;KACH;CACF"}
@@ -1,10 +1,7 @@
1
- import { AutoSubscription, AutoSubscriptionState } from '~/client/utils/autoSubscriptionManager';
2
- export { AutoSubscription } from '~/client/utils/autoSubscriptionManager';
3
- export type { AutoSubscriptionState } from '~/client/utils/autoSubscriptionManager';
4
1
  /**
5
2
  * ```js
6
- * import { Client } from '@amityco/ts-sdk'
7
- * Client.enableAutoSubscriptions([Client.AutoSubscription.BLOCK])
3
+ * import { Client, AmityAutoSubscription } from '@amityco/ts-sdk'
4
+ * Client.enableAutoSubscriptions([AmityAutoSubscription.BLOCK])
8
5
  * ```
9
6
  *
10
7
  * Enables one or more managed auto-subscription handles. Managed handles are
@@ -13,26 +10,26 @@ export type { AutoSubscriptionState } from '~/client/utils/autoSubscriptionManag
13
10
  * {@link disableAutoSubscriptions}. Synchronous fire-and-forget — the registry
14
11
  * updates immediately and the broker subscribe is retried on reconnect.
15
12
  *
16
- * @param features the {@link AutoSubscription} handles to enable
13
+ * @param features the {@link AmityAutoSubscription} handles to enable
17
14
  *
18
15
  * @category Client API
19
16
  */
20
- export declare const enableAutoSubscriptions: (features: AutoSubscription[]) => void;
17
+ export declare const enableAutoSubscriptions: (features: Amity.AutoSubscription[]) => void;
21
18
  /**
22
19
  * ```js
23
- * import { Client } from '@amityco/ts-sdk'
24
- * Client.disableAutoSubscriptions([Client.AutoSubscription.LIVESTREAM])
20
+ * import { Client, AmityAutoSubscription } from '@amityco/ts-sdk'
21
+ * Client.disableAutoSubscriptions([AmityAutoSubscription.LIVESTREAM])
25
22
  * ```
26
23
  *
27
24
  * Disables one or more managed auto-subscription handles. The change persists
28
25
  * across reconnect (it is not silently re-enabled) until
29
26
  * {@link enableAutoSubscriptions} is called again. Synchronous fire-and-forget.
30
27
  *
31
- * @param features the {@link AutoSubscription} handles to disable
28
+ * @param features the {@link AmityAutoSubscription} handles to disable
32
29
  *
33
30
  * @category Client API
34
31
  */
35
- export declare const disableAutoSubscriptions: (features: AutoSubscription[]) => void;
32
+ export declare const disableAutoSubscriptions: (features: Amity.AutoSubscription[]) => void;
36
33
  /**
37
34
  * ```js
38
35
  * import { Client } from '@amityco/ts-sdk'
@@ -46,5 +43,5 @@ export declare const disableAutoSubscriptions: (features: AutoSubscription[]) =>
46
43
  *
47
44
  * @category Client API
48
45
  */
49
- export declare const autoSubscriptions: () => AutoSubscriptionState[];
46
+ export declare const autoSubscriptions: () => Amity.AutoSubscriptionState[];
50
47
  //# sourceMappingURL=autoSubscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autoSubscription.d.ts","sourceRoot":"","sources":["../../../src/client/api/autoSubscription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAKpF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,aAAc,gBAAgB,EAAE,KAAG,IAGtE,CAAC;AAMF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,aAAc,gBAAgB,EAAE,KAAG,IAGvE,CAAC;AAMF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,QAAO,qBAAqB,EACZ,CAAC"}
1
+ {"version":3,"file":"autoSubscription.d.ts","sourceRoot":"","sources":["../../../src/client/api/autoSubscription.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,aAAc,MAAM,gBAAgB,EAAE,KAAG,IAG5E,CAAC;AAMF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,aAAc,MAAM,gBAAgB,EAAE,KAAG,IAG7E,CAAC;AAMF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAAM,qBAAqB,EAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../../src/client/api/createClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAc,MAAM,0BAA0B,CAAC;AAoBnE;;;;;;;;;;;;;;;KAeK;AACL,eAAO,MAAM,YAAY,WACf,MAAM,cACH,CAAA,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;;;;;;;;;MAYtD,MAAM,MA+FR,CAAC"}
1
+ {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../../src/client/api/createClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAc,MAAM,0BAA0B,CAAC;AAsBnE;;;;;;;;;;;;;;;KAeK;AACL,eAAO,MAAM,YAAY,WACf,MAAM,cACH,CAAA,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;;;;;;;;;MAYtD,MAAM,MAiGR,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ```js
3
+ * import { createClient } from '@amityco/ts-sdk'
4
+ * const client = createClient(apiKey, apiRegion)
5
+ * const userSettings = await client.getCoreUserSettings()
6
+ * ```
7
+ *
8
+ * Fetches a {@link Amity.CoreUserSettings} object
9
+ *
10
+ * @returns A Promise of {@link Amity.CoreUserSettings} object
11
+ *
12
+ * @category Client API
13
+ * @async
14
+ */
15
+ export declare const getCoreUserSettings: () => Promise<Amity.CoreUserSettings>;
16
+ //# sourceMappingURL=getCoreUserSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCoreUserSettings.d.ts","sourceRoot":"","sources":["../../../src/client/api/getCoreUserSettings.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,QAAa,QAAQ,MAAM,gBAAgB,CAM1E,CAAC"}
@@ -23,6 +23,7 @@ export * from './getCurrentUser';
23
23
  export * from './getCurrentUserType';
24
24
  export * from './setAccessTokenHandler';
25
25
  export * from './getChatSettings';
26
+ export * from './getCoreUserSettings';
26
27
  export * from './notifications';
27
28
  export * from './autoSubscription';
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,cAAc,cAAc,CAAC;AAE7B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAE9B,cAAc,mBAAmB,CAAC;AAElC,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAE7B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iCAAiC,CAAC;AAEhD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AAErC,cAAc,yBAAyB,CAAC;AAExC,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,cAAc,cAAc,CAAC;AAE7B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAE9B,cAAc,mBAAmB,CAAC;AAElC,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAE7B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iCAAiC,CAAC;AAEhD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AAErC,cAAc,yBAAyB,CAAC;AAExC,cAAc,mBAAmB,CAAC;AAElC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC"}
@@ -1,23 +1,3 @@
1
- /** Feature-grouped real-time handles; all default-on, toggleable per handle. */
2
- export declare enum AutoSubscription {
3
- /** SMART_CHANNEL + SMART_MESSAGE + SMART_MESSAGE_FEED — chat "smart" real-time. */
4
- CHAT = "chat",
5
- /** Network-wide events (e.g. global ban). */
6
- NETWORK = "network",
7
- /** Livestream state events. */
8
- LIVESTREAM = "livestream",
9
- /** Both membership wildcards (followers + followings) — block real-time. */
10
- BLOCK = "block"
11
- }
12
- export interface AutoSubscriptionState {
13
- feature: AutoSubscription;
14
- /** currently subscribed */
15
- isActive: boolean;
16
- /** backs a core SDK feature (turning it off degrades that feature) */
17
- isSystem: boolean;
18
- /** underlying MQTT topics (broker slots) this handle consumes */
19
- topicCount: number;
20
- }
21
1
  /** Ref-counted, reconnect-resilient registry of the managed auto-subscriptions. */
22
2
  declare class AutoSubscriptionManager {
23
3
  private readonly refCountByFeature;
@@ -29,9 +9,9 @@ declare class AutoSubscriptionManager {
29
9
  private unsubscribeTopics;
30
10
  /** Subscribe every enabled handle's topics, converging the broker to the registry. Called on each (re)connect. */
31
11
  initialize(): void;
32
- subscribe(feature: AutoSubscription): void;
33
- unsubscribe(feature: AutoSubscription): void;
34
- subscriptions(): AutoSubscriptionState[];
12
+ subscribe(feature: Amity.AutoSubscription): void;
13
+ unsubscribe(feature: Amity.AutoSubscription): void;
14
+ subscriptions(): Amity.AutoSubscriptionState[];
35
15
  reset(): void;
36
16
  }
37
17
  export declare const getAutoSubscriptionManager: () => AutoSubscriptionManager;
@@ -1 +1 @@
1
- {"version":3,"file":"autoSubscriptionManager.d.ts","sourceRoot":"","sources":["../../../src/client/utils/autoSubscriptionManager.ts"],"names":[],"mappings":"AAYA,gFAAgF;AAChF,oBAAY,gBAAgB;IAC1B,mFAAmF;IACnF,IAAI,SAAS;IACb,6CAA6C;IAC7C,OAAO,YAAY;IACnB,+BAA+B;IAC/B,UAAU,eAAe;IACzB,4EAA4E;IAC5E,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,2BAA2B;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;CACpB;AAyBD,mFAAmF;AACnF,cAAM,uBAAuB;IAC3B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuC;IAEzE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqD;;IAM/E,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,iBAAiB;IAKzB,kHAAkH;IAClH,UAAU;IAMV,SAAS,CAAC,OAAO,EAAE,gBAAgB;IAMnC,WAAW,CAAC,OAAO,EAAE,gBAAgB;IAMrC,aAAa,IAAI,qBAAqB,EAAE;IASxC,KAAK;CAKN;AAID,eAAO,MAAM,0BAA0B,QAAO,uBAG7C,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,QAAO,MAAM,YAGpD,CAAC"}
1
+ {"version":3,"file":"autoSubscriptionManager.d.ts","sourceRoot":"","sources":["../../../src/client/utils/autoSubscriptionManager.ts"],"names":[],"mappings":"AAoCA,mFAAmF;AACnF,cAAM,uBAAuB;IAC3B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6C;IAE/E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2D;;IAMrF,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,iBAAiB;IAKzB,kHAAkH;IAClH,UAAU;IAMV,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,gBAAgB;IAMzC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,gBAAgB;IAM3C,aAAa,IAAI,KAAK,CAAC,qBAAqB,EAAE;IAS9C,KAAK;CAKN;AAID,eAAO,MAAM,0BAA0B,QAAO,uBAG7C,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,QAAO,MAAM,YAGpD,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -28,6 +28,13 @@ exports.MembershipAcceptanceTypeEnum = void 0;
28
28
  MembershipAcceptanceTypeEnum["AUTOMATIC"] = "automatic";
29
29
  MembershipAcceptanceTypeEnum["INVITATION"] = "invitation";
30
30
  })(exports.MembershipAcceptanceTypeEnum || (exports.MembershipAcceptanceTypeEnum = {}));
31
+ exports.AmityAutoSubscription = void 0;
32
+ (function (AmityAutoSubscription) {
33
+ AmityAutoSubscription["CHAT"] = "chat";
34
+ AmityAutoSubscription["NETWORK"] = "network";
35
+ AmityAutoSubscription["LIVESTREAM"] = "livestream";
36
+ AmityAutoSubscription["BLOCK"] = "block";
37
+ })(exports.AmityAutoSubscription || (exports.AmityAutoSubscription = {}));
31
38
 
32
39
  exports.UserTypeEnum = void 0;
33
40
  (function (UserTypeEnum) {
@@ -4766,35 +4773,23 @@ var SessionWatcher$1 = {
4766
4773
  */
4767
4774
  const onSessionStateChange = (callback) => SessionWatcher$1.getInstance().onSessionStateChange(callback);
4768
4775
 
4769
- /** Feature-grouped real-time handles; all default-on, toggleable per handle. */
4770
- var AutoSubscription;
4771
- (function (AutoSubscription) {
4772
- /** SMART_CHANNEL + SMART_MESSAGE + SMART_MESSAGE_FEED — chat "smart" real-time. */
4773
- AutoSubscription["CHAT"] = "chat";
4774
- /** Network-wide events (e.g. global ban). */
4775
- AutoSubscription["NETWORK"] = "network";
4776
- /** Livestream state events. */
4777
- AutoSubscription["LIVESTREAM"] = "livestream";
4778
- /** Both membership wildcards (followers + followings) — block real-time. */
4779
- AutoSubscription["BLOCK"] = "block";
4780
- })(AutoSubscription || (AutoSubscription = {}));
4781
4776
  const TOPICS = {
4782
- [AutoSubscription.NETWORK]: [getNetworkTopic],
4783
- [AutoSubscription.CHAT]: [
4777
+ [exports.AmityAutoSubscription.NETWORK]: [getNetworkTopic],
4778
+ [exports.AmityAutoSubscription.CHAT]: [
4784
4779
  getSmartFeedChannelTopic,
4785
4780
  getSmartFeedSubChannelTopic,
4786
4781
  getSmartFeedMessageTopic,
4787
4782
  ],
4788
- [AutoSubscription.LIVESTREAM]: [getLiveStreamTopic],
4789
- [AutoSubscription.BLOCK]: [getMyFollowersTopic, getMyFollowingsTopic],
4783
+ [exports.AmityAutoSubscription.LIVESTREAM]: [getLiveStreamTopic],
4784
+ [exports.AmityAutoSubscription.BLOCK]: [getMyFollowersTopic, getMyFollowingsTopic],
4790
4785
  };
4791
4786
  const DEFAULT_TOPICS = [
4792
- AutoSubscription.CHAT,
4793
- AutoSubscription.NETWORK,
4794
- AutoSubscription.LIVESTREAM,
4795
- AutoSubscription.BLOCK,
4787
+ exports.AmityAutoSubscription.CHAT,
4788
+ exports.AmityAutoSubscription.NETWORK,
4789
+ exports.AmityAutoSubscription.LIVESTREAM,
4790
+ exports.AmityAutoSubscription.BLOCK,
4796
4791
  ];
4797
- const ALL_FEATURES = Object.values(AutoSubscription);
4792
+ const ALL_FEATURES = Object.values(exports.AmityAutoSubscription);
4798
4793
  /** Ref-counted, reconnect-resilient registry of the managed auto-subscriptions. */
4799
4794
  class AutoSubscriptionManager {
4800
4795
  constructor() {
@@ -7544,6 +7539,26 @@ const getSocialSettings = async () => {
7544
7539
  return data.socialNetworkSetting;
7545
7540
  };
7546
7541
 
7542
+ /**
7543
+ * ```js
7544
+ * import { createClient } from '@amityco/ts-sdk'
7545
+ * const client = createClient(apiKey, apiRegion)
7546
+ * const userSettings = await client.getCoreUserSettings()
7547
+ * ```
7548
+ *
7549
+ * Fetches a {@link Amity.CoreUserSettings} object
7550
+ *
7551
+ * @returns A Promise of {@link Amity.CoreUserSettings} object
7552
+ *
7553
+ * @category Client API
7554
+ * @async
7555
+ */
7556
+ const getCoreUserSettings = async () => {
7557
+ const client = getActiveClient();
7558
+ const { data } = await client.http.get(`/api/v3/network-settings/users`);
7559
+ return data;
7560
+ };
7561
+
7547
7562
  /* begin_public_function
7548
7563
  id: client.getProductCatalogueSetting
7549
7564
  */
@@ -10745,7 +10760,9 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
10745
10760
  validateUrls,
10746
10761
  validateTexts,
10747
10762
  getFeedSettings,
10763
+ getCoreUserSettings,
10748
10764
  getSocialSettings,
10765
+ getChatSettings,
10749
10766
  getVisitorDeviceId: getDeviceId,
10750
10767
  getMessagePreviewSetting,
10751
10768
  use: () => setActiveClient(client),
@@ -11394,8 +11411,8 @@ const notifications = () => new Notifications();
11394
11411
  */
11395
11412
  /**
11396
11413
  * ```js
11397
- * import { Client } from '@amityco/ts-sdk'
11398
- * Client.enableAutoSubscriptions([Client.AutoSubscription.BLOCK])
11414
+ * import { Client, AmityAutoSubscription } from '@amityco/ts-sdk'
11415
+ * Client.enableAutoSubscriptions([AmityAutoSubscription.BLOCK])
11399
11416
  * ```
11400
11417
  *
11401
11418
  * Enables one or more managed auto-subscription handles. Managed handles are
@@ -11404,7 +11421,7 @@ const notifications = () => new Notifications();
11404
11421
  * {@link disableAutoSubscriptions}. Synchronous fire-and-forget — the registry
11405
11422
  * updates immediately and the broker subscribe is retried on reconnect.
11406
11423
  *
11407
- * @param features the {@link AutoSubscription} handles to enable
11424
+ * @param features the {@link AmityAutoSubscription} handles to enable
11408
11425
  *
11409
11426
  * @category Client API
11410
11427
  */
@@ -11418,15 +11435,15 @@ const enableAutoSubscriptions = (features) => {
11418
11435
  */
11419
11436
  /**
11420
11437
  * ```js
11421
- * import { Client } from '@amityco/ts-sdk'
11422
- * Client.disableAutoSubscriptions([Client.AutoSubscription.LIVESTREAM])
11438
+ * import { Client, AmityAutoSubscription } from '@amityco/ts-sdk'
11439
+ * Client.disableAutoSubscriptions([AmityAutoSubscription.LIVESTREAM])
11423
11440
  * ```
11424
11441
  *
11425
11442
  * Disables one or more managed auto-subscription handles. The change persists
11426
11443
  * across reconnect (it is not silently re-enabled) until
11427
11444
  * {@link enableAutoSubscriptions} is called again. Synchronous fire-and-forget.
11428
11445
  *
11429
- * @param features the {@link AutoSubscription} handles to disable
11446
+ * @param features the {@link AmityAutoSubscription} handles to disable
11430
11447
  *
11431
11448
  * @category Client API
11432
11449
  */
@@ -11835,8 +11852,8 @@ var index$s = /*#__PURE__*/Object.freeze({
11835
11852
  setCurrentUserType: setCurrentUserType,
11836
11853
  setAccessTokenHandler: setAccessTokenHandler,
11837
11854
  getChatSettings: getChatSettings,
11855
+ getCoreUserSettings: getCoreUserSettings,
11838
11856
  notifications: notifications,
11839
- get AutoSubscription () { return AutoSubscription; },
11840
11857
  enableAutoSubscriptions: enableAutoSubscriptions,
11841
11858
  disableAutoSubscriptions: disableAutoSubscriptions,
11842
11859
  autoSubscriptions: autoSubscriptions,
package/dist/index.esm.js CHANGED
@@ -13,6 +13,13 @@ var MembershipAcceptanceTypeEnum;
13
13
  MembershipAcceptanceTypeEnum["AUTOMATIC"] = "automatic";
14
14
  MembershipAcceptanceTypeEnum["INVITATION"] = "invitation";
15
15
  })(MembershipAcceptanceTypeEnum || (MembershipAcceptanceTypeEnum = {}));
16
+ var AmityAutoSubscription;
17
+ (function (AmityAutoSubscription) {
18
+ AmityAutoSubscription["CHAT"] = "chat";
19
+ AmityAutoSubscription["NETWORK"] = "network";
20
+ AmityAutoSubscription["LIVESTREAM"] = "livestream";
21
+ AmityAutoSubscription["BLOCK"] = "block";
22
+ })(AmityAutoSubscription || (AmityAutoSubscription = {}));
16
23
 
17
24
  var UserTypeEnum;
18
25
  (function (UserTypeEnum) {
@@ -20842,35 +20849,23 @@ var SessionWatcher$1 = {
20842
20849
  */
20843
20850
  const onSessionStateChange = (callback) => SessionWatcher$1.getInstance().onSessionStateChange(callback);
20844
20851
 
20845
- /** Feature-grouped real-time handles; all default-on, toggleable per handle. */
20846
- var AutoSubscription;
20847
- (function (AutoSubscription) {
20848
- /** SMART_CHANNEL + SMART_MESSAGE + SMART_MESSAGE_FEED — chat "smart" real-time. */
20849
- AutoSubscription["CHAT"] = "chat";
20850
- /** Network-wide events (e.g. global ban). */
20851
- AutoSubscription["NETWORK"] = "network";
20852
- /** Livestream state events. */
20853
- AutoSubscription["LIVESTREAM"] = "livestream";
20854
- /** Both membership wildcards (followers + followings) — block real-time. */
20855
- AutoSubscription["BLOCK"] = "block";
20856
- })(AutoSubscription || (AutoSubscription = {}));
20857
20852
  const TOPICS = {
20858
- [AutoSubscription.NETWORK]: [getNetworkTopic],
20859
- [AutoSubscription.CHAT]: [
20853
+ [AmityAutoSubscription.NETWORK]: [getNetworkTopic],
20854
+ [AmityAutoSubscription.CHAT]: [
20860
20855
  getSmartFeedChannelTopic,
20861
20856
  getSmartFeedSubChannelTopic,
20862
20857
  getSmartFeedMessageTopic,
20863
20858
  ],
20864
- [AutoSubscription.LIVESTREAM]: [getLiveStreamTopic],
20865
- [AutoSubscription.BLOCK]: [getMyFollowersTopic, getMyFollowingsTopic],
20859
+ [AmityAutoSubscription.LIVESTREAM]: [getLiveStreamTopic],
20860
+ [AmityAutoSubscription.BLOCK]: [getMyFollowersTopic, getMyFollowingsTopic],
20866
20861
  };
20867
20862
  const DEFAULT_TOPICS = [
20868
- AutoSubscription.CHAT,
20869
- AutoSubscription.NETWORK,
20870
- AutoSubscription.LIVESTREAM,
20871
- AutoSubscription.BLOCK,
20863
+ AmityAutoSubscription.CHAT,
20864
+ AmityAutoSubscription.NETWORK,
20865
+ AmityAutoSubscription.LIVESTREAM,
20866
+ AmityAutoSubscription.BLOCK,
20872
20867
  ];
20873
- const ALL_FEATURES = Object.values(AutoSubscription);
20868
+ const ALL_FEATURES = Object.values(AmityAutoSubscription);
20874
20869
  /** Ref-counted, reconnect-resilient registry of the managed auto-subscriptions. */
20875
20870
  class AutoSubscriptionManager {
20876
20871
  constructor() {
@@ -23636,6 +23631,26 @@ const getSocialSettings = async () => {
23636
23631
  return data.socialNetworkSetting;
23637
23632
  };
23638
23633
 
23634
+ /**
23635
+ * ```js
23636
+ * import { createClient } from '@amityco/ts-sdk'
23637
+ * const client = createClient(apiKey, apiRegion)
23638
+ * const userSettings = await client.getCoreUserSettings()
23639
+ * ```
23640
+ *
23641
+ * Fetches a {@link Amity.CoreUserSettings} object
23642
+ *
23643
+ * @returns A Promise of {@link Amity.CoreUserSettings} object
23644
+ *
23645
+ * @category Client API
23646
+ * @async
23647
+ */
23648
+ const getCoreUserSettings = async () => {
23649
+ const client = getActiveClient();
23650
+ const { data } = await client.http.get(`/api/v3/network-settings/users`);
23651
+ return data;
23652
+ };
23653
+
23639
23654
  /* begin_public_function
23640
23655
  id: client.getProductCatalogueSetting
23641
23656
  */
@@ -26837,7 +26852,9 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
26837
26852
  validateUrls,
26838
26853
  validateTexts,
26839
26854
  getFeedSettings,
26855
+ getCoreUserSettings,
26840
26856
  getSocialSettings,
26857
+ getChatSettings,
26841
26858
  getVisitorDeviceId: getDeviceId,
26842
26859
  getMessagePreviewSetting,
26843
26860
  use: () => setActiveClient(client),
@@ -27486,8 +27503,8 @@ const notifications = () => new Notifications();
27486
27503
  */
27487
27504
  /**
27488
27505
  * ```js
27489
- * import { Client } from '@amityco/ts-sdk'
27490
- * Client.enableAutoSubscriptions([Client.AutoSubscription.BLOCK])
27506
+ * import { Client, AmityAutoSubscription } from '@amityco/ts-sdk'
27507
+ * Client.enableAutoSubscriptions([AmityAutoSubscription.BLOCK])
27491
27508
  * ```
27492
27509
  *
27493
27510
  * Enables one or more managed auto-subscription handles. Managed handles are
@@ -27496,7 +27513,7 @@ const notifications = () => new Notifications();
27496
27513
  * {@link disableAutoSubscriptions}. Synchronous fire-and-forget — the registry
27497
27514
  * updates immediately and the broker subscribe is retried on reconnect.
27498
27515
  *
27499
- * @param features the {@link AutoSubscription} handles to enable
27516
+ * @param features the {@link AmityAutoSubscription} handles to enable
27500
27517
  *
27501
27518
  * @category Client API
27502
27519
  */
@@ -27510,15 +27527,15 @@ const enableAutoSubscriptions = (features) => {
27510
27527
  */
27511
27528
  /**
27512
27529
  * ```js
27513
- * import { Client } from '@amityco/ts-sdk'
27514
- * Client.disableAutoSubscriptions([Client.AutoSubscription.LIVESTREAM])
27530
+ * import { Client, AmityAutoSubscription } from '@amityco/ts-sdk'
27531
+ * Client.disableAutoSubscriptions([AmityAutoSubscription.LIVESTREAM])
27515
27532
  * ```
27516
27533
  *
27517
27534
  * Disables one or more managed auto-subscription handles. The change persists
27518
27535
  * across reconnect (it is not silently re-enabled) until
27519
27536
  * {@link enableAutoSubscriptions} is called again. Synchronous fire-and-forget.
27520
27537
  *
27521
- * @param features the {@link AutoSubscription} handles to disable
27538
+ * @param features the {@link AmityAutoSubscription} handles to disable
27522
27539
  *
27523
27540
  * @category Client API
27524
27541
  */
@@ -27927,8 +27944,8 @@ var index$s = /*#__PURE__*/Object.freeze({
27927
27944
  setCurrentUserType: setCurrentUserType,
27928
27945
  setAccessTokenHandler: setAccessTokenHandler,
27929
27946
  getChatSettings: getChatSettings,
27947
+ getCoreUserSettings: getCoreUserSettings,
27930
27948
  notifications: notifications,
27931
- get AutoSubscription () { return AutoSubscription; },
27932
27949
  enableAutoSubscriptions: enableAutoSubscriptions,
27933
27950
  disableAutoSubscriptions: disableAutoSubscriptions,
27934
27951
  autoSubscriptions: autoSubscriptions,
@@ -53349,4 +53366,4 @@ class AmityAttachmentProductTags {
53349
53366
  }
53350
53367
  }
53351
53368
 
53352
- export { API_REGIONS, index$5 as AdRepository, AmityAttachmentProductTags, AmityChannelNotificationModeEnum, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmitySharableContentType, AnalyticsSourceTypeEnum, index$f as CategoryRepository, index$j as ChannelRepository, index$s as Client, index$e as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$g as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$1 as EventRepository, FeedDataTypeEnum, index$d as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$p as FileRepository, FileType, GET_WATCHER_URLS, index$3 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$2 as LiveReactionRepository, index$7 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$n as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$8 as PollRepository, PostContentType, index$b as PostRepository, PostStructureType, index as ProductRepository, index$o as ReactionRepository, index$9 as RoomPresenceRepository, index$c as RoomRepository, SearchUsersByEnum, index$6 as StoryRepository, index$a as StreamRepository, index$m as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, index$q as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$4 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
53369
+ export { API_REGIONS, index$5 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmitySharableContentType, AnalyticsSourceTypeEnum, index$f as CategoryRepository, index$j as ChannelRepository, index$s as Client, index$e as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$g as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$1 as EventRepository, FeedDataTypeEnum, index$d as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$p as FileRepository, FileType, GET_WATCHER_URLS, index$3 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$2 as LiveReactionRepository, index$7 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$n as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$8 as PollRepository, PostContentType, index$b as PostRepository, PostStructureType, index as ProductRepository, index$o as ReactionRepository, index$9 as RoomPresenceRepository, index$c as RoomRepository, SearchUsersByEnum, index$6 as StoryRepository, index$a as StreamRepository, index$m as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, index$q as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$4 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };