rocketchat-ts-sdk 1.1.1 → 1.1.2

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.esm.js CHANGED
@@ -2948,7 +2948,27 @@ class BaseResource {
2948
2948
  this.client = client;
2949
2949
  }
2950
2950
  addQuery(query) {
2951
- return QueryString.stringify(query, {
2951
+ if (!query || Object.keys(query).length === 0) {
2952
+ return "";
2953
+ }
2954
+ const normalized = { ...query };
2955
+ for (const [k, v] of Object.entries(normalized)) {
2956
+ if (typeof v === "string") {
2957
+ const s = v.trim();
2958
+ if (s.startsWith("[") && s.endsWith("]")) {
2959
+ try {
2960
+ const parsed = JSON.parse(s);
2961
+ if (Array.isArray(parsed)) {
2962
+ normalized[k] = parsed;
2963
+ }
2964
+ }
2965
+ catch (_a) {
2966
+ // ignore parse errors and keep original string
2967
+ }
2968
+ }
2969
+ }
2970
+ }
2971
+ return QueryString.stringify(normalized, {
2952
2972
  addQueryPrefix: true,
2953
2973
  arrayFormat: "brackets",
2954
2974
  encode: true,