@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.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +24 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.http.d.ts +8 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.http.js +105 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.http.js.map +1 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.public.d.ts +7 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.public.js +29 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.public.js.map +1 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.types.d.ts +113 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.types.js +3 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.types.js.map +1 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.universal.d.ts +175 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js +261 -0
- package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/identity-oauth-v1-refresh-token.http.d.ts +8 -0
- package/build/es/src/identity-oauth-v1-refresh-token.http.js +98 -0
- package/build/es/src/identity-oauth-v1-refresh-token.http.js.map +1 -0
- package/build/es/src/identity-oauth-v1-refresh-token.public.d.ts +7 -0
- package/build/es/src/identity-oauth-v1-refresh-token.public.js +22 -0
- package/build/es/src/identity-oauth-v1-refresh-token.public.js.map +1 -0
- package/build/es/src/identity-oauth-v1-refresh-token.types.d.ts +113 -0
- package/build/es/src/identity-oauth-v1-refresh-token.types.js +2 -0
- package/build/es/src/identity-oauth-v1-refresh-token.types.js.map +1 -0
- package/build/es/src/identity-oauth-v1-refresh-token.universal.d.ts +175 -0
- package/build/es/src/identity-oauth-v1-refresh-token.universal.js +235 -0
- package/build/es/src/identity-oauth-v1-refresh-token.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,261 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.deviceVerify = exports.deviceCode = exports.token = exports.authorize = exports.__debug = void 0;
|
|
32
|
+
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
+
const ambassadorWixIdentityOauthV1RefreshToken = __importStar(require("./identity-oauth-v1-refresh-token.http"));
|
|
34
|
+
let __verbose = false;
|
|
35
|
+
function __log(...args) {
|
|
36
|
+
__verbose && console.log(...args);
|
|
37
|
+
}
|
|
38
|
+
function __inspect(obj) {
|
|
39
|
+
return obj;
|
|
40
|
+
}
|
|
41
|
+
exports.__debug = {
|
|
42
|
+
verboseLogging: {
|
|
43
|
+
on: () => (__verbose = true),
|
|
44
|
+
off: () => (__verbose = false),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const _toVeloEntity = '$';
|
|
48
|
+
const _fromVeloEntity = '$';
|
|
49
|
+
const _authorizeRequest = {};
|
|
50
|
+
const _deviceCodeRequest = {};
|
|
51
|
+
const _deviceCodeResponse = {};
|
|
52
|
+
const _deviceVerifyRequest = {};
|
|
53
|
+
const _deviceVerifyResponse = {};
|
|
54
|
+
const _rawHttpResponse = {};
|
|
55
|
+
const _tokenRequest = {};
|
|
56
|
+
const _tokenResponse = {};
|
|
57
|
+
/** @public */
|
|
58
|
+
function authorize(options) {
|
|
59
|
+
var _a, _b, _c;
|
|
60
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
61
|
+
const requestTransformation = {
|
|
62
|
+
responseType: '$[0].responseType',
|
|
63
|
+
clientId: '$[0].clientId',
|
|
64
|
+
redirectUri: '$[0].redirectUri',
|
|
65
|
+
scope: '$[0].scope',
|
|
66
|
+
state: '$[0].state',
|
|
67
|
+
responseMode: '$[0].responseMode',
|
|
68
|
+
codeChallenge: '$[0].codeChallenge',
|
|
69
|
+
codeChallengeMethod: '$[0].codeChallengeMethod',
|
|
70
|
+
sessionToken: '$[0].sessionToken',
|
|
71
|
+
};
|
|
72
|
+
const responseTransformation = '$';
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
75
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
76
|
+
rootSchema: _authorizeRequest,
|
|
77
|
+
depSchemas: {},
|
|
78
|
+
fqdnTransformation: {
|
|
79
|
+
paths: [],
|
|
80
|
+
transformation: _fromVeloEntity,
|
|
81
|
+
},
|
|
82
|
+
customTransformation: requestTransformation,
|
|
83
|
+
});
|
|
84
|
+
const { fromJSON } = velo_1.serializer({
|
|
85
|
+
rootSchema: _rawHttpResponse,
|
|
86
|
+
depSchemas: {},
|
|
87
|
+
fqdnTransformation: {
|
|
88
|
+
paths: [],
|
|
89
|
+
transformation: _toVeloEntity,
|
|
90
|
+
},
|
|
91
|
+
customTransformation: responseTransformation,
|
|
92
|
+
});
|
|
93
|
+
const payload = toAmbassadorRequest([options]);
|
|
94
|
+
const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.authorize(payload);
|
|
95
|
+
__log(`"Authorize" sending request with: ${__inspect(reqOpts)}`);
|
|
96
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
97
|
+
try {
|
|
98
|
+
const result = yield httpClient.request(reqOpts);
|
|
99
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
100
|
+
return fromJSON(result.data);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
104
|
+
'options',
|
|
105
|
+
]);
|
|
106
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
107
|
+
throw transformedError;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.authorize = authorize;
|
|
112
|
+
/** @public */
|
|
113
|
+
function token(options) {
|
|
114
|
+
var _a, _b, _c;
|
|
115
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
116
|
+
const requestTransformation = {
|
|
117
|
+
authorizationCode: '$[0].authorizationCode',
|
|
118
|
+
pkce: '$[0].pkce',
|
|
119
|
+
deviceCode: '$[0].deviceCode',
|
|
120
|
+
refreshToken: '$[0].refreshToken',
|
|
121
|
+
clientCredentials: '$[0].clientCredentials',
|
|
122
|
+
preAuthenticated: '$[0].preAuthenticated',
|
|
123
|
+
};
|
|
124
|
+
const responseTransformation = '$';
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
127
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
128
|
+
rootSchema: _tokenRequest,
|
|
129
|
+
depSchemas: {},
|
|
130
|
+
fqdnTransformation: {
|
|
131
|
+
paths: [...['refreshToken']],
|
|
132
|
+
transformation: _fromVeloEntity,
|
|
133
|
+
},
|
|
134
|
+
customTransformation: requestTransformation,
|
|
135
|
+
});
|
|
136
|
+
const { fromJSON } = velo_1.serializer({
|
|
137
|
+
rootSchema: _tokenResponse,
|
|
138
|
+
depSchemas: {},
|
|
139
|
+
fqdnTransformation: {
|
|
140
|
+
paths: [...['refreshToken']],
|
|
141
|
+
transformation: _toVeloEntity,
|
|
142
|
+
},
|
|
143
|
+
customTransformation: responseTransformation,
|
|
144
|
+
});
|
|
145
|
+
const payload = toAmbassadorRequest([options]);
|
|
146
|
+
const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.token(payload);
|
|
147
|
+
__log(`"Token" sending request with: ${__inspect(reqOpts)}`);
|
|
148
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
149
|
+
try {
|
|
150
|
+
const result = yield httpClient.request(reqOpts);
|
|
151
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
152
|
+
return fromJSON(result.data);
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
156
|
+
'options',
|
|
157
|
+
]);
|
|
158
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
159
|
+
throw transformedError;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
exports.token = token;
|
|
164
|
+
/**
|
|
165
|
+
* this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf
|
|
166
|
+
* @public */
|
|
167
|
+
function deviceCode(options) {
|
|
168
|
+
var _a, _b, _c;
|
|
169
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
170
|
+
const requestTransformation = {
|
|
171
|
+
clientId: '$[0].clientId',
|
|
172
|
+
scope: '$[0].scope',
|
|
173
|
+
};
|
|
174
|
+
const responseTransformation = '$';
|
|
175
|
+
// @ts-ignore
|
|
176
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
177
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
178
|
+
rootSchema: _deviceCodeRequest,
|
|
179
|
+
depSchemas: {},
|
|
180
|
+
fqdnTransformation: {
|
|
181
|
+
paths: [],
|
|
182
|
+
transformation: _fromVeloEntity,
|
|
183
|
+
},
|
|
184
|
+
customTransformation: requestTransformation,
|
|
185
|
+
});
|
|
186
|
+
const { fromJSON } = velo_1.serializer({
|
|
187
|
+
rootSchema: _deviceCodeResponse,
|
|
188
|
+
depSchemas: {},
|
|
189
|
+
fqdnTransformation: {
|
|
190
|
+
paths: [],
|
|
191
|
+
transformation: _toVeloEntity,
|
|
192
|
+
},
|
|
193
|
+
customTransformation: responseTransformation,
|
|
194
|
+
});
|
|
195
|
+
const payload = toAmbassadorRequest([options]);
|
|
196
|
+
const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.deviceCode(payload);
|
|
197
|
+
__log(`"DeviceCode" sending request with: ${__inspect(reqOpts)}`);
|
|
198
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
199
|
+
try {
|
|
200
|
+
const result = yield httpClient.request(reqOpts);
|
|
201
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
202
|
+
return fromJSON(result.data);
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
206
|
+
'options',
|
|
207
|
+
]);
|
|
208
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
209
|
+
throw transformedError;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
exports.deviceCode = deviceCode;
|
|
214
|
+
/**
|
|
215
|
+
* this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf
|
|
216
|
+
* @public */
|
|
217
|
+
function deviceVerify(options) {
|
|
218
|
+
var _a, _b, _c;
|
|
219
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
220
|
+
const requestTransformation = { userCode: '$[0].userCode' };
|
|
221
|
+
const responseTransformation = '$';
|
|
222
|
+
// @ts-ignore
|
|
223
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
224
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
225
|
+
rootSchema: _deviceVerifyRequest,
|
|
226
|
+
depSchemas: {},
|
|
227
|
+
fqdnTransformation: {
|
|
228
|
+
paths: [],
|
|
229
|
+
transformation: _fromVeloEntity,
|
|
230
|
+
},
|
|
231
|
+
customTransformation: requestTransformation,
|
|
232
|
+
});
|
|
233
|
+
const { fromJSON } = velo_1.serializer({
|
|
234
|
+
rootSchema: _deviceVerifyResponse,
|
|
235
|
+
depSchemas: {},
|
|
236
|
+
fqdnTransformation: {
|
|
237
|
+
paths: [],
|
|
238
|
+
transformation: _toVeloEntity,
|
|
239
|
+
},
|
|
240
|
+
customTransformation: responseTransformation,
|
|
241
|
+
});
|
|
242
|
+
const payload = toAmbassadorRequest([options]);
|
|
243
|
+
const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.deviceVerify(payload);
|
|
244
|
+
__log(`"DeviceVerify" sending request with: ${__inspect(reqOpts)}`);
|
|
245
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
246
|
+
try {
|
|
247
|
+
const result = yield httpClient.request(reqOpts);
|
|
248
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
249
|
+
return fromJSON(result.data);
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
253
|
+
'options',
|
|
254
|
+
]);
|
|
255
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
256
|
+
throw transformedError;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
exports.deviceVerify = deviceVerify;
|
|
261
|
+
//# sourceMappingURL=identity-oauth-v1-refresh-token.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-oauth-v1-refresh-token.universal.js","sourceRoot":"","sources":["../../../src/identity-oauth-v1-refresh-token.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,iHAAmG;AAEnG,IAAI,SAAS,GAAG,KA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H,MAAM,EAAE,QAAQ,EAAE,GAAG,iBAAU,CAAC;YAC9B,UAAU,EAAE,qBAAqB;YACjC,UAAU,EAAE,EAAE;YACd,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAE;gBACT,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAE/C,MAAM,OAAO,GACX,wCAAwC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAEjE,KAAK,CAAC,wCAAwC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEpE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,qBAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AArDD,oCAqDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as oauth from './src/identity-oauth-v1-refresh-token.public';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,8CAA8C,CAAC"}
|
|
@@ -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,98 @@
|
|
|
1
|
+
import { toURLSearchParams } from '@wix/metro-runtime';
|
|
2
|
+
import { serializer } from '@wix/metro-runtime/ambassador';
|
|
3
|
+
import { resolveUrl } from '@wix/metro-runtime';
|
|
4
|
+
const _authorizeRequest = {};
|
|
5
|
+
const _deviceCodeRequest = {};
|
|
6
|
+
const _deviceCodeResponse = {};
|
|
7
|
+
const _deviceVerifyRequest = {};
|
|
8
|
+
const _deviceVerifyResponse = {};
|
|
9
|
+
const _rawHttpResponse = { body: 'BYTES' };
|
|
10
|
+
const _tokenRequest = {};
|
|
11
|
+
const _tokenResponse = {};
|
|
12
|
+
function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
|
|
13
|
+
const domainToMappings = {};
|
|
14
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
15
|
+
}
|
|
16
|
+
export function authorize(payload) {
|
|
17
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_authorizeRequest, {});
|
|
18
|
+
const { fromJSON: fromRes } = serializer(_rawHttpResponse, {});
|
|
19
|
+
function __authorize({ host }) {
|
|
20
|
+
const serializedData = toReq(payload);
|
|
21
|
+
const metadata = {
|
|
22
|
+
method: 'GET',
|
|
23
|
+
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
24
|
+
protoPath: '/v1/oauth/authorize',
|
|
25
|
+
data: serializedData,
|
|
26
|
+
host,
|
|
27
|
+
}),
|
|
28
|
+
params: toURLSearchParams(serializedData),
|
|
29
|
+
transformResponse: fromRes,
|
|
30
|
+
};
|
|
31
|
+
return metadata;
|
|
32
|
+
}
|
|
33
|
+
__authorize.fromReq = fromReq;
|
|
34
|
+
return __authorize;
|
|
35
|
+
}
|
|
36
|
+
export function token(payload) {
|
|
37
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_tokenRequest, {});
|
|
38
|
+
const { fromJSON: fromRes } = serializer(_tokenResponse, {});
|
|
39
|
+
function __token({ host }) {
|
|
40
|
+
const serializedData = toReq(payload);
|
|
41
|
+
const metadata = {
|
|
42
|
+
method: 'GET',
|
|
43
|
+
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
44
|
+
protoPath: '/v1/oauth/token',
|
|
45
|
+
data: serializedData,
|
|
46
|
+
host,
|
|
47
|
+
}),
|
|
48
|
+
params: toURLSearchParams(serializedData),
|
|
49
|
+
transformResponse: fromRes,
|
|
50
|
+
};
|
|
51
|
+
return metadata;
|
|
52
|
+
}
|
|
53
|
+
__token.fromReq = fromReq;
|
|
54
|
+
return __token;
|
|
55
|
+
}
|
|
56
|
+
/** this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf */
|
|
57
|
+
export function deviceCode(payload) {
|
|
58
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_deviceCodeRequest, {});
|
|
59
|
+
const { fromJSON: fromRes } = serializer(_deviceCodeResponse, {});
|
|
60
|
+
function __deviceCode({ host }) {
|
|
61
|
+
const serializedData = toReq(payload);
|
|
62
|
+
const metadata = {
|
|
63
|
+
method: 'GET',
|
|
64
|
+
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
65
|
+
protoPath: '/v1/oauth/device/code',
|
|
66
|
+
data: serializedData,
|
|
67
|
+
host,
|
|
68
|
+
}),
|
|
69
|
+
params: toURLSearchParams(serializedData),
|
|
70
|
+
transformResponse: fromRes,
|
|
71
|
+
};
|
|
72
|
+
return metadata;
|
|
73
|
+
}
|
|
74
|
+
__deviceCode.fromReq = fromReq;
|
|
75
|
+
return __deviceCode;
|
|
76
|
+
}
|
|
77
|
+
/** this endpoint serves the Device Authorization Flow as described in https://www.rfc-editor.org/rfc/pdfrfc/rfc8628.txt.pdf */
|
|
78
|
+
export function deviceVerify(payload) {
|
|
79
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_deviceVerifyRequest, {});
|
|
80
|
+
const { fromJSON: fromRes } = serializer(_deviceVerifyResponse, {});
|
|
81
|
+
function __deviceVerify({ host }) {
|
|
82
|
+
const serializedData = toReq(payload);
|
|
83
|
+
const metadata = {
|
|
84
|
+
method: 'GET',
|
|
85
|
+
url: resolveWixIdentityOauth2V1Oauth2NgUrl({
|
|
86
|
+
protoPath: '/v1/oauth/device/verify',
|
|
87
|
+
data: serializedData,
|
|
88
|
+
host,
|
|
89
|
+
}),
|
|
90
|
+
params: toURLSearchParams(serializedData),
|
|
91
|
+
transformResponse: fromRes,
|
|
92
|
+
};
|
|
93
|
+
return metadata;
|
|
94
|
+
}
|
|
95
|
+
__deviceVerify.fromReq = fromReq;
|
|
96
|
+
return __deviceVerify;
|
|
97
|
+
}
|
|
98
|
+
//# 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":"AA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AAM,EAAE,KAAY;YACpB,GAAG,EAAE,qCAAqC,CAAC;gBACzC,SAAS,EAAE,uBAAuB;gBAClC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,MAAM,EAAE,iBAAiB,CAAC,cAAc,CAAC;YACzC,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IAE/B,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,+HAA+H;AAC/H,MAAM,UAAU,YAAY,CAC1B,OAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CACrD,oBAAoB,EACpB,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAEpE,SAAS,cAAc,CAAC,EAAE,IAAI,EAAO;QACnC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,MAAM,EAAE,KAAY;YACpB,GAAG,EAAE,qCAAqC,CAAC;gBACzC,SAAS,EAAE,yBAAyB;gBACpC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,MAAM,EAAE,iBAAiB,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"}
|
|
@@ -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,22 @@
|
|
|
1
|
+
import { authorize as universalAuthorize, token as universalToken, deviceCode as universalDeviceCode, deviceVerify as universalDeviceVerify, } from './identity-oauth-v1-refresh-token.universal';
|
|
2
|
+
export function authorize(httpClient) {
|
|
3
|
+
return (options) => universalAuthorize(options,
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
{ httpClient });
|
|
6
|
+
}
|
|
7
|
+
export function token(httpClient) {
|
|
8
|
+
return (options) => universalToken(options,
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
{ httpClient });
|
|
11
|
+
}
|
|
12
|
+
export function deviceCode(httpClient) {
|
|
13
|
+
return (options) => universalDeviceCode(options,
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
{ httpClient });
|
|
16
|
+
}
|
|
17
|
+
export function deviceVerify(httpClient) {
|
|
18
|
+
return (options) => universalDeviceVerify(options,
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
{ httpClient });
|
|
21
|
+
}
|
|
22
|
+
//# 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,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,KAAK,IAAI,cAAc,EACvB,UAAU,IAAI,mBAAmB,EACjC,YAAY,IAAI,qBAAqB,GAKtC,MAAM,6CAA6C,CAAC;AAErD,MAAM,UAAU,SAAS,CAAC,UAAsB;IAC9C,OAAO,CAAC,OAA0B,EAAE,EAAE,CACpC,kBAAkB,CAChB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,UAAsB;IAC1C,OAAO,CAAC,OAAsB,EAAE,EAAE,CAChC,cAAc,CACZ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,UAAsB;IAC/C,OAAO,CAAC,OAA2B,EAAE,EAAE,CACrC,mBAAmB,CACjB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAAsB;IACjD,OAAO,CAAC,OAA6B,EAAE,EAAE,CACvC,qBAAqB,CACnB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"identity-oauth-v1-refresh-token.types.js","sourceRoot":"","sources":["../../../src/identity-oauth-v1-refresh-token.types.ts"],"names":[],"mappings":""}
|