@wix/auto_sdk_identity_oauth 1.0.3 → 1.0.4

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 (134) hide show
  1. package/build/{cjs/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → identity-oauth-v1-refresh-token-oauth.universal-BzqSyI-5.d.mts} +52 -34
  2. package/build/{internal/cjs/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → identity-oauth-v1-refresh-token-oauth.universal-BzqSyI-5.d.ts} +52 -34
  3. package/build/index.d.mts +37 -0
  4. package/build/index.d.ts +37 -0
  5. package/build/index.js +259 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +233 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{es/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → identity-oauth-v1-refresh-token-oauth.universal-BzqSyI-5.d.mts} +52 -34
  10. package/build/{es/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → internal/identity-oauth-v1-refresh-token-oauth.universal-BzqSyI-5.d.ts} +52 -34
  11. package/build/internal/index.d.mts +37 -0
  12. package/build/internal/index.d.ts +37 -0
  13. package/build/internal/index.js +259 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +233 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +79 -0
  18. package/build/internal/meta.d.ts +79 -0
  19. package/build/internal/meta.js +182 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +154 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +79 -0
  24. package/build/meta.d.ts +79 -0
  25. package/build/meta.js +182 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +154 -0
  28. package/build/meta.mjs.map +1 -0
  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/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  40. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -10
  41. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  42. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  43. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -134
  44. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  45. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  46. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -66
  47. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  48. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  49. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -20
  50. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  51. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -17
  52. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  53. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -300
  54. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -143
  55. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  67. package/build/es/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -6
  68. package/build/es/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  69. package/build/es/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  70. package/build/es/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -129
  71. package/build/es/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  72. package/build/es/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  73. package/build/es/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -38
  74. package/build/es/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  75. package/build/es/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  76. package/build/es/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -14
  77. package/build/es/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  78. package/build/es/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -14
  79. package/build/es/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  80. package/build/es/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -300
  81. package/build/es/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -115
  82. package/build/es/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  93. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -10
  94. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  95. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  96. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -134
  97. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  98. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  99. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -66
  100. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  101. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  102. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -20
  103. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  104. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -17
  105. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  106. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -300
  107. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -143
  108. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  119. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -6
  120. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  121. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  122. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -129
  123. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  124. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  125. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -38
  126. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  127. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  128. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -14
  129. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  130. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -14
  131. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  132. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -300
  133. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -115
  134. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
@@ -0,0 +1,259 @@
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
+ SubjectType: () => SubjectType,
24
+ token: () => token4,
25
+ tokenInfo: () => tokenInfo4
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/identity-oauth-v1-refresh-token-oauth.universal.ts
30
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
31
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
32
+
33
+ // src/identity-oauth-v1-refresh-token-oauth.http.ts
34
+ var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
35
+ var import_bytes2 = require("@wix/sdk-runtime/transformations/bytes");
36
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
37
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
38
+ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
39
+ const domainToMappings = {
40
+ "manage._base_domain_": [
41
+ {
42
+ srcPath: "/oauth2",
43
+ destPath: "/v1/oauth"
44
+ }
45
+ ],
46
+ "www.wixapis.com": [
47
+ {
48
+ srcPath: "/oauth2",
49
+ destPath: "/v1/oauth"
50
+ },
51
+ {
52
+ srcPath: "/oauth2/token_info",
53
+ destPath: "/v1/token_info"
54
+ }
55
+ ],
56
+ "users._base_domain_": [
57
+ {
58
+ srcPath: "/v1/oauth/device/verify",
59
+ destPath: "/v1/oauth/device/verify"
60
+ },
61
+ {
62
+ srcPath: "/v1/oauth/manage/user-code",
63
+ destPath: "/v1/oauth/manage/user-code"
64
+ },
65
+ {
66
+ srcPath: "/v2/oauth/device/verify",
67
+ destPath: "/v2/oauth/device/verify"
68
+ },
69
+ {
70
+ srcPath: "/v1/oauth/authorize",
71
+ destPath: "/v1/oauth/authorize"
72
+ }
73
+ ],
74
+ _: [
75
+ {
76
+ srcPath: "/_api/oauth2",
77
+ destPath: "/v1/oauth"
78
+ }
79
+ ],
80
+ "platform.rise.ai": [
81
+ {
82
+ srcPath: "/oauth2",
83
+ destPath: "/v1/oauth"
84
+ }
85
+ ],
86
+ "api._api_base_domain_": [
87
+ {
88
+ srcPath: "/oauth2-ng",
89
+ destPath: ""
90
+ }
91
+ ]
92
+ };
93
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
94
+ }
95
+ var PACKAGE_NAME = "@wix/auto_sdk_identity_oauth";
96
+ function token(payload) {
97
+ function __token({ host }) {
98
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
99
+ { transformFn: import_bytes.transformSDKBytesToRESTBytes, paths: [{ path: "body" }] }
100
+ ]);
101
+ const metadata = {
102
+ entityFqdn: "wix.identity.oauth.v1.refresh_token",
103
+ method: "POST",
104
+ methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.Token",
105
+ packageName: PACKAGE_NAME,
106
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
107
+ protoPath: "/v1/oauth/token",
108
+ data: serializedData,
109
+ host
110
+ }),
111
+ data: serializedData,
112
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
113
+ {
114
+ transformFn: import_bytes2.transformRESTBytesToSDKBytes,
115
+ paths: [{ path: "body" }]
116
+ }
117
+ ])
118
+ };
119
+ return metadata;
120
+ }
121
+ return __token;
122
+ }
123
+ function tokenInfo(payload) {
124
+ function __tokenInfo({ host }) {
125
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
126
+ { transformFn: import_bytes.transformSDKBytesToRESTBytes, paths: [{ path: "body" }] }
127
+ ]);
128
+ const metadata = {
129
+ entityFqdn: "wix.identity.oauth.v1.refresh_token",
130
+ method: "POST",
131
+ methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.TokenInfo",
132
+ packageName: PACKAGE_NAME,
133
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
134
+ protoPath: "/v1/oauth/token-info",
135
+ data: serializedData,
136
+ host
137
+ }),
138
+ data: serializedData
139
+ };
140
+ return metadata;
141
+ }
142
+ return __tokenInfo;
143
+ }
144
+
145
+ // src/identity-oauth-v1-refresh-token-oauth.universal.ts
146
+ var SubjectType = /* @__PURE__ */ ((SubjectType2) => {
147
+ SubjectType2["UNKNOWN"] = "UNKNOWN";
148
+ SubjectType2["USER"] = "USER";
149
+ SubjectType2["VISITOR"] = "VISITOR";
150
+ SubjectType2["MEMBER"] = "MEMBER";
151
+ SubjectType2["APP"] = "APP";
152
+ return SubjectType2;
153
+ })(SubjectType || {});
154
+ async function token2(options) {
155
+ const { httpClient, sideEffects } = arguments[1];
156
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
157
+ body: options?.body,
158
+ pathParams: options?.pathParams,
159
+ queryParams: options?.queryParams,
160
+ headers: options?.headers,
161
+ method: options?.method,
162
+ rawPath: options?.rawPath,
163
+ rawQuery: options?.rawQuery
164
+ });
165
+ const reqOpts = token(payload);
166
+ sideEffects?.onSiteCall?.();
167
+ try {
168
+ const result = await httpClient.request(reqOpts);
169
+ sideEffects?.onSuccess?.(result);
170
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
171
+ } catch (err) {
172
+ const transformedError = (0, import_transform_error.transformError)(
173
+ err,
174
+ {
175
+ spreadPathsToArguments: {},
176
+ explicitPathsToArguments: {
177
+ body: "$[0].body",
178
+ pathParams: "$[0].pathParams",
179
+ queryParams: "$[0].queryParams",
180
+ headers: "$[0].headers",
181
+ method: "$[0].method",
182
+ rawPath: "$[0].rawPath",
183
+ rawQuery: "$[0].rawQuery"
184
+ },
185
+ singleArgumentUnchanged: false
186
+ },
187
+ ["options"]
188
+ );
189
+ sideEffects?.onError?.(err);
190
+ throw transformedError;
191
+ }
192
+ }
193
+ async function tokenInfo2(options) {
194
+ const { httpClient, sideEffects } = arguments[1];
195
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
196
+ body: options?.body,
197
+ pathParams: options?.pathParams,
198
+ queryParams: options?.queryParams,
199
+ headers: options?.headers,
200
+ method: options?.method,
201
+ rawPath: options?.rawPath,
202
+ rawQuery: options?.rawQuery
203
+ });
204
+ const reqOpts = tokenInfo(payload);
205
+ sideEffects?.onSiteCall?.();
206
+ try {
207
+ const result = await httpClient.request(reqOpts);
208
+ sideEffects?.onSuccess?.(result);
209
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
210
+ } catch (err) {
211
+ const transformedError = (0, import_transform_error.transformError)(
212
+ err,
213
+ {
214
+ spreadPathsToArguments: {},
215
+ explicitPathsToArguments: {
216
+ body: "$[0].body",
217
+ pathParams: "$[0].pathParams",
218
+ queryParams: "$[0].queryParams",
219
+ headers: "$[0].headers",
220
+ method: "$[0].method",
221
+ rawPath: "$[0].rawPath",
222
+ rawQuery: "$[0].rawQuery"
223
+ },
224
+ singleArgumentUnchanged: false
225
+ },
226
+ ["options"]
227
+ );
228
+ sideEffects?.onError?.(err);
229
+ throw transformedError;
230
+ }
231
+ }
232
+
233
+ // src/identity-oauth-v1-refresh-token-oauth.public.ts
234
+ function token3(httpClient) {
235
+ return (options) => token2(
236
+ options,
237
+ // @ts-ignore
238
+ { httpClient }
239
+ );
240
+ }
241
+ function tokenInfo3(httpClient) {
242
+ return (options) => tokenInfo2(
243
+ options,
244
+ // @ts-ignore
245
+ { httpClient }
246
+ );
247
+ }
248
+
249
+ // src/identity-oauth-v1-refresh-token-oauth.context.ts
250
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
251
+ var token4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(token3);
252
+ var tokenInfo4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(tokenInfo3);
253
+ // Annotate the CommonJS export names for ESM import in node:
254
+ 0 && (module.exports = {
255
+ SubjectType,
256
+ token,
257
+ tokenInfo
258
+ });
259
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts","../../src/identity-oauth-v1-refresh-token-oauth.universal.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.public.ts","../../src/identity-oauth-v1-refresh-token-oauth.context.ts"],"sourcesContent":["export * from './src/identity-oauth-v1-refresh-token-oauth.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 ambassadorWixIdentityOauthV1RefreshToken from './identity-oauth-v1-refresh-token-oauth.http.js';\n\nexport interface RefreshToken {\n token?: string;\n}\n\n/**\n * AuthorizeRequest is sent by the client to the authorization server to initiate\n * the authorization process.\n */\nexport interface AuthorizeRequest {\n /**\n * ID of the Wix OAuth app requesting authorization.\n * @format GUID\n */\n clientId?: string;\n /**\n * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).\n *\n * Supported values:\n * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.\n * @minLength 1\n */\n responseType?: string;\n /**\n * URI to redirect the browser to after authentication and authorization. The browser is redirected to this URI whether the authentication and authorization process is successful or not.\n * @minLength 1\n */\n redirectUri?: string | null;\n /**\n * Desired scope of access. If this field is left empty, only an access token is granted.\n * To received a refresh token, pass `offline_access` as the value of this field.\n */\n scope?: string | null;\n /**\n * A value used to confirm the state of an application before and after it makes an authorization\n * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser\n * is redirected there.\n * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).\n * @minLength 1\n */\n state?: string;\n /**\n * esired response format.\n *\n * Supported values:\n * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.\n * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.\n * + `web_message`: The response parameters are encoded as a JSON object and added to the body of a [web message response](https://datatracker.ietf.org/doc/html/draft-sakimura-oauth-wmrm-00).\n *\n * Default value: `query`\n */\n responseMode?: string | null;\n /**\n * Code challenge to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n */\n codeChallenge?: string | null;\n /**\n * Code challenge method to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n *\n * Supported values:\n * + `S256`: The code challenge is transformed using SHA-256 encyption.\n * + `S512`: The code challenge is transformed using SHA-512 encyption.\n */\n codeChallengeMethod?: string | null;\n /** Session token of the site visitor to authorize. */\n sessionToken?: string | null;\n /**\n * URL to redirect user to sign in\n * @format SECURE_WEB_URL\n */\n signInUrl?: string | null;\n}\n\nexport interface RawHttpResponse {\n body?: Uint8Array;\n statusCode?: number | null;\n headers?: HeadersEntry[];\n}\n\nexport interface HeadersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface RawHttpRequest {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n\nexport interface PathParametersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface QueryParametersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface DeviceCodeRequest {\n /** The ID of the application that asks for authorization. */\n clientId?: string;\n /**\n * scope is a space-delimited string that specifies the requested scope of the\n * access request.\n */\n scope?: string | null;\n}\n\nexport interface DeviceCodeResponse {\n /** is the unique code for the device. When the user goes to the verification_uri in their browser-based device, this code will be bound to their session. */\n deviceCode?: string;\n /** contains the code that should be input at the verification_uri to authorize the device. */\n userCode?: string;\n /** contains the URL the user should visit to authorize the device. */\n verificationUri?: string;\n /** indicates the lifetime (in seconds) of the device_code and user_code. */\n expiresIn?: number;\n /** indicates the interval (in seconds) at which the app should poll the token URL to request a token. clients MUST use 5 as the default */\n interval?: number | null;\n}\n\nexport interface DeviceVerifyRequest {\n /** User code representing a currently authorizing device. */\n userCode?: string;\n}\n\nexport interface DeviceVerifyResponse {}\n\nexport interface DeviceVerifyV2Request {\n /**\n * User code representing a currently authorizing device.\n * @minLength 8\n * @maxLength 8\n */\n userCode?: string;\n}\n\nexport interface DeviceVerifyV2Response {}\n\nexport interface InvalidateUserCodeRequest {\n /** user code to invalidate. Only the authorizing identity is able to invalidate it. */\n userCode?: string;\n}\n\nexport interface InvalidateUserCodeResponse {}\n\nexport interface RevokeRefreshTokenRequest {\n /** The refresh token itself. Anyone with the token itself is able to revoke it. */\n token?: string;\n}\n\nexport interface RevokeRefreshTokenResponse {}\n\nexport interface TokenInfoResponse {\n active?: boolean;\n /** subject type. */\n subjectType?: SubjectType;\n /** subject id */\n subjectId?: string;\n /** Expiration time of the token */\n exp?: string | null;\n /** Issued time of the token */\n iat?: string | null;\n /** Client id */\n clientId?: string;\n /** Account id */\n accountId?: string | null;\n /** Site id */\n siteId?: string | null;\n /** Instance Id */\n instanceId?: string | null;\n /**\n * Vendor Product Id\n * @maxLength 100\n */\n vendorProductId?: string | null;\n}\n\nexport enum SubjectType {\n /** unknown subject type */\n UNKNOWN = 'UNKNOWN',\n /** user subject type */\n USER = 'USER',\n /** visitor subject type */\n VISITOR = 'VISITOR',\n /** member subject type */\n MEMBER = 'MEMBER',\n /** app subject type */\n APP = 'APP',\n}\n\nexport interface Empty {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /**\n * Unique event ID.\n * Allows clients to ignore duplicate webhooks.\n */\n _id?: string;\n /**\n * Assumes actions are also always typed to an entity_type\n * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction\n */\n entityFqdn?: string;\n /**\n * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)\n * This is although the created/updated/deleted notion is duplication of the oneof types\n * Example: created/updated/deleted/started/completed/email_opened\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number defining the order of updates to the underlying entity.\n * For example, given that some entity was updated at 16:00 and than again at 16:01,\n * it is guaranteed that the sequence number of the second update is strictly higher than the first.\n * As the consumer, you can use this value to ensure that you handle messages in the correct order.\n * To do so, you will need to persist this number on your end, and compare the sequence number from the\n * message against the one you have stored. Given that the stored number is higher, you should ignore the message.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\n/**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n * @public\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.Token\n */\nexport async function token(\n options?: TokenOptions\n): Promise<\n NonNullablePaths<\n RawHttpResponse,\n `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n body: options?.body,\n pathParams: options?.pathParams,\n queryParams: options?.queryParams,\n headers: options?.headers,\n method: options?.method,\n rawPath: options?.rawPath,\n rawQuery: options?.rawQuery,\n });\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.token(payload);\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: {\n body: '$[0].body',\n pathParams: '$[0].pathParams',\n queryParams: '$[0].queryParams',\n headers: '$[0].headers',\n method: '$[0].method',\n rawPath: '$[0].rawPath',\n rawQuery: '$[0].rawQuery',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TokenOptions {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n\n/**\n * Token Introspection Endpoint.\n * @public\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.TokenInfo\n */\nexport async function tokenInfo(\n options?: TokenInfoOptions\n): Promise<\n NonNullablePaths<\n TokenInfoResponse,\n `active` | `subjectType` | `subjectId` | `clientId`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n body: options?.body,\n pathParams: options?.pathParams,\n queryParams: options?.queryParams,\n headers: options?.headers,\n method: options?.method,\n rawPath: options?.rawPath,\n rawQuery: options?.rawQuery,\n });\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.tokenInfo(payload);\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: {\n body: '$[0].body',\n pathParams: '$[0].pathParams',\n queryParams: '$[0].queryParams',\n headers: '$[0].headers',\n method: '$[0].method',\n rawPath: '$[0].rawPath',\n rawQuery: '$[0].rawQuery',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TokenInfoOptions {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n","import { transformSDKBytesToRESTBytes } from '@wix/sdk-runtime/transformations/bytes';\nimport { transformRESTBytesToSDKBytes } from '@wix/sdk-runtime/transformations/bytes';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIdentityOauth2V1Oauth2NgUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n {\n srcPath: '/oauth2/token_info',\n destPath: '/v1/token_info',\n },\n ],\n 'users._base_domain_': [\n {\n srcPath: '/v1/oauth/device/verify',\n destPath: '/v1/oauth/device/verify',\n },\n {\n srcPath: '/v1/oauth/manage/user-code',\n destPath: '/v1/oauth/manage/user-code',\n },\n {\n srcPath: '/v2/oauth/device/verify',\n destPath: '/v2/oauth/device/verify',\n },\n {\n srcPath: '/v1/oauth/authorize',\n destPath: '/v1/oauth/authorize',\n },\n ],\n _: [\n {\n srcPath: '/_api/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/oauth2-ng',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_identity_oauth';\n\n/**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n */\nexport function token(payload: object): RequestOptionsFactory<any> {\n function __token({ host }: any) {\n const serializedData = transformPaths(payload, [\n { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: 'body' }] },\n ]);\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'POST' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.Token',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/token',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTBytesToSDKBytes,\n paths: [{ path: 'body' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __token;\n}\n\n/** Token Introspection Endpoint. */\nexport function tokenInfo(payload: object): RequestOptionsFactory<any> {\n function __tokenInfo({ host }: any) {\n const serializedData = transformPaths(payload, [\n { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: 'body' }] },\n ]);\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'POST' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.TokenInfo',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/token-info',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __tokenInfo;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n RawHttpResponse,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n token as universalToken,\n tokenInfo as universalTokenInfo,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/identity' };\n\nexport function token(httpClient: HttpClient): TokenSignature {\n return (options?: TokenOptions) =>\n universalToken(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TokenSignature {\n /**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n */\n (options?: TokenOptions | undefined): Promise<RawHttpResponse>;\n}\n\nexport function tokenInfo(httpClient: HttpClient): TokenInfoSignature {\n return (options?: TokenInfoOptions) =>\n universalTokenInfo(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TokenInfoSignature {\n /**\n * Token Introspection Endpoint.\n */\n (options?: TokenInfoOptions | undefined): Promise<TokenInfoResponse>;\n}\n\nexport {\n ActionEvent,\n AuthorizeRequest,\n DeviceCodeRequest,\n DeviceCodeResponse,\n DeviceVerifyRequest,\n DeviceVerifyResponse,\n DeviceVerifyV2Request,\n DeviceVerifyV2Response,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n HeadersEntry,\n InvalidateUserCodeRequest,\n InvalidateUserCodeResponse,\n PathParametersEntry,\n QueryParametersEntry,\n RawHttpRequest,\n RawHttpResponse,\n RefreshToken,\n RestoreInfo,\n RevokeRefreshTokenRequest,\n RevokeRefreshTokenResponse,\n SubjectType,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n","import {\n token as publicToken,\n tokenInfo as publicTokenInfo,\n} from './identity-oauth-v1-refresh-token-oauth.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const token: MaybeContext<\n BuildRESTFunction<typeof publicToken> & typeof publicToken\n> = /*#__PURE__*/ createRESTModule(publicToken);\nexport const tokenInfo: MaybeContext<\n BuildRESTFunction<typeof publicTokenInfo> & typeof publicTokenInfo\n> = /*#__PURE__*/ createRESTModule(publicTokenInfo);\n\nexport { SubjectType } from './identity-oauth-v1-refresh-token-oauth.universal.js';\nexport {\n RefreshToken,\n AuthorizeRequest,\n RawHttpResponse,\n HeadersEntry,\n RawHttpRequest,\n PathParametersEntry,\n QueryParametersEntry,\n DeviceCodeRequest,\n DeviceCodeResponse,\n DeviceVerifyRequest,\n DeviceVerifyResponse,\n DeviceVerifyV2Request,\n DeviceVerifyV2Response,\n InvalidateUserCodeRequest,\n InvalidateUserCodeResponse,\n RevokeRefreshTokenRequest,\n RevokeRefreshTokenResponse,\n TokenInfoResponse,\n Empty,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n TokenOptions,\n TokenInfoOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA,iBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,sCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,uBAAuB;AAAA,MACrB;AAAA,QACE,SAAS;AAAA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SAEK,2DAAiBA,MAAW;AACvC,IAAMC,aAEK,2DAAiBA,UAAe;","names":["token","tokenInfo","import_bytes","payload","SubjectType","token","sdkTransformError","tokenInfo","token","tokenInfo","import_rest_modules","token","tokenInfo"]}
@@ -0,0 +1,233 @@
1
+ // src/identity-oauth-v1-refresh-token-oauth.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/identity-oauth-v1-refresh-token-oauth.http.ts
9
+ import { transformSDKBytesToRESTBytes } from "@wix/sdk-runtime/transformations/bytes";
10
+ import { transformRESTBytesToSDKBytes } from "@wix/sdk-runtime/transformations/bytes";
11
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
12
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
13
+ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
14
+ const domainToMappings = {
15
+ "manage._base_domain_": [
16
+ {
17
+ srcPath: "/oauth2",
18
+ destPath: "/v1/oauth"
19
+ }
20
+ ],
21
+ "www.wixapis.com": [
22
+ {
23
+ srcPath: "/oauth2",
24
+ destPath: "/v1/oauth"
25
+ },
26
+ {
27
+ srcPath: "/oauth2/token_info",
28
+ destPath: "/v1/token_info"
29
+ }
30
+ ],
31
+ "users._base_domain_": [
32
+ {
33
+ srcPath: "/v1/oauth/device/verify",
34
+ destPath: "/v1/oauth/device/verify"
35
+ },
36
+ {
37
+ srcPath: "/v1/oauth/manage/user-code",
38
+ destPath: "/v1/oauth/manage/user-code"
39
+ },
40
+ {
41
+ srcPath: "/v2/oauth/device/verify",
42
+ destPath: "/v2/oauth/device/verify"
43
+ },
44
+ {
45
+ srcPath: "/v1/oauth/authorize",
46
+ destPath: "/v1/oauth/authorize"
47
+ }
48
+ ],
49
+ _: [
50
+ {
51
+ srcPath: "/_api/oauth2",
52
+ destPath: "/v1/oauth"
53
+ }
54
+ ],
55
+ "platform.rise.ai": [
56
+ {
57
+ srcPath: "/oauth2",
58
+ destPath: "/v1/oauth"
59
+ }
60
+ ],
61
+ "api._api_base_domain_": [
62
+ {
63
+ srcPath: "/oauth2-ng",
64
+ destPath: ""
65
+ }
66
+ ]
67
+ };
68
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
69
+ }
70
+ var PACKAGE_NAME = "@wix/auto_sdk_identity_oauth";
71
+ function token(payload) {
72
+ function __token({ host }) {
73
+ const serializedData = transformPaths(payload, [
74
+ { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: "body" }] }
75
+ ]);
76
+ const metadata = {
77
+ entityFqdn: "wix.identity.oauth.v1.refresh_token",
78
+ method: "POST",
79
+ methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.Token",
80
+ packageName: PACKAGE_NAME,
81
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
82
+ protoPath: "/v1/oauth/token",
83
+ data: serializedData,
84
+ host
85
+ }),
86
+ data: serializedData,
87
+ transformResponse: (payload2) => transformPaths(payload2, [
88
+ {
89
+ transformFn: transformRESTBytesToSDKBytes,
90
+ paths: [{ path: "body" }]
91
+ }
92
+ ])
93
+ };
94
+ return metadata;
95
+ }
96
+ return __token;
97
+ }
98
+ function tokenInfo(payload) {
99
+ function __tokenInfo({ host }) {
100
+ const serializedData = transformPaths(payload, [
101
+ { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: "body" }] }
102
+ ]);
103
+ const metadata = {
104
+ entityFqdn: "wix.identity.oauth.v1.refresh_token",
105
+ method: "POST",
106
+ methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.TokenInfo",
107
+ packageName: PACKAGE_NAME,
108
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
109
+ protoPath: "/v1/oauth/token-info",
110
+ data: serializedData,
111
+ host
112
+ }),
113
+ data: serializedData
114
+ };
115
+ return metadata;
116
+ }
117
+ return __tokenInfo;
118
+ }
119
+
120
+ // src/identity-oauth-v1-refresh-token-oauth.universal.ts
121
+ var SubjectType = /* @__PURE__ */ ((SubjectType2) => {
122
+ SubjectType2["UNKNOWN"] = "UNKNOWN";
123
+ SubjectType2["USER"] = "USER";
124
+ SubjectType2["VISITOR"] = "VISITOR";
125
+ SubjectType2["MEMBER"] = "MEMBER";
126
+ SubjectType2["APP"] = "APP";
127
+ return SubjectType2;
128
+ })(SubjectType || {});
129
+ async function token2(options) {
130
+ const { httpClient, sideEffects } = arguments[1];
131
+ const payload = renameKeysFromSDKRequestToRESTRequest({
132
+ body: options?.body,
133
+ pathParams: options?.pathParams,
134
+ queryParams: options?.queryParams,
135
+ headers: options?.headers,
136
+ method: options?.method,
137
+ rawPath: options?.rawPath,
138
+ rawQuery: options?.rawQuery
139
+ });
140
+ const reqOpts = token(payload);
141
+ sideEffects?.onSiteCall?.();
142
+ try {
143
+ const result = await httpClient.request(reqOpts);
144
+ sideEffects?.onSuccess?.(result);
145
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
146
+ } catch (err) {
147
+ const transformedError = sdkTransformError(
148
+ err,
149
+ {
150
+ spreadPathsToArguments: {},
151
+ explicitPathsToArguments: {
152
+ body: "$[0].body",
153
+ pathParams: "$[0].pathParams",
154
+ queryParams: "$[0].queryParams",
155
+ headers: "$[0].headers",
156
+ method: "$[0].method",
157
+ rawPath: "$[0].rawPath",
158
+ rawQuery: "$[0].rawQuery"
159
+ },
160
+ singleArgumentUnchanged: false
161
+ },
162
+ ["options"]
163
+ );
164
+ sideEffects?.onError?.(err);
165
+ throw transformedError;
166
+ }
167
+ }
168
+ async function tokenInfo2(options) {
169
+ const { httpClient, sideEffects } = arguments[1];
170
+ const payload = renameKeysFromSDKRequestToRESTRequest({
171
+ body: options?.body,
172
+ pathParams: options?.pathParams,
173
+ queryParams: options?.queryParams,
174
+ headers: options?.headers,
175
+ method: options?.method,
176
+ rawPath: options?.rawPath,
177
+ rawQuery: options?.rawQuery
178
+ });
179
+ const reqOpts = tokenInfo(payload);
180
+ sideEffects?.onSiteCall?.();
181
+ try {
182
+ const result = await httpClient.request(reqOpts);
183
+ sideEffects?.onSuccess?.(result);
184
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
185
+ } catch (err) {
186
+ const transformedError = sdkTransformError(
187
+ err,
188
+ {
189
+ spreadPathsToArguments: {},
190
+ explicitPathsToArguments: {
191
+ body: "$[0].body",
192
+ pathParams: "$[0].pathParams",
193
+ queryParams: "$[0].queryParams",
194
+ headers: "$[0].headers",
195
+ method: "$[0].method",
196
+ rawPath: "$[0].rawPath",
197
+ rawQuery: "$[0].rawQuery"
198
+ },
199
+ singleArgumentUnchanged: false
200
+ },
201
+ ["options"]
202
+ );
203
+ sideEffects?.onError?.(err);
204
+ throw transformedError;
205
+ }
206
+ }
207
+
208
+ // src/identity-oauth-v1-refresh-token-oauth.public.ts
209
+ function token3(httpClient) {
210
+ return (options) => token2(
211
+ options,
212
+ // @ts-ignore
213
+ { httpClient }
214
+ );
215
+ }
216
+ function tokenInfo3(httpClient) {
217
+ return (options) => tokenInfo2(
218
+ options,
219
+ // @ts-ignore
220
+ { httpClient }
221
+ );
222
+ }
223
+
224
+ // src/identity-oauth-v1-refresh-token-oauth.context.ts
225
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
226
+ var token4 = /* @__PURE__ */ createRESTModule(token3);
227
+ var tokenInfo4 = /* @__PURE__ */ createRESTModule(tokenInfo3);
228
+ export {
229
+ SubjectType,
230
+ token4 as token,
231
+ tokenInfo4 as tokenInfo
232
+ };
233
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/identity-oauth-v1-refresh-token-oauth.universal.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.public.ts","../../src/identity-oauth-v1-refresh-token-oauth.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 ambassadorWixIdentityOauthV1RefreshToken from './identity-oauth-v1-refresh-token-oauth.http.js';\n\nexport interface RefreshToken {\n token?: string;\n}\n\n/**\n * AuthorizeRequest is sent by the client to the authorization server to initiate\n * the authorization process.\n */\nexport interface AuthorizeRequest {\n /**\n * ID of the Wix OAuth app requesting authorization.\n * @format GUID\n */\n clientId?: string;\n /**\n * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).\n *\n * Supported values:\n * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.\n * @minLength 1\n */\n responseType?: string;\n /**\n * URI to redirect the browser to after authentication and authorization. The browser is redirected to this URI whether the authentication and authorization process is successful or not.\n * @minLength 1\n */\n redirectUri?: string | null;\n /**\n * Desired scope of access. If this field is left empty, only an access token is granted.\n * To received a refresh token, pass `offline_access` as the value of this field.\n */\n scope?: string | null;\n /**\n * A value used to confirm the state of an application before and after it makes an authorization\n * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser\n * is redirected there.\n * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).\n * @minLength 1\n */\n state?: string;\n /**\n * esired response format.\n *\n * Supported values:\n * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.\n * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.\n * + `web_message`: The response parameters are encoded as a JSON object and added to the body of a [web message response](https://datatracker.ietf.org/doc/html/draft-sakimura-oauth-wmrm-00).\n *\n * Default value: `query`\n */\n responseMode?: string | null;\n /**\n * Code challenge to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n */\n codeChallenge?: string | null;\n /**\n * Code challenge method to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n *\n * Supported values:\n * + `S256`: The code challenge is transformed using SHA-256 encyption.\n * + `S512`: The code challenge is transformed using SHA-512 encyption.\n */\n codeChallengeMethod?: string | null;\n /** Session token of the site visitor to authorize. */\n sessionToken?: string | null;\n /**\n * URL to redirect user to sign in\n * @format SECURE_WEB_URL\n */\n signInUrl?: string | null;\n}\n\nexport interface RawHttpResponse {\n body?: Uint8Array;\n statusCode?: number | null;\n headers?: HeadersEntry[];\n}\n\nexport interface HeadersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface RawHttpRequest {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n\nexport interface PathParametersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface QueryParametersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface DeviceCodeRequest {\n /** The ID of the application that asks for authorization. */\n clientId?: string;\n /**\n * scope is a space-delimited string that specifies the requested scope of the\n * access request.\n */\n scope?: string | null;\n}\n\nexport interface DeviceCodeResponse {\n /** is the unique code for the device. When the user goes to the verification_uri in their browser-based device, this code will be bound to their session. */\n deviceCode?: string;\n /** contains the code that should be input at the verification_uri to authorize the device. */\n userCode?: string;\n /** contains the URL the user should visit to authorize the device. */\n verificationUri?: string;\n /** indicates the lifetime (in seconds) of the device_code and user_code. */\n expiresIn?: number;\n /** indicates the interval (in seconds) at which the app should poll the token URL to request a token. clients MUST use 5 as the default */\n interval?: number | null;\n}\n\nexport interface DeviceVerifyRequest {\n /** User code representing a currently authorizing device. */\n userCode?: string;\n}\n\nexport interface DeviceVerifyResponse {}\n\nexport interface DeviceVerifyV2Request {\n /**\n * User code representing a currently authorizing device.\n * @minLength 8\n * @maxLength 8\n */\n userCode?: string;\n}\n\nexport interface DeviceVerifyV2Response {}\n\nexport interface InvalidateUserCodeRequest {\n /** user code to invalidate. Only the authorizing identity is able to invalidate it. */\n userCode?: string;\n}\n\nexport interface InvalidateUserCodeResponse {}\n\nexport interface RevokeRefreshTokenRequest {\n /** The refresh token itself. Anyone with the token itself is able to revoke it. */\n token?: string;\n}\n\nexport interface RevokeRefreshTokenResponse {}\n\nexport interface TokenInfoResponse {\n active?: boolean;\n /** subject type. */\n subjectType?: SubjectType;\n /** subject id */\n subjectId?: string;\n /** Expiration time of the token */\n exp?: string | null;\n /** Issued time of the token */\n iat?: string | null;\n /** Client id */\n clientId?: string;\n /** Account id */\n accountId?: string | null;\n /** Site id */\n siteId?: string | null;\n /** Instance Id */\n instanceId?: string | null;\n /**\n * Vendor Product Id\n * @maxLength 100\n */\n vendorProductId?: string | null;\n}\n\nexport enum SubjectType {\n /** unknown subject type */\n UNKNOWN = 'UNKNOWN',\n /** user subject type */\n USER = 'USER',\n /** visitor subject type */\n VISITOR = 'VISITOR',\n /** member subject type */\n MEMBER = 'MEMBER',\n /** app subject type */\n APP = 'APP',\n}\n\nexport interface Empty {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /**\n * Unique event ID.\n * Allows clients to ignore duplicate webhooks.\n */\n _id?: string;\n /**\n * Assumes actions are also always typed to an entity_type\n * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction\n */\n entityFqdn?: string;\n /**\n * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)\n * This is although the created/updated/deleted notion is duplication of the oneof types\n * Example: created/updated/deleted/started/completed/email_opened\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number defining the order of updates to the underlying entity.\n * For example, given that some entity was updated at 16:00 and than again at 16:01,\n * it is guaranteed that the sequence number of the second update is strictly higher than the first.\n * As the consumer, you can use this value to ensure that you handle messages in the correct order.\n * To do so, you will need to persist this number on your end, and compare the sequence number from the\n * message against the one you have stored. Given that the stored number is higher, you should ignore the message.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\n/**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n * @public\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.Token\n */\nexport async function token(\n options?: TokenOptions\n): Promise<\n NonNullablePaths<\n RawHttpResponse,\n `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n body: options?.body,\n pathParams: options?.pathParams,\n queryParams: options?.queryParams,\n headers: options?.headers,\n method: options?.method,\n rawPath: options?.rawPath,\n rawQuery: options?.rawQuery,\n });\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.token(payload);\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: {\n body: '$[0].body',\n pathParams: '$[0].pathParams',\n queryParams: '$[0].queryParams',\n headers: '$[0].headers',\n method: '$[0].method',\n rawPath: '$[0].rawPath',\n rawQuery: '$[0].rawQuery',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TokenOptions {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n\n/**\n * Token Introspection Endpoint.\n * @public\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.TokenInfo\n */\nexport async function tokenInfo(\n options?: TokenInfoOptions\n): Promise<\n NonNullablePaths<\n TokenInfoResponse,\n `active` | `subjectType` | `subjectId` | `clientId`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n body: options?.body,\n pathParams: options?.pathParams,\n queryParams: options?.queryParams,\n headers: options?.headers,\n method: options?.method,\n rawPath: options?.rawPath,\n rawQuery: options?.rawQuery,\n });\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.tokenInfo(payload);\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: {\n body: '$[0].body',\n pathParams: '$[0].pathParams',\n queryParams: '$[0].queryParams',\n headers: '$[0].headers',\n method: '$[0].method',\n rawPath: '$[0].rawPath',\n rawQuery: '$[0].rawQuery',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TokenInfoOptions {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n","import { transformSDKBytesToRESTBytes } from '@wix/sdk-runtime/transformations/bytes';\nimport { transformRESTBytesToSDKBytes } from '@wix/sdk-runtime/transformations/bytes';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIdentityOauth2V1Oauth2NgUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n {\n srcPath: '/oauth2/token_info',\n destPath: '/v1/token_info',\n },\n ],\n 'users._base_domain_': [\n {\n srcPath: '/v1/oauth/device/verify',\n destPath: '/v1/oauth/device/verify',\n },\n {\n srcPath: '/v1/oauth/manage/user-code',\n destPath: '/v1/oauth/manage/user-code',\n },\n {\n srcPath: '/v2/oauth/device/verify',\n destPath: '/v2/oauth/device/verify',\n },\n {\n srcPath: '/v1/oauth/authorize',\n destPath: '/v1/oauth/authorize',\n },\n ],\n _: [\n {\n srcPath: '/_api/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/oauth2-ng',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_identity_oauth';\n\n/**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n */\nexport function token(payload: object): RequestOptionsFactory<any> {\n function __token({ host }: any) {\n const serializedData = transformPaths(payload, [\n { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: 'body' }] },\n ]);\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'POST' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.Token',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/token',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTBytesToSDKBytes,\n paths: [{ path: 'body' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __token;\n}\n\n/** Token Introspection Endpoint. */\nexport function tokenInfo(payload: object): RequestOptionsFactory<any> {\n function __tokenInfo({ host }: any) {\n const serializedData = transformPaths(payload, [\n { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: 'body' }] },\n ]);\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'POST' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.TokenInfo',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/token-info',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __tokenInfo;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n RawHttpResponse,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n token as universalToken,\n tokenInfo as universalTokenInfo,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/identity' };\n\nexport function token(httpClient: HttpClient): TokenSignature {\n return (options?: TokenOptions) =>\n universalToken(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TokenSignature {\n /**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n */\n (options?: TokenOptions | undefined): Promise<RawHttpResponse>;\n}\n\nexport function tokenInfo(httpClient: HttpClient): TokenInfoSignature {\n return (options?: TokenInfoOptions) =>\n universalTokenInfo(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TokenInfoSignature {\n /**\n * Token Introspection Endpoint.\n */\n (options?: TokenInfoOptions | undefined): Promise<TokenInfoResponse>;\n}\n\nexport {\n ActionEvent,\n AuthorizeRequest,\n DeviceCodeRequest,\n DeviceCodeResponse,\n DeviceVerifyRequest,\n DeviceVerifyResponse,\n DeviceVerifyV2Request,\n DeviceVerifyV2Response,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n HeadersEntry,\n InvalidateUserCodeRequest,\n InvalidateUserCodeResponse,\n PathParametersEntry,\n QueryParametersEntry,\n RawHttpRequest,\n RawHttpResponse,\n RefreshToken,\n RestoreInfo,\n RevokeRefreshTokenRequest,\n RevokeRefreshTokenResponse,\n SubjectType,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n","import {\n token as publicToken,\n tokenInfo as publicTokenInfo,\n} from './identity-oauth-v1-refresh-token-oauth.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const token: MaybeContext<\n BuildRESTFunction<typeof publicToken> & typeof publicToken\n> = /*#__PURE__*/ createRESTModule(publicToken);\nexport const tokenInfo: MaybeContext<\n BuildRESTFunction<typeof publicTokenInfo> & typeof publicTokenInfo\n> = /*#__PURE__*/ createRESTModule(publicTokenInfo);\n\nexport { SubjectType } from './identity-oauth-v1-refresh-token-oauth.universal.js';\nexport {\n RefreshToken,\n AuthorizeRequest,\n RawHttpResponse,\n HeadersEntry,\n RawHttpRequest,\n PathParametersEntry,\n QueryParametersEntry,\n DeviceCodeRequest,\n DeviceCodeResponse,\n DeviceVerifyRequest,\n DeviceVerifyResponse,\n DeviceVerifyV2Request,\n DeviceVerifyV2Response,\n InvalidateUserCodeRequest,\n InvalidateUserCodeResponse,\n RevokeRefreshTokenRequest,\n RevokeRefreshTokenResponse,\n TokenInfoResponse,\n Empty,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n TokenOptions,\n TokenInfoOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,sCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,uBAAuB;AAAA,MACrB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,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