@wix/himalaya-cli 0.888.0 → 0.890.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.
Files changed (32) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/automations-v1/src/index.d.ts +15 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/badges-v2/src/index.d.ts +15 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/billing-tax-v1/src/index.d.ts +15 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +15 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-tools-v1/src/index.d.ts +15 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/index.d.ts +15 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/contacts/src/index.d.ts +15 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/data-collections-v1/src/index.d.ts +15 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/email-marketing-v1/src/index.d.ts +15 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/faq-v2/src/index.d.ts +15 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/gift-cards/src/index.d.ts +15 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/marketing-v1/src/index.d.ts +15 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/seo-v1/src/index.d.ts +15 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/workflows-v1/src/index.d.ts +15 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-automations.mjs +36 -5
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +34 -3
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-billing-tax.mjs +36 -5
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +34 -3
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-business-tools.mjs +34 -3
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +34 -3
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-contacts.mjs +34 -3
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data-collections.mjs +52 -11
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-email-marketing.mjs +34 -3
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +41 -10
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-faq.mjs +36 -5
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-gift-cards.mjs +34 -3
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-marketing.mjs +38 -7
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-seo.mjs +38 -7
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-workflows.mjs +34 -3
  30. package/dist/cli.mjs +124 -19
  31. package/guides/sdk-reference.json +84 -0
  32. package/package.json +2 -2
@@ -95,6 +95,36 @@ function wixCall(method, path, body, opts) {
95
95
  wixCallHeaders(opts)
96
96
  );
97
97
  }
98
+ function wixQueryPath(path, req) {
99
+ const parts = [];
100
+ const pair = (key, value) => {
101
+ parts.push(
102
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
103
+ );
104
+ };
105
+ const add = (key, value) => {
106
+ if (value === void 0 || value === null) return;
107
+ if (Array.isArray(value)) {
108
+ for (const item of value) {
109
+ if (item === void 0 || item === null || typeof item === "object")
110
+ continue;
111
+ pair(key, item);
112
+ }
113
+ return;
114
+ }
115
+ if (typeof value === "object") {
116
+ for (const [k, v] of Object.entries(value))
117
+ add(`${key}.${k}`, v);
118
+ return;
119
+ }
120
+ pair(key, value);
121
+ };
122
+ for (const [key, value] of Object.entries(
123
+ req ?? {}
124
+ ))
125
+ add(key, value);
126
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
127
+ }
98
128
  function getComment(commentId, opts) {
99
129
  if (!commentId) throw new Error("getComment: commentId is required");
100
130
  return wixCall(
@@ -178,8 +208,8 @@ function countComments(req = {}, opts) {
178
208
  function listCommentsByResource(req = {}, opts) {
179
209
  return wixCall(
180
210
  "GET",
181
- "/comments/v1/comments/list-by-resource",
182
- req,
211
+ wixQueryPath("/comments/v1/comments/list-by-resource", req),
212
+ void 0,
183
213
  opts
184
214
  );
185
215
  }
@@ -251,6 +281,7 @@ export {
251
281
  publishComment,
252
282
  queryComments,
253
283
  unmarkComment,
254
- wixCall
284
+ wixCall,
285
+ wixQueryPath
255
286
  };
256
287
  //# sourceMappingURL=wix-comments.mjs.map
@@ -29,6 +29,36 @@ function wixCall(method, path, body, opts) {
29
29
  wixCallHeaders(opts)
30
30
  );
31
31
  }
32
+ function wixQueryPath(path, req) {
33
+ const parts = [];
34
+ const pair = (key, value) => {
35
+ parts.push(
36
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
37
+ );
38
+ };
39
+ const add = (key, value) => {
40
+ if (value === void 0 || value === null) return;
41
+ if (Array.isArray(value)) {
42
+ for (const item of value) {
43
+ if (item === void 0 || item === null || typeof item === "object")
44
+ continue;
45
+ pair(key, item);
46
+ }
47
+ return;
48
+ }
49
+ if (typeof value === "object") {
50
+ for (const [k, v] of Object.entries(value))
51
+ add(`${key}.${k}`, v);
52
+ return;
53
+ }
54
+ pair(key, value);
55
+ };
56
+ for (const [key, value] of Object.entries(
57
+ req ?? {}
58
+ ))
59
+ add(key, value);
60
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
61
+ }
32
62
  function queryContacts(req = {}, opts) {
33
63
  return wixCall(
34
64
  "POST",
@@ -40,8 +70,8 @@ function queryContacts(req = {}, opts) {
40
70
  function listContacts(req = {}, opts) {
41
71
  return wixCall(
42
72
  "GET",
43
- "/contacts/v4/contacts",
44
- req,
73
+ wixQueryPath("/contacts/v4/contacts", req),
74
+ void 0,
45
75
  opts
46
76
  );
47
77
  }
@@ -90,6 +120,7 @@ export {
90
120
  queryLabels,
91
121
  unlabelContact,
92
122
  updateContact,
93
- wixCall
123
+ wixCall,
124
+ wixQueryPath
94
125
  };
95
126
  //# sourceMappingURL=wix-contacts.mjs.map
@@ -32,6 +32,36 @@ function wixCall(method, path, body, opts) {
32
32
  wixCallHeaders(opts)
33
33
  );
34
34
  }
35
+ function wixQueryPath(path, req) {
36
+ const parts = [];
37
+ const pair = (key, value) => {
38
+ parts.push(
39
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
40
+ );
41
+ };
42
+ const add = (key, value) => {
43
+ if (value === void 0 || value === null) return;
44
+ if (Array.isArray(value)) {
45
+ for (const item of value) {
46
+ if (item === void 0 || item === null || typeof item === "object")
47
+ continue;
48
+ pair(key, item);
49
+ }
50
+ return;
51
+ }
52
+ if (typeof value === "object") {
53
+ for (const [k, v] of Object.entries(value))
54
+ add(`${key}.${k}`, v);
55
+ return;
56
+ }
57
+ pair(key, value);
58
+ };
59
+ for (const [key, value] of Object.entries(
60
+ req ?? {}
61
+ ))
62
+ add(key, value);
63
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
64
+ }
35
65
  function getDataCollection(dataCollectionId, opts) {
36
66
  if (!dataCollectionId)
37
67
  throw new Error("getDataCollection: dataCollectionId is required");
@@ -45,8 +75,8 @@ function getDataCollection(dataCollectionId, opts) {
45
75
  function listDataCollections(req = {}, opts) {
46
76
  return wixCall(
47
77
  "GET",
48
- "/data/v2/collections",
49
- req,
78
+ wixQueryPath("/data/v2/collections", req),
79
+ void 0,
50
80
  opts
51
81
  );
52
82
  }
@@ -98,24 +128,34 @@ function createIndex(req = {}, opts) {
98
128
  return wixCall("POST", "/data/v2/indexes", req, opts);
99
129
  }
100
130
  function dropIndex(req = {}, opts) {
101
- return wixCall("DELETE", "/data/v2/indexes", req, opts);
131
+ return wixCall(
132
+ "DELETE",
133
+ wixQueryPath("/data/v2/indexes", req),
134
+ void 0,
135
+ opts
136
+ );
102
137
  }
103
138
  function listIndexes(req = {}, opts) {
104
- return wixCall("GET", "/data/v2/indexes", req, opts);
139
+ return wixCall(
140
+ "GET",
141
+ wixQueryPath("/data/v2/indexes", req),
142
+ void 0,
143
+ opts
144
+ );
105
145
  }
106
146
  function listAvailableIndexes(req = {}, opts) {
107
147
  return wixCall(
108
148
  "GET",
109
- "/data/v2/indexes/available",
110
- req,
149
+ wixQueryPath("/data/v2/indexes/available", req),
150
+ void 0,
111
151
  opts
112
152
  );
113
153
  }
114
154
  function getPermissions(req = {}, opts) {
115
155
  return wixCall(
116
156
  "GET",
117
- "/wix-data/v1/permissions",
118
- req,
157
+ wixQueryPath("/wix-data/v1/permissions", req),
158
+ void 0,
119
159
  opts
120
160
  );
121
161
  }
@@ -162,8 +202,8 @@ function removeSpecialPermissions(specialPermissionsId, opts) {
162
202
  function getMyPermissions(req = {}, opts) {
163
203
  return wixCall(
164
204
  "GET",
165
- "/wix-data/v1/permissions/current",
166
- req,
205
+ wixQueryPath("/wix-data/v1/permissions/current", req),
206
+ void 0,
167
207
  opts
168
208
  );
169
209
  }
@@ -187,6 +227,7 @@ export {
187
227
  updateDataCollection,
188
228
  updatePermissions,
189
229
  updateSpecialPermissions,
190
- wixCall
230
+ wixCall,
231
+ wixQueryPath
191
232
  };
192
233
  //# sourceMappingURL=wix-data-collections.mjs.map
@@ -18,11 +18,41 @@ function wixCall(method, path, body, opts) {
18
18
  wixCallHeaders(opts)
19
19
  );
20
20
  }
21
+ function wixQueryPath(path, req) {
22
+ const parts = [];
23
+ const pair = (key, value) => {
24
+ parts.push(
25
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
26
+ );
27
+ };
28
+ const add = (key, value) => {
29
+ if (value === void 0 || value === null) return;
30
+ if (Array.isArray(value)) {
31
+ for (const item of value) {
32
+ if (item === void 0 || item === null || typeof item === "object")
33
+ continue;
34
+ pair(key, item);
35
+ }
36
+ return;
37
+ }
38
+ if (typeof value === "object") {
39
+ for (const [k, v] of Object.entries(value))
40
+ add(`${key}.${k}`, v);
41
+ return;
42
+ }
43
+ pair(key, value);
44
+ };
45
+ for (const [key, value] of Object.entries(
46
+ req ?? {}
47
+ ))
48
+ add(key, value);
49
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
50
+ }
21
51
  function listStatistics(req = {}, opts) {
22
52
  return wixCall(
23
53
  "GET",
24
- "/email-marketing/v1/campaigns/statistics",
25
- req,
54
+ wixQueryPath("/email-marketing/v1/campaigns/statistics", req),
55
+ void 0,
26
56
  opts
27
57
  );
28
58
  }
@@ -180,6 +210,7 @@ export {
180
210
  validateHtmlLinks,
181
211
  validateLink,
182
212
  verifyEmail,
183
- wixCall
213
+ wixCall,
214
+ wixQueryPath
184
215
  };
185
216
  //# sourceMappingURL=wix-email-marketing.mjs.map
@@ -115,13 +115,11 @@ function eventAddress(e) {
115
115
  function directMapUrl(value) {
116
116
  const raw = value.trim();
117
117
  if (!/^https?:\/\//i.test(raw)) return "";
118
- try {
119
- const url = new URL(raw);
120
- if (!url.hostname) return "";
121
- return url.pathname && url.pathname !== "/" ? raw : "";
122
- } catch {
123
- return "";
124
- }
118
+ const parsed = raw.match(/^https?:\/\/([^/?#]+)([^?#]*)/i);
119
+ const authority = parsed?.[1];
120
+ if (!authority || !/^(?:[^\s@/?#]*@)?(?:\[[0-9A-Fa-f:.]+\]|[^\s:@/?#]+)(?::\d*)?$/.test(authority)) return "";
121
+ const path = parsed[2] || "";
122
+ return path && path !== "/" ? raw : "";
125
123
  }
126
124
  function mapSearchQuery(value) {
127
125
  const raw = value.trim();
@@ -154,18 +152,51 @@ function eventEndMillis(e) {
154
152
  const ms = new Date(end).getTime();
155
153
  return Number.isNaN(ms) ? void 0 : ms;
156
154
  }
155
+ var WEEKDAYS_SHORT = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
156
+ var MONTHS_SHORT = [
157
+ "Jan",
158
+ "Feb",
159
+ "Mar",
160
+ "Apr",
161
+ "May",
162
+ "Jun",
163
+ "Jul",
164
+ "Aug",
165
+ "Sep",
166
+ "Oct",
167
+ "Nov",
168
+ "Dec"
169
+ ];
170
+ function hasIntl() {
171
+ return typeof Intl !== "undefined" && typeof Intl.DateTimeFormat === "function";
172
+ }
173
+ function weekdayMonthDay(d) {
174
+ if (hasIntl()) {
175
+ return new Intl.DateTimeFormat("en", { weekday: "short", month: "short", day: "numeric" }).format(d);
176
+ }
177
+ return `${WEEKDAYS_SHORT[d.getDay()]}, ${MONTHS_SHORT[d.getMonth()]} ${d.getDate()}`;
178
+ }
179
+ function clockTime(d) {
180
+ if (hasIntl()) {
181
+ return new Intl.DateTimeFormat("en", { hour: "numeric", minute: "2-digit" }).format(d);
182
+ }
183
+ const h = d.getHours();
184
+ const hour = h % 12 === 0 ? 12 : h % 12;
185
+ const minute = d.getMinutes();
186
+ return `${hour}:${minute < 10 ? `0${minute}` : minute} ${h < 12 ? "AM" : "PM"}`;
187
+ }
157
188
  function eventWhen(e) {
158
189
  const start = startDateOf(e);
159
190
  const end = endDateOf(e);
160
191
  if (!start) return titleCase(e.eventStatus) || "Date to be announced";
161
192
  const s = new Date(start);
162
193
  if (Number.isNaN(s.getTime())) return "Date to be announced";
163
- const date = new Intl.DateTimeFormat("en", { weekday: "short", month: "short", day: "numeric" }).format(s);
164
- const time = new Intl.DateTimeFormat("en", { hour: "numeric", minute: "2-digit" }).format(s);
194
+ const date = weekdayMonthDay(s);
195
+ const time = clockTime(s);
165
196
  if (!end) return `${date} at ${time}`;
166
197
  const eDate = new Date(end);
167
198
  if (Number.isNaN(eDate.getTime())) return `${date} at ${time}`;
168
- const endTime = new Intl.DateTimeFormat("en", { hour: "numeric", minute: "2-digit" }).format(eDate);
199
+ const endTime = clockTime(eDate);
169
200
  return `${date} \xB7 ${time}-${endTime}`;
170
201
  }
171
202
  function normalizeEvent(e) {
@@ -16,6 +16,36 @@ function wixCall(method, path, body, opts) {
16
16
  wixCallHeaders(opts)
17
17
  );
18
18
  }
19
+ function wixQueryPath(path, req) {
20
+ const parts = [];
21
+ const pair = (key, value) => {
22
+ parts.push(
23
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
24
+ );
25
+ };
26
+ const add = (key, value) => {
27
+ if (value === void 0 || value === null) return;
28
+ if (Array.isArray(value)) {
29
+ for (const item of value) {
30
+ if (item === void 0 || item === null || typeof item === "object")
31
+ continue;
32
+ pair(key, item);
33
+ }
34
+ return;
35
+ }
36
+ if (typeof value === "object") {
37
+ for (const [k, v] of Object.entries(value))
38
+ add(`${key}.${k}`, v);
39
+ return;
40
+ }
41
+ pair(key, value);
42
+ };
43
+ for (const [key, value] of Object.entries(
44
+ req ?? {}
45
+ ))
46
+ add(key, value);
47
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
48
+ }
19
49
  function createCategory(req = {}, opts) {
20
50
  return wixCall(
21
51
  "POST",
@@ -54,8 +84,8 @@ function deleteCategory(categoryId, opts) {
54
84
  function listCategories(req = {}, opts) {
55
85
  return wixCall(
56
86
  "GET",
57
- "/faq/v2/categories",
58
- req,
87
+ wixQueryPath("/faq/v2/categories", req),
88
+ void 0,
59
89
  opts
60
90
  );
61
91
  }
@@ -108,8 +138,8 @@ function deleteQuestionEntry(questionEntryId, opts) {
108
138
  function listQuestionEntries(req = {}, opts) {
109
139
  return wixCall(
110
140
  "GET",
111
- "/faq/v2/question-entries",
112
- req,
141
+ wixQueryPath("/faq/v2/question-entries", req),
142
+ void 0,
113
143
  opts
114
144
  );
115
145
  }
@@ -163,6 +193,7 @@ export {
163
193
  setQuestionEntryLabels,
164
194
  updateCategory,
165
195
  updateQuestionEntry,
166
- wixCall
196
+ wixCall,
197
+ wixQueryPath
167
198
  };
168
199
  //# sourceMappingURL=wix-faq.mjs.map
@@ -18,6 +18,36 @@ function wixCall(method, path, body, opts) {
18
18
  wixCallHeaders(opts)
19
19
  );
20
20
  }
21
+ function wixQueryPath(path, req) {
22
+ const parts = [];
23
+ const pair = (key, value) => {
24
+ parts.push(
25
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
26
+ );
27
+ };
28
+ const add = (key, value) => {
29
+ if (value === void 0 || value === null) return;
30
+ if (Array.isArray(value)) {
31
+ for (const item of value) {
32
+ if (item === void 0 || item === null || typeof item === "object")
33
+ continue;
34
+ pair(key, item);
35
+ }
36
+ return;
37
+ }
38
+ if (typeof value === "object") {
39
+ for (const [k, v] of Object.entries(value))
40
+ add(`${key}.${k}`, v);
41
+ return;
42
+ }
43
+ pair(key, value);
44
+ };
45
+ for (const [key, value] of Object.entries(
46
+ req ?? {}
47
+ ))
48
+ add(key, value);
49
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
50
+ }
21
51
  function createGiftCard(req = {}, opts) {
22
52
  return wixCall(
23
53
  "POST",
@@ -72,8 +102,8 @@ function disableGiftCard(giftCardId, req = {}, opts) {
72
102
  function listGiftCardsByEmail(req = {}, opts) {
73
103
  return wixCall(
74
104
  "GET",
75
- "/gift-cards/v1/gift-cards",
76
- req,
105
+ wixQueryPath("/gift-cards/v1/gift-cards", req),
106
+ void 0,
77
107
  opts
78
108
  );
79
109
  }
@@ -103,6 +133,7 @@ export {
103
133
  queryGiftCards,
104
134
  searchGiftCards,
105
135
  sendGiftCardEmail,
106
- wixCall
136
+ wixCall,
137
+ wixQueryPath
107
138
  };
108
139
  //# sourceMappingURL=wix-gift-cards.mjs.map
@@ -18,6 +18,36 @@ function wixCall(method, path, body, opts) {
18
18
  wixCallHeaders(opts)
19
19
  );
20
20
  }
21
+ function wixQueryPath(path, req) {
22
+ const parts = [];
23
+ const pair = (key, value) => {
24
+ parts.push(
25
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
26
+ );
27
+ };
28
+ const add = (key, value) => {
29
+ if (value === void 0 || value === null) return;
30
+ if (Array.isArray(value)) {
31
+ for (const item of value) {
32
+ if (item === void 0 || item === null || typeof item === "object")
33
+ continue;
34
+ pair(key, item);
35
+ }
36
+ return;
37
+ }
38
+ if (typeof value === "object") {
39
+ for (const [k, v] of Object.entries(value))
40
+ add(`${key}.${k}`, v);
41
+ return;
42
+ }
43
+ pair(key, value);
44
+ };
45
+ for (const [key, value] of Object.entries(
46
+ req ?? {}
47
+ ))
48
+ add(key, value);
49
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
50
+ }
21
51
  function upsertMarketingTag(req = {}, opts) {
22
52
  return wixCall(
23
53
  "POST",
@@ -29,24 +59,24 @@ function upsertMarketingTag(req = {}, opts) {
29
59
  function listMarketingTags(req = {}, opts) {
30
60
  return wixCall(
31
61
  "GET",
32
- "/marketing/v1/tags",
33
- req,
62
+ wixQueryPath("/marketing/v1/tags", req),
63
+ void 0,
34
64
  opts
35
65
  );
36
66
  }
37
67
  function deleteMarketingTag(req = {}, opts) {
38
68
  return wixCall(
39
69
  "DELETE",
40
- "/marketing/v1/tags",
41
- req,
70
+ wixQueryPath("/marketing/v1/tags", req),
71
+ void 0,
42
72
  opts
43
73
  );
44
74
  }
45
75
  function deleteMarketingTagV2(req = {}, opts) {
46
76
  return wixCall(
47
77
  "DELETE",
48
- "/marketing/v2/tags",
49
- req,
78
+ wixQueryPath("/marketing/v2/tags", req),
79
+ void 0,
50
80
  opts
51
81
  );
52
82
  }
@@ -55,6 +85,7 @@ export {
55
85
  deleteMarketingTagV2,
56
86
  listMarketingTags,
57
87
  upsertMarketingTag,
58
- wixCall
88
+ wixCall,
89
+ wixQueryPath
59
90
  };
60
91
  //# sourceMappingURL=wix-marketing.mjs.map
@@ -16,27 +16,57 @@ function wixCall(method, path, body, opts) {
16
16
  wixCallHeaders(opts)
17
17
  );
18
18
  }
19
+ function wixQueryPath(path, req) {
20
+ const parts = [];
21
+ const pair = (key, value) => {
22
+ parts.push(
23
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
24
+ );
25
+ };
26
+ const add = (key, value) => {
27
+ if (value === void 0 || value === null) return;
28
+ if (Array.isArray(value)) {
29
+ for (const item of value) {
30
+ if (item === void 0 || item === null || typeof item === "object")
31
+ continue;
32
+ pair(key, item);
33
+ }
34
+ return;
35
+ }
36
+ if (typeof value === "object") {
37
+ for (const [k, v] of Object.entries(value))
38
+ add(`${key}.${k}`, v);
39
+ return;
40
+ }
41
+ pair(key, value);
42
+ };
43
+ for (const [key, value] of Object.entries(
44
+ req ?? {}
45
+ ))
46
+ add(key, value);
47
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
48
+ }
19
49
  function resolveSeoTags(req = {}, opts) {
20
50
  return wixCall(
21
51
  "GET",
22
- "/promote/seo/v1/resolve-seo-tags",
23
- req,
52
+ wixQueryPath("/promote/seo/v1/resolve-seo-tags", req),
53
+ void 0,
24
54
  opts
25
55
  );
26
56
  }
27
57
  function resolveStaticPageSeoTags(req = {}, opts) {
28
58
  return wixCall(
29
59
  "GET",
30
- "/promote/seo/v1/resolve-static-page-seo-tags",
31
- req,
60
+ wixQueryPath("/promote/seo/v1/resolve-static-page-seo-tags", req),
61
+ void 0,
32
62
  opts
33
63
  );
34
64
  }
35
65
  function resolveItemSeoTags(req = {}, opts) {
36
66
  return wixCall(
37
67
  "GET",
38
- "/promote/seo/v1/resolve-item-seo-tags",
39
- req,
68
+ wixQueryPath("/promote/seo/v1/resolve-item-seo-tags", req),
69
+ void 0,
40
70
  opts
41
71
  );
42
72
  }
@@ -44,6 +74,7 @@ export {
44
74
  resolveItemSeoTags,
45
75
  resolveSeoTags,
46
76
  resolveStaticPageSeoTags,
47
- wixCall
77
+ wixCall,
78
+ wixQueryPath
48
79
  };
49
80
  //# sourceMappingURL=wix-seo.mjs.map
@@ -18,11 +18,41 @@ function wixCall(method, path, body, opts) {
18
18
  wixCallHeaders(opts)
19
19
  );
20
20
  }
21
+ function wixQueryPath(path, req) {
22
+ const parts = [];
23
+ const pair = (key, value) => {
24
+ parts.push(
25
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
26
+ );
27
+ };
28
+ const add = (key, value) => {
29
+ if (value === void 0 || value === null) return;
30
+ if (Array.isArray(value)) {
31
+ for (const item of value) {
32
+ if (item === void 0 || item === null || typeof item === "object")
33
+ continue;
34
+ pair(key, item);
35
+ }
36
+ return;
37
+ }
38
+ if (typeof value === "object") {
39
+ for (const [k, v] of Object.entries(value))
40
+ add(`${key}.${k}`, v);
41
+ return;
42
+ }
43
+ pair(key, value);
44
+ };
45
+ for (const [key, value] of Object.entries(
46
+ req ?? {}
47
+ ))
48
+ add(key, value);
49
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
50
+ }
21
51
  function listWorkflows(req = {}, opts) {
22
52
  return wixCall(
23
53
  "GET",
24
- "/workflows/v1/workflows",
25
- req,
54
+ wixQueryPath("/workflows/v1/workflows", req),
55
+ void 0,
26
56
  opts
27
57
  );
28
58
  }
@@ -67,6 +97,7 @@ export {
67
97
  getWorkflow,
68
98
  listWorkflows,
69
99
  updateWorkflow,
70
- wixCall
100
+ wixCall,
101
+ wixQueryPath
71
102
  };
72
103
  //# sourceMappingURL=wix-workflows.mjs.map