repzo 1.0.110 → 1.0.112

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/lib/index.js CHANGED
@@ -2426,6 +2426,9 @@ export default class Repzo {
2426
2426
  }
2427
2427
  }
2428
2428
  async _fetch(baseUrl, path, params) {
2429
+ if (params) {
2430
+ params = normalizeParams(params);
2431
+ }
2429
2432
  let res = await axios.get(`${baseUrl}/${path}`, {
2430
2433
  params,
2431
2434
  headers: this.headers,
@@ -2762,3 +2765,20 @@ Repzo.CommandLog = class {
2762
2765
  return this;
2763
2766
  }
2764
2767
  };
2768
+ function normalizeParams(params) {
2769
+ const normalized = {};
2770
+ for (const key in params) {
2771
+ const value = params[key];
2772
+ if (value === undefined || value === null) continue;
2773
+ if (
2774
+ typeof value === "object" &&
2775
+ !(value instanceof Date) &&
2776
+ !(value instanceof String)
2777
+ ) {
2778
+ normalized[key] = JSON.stringify(value);
2779
+ } else {
2780
+ normalized[key] = value;
2781
+ }
2782
+ }
2783
+ return normalized;
2784
+ }
@@ -3369,6 +3369,12 @@ export declare namespace Service {
3369
3369
  name?: string[] | string;
3370
3370
  local_name?: string[] | string;
3371
3371
  from_updatedAt?: number;
3372
+ from__id?: string;
3373
+ to__id?: string;
3374
+ sortBy?: {
3375
+ field: "_id";
3376
+ type: "asc" | "desc";
3377
+ }[];
3372
3378
  };
3373
3379
  interface Result extends DefaultPaginationResult {
3374
3380
  data: SpecialitySchema[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.110",
3
+ "version": "1.0.112",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -111,6 +111,9 @@ export default class Repzo {
111
111
  } as const;
112
112
  public END_POINTS = this._end_points;
113
113
  private async _fetch(baseUrl: string, path: string, params?: Params) {
114
+ if (params) {
115
+ params = normalizeParams(params);
116
+ }
114
117
  let res = await axios.get(`${baseUrl}/${path}`, {
115
118
  params,
116
119
  headers: this.headers,
@@ -3713,3 +3716,25 @@ export default class Repzo {
3713
3716
  },
3714
3717
  };
3715
3718
  }
3719
+
3720
+ function normalizeParams(params: Params): { [key: string]: any } {
3721
+ const normalized: Record<string, any> = {};
3722
+
3723
+ for (const key in params) {
3724
+ const value = params[key];
3725
+
3726
+ if (value === undefined || value === null) continue;
3727
+
3728
+ if (
3729
+ typeof value === "object" &&
3730
+ !(value instanceof Date) &&
3731
+ !(value instanceof String)
3732
+ ) {
3733
+ normalized[key] = JSON.stringify(value);
3734
+ } else {
3735
+ normalized[key] = value;
3736
+ }
3737
+ }
3738
+
3739
+ return normalized;
3740
+ }
@@ -3420,6 +3420,12 @@ export namespace Service {
3420
3420
  name?: string[] | string;
3421
3421
  local_name?: string[] | string;
3422
3422
  from_updatedAt?: number;
3423
+ from__id?: string;
3424
+ to__id?: string;
3425
+ sortBy?: {
3426
+ field: "_id";
3427
+ type: "asc" | "desc";
3428
+ }[];
3423
3429
  };
3424
3430
  export interface Result extends DefaultPaginationResult {
3425
3431
  data: SpecialitySchema[];