@wix/auto_sdk_identity_oauth 1.0.22 → 1.0.24
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.js +18 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +229 -1
- package/build/cjs/meta.js +30 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +18 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +2 -0
- package/build/es/index.typings.mjs +18 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +229 -1
- package/build/es/meta.mjs +29 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +2 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +229 -1
- package/build/internal/cjs/meta.js +30 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.mjs +18 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +2 -0
- package/build/internal/es/index.typings.mjs +18 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +229 -1
- package/build/internal/es/meta.mjs +29 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -86,18 +86,30 @@ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
|
|
|
86
86
|
{
|
|
87
87
|
srcPath: "/oauth2/callback",
|
|
88
88
|
destPath: "/oauth2/callback"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
srcPath: "/oauth2/user-authorized",
|
|
92
|
+
destPath: "/oauth2/user-authorized"
|
|
89
93
|
}
|
|
90
94
|
],
|
|
91
95
|
"blocks._base_domain_": [
|
|
92
96
|
{
|
|
93
97
|
srcPath: "/oauth2/callback",
|
|
94
98
|
destPath: "/oauth2/callback"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/oauth2/user-authorized",
|
|
102
|
+
destPath: "/oauth2/user-authorized"
|
|
95
103
|
}
|
|
96
104
|
],
|
|
97
105
|
"create.editorx": [
|
|
98
106
|
{
|
|
99
107
|
srcPath: "/oauth2/callback",
|
|
100
108
|
destPath: "/oauth2/callback"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
srcPath: "/oauth2/user-authorized",
|
|
112
|
+
destPath: "/oauth2/user-authorized"
|
|
101
113
|
}
|
|
102
114
|
]
|
|
103
115
|
};
|
|
@@ -114,6 +126,9 @@ function token(payload) {
|
|
|
114
126
|
method: "POST",
|
|
115
127
|
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.Token",
|
|
116
128
|
packageName: PACKAGE_NAME,
|
|
129
|
+
migrationOptions: {
|
|
130
|
+
optInTransformResponse: true
|
|
131
|
+
},
|
|
117
132
|
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
118
133
|
protoPath: "/v1/oauth/token",
|
|
119
134
|
data: serializedData,
|
|
@@ -141,6 +156,9 @@ function tokenInfo(payload) {
|
|
|
141
156
|
method: "POST",
|
|
142
157
|
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.TokenInfo",
|
|
143
158
|
packageName: PACKAGE_NAME,
|
|
159
|
+
migrationOptions: {
|
|
160
|
+
optInTransformResponse: true
|
|
161
|
+
},
|
|
144
162
|
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
145
163
|
protoPath: "/v1/oauth/token-info",
|
|
146
164
|
data: serializedData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/identity-oauth-v1-refresh-token-oauth.universal.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.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"],"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,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,M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Aa;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;AAiBA,eAAsBC,WACpB,SAOA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,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;","names":["payload","SubjectType","token","tokenInfo"]}
|
|
1
|
+
{"version":3,"sources":["../../src/identity-oauth-v1-refresh-token-oauth.universal.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.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 /** Indicates whether login is optional. If true, will not redirect to the sign_in_url if user is not logged in. */\n optionalLogin?: 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 srcPath: '/oauth2/user-authorized',\n destPath: '/oauth2/user-authorized',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n {\n srcPath: '/oauth2/user-authorized',\n destPath: '/oauth2/user-authorized',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n {\n srcPath: '/oauth2/user-authorized',\n destPath: '/oauth2/user-authorized',\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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"],"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,MACA;AAAA,QACE,SAAS;AAAA,QACT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,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;","names":["payload","SubjectType","token","tokenInfo"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
import { RawHttpRequest as RawHttpRequest$1, RawHttpResponse as RawHttpResponse$1, TokenInfoResponse as TokenInfoResponse$1 } from './index.typings.mjs';
|
|
2
2
|
import '@wix/sdk-types';
|
|
3
3
|
|
|
4
|
+
interface RefreshToken {
|
|
5
|
+
token?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* AuthorizeRequest is sent by the client to the authorization server to initiate
|
|
9
|
+
* the authorization process.
|
|
10
|
+
*/
|
|
11
|
+
interface AuthorizeRequest {
|
|
12
|
+
/**
|
|
13
|
+
* ID of the Wix OAuth app requesting authorization.
|
|
14
|
+
* @format GUID
|
|
15
|
+
*/
|
|
16
|
+
clientId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).
|
|
19
|
+
*
|
|
20
|
+
* Supported values:
|
|
21
|
+
* + `code`: The endpoint returns an authorization code that can be used to obtain an access token.
|
|
22
|
+
* @minLength 1
|
|
23
|
+
*/
|
|
24
|
+
responseType?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
* @minLength 1
|
|
28
|
+
*/
|
|
29
|
+
redirectUri?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Desired scope of access. If this field is left empty, only an access token is granted.
|
|
32
|
+
* To received a refresh token, pass `offline_access` as the value of this field.
|
|
33
|
+
*/
|
|
34
|
+
scope?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* A value used to confirm the state of an application before and after it makes an authorization
|
|
37
|
+
* request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser
|
|
38
|
+
* is redirected there.
|
|
39
|
+
* Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).
|
|
40
|
+
* @minLength 1
|
|
41
|
+
*/
|
|
42
|
+
state?: string;
|
|
43
|
+
/**
|
|
44
|
+
* esired response format.
|
|
45
|
+
*
|
|
46
|
+
* Supported values:
|
|
47
|
+
* + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.
|
|
48
|
+
* + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.
|
|
49
|
+
* + `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).
|
|
50
|
+
*
|
|
51
|
+
* Default value: `query`
|
|
52
|
+
*/
|
|
53
|
+
responseMode?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Code challenge to use for PKCE verification.
|
|
56
|
+
* This field is only used if `responseType` is set to `code`.
|
|
57
|
+
*/
|
|
58
|
+
codeChallenge?: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Code challenge method to use for PKCE verification.
|
|
61
|
+
* This field is only used if `responseType` is set to `code`.
|
|
62
|
+
*
|
|
63
|
+
* Supported values:
|
|
64
|
+
* + `S256`: The code challenge is transformed using SHA-256 encyption.
|
|
65
|
+
* + `S512`: The code challenge is transformed using SHA-512 encyption.
|
|
66
|
+
*/
|
|
67
|
+
codeChallengeMethod?: string | null;
|
|
68
|
+
/** Session token of the site visitor to authorize. */
|
|
69
|
+
sessionToken?: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* URL to redirect user to sign in
|
|
72
|
+
* @format SECURE_WEB_URL
|
|
73
|
+
*/
|
|
74
|
+
signInUrl?: string | null;
|
|
75
|
+
/** Indicates whether the user has consented to the requested scopes */
|
|
76
|
+
userConsented?: boolean | null;
|
|
77
|
+
/** Indicates whether login is optional. If true, will not redirect to the sign_in_url if user is not logged in. */
|
|
78
|
+
optionalLogin?: boolean | null;
|
|
79
|
+
}
|
|
4
80
|
interface RawHttpResponse {
|
|
5
81
|
body?: Uint8Array;
|
|
6
82
|
statusCode?: number | null;
|
|
@@ -27,6 +103,55 @@ interface QueryParametersEntry {
|
|
|
27
103
|
key?: string;
|
|
28
104
|
value?: string;
|
|
29
105
|
}
|
|
106
|
+
interface DeviceCodeRequest {
|
|
107
|
+
/** The ID of the application that asks for authorization. */
|
|
108
|
+
clientId?: string;
|
|
109
|
+
/**
|
|
110
|
+
* scope is a space-delimited string that specifies the requested scope of the
|
|
111
|
+
* access request.
|
|
112
|
+
*/
|
|
113
|
+
scope?: string | null;
|
|
114
|
+
}
|
|
115
|
+
interface DeviceCodeResponse {
|
|
116
|
+
/** 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. */
|
|
117
|
+
deviceCode?: string;
|
|
118
|
+
/** contains the code that should be input at the verification_uri to authorize the device. */
|
|
119
|
+
userCode?: string;
|
|
120
|
+
/** contains the URL the user should visit to authorize the device. */
|
|
121
|
+
verificationUri?: string;
|
|
122
|
+
/** indicates the lifetime (in seconds) of the device_code and user_code. */
|
|
123
|
+
expiresIn?: number;
|
|
124
|
+
/** 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 */
|
|
125
|
+
interval?: number | null;
|
|
126
|
+
}
|
|
127
|
+
interface DeviceVerifyRequest {
|
|
128
|
+
/** User code representing a currently authorizing device. */
|
|
129
|
+
userCode?: string;
|
|
130
|
+
}
|
|
131
|
+
interface DeviceVerifyResponse {
|
|
132
|
+
}
|
|
133
|
+
interface DeviceVerifyV2Request {
|
|
134
|
+
/**
|
|
135
|
+
* User code representing a currently authorizing device.
|
|
136
|
+
* @minLength 8
|
|
137
|
+
* @maxLength 8
|
|
138
|
+
*/
|
|
139
|
+
userCode?: string;
|
|
140
|
+
}
|
|
141
|
+
interface DeviceVerifyV2Response {
|
|
142
|
+
}
|
|
143
|
+
interface InvalidateUserCodeRequest {
|
|
144
|
+
/** user code to invalidate. Only the authorizing identity is able to invalidate it. */
|
|
145
|
+
userCode?: string;
|
|
146
|
+
}
|
|
147
|
+
interface InvalidateUserCodeResponse {
|
|
148
|
+
}
|
|
149
|
+
interface RevokeRefreshTokenRequest {
|
|
150
|
+
/** The refresh token itself. Anyone with the token itself is able to revoke it. */
|
|
151
|
+
token?: string;
|
|
152
|
+
}
|
|
153
|
+
interface RevokeRefreshTokenResponse {
|
|
154
|
+
}
|
|
30
155
|
interface TokenInfoResponse {
|
|
31
156
|
active?: boolean;
|
|
32
157
|
/** subject type. */
|
|
@@ -65,6 +190,109 @@ declare enum SubjectType {
|
|
|
65
190
|
}
|
|
66
191
|
/** @enumType */
|
|
67
192
|
type SubjectTypeWithLiterals = SubjectType | 'UNKNOWN' | 'USER' | 'VISITOR' | 'MEMBER' | 'APP';
|
|
193
|
+
interface Empty {
|
|
194
|
+
}
|
|
195
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
196
|
+
createdEvent?: EntityCreatedEvent;
|
|
197
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
198
|
+
deletedEvent?: EntityDeletedEvent;
|
|
199
|
+
actionEvent?: ActionEvent;
|
|
200
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
201
|
+
id?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
204
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
205
|
+
*/
|
|
206
|
+
entityFqdn?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
209
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
210
|
+
*/
|
|
211
|
+
slug?: string;
|
|
212
|
+
/** ID of the entity associated with the event. */
|
|
213
|
+
entityId?: string;
|
|
214
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
215
|
+
eventTime?: Date | null;
|
|
216
|
+
/**
|
|
217
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
218
|
+
* (for example, GDPR).
|
|
219
|
+
*/
|
|
220
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
221
|
+
/** If present, indicates the action that triggered the event. */
|
|
222
|
+
originatedFrom?: string | null;
|
|
223
|
+
/**
|
|
224
|
+
* 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.
|
|
225
|
+
* 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.
|
|
226
|
+
*/
|
|
227
|
+
entityEventSequence?: string | null;
|
|
228
|
+
}
|
|
229
|
+
/** @oneof */
|
|
230
|
+
interface DomainEventBodyOneOf {
|
|
231
|
+
createdEvent?: EntityCreatedEvent;
|
|
232
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
233
|
+
deletedEvent?: EntityDeletedEvent;
|
|
234
|
+
actionEvent?: ActionEvent;
|
|
235
|
+
}
|
|
236
|
+
interface EntityCreatedEvent {
|
|
237
|
+
entityAsJson?: string;
|
|
238
|
+
/** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
|
|
239
|
+
restoreInfo?: RestoreInfo;
|
|
240
|
+
}
|
|
241
|
+
interface RestoreInfo {
|
|
242
|
+
deletedDate?: Date | null;
|
|
243
|
+
}
|
|
244
|
+
interface EntityUpdatedEvent {
|
|
245
|
+
/**
|
|
246
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
247
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
248
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
249
|
+
*/
|
|
250
|
+
currentEntityAsJson?: string;
|
|
251
|
+
}
|
|
252
|
+
interface EntityDeletedEvent {
|
|
253
|
+
/** Entity that was deleted. */
|
|
254
|
+
deletedEntityAsJson?: string | null;
|
|
255
|
+
}
|
|
256
|
+
interface ActionEvent {
|
|
257
|
+
bodyAsJson?: string;
|
|
258
|
+
}
|
|
259
|
+
interface UserInfoRequest {
|
|
260
|
+
}
|
|
261
|
+
/** UserInfo endpoint response for OpenID Connect */
|
|
262
|
+
interface UserInfoResponse {
|
|
263
|
+
/**
|
|
264
|
+
* The unique identifier for the user.
|
|
265
|
+
* @format GUID
|
|
266
|
+
*/
|
|
267
|
+
id?: string;
|
|
268
|
+
/**
|
|
269
|
+
* The user's given name.
|
|
270
|
+
* @maxLength 20
|
|
271
|
+
*/
|
|
272
|
+
givenName?: string | null;
|
|
273
|
+
/**
|
|
274
|
+
* The user's family name.
|
|
275
|
+
* @maxLength 20
|
|
276
|
+
*/
|
|
277
|
+
familyName?: string | null;
|
|
278
|
+
/**
|
|
279
|
+
* The user's email address.
|
|
280
|
+
* @format EMAIL
|
|
281
|
+
*/
|
|
282
|
+
email?: string | null;
|
|
283
|
+
/** Indicates whether the user's email address has been verified. */
|
|
284
|
+
emailVerified?: boolean | null;
|
|
285
|
+
/**
|
|
286
|
+
* The URL of the user's profile picture.
|
|
287
|
+
* @format WEB_URL
|
|
288
|
+
*/
|
|
289
|
+
picture?: string | null;
|
|
290
|
+
/**
|
|
291
|
+
* The user's preferred language, if available.
|
|
292
|
+
* @format LANGUAGE
|
|
293
|
+
*/
|
|
294
|
+
language?: string | null;
|
|
295
|
+
}
|
|
68
296
|
|
|
69
297
|
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
70
298
|
getUrl: (context: any) => string;
|
|
@@ -79,4 +307,4 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
|
|
|
79
307
|
declare function token(): __PublicMethodMetaInfo<'POST', {}, RawHttpRequest$1, RawHttpRequest, RawHttpResponse$1, RawHttpResponse>;
|
|
80
308
|
declare function tokenInfo(): __PublicMethodMetaInfo<'POST', {}, RawHttpRequest$1, RawHttpRequest, TokenInfoResponse$1, TokenInfoResponse>;
|
|
81
309
|
|
|
82
|
-
export { type __PublicMethodMetaInfo, token, tokenInfo };
|
|
310
|
+
export { type ActionEvent as ActionEventOriginal, type AuthorizeRequest as AuthorizeRequestOriginal, type DeviceCodeRequest as DeviceCodeRequestOriginal, type DeviceCodeResponse as DeviceCodeResponseOriginal, type DeviceVerifyRequest as DeviceVerifyRequestOriginal, type DeviceVerifyResponse as DeviceVerifyResponseOriginal, type DeviceVerifyV2Request as DeviceVerifyV2RequestOriginal, type DeviceVerifyV2Response as DeviceVerifyV2ResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type Empty as EmptyOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type HeadersEntry as HeadersEntryOriginal, type InvalidateUserCodeRequest as InvalidateUserCodeRequestOriginal, type InvalidateUserCodeResponse as InvalidateUserCodeResponseOriginal, type PathParametersEntry as PathParametersEntryOriginal, type QueryParametersEntry as QueryParametersEntryOriginal, type RawHttpRequest as RawHttpRequestOriginal, type RawHttpResponse as RawHttpResponseOriginal, type RefreshToken as RefreshTokenOriginal, type RestoreInfo as RestoreInfoOriginal, type RevokeRefreshTokenRequest as RevokeRefreshTokenRequestOriginal, type RevokeRefreshTokenResponse as RevokeRefreshTokenResponseOriginal, SubjectType as SubjectTypeOriginal, type SubjectTypeWithLiterals as SubjectTypeWithLiteralsOriginal, type TokenInfoResponse as TokenInfoResponseOriginal, type UserInfoRequest as UserInfoRequestOriginal, type UserInfoResponse as UserInfoResponseOriginal, type __PublicMethodMetaInfo, token, tokenInfo };
|
package/build/es/meta.mjs
CHANGED
|
@@ -79,18 +79,30 @@ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
|
|
|
79
79
|
{
|
|
80
80
|
srcPath: "/oauth2/callback",
|
|
81
81
|
destPath: "/oauth2/callback"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
srcPath: "/oauth2/user-authorized",
|
|
85
|
+
destPath: "/oauth2/user-authorized"
|
|
82
86
|
}
|
|
83
87
|
],
|
|
84
88
|
"blocks._base_domain_": [
|
|
85
89
|
{
|
|
86
90
|
srcPath: "/oauth2/callback",
|
|
87
91
|
destPath: "/oauth2/callback"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
srcPath: "/oauth2/user-authorized",
|
|
95
|
+
destPath: "/oauth2/user-authorized"
|
|
88
96
|
}
|
|
89
97
|
],
|
|
90
98
|
"create.editorx": [
|
|
91
99
|
{
|
|
92
100
|
srcPath: "/oauth2/callback",
|
|
93
101
|
destPath: "/oauth2/callback"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
srcPath: "/oauth2/user-authorized",
|
|
105
|
+
destPath: "/oauth2/user-authorized"
|
|
94
106
|
}
|
|
95
107
|
]
|
|
96
108
|
};
|
|
@@ -107,6 +119,9 @@ function token(payload) {
|
|
|
107
119
|
method: "POST",
|
|
108
120
|
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.Token",
|
|
109
121
|
packageName: PACKAGE_NAME,
|
|
122
|
+
migrationOptions: {
|
|
123
|
+
optInTransformResponse: true
|
|
124
|
+
},
|
|
110
125
|
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
111
126
|
protoPath: "/v1/oauth/token",
|
|
112
127
|
data: serializedData,
|
|
@@ -134,6 +149,9 @@ function tokenInfo(payload) {
|
|
|
134
149
|
method: "POST",
|
|
135
150
|
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.TokenInfo",
|
|
136
151
|
packageName: PACKAGE_NAME,
|
|
152
|
+
migrationOptions: {
|
|
153
|
+
optInTransformResponse: true
|
|
154
|
+
},
|
|
137
155
|
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
138
156
|
protoPath: "/v1/oauth/token-info",
|
|
139
157
|
data: serializedData,
|
|
@@ -146,6 +164,16 @@ function tokenInfo(payload) {
|
|
|
146
164
|
return __tokenInfo;
|
|
147
165
|
}
|
|
148
166
|
|
|
167
|
+
// src/identity-oauth-v1-refresh-token-oauth.types.ts
|
|
168
|
+
var SubjectType = /* @__PURE__ */ ((SubjectType2) => {
|
|
169
|
+
SubjectType2["UNKNOWN"] = "UNKNOWN";
|
|
170
|
+
SubjectType2["USER"] = "USER";
|
|
171
|
+
SubjectType2["VISITOR"] = "VISITOR";
|
|
172
|
+
SubjectType2["MEMBER"] = "MEMBER";
|
|
173
|
+
SubjectType2["APP"] = "APP";
|
|
174
|
+
return SubjectType2;
|
|
175
|
+
})(SubjectType || {});
|
|
176
|
+
|
|
149
177
|
// src/identity-oauth-v1-refresh-token-oauth.meta.ts
|
|
150
178
|
function token2() {
|
|
151
179
|
const payload = {};
|
|
@@ -184,6 +212,7 @@ function tokenInfo2() {
|
|
|
184
212
|
};
|
|
185
213
|
}
|
|
186
214
|
export {
|
|
215
|
+
SubjectType as SubjectTypeOriginal,
|
|
187
216
|
token2 as token,
|
|
188
217
|
tokenInfo2 as tokenInfo
|
|
189
218
|
};
|
package/build/es/meta.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.meta.ts"],"sourcesContent":["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,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,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,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,SAAS,UAAU,SAA6C;AACrE,WAAS,YAAY,EAAE,KAAK,GAAQ;AAClC,UAAM,iBAAiB,eAAe,SAAS;AAAA,MAC7C,EAAE,aAAa,8BAA8B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,EAAE;AAAA,IACzE,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,sCAAsC;AAAA,QACzC,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,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":["payload","token","tokenInfo"]}
|
|
1
|
+
{"version":3,"sources":["../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.types.ts","../../src/identity-oauth-v1-refresh-token-oauth.meta.ts"],"sourcesContent":["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 srcPath: '/oauth2/user-authorized',\n destPath: '/oauth2/user-authorized',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n {\n srcPath: '/oauth2/user-authorized',\n destPath: '/oauth2/user-authorized',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/oauth2/callback',\n destPath: '/oauth2/callback',\n },\n {\n srcPath: '/oauth2/user-authorized',\n destPath: '/oauth2/user-authorized',\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /** Indicates whether login is optional. If true, will not redirect to the sign_in_url if user is not logged in. */\n optionalLogin?: 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 entityAsJson?: string;\n /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */\n restoreInfo?: RestoreInfo;\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 currentEntityAsJson?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntityAsJson?: string | null;\n}\n\nexport interface ActionEvent {\n bodyAsJson?: 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","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 {\n RefreshToken as RefreshTokenOriginal,\n AuthorizeRequest as AuthorizeRequestOriginal,\n RawHttpResponse as RawHttpResponseOriginal,\n HeadersEntry as HeadersEntryOriginal,\n RawHttpRequest as RawHttpRequestOriginal,\n PathParametersEntry as PathParametersEntryOriginal,\n QueryParametersEntry as QueryParametersEntryOriginal,\n DeviceCodeRequest as DeviceCodeRequestOriginal,\n DeviceCodeResponse as DeviceCodeResponseOriginal,\n DeviceVerifyRequest as DeviceVerifyRequestOriginal,\n DeviceVerifyResponse as DeviceVerifyResponseOriginal,\n DeviceVerifyV2Request as DeviceVerifyV2RequestOriginal,\n DeviceVerifyV2Response as DeviceVerifyV2ResponseOriginal,\n InvalidateUserCodeRequest as InvalidateUserCodeRequestOriginal,\n InvalidateUserCodeResponse as InvalidateUserCodeResponseOriginal,\n RevokeRefreshTokenRequest as RevokeRefreshTokenRequestOriginal,\n RevokeRefreshTokenResponse as RevokeRefreshTokenResponseOriginal,\n TokenInfoResponse as TokenInfoResponseOriginal,\n SubjectType as SubjectTypeOriginal,\n SubjectTypeWithLiterals as SubjectTypeWithLiteralsOriginal,\n Empty as EmptyOriginal,\n DomainEvent as DomainEventOriginal,\n DomainEventBodyOneOf as DomainEventBodyOneOfOriginal,\n EntityCreatedEvent as EntityCreatedEventOriginal,\n RestoreInfo as RestoreInfoOriginal,\n EntityUpdatedEvent as EntityUpdatedEventOriginal,\n EntityDeletedEvent as EntityDeletedEventOriginal,\n ActionEvent as ActionEventOriginal,\n UserInfoRequest as UserInfoRequestOriginal,\n UserInfoResponse as UserInfoResponseOriginal,\n} from './identity-oauth-v1-refresh-token-oauth.types.js';\n"],"mappings":";AAAA,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,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;A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AAY;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":["payload","SubjectType","token","tokenInfo"]}
|
|
@@ -111,18 +111,30 @@ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
|
|
|
111
111
|
{
|
|
112
112
|
srcPath: "/oauth2/callback",
|
|
113
113
|
destPath: "/oauth2/callback"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
srcPath: "/oauth2/user-authorized",
|
|
117
|
+
destPath: "/oauth2/user-authorized"
|
|
114
118
|
}
|
|
115
119
|
],
|
|
116
120
|
"blocks._base_domain_": [
|
|
117
121
|
{
|
|
118
122
|
srcPath: "/oauth2/callback",
|
|
119
123
|
destPath: "/oauth2/callback"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
srcPath: "/oauth2/user-authorized",
|
|
127
|
+
destPath: "/oauth2/user-authorized"
|
|
120
128
|
}
|
|
121
129
|
],
|
|
122
130
|
"create.editorx": [
|
|
123
131
|
{
|
|
124
132
|
srcPath: "/oauth2/callback",
|
|
125
133
|
destPath: "/oauth2/callback"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
srcPath: "/oauth2/user-authorized",
|
|
137
|
+
destPath: "/oauth2/user-authorized"
|
|
126
138
|
}
|
|
127
139
|
]
|
|
128
140
|
};
|
|
@@ -139,6 +151,9 @@ function token(payload) {
|
|
|
139
151
|
method: "POST",
|
|
140
152
|
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.Token",
|
|
141
153
|
packageName: PACKAGE_NAME,
|
|
154
|
+
migrationOptions: {
|
|
155
|
+
optInTransformResponse: true
|
|
156
|
+
},
|
|
142
157
|
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
143
158
|
protoPath: "/v1/oauth/token",
|
|
144
159
|
data: serializedData,
|
|
@@ -166,6 +181,9 @@ function tokenInfo(payload) {
|
|
|
166
181
|
method: "POST",
|
|
167
182
|
methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.TokenInfo",
|
|
168
183
|
packageName: PACKAGE_NAME,
|
|
184
|
+
migrationOptions: {
|
|
185
|
+
optInTransformResponse: true
|
|
186
|
+
},
|
|
169
187
|
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
170
188
|
protoPath: "/v1/oauth/token-info",
|
|
171
189
|
data: serializedData,
|