@wix/astro 1.0.30 → 2.1.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 (92) hide show
  1. package/.turbo/turbo-build.log +16 -0
  2. package/CHANGELOG.md +66 -0
  3. package/build/builders.d.ts +2 -0
  4. package/build/builders.js +34 -0
  5. package/build/builders.js.map +1 -0
  6. package/build/index.d.ts +2 -3
  7. package/build/index.js +20 -17116
  8. package/build/index.js.map +1 -1
  9. package/package.json +14 -33
  10. package/src/builders.ts +14 -0
  11. package/src/index.ts +23 -252
  12. package/tsconfig.json +1 -3
  13. package/tsup.config.mjs +1 -46
  14. package/build-browser-runtime/setup.d.ts +0 -5
  15. package/build-browser-runtime/setup.js +0 -129
  16. package/build-runtime/chunk-B6RICTPP.js +0 -94
  17. package/build-runtime/chunk-FR26HCAT.js +0 -471
  18. package/build-runtime/chunk-HPW4ZAEJ.js +0 -23
  19. package/build-runtime/chunk-MLKGABMK.js +0 -9
  20. package/build-runtime/chunk-NVTQFGTR.js +0 -7
  21. package/build-runtime/chunk-RKE6XT5Z.js +0 -3104
  22. package/build-runtime/chunk-UZPSWWI5.js +0 -13
  23. package/build-runtime/chunk-W73LN534.js +0 -24
  24. package/build-runtime/context/elevated.d.ts +0 -2
  25. package/build-runtime/context/elevated.js +0 -24
  26. package/build-runtime/context/nonElevated.d.ts +0 -2
  27. package/build-runtime/context/nonElevated.js +0 -37
  28. package/build-runtime/context/setupServicePlugin.d.ts +0 -5
  29. package/build-runtime/context/setupServicePlugin.js +0 -16
  30. package/build-runtime/context/setupWebhook.d.ts +0 -5
  31. package/build-runtime/context/setupWebhook.js +0 -16
  32. package/build-runtime/middleware/auth.d.ts +0 -5
  33. package/build-runtime/middleware/auth.js +0 -74
  34. package/build-runtime/middleware/html-embeds.d.ts +0 -5
  35. package/build-runtime/middleware/html-embeds.js +0 -165
  36. package/build-runtime/routes/auth/callback.d.ts +0 -5
  37. package/build-runtime/routes/auth/callback.js +0 -52
  38. package/build-runtime/routes/auth/login.d.ts +0 -5
  39. package/build-runtime/routes/auth/login.js +0 -45
  40. package/build-runtime/routes/auth/logout-callback.d.ts +0 -5
  41. package/build-runtime/routes/auth/logout-callback.js +0 -23
  42. package/build-runtime/routes/auth/logout.d.ts +0 -5
  43. package/build-runtime/routes/auth/logout.js +0 -32
  44. package/build-runtime/routes/paylink/paylink.d.ts +0 -5
  45. package/build-runtime/routes/paylink/paylink.js +0 -1101
  46. package/build-runtime/routes/servicePluginsDevRoute.d.ts +0 -5
  47. package/build-runtime/routes/servicePluginsDevRoute.js +0 -13
  48. package/build-runtime/routes/webhooksDevRoute.d.ts +0 -5
  49. package/build-runtime/routes/webhooksDevRoute.js +0 -13
  50. package/runtime/entry.astro +0 -26
  51. package/src/client-context/setup.ts +0 -14
  52. package/src/client-context/utils.ts +0 -59
  53. package/src/components.ts +0 -98
  54. package/src/constants.ts +0 -2
  55. package/src/context/elevated.ts +0 -20
  56. package/src/context/hostProxy.ts +0 -38
  57. package/src/context/nonElevated.ts +0 -42
  58. package/src/context/setupServicePlugin.ts +0 -13
  59. package/src/context/setupWebhook.ts +0 -13
  60. package/src/context/utils.ts +0 -32
  61. package/src/directories.ts +0 -5
  62. package/src/env.d.ts +0 -11
  63. package/src/middleware/auth.ts +0 -38
  64. package/src/middleware/html-embeds.ts +0 -59
  65. package/src/plugins/patchAstroInlineScripts.ts +0 -27
  66. package/src/plugins/patchGlobal.ts +0 -20
  67. package/src/plugins/setupSsrContext.ts +0 -68
  68. package/src/routes/auth/callback.ts +0 -51
  69. package/src/routes/auth/login.ts +0 -42
  70. package/src/routes/auth/logout-callback.ts +0 -18
  71. package/src/routes/auth/logout.ts +0 -28
  72. package/src/routes/paylink/paylink.ts +0 -33
  73. package/src/routes/servicePluginsDevRoute.ts +0 -10
  74. package/src/routes/webhooksDevRoute.ts +0 -10
  75. package/src/schemas.ts +0 -227
  76. package/src/types.ts +0 -9
  77. package/src/utils/authAsyncLocalStorage.ts +0 -7
  78. package/src/utils/buildBackofficeComponent.ts +0 -64
  79. package/src/utils/buildComponents.ts +0 -182
  80. package/src/utils/buildServicePluginComponent.ts +0 -52
  81. package/src/utils/buildWebhookComponent.ts +0 -39
  82. package/src/utils/contextualAuth.ts +0 -4
  83. package/src/utils/createProjectModel.ts +0 -190
  84. package/src/utils/fs-utils.ts +0 -48
  85. package/src/utils/generateAppManifest.ts +0 -177
  86. package/src/utils/generateVisitorTokens.ts +0 -11
  87. package/src/utils/getSessionTokensFromCookie.ts +0 -38
  88. package/src/utils/loadEnvVars.ts +0 -47
  89. package/src/utils/removeUnusedCodegenFiles.ts +0 -34
  90. package/src/utils/resolveBuildMetadata.ts +0 -37
  91. package/src/utils/saveSessionTokensToCookie.ts +0 -27
  92. package/src/utils/transformStreamUtils.ts +0 -39
@@ -1,1101 +0,0 @@
1
- import {
2
- DEFAULT_LIMIT,
3
- EventDefinition,
4
- ITEMS_RESULT_PROPERTY_NAME,
5
- PAGING_METADATA_RESULT_PROPERTY_NAME,
6
- SDKRequestToRESTRequestRenameMap,
7
- contextualizeEventDefinitionModuleV2,
8
- createRESTModule,
9
- renameKeysFromRESTResponseToSDKResponse,
10
- renameKeysFromSDKRequestToRESTRequest,
11
- resolveUrl,
12
- toURLSearchParams,
13
- transformError
14
- } from "../../chunk-FR26HCAT.js";
15
- import {
16
- __export
17
- } from "../../chunk-MLKGABMK.js";
18
-
19
- // ../../node_modules/@wix/auto_sdk_auth-management_o-auth-apps/build/es/index.mjs
20
- var es_exports = {};
21
- __export(es_exports, {
22
- DeleteStatus: () => DeleteStatus,
23
- Namespace: () => Namespace,
24
- OAuthAppType: () => OAuthAppType,
25
- OAuthTechnologies: () => OAuthTechnologies,
26
- SiteCreatedContext: () => SiteCreatedContext,
27
- SortOrder: () => SortOrder,
28
- State: () => State,
29
- WebhookIdentityType: () => WebhookIdentityType,
30
- createOAuthApp: () => createOAuthApp4,
31
- deleteOAuthApp: () => deleteOAuthApp4,
32
- generateOAuthAppSecret: () => generateOAuthAppSecret4,
33
- getOAuthApp: () => getOAuthApp4,
34
- onOAuthAppCreated: () => onOAuthAppCreated2,
35
- onOAuthAppDeleted: () => onOAuthAppDeleted2,
36
- onOAuthAppUpdated: () => onOAuthAppUpdated2,
37
- queryOAuthApps: () => queryOAuthApps4,
38
- updateOAuthApp: () => updateOAuthApp4
39
- });
40
-
41
- // ../../node_modules/@wix/sdk-runtime/build/transformations/timestamp.js
42
- function transformSDKTimestampToRESTTimestamp(val) {
43
- return val?.toISOString();
44
- }
45
- function transformRESTTimestampToSDKTimestamp(val) {
46
- return val ? new Date(val) : void 0;
47
- }
48
-
49
- // ../../node_modules/@wix/sdk-runtime/build/transformations/transform-paths.js
50
- function transformPath(obj, { path, isRepeated, isMap }, transformFn) {
51
- const pathParts = path.split(".");
52
- if (pathParts.length === 1 && path in obj) {
53
- obj[path] = isRepeated ? obj[path].map(transformFn) : isMap ? Object.fromEntries(Object.entries(obj[path]).map(([key, value]) => [key, transformFn(value)])) : transformFn(obj[path]);
54
- return obj;
55
- }
56
- const [first, ...rest] = pathParts;
57
- if (first.endsWith("{}")) {
58
- const cleanPath = first.slice(0, -2);
59
- obj[cleanPath] = Object.fromEntries(Object.entries(obj[cleanPath]).map(([key, value]) => [
60
- key,
61
- transformPath(value, { path: rest.join("."), isRepeated, isMap }, transformFn)
62
- ]));
63
- } else if (Array.isArray(obj[first])) {
64
- obj[first] = obj[first].map((item) => transformPath(item, { path: rest.join("."), isRepeated, isMap }, transformFn));
65
- } else if (first in obj && typeof obj[first] === "object" && obj[first] !== null) {
66
- obj[first] = transformPath(obj[first], { path: rest.join("."), isRepeated, isMap }, transformFn);
67
- } else if (first === "*") {
68
- Object.keys(obj).reduce((acc, curr) => {
69
- acc[curr] = transformPath(obj[curr], { path: rest.join("."), isRepeated, isMap }, transformFn);
70
- return acc;
71
- }, obj);
72
- }
73
- return obj;
74
- }
75
- function transformPaths(obj, transformations) {
76
- return transformations.reduce((acc, { paths, transformFn }) => paths.reduce((transformerAcc, path) => transformPath(transformerAcc, path, transformFn), acc), obj);
77
- }
78
-
79
- // ../../node_modules/@wix/sdk-runtime/build/query-filter.js
80
- function isAndOperator(filter) {
81
- return Object.keys(filter).length === 1 && "$and" in filter && Array.isArray(filter.$and);
82
- }
83
- function isOrOperator(filter) {
84
- return Object.keys(filter).length === 1 && "$or" in filter && Array.isArray(filter.$or);
85
- }
86
- function isNotOperator(filter) {
87
- return Object.keys(filter).length === 1 && "$not" in filter && typeof filter.$not === "object";
88
- }
89
- function and(a, b) {
90
- if (typeof a === "undefined" || Object.keys(a).length === 0) {
91
- return b;
92
- } else if (typeof b === "undefined" || Object.keys(b).length === 0) {
93
- return a;
94
- } else {
95
- return {
96
- $and: [
97
- ...isAndOperator(a) ? a.$and : [a],
98
- ...isAndOperator(b) ? b.$and : [b]
99
- ]
100
- };
101
- }
102
- }
103
- function or(a, b) {
104
- if (typeof a === "undefined" || Object.keys(a).length === 0) {
105
- return b;
106
- } else if (typeof b === "undefined" || Object.keys(b).length === 0) {
107
- return a;
108
- } else {
109
- return {
110
- $or: [
111
- ...isOrOperator(a) ? a.$or : [a],
112
- ...isOrOperator(b) ? b.$or : [b]
113
- ]
114
- };
115
- }
116
- }
117
- function not(a) {
118
- if (typeof a === "undefined" || Object.keys(a).length === 0) {
119
- return void 0;
120
- } else if (isNotOperator(a)) {
121
- return a.$not;
122
- } else {
123
- return { $not: a };
124
- }
125
- }
126
-
127
- // ../../node_modules/@wix/sdk-runtime/build/query-iterators.js
128
- var Iterator = class {
129
- _items;
130
- _fetchNextPage;
131
- _fetchPrevPage;
132
- _originQuery;
133
- _limit;
134
- constructor({ items, originQuery, fetchNextPage, fetchPrevPage, limit }) {
135
- this._items = items;
136
- this._fetchNextPage = fetchNextPage;
137
- this._fetchPrevPage = fetchPrevPage;
138
- this._originQuery = originQuery;
139
- this._limit = limit;
140
- }
141
- get items() {
142
- return this._items;
143
- }
144
- get length() {
145
- return this._items.length;
146
- }
147
- get pageSize() {
148
- return this._limit;
149
- }
150
- get query() {
151
- return this._originQuery;
152
- }
153
- async next() {
154
- if (!this.hasNext()) {
155
- throw new Error("No next page to fetch");
156
- }
157
- const nextPageIterator = await this._fetchNextPage();
158
- return nextPageIterator;
159
- }
160
- async prev() {
161
- if (!this.hasPrev()) {
162
- throw new Error("No previous page to fetch");
163
- }
164
- const previousPageIterator = await this._fetchPrevPage();
165
- return previousPageIterator;
166
- }
167
- };
168
- var CursorBasedIterator = class extends Iterator {
169
- _nextCursor;
170
- _prevCursor;
171
- cursors;
172
- constructor({ items, originQuery, fetchNextPage, fetchPrevPage, limit, nextCursor, prevCursor }) {
173
- super({ items, originQuery, fetchNextPage, fetchPrevPage, limit });
174
- this._nextCursor = nextCursor;
175
- this._prevCursor = prevCursor;
176
- this.cursors = {
177
- next: nextCursor,
178
- prev: prevCursor
179
- };
180
- }
181
- hasNext() {
182
- return !!this._nextCursor;
183
- }
184
- hasPrev() {
185
- return !!this._prevCursor;
186
- }
187
- };
188
- var OffsetBasedIterator = class extends Iterator {
189
- _totalCount;
190
- _offset;
191
- _tooManyToCount;
192
- constructor({ items, fetchNextPage, fetchPrevPage, offset, originQuery, limit, totalCount, tooManyToCount }) {
193
- super({ items, fetchNextPage, fetchPrevPage, originQuery, limit });
194
- this._totalCount = totalCount;
195
- this._offset = offset;
196
- this._tooManyToCount = tooManyToCount;
197
- }
198
- get currentPage() {
199
- return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
200
- }
201
- get totalPages() {
202
- return this._tooManyToCount || this._limit === 0 ? void 0 : Math.ceil(this._totalCount / this._limit);
203
- }
204
- get totalCount() {
205
- return this._tooManyToCount ? void 0 : this._totalCount;
206
- }
207
- hasNext() {
208
- return Boolean(this._limit !== 0 && this.currentPage !== void 0 && // currentPage 0 is the first page
209
- this.totalPages !== void 0 && this.currentPage < this.totalPages - 1);
210
- }
211
- hasPrev() {
212
- return Boolean(this._limit !== 0 && this.currentPage && this.currentPage > 0);
213
- }
214
- };
215
-
216
- // ../../node_modules/@wix/sdk-runtime/build/query-builder.js
217
- function queryBuilder(opts) {
218
- const createQueryBuilder = (query) => {
219
- return {
220
- query,
221
- async find() {
222
- try {
223
- const request = opts.requestTransformer(opts.pagingMethod === "CURSOR" && query.cursorPaging.cursor ? {
224
- cursorPaging: query.cursorPaging
225
- } : query);
226
- const response = await opts.func(request);
227
- const { [ITEMS_RESULT_PROPERTY_NAME]: items, [PAGING_METADATA_RESULT_PROPERTY_NAME]: pagingMetadata } = opts.responseTransformer(response);
228
- if (opts.pagingMethod === "OFFSET") {
229
- const offsetQuery = query;
230
- return new OffsetBasedIterator({
231
- items: items ?? [],
232
- fetchNextPage: () => {
233
- return createQueryBuilder({
234
- ...offsetQuery,
235
- paging: {
236
- offset: offsetQuery.paging.offset + offsetQuery.paging.limit,
237
- limit: offsetQuery.paging.limit
238
- }
239
- }).find();
240
- },
241
- fetchPrevPage: () => {
242
- return createQueryBuilder({
243
- ...query,
244
- paging: {
245
- offset: Math.max(offsetQuery.paging.offset - offsetQuery.paging.limit, 0),
246
- limit: offsetQuery.paging.limit
247
- }
248
- }).find();
249
- },
250
- offset: offsetQuery.paging.offset,
251
- limit: offsetQuery.paging.limit,
252
- totalCount: pagingMetadata?.total,
253
- tooManyToCount: pagingMetadata?.tooManyToCount,
254
- originQuery: this
255
- });
256
- }
257
- const paging = query.cursorPaging;
258
- return new CursorBasedIterator({
259
- items: items ?? [],
260
- limit: paging.limit,
261
- originQuery: this,
262
- fetchNextPage: () => {
263
- return createQueryBuilder({
264
- ...query,
265
- cursorPaging: {
266
- cursor: pagingMetadata?.cursors?.next ?? void 0,
267
- limit: paging.limit
268
- }
269
- }).find();
270
- },
271
- fetchPrevPage: () => {
272
- return createQueryBuilder({
273
- ...query,
274
- cursorPaging: {
275
- cursor: pagingMetadata?.cursors?.prev ?? void 0,
276
- limit: paging.limit
277
- }
278
- }).find();
279
- },
280
- prevCursor: pagingMetadata?.cursors?.prev ?? void 0,
281
- nextCursor: pagingMetadata?.cursors?.next ?? void 0
282
- });
283
- } catch (err) {
284
- throw opts.errorTransformer(err);
285
- }
286
- },
287
- skipTo(cursor) {
288
- return createQueryBuilder({
289
- ...query,
290
- cursorPaging: {
291
- cursor,
292
- limit: query.cursorPaging.limit
293
- }
294
- });
295
- },
296
- eq(field, value) {
297
- const serializableValue = typeof value === "undefined" ? null : value;
298
- const newFilter = {
299
- [renameFieldByPaths(opts.transformationPaths, field)]: serializableValue
300
- };
301
- return createQueryBuilder({
302
- ...query,
303
- filter: and(query.filter, newFilter)
304
- });
305
- },
306
- ne(field, value) {
307
- const serializableValue = typeof value === "undefined" ? null : value;
308
- const newFilter = {
309
- [renameFieldByPaths(opts.transformationPaths, field)]: {
310
- $ne: serializableValue
311
- }
312
- };
313
- return createQueryBuilder({
314
- ...query,
315
- filter: and(query.filter, newFilter)
316
- });
317
- },
318
- ge(field, value) {
319
- const newFilter = {
320
- [renameFieldByPaths(opts.transformationPaths, field)]: {
321
- $gte: value
322
- }
323
- };
324
- return createQueryBuilder({
325
- ...query,
326
- filter: and(query.filter, newFilter)
327
- });
328
- },
329
- gt(field, value) {
330
- const newFilter = {
331
- [renameFieldByPaths(opts.transformationPaths, field)]: { $gt: value }
332
- };
333
- return createQueryBuilder({
334
- ...query,
335
- filter: and(query.filter, newFilter)
336
- });
337
- },
338
- le(field, value) {
339
- const newFilter = {
340
- [renameFieldByPaths(opts.transformationPaths, field)]: {
341
- $lte: value
342
- }
343
- };
344
- return createQueryBuilder({
345
- ...query,
346
- filter: and(query.filter, newFilter)
347
- });
348
- },
349
- lt(field, value) {
350
- const newFilter = {
351
- [renameFieldByPaths(opts.transformationPaths, field)]: { $lt: value }
352
- };
353
- return createQueryBuilder({
354
- ...query,
355
- filter: and(query.filter, newFilter)
356
- });
357
- },
358
- isNotEmpty(field) {
359
- return this.ne(field, null);
360
- },
361
- isEmpty(field) {
362
- return this.eq(field, null);
363
- },
364
- startsWith(field, value) {
365
- const newFilter = {
366
- [renameFieldByPaths(opts.transformationPaths, field)]: {
367
- $startsWith: value
368
- }
369
- };
370
- return createQueryBuilder({
371
- ...query,
372
- filter: and(query.filter, newFilter)
373
- });
374
- },
375
- endsWith(field, value) {
376
- const newFilter = {
377
- [renameFieldByPaths(opts.transformationPaths, field)]: {
378
- $endsWith: value
379
- }
380
- };
381
- return createQueryBuilder({
382
- ...query,
383
- filter: and(query.filter, newFilter)
384
- });
385
- },
386
- contains(field, value) {
387
- const newFilter = {
388
- [renameFieldByPaths(opts.transformationPaths, field)]: {
389
- $contains: value
390
- }
391
- };
392
- return createQueryBuilder({
393
- ...query,
394
- filter: and(query.filter, newFilter)
395
- });
396
- },
397
- hasSome(field, ...values) {
398
- const newFilter = {
399
- [renameFieldByPaths(opts.transformationPaths, field)]: {
400
- $hasSome: Array.isArray(values[0]) ? values[0] : values
401
- }
402
- };
403
- return createQueryBuilder({
404
- ...query,
405
- filter: and(query.filter, newFilter)
406
- });
407
- },
408
- hasAll(field, ...values) {
409
- const newFilter = {
410
- [renameFieldByPaths(opts.transformationPaths, field)]: {
411
- $hasAll: Array.isArray(values[0]) ? values[0] : values
412
- }
413
- };
414
- return createQueryBuilder({
415
- ...query,
416
- filter: and(query.filter, newFilter)
417
- });
418
- },
419
- between(field, from, to) {
420
- return this.ge(field, from).lt(field, to);
421
- },
422
- in(field, values) {
423
- const newFilter = {
424
- [renameFieldByPaths(opts.transformationPaths, field)]: {
425
- $in: values
426
- }
427
- };
428
- return createQueryBuilder({
429
- ...query,
430
- filter: and(query.filter, newFilter)
431
- });
432
- },
433
- exists(field, value = true) {
434
- const newFilter = {
435
- [renameFieldByPaths(opts.transformationPaths, field)]: {
436
- $exists: value
437
- }
438
- };
439
- return createQueryBuilder({
440
- ...query,
441
- filter: and(query.filter, newFilter)
442
- });
443
- },
444
- or(orQuery) {
445
- return createQueryBuilder({
446
- ...query,
447
- filter: or(query.filter, orQuery.query.filter)
448
- });
449
- },
450
- and(andQuery) {
451
- return createQueryBuilder({
452
- ...query,
453
- filter: and(query.filter, andQuery.query.filter)
454
- });
455
- },
456
- not(notQuery) {
457
- return createQueryBuilder({
458
- ...query,
459
- filter: not(notQuery.query.filter)
460
- });
461
- },
462
- ascending(...fieldNames) {
463
- return createQueryBuilder({
464
- ...query,
465
- sort: [
466
- ...query.sort ?? [],
467
- ...fieldNames.map((fieldName) => ({
468
- fieldName: renameFieldByPaths(opts.transformationPaths, fieldName),
469
- order: "ASC"
470
- }))
471
- ]
472
- });
473
- },
474
- descending(...fieldNames) {
475
- return createQueryBuilder({
476
- ...query,
477
- sort: [
478
- ...query.sort ?? [],
479
- ...fieldNames.map((fieldName) => ({
480
- fieldName: renameFieldByPaths(opts.transformationPaths, fieldName),
481
- order: "DESC"
482
- }))
483
- ]
484
- });
485
- },
486
- skip(offset) {
487
- return createQueryBuilder({
488
- ...query,
489
- paging: {
490
- offset,
491
- limit: "limit" in query.paging ? query.paging.limit : DEFAULT_LIMIT
492
- }
493
- });
494
- },
495
- limit(limit) {
496
- if (opts.pagingMethod === "CURSOR") {
497
- const cursorQuery = query;
498
- return createQueryBuilder({
499
- ...query,
500
- cursorPaging: {
501
- limit,
502
- cursor: "cursor" in cursorQuery.cursorPaging ? cursorQuery.cursorPaging.cursor : void 0
503
- }
504
- });
505
- }
506
- const offsetQuery = query;
507
- return createQueryBuilder({
508
- ...query,
509
- paging: {
510
- limit,
511
- offset: "offset" in offsetQuery.paging ? offsetQuery.paging.offset : 0
512
- }
513
- });
514
- }
515
- };
516
- };
517
- return createQueryBuilder({
518
- filter: {},
519
- ...opts.pagingMethod === "OFFSET" ? { paging: { offset: 0, limit: DEFAULT_LIMIT } } : { cursorPaging: { limit: DEFAULT_LIMIT } }
520
- });
521
- }
522
- function renameFieldByPaths(transformationPaths, fieldPath) {
523
- const transformationPath = Object.entries(transformationPaths).find(([path]) => path === fieldPath || fieldPath.startsWith(`${path}.`))?.[0];
524
- if (transformationPath) {
525
- return fieldPath.replace(transformationPath, transformationPaths[transformationPath]);
526
- }
527
- return fieldPath.split(".").map((segment) => transformationPaths[segment] ?? SDKRequestToRESTRequestRenameMap[segment] ?? segment).join(".");
528
- }
529
-
530
- // ../../node_modules/@wix/sdk-runtime/build/transformations/field-mask.js
531
- function transformSDKFieldMaskToRESTFieldMask(val) {
532
- if (!val) {
533
- return val;
534
- }
535
- return val.join(",");
536
- }
537
-
538
- // ../../node_modules/@wix/sdk-runtime/build/event-definition-modules.js
539
- function createEventModule(eventDefinition) {
540
- return contextualizeEventDefinitionModuleV2(eventDefinition);
541
- }
542
-
543
- // ../../node_modules/@wix/auto_sdk_auth-management_o-auth-apps/build/es/index.mjs
544
- function resolveWixHeadlessV1OAuthAppServiceUrl(opts) {
545
- const domainToMappings = {
546
- "manage._base_domain_": [
547
- {
548
- srcPath: "/oauth-app-service",
549
- destPath: ""
550
- },
551
- {
552
- srcPath: "/oauth-app",
553
- destPath: ""
554
- }
555
- ],
556
- "www.wixapis.com": [
557
- {
558
- srcPath: "/oauth-app",
559
- destPath: ""
560
- }
561
- ],
562
- "api._api_base_domain_": [
563
- {
564
- srcPath: "/oauth-app-service",
565
- destPath: ""
566
- }
567
- ]
568
- };
569
- return resolveUrl(Object.assign(opts, { domainToMappings }));
570
- }
571
- var PACKAGE_NAME = "@wix/auto_sdk_auth-management_o-auth-apps";
572
- function createOAuthApp(payload) {
573
- function __createOAuthApp({ host }) {
574
- const serializedData = transformPaths(payload, [
575
- {
576
- transformFn: transformSDKTimestampToRESTTimestamp,
577
- paths: [{ path: "oAuthApp.createdDate" }]
578
- }
579
- ]);
580
- const metadata = {
581
- entityFqdn: "wix.headless.v1.o_auth_app",
582
- method: "POST",
583
- methodFqn: "wix.headless.v1.OAuthAppService.CreateOAuthApp",
584
- packageName: PACKAGE_NAME,
585
- url: resolveWixHeadlessV1OAuthAppServiceUrl({
586
- protoPath: "/v1/oauth-apps",
587
- data: serializedData,
588
- host
589
- }),
590
- data: serializedData,
591
- transformResponse: (payload2) => transformPaths(payload2, [
592
- {
593
- transformFn: transformRESTTimestampToSDKTimestamp,
594
- paths: [{ path: "oAuthApp.createdDate" }]
595
- }
596
- ])
597
- };
598
- return metadata;
599
- }
600
- return __createOAuthApp;
601
- }
602
- function getOAuthApp(payload) {
603
- function __getOAuthApp({ host }) {
604
- const metadata = {
605
- entityFqdn: "wix.headless.v1.o_auth_app",
606
- method: "GET",
607
- methodFqn: "wix.headless.v1.OAuthAppService.GetOAuthApp",
608
- packageName: PACKAGE_NAME,
609
- url: resolveWixHeadlessV1OAuthAppServiceUrl({
610
- protoPath: "/v1/oauth-apps/{oAuthAppId}",
611
- data: payload,
612
- host
613
- }),
614
- params: toURLSearchParams(payload),
615
- transformResponse: (payload2) => transformPaths(payload2, [
616
- {
617
- transformFn: transformRESTTimestampToSDKTimestamp,
618
- paths: [{ path: "oAuthApp.createdDate" }]
619
- }
620
- ])
621
- };
622
- return metadata;
623
- }
624
- return __getOAuthApp;
625
- }
626
- function updateOAuthApp(payload) {
627
- function __updateOAuthApp({ host }) {
628
- const serializedData = transformPaths(payload, [
629
- {
630
- transformFn: transformSDKFieldMaskToRESTFieldMask,
631
- paths: [{ path: "mask" }]
632
- },
633
- {
634
- transformFn: transformSDKTimestampToRESTTimestamp,
635
- paths: [{ path: "oAuthApp.createdDate" }]
636
- }
637
- ]);
638
- const metadata = {
639
- entityFqdn: "wix.headless.v1.o_auth_app",
640
- method: "PATCH",
641
- methodFqn: "wix.headless.v1.OAuthAppService.UpdateOAuthApp",
642
- packageName: PACKAGE_NAME,
643
- url: resolveWixHeadlessV1OAuthAppServiceUrl({
644
- protoPath: "/v1/oauth-apps/{oAuthApp.id}",
645
- data: serializedData,
646
- host
647
- }),
648
- data: serializedData,
649
- transformResponse: (payload2) => transformPaths(payload2, [
650
- {
651
- transformFn: transformRESTTimestampToSDKTimestamp,
652
- paths: [{ path: "oAuthApp.createdDate" }]
653
- }
654
- ])
655
- };
656
- return metadata;
657
- }
658
- return __updateOAuthApp;
659
- }
660
- function deleteOAuthApp(payload) {
661
- function __deleteOAuthApp({ host }) {
662
- const metadata = {
663
- entityFqdn: "wix.headless.v1.o_auth_app",
664
- method: "DELETE",
665
- methodFqn: "wix.headless.v1.OAuthAppService.DeleteOAuthApp",
666
- packageName: PACKAGE_NAME,
667
- url: resolveWixHeadlessV1OAuthAppServiceUrl({
668
- protoPath: "/v1/oauth-apps/{oAuthAppId}",
669
- data: payload,
670
- host
671
- }),
672
- params: toURLSearchParams(payload)
673
- };
674
- return metadata;
675
- }
676
- return __deleteOAuthApp;
677
- }
678
- function queryOAuthApps(payload) {
679
- function __queryOAuthApps({ host }) {
680
- const metadata = {
681
- entityFqdn: "wix.headless.v1.o_auth_app",
682
- method: "POST",
683
- methodFqn: "wix.headless.v1.OAuthAppService.QueryOAuthApps",
684
- packageName: PACKAGE_NAME,
685
- url: resolveWixHeadlessV1OAuthAppServiceUrl({
686
- protoPath: "/v1/oauth-apps/query",
687
- data: payload,
688
- host
689
- }),
690
- data: payload,
691
- transformResponse: (payload2) => transformPaths(payload2, [
692
- {
693
- transformFn: transformRESTTimestampToSDKTimestamp,
694
- paths: [{ path: "oAuthApps.createdDate" }]
695
- }
696
- ])
697
- };
698
- return metadata;
699
- }
700
- return __queryOAuthApps;
701
- }
702
- function generateOAuthAppSecret(payload) {
703
- function __generateOAuthAppSecret({ host }) {
704
- const metadata = {
705
- entityFqdn: "wix.headless.v1.o_auth_app",
706
- method: "POST",
707
- methodFqn: "wix.headless.v1.OAuthAppService.GenerateOAuthAppSecret",
708
- packageName: PACKAGE_NAME,
709
- url: resolveWixHeadlessV1OAuthAppServiceUrl({
710
- protoPath: "/v1/oauth-apps/{oAuthAppId}/generate-secret",
711
- data: payload,
712
- host
713
- }),
714
- data: payload
715
- };
716
- return metadata;
717
- }
718
- return __generateOAuthAppSecret;
719
- }
720
- var OAuthAppType = /* @__PURE__ */ ((OAuthAppType2) => {
721
- OAuthAppType2["OAUTH_APP_TYPE_UNSPECIFIED"] = "OAUTH_APP_TYPE_UNSPECIFIED";
722
- OAuthAppType2["WEB_APP"] = "WEB_APP";
723
- OAuthAppType2["MOBILE"] = "MOBILE";
724
- OAuthAppType2["OTHER"] = "OTHER";
725
- return OAuthAppType2;
726
- })(OAuthAppType || {});
727
- var OAuthTechnologies = /* @__PURE__ */ ((OAuthTechnologies2) => {
728
- OAuthTechnologies2["OAUTH_TECHNOLOGY_UNSPECIFIED"] = "OAUTH_TECHNOLOGY_UNSPECIFIED";
729
- OAuthTechnologies2["JAVASCRIPT"] = "JAVASCRIPT";
730
- OAuthTechnologies2["ANGULAR"] = "ANGULAR";
731
- OAuthTechnologies2["VUE"] = "VUE";
732
- OAuthTechnologies2["REACT"] = "REACT";
733
- OAuthTechnologies2["REACT_NATIVE"] = "REACT_NATIVE";
734
- OAuthTechnologies2["IOS"] = "IOS";
735
- OAuthTechnologies2["ANDROID"] = "ANDROID";
736
- OAuthTechnologies2["OTHER_TECHNOLOGY"] = "OTHER_TECHNOLOGY";
737
- return OAuthTechnologies2;
738
- })(OAuthTechnologies || {});
739
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
740
- SortOrder2["ASC"] = "ASC";
741
- SortOrder2["DESC"] = "DESC";
742
- return SortOrder2;
743
- })(SortOrder || {});
744
- var State = /* @__PURE__ */ ((State2) => {
745
- State2["UNKNOWN"] = "UNKNOWN";
746
- State2["ENABLED"] = "ENABLED";
747
- State2["DISABLED"] = "DISABLED";
748
- State2["PENDING"] = "PENDING";
749
- State2["DEMO"] = "DEMO";
750
- return State2;
751
- })(State || {});
752
- var SiteCreatedContext = /* @__PURE__ */ ((SiteCreatedContext2) => {
753
- SiteCreatedContext2["OTHER"] = "OTHER";
754
- SiteCreatedContext2["FROM_TEMPLATE"] = "FROM_TEMPLATE";
755
- SiteCreatedContext2["DUPLICATE_BY_SITE_TRANSFER"] = "DUPLICATE_BY_SITE_TRANSFER";
756
- SiteCreatedContext2["DUPLICATE"] = "DUPLICATE";
757
- SiteCreatedContext2["OLD_SITE_TRANSFER"] = "OLD_SITE_TRANSFER";
758
- SiteCreatedContext2["FLASH"] = "FLASH";
759
- return SiteCreatedContext2;
760
- })(SiteCreatedContext || {});
761
- var Namespace = /* @__PURE__ */ ((Namespace2) => {
762
- Namespace2["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
763
- Namespace2["WIX"] = "WIX";
764
- Namespace2["SHOUT_OUT"] = "SHOUT_OUT";
765
- Namespace2["ALBUMS"] = "ALBUMS";
766
- Namespace2["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
767
- Namespace2["HOTELS"] = "HOTELS";
768
- Namespace2["CLUBS"] = "CLUBS";
769
- Namespace2["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
770
- Namespace2["DEV_SITE"] = "DEV_SITE";
771
- Namespace2["LOGOS"] = "LOGOS";
772
- Namespace2["VIDEO_MAKER"] = "VIDEO_MAKER";
773
- Namespace2["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
774
- Namespace2["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
775
- Namespace2["HTML_DRAFT"] = "HTML_DRAFT";
776
- Namespace2["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
777
- Namespace2["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
778
- Namespace2["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
779
- Namespace2["ANYWHERE"] = "ANYWHERE";
780
- Namespace2["HEADLESS"] = "HEADLESS";
781
- Namespace2["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
782
- Namespace2["RISE"] = "RISE";
783
- Namespace2["BRANDED_FIRST"] = "BRANDED_FIRST";
784
- Namespace2["NOWNIA"] = "NOWNIA";
785
- Namespace2["UGC_TEMPLATE"] = "UGC_TEMPLATE";
786
- Namespace2["CODUX"] = "CODUX";
787
- Namespace2["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
788
- Namespace2["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
789
- Namespace2["STANDALONE_FORMS"] = "STANDALONE_FORMS";
790
- Namespace2["STANDALONE_EVENTS"] = "STANDALONE_EVENTS";
791
- Namespace2["MIMIR"] = "MIMIR";
792
- Namespace2["TWINS"] = "TWINS";
793
- return Namespace2;
794
- })(Namespace || {});
795
- var DeleteStatus = /* @__PURE__ */ ((DeleteStatus2) => {
796
- DeleteStatus2["UNKNOWN"] = "UNKNOWN";
797
- DeleteStatus2["TRASH"] = "TRASH";
798
- DeleteStatus2["DELETED"] = "DELETED";
799
- DeleteStatus2["PENDING_PURGE"] = "PENDING_PURGE";
800
- DeleteStatus2["PURGED_EXTERNALLY"] = "PURGED_EXTERNALLY";
801
- return DeleteStatus2;
802
- })(DeleteStatus || {});
803
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
804
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
805
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
806
- WebhookIdentityType2["MEMBER"] = "MEMBER";
807
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
808
- WebhookIdentityType2["APP"] = "APP";
809
- return WebhookIdentityType2;
810
- })(WebhookIdentityType || {});
811
- async function createOAuthApp2(oAuthApp) {
812
- const { httpClient, sideEffects } = arguments[1];
813
- const payload = renameKeysFromSDKRequestToRESTRequest({ oAuthApp });
814
- const reqOpts = createOAuthApp(payload);
815
- sideEffects?.onSiteCall?.();
816
- try {
817
- const result = await httpClient.request(reqOpts);
818
- sideEffects?.onSuccess?.(result);
819
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.oAuthApp;
820
- } catch (err) {
821
- const transformedError = transformError(
822
- err,
823
- {
824
- spreadPathsToArguments: {},
825
- explicitPathsToArguments: { oAuthApp: "$[0]" },
826
- singleArgumentUnchanged: false
827
- },
828
- ["oAuthApp"]
829
- );
830
- sideEffects?.onError?.(err);
831
- throw transformedError;
832
- }
833
- }
834
- async function getOAuthApp2(oAuthAppId) {
835
- const { httpClient, sideEffects } = arguments[1];
836
- const payload = renameKeysFromSDKRequestToRESTRequest({
837
- oAuthAppId
838
- });
839
- const reqOpts = getOAuthApp(payload);
840
- sideEffects?.onSiteCall?.();
841
- try {
842
- const result = await httpClient.request(reqOpts);
843
- sideEffects?.onSuccess?.(result);
844
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.oAuthApp;
845
- } catch (err) {
846
- const transformedError = transformError(
847
- err,
848
- {
849
- spreadPathsToArguments: {},
850
- explicitPathsToArguments: { oAuthAppId: "$[0]" },
851
- singleArgumentUnchanged: false
852
- },
853
- ["oAuthAppId"]
854
- );
855
- sideEffects?.onError?.(err);
856
- throw transformedError;
857
- }
858
- }
859
- async function updateOAuthApp2(_id, oAuthApp, mask) {
860
- const { httpClient, sideEffects } = arguments[3];
861
- const payload = renameKeysFromSDKRequestToRESTRequest({
862
- oAuthApp: { ...oAuthApp, id: _id },
863
- mask
864
- });
865
- const reqOpts = updateOAuthApp(payload);
866
- sideEffects?.onSiteCall?.();
867
- try {
868
- const result = await httpClient.request(reqOpts);
869
- sideEffects?.onSuccess?.(result);
870
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.oAuthApp;
871
- } catch (err) {
872
- const transformedError = transformError(
873
- err,
874
- {
875
- spreadPathsToArguments: { oAuthApp: "$[1]" },
876
- explicitPathsToArguments: { "oAuthApp.id": "$[0]", mask: "$[2]" },
877
- singleArgumentUnchanged: false
878
- },
879
- ["_id", "oAuthApp", "mask"]
880
- );
881
- sideEffects?.onError?.(err);
882
- throw transformedError;
883
- }
884
- }
885
- async function deleteOAuthApp2(oAuthAppId) {
886
- const { httpClient, sideEffects } = arguments[1];
887
- const payload = renameKeysFromSDKRequestToRESTRequest({
888
- oAuthAppId
889
- });
890
- const reqOpts = deleteOAuthApp(payload);
891
- sideEffects?.onSiteCall?.();
892
- try {
893
- const result = await httpClient.request(reqOpts);
894
- sideEffects?.onSuccess?.(result);
895
- } catch (err) {
896
- const transformedError = transformError(
897
- err,
898
- {
899
- spreadPathsToArguments: {},
900
- explicitPathsToArguments: { oAuthAppId: "$[0]" },
901
- singleArgumentUnchanged: false
902
- },
903
- ["oAuthAppId"]
904
- );
905
- sideEffects?.onError?.(err);
906
- throw transformedError;
907
- }
908
- }
909
- function queryOAuthApps2() {
910
- const { httpClient, sideEffects } = arguments[0];
911
- return queryBuilder({
912
- func: async (payload) => {
913
- const reqOpts = queryOAuthApps(payload);
914
- sideEffects?.onSiteCall?.();
915
- try {
916
- const result = await httpClient.request(reqOpts);
917
- sideEffects?.onSuccess?.(result);
918
- return result;
919
- } catch (err) {
920
- sideEffects?.onError?.(err);
921
- throw err;
922
- }
923
- },
924
- requestTransformer: (query) => {
925
- const args = [query, {}];
926
- return renameKeysFromSDKRequestToRESTRequest({
927
- ...args?.[1],
928
- query: args?.[0]
929
- });
930
- },
931
- responseTransformer: ({ data }) => {
932
- const transformedData = renameKeysFromRESTResponseToSDKResponse(
933
- transformPaths(data, [])
934
- );
935
- return {
936
- items: transformedData?.oAuthApps,
937
- pagingMetadata: transformedData?.pagingMetadata
938
- };
939
- },
940
- errorTransformer: (err) => {
941
- const transformedError = transformError(err, {
942
- spreadPathsToArguments: {},
943
- explicitPathsToArguments: { query: "$[0]" },
944
- singleArgumentUnchanged: false
945
- });
946
- throw transformedError;
947
- },
948
- pagingMethod: "OFFSET",
949
- transformationPaths: {}
950
- });
951
- }
952
- async function generateOAuthAppSecret2(oAuthAppId) {
953
- const { httpClient, sideEffects } = arguments[1];
954
- const payload = renameKeysFromSDKRequestToRESTRequest({
955
- oAuthAppId
956
- });
957
- const reqOpts = generateOAuthAppSecret(payload);
958
- sideEffects?.onSiteCall?.();
959
- try {
960
- const result = await httpClient.request(reqOpts);
961
- sideEffects?.onSuccess?.(result);
962
- return renameKeysFromRESTResponseToSDKResponse(result.data);
963
- } catch (err) {
964
- const transformedError = transformError(
965
- err,
966
- {
967
- spreadPathsToArguments: {},
968
- explicitPathsToArguments: { oAuthAppId: "$[0]" },
969
- singleArgumentUnchanged: false
970
- },
971
- ["oAuthAppId"]
972
- );
973
- sideEffects?.onError?.(err);
974
- throw transformedError;
975
- }
976
- }
977
- function createOAuthApp3(httpClient) {
978
- return (oAuthApp) => createOAuthApp2(
979
- oAuthApp,
980
- // @ts-ignore
981
- { httpClient }
982
- );
983
- }
984
- function getOAuthApp3(httpClient) {
985
- return (oAuthAppId) => getOAuthApp2(
986
- oAuthAppId,
987
- // @ts-ignore
988
- { httpClient }
989
- );
990
- }
991
- function updateOAuthApp3(httpClient) {
992
- return (_id, oAuthApp, mask) => updateOAuthApp2(
993
- _id,
994
- oAuthApp,
995
- mask,
996
- // @ts-ignore
997
- { httpClient }
998
- );
999
- }
1000
- function deleteOAuthApp3(httpClient) {
1001
- return (oAuthAppId) => deleteOAuthApp2(
1002
- oAuthAppId,
1003
- // @ts-ignore
1004
- { httpClient }
1005
- );
1006
- }
1007
- function queryOAuthApps3(httpClient) {
1008
- return () => queryOAuthApps2(
1009
- // @ts-ignore
1010
- { httpClient }
1011
- );
1012
- }
1013
- function generateOAuthAppSecret3(httpClient) {
1014
- return (oAuthAppId) => generateOAuthAppSecret2(
1015
- oAuthAppId,
1016
- // @ts-ignore
1017
- { httpClient }
1018
- );
1019
- }
1020
- var onOAuthAppCreated = EventDefinition(
1021
- "wix.headless.v1.o_auth_app_created",
1022
- true,
1023
- (event) => renameKeysFromRESTResponseToSDKResponse(
1024
- transformPaths(event, [
1025
- {
1026
- transformFn: transformRESTTimestampToSDKTimestamp,
1027
- paths: [
1028
- { path: "entity.createdDate" },
1029
- { path: "metadata.eventTime" }
1030
- ]
1031
- }
1032
- ])
1033
- )
1034
- )();
1035
- var onOAuthAppDeleted = EventDefinition(
1036
- "wix.headless.v1.o_auth_app_deleted",
1037
- true,
1038
- (event) => renameKeysFromRESTResponseToSDKResponse(
1039
- transformPaths(event, [
1040
- {
1041
- transformFn: transformRESTTimestampToSDKTimestamp,
1042
- paths: [
1043
- { path: "undefined.createdDate" },
1044
- { path: "metadata.eventTime" }
1045
- ]
1046
- }
1047
- ])
1048
- )
1049
- )();
1050
- var onOAuthAppUpdated = EventDefinition(
1051
- "wix.headless.v1.o_auth_app_updated",
1052
- true,
1053
- (event) => renameKeysFromRESTResponseToSDKResponse(
1054
- transformPaths(event, [
1055
- {
1056
- transformFn: transformRESTTimestampToSDKTimestamp,
1057
- paths: [
1058
- { path: "entity.createdDate" },
1059
- { path: "metadata.eventTime" }
1060
- ]
1061
- }
1062
- ])
1063
- )
1064
- )();
1065
- var createOAuthApp4 = /* @__PURE__ */ createRESTModule(createOAuthApp3);
1066
- var getOAuthApp4 = /* @__PURE__ */ createRESTModule(getOAuthApp3);
1067
- var updateOAuthApp4 = /* @__PURE__ */ createRESTModule(updateOAuthApp3);
1068
- var deleteOAuthApp4 = /* @__PURE__ */ createRESTModule(deleteOAuthApp3);
1069
- var queryOAuthApps4 = /* @__PURE__ */ createRESTModule(queryOAuthApps3);
1070
- var generateOAuthAppSecret4 = /* @__PURE__ */ createRESTModule(generateOAuthAppSecret3);
1071
- var onOAuthAppCreated2 = createEventModule(onOAuthAppCreated);
1072
- var onOAuthAppDeleted2 = createEventModule(onOAuthAppDeleted);
1073
- var onOAuthAppUpdated2 = createEventModule(onOAuthAppUpdated);
1074
-
1075
- // src/routes/paylink/paylink.ts
1076
- import { auth } from "@wix/essentials";
1077
- import { WIX_CLIENT_ID } from "astro:env/client";
1078
- var GET = async ({ params }) => {
1079
- try {
1080
- const { redirectUrlWixPages } = await auth.elevate(es_exports.getOAuthApp)(
1081
- WIX_CLIENT_ID
1082
- );
1083
- if (redirectUrlWixPages == null) {
1084
- throw new Error(`Invalid Redirect URL: ${redirectUrlWixPages}`);
1085
- }
1086
- const paylinkId = params.id;
1087
- const baseUrl = redirectUrlWixPages.endsWith("/") ? redirectUrlWixPages : `${redirectUrlWixPages}/`;
1088
- const paylinkUrl = new URL(`_paylink/${paylinkId}`, baseUrl);
1089
- return new Response(null, {
1090
- headers: { Location: paylinkUrl.toString() },
1091
- status: 302
1092
- });
1093
- } catch (error) {
1094
- throw new Error(
1095
- `Error while constructing Paylink URL: ${JSON.stringify(error)}`
1096
- );
1097
- }
1098
- };
1099
- export {
1100
- GET
1101
- };