@wix/auto_sdk_payments_wix-payments-account 1.0.6 → 1.0.8

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 (130) hide show
  1. package/build/{cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.d.ts → index.d.mts} +9 -7
  2. package/build/{internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.d.ts → index.d.ts} +9 -7
  3. package/build/index.js +111 -0
  4. package/build/index.js.map +1 -0
  5. package/build/index.mjs +87 -0
  6. package/build/index.mjs.map +1 -0
  7. package/build/internal/{es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.d.ts → index.d.mts} +9 -7
  8. package/build/{es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.d.ts → internal/index.d.ts} +9 -7
  9. package/build/internal/index.js +111 -0
  10. package/build/internal/index.js.map +1 -0
  11. package/build/internal/index.mjs +87 -0
  12. package/build/internal/index.mjs.map +1 -0
  13. package/build/internal/meta.d.mts +57 -0
  14. package/build/internal/meta.d.ts +57 -0
  15. package/build/internal/meta.js +89 -0
  16. package/build/internal/meta.js.map +1 -0
  17. package/build/internal/meta.mjs +62 -0
  18. package/build/internal/meta.mjs.map +1 -0
  19. package/build/{es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.d.ts → internal/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.mts} +6 -4
  20. package/build/{cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.d.ts → internal/payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.ts} +6 -4
  21. package/build/meta.d.mts +57 -0
  22. package/build/meta.d.ts +57 -0
  23. package/build/meta.js +89 -0
  24. package/build/meta.js.map +1 -0
  25. package/build/meta.mjs +62 -0
  26. package/build/meta.mjs.map +1 -0
  27. package/build/{internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.d.ts → payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.mts} +6 -4
  28. package/build/{internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.d.ts → payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.d.ts} +6 -4
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.d.ts +0 -4
  40. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js +0 -7
  41. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js.map +0 -1
  42. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.d.ts +0 -20
  43. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js +0 -58
  44. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js.map +0 -1
  45. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.d.ts +0 -13
  46. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js +0 -47
  47. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js.map +0 -1
  48. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js +0 -12
  49. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js.map +0 -1
  50. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js +0 -3
  51. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js.map +0 -1
  52. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.d.ts +0 -73
  53. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js +0 -82
  54. package/build/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.d.ts +0 -4
  66. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js +0 -4
  67. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js.map +0 -1
  68. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.d.ts +0 -20
  69. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js +0 -54
  70. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js.map +0 -1
  71. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.d.ts +0 -13
  72. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js +0 -20
  73. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js.map +0 -1
  74. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js +0 -8
  75. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js.map +0 -1
  76. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js +0 -2
  77. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js.map +0 -1
  78. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.d.ts +0 -73
  79. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js +0 -55
  80. package/build/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.d.ts +0 -4
  91. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js +0 -7
  92. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js.map +0 -1
  93. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.d.ts +0 -20
  94. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js +0 -58
  95. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js.map +0 -1
  96. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.d.ts +0 -13
  97. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js +0 -47
  98. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js.map +0 -1
  99. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js +0 -12
  100. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js.map +0 -1
  101. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js +0 -3
  102. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js.map +0 -1
  103. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.d.ts +0 -73
  104. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js +0 -82
  105. package/build/internal/cjs/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js.map +0 -1
  106. package/build/internal/es/index.d.ts +0 -1
  107. package/build/internal/es/index.js +0 -2
  108. package/build/internal/es/index.js.map +0 -1
  109. package/build/internal/es/index.typings.d.ts +0 -1
  110. package/build/internal/es/index.typings.js +0 -2
  111. package/build/internal/es/index.typings.js.map +0 -1
  112. package/build/internal/es/meta.d.ts +0 -1
  113. package/build/internal/es/meta.js +0 -2
  114. package/build/internal/es/meta.js.map +0 -1
  115. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.d.ts +0 -4
  116. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js +0 -4
  117. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js.map +0 -1
  118. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.d.ts +0 -20
  119. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js +0 -54
  120. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.js.map +0 -1
  121. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.d.ts +0 -13
  122. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js +0 -20
  123. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.meta.js.map +0 -1
  124. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js +0 -8
  125. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.js.map +0 -1
  126. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js +0 -2
  127. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.types.js.map +0 -1
  128. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.d.ts +0 -73
  129. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js +0 -55
  130. package/build/internal/es/src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js.map +0 -1
@@ -1,9 +1,8 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { ConnectWixPaymentsAccountResponse, WixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function connectWixPaymentsAccount(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { W as WixPaymentsAccount, C as ConnectWixPaymentsAccountResponse } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.mjs';
3
+ export { a as ConnectWixPaymentsAccountRequest } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.mjs';
4
+
5
+ declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
7
6
  interface ConnectWixPaymentsAccountSignature {
8
7
  /**
9
8
  * Connects a Wix Payments account to the site.
@@ -26,4 +25,7 @@ interface ConnectWixPaymentsAccountSignature {
26
25
  */
27
26
  (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;
28
27
  }
29
- export { ConnectWixPaymentsAccountRequest, ConnectWixPaymentsAccountResponse, WixPaymentsAccount, } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
28
+
29
+ declare const connectWixPaymentsAccount: MaybeContext<BuildRESTFunction<typeof connectWixPaymentsAccount$1> & typeof connectWixPaymentsAccount$1>;
30
+
31
+ export { ConnectWixPaymentsAccountResponse, WixPaymentsAccount, connectWixPaymentsAccount };
@@ -1,9 +1,8 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { ConnectWixPaymentsAccountResponse, WixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function connectWixPaymentsAccount(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { W as WixPaymentsAccount, C as ConnectWixPaymentsAccountResponse } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.js';
3
+ export { a as ConnectWixPaymentsAccountRequest } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.js';
4
+
5
+ declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
7
6
  interface ConnectWixPaymentsAccountSignature {
8
7
  /**
9
8
  * Connects a Wix Payments account to the site.
@@ -26,4 +25,7 @@ interface ConnectWixPaymentsAccountSignature {
26
25
  */
27
26
  (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;
28
27
  }
29
- export { ConnectWixPaymentsAccountRequest, ConnectWixPaymentsAccountResponse, WixPaymentsAccount, } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
28
+
29
+ declare const connectWixPaymentsAccount: MaybeContext<BuildRESTFunction<typeof connectWixPaymentsAccount$1> & typeof connectWixPaymentsAccount$1>;
30
+
31
+ export { ConnectWixPaymentsAccountResponse, WixPaymentsAccount, connectWixPaymentsAccount };
package/build/index.js ADDED
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ connectWixPaymentsAccount: () => connectWixPaymentsAccount4
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
28
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
29
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
30
+
31
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
32
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
+ function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
34
+ const domainToMappings = {
35
+ "www.wixapis.com": [
36
+ {
37
+ srcPath: "/payments/v1/wix-payments-account",
38
+ destPath: "/v1/wix-payments-account"
39
+ },
40
+ {
41
+ srcPath: "/payments/mcp/v1/wix-payments-account",
42
+ destPath: "/v1/wix-payments-account"
43
+ }
44
+ ]
45
+ };
46
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
47
+ }
48
+ var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
49
+ function connectWixPaymentsAccount(payload) {
50
+ function __connectWixPaymentsAccount({ host }) {
51
+ const metadata = {
52
+ entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
53
+ method: "POST",
54
+ methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
55
+ packageName: PACKAGE_NAME,
56
+ url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
57
+ protoPath: "/v1/wix-payments-account/connect",
58
+ data: payload,
59
+ host
60
+ }),
61
+ data: payload
62
+ };
63
+ return metadata;
64
+ }
65
+ return __connectWixPaymentsAccount;
66
+ }
67
+
68
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
69
+ async function connectWixPaymentsAccount2(account) {
70
+ const { httpClient, sideEffects } = arguments[1];
71
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ account });
72
+ const reqOpts = connectWixPaymentsAccount(
73
+ payload
74
+ );
75
+ sideEffects?.onSiteCall?.();
76
+ try {
77
+ const result = await httpClient.request(reqOpts);
78
+ sideEffects?.onSuccess?.(result);
79
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
80
+ } catch (err) {
81
+ const transformedError = (0, import_transform_error.transformError)(
82
+ err,
83
+ {
84
+ spreadPathsToArguments: {},
85
+ explicitPathsToArguments: { account: "$[0]" },
86
+ singleArgumentUnchanged: false
87
+ },
88
+ ["account"]
89
+ );
90
+ sideEffects?.onError?.(err);
91
+ throw transformedError;
92
+ }
93
+ }
94
+
95
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts
96
+ function connectWixPaymentsAccount3(httpClient) {
97
+ return (account) => connectWixPaymentsAccount2(
98
+ account,
99
+ // @ts-ignore
100
+ { httpClient }
101
+ );
102
+ }
103
+
104
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts
105
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
106
+ var connectWixPaymentsAccount4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(connectWixPaymentsAccount3);
107
+ // Annotate the CommonJS export names for ESM import in node:
108
+ 0 && (module.exports = {
109
+ connectWixPaymentsAccount
110
+ });
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @permissionScope Connect Wix Payments Account\n * @permissionScopeId SCOPE.PAYMENTS.CONNECT-WIX-PAYMENTS-ACCOUNT\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\n /**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param - Wix Payments account to connect to the site.\n */\n (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;\n}\n\nexport {\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import { connectWixPaymentsAccount as publicConnectWixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\n\nexport {\n WixPaymentsAccount,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADiBA,eAAsBC,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEhHO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,IAAAC,uBAAiC;AAG1B,IAAMC,6BAGK,2DAAiBA,0BAA+B;","names":["connectWixPaymentsAccount","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccount","import_rest_modules","connectWixPaymentsAccount"]}
@@ -0,0 +1,87 @@
1
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
9
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
10
+ function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
11
+ const domainToMappings = {
12
+ "www.wixapis.com": [
13
+ {
14
+ srcPath: "/payments/v1/wix-payments-account",
15
+ destPath: "/v1/wix-payments-account"
16
+ },
17
+ {
18
+ srcPath: "/payments/mcp/v1/wix-payments-account",
19
+ destPath: "/v1/wix-payments-account"
20
+ }
21
+ ]
22
+ };
23
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
24
+ }
25
+ var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
26
+ function connectWixPaymentsAccount(payload) {
27
+ function __connectWixPaymentsAccount({ host }) {
28
+ const metadata = {
29
+ entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
30
+ method: "POST",
31
+ methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
32
+ packageName: PACKAGE_NAME,
33
+ url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
34
+ protoPath: "/v1/wix-payments-account/connect",
35
+ data: payload,
36
+ host
37
+ }),
38
+ data: payload
39
+ };
40
+ return metadata;
41
+ }
42
+ return __connectWixPaymentsAccount;
43
+ }
44
+
45
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
46
+ async function connectWixPaymentsAccount2(account) {
47
+ const { httpClient, sideEffects } = arguments[1];
48
+ const payload = renameKeysFromSDKRequestToRESTRequest({ account });
49
+ const reqOpts = connectWixPaymentsAccount(
50
+ payload
51
+ );
52
+ sideEffects?.onSiteCall?.();
53
+ try {
54
+ const result = await httpClient.request(reqOpts);
55
+ sideEffects?.onSuccess?.(result);
56
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
57
+ } catch (err) {
58
+ const transformedError = sdkTransformError(
59
+ err,
60
+ {
61
+ spreadPathsToArguments: {},
62
+ explicitPathsToArguments: { account: "$[0]" },
63
+ singleArgumentUnchanged: false
64
+ },
65
+ ["account"]
66
+ );
67
+ sideEffects?.onError?.(err);
68
+ throw transformedError;
69
+ }
70
+ }
71
+
72
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts
73
+ function connectWixPaymentsAccount3(httpClient) {
74
+ return (account) => connectWixPaymentsAccount2(
75
+ account,
76
+ // @ts-ignore
77
+ { httpClient }
78
+ );
79
+ }
80
+
81
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts
82
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
83
+ var connectWixPaymentsAccount4 = /* @__PURE__ */ createRESTModule(connectWixPaymentsAccount3);
84
+ export {
85
+ connectWixPaymentsAccount4 as connectWixPaymentsAccount
86
+ };
87
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @permissionScope Connect Wix Payments Account\n * @permissionScopeId SCOPE.PAYMENTS.CONNECT-WIX-PAYMENTS-ACCOUNT\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\n /**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param - Wix Payments account to connect to the site.\n */\n (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;\n}\n\nexport {\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import { connectWixPaymentsAccount as publicConnectWixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\n\nexport {\n WixPaymentsAccount,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADiBA,eAAsBA,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEhHO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,SAAS,wBAAwB;AAG1B,IAAMC,6BAGK,iCAAiBA,0BAA+B;","names":["connectWixPaymentsAccount","connectWixPaymentsAccount","connectWixPaymentsAccount"]}
@@ -1,9 +1,8 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { ConnectWixPaymentsAccountResponse, WixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function connectWixPaymentsAccount(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { W as WixPaymentsAccount, C as ConnectWixPaymentsAccountResponse } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.mjs';
3
+ export { a as ConnectWixPaymentsAccountRequest } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.mjs';
4
+
5
+ declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
7
6
  interface ConnectWixPaymentsAccountSignature {
8
7
  /**
9
8
  * Connects a Wix Payments account to the site.
@@ -26,4 +25,7 @@ interface ConnectWixPaymentsAccountSignature {
26
25
  */
27
26
  (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;
28
27
  }
29
- export { ConnectWixPaymentsAccountRequest, ConnectWixPaymentsAccountResponse, WixPaymentsAccount, } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
28
+
29
+ declare const connectWixPaymentsAccount: MaybeContext<BuildRESTFunction<typeof connectWixPaymentsAccount$1> & typeof connectWixPaymentsAccount$1>;
30
+
31
+ export { ConnectWixPaymentsAccountResponse, WixPaymentsAccount, connectWixPaymentsAccount };
@@ -1,9 +1,8 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { ConnectWixPaymentsAccountResponse, WixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function connectWixPaymentsAccount(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { W as WixPaymentsAccount, C as ConnectWixPaymentsAccountResponse } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.js';
3
+ export { a as ConnectWixPaymentsAccountRequest } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal-C1SXJ3VZ.js';
4
+
5
+ declare function connectWixPaymentsAccount$1(httpClient: HttpClient): ConnectWixPaymentsAccountSignature;
7
6
  interface ConnectWixPaymentsAccountSignature {
8
7
  /**
9
8
  * Connects a Wix Payments account to the site.
@@ -26,4 +25,7 @@ interface ConnectWixPaymentsAccountSignature {
26
25
  */
27
26
  (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;
28
27
  }
29
- export { ConnectWixPaymentsAccountRequest, ConnectWixPaymentsAccountResponse, WixPaymentsAccount, } from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';
28
+
29
+ declare const connectWixPaymentsAccount: MaybeContext<BuildRESTFunction<typeof connectWixPaymentsAccount$1> & typeof connectWixPaymentsAccount$1>;
30
+
31
+ export { ConnectWixPaymentsAccountResponse, WixPaymentsAccount, connectWixPaymentsAccount };
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ connectWixPaymentsAccount: () => connectWixPaymentsAccount4
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
28
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
29
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
30
+
31
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
32
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
+ function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
34
+ const domainToMappings = {
35
+ "www.wixapis.com": [
36
+ {
37
+ srcPath: "/payments/v1/wix-payments-account",
38
+ destPath: "/v1/wix-payments-account"
39
+ },
40
+ {
41
+ srcPath: "/payments/mcp/v1/wix-payments-account",
42
+ destPath: "/v1/wix-payments-account"
43
+ }
44
+ ]
45
+ };
46
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
47
+ }
48
+ var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
49
+ function connectWixPaymentsAccount(payload) {
50
+ function __connectWixPaymentsAccount({ host }) {
51
+ const metadata = {
52
+ entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
53
+ method: "POST",
54
+ methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
55
+ packageName: PACKAGE_NAME,
56
+ url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
57
+ protoPath: "/v1/wix-payments-account/connect",
58
+ data: payload,
59
+ host
60
+ }),
61
+ data: payload
62
+ };
63
+ return metadata;
64
+ }
65
+ return __connectWixPaymentsAccount;
66
+ }
67
+
68
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
69
+ async function connectWixPaymentsAccount2(account) {
70
+ const { httpClient, sideEffects } = arguments[1];
71
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ account });
72
+ const reqOpts = connectWixPaymentsAccount(
73
+ payload
74
+ );
75
+ sideEffects?.onSiteCall?.();
76
+ try {
77
+ const result = await httpClient.request(reqOpts);
78
+ sideEffects?.onSuccess?.(result);
79
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
80
+ } catch (err) {
81
+ const transformedError = (0, import_transform_error.transformError)(
82
+ err,
83
+ {
84
+ spreadPathsToArguments: {},
85
+ explicitPathsToArguments: { account: "$[0]" },
86
+ singleArgumentUnchanged: false
87
+ },
88
+ ["account"]
89
+ );
90
+ sideEffects?.onError?.(err);
91
+ throw transformedError;
92
+ }
93
+ }
94
+
95
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts
96
+ function connectWixPaymentsAccount3(httpClient) {
97
+ return (account) => connectWixPaymentsAccount2(
98
+ account,
99
+ // @ts-ignore
100
+ { httpClient }
101
+ );
102
+ }
103
+
104
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts
105
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
106
+ var connectWixPaymentsAccount4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(connectWixPaymentsAccount3);
107
+ // Annotate the CommonJS export names for ESM import in node:
108
+ 0 && (module.exports = {
109
+ connectWixPaymentsAccount
110
+ });
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["export * from './src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @permissionScope Connect Wix Payments Account\n * @permissionScopeId SCOPE.PAYMENTS.CONNECT-WIX-PAYMENTS-ACCOUNT\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\n /**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param - Wix Payments account to connect to the site.\n */\n (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;\n}\n\nexport {\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import { connectWixPaymentsAccount as publicConnectWixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\n\nexport {\n WixPaymentsAccount,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADiBA,eAAsBC,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEhHO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,IAAAC,uBAAiC;AAG1B,IAAMC,6BAGK,2DAAiBA,0BAA+B;","names":["connectWixPaymentsAccount","connectWixPaymentsAccount","sdkTransformError","connectWixPaymentsAccount","import_rest_modules","connectWixPaymentsAccount"]}
@@ -0,0 +1,87 @@
1
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts
9
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
10
+ function resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(opts) {
11
+ const domainToMappings = {
12
+ "www.wixapis.com": [
13
+ {
14
+ srcPath: "/payments/v1/wix-payments-account",
15
+ destPath: "/v1/wix-payments-account"
16
+ },
17
+ {
18
+ srcPath: "/payments/mcp/v1/wix-payments-account",
19
+ destPath: "/v1/wix-payments-account"
20
+ }
21
+ ]
22
+ };
23
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
24
+ }
25
+ var PACKAGE_NAME = "@wix/auto_sdk_payments_wix-payments-account";
26
+ function connectWixPaymentsAccount(payload) {
27
+ function __connectWixPaymentsAccount({ host }) {
28
+ const metadata = {
29
+ entityFqdn: "wix.payments.mcp.v1.wix_payments_account",
30
+ method: "POST",
31
+ methodFqn: "wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount",
32
+ packageName: PACKAGE_NAME,
33
+ url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({
34
+ protoPath: "/v1/wix-payments-account/connect",
35
+ data: payload,
36
+ host
37
+ }),
38
+ data: payload
39
+ };
40
+ return metadata;
41
+ }
42
+ return __connectWixPaymentsAccount;
43
+ }
44
+
45
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts
46
+ async function connectWixPaymentsAccount2(account) {
47
+ const { httpClient, sideEffects } = arguments[1];
48
+ const payload = renameKeysFromSDKRequestToRESTRequest({ account });
49
+ const reqOpts = connectWixPaymentsAccount(
50
+ payload
51
+ );
52
+ sideEffects?.onSiteCall?.();
53
+ try {
54
+ const result = await httpClient.request(reqOpts);
55
+ sideEffects?.onSuccess?.(result);
56
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
57
+ } catch (err) {
58
+ const transformedError = sdkTransformError(
59
+ err,
60
+ {
61
+ spreadPathsToArguments: {},
62
+ explicitPathsToArguments: { account: "$[0]" },
63
+ singleArgumentUnchanged: false
64
+ },
65
+ ["account"]
66
+ );
67
+ sideEffects?.onError?.(err);
68
+ throw transformedError;
69
+ }
70
+ }
71
+
72
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts
73
+ function connectWixPaymentsAccount3(httpClient) {
74
+ return (account) => connectWixPaymentsAccount2(
75
+ account,
76
+ // @ts-ignore
77
+ { httpClient }
78
+ );
79
+ }
80
+
81
+ // src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts
82
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
83
+ var connectWixPaymentsAccount4 = /* @__PURE__ */ createRESTModule(connectWixPaymentsAccount3);
84
+ export {
85
+ connectWixPaymentsAccount4 as connectWixPaymentsAccount
86
+ };
87
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.universal.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.http.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.public.ts","../../src/payments-mcp-v1-wix-payments-account-wix-payments-account.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsMcpV1WixPaymentsAccount from './payments-mcp-v1-wix-payments-account-wix-payments-account.http.js';\n\n/** An account that enables a Wix site to process customer payments. */\nexport interface WixPaymentsAccount {\n /**\n * ID of the Wix Payments account.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * First name of the Wix Payments account owner.\n * @maxLength 500\n */\n firstName?: string | null;\n /**\n * Last name of the Wix Payments account owner.\n * @maxLength 500\n */\n lastName?: string | null;\n /**\n * Whether the account owner has accepted the\n * [Wix Payments Terms of Service](https://www.wix.com/about/terms-of-payments).\n * The account owner must accept these terms for the account to be created\n * successfully. If the terms aren't accepted, the Connect Wix Payments Account\n * call fails.\n */\n tosAccepted?: boolean | null;\n /**\n * Brief summary of the types of products and services offered for sale through the Wix Payments account.\n * For example, \"Sportswear and sport accessories\".\n * @maxLength 500\n */\n productDescription?: string | null;\n}\n\nexport interface ConnectWixPaymentsAccountRequest {\n /** Wix Payments account to connect to the site. */\n account: WixPaymentsAccount;\n}\n\nexport interface ConnectWixPaymentsAccountResponse {\n /** Connected Wix Payments account. */\n account?: WixPaymentsAccount;\n}\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param account - Wix Payments account to connect to the site.\n * @public\n * @documentationMaturity preview\n * @requiredField account\n * @requiredField account.firstName\n * @requiredField account.lastName\n * @requiredField account.tosAccepted\n * @permissionId CASHIER.PROVIDER_ACCOUNTS_CREATE\n * @permissionScope Connect Wix Payments Account\n * @permissionScopeId SCOPE.PAYMENTS.CONNECT-WIX-PAYMENTS-ACCOUNT\n * @applicableIdentity APP\n * @fqn wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount\n */\nexport async function connectWixPaymentsAccount(\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n): Promise<ConnectWixPaymentsAccountResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ account: account });\n\n const reqOpts =\n ambassadorWixPaymentsMcpV1WixPaymentsAccount.connectWixPaymentsAccount(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { account: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['account']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n {\n srcPath: '/payments/mcp/v1/wix-payments-account',\n destPath: '/v1/wix-payments-account',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_wix-payments-account';\n\n/**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n */\nexport function connectWixPaymentsAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __connectWixPaymentsAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.mcp.v1.wix_payments_account',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.mcp.v1.WixPaymentsAccountService.ConnectWixPaymentsAccount',\n packageName: PACKAGE_NAME,\n url: resolveWixPaymentsMcpV1WixPaymentsAccountServiceUrl({\n protoPath: '/v1/wix-payments-account/connect',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __connectWixPaymentsAccount;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n connectWixPaymentsAccount as universalConnectWixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function connectWixPaymentsAccount(\n httpClient: HttpClient\n): ConnectWixPaymentsAccountSignature {\n return (\n account: NonNullablePaths<\n WixPaymentsAccount,\n `firstName` | `lastName` | `tosAccepted`\n >\n ) =>\n universalConnectWixPaymentsAccount(\n account,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConnectWixPaymentsAccountSignature {\n /**\n * Connects a Wix Payments account to the site.\n *\n *\n * The call fails if:\n * - The site's location\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/introduction))\n * is outside the USA.\n * - A Wix Payments account is already connected to the site.\n * - You don't specify `{\"tosAccepted\": true}`.\n *\n * The connected Wix Payments account has the following limitations, which site\n * owners can manage in their dashboard:\n *\n * - By default, customers can only pay via credit card, Apple Pay, or Google Pay.\n * - To receive payments, site owners must complete onboarding to their Wix\n * Payments account in the site's dashboard.\n * @param - Wix Payments account to connect to the site.\n */\n (account: WixPaymentsAccount): Promise<ConnectWixPaymentsAccountResponse>;\n}\n\nexport {\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n WixPaymentsAccount,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n","import { connectWixPaymentsAccount as publicConnectWixPaymentsAccount } from './payments-mcp-v1-wix-payments-account-wix-payments-account.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const connectWixPaymentsAccount: MaybeContext<\n BuildRESTFunction<typeof publicConnectWixPaymentsAccount> &\n typeof publicConnectWixPaymentsAccount\n> = /*#__PURE__*/ createRESTModule(publicConnectWixPaymentsAccount);\n\nexport {\n WixPaymentsAccount,\n ConnectWixPaymentsAccountRequest,\n ConnectWixPaymentsAccountResponse,\n} from './payments-mcp-v1-wix-payments-account-wix-payments-account.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,0BACd,SAC4B;AAC5B,WAAS,4BAA4B,EAAE,KAAK,GAAQ;AAClD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,oDAAoD;AAAA,QACvD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADiBA,eAAsBA,2BACpB,SAI4C;AAE5C,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEhHO,SAASC,2BACd,YACoC;AACpC,SAAO,CACL,YAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,SAAS,wBAAwB;AAG1B,IAAMC,6BAGK,iCAAiBA,0BAA+B;","names":["connectWixPaymentsAccount","connectWixPaymentsAccount","connectWixPaymentsAccount"]}