@api-client/core 0.8.1 → 0.8.2
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/browser.d.ts +3 -3
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +3 -3
- package/build/index.js.map +1 -1
- package/build/oauth-popup.html +29 -0
- package/build/src/amf/AmfShapeGenerator.d.ts +2 -0
- package/build/src/amf/AmfShapeGenerator.js +2 -0
- package/build/src/amf/AmfShapeGenerator.js.map +1 -1
- package/build/src/amf/ApiSchemaValues.d.ts +4 -4
- package/build/src/amf/ApiSchemaValues.js.map +1 -1
- package/build/src/amf/Utils.js +3 -1
- package/build/src/amf/Utils.js.map +1 -1
- package/build/src/amf/data-node/XmlDataNodeGenerator.js +2 -1
- package/build/src/amf/data-node/XmlDataNodeGenerator.js.map +1 -1
- package/build/src/amf/shape/ShapeBase.d.ts +1 -1
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.js +4 -2
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +1 -1
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts +13 -13
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js +25 -7
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +1 -1
- package/build/src/authorization/OAuth2Authorization.d.ts +4 -4
- package/build/src/authorization/OAuth2Authorization.js +7 -7
- package/build/src/authorization/OAuth2Authorization.js.map +1 -1
- package/build/src/authorization/OidcAuthorization.js +0 -1
- package/build/src/authorization/OidcAuthorization.js.map +1 -1
- package/build/src/data/XmlReader.js +2 -0
- package/build/src/data/XmlReader.js.map +1 -1
- package/build/src/events/CustomEvent.d.ts +1 -1
- package/build/src/events/CustomEvent.js +1 -1
- package/build/src/lib/logging/DefaultLogger.js +1 -0
- package/build/src/lib/logging/DefaultLogger.js.map +1 -1
- package/build/src/lib/parsers/UriTemplate.js +1 -1
- package/build/src/lib/parsers/UrlEncoder.js +1 -0
- package/build/src/lib/parsers/UrlEncoder.js.map +1 -1
- package/build/src/mocking/LegacyInterfaces.d.ts +1 -2
- package/build/src/mocking/LegacyMock.js +0 -1
- package/build/src/mocking/LegacyMock.js.map +1 -1
- package/build/src/mocking/legacy/Http.js +1 -1
- package/build/src/mocking/legacy/Http.js.map +1 -1
- package/build/src/models/data/DataNamespace.d.ts +0 -1
- package/build/src/models/data/DataNamespace.js +1 -1
- package/build/src/models/data/DataNamespace.js.map +1 -1
- package/build/src/models/store/Permission.js.map +1 -1
- package/build/src/models/transformers/ArcLegacyTransformer.js +1 -0
- package/build/src/models/transformers/ArcLegacyTransformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV21Transformer.d.ts +1 -2
- package/build/src/models/transformers/PostmanV21Transformer.js +2 -0
- package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV2Transformer.js +2 -0
- package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
- package/build/src/runtime/store/AuthSdk.js +1 -0
- package/build/src/runtime/store/AuthSdk.js.map +1 -1
- package/build/src/runtime/store/SdkBase.js.map +1 -1
- package/build/src/testing/TestCliHelper.js.map +1 -1
- package/data/apis/APIC-187/APIC-187.raml +21 -0
- package/data/apis/APIC-187/dataType.raml +132 -0
- package/data/apis/APIC-187/example.raml +84 -0
- package/data/apis/APIC-188/APIC-188.raml +21 -0
- package/data/apis/APIC-188/dataType.raml +132 -0
- package/data/apis/APIC-188/example.raml +84 -0
- package/data/apis/APIC-233/APIC-233.raml +15 -0
- package/data/apis/APIC-391/APIC-391.raml +44 -0
- package/data/apis/APIC-391/examples/post-body-request-example.raml +7 -0
- package/data/apis/APIC-487/APIC-487.raml +36 -0
- package/data/apis/APIC-655/APIC-655.raml +44 -0
- package/data/apis/APIC-655/delivery.json +12 -0
- package/data/apis/APIC-689/APIC-689.raml +20 -0
- package/data/apis/APIC-690/APIC-690.raml +17 -0
- package/data/apis/APIC-690/datatypes/Address.raml +10 -0
- package/data/apis/APIC-690/datatypes/Customer.raml +17 -0
- package/data/apis/APIC-690/examples/CustomerExample2.raml +17 -0
- package/data/apis/APIC-690/examples/CustomersExample.raml +34 -0
- package/data/apis/SE-10469/Purchase-Order-oagis-id-dd32f9c6c01048a19e15c423c9c741ae.json +1383 -0
- package/data/apis/SE-10469/SE-10469.raml +11 -0
- package/data/apis/SE-13092/Examples/PersonExample.raml +7 -0
- package/data/apis/SE-13092/SE-13092.raml +37 -0
- package/data/apis/SE-13092/datatypes/Address.raml +5 -0
- package/data/apis/SE-13092/datatypes/InlineType.raml +5 -0
- package/data/apis/SE-13092/datatypes/Person.raml +15 -0
- package/data/apis/SE-22063/SE-22063.raml +14 -0
- package/data/apis/SE-22063/stock.raml +41 -0
- package/data/apis/example-generator-api/contact-email-example.raml +6 -0
- package/data/apis/example-generator-api/contact-example.raml +5 -0
- package/data/apis/example-generator-api/contact-fax-example.raml +5 -0
- package/data/apis/example-generator-api/contact-website-example.raml +2 -0
- package/data/apis/example-generator-api/example-1.raml +6 -0
- package/data/apis/example-generator-api/example-2.raml +9 -0
- package/data/apis/example-generator-api/example-3.raml +4 -0
- package/data/apis/example-generator-api/example-4.raml +2 -0
- package/data/apis/example-generator-api/example-5.raml +4 -0
- package/data/apis/example-generator-api/example-6.raml +2 -0
- package/data/apis/example-generator-api/example-7.raml +5 -0
- package/data/apis/example-generator-api/example-generator-api.raml +423 -0
- package/data/apis/example-generator-api/example.json +14 -0
- package/data/apis/example-generator-api/example.xml +15 -0
- package/data/apis/example-generator-api/example.xsd +26 -0
- package/data/apis/example-generator-api/examples/employee.raml +7 -0
- package/data/apis/example-generator-api/examples/employees.raml +7 -0
- package/data/apis/example-generator-api/linked-named-example.raml +21 -0
- package/data/apis/example-generator-api/named-example-with-link.raml +5 -0
- package/data/apis/example-generator-api/named-example.raml +9 -0
- package/data/apis/example-generator-api/user-json-example.raml +17 -0
- package/data/apis/example-generator-api/user-raml-example.raml +37 -0
- package/data/apis/example-generator-api/user.json +8 -0
- package/data/apis/example-generator-api/user.raml +18 -0
- package/data/apis/example-generator-api/users-json-example.raml +17 -0
- package/data/apis/example-generator-api/users-raml-example.raml +32 -0
- package/data/apis/example-generator-api/users.json +8 -0
- package/data/apis/schema-api/schema-api.raml +13 -1
- package/data/apis/tracked-examples/datatypes/employee.raml +5 -0
- package/data/apis/tracked-examples/examples/employee.raml +4 -0
- package/data/apis/tracked-examples/examples/employees.raml +8 -0
- package/data/apis/tracked-examples/tracked-to-linked.raml +28 -0
- package/data/model.js +14 -0
- package/data/models/APIC-187.json +11398 -0
- package/data/models/APIC-188.json +11398 -0
- package/data/models/APIC-233.json +539 -0
- package/data/models/APIC-391.json +1872 -0
- package/data/models/APIC-487.json +1225 -0
- package/data/models/APIC-655.json +3109 -0
- package/data/models/APIC-689.json +761 -0
- package/data/models/APIC-690.json +5992 -0
- package/data/models/SE-10469.json +22882 -0
- package/data/models/SE-13092.json +2715 -0
- package/data/models/SE-22063.json +2276 -0
- package/data/models/example-generator-api.json +44978 -0
- package/data/models/schema-api.json +436 -428
- package/data/models/tracked-to-linked.json +1790 -0
- package/package.json +6 -5
- package/src/amf/AmfShapeGenerator.ts +5 -3
- package/src/amf/ApiSchemaValues.ts +5 -5
- package/src/amf/Utils.ts +6 -4
- package/src/amf/data-node/XmlDataNodeGenerator.ts +2 -1
- package/src/amf/shape/ShapeBase.ts +1 -1
- package/src/amf/shape/ShapeJsonSchemaGenerator.ts +4 -2
- package/src/amf/shape/ShapeXmlSchemaGenerator.ts +85 -66
- package/src/authorization/OAuth2Authorization.ts +33 -32
- package/src/authorization/OidcAuthorization.ts +3 -4
- package/src/data/XmlReader.ts +7 -5
- package/src/events/CustomEvent.ts +1 -1
- package/src/lib/logging/DefaultLogger.ts +1 -0
- package/src/lib/parsers/UriTemplate.ts +1 -1
- package/src/lib/parsers/UrlEncoder.ts +1 -0
- package/src/mocking/LegacyInterfaces.ts +1 -2
- package/src/mocking/LegacyMock.ts +0 -1
- package/src/mocking/legacy/Http.ts +1 -1
- package/src/models/data/DataNamespace.ts +2 -2
- package/src/models/store/Permission.ts +1 -1
- package/src/models/transformers/ArcLegacyTransformer.ts +1 -0
- package/src/models/transformers/PostmanV21Transformer.ts +3 -2
- package/src/models/transformers/PostmanV2Transformer.ts +2 -0
- package/src/runtime/store/AuthSdk.ts +1 -0
- package/src/runtime/store/SdkBase.ts +1 -0
- package/src/testing/TestCliHelper.ts +1 -0
|
@@ -82,7 +82,7 @@ export class OAuth2Authorization {
|
|
|
82
82
|
if (!this[stateValue]) {
|
|
83
83
|
this[stateValue] = this.settings.state || randomString();
|
|
84
84
|
}
|
|
85
|
-
return this[stateValue]
|
|
85
|
+
return this[stateValue] as string;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -172,8 +172,8 @@ export class OAuth2Authorization {
|
|
|
172
172
|
*
|
|
173
173
|
* This operation clears the promise object.
|
|
174
174
|
*
|
|
175
|
-
* @param
|
|
176
|
-
* @param
|
|
175
|
+
* @param message The message to report
|
|
176
|
+
* @param code Error code
|
|
177
177
|
*/
|
|
178
178
|
[reportOAuthError](message: string, code: string): void {
|
|
179
179
|
this.clearObservers();
|
|
@@ -195,6 +195,7 @@ export class OAuth2Authorization {
|
|
|
195
195
|
/**
|
|
196
196
|
* Starts the authorization process.
|
|
197
197
|
*/
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures
|
|
198
199
|
[authorize](): void {
|
|
199
200
|
const { settings } = this;
|
|
200
201
|
switch (settings.grantType) {
|
|
@@ -261,13 +262,13 @@ export class OAuth2Authorization {
|
|
|
261
262
|
*/
|
|
262
263
|
async buildPopupUrlParams(): Promise<URL | null> {
|
|
263
264
|
const { settings } = this;
|
|
264
|
-
const type = (settings.responseType || grantResponseMapping[settings.grantType
|
|
265
|
+
const type = (settings.responseType || grantResponseMapping[settings.grantType as string]);
|
|
265
266
|
if (!type) {
|
|
266
267
|
return null;
|
|
267
268
|
}
|
|
268
|
-
const url = new URL(settings.authorizationUri
|
|
269
|
+
const url = new URL(settings.authorizationUri as string);
|
|
269
270
|
url.searchParams.set('response_type', type);
|
|
270
|
-
url.searchParams.set('client_id', settings.clientId
|
|
271
|
+
url.searchParams.set('client_id', settings.clientId as string);
|
|
271
272
|
// Client secret cannot be ever exposed to the client (browser)!
|
|
272
273
|
// if (settings.clientSecret) {
|
|
273
274
|
// url.searchParams.set('client_secret', settings.clientSecret);
|
|
@@ -294,7 +295,7 @@ export class OAuth2Authorization {
|
|
|
294
295
|
}
|
|
295
296
|
if (settings.pkce && String(type).includes('code')) {
|
|
296
297
|
this[codeVerifierValue] = randomString();
|
|
297
|
-
const challenge = await generateCodeChallenge(this[codeVerifierValue]
|
|
298
|
+
const challenge = await generateCodeChallenge(this[codeVerifierValue] as string);
|
|
298
299
|
url.searchParams.set('code_challenge', challenge);
|
|
299
300
|
url.searchParams.set('code_challenge_method', 'S256');
|
|
300
301
|
}
|
|
@@ -421,8 +422,8 @@ export class OAuth2Authorization {
|
|
|
421
422
|
try {
|
|
422
423
|
params = new URLSearchParams(raw);
|
|
423
424
|
} catch (e) {
|
|
424
|
-
|
|
425
|
-
this[reportOAuthError]('Invalid response from the redirect page');
|
|
425
|
+
|
|
426
|
+
this[reportOAuthError]('Invalid response from the redirect page', 'invalid_redirect');
|
|
426
427
|
return;
|
|
427
428
|
}
|
|
428
429
|
if (this.validateTokenResponse(params)) {
|
|
@@ -465,7 +466,6 @@ export class OAuth2Authorization {
|
|
|
465
466
|
}
|
|
466
467
|
if (oauthParams.has('error')) {
|
|
467
468
|
const args = this.createTokenResponseError(oauthParams);
|
|
468
|
-
// @ts-ignore
|
|
469
469
|
this[reportOAuthError](...args);
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
@@ -499,9 +499,9 @@ export class OAuth2Authorization {
|
|
|
499
499
|
* Processes the response returned by the popup or the iframe.
|
|
500
500
|
* @returns Parameters for the [reportOAuthError]() function
|
|
501
501
|
*/
|
|
502
|
-
createTokenResponseError(oauthParams: URLSearchParams): string
|
|
503
|
-
const code = oauthParams.get('error')
|
|
504
|
-
const message = oauthParams.get('error_description')
|
|
502
|
+
createTokenResponseError(oauthParams: URLSearchParams): [string, string] {
|
|
503
|
+
const code = oauthParams.get('error') as string;
|
|
504
|
+
const message = oauthParams.get('error_description') as string;
|
|
505
505
|
return this[createErrorParams](code, message);
|
|
506
506
|
}
|
|
507
507
|
|
|
@@ -511,7 +511,7 @@ export class OAuth2Authorization {
|
|
|
511
511
|
* @param description Returned from the authorization server error description
|
|
512
512
|
* @returns Parameters for the [reportOAuthError]() function
|
|
513
513
|
*/
|
|
514
|
-
[createErrorParams](code: string, description?: string): string
|
|
514
|
+
[createErrorParams](code: string, description?: string): [string, string] {
|
|
515
515
|
let message;
|
|
516
516
|
if (description) {
|
|
517
517
|
message = description;
|
|
@@ -549,21 +549,22 @@ export class OAuth2Authorization {
|
|
|
549
549
|
* Creates a token info object from query parameters
|
|
550
550
|
*/
|
|
551
551
|
[tokenInfoFromParams](oauthParams: URLSearchParams): ITokenInfo {
|
|
552
|
-
const accessToken = oauthParams.get('access_token')
|
|
553
|
-
const idToken = oauthParams.get('id_token')
|
|
554
|
-
const refreshToken = oauthParams.get('refresh_token')
|
|
555
|
-
const tokenType = oauthParams.get('token_type')
|
|
556
|
-
const expiresIn = Number(oauthParams.get('expires_in')
|
|
557
|
-
const scope = this[computeTokenInfoScopes](oauthParams.get('scope')
|
|
552
|
+
const accessToken = oauthParams.get('access_token') as string;
|
|
553
|
+
const idToken = oauthParams.get('id_token') as string;
|
|
554
|
+
const refreshToken = oauthParams.get('refresh_token') as string;
|
|
555
|
+
const tokenType = oauthParams.get('token_type') as string;
|
|
556
|
+
const expiresIn = Number(oauthParams.get('expires_in') as string);
|
|
557
|
+
const scope = this[computeTokenInfoScopes](oauthParams.get('scope') as string);
|
|
558
558
|
const tokenInfo: ITokenInfo = {
|
|
559
559
|
accessToken,
|
|
560
560
|
// FIXME: This should be set in the OIDC class.
|
|
561
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
561
562
|
// @ts-ignore
|
|
562
563
|
idToken,
|
|
563
564
|
refreshToken,
|
|
564
565
|
tokenType,
|
|
565
566
|
expiresIn,
|
|
566
|
-
state: oauthParams.get('state')
|
|
567
|
+
state: oauthParams.get('state') as string,
|
|
567
568
|
scope,
|
|
568
569
|
expiresAt: 0,
|
|
569
570
|
expiresAssumed: false,
|
|
@@ -635,7 +636,7 @@ export class OAuth2Authorization {
|
|
|
635
636
|
*/
|
|
636
637
|
async getCodeInfo(code: string): Promise<Record<string, any>> {
|
|
637
638
|
const body = this.getCodeRequestBody(code);
|
|
638
|
-
const url = this.settings.accessTokenUri
|
|
639
|
+
const url = this.settings.accessTokenUri as string;
|
|
639
640
|
return this.requestTokenInfo(url, body);
|
|
640
641
|
}
|
|
641
642
|
|
|
@@ -770,7 +771,7 @@ export class OAuth2Authorization {
|
|
|
770
771
|
const { settings } = this;
|
|
771
772
|
const params = new URLSearchParams();
|
|
772
773
|
params.set('grant_type', 'authorization_code');
|
|
773
|
-
params.set('client_id', settings.clientId
|
|
774
|
+
params.set('client_id', settings.clientId as string);
|
|
774
775
|
if (settings.redirectUri) {
|
|
775
776
|
params.set('redirect_uri', settings.redirectUri);
|
|
776
777
|
}
|
|
@@ -781,7 +782,7 @@ export class OAuth2Authorization {
|
|
|
781
782
|
params.set('client_secret', '');
|
|
782
783
|
}
|
|
783
784
|
if (settings.pkce) {
|
|
784
|
-
params.set('code_verifier', this[codeVerifierValue]
|
|
785
|
+
params.set('code_verifier', this[codeVerifierValue] as string);
|
|
785
786
|
}
|
|
786
787
|
return params.toString();
|
|
787
788
|
}
|
|
@@ -791,8 +792,8 @@ export class OAuth2Authorization {
|
|
|
791
792
|
*/
|
|
792
793
|
[handleTokenCodeError](e: Error): void {
|
|
793
794
|
if (e instanceof CodeError) {
|
|
794
|
-
|
|
795
|
-
this[reportOAuthError](...
|
|
795
|
+
const params = this[createErrorParams](e.code, e.message) as [string, string];
|
|
796
|
+
this[reportOAuthError](...params);
|
|
796
797
|
} else {
|
|
797
798
|
this[reportOAuthError](`Couldn't connect to the server. ${e.message}`, 'request_error');
|
|
798
799
|
}
|
|
@@ -817,7 +818,7 @@ export class OAuth2Authorization {
|
|
|
817
818
|
};
|
|
818
819
|
}
|
|
819
820
|
try {
|
|
820
|
-
const info = await this.requestTokenInfo(accessTokenUri
|
|
821
|
+
const info = await this.requestTokenInfo(accessTokenUri as string, body, headers);
|
|
821
822
|
const tokenInfo = this.mapCodeResponse(info);
|
|
822
823
|
this[handleTokenInfo](tokenInfo);
|
|
823
824
|
} catch (cause) {
|
|
@@ -869,7 +870,7 @@ export class OAuth2Authorization {
|
|
|
869
870
|
*/
|
|
870
871
|
async [authorizePassword](): Promise<void> {
|
|
871
872
|
const { settings } = this;
|
|
872
|
-
const url = settings.accessTokenUri
|
|
873
|
+
const url = settings.accessTokenUri as string;
|
|
873
874
|
const body = this.getPasswordBody();
|
|
874
875
|
try {
|
|
875
876
|
const info = await this.requestTokenInfo(url, body);
|
|
@@ -913,7 +914,7 @@ export class OAuth2Authorization {
|
|
|
913
914
|
*/
|
|
914
915
|
async [authorizeCustomGrant](): Promise<void> {
|
|
915
916
|
const { settings } = this;
|
|
916
|
-
const url = settings.accessTokenUri
|
|
917
|
+
const url = settings.accessTokenUri as string;
|
|
917
918
|
const body = this.getCustomGrantBody();
|
|
918
919
|
try {
|
|
919
920
|
const info = await this.requestTokenInfo(url, body);
|
|
@@ -932,7 +933,7 @@ export class OAuth2Authorization {
|
|
|
932
933
|
getCustomGrantBody(): string {
|
|
933
934
|
const { settings } = this;
|
|
934
935
|
const params = new URLSearchParams();
|
|
935
|
-
params.set('grant_type', settings.grantType
|
|
936
|
+
params.set('grant_type', settings.grantType as string);
|
|
936
937
|
if (settings.clientId) {
|
|
937
938
|
params.set('client_id', settings.clientId);
|
|
938
939
|
}
|
|
@@ -961,7 +962,7 @@ export class OAuth2Authorization {
|
|
|
961
962
|
*/
|
|
962
963
|
async [authorizeDeviceCode](): Promise<void> {
|
|
963
964
|
const { settings } = this;
|
|
964
|
-
const url = settings.accessTokenUri
|
|
965
|
+
const url = settings.accessTokenUri as string;
|
|
965
966
|
const body = this.getDeviceCodeBody();
|
|
966
967
|
try {
|
|
967
968
|
const info = await this.requestTokenInfo(url, body);
|
|
@@ -998,7 +999,7 @@ export class OAuth2Authorization {
|
|
|
998
999
|
*/
|
|
999
1000
|
async [authorizeJwt](): Promise<void> {
|
|
1000
1001
|
const { settings } = this;
|
|
1001
|
-
const url = settings.accessTokenUri
|
|
1002
|
+
const url = settings.accessTokenUri as string;
|
|
1002
1003
|
const body = this.getJwtBody();
|
|
1003
1004
|
try {
|
|
1004
1005
|
const info = await this.requestTokenInfo(url, body);
|
|
@@ -16,7 +16,7 @@ export class OidcAuthorization extends OAuth2Authorization {
|
|
|
16
16
|
if (url === null) {
|
|
17
17
|
return url;
|
|
18
18
|
}
|
|
19
|
-
const type = (this.settings.responseType || grantResponseMapping[this.settings.grantType
|
|
19
|
+
const type = (this.settings.responseType || grantResponseMapping[this.settings.grantType as string]);
|
|
20
20
|
// ID token nonce
|
|
21
21
|
if (type.includes('id_token')) {
|
|
22
22
|
url.searchParams.set('nonce', nonceGenerator());
|
|
@@ -53,7 +53,6 @@ export class OidcAuthorization extends OAuth2Authorization {
|
|
|
53
53
|
}
|
|
54
54
|
if (params.has('error')) {
|
|
55
55
|
const info = this.createTokenResponseError(params);
|
|
56
|
-
// @ts-ignore
|
|
57
56
|
this[reportOAuthError](...info);
|
|
58
57
|
return;
|
|
59
58
|
}
|
|
@@ -68,7 +67,7 @@ export class OidcAuthorization extends OAuth2Authorization {
|
|
|
68
67
|
if (codeIndex >= 0) {
|
|
69
68
|
const codeToken = tokens[codeIndex] as IOidcTokenInfo;
|
|
70
69
|
try {
|
|
71
|
-
const info = await this.getCodeInfo(codeToken.code
|
|
70
|
+
const info = await this.getCodeInfo(codeToken.code as string);
|
|
72
71
|
if (info.error) {
|
|
73
72
|
tokens[codeIndex] = {
|
|
74
73
|
responseType: codeToken.responseType,
|
|
@@ -106,7 +105,7 @@ export class OidcAuthorization extends OAuth2Authorization {
|
|
|
106
105
|
const { grantType, responseType='', scopes } = this.settings;
|
|
107
106
|
let type = responseType;
|
|
108
107
|
if (!type) {
|
|
109
|
-
type = grantResponseMapping[grantType
|
|
108
|
+
type = grantResponseMapping[grantType as string];
|
|
110
109
|
}
|
|
111
110
|
if (!type) {
|
|
112
111
|
return null;
|
package/src/data/XmlReader.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
/* eslint-disable no-console */
|
|
1
3
|
import { DataReader } from './DataReader.js';
|
|
2
4
|
|
|
3
5
|
let xResult: typeof XPathResult | undefined = typeof XPathResult !== 'undefined' ? XPathResult : undefined;
|
|
@@ -19,11 +21,11 @@ export class XmlReader extends DataReader {
|
|
|
19
21
|
try {
|
|
20
22
|
const result = doc.evaluate(path, doc);
|
|
21
23
|
switch (result.resultType) {
|
|
22
|
-
case xResult
|
|
23
|
-
case xResult
|
|
24
|
-
case xResult
|
|
25
|
-
case xResult
|
|
26
|
-
case xResult
|
|
24
|
+
case (xResult as typeof XPathResult).NUMBER_TYPE: return result.numberValue;
|
|
25
|
+
case (xResult as typeof XPathResult).STRING_TYPE: return result.stringValue;
|
|
26
|
+
case (xResult as typeof XPathResult).BOOLEAN_TYPE: return result.booleanValue;
|
|
27
|
+
case (xResult as typeof XPathResult).UNORDERED_NODE_ITERATOR_TYPE:
|
|
28
|
+
case (xResult as typeof XPathResult).ORDERED_NODE_ITERATOR_TYPE:
|
|
27
29
|
return this.processNodeResult(result);
|
|
28
30
|
default:
|
|
29
31
|
console.error(`Unsupported xpath result type: [${result.resultType}]`);
|
|
@@ -308,7 +308,7 @@ export class UriTemplate {
|
|
|
308
308
|
const varParts = eMatch[2].split(',');
|
|
309
309
|
const vars: IVariable[] = [];
|
|
310
310
|
|
|
311
|
-
for (
|
|
311
|
+
for (let i = 0, l = varParts.length; i < l; i++) {
|
|
312
312
|
const vMatch = varParts[i].match(VARIABLE_PATTERN);
|
|
313
313
|
if (vMatch === null) {
|
|
314
314
|
throw new Error(`Invalid Variable "${varParts[i]}" in "${eMatch[0]}"`);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IDataMockInit, IHarTimingInit, IHttpResponseRedirectStatusInit } from '@pawel-up/data-mock'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
}
|
|
3
|
+
export type ArcDataMockInit = IDataMockInit
|
|
5
4
|
|
|
6
5
|
export interface VariableInit {
|
|
7
6
|
defaultEnv?: boolean;
|
|
@@ -40,7 +40,6 @@ export class Http extends Base {
|
|
|
40
40
|
LAST_TIME: number;
|
|
41
41
|
types: Types;
|
|
42
42
|
lorem: Lorem;
|
|
43
|
-
// @ts-ignore
|
|
44
43
|
response: HttpResponse;
|
|
45
44
|
time: Time;
|
|
46
45
|
|
|
@@ -231,6 +230,7 @@ export class Http extends Base {
|
|
|
231
230
|
}
|
|
232
231
|
request.httpMessage += '\n';
|
|
233
232
|
} else {
|
|
233
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
234
234
|
// @ts-ignore
|
|
235
235
|
delete request.httpMessage;
|
|
236
236
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
1
2
|
import { IThing, Thing } from "../Thing.js";
|
|
2
3
|
import { IDataAssociation, DataAssociation } from "./DataAssociation.js";
|
|
3
4
|
import { IDataEntity, DataEntity } from "./DataEntity.js";
|
|
@@ -115,10 +116,9 @@ class DataNamespaceParent {
|
|
|
115
116
|
/**
|
|
116
117
|
* Adds a data namespace to the structure.
|
|
117
118
|
* @param init The name of the namespace to add, namespace's schema, or instance.
|
|
118
|
-
* @param parent The optional key of the parent namespace to add the new namespace to.
|
|
119
119
|
*/
|
|
120
120
|
addNamespace(init: string | IDataNamespace | DataNamespace): DataNamespace {
|
|
121
|
-
return this.root
|
|
121
|
+
return (this.root as DataNamespace).addNamespace(init, this.key);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
@@ -79,6 +79,7 @@ export class ArcLegacyTransformer extends BaseTransformer {
|
|
|
79
79
|
const tmp = projects = this.transformProjects(data.projects);
|
|
80
80
|
requests = this.transformRequests(data.requests, tmp);
|
|
81
81
|
projects = projects.map((item) => {
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
82
83
|
// @ts-ignore
|
|
83
84
|
delete item.originId;
|
|
84
85
|
return item;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
1
3
|
/* eslint-disable no-unused-vars */
|
|
2
4
|
import { PostmanTransformer, dataValue, paramValue } from './PostmanTransformer.js';
|
|
3
5
|
import { HttpProject, IHttpProject, Kind as ProjectKind } from '../HttpProject.js';
|
|
@@ -39,8 +41,7 @@ interface PostmanParameter {
|
|
|
39
41
|
disabled?: boolean;
|
|
40
42
|
description?: string;
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
+
type PostmanHeader = PostmanParameter
|
|
44
45
|
interface PostmanUrlEncoded extends PostmanParameter {
|
|
45
46
|
type?: string;
|
|
46
47
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
1
3
|
/* eslint-disable no-unused-vars */
|
|
2
4
|
import { PostmanTransformer, dataValue, paramValue } from './PostmanTransformer.js';
|
|
3
5
|
import { HttpProject, IHttpProject, Kind as ProjectKind } from '../HttpProject.js';
|