@wix/identity 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +24 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/identity-oauth-v1-refresh-token.http.d.ts +8 -0
  5. package/build/cjs/src/identity-oauth-v1-refresh-token.http.js +105 -0
  6. package/build/cjs/src/identity-oauth-v1-refresh-token.http.js.map +1 -0
  7. package/build/cjs/src/identity-oauth-v1-refresh-token.public.d.ts +7 -0
  8. package/build/cjs/src/identity-oauth-v1-refresh-token.public.js +29 -0
  9. package/build/cjs/src/identity-oauth-v1-refresh-token.public.js.map +1 -0
  10. package/build/cjs/src/identity-oauth-v1-refresh-token.types.d.ts +113 -0
  11. package/build/cjs/src/identity-oauth-v1-refresh-token.types.js +3 -0
  12. package/build/cjs/src/identity-oauth-v1-refresh-token.types.js.map +1 -0
  13. package/build/cjs/src/identity-oauth-v1-refresh-token.universal.d.ts +175 -0
  14. package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js +261 -0
  15. package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +2 -0
  18. package/build/es/index.js.map +1 -0
  19. package/build/es/src/identity-oauth-v1-refresh-token.http.d.ts +8 -0
  20. package/build/es/src/identity-oauth-v1-refresh-token.http.js +98 -0
  21. package/build/es/src/identity-oauth-v1-refresh-token.http.js.map +1 -0
  22. package/build/es/src/identity-oauth-v1-refresh-token.public.d.ts +7 -0
  23. package/build/es/src/identity-oauth-v1-refresh-token.public.js +22 -0
  24. package/build/es/src/identity-oauth-v1-refresh-token.public.js.map +1 -0
  25. package/build/es/src/identity-oauth-v1-refresh-token.types.d.ts +113 -0
  26. package/build/es/src/identity-oauth-v1-refresh-token.types.js +2 -0
  27. package/build/es/src/identity-oauth-v1-refresh-token.types.js.map +1 -0
  28. package/build/es/src/identity-oauth-v1-refresh-token.universal.d.ts +175 -0
  29. package/build/es/src/identity-oauth-v1-refresh-token.universal.js +235 -0
  30. package/build/es/src/identity-oauth-v1-refresh-token.universal.js.map +1 -0
  31. package/package.json +37 -0
@@ -0,0 +1 @@
1
+ export * as oauth from './src/identity-oauth-v1-refresh-token.public';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.oauth = void 0;
23
+ exports.oauth = __importStar(require("./src/identity-oauth-v1-refresh-token.public"));
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,sFAAsE"}
@@ -0,0 +1,8 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { RawHttpResponse, AuthorizeRequest, DeviceCodeRequest, DeviceCodeResponse, DeviceVerifyRequest, DeviceVerifyResponse, TokenRequest, TokenResponse } from './identity-oauth-v1-refresh-token.types';
3
+ export declare function authorize(payload: AuthorizeRequest): RequestOptionsFactory<RawHttpResponse>;
4
+ export declare function token(payload: TokenRequest): RequestOptionsFactory<TokenResponse>;
5
+ /** this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf */
6
+ export declare function deviceCode(payload: DeviceCodeRequest): RequestOptionsFactory<DeviceCodeResponse>;
7
+ /** this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf */
8
+ export declare function deviceVerify(payload: DeviceVerifyRequest): RequestOptionsFactory<DeviceVerifyResponse>;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deviceVerify = exports.deviceCode = exports.token = exports.authorize = void 0;
4
+ const metro_runtime_1 = require("@wix/metro-runtime");
5
+ const ambassador_1 = require("@wix/metro-runtime/ambassador");
6
+ const metro_runtime_2 = require("@wix/metro-runtime");
7
+ const _authorizeRequest = {};
8
+ const _deviceCodeRequest = {};
9
+ const _deviceCodeResponse = {};
10
+ const _deviceVerifyRequest = {};
11
+ const _deviceVerifyResponse = {};
12
+ const _rawHttpResponse = { body: 'BYTES' };
13
+ const _tokenRequest = {};
14
+ const _tokenResponse = {};
15
+ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
16
+ const domainToMappings = {};
17
+ return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
18
+ }
19
+ function authorize(payload) {
20
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_authorizeRequest, {});
21
+ const { fromJSON: fromRes } = ambassador_1.serializer(_rawHttpResponse, {});
22
+ function __authorize({ host }) {
23
+ const serializedData = toReq(payload);
24
+ const metadata = {
25
+ method: 'GET',
26
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
27
+ protoPath: '/v1/oauth/authorize',
28
+ data: serializedData,
29
+ host,
30
+ }),
31
+ params: metro_runtime_1.toURLSearchParams(serializedData),
32
+ transformResponse: fromRes,
33
+ };
34
+ return metadata;
35
+ }
36
+ __authorize.fromReq = fromReq;
37
+ return __authorize;
38
+ }
39
+ exports.authorize = authorize;
40
+ function token(payload) {
41
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_tokenRequest, {});
42
+ const { fromJSON: fromRes } = ambassador_1.serializer(_tokenResponse, {});
43
+ function __token({ host }) {
44
+ const serializedData = toReq(payload);
45
+ const metadata = {
46
+ method: 'GET',
47
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
48
+ protoPath: '/v1/oauth/token',
49
+ data: serializedData,
50
+ host,
51
+ }),
52
+ params: metro_runtime_1.toURLSearchParams(serializedData),
53
+ transformResponse: fromRes,
54
+ };
55
+ return metadata;
56
+ }
57
+ __token.fromReq = fromReq;
58
+ return __token;
59
+ }
60
+ exports.token = token;
61
+ /** this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf */
62
+ function deviceCode(payload) {
63
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deviceCodeRequest, {});
64
+ const { fromJSON: fromRes } = ambassador_1.serializer(_deviceCodeResponse, {});
65
+ function __deviceCode({ host }) {
66
+ const serializedData = toReq(payload);
67
+ const metadata = {
68
+ method: 'GET',
69
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
70
+ protoPath: '/v1/oauth/device/code',
71
+ data: serializedData,
72
+ host,
73
+ }),
74
+ params: metro_runtime_1.toURLSearchParams(serializedData),
75
+ transformResponse: fromRes,
76
+ };
77
+ return metadata;
78
+ }
79
+ __deviceCode.fromReq = fromReq;
80
+ return __deviceCode;
81
+ }
82
+ exports.deviceCode = deviceCode;
83
+ /** this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf */
84
+ function deviceVerify(payload) {
85
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deviceVerifyRequest, {});
86
+ const { fromJSON: fromRes } = ambassador_1.serializer(_deviceVerifyResponse, {});
87
+ function __deviceVerify({ host }) {
88
+ const serializedData = toReq(payload);
89
+ const metadata = {
90
+ method: 'GET',
91
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
92
+ protoPath: '/v1/oauth/device/verify',
93
+ data: serializedData,
94
+ host,
95
+ }),
96
+ params: metro_runtime_1.toURLSearchParams(serializedData),
97
+ transformResponse: fromRes,
98
+ };
99
+ return metadata;
100
+ }
101
+ __deviceVerify.fromReq = fromReq;
102
+ return __deviceVerify;
103
+ }
104
+ exports.deviceVerify = deviceVerify;
105
+ //# sourceMappingURL=identity-oauth-v1-refresh-token.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-oauth-v1-refresh-token.http.js","sourceRoot":"","sources":["../../../src/identity-oauth-v1-refresh-token.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8DAA2D;AAC3D,sDAAgD;AAchD,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3C,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,SAAS,qCAAqC,CAC5C,IAA8C;IAE9C,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAE5B,OAAO,0BAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAgB,SAAS,CACvB,OAAyB;IAEzB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,uBAAU,CACrD,iBAAiB,E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;gBACzC,SAAS,EAAE,yBAAyB;gBACpC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,MAAM,EAAE,iCAAiB,CAAC,cAAc,CAAC;YACzC,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;IAEjC,OAAO,cAAc,CAAC;AACxB,CAAC;AA5BD,oCA4BC"}
@@ -0,0 +1,7 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { AuthorizeOptions, DeviceCodeOptions, DeviceVerifyOptions, TokenOptions } from './identity-oauth-v1-refresh-token.universal';
3
+ export declare function authorize(httpClient: HttpClient): (options?: AuthorizeOptions | undefined) => Promise<import("./identity-oauth-v1-refresh-token.universal").RawHttpResponse>;
4
+ export declare function token(httpClient: HttpClient): (options?: TokenOptions | undefined) => Promise<import("./identity-oauth-v1-refresh-token.universal").TokenResponse>;
5
+ export declare function deviceCode(httpClient: HttpClient): (options?: DeviceCodeOptions | undefined) => Promise<import("./identity-oauth-v1-refresh-token.universal").DeviceCodeResponse>;
6
+ export declare function deviceVerify(httpClient: HttpClient): (options?: DeviceVerifyOptions | undefined) => Promise<void>;
7
+ export { RefreshToken, AuthorizeRequest, Scope, RawHttpResponse, HeadersEntry, TokenRequest, TokenRequestGrantTypeOneOf, AuthorizationCode, PKCE, DeviceCode, ClientCredentials, PreAuthenticated, TokenResponse, AccessToken, DeviceCodeRequest, DeviceCodeResponse, DeviceVerifyRequest, DeviceVerifyResponse, AuthorizeOptions, TokenOptions, DeviceCodeOptions, DeviceVerifyOptions, } from './identity-oauth-v1-refresh-token.universal';
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deviceVerify = exports.deviceCode = exports.token = exports.authorize = void 0;
4
+ const identity_oauth_v1_refresh_token_universal_1 = require("./identity-oauth-v1-refresh-token.universal");
5
+ function authorize(httpClient) {
6
+ return (options) => identity_oauth_v1_refresh_token_universal_1.authorize(options,
7
+ // @ts-ignore
8
+ { httpClient });
9
+ }
10
+ exports.authorize = authorize;
11
+ function token(httpClient) {
12
+ return (options) => identity_oauth_v1_refresh_token_universal_1.token(options,
13
+ // @ts-ignore
14
+ { httpClient });
15
+ }
16
+ exports.token = token;
17
+ function deviceCode(httpClient) {
18
+ return (options) => identity_oauth_v1_refresh_token_universal_1.deviceCode(options,
19
+ // @ts-ignore
20
+ { httpClient });
21
+ }
22
+ exports.deviceCode = deviceCode;
23
+ function deviceVerify(httpClient) {
24
+ return (options) => identity_oauth_v1_refresh_token_universal_1.deviceVerify(options,
25
+ // @ts-ignore
26
+ { httpClient });
27
+ }
28
+ exports.deviceVerify = deviceVerify;
29
+ //# sourceMappingURL=identity-oauth-v1-refresh-token.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-oauth-v1-refresh-token.public.js","sourceRoot":"","sources":["../../../src/identity-oauth-v1-refresh-token.public.ts"],"names":[],"mappings":";;;AACA,2GASqD;AAErD,SAAgB,SAAS,CAAC,UAAsB;IAC9C,OAAO,CAAC,OAA0B,EAAE,EAAE,CACpC,qDAAkB,CAChB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,8BAOC;AAED,SAAgB,KAAK,CAAC,UAAsB;IAC1C,OAAO,CAAC,OAAsB,EAAE,EAAE,CAChC,iDAAc,CACZ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sBAOC;AAED,SAAgB,UAAU,CAAC,UAAsB;IAC/C,OAAO,CAAC,OAA2B,EAAE,EAAE,CACrC,sDAAmB,CACjB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,gCAOC;AAED,SAAgB,YAAY,CAAC,UAAsB;IACjD,OAAO,CAAC,OAA6B,EAAE,EAAE,CACvC,wDAAqB,CACnB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oCAOC"}
@@ -0,0 +1,113 @@
1
+ export interface RefreshToken {
2
+ token?: string;
3
+ }
4
+ export interface AuthorizeRequest {
5
+ /** Tells the authorization server which grant to execute. */
6
+ responseType?: string;
7
+ /** The ID of the application that asks for authorization. */
8
+ clientId?: string;
9
+ /** Holds a URL. A successful response from this endpoint results in a redirect to this URL. */
10
+ redirectUri?: string | null;
11
+ /** A list of scopes that the application requires. */
12
+ scope?: Scope;
13
+ /** An opaque value, used for security purposes. If this request parameter is set in the request, then it is returned to the application as part of the redirect_uri. */
14
+ state?: string;
15
+ /** (Optional) How the result of the authorization request is formatted */
16
+ responseMode?: string | null;
17
+ /** PKCE hashed code */
18
+ codeChallenge?: string | null;
19
+ /** PKCE hashing method */
20
+ codeChallengeMethod?: string | null;
21
+ /** Current client session */
22
+ sessionToken?: string | null;
23
+ }
24
+ export interface Scope {
25
+ /** A list of permissions that the application requires. Empty list means the default list of scopes. */
26
+ ids?: string[];
27
+ }
28
+ export interface RawHttpResponse {
29
+ body?: Uint8Array;
30
+ statusCode?: number | null;
31
+ headers?: HeadersEntry[];
32
+ }
33
+ export interface HeadersEntry {
34
+ key?: string;
35
+ value?: string;
36
+ }
37
+ export interface TokenRequest extends TokenRequestGrantTypeOneOf {
38
+ /** Authorization code given at the authorize endpoint. */
39
+ authorizationCode?: AuthorizationCode;
40
+ /** Authorization code given at the authorize endpoint with the PKCE extention. */
41
+ pkce?: PKCE;
42
+ /** Device code given at the device code endpoint. */
43
+ deviceCode?: DeviceCode;
44
+ /** Refresh Token that was issued by this service beforehand. */
45
+ refreshToken?: RefreshToken;
46
+ /** Client credentials for authenticating a client */
47
+ clientCredentials?: ClientCredentials;
48
+ /** Granting a pre authenticated token for basic access. */
49
+ preAuthenticated?: PreAuthenticated;
50
+ }
51
+ /** @oneof */
52
+ export interface TokenRequestGrantTypeOneOf {
53
+ /** Authorization code given at the authorize endpoint. */
54
+ authorizationCode?: AuthorizationCode;
55
+ /** Authorization code given at the authorize endpoint with the PKCE extention. */
56
+ pkce?: PKCE;
57
+ /** Device code given at the device code endpoint. */
58
+ deviceCode?: DeviceCode;
59
+ /** Refresh Token that was issued by this service beforehand. */
60
+ refreshToken?: RefreshToken;
61
+ /** Client credentials for authenticating a client */
62
+ clientCredentials?: ClientCredentials;
63
+ /** Granting a pre authenticated token for basic access. */
64
+ preAuthenticated?: PreAuthenticated;
65
+ }
66
+ export interface AuthorizationCode {
67
+ code?: string;
68
+ }
69
+ export interface PKCE {
70
+ authorizationCode?: AuthorizationCode;
71
+ /** PKCE code */
72
+ code?: string | null;
73
+ }
74
+ export interface DeviceCode {
75
+ deviceCode?: string;
76
+ }
77
+ export interface ClientCredentials {
78
+ }
79
+ export interface PreAuthenticated {
80
+ clientId?: string;
81
+ }
82
+ export interface TokenResponse {
83
+ accessToken?: AccessToken;
84
+ refreshToken?: RefreshToken;
85
+ }
86
+ export interface AccessToken {
87
+ /** The access token string as issued by the authorization server. */
88
+ token?: string;
89
+ }
90
+ export interface DeviceCodeRequest {
91
+ /** The ID of the application that asks for authorization. */
92
+ clientId?: string;
93
+ /** A list of permissions that the application requires. Empty list means the default list of scopes. */
94
+ scope?: Scope;
95
+ }
96
+ export interface DeviceCodeResponse {
97
+ /** 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. */
98
+ deviceCode?: string;
99
+ /** contains the code that should be input at the verification_uri to authorize the device. */
100
+ userCode?: string;
101
+ /** contains the URL the user should visit to authorize the device. */
102
+ verificationUri?: string;
103
+ /** indicates the lifetime (in seconds) of the device_code and user_code. */
104
+ expiresIn?: number;
105
+ /** indicates the interval (in seconds) at which the app should poll the token URL to request a token. */
106
+ interval?: number;
107
+ }
108
+ export interface DeviceVerifyRequest {
109
+ /** User code representing a currently authorizing device. */
110
+ userCode?: string;
111
+ }
112
+ export interface DeviceVerifyResponse {
113
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=identity-oauth-v1-refresh-token.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-oauth-v1-refresh-token.types.js","sourceRoot":"","sources":["../../../src/identity-oauth-v1-refresh-token.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,175 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ export interface RefreshToken {
8
+ token?: string;
9
+ }
10
+ export interface AuthorizeRequest {
11
+ /** Tells the authorization server which grant to execute. */
12
+ responseType?: string;
13
+ /** The ID of the application that asks for authorization. */
14
+ clientId?: string;
15
+ /** Holds a URL. A successful response from this endpoint results in a redirect to this URL. */
16
+ redirectUri?: string | null;
17
+ /** A list of scopes that the application requires. */
18
+ scope?: Scope;
19
+ /** An opaque value, used for security purposes. If this request parameter is set in the request, then it is returned to the application as part of the redirect_uri. */
20
+ state?: string;
21
+ /** (Optional) How the result of the authorization request is formatted */
22
+ responseMode?: string | null;
23
+ /** PKCE hashed code */
24
+ codeChallenge?: string | null;
25
+ /** PKCE hashing method */
26
+ codeChallengeMethod?: string | null;
27
+ /** Current client session */
28
+ sessionToken?: string | null;
29
+ }
30
+ export interface Scope {
31
+ /** A list of permissions that the application requires. Empty list means the default list of scopes. */
32
+ ids?: string[];
33
+ }
34
+ export interface RawHttpResponse {
35
+ body?: Uint8Array;
36
+ statusCode?: number | null;
37
+ headers?: HeadersEntry[];
38
+ }
39
+ export interface HeadersEntry {
40
+ key?: string;
41
+ value?: string;
42
+ }
43
+ export interface TokenRequest extends TokenRequestGrantTypeOneOf {
44
+ /** Authorization code given at the authorize endpoint. */
45
+ authorizationCode?: AuthorizationCode;
46
+ /** Authorization code given at the authorize endpoint with the PKCE extention. */
47
+ pkce?: PKCE;
48
+ /** Device code given at the device code endpoint. */
49
+ deviceCode?: DeviceCode;
50
+ /** Refresh Token that was issued by this service beforehand. */
51
+ refreshToken?: RefreshToken;
52
+ /** Client credentials for authenticating a client */
53
+ clientCredentials?: ClientCredentials;
54
+ /** Granting a pre authenticated token for basic access. */
55
+ preAuthenticated?: PreAuthenticated;
56
+ }
57
+ /** @oneof */
58
+ export interface TokenRequestGrantTypeOneOf {
59
+ /** Authorization code given at the authorize endpoint. */
60
+ authorizationCode?: AuthorizationCode;
61
+ /** Authorization code given at the authorize endpoint with the PKCE extention. */
62
+ pkce?: PKCE;
63
+ /** Device code given at the device code endpoint. */
64
+ deviceCode?: DeviceCode;
65
+ /** Refresh Token that was issued by this service beforehand. */
66
+ refreshToken?: RefreshToken;
67
+ /** Client credentials for authenticating a client */
68
+ clientCredentials?: ClientCredentials;
69
+ /** Granting a pre authenticated token for basic access. */
70
+ preAuthenticated?: PreAuthenticated;
71
+ }
72
+ export interface AuthorizationCode {
73
+ code?: string;
74
+ }
75
+ export interface PKCE {
76
+ authorizationCode?: AuthorizationCode;
77
+ /** PKCE code */
78
+ code?: string | null;
79
+ }
80
+ export interface DeviceCode {
81
+ deviceCode?: string;
82
+ }
83
+ export interface ClientCredentials {
84
+ }
85
+ export interface PreAuthenticated {
86
+ clientId?: string;
87
+ }
88
+ export interface TokenResponse {
89
+ accessToken?: AccessToken;
90
+ refreshToken?: RefreshToken;
91
+ }
92
+ export interface AccessToken {
93
+ /** The access token string as issued by the authorization server. */
94
+ token?: string;
95
+ }
96
+ export interface DeviceCodeRequest {
97
+ /** The ID of the application that asks for authorization. */
98
+ clientId?: string;
99
+ /** A list of permissions that the application requires. Empty list means the default list of scopes. */
100
+ scope?: Scope;
101
+ }
102
+ export interface DeviceCodeResponse {
103
+ /** 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. */
104
+ deviceCode?: string;
105
+ /** contains the code that should be input at the verification_uri to authorize the device. */
106
+ userCode?: string;
107
+ /** contains the URL the user should visit to authorize the device. */
108
+ verificationUri?: string;
109
+ /** indicates the lifetime (in seconds) of the device_code and user_code. */
110
+ expiresIn?: number;
111
+ /** indicates the interval (in seconds) at which the app should poll the token URL to request a token. */
112
+ interval?: number;
113
+ }
114
+ export interface DeviceVerifyRequest {
115
+ /** User code representing a currently authorizing device. */
116
+ userCode?: string;
117
+ }
118
+ export interface DeviceVerifyResponse {
119
+ }
120
+ /** @public */
121
+ export declare function authorize(options?: AuthorizeOptions): Promise<RawHttpResponse>;
122
+ export interface AuthorizeOptions {
123
+ /** Tells the authorization server which grant to execute. */
124
+ responseType?: string;
125
+ /** The ID of the application that asks for authorization. */
126
+ clientId?: string;
127
+ /** Holds a URL. A successful response from this endpoint results in a redirect to this URL. */
128
+ redirectUri?: string | null;
129
+ /** A list of scopes that the application requires. */
130
+ scope?: Scope;
131
+ /** An opaque value, used for security purposes. If this request parameter is set in the request, then it is returned to the application as part of the redirect_uri. */
132
+ state?: string;
133
+ /** (Optional) How the result of the authorization request is formatted */
134
+ responseMode?: string | null;
135
+ /** PKCE hashed code */
136
+ codeChallenge?: string | null;
137
+ /** PKCE hashing method */
138
+ codeChallengeMethod?: string | null;
139
+ /** Current client session */
140
+ sessionToken?: string | null;
141
+ }
142
+ /** @public */
143
+ export declare function token(options?: TokenOptions): Promise<TokenResponse>;
144
+ export interface TokenOptions {
145
+ /** Authorization code given at the authorize endpoint. */
146
+ authorizationCode?: AuthorizationCode;
147
+ /** Authorization code given at the authorize endpoint with the PKCE extention. */
148
+ pkce?: PKCE;
149
+ /** Device code given at the device code endpoint. */
150
+ deviceCode?: DeviceCode;
151
+ /** Refresh Token that was issued by this service beforehand. */
152
+ refreshToken?: RefreshToken;
153
+ /** Client credentials for authenticating a client */
154
+ clientCredentials?: ClientCredentials;
155
+ /** Granting a pre authenticated token for basic access. */
156
+ preAuthenticated?: PreAuthenticated;
157
+ }
158
+ /**
159
+ * this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf
160
+ * @public */
161
+ export declare function deviceCode(options?: DeviceCodeOptions): Promise<DeviceCodeResponse>;
162
+ export interface DeviceCodeOptions {
163
+ /** The ID of the application that asks for authorization. */
164
+ clientId?: string;
165
+ /** A list of permissions that the application requires. Empty list means the default list of scopes. */
166
+ scope?: Scope;
167
+ }
168
+ /**
169
+ * this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf
170
+ * @public */
171
+ export declare function deviceVerify(options?: DeviceVerifyOptions): Promise<void>;
172
+ export interface DeviceVerifyOptions {
173
+ /** User code representing a currently authorizing device. */
174
+ userCode?: string;
175
+ }