@cords/sdk 0.0.15 → 0.0.16

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.d.mts CHANGED
@@ -81,8 +81,8 @@ type SearchOptions = {
81
81
  };
82
82
  calculateProvinceFromSearchString?: boolean;
83
83
  calculateCityFromSearchString?: boolean;
84
- meta: {
85
- taxonomy: TaxonomyCodeType[];
84
+ meta?: {
85
+ taxonomy?: TaxonomyCodeType[];
86
86
  };
87
87
  };
88
88
  type CordsError = {
package/dist/index.d.ts CHANGED
@@ -81,8 +81,8 @@ type SearchOptions = {
81
81
  };
82
82
  calculateProvinceFromSearchString?: boolean;
83
83
  calculateCityFromSearchString?: boolean;
84
- meta: {
85
- taxonomy: TaxonomyCodeType[];
84
+ meta?: {
85
+ taxonomy?: TaxonomyCodeType[];
86
86
  };
87
87
  };
88
88
  type CordsError = {
package/dist/index.js CHANGED
@@ -92,6 +92,7 @@ var CordsAPI = ({
92
92
  "calculateCityFromSearchString",
93
93
  "calculateProvinceFromSearchString"
94
94
  ]);
95
+ var _a2;
95
96
  const url = formatUrl("/search");
96
97
  const params = new URLSearchParams({
97
98
  q
@@ -126,9 +127,9 @@ var CordsAPI = ({
126
127
  );
127
128
  }
128
129
  }
129
- if (options.meta.taxonomy) {
130
+ if ((_a2 = options == null ? void 0 : options.meta) == null ? void 0 : _a2.taxonomy) {
130
131
  options.meta.taxonomy.forEach((code) => {
131
- params.append("filter[meta][TaxonomyCodes]", code);
132
+ params.append("filter[meta][TaxonomyCodes][]", code);
132
133
  });
133
134
  }
134
135
  const res = await request(`${url.toString()}?${params}`);
package/dist/index.mjs CHANGED
@@ -69,6 +69,7 @@ var CordsAPI = ({
69
69
  "calculateCityFromSearchString",
70
70
  "calculateProvinceFromSearchString"
71
71
  ]);
72
+ var _a2;
72
73
  const url = formatUrl("/search");
73
74
  const params = new URLSearchParams({
74
75
  q
@@ -103,9 +104,9 @@ var CordsAPI = ({
103
104
  );
104
105
  }
105
106
  }
106
- if (options.meta.taxonomy) {
107
+ if ((_a2 = options == null ? void 0 : options.meta) == null ? void 0 : _a2.taxonomy) {
107
108
  options.meta.taxonomy.forEach((code) => {
108
- params.append("filter[meta][TaxonomyCodes]", code);
109
+ params.append("filter[meta][TaxonomyCodes][]", code);
109
110
  });
110
111
  }
111
112
  const res = await request(`${url.toString()}?${params}`);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./dist/index.js",
4
4
  "module": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.ts",
6
- "version": "0.0.15",
6
+ "version": "0.0.16",
7
7
  "private": false,
8
8
  "publishConfig": {
9
9
  "access": "public"