@wix/auto_sdk_identity_oauth 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +3 -13
- package/build/cjs/index.js +7 -58
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -11
- package/build/cjs/index.typings.js +4 -48
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +2 -40
- package/build/cjs/meta.js +4 -43
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +3 -13
- package/build/es/index.mjs +1 -51
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -11
- package/build/es/index.typings.mjs +1 -44
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +2 -40
- package/build/es/meta.mjs +1 -39
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +3 -13
- package/build/internal/cjs/index.js +7 -58
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +1 -11
- package/build/internal/cjs/index.typings.js +4 -48
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +2 -40
- package/build/internal/cjs/meta.js +4 -43
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +3 -13
- package/build/internal/es/index.mjs +1 -51
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +1 -11
- package/build/internal/es/index.typings.mjs +1 -44
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +2 -40
- package/build/internal/es/meta.mjs +1 -39
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/meta.js
CHANGED
|
@@ -21,17 +21,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var meta_exports = {};
|
|
22
22
|
__export(meta_exports, {
|
|
23
23
|
token: () => token2,
|
|
24
|
-
tokenInfo: () => tokenInfo2
|
|
25
|
-
userInfo: () => userInfo2
|
|
24
|
+
tokenInfo: () => tokenInfo2
|
|
26
25
|
});
|
|
27
26
|
module.exports = __toCommonJS(meta_exports);
|
|
28
27
|
|
|
29
28
|
// src/identity-oauth-v1-refresh-token-oauth.http.ts
|
|
30
|
-
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
31
29
|
var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
|
|
32
30
|
var import_bytes2 = require("@wix/sdk-runtime/transformations/bytes");
|
|
33
31
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
34
|
-
var
|
|
32
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
35
33
|
function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
|
|
36
34
|
const domainToMappings = {
|
|
37
35
|
"manage._base_domain_": [
|
|
@@ -123,7 +121,7 @@ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
|
|
|
123
121
|
}
|
|
124
122
|
]
|
|
125
123
|
};
|
|
126
|
-
return (0,
|
|
124
|
+
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
127
125
|
}
|
|
128
126
|
var PACKAGE_NAME = "@wix/auto_sdk_identity_oauth";
|
|
129
127
|
function token(payload) {
|
|
@@ -174,24 +172,6 @@ function tokenInfo(payload) {
|
|
|
174
172
|
}
|
|
175
173
|
return __tokenInfo;
|
|
176
174
|
}
|
|
177
|
-
function userInfo(payload) {
|
|
178
|
-
function __userInfo({ host }) {
|
|
179
|
-
const metadata = {
|
|
180
|
-
entityFqdn: "wix.identity.oauth.v1.refresh_token",
|
|
181
|
-
method: "GET",
|
|
182
|
-
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.UserInfo",
|
|
183
|
-
packageName: PACKAGE_NAME,
|
|
184
|
-
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
185
|
-
protoPath: "/v1/oauth/user-info",
|
|
186
|
-
data: payload,
|
|
187
|
-
host
|
|
188
|
-
}),
|
|
189
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
190
|
-
};
|
|
191
|
-
return metadata;
|
|
192
|
-
}
|
|
193
|
-
return __userInfo;
|
|
194
|
-
}
|
|
195
175
|
|
|
196
176
|
// src/identity-oauth-v1-refresh-token-oauth.meta.ts
|
|
197
177
|
function token2() {
|
|
@@ -230,28 +210,9 @@ function tokenInfo2() {
|
|
|
230
210
|
__originalResponseType: null
|
|
231
211
|
};
|
|
232
212
|
}
|
|
233
|
-
function userInfo2() {
|
|
234
|
-
const payload = {};
|
|
235
|
-
const getRequestOptions = userInfo(payload);
|
|
236
|
-
const getUrl = (context) => {
|
|
237
|
-
const { url } = getRequestOptions(context);
|
|
238
|
-
return url;
|
|
239
|
-
};
|
|
240
|
-
return {
|
|
241
|
-
getUrl,
|
|
242
|
-
httpMethod: "GET",
|
|
243
|
-
path: "/v1/oauth/user-info",
|
|
244
|
-
pathParams: {},
|
|
245
|
-
__requestType: null,
|
|
246
|
-
__originalRequestType: null,
|
|
247
|
-
__responseType: null,
|
|
248
|
-
__originalResponseType: null
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
213
|
// Annotate the CommonJS export names for ESM import in node:
|
|
252
214
|
0 && (module.exports = {
|
|
253
215
|
token,
|
|
254
|
-
tokenInfo
|
|
255
|
-
userInfo
|
|
216
|
+
tokenInfo
|
|
256
217
|
});
|
|
257
218
|
//# sourceMappingURL=meta.js.map
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.meta.ts"],"sourcesContent":["export * from './src/identity-oauth-v1-refresh-token-oauth.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { 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 srcPath: '/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/token',\n destPath: '/v1/oauth/token',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\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 'apps._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\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\n/**\n * OpenID Connect UserInfo endpoint\n * Should be called with user access token obtained in OIDC flow as Authorization header\n */\nexport function userInfo(payload: object): RequestOptionsFactory<any> {\n function __userInfo({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'GET' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.UserInfo',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/user-info',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __userInfo;\n}\n","import * as ambassadorWixIdentityOauthV1RefreshToken from './identity-oauth-v1-refresh-token-oauth.http.js';\nimport * as ambassadorWixIdentityOauthV1RefreshTokenTypes from './identity-oauth-v1-refresh-token-oauth.types.js';\nimport * as ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes from './identity-oauth-v1-refresh-token-oauth.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function token(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.RawHttpResponse,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.RawHttpResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIdentityOauthV1RefreshToken.token(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/oauth/token',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function tokenInfo(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.TokenInfoResponse,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.TokenInfoResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIdentityOauthV1RefreshToken.tokenInfo(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/oauth/token-info',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function userInfo(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.UserInfoRequest,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.UserInfoRequest,\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.UserInfoResponse,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.UserInfoResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIdentityOauthV1RefreshToken.userInfo(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/oauth/user-info',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA,iBAAAC;AAAA,EAAA,gBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,6BAA+B;AAC/B,IAAAC,uBAA2B;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,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,MACvB;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b,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,YAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACqC,SAAS,OAAO;AAE3D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["token","tokenInfo","userInfo","import_bytes","import_rest_modules","payload","token","tokenInfo","userInfo"]}
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.meta.ts"],"sourcesContent":["export * from './src/identity-oauth-v1-refresh-token-oauth.meta.js';\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 srcPath: '/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/token',\n destPath: '/v1/oauth/token',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\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 'apps._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\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 * as ambassadorWixIdentityOauthV1RefreshToken from './identity-oauth-v1-refresh-token-oauth.http.js';\nimport * as ambassadorWixIdentityOauthV1RefreshTokenTypes from './identity-oauth-v1-refresh-token-oauth.types.js';\nimport * as ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes from './identity-oauth-v1-refresh-token-oauth.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function token(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.RawHttpResponse,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.RawHttpResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIdentityOauthV1RefreshToken.token(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/oauth/token',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function tokenInfo(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.RawHttpRequest,\n ambassadorWixIdentityOauthV1RefreshTokenUniversalTypes.TokenInfoResponse,\n ambassadorWixIdentityOauthV1RefreshTokenTypes.TokenInfoResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIdentityOauthV1RefreshToken.tokenInfo(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/oauth/token-info',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA,iBAAAC;AAAA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AAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC3JO,SAASC,SAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACqC,MAAM,OAAO;AAExD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,aAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACqC,UAAU,OAAO;AAE5D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["token","tokenInfo","import_bytes","payload","token","tokenInfo"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { TokenOptions, RawHttpResponse, TokenInfoOptions, TokenInfoResponse
|
|
3
|
-
export { ActionEvent, AuthorizeRequest, DeviceCodeRequest, DeviceCodeResponse, DeviceVerifyRequest, DeviceVerifyResponse, DeviceVerifyV2Request, DeviceVerifyV2Response, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, HeadersEntry, InvalidateUserCodeRequest, InvalidateUserCodeResponse, PathParametersEntry, QueryParametersEntry, RawHttpRequest, RefreshToken, RestoreInfo, RevokeRefreshTokenRequest, RevokeRefreshTokenResponse, SubjectType, SubjectTypeWithLiterals, UserInfoRequest } from './index.typings.mjs';
|
|
2
|
+
import { TokenOptions, RawHttpResponse, TokenInfoOptions, TokenInfoResponse } from './index.typings.mjs';
|
|
3
|
+
export { ActionEvent, AuthorizeRequest, DeviceCodeRequest, DeviceCodeResponse, DeviceVerifyRequest, DeviceVerifyResponse, DeviceVerifyV2Request, DeviceVerifyV2Response, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, HeadersEntry, InvalidateUserCodeRequest, InvalidateUserCodeResponse, PathParametersEntry, QueryParametersEntry, RawHttpRequest, RefreshToken, RestoreInfo, RevokeRefreshTokenRequest, RevokeRefreshTokenResponse, SubjectType, SubjectTypeWithLiterals, UserInfoRequest, UserInfoResponse } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function token$1(httpClient: HttpClient): TokenSignature;
|
|
6
6
|
interface TokenSignature {
|
|
@@ -30,18 +30,8 @@ interface TokenInfoSignature {
|
|
|
30
30
|
*/
|
|
31
31
|
(options?: TokenInfoOptions): Promise<NonNullablePaths<TokenInfoResponse, `active` | `subjectType` | `subjectId` | `clientId`, 2>>;
|
|
32
32
|
}
|
|
33
|
-
declare function userInfo$1(httpClient: HttpClient): UserInfoSignature;
|
|
34
|
-
interface UserInfoSignature {
|
|
35
|
-
/**
|
|
36
|
-
* OpenID Connect UserInfo endpoint
|
|
37
|
-
* Should be called with user access token obtained in OIDC flow as Authorization header
|
|
38
|
-
* @returns UserInfo endpoint response for OpenID Connect
|
|
39
|
-
*/
|
|
40
|
-
(): Promise<NonNullablePaths<UserInfoResponse, `_id`, 2>>;
|
|
41
|
-
}
|
|
42
33
|
|
|
43
34
|
declare const token: MaybeContext<BuildRESTFunction<typeof token$1> & typeof token$1>;
|
|
44
35
|
declare const tokenInfo: MaybeContext<BuildRESTFunction<typeof tokenInfo$1> & typeof tokenInfo$1>;
|
|
45
|
-
declare const userInfo: MaybeContext<BuildRESTFunction<typeof userInfo$1> & typeof userInfo$1>;
|
|
46
36
|
|
|
47
|
-
export { RawHttpResponse, TokenInfoOptions, TokenInfoResponse, TokenOptions,
|
|
37
|
+
export { RawHttpResponse, TokenInfoOptions, TokenInfoResponse, TokenOptions, token, tokenInfo };
|
package/build/es/index.mjs
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
7
|
|
|
8
8
|
// src/identity-oauth-v1-refresh-token-oauth.http.ts
|
|
9
|
-
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
9
|
import { transformSDKBytesToRESTBytes } from "@wix/sdk-runtime/transformations/bytes";
|
|
11
10
|
import { transformRESTBytesToSDKBytes } from "@wix/sdk-runtime/transformations/bytes";
|
|
12
11
|
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
@@ -153,24 +152,6 @@ function tokenInfo(payload) {
|
|
|
153
152
|
}
|
|
154
153
|
return __tokenInfo;
|
|
155
154
|
}
|
|
156
|
-
function userInfo(payload) {
|
|
157
|
-
function __userInfo({ host }) {
|
|
158
|
-
const metadata = {
|
|
159
|
-
entityFqdn: "wix.identity.oauth.v1.refresh_token",
|
|
160
|
-
method: "GET",
|
|
161
|
-
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.UserInfo",
|
|
162
|
-
packageName: PACKAGE_NAME,
|
|
163
|
-
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
164
|
-
protoPath: "/v1/oauth/user-info",
|
|
165
|
-
data: payload,
|
|
166
|
-
host
|
|
167
|
-
}),
|
|
168
|
-
params: toURLSearchParams(payload)
|
|
169
|
-
};
|
|
170
|
-
return metadata;
|
|
171
|
-
}
|
|
172
|
-
return __userInfo;
|
|
173
|
-
}
|
|
174
155
|
|
|
175
156
|
// src/identity-oauth-v1-refresh-token-oauth.universal.ts
|
|
176
157
|
var SubjectType = /* @__PURE__ */ ((SubjectType2) => {
|
|
@@ -259,29 +240,6 @@ async function tokenInfo2(options) {
|
|
|
259
240
|
throw transformedError;
|
|
260
241
|
}
|
|
261
242
|
}
|
|
262
|
-
async function userInfo2() {
|
|
263
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
264
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({});
|
|
265
|
-
const reqOpts = userInfo(payload);
|
|
266
|
-
sideEffects?.onSiteCall?.();
|
|
267
|
-
try {
|
|
268
|
-
const result = await httpClient.request(reqOpts);
|
|
269
|
-
sideEffects?.onSuccess?.(result);
|
|
270
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
271
|
-
} catch (err) {
|
|
272
|
-
const transformedError = sdkTransformError(
|
|
273
|
-
err,
|
|
274
|
-
{
|
|
275
|
-
spreadPathsToArguments: {},
|
|
276
|
-
explicitPathsToArguments: {},
|
|
277
|
-
singleArgumentUnchanged: false
|
|
278
|
-
},
|
|
279
|
-
[]
|
|
280
|
-
);
|
|
281
|
-
sideEffects?.onError?.(err);
|
|
282
|
-
throw transformedError;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
243
|
|
|
286
244
|
// src/identity-oauth-v1-refresh-token-oauth.public.ts
|
|
287
245
|
function token3(httpClient) {
|
|
@@ -298,22 +256,14 @@ function tokenInfo3(httpClient) {
|
|
|
298
256
|
{ httpClient }
|
|
299
257
|
);
|
|
300
258
|
}
|
|
301
|
-
function userInfo3(httpClient) {
|
|
302
|
-
return () => userInfo2(
|
|
303
|
-
// @ts-ignore
|
|
304
|
-
{ httpClient }
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
259
|
|
|
308
260
|
// src/identity-oauth-v1-refresh-token-oauth.context.ts
|
|
309
261
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
310
262
|
var token4 = /* @__PURE__ */ createRESTModule(token3);
|
|
311
263
|
var tokenInfo4 = /* @__PURE__ */ createRESTModule(tokenInfo3);
|
|
312
|
-
var userInfo4 = /* @__PURE__ */ createRESTModule(userInfo3);
|
|
313
264
|
export {
|
|
314
265
|
SubjectType,
|
|
315
266
|
token4 as token,
|
|
316
|
-
tokenInfo4 as tokenInfo
|
|
317
|
-
userInfo4 as userInfo
|
|
267
|
+
tokenInfo4 as tokenInfo
|
|
318
268
|
};
|
|
319
269
|
//# sourceMappingURL=index.mjs.map
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +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 /** Indicates whether the user has consented to the requested scopes */\n userConsented?: boolean | 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?: SubjectTypeWithLiterals;\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\n/** @enumType */\nexport type SubjectTypeWithLiterals =\n | SubjectType\n | 'UNKNOWN'\n | 'USER'\n | 'VISITOR'\n | 'MEMBER'\n | 'APP';\n\nexport interface Empty {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For 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 that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\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\nexport interface UserInfoRequest {}\n\n/** UserInfo endpoint response for OpenID Connect */\nexport interface UserInfoResponse {\n /**\n * The unique identifier for the user.\n * @format GUID\n */\n _id?: string;\n /**\n * The user's given name.\n * @maxLength 20\n */\n givenName?: string | null;\n /**\n * The user's family name.\n * @maxLength 20\n */\n familyName?: string | null;\n /**\n * The user's email address.\n * @format EMAIL\n */\n email?: string | null;\n /** Indicates whether the user's email address has been verified. */\n emailVerified?: boolean | null;\n /**\n * The URL of the user's profile picture.\n * @format WEB_URL\n */\n picture?: string | null;\n /**\n * The user's preferred language, if available.\n * @format LANGUAGE\n */\n language?: string | null;\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 4\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 2\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\n/**\n * OpenID Connect UserInfo endpoint\n * Should be called with user access token obtained in OIDC flow as Authorization header\n * @public\n * @documentationMaturity preview\n * @permissionId OAUTH.USER_INFO\n * @returns UserInfo endpoint response for OpenID Connect\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.UserInfo\n */\nexport async function userInfo(): Promise<\n NonNullablePaths<UserInfoResponse, `_id`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.userInfo(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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { 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 srcPath: '/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/token',\n destPath: '/v1/oauth/token',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\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 'apps._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\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\n/**\n * OpenID Connect UserInfo endpoint\n * Should be called with user access token obtained in OIDC flow as Authorization header\n */\nexport function userInfo(payload: object): RequestOptionsFactory<any> {\n function __userInfo({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'GET' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.UserInfo',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/user-info',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __userInfo;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n RawHttpResponse,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n UserInfoResponse,\n token as universalToken,\n tokenInfo as universalTokenInfo,\n userInfo as universalUserInfo,\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): Promise<\n NonNullablePaths<\n RawHttpResponse,\n `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`,\n 4\n >\n >;\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): Promise<\n NonNullablePaths<\n TokenInfoResponse,\n `active` | `subjectType` | `subjectId` | `clientId`,\n 2\n >\n >;\n}\n\nexport function userInfo(httpClient: HttpClient): UserInfoSignature {\n return () =>\n universalUserInfo(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UserInfoSignature {\n /**\n * OpenID Connect UserInfo endpoint\n * Should be called with user access token obtained in OIDC flow as Authorization header\n * @returns UserInfo endpoint response for OpenID Connect\n */\n (): Promise<NonNullablePaths<UserInfoResponse, `_id`, 2>>;\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 UserInfoRequest,\n UserInfoResponse,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n","import {\n token as publicToken,\n tokenInfo as publicTokenInfo,\n userInfo as publicUserInfo,\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);\nexport const userInfo: MaybeContext<\n BuildRESTFunction<typeof publicUserInfo> & typeof publicUserInfo\n> = /*#__PURE__*/ createRESTModule(publicUserInfo);\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 UserInfoRequest,\n UserInfoResponse,\n TokenOptions,\n TokenInfoOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\nexport { SubjectTypeWithLiterals } from './identity-oauth-v1-refresh-token-oauth.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;AAC7C,S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UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEhgBO,SAASC,OAAM,YAAwC;AAC5D,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AA6BO,SAASC,WAAU,YAA4C;AACpE,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAeO,SAASC,UAAS,YAA2C;AAClE,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;;;ACzEA,SAAS,wBAAwB;AAG1B,IAAMC,SAEK,iCAAiBA,MAAW;AACvC,IAAMC,aAEK,iCAAiBA,UAAe;AAC3C,IAAMC,YAEK,iCAAiBA,SAAc;","names":["payload","SubjectType","token","tokenInfo","userInfo","token","tokenInfo","userInfo","token","tokenInfo","userInfo"]}
|
|
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 /** Indicates whether the user has consented to the requested scopes */\n userConsented?: boolean | 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?: SubjectTypeWithLiterals;\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\n/** @enumType */\nexport type SubjectTypeWithLiterals =\n | SubjectType\n | 'UNKNOWN'\n | 'USER'\n | 'VISITOR'\n | 'MEMBER'\n | 'APP';\n\nexport interface Empty {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For 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 that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\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\nexport interface UserInfoRequest {}\n\n/** UserInfo endpoint response for OpenID Connect */\nexport interface UserInfoResponse {\n /**\n * The unique identifier for the user.\n * @format GUID\n */\n _id?: string;\n /**\n * The user's given name.\n * @maxLength 20\n */\n givenName?: string | null;\n /**\n * The user's family name.\n * @maxLength 20\n */\n familyName?: string | null;\n /**\n * The user's email address.\n * @format EMAIL\n */\n email?: string | null;\n /** Indicates whether the user's email address has been verified. */\n emailVerified?: boolean | null;\n /**\n * The URL of the user's profile picture.\n * @format WEB_URL\n */\n picture?: string | null;\n /**\n * The user's preferred language, if available.\n * @format LANGUAGE\n */\n language?: string | null;\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 4\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 2\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 srcPath: '/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/token',\n destPath: '/v1/oauth/token',\n },\n {\n srcPath: '/iam/wix-idp/v1/oauth/user-info',\n destPath: '/v1/oauth/user-info',\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 'apps._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\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, NonNullablePaths } 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): Promise<\n NonNullablePaths<\n RawHttpResponse,\n `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`,\n 4\n >\n >;\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): Promise<\n NonNullablePaths<\n TokenInfoResponse,\n `active` | `subjectType` | `subjectId` | `clientId`,\n 2\n >\n >;\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 UserInfoRequest,\n UserInfoResponse,\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 UserInfoRequest,\n UserInfoResponse,\n TokenOptions,\n TokenInfoOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\nexport { SubjectTypeWithLiterals } from './identity-oauth-v1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,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,MAAM,SAAS;AAAA,IACf,YAAY,SAAS;AAAA,IACrB,aAAa,SAAS;AAAA,IACtB,SAAS,SAAS;AAAA,IAClB,QAAQ,SAAS;AAAA,IACjB,SAAS,SAAS;AAAA,IAClB,UAAU,SAAS;AAAA,EACrB,CAAC;AAED,QAAM,UAAmD,UAAU,OAAO;AAE1E,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;AAAA,UACxB,MAAM;AAAA,UACN,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE5cO,SAASC,OAAM,YAAwC;AAC5D,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AA6BO,SAASC,WAAU,YAA4C;AACpE,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnDA,SAAS,wBAAwB;AAG1B,IAAMC,SAEK,iCAAiBA,MAAW;AACvC,IAAMC,aAEK,iCAAiBA,UAAe;","names":["payload","SubjectType","token","tokenInfo","token","tokenInfo","token","tokenInfo"]}
|
|
@@ -332,15 +332,5 @@ interface TokenInfoOptions {
|
|
|
332
332
|
rawPath?: string;
|
|
333
333
|
rawQuery?: string;
|
|
334
334
|
}
|
|
335
|
-
/**
|
|
336
|
-
* OpenID Connect UserInfo endpoint
|
|
337
|
-
* Should be called with user access token obtained in OIDC flow as Authorization header
|
|
338
|
-
* @public
|
|
339
|
-
* @documentationMaturity preview
|
|
340
|
-
* @permissionId OAUTH.USER_INFO
|
|
341
|
-
* @returns UserInfo endpoint response for OpenID Connect
|
|
342
|
-
* @fqn wix.identity.oauth2.v1.Oauth2Ng.UserInfo
|
|
343
|
-
*/
|
|
344
|
-
declare function userInfo(): Promise<NonNullablePaths<UserInfoResponse, `_id`, 2>>;
|
|
345
335
|
|
|
346
|
-
export { type ActionEvent, type AuthorizeRequest, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceVerifyRequest, type DeviceVerifyResponse, type DeviceVerifyV2Request, type DeviceVerifyV2Response, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type HeadersEntry, type InvalidateUserCodeRequest, type InvalidateUserCodeResponse, type PathParametersEntry, type QueryParametersEntry, type RawHttpRequest, type RawHttpResponse, type RefreshToken, type RestoreInfo, type RevokeRefreshTokenRequest, type RevokeRefreshTokenResponse, SubjectType, type SubjectTypeWithLiterals, type TokenInfoOptions, type TokenInfoResponse, type TokenOptions, type UserInfoRequest, type UserInfoResponse, token, tokenInfo
|
|
336
|
+
export { type ActionEvent, type AuthorizeRequest, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceVerifyRequest, type DeviceVerifyResponse, type DeviceVerifyV2Request, type DeviceVerifyV2Response, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type HeadersEntry, type InvalidateUserCodeRequest, type InvalidateUserCodeResponse, type PathParametersEntry, type QueryParametersEntry, type RawHttpRequest, type RawHttpResponse, type RefreshToken, type RestoreInfo, type RevokeRefreshTokenRequest, type RevokeRefreshTokenResponse, SubjectType, type SubjectTypeWithLiterals, type TokenInfoOptions, type TokenInfoResponse, type TokenOptions, type UserInfoRequest, type UserInfoResponse, token, tokenInfo };
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
7
|
|
|
8
8
|
// src/identity-oauth-v1-refresh-token-oauth.http.ts
|
|
9
|
-
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
9
|
import { transformSDKBytesToRESTBytes } from "@wix/sdk-runtime/transformations/bytes";
|
|
11
10
|
import { transformRESTBytesToSDKBytes } from "@wix/sdk-runtime/transformations/bytes";
|
|
12
11
|
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
@@ -153,24 +152,6 @@ function tokenInfo(payload) {
|
|
|
153
152
|
}
|
|
154
153
|
return __tokenInfo;
|
|
155
154
|
}
|
|
156
|
-
function userInfo(payload) {
|
|
157
|
-
function __userInfo({ host }) {
|
|
158
|
-
const metadata = {
|
|
159
|
-
entityFqdn: "wix.identity.oauth.v1.refresh_token",
|
|
160
|
-
method: "GET",
|
|
161
|
-
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.UserInfo",
|
|
162
|
-
packageName: PACKAGE_NAME,
|
|
163
|
-
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
164
|
-
protoPath: "/v1/oauth/user-info",
|
|
165
|
-
data: payload,
|
|
166
|
-
host
|
|
167
|
-
}),
|
|
168
|
-
params: toURLSearchParams(payload)
|
|
169
|
-
};
|
|
170
|
-
return metadata;
|
|
171
|
-
}
|
|
172
|
-
return __userInfo;
|
|
173
|
-
}
|
|
174
155
|
|
|
175
156
|
// src/identity-oauth-v1-refresh-token-oauth.universal.ts
|
|
176
157
|
var SubjectType = /* @__PURE__ */ ((SubjectType2) => {
|
|
@@ -259,33 +240,9 @@ async function tokenInfo2(options) {
|
|
|
259
240
|
throw transformedError;
|
|
260
241
|
}
|
|
261
242
|
}
|
|
262
|
-
async function userInfo2() {
|
|
263
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
264
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({});
|
|
265
|
-
const reqOpts = userInfo(payload);
|
|
266
|
-
sideEffects?.onSiteCall?.();
|
|
267
|
-
try {
|
|
268
|
-
const result = await httpClient.request(reqOpts);
|
|
269
|
-
sideEffects?.onSuccess?.(result);
|
|
270
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
271
|
-
} catch (err) {
|
|
272
|
-
const transformedError = sdkTransformError(
|
|
273
|
-
err,
|
|
274
|
-
{
|
|
275
|
-
spreadPathsToArguments: {},
|
|
276
|
-
explicitPathsToArguments: {},
|
|
277
|
-
singleArgumentUnchanged: false
|
|
278
|
-
},
|
|
279
|
-
[]
|
|
280
|
-
);
|
|
281
|
-
sideEffects?.onError?.(err);
|
|
282
|
-
throw transformedError;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
243
|
export {
|
|
286
244
|
SubjectType,
|
|
287
245
|
token2 as token,
|
|
288
|
-
tokenInfo2 as tokenInfo
|
|
289
|
-
userInfo2 as userInfo
|
|
246
|
+
tokenInfo2 as tokenInfo
|
|
290
247
|
};
|
|
291
248
|
//# sourceMappingURL=index.typings.mjs.map
|