@eway-crm/connector 1.0.126 → 1.0.128
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/lib/{index.js → cjs/index.d.ts} +7 -6
- package/lib/cjs/index.js +8 -0
- package/lib/esm/AnonymousSessionHandler.d.ts +5 -0
- package/lib/esm/ApiConnection.d.ts +66 -0
- package/lib/esm/ApiMethods.d.ts +16 -0
- package/lib/esm/CredentialsSessionHandler.d.ts +16 -0
- package/lib/esm/HttpMethod.d.ts +4 -0
- package/lib/esm/ISessionHandler.d.ts +7 -0
- package/lib/esm/OAuthSessionHandler.d.ts +12 -0
- package/lib/esm/OAuthSessionHandlerBase.d.ts +16 -0
- package/lib/esm/ReturnCodes.d.ts +9 -0
- package/lib/esm/constants/ActionEventTypes.d.ts +9 -0
- package/lib/esm/constants/ColumnPermissionRules.d.ts +14 -0
- package/lib/esm/constants/CompletionLevels.d.ts +6 -0
- package/lib/esm/constants/CustomizationStatsItemKeys.d.ts +11 -0
- package/lib/esm/constants/Edition.d.ts +6 -0
- package/lib/esm/constants/EnumTypes.d.ts +32 -0
- package/lib/esm/constants/ExpirationReason.d.ts +7 -0
- package/lib/esm/constants/Feature.d.ts +6 -0
- package/lib/esm/constants/FieldNames.d.ts +389 -0
- package/lib/esm/constants/FieldTypes.d.ts +15 -0
- package/lib/esm/constants/FolderNames.d.ts +80 -0
- package/lib/esm/constants/Functionality.d.ts +54 -0
- package/lib/esm/constants/GlobalSettingsNames.d.ts +71 -0
- package/lib/esm/constants/LicenseKeyInvoiceSeverity.d.ts +8 -0
- package/lib/esm/constants/LicenseRestrictionKeys.d.ts +62 -0
- package/lib/esm/constants/RelationTypes.d.ts +11 -0
- package/lib/esm/data/EWItem.d.ts +12 -0
- package/lib/esm/data/IApiAdditionalField.d.ts +21 -0
- package/lib/esm/data/IApiAvailableBundle.d.ts +4 -0
- package/lib/esm/data/IApiAvailableVersionResponse.d.ts +9 -0
- package/lib/esm/data/IApiBooleanResponse.d.ts +4 -0
- package/lib/esm/data/IApiCapacityAvailableBundle.d.ts +5 -0
- package/lib/esm/data/IApiCart.d.ts +48 -0
- package/lib/esm/data/IApiColumn.d.ts +51 -0
- package/lib/esm/data/IApiColumnPermission.d.ts +15 -0
- package/lib/esm/data/IApiCompany.d.ts +55 -0
- package/lib/esm/data/IApiContact.d.ts +58 -0
- package/lib/esm/data/IApiCurrencyExchangeRate.d.ts +9 -0
- package/lib/esm/data/IApiCustomizationStatsItem.d.ts +6 -0
- package/lib/esm/data/IApiDataResponse.d.ts +4 -0
- package/lib/esm/data/IApiDatumResponse.d.ts +4 -0
- package/lib/esm/data/IApiDocument.d.ts +22 -0
- package/lib/esm/data/IApiEmail.d.ts +26 -0
- package/lib/esm/data/IApiEnumType.d.ts +26 -0
- package/lib/esm/data/IApiEnumValue.d.ts +18 -0
- package/lib/esm/data/IApiEnumValuesRelation.d.ts +8 -0
- package/lib/esm/data/IApiFeature.d.ts +5 -0
- package/lib/esm/data/IApiFeaturesLicenseBundle.d.ts +10 -0
- package/lib/esm/data/IApiFlow.d.ts +9 -0
- package/lib/esm/data/IApiGlobalSetting.d.ts +33 -0
- package/lib/esm/data/IApiGoal.d.ts +22 -0
- package/lib/esm/data/IApiGood.d.ts +26 -0
- package/lib/esm/data/IApiGoodInCart.d.ts +62 -0
- package/lib/esm/data/IApiGroup.d.ts +16 -0
- package/lib/esm/data/IApiItemBase.d.ts +14 -0
- package/lib/esm/data/IApiItemIdentifier.d.ts +5 -0
- package/lib/esm/data/IApiItemUsageStatus.d.ts +4 -0
- package/lib/esm/data/IApiJournal.d.ts +25 -0
- package/lib/esm/data/IApiLead.d.ts +36 -0
- package/lib/esm/data/IApiLicense.d.ts +65 -0
- package/lib/esm/data/IApiLicenseBundleBase.d.ts +6 -0
- package/lib/esm/data/IApiLocalizedLicenseBundle.d.ts +4 -0
- package/lib/esm/data/IApiLoginResponse.d.ts +8 -0
- package/lib/esm/data/IApiMarketingCampaign.d.ts +32 -0
- package/lib/esm/data/IApiMarketingList.d.ts +17 -0
- package/lib/esm/data/IApiModulePermission.d.ts +14 -0
- package/lib/esm/data/IApiObjectType.d.ts +9 -0
- package/lib/esm/data/IApiPasswordStrength.d.ts +5 -0
- package/lib/esm/data/IApiPayment.d.ts +9 -0
- package/lib/esm/data/IApiProject.d.ts +59 -0
- package/lib/esm/data/IApiRecurrencePattern.d.ts +16 -0
- package/lib/{IApiResult.d.ts → esm/data/IApiResult.d.ts} +4 -4
- package/lib/esm/data/IApiSaveResponse.d.ts +4 -0
- package/lib/esm/data/IApiTask.d.ts +34 -0
- package/lib/esm/data/IApiUser.d.ts +22 -0
- package/lib/esm/data/IApiUserSetting.d.ts +6 -0
- package/lib/esm/data/IApiWebServiceTaskStatus.d.ts +10 -0
- package/lib/esm/data/IApiWorkReport.d.ts +36 -0
- package/lib/esm/data/IApiWorkflowActionDerivedItem.d.ts +21 -0
- package/lib/esm/data/IApiWorkflowModel.d.ts +8 -0
- package/lib/esm/data/query/IApiQuery.d.ts +42 -0
- package/lib/esm/data/query/IApiQueryFilters.d.ts +43 -0
- package/lib/esm/data/workflowActions/IApiAction.d.ts +106 -0
- package/lib/esm/exceptions/HttpRequestError.d.ts +7 -0
- package/lib/esm/exceptions/WebServiceError.d.ts +5 -0
- package/lib/esm/helpers/ErrorHelper.d.ts +4 -0
- package/lib/esm/helpers/OAuthHelper.d.ts +8 -0
- package/lib/esm/helpers/VersionHelperBase.d.ts +5 -0
- package/lib/esm/index.d.ts +85 -0
- package/lib/esm/index.js +8 -0
- package/lib/esm/interfaces/IEWJwtPayload.d.ts +4 -0
- package/lib/esm/interfaces/IItemPreview.d.ts +5 -0
- package/lib/esm/interfaces/ITokenData.d.ts +9 -0
- package/lib/esm/interfaces/ITranslatableString.d.ts +8 -0
- package/lib/esm/interfaces/TNumericValidatorType.d.ts +1 -0
- package/lib/esm/tokenizedServices/CommonDataConnection.d.ts +9 -0
- package/lib/esm/tokenizedServices/ITokenizedApiResult.d.ts +4 -0
- package/lib/esm/tokenizedServices/TokenizedServiceConnection.d.ts +25 -0
- package/lib/index.d.ts +2164 -85
- package/package.json +14 -4
- package/lib/AnonymousSessionHandler.js +0 -10
- package/lib/ApiConnection.js +0 -307
- package/lib/ApiMethods.js +0 -36
- package/lib/CredentialsSessionHandler.js +0 -54
- package/lib/HttpMethod.js +0 -5
- package/lib/IApiResult.js +0 -2
- package/lib/ISessionHandler.js +0 -1
- package/lib/OAuthSessionHandler.js +0 -29
- package/lib/OAuthSessionHandlerBase.js +0 -72
- package/lib/ReturnCodes.js +0 -10
- package/lib/axios/AxiosInstance.d.ts +0 -2
- package/lib/axios/AxiosInstance.js +0 -3
- package/lib/constants/ActionEventTypes.js +0 -9
- package/lib/constants/ColumnPermissionRules.js +0 -15
- package/lib/constants/CompletionLevels.js +0 -6
- package/lib/constants/CustomizationStatsItemKeys.js +0 -12
- package/lib/constants/Edition.js +0 -7
- package/lib/constants/EnumTypes.js +0 -33
- package/lib/constants/ExpirationReason.js +0 -8
- package/lib/constants/Feature.js +0 -7
- package/lib/constants/FieldNames.js +0 -422
- package/lib/constants/FieldTypes.js +0 -15
- package/lib/constants/FolderNames.js +0 -82
- package/lib/constants/Functionality.js +0 -55
- package/lib/constants/GlobalSettingsNames.js +0 -71
- package/lib/constants/LicenseKeyInvoiceSeverity.js +0 -9
- package/lib/constants/LicenseRestrictionKeys.js +0 -63
- package/lib/constants/RelationTypes.js +0 -11
- package/lib/data/EWItem.js +0 -86
- package/lib/data/IApiAdditionalField.js +0 -1
- package/lib/data/IApiAvailableBundle.js +0 -1
- package/lib/data/IApiAvailableVersionResponse.js +0 -1
- package/lib/data/IApiBooleanResponse.js +0 -1
- package/lib/data/IApiCapacityAvailableBundle.js +0 -1
- package/lib/data/IApiCart.js +0 -7
- package/lib/data/IApiColumn.js +0 -1
- package/lib/data/IApiColumnPermission.js +0 -1
- package/lib/data/IApiCompany.js +0 -7
- package/lib/data/IApiContact.js +0 -7
- package/lib/data/IApiCurrencyExchangeRate.js +0 -7
- package/lib/data/IApiCustomizationStatsItem.js +0 -1
- package/lib/data/IApiDataResponse.js +0 -1
- package/lib/data/IApiDatumResponse.js +0 -1
- package/lib/data/IApiDocument.js +0 -7
- package/lib/data/IApiEmail.js +0 -7
- package/lib/data/IApiEnumType.js +0 -6
- package/lib/data/IApiEnumValue.js +0 -1
- package/lib/data/IApiEnumValuesRelation.js +0 -7
- package/lib/data/IApiFeature.js +0 -1
- package/lib/data/IApiFeaturesLicenseBundle.js +0 -1
- package/lib/data/IApiFlow.js +0 -7
- package/lib/data/IApiGlobalSetting.js +0 -1
- package/lib/data/IApiGoal.js +0 -7
- package/lib/data/IApiGood.js +0 -7
- package/lib/data/IApiGoodInCart.js +0 -7
- package/lib/data/IApiGroup.js +0 -1
- package/lib/data/IApiItemBase.js +0 -1
- package/lib/data/IApiItemIdentifier.js +0 -1
- package/lib/data/IApiItemUsageStatus.js +0 -1
- package/lib/data/IApiJournal.js +0 -7
- package/lib/data/IApiLead.js +0 -7
- package/lib/data/IApiLicense.js +0 -1
- package/lib/data/IApiLicenseBundleBase.js +0 -1
- package/lib/data/IApiLocalizedLicenseBundle.js +0 -1
- package/lib/data/IApiLoginResponse.js +0 -1
- package/lib/data/IApiMarketingCampaign.js +0 -7
- package/lib/data/IApiMarketingList.js +0 -7
- package/lib/data/IApiModulePermission.js +0 -1
- package/lib/data/IApiObjectType.js +0 -1
- package/lib/data/IApiPasswordStrength.js +0 -1
- package/lib/data/IApiPayment.js +0 -7
- package/lib/data/IApiProject.js +0 -7
- package/lib/data/IApiRecurrencePattern.js +0 -7
- package/lib/data/IApiResult.js +0 -1
- package/lib/data/IApiSaveResponse.js +0 -1
- package/lib/data/IApiTask.js +0 -7
- package/lib/data/IApiUser.js +0 -1
- package/lib/data/IApiUserSetting.js +0 -1
- package/lib/data/IApiWebServiceTaskStatus.js +0 -1
- package/lib/data/IApiWorkReport.js +0 -7
- package/lib/data/IApiWorkflowActionDerivedItem.js +0 -1
- package/lib/data/IApiWorkflowModel.js +0 -1
- package/lib/data/query/IApiQuery.js +0 -1
- package/lib/data/query/IApiQueryFilters.js +0 -1
- package/lib/data/workflowActions/IApiAction.js +0 -1
- package/lib/exceptions/HttpRequestError.js +0 -7
- package/lib/exceptions/WebServiceError.js +0 -7
- package/lib/helpers/ErrorHelper.js +0 -16
- package/lib/helpers/OAuthHelper.js +0 -52
- package/lib/helpers/VersionHelperBase.js +0 -16
- package/lib/interfaces/IEWJwtPayload.js +0 -1
- package/lib/interfaces/IItemPreview.js +0 -1
- package/lib/interfaces/ITokenData.js +0 -1
- package/lib/interfaces/ITranslatableString.js +0 -1
- package/lib/interfaces/TNumericValidatorType.js +0 -1
- package/lib/tokenizedServices/CommonDataConnection.js +0 -16
- package/lib/tokenizedServices/ITokenizedApiResult.js +0 -1
- package/lib/tokenizedServices/TokenizedServiceConnection.js +0 -124
- /package/lib/{AnonymousSessionHandler.d.ts → cjs/AnonymousSessionHandler.d.ts} +0 -0
- /package/lib/{ApiConnection.d.ts → cjs/ApiConnection.d.ts} +0 -0
- /package/lib/{ApiMethods.d.ts → cjs/ApiMethods.d.ts} +0 -0
- /package/lib/{CredentialsSessionHandler.d.ts → cjs/CredentialsSessionHandler.d.ts} +0 -0
- /package/lib/{HttpMethod.d.ts → cjs/HttpMethod.d.ts} +0 -0
- /package/lib/{ISessionHandler.d.ts → cjs/ISessionHandler.d.ts} +0 -0
- /package/lib/{OAuthSessionHandler.d.ts → cjs/OAuthSessionHandler.d.ts} +0 -0
- /package/lib/{OAuthSessionHandlerBase.d.ts → cjs/OAuthSessionHandlerBase.d.ts} +0 -0
- /package/lib/{ReturnCodes.d.ts → cjs/ReturnCodes.d.ts} +0 -0
- /package/lib/{constants → cjs/constants}/ActionEventTypes.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/ColumnPermissionRules.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/CompletionLevels.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/CustomizationStatsItemKeys.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/Edition.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/EnumTypes.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/ExpirationReason.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/Feature.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/FieldNames.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/FieldTypes.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/FolderNames.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/Functionality.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/GlobalSettingsNames.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/LicenseKeyInvoiceSeverity.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/LicenseRestrictionKeys.d.ts +0 -0
- /package/lib/{constants → cjs/constants}/RelationTypes.d.ts +0 -0
- /package/lib/{data → cjs/data}/EWItem.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiAdditionalField.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiAvailableBundle.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiAvailableVersionResponse.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiBooleanResponse.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiCapacityAvailableBundle.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiCart.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiColumn.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiColumnPermission.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiCompany.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiContact.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiCurrencyExchangeRate.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiCustomizationStatsItem.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiDataResponse.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiDatumResponse.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiDocument.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiEmail.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiEnumType.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiEnumValue.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiEnumValuesRelation.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiFeature.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiFeaturesLicenseBundle.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiFlow.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiGlobalSetting.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiGoal.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiGood.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiGoodInCart.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiGroup.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiItemBase.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiItemIdentifier.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiItemUsageStatus.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiJournal.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiLead.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiLicense.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiLicenseBundleBase.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiLocalizedLicenseBundle.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiLoginResponse.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiMarketingCampaign.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiMarketingList.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiModulePermission.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiObjectType.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiPasswordStrength.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiPayment.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiProject.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiRecurrencePattern.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiResult.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiSaveResponse.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiTask.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiUser.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiUserSetting.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiWebServiceTaskStatus.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiWorkReport.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiWorkflowActionDerivedItem.d.ts +0 -0
- /package/lib/{data → cjs/data}/IApiWorkflowModel.d.ts +0 -0
- /package/lib/{data → cjs/data}/query/IApiQuery.d.ts +0 -0
- /package/lib/{data → cjs/data}/query/IApiQueryFilters.d.ts +0 -0
- /package/lib/{data → cjs/data}/workflowActions/IApiAction.d.ts +0 -0
- /package/lib/{exceptions → cjs/exceptions}/HttpRequestError.d.ts +0 -0
- /package/lib/{exceptions → cjs/exceptions}/WebServiceError.d.ts +0 -0
- /package/lib/{helpers → cjs/helpers}/ErrorHelper.d.ts +0 -0
- /package/lib/{helpers → cjs/helpers}/OAuthHelper.d.ts +0 -0
- /package/lib/{helpers → cjs/helpers}/VersionHelperBase.d.ts +0 -0
- /package/lib/{interfaces → cjs/interfaces}/IEWJwtPayload.d.ts +0 -0
- /package/lib/{interfaces → cjs/interfaces}/IItemPreview.d.ts +0 -0
- /package/lib/{interfaces → cjs/interfaces}/ITokenData.d.ts +0 -0
- /package/lib/{interfaces → cjs/interfaces}/ITranslatableString.d.ts +0 -0
- /package/lib/{interfaces → cjs/interfaces}/TNumericValidatorType.d.ts +0 -0
- /package/lib/{tokenizedServices → cjs/tokenizedServices}/CommonDataConnection.d.ts +0 -0
- /package/lib/{tokenizedServices → cjs/tokenizedServices}/ITokenizedApiResult.d.ts +0 -0
- /package/lib/{tokenizedServices → cjs/tokenizedServices}/TokenizedServiceConnection.d.ts +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import Axios from 'axios';
|
|
2
|
-
import * as base64url from 'universal-base64url';
|
|
3
|
-
import jwt_decode from 'jwt-decode';
|
|
4
|
-
class OAuthHelper {
|
|
5
|
-
}
|
|
6
|
-
OAuthHelper.finishAuthorization = (wsUrl, clientId, clientSecret, codeVerifier, authorizationCode, redirectUrl, callback) => {
|
|
7
|
-
const params = new URLSearchParams();
|
|
8
|
-
params.append('code_verifier', codeVerifier);
|
|
9
|
-
params.append('client_id', clientId);
|
|
10
|
-
params.append('client_secret', clientSecret);
|
|
11
|
-
params.append('code', authorizationCode);
|
|
12
|
-
params.append('redirect_uri', redirectUrl);
|
|
13
|
-
params.append('grant_type', 'authorization_code');
|
|
14
|
-
OAuthHelper.callTokenEndpoint(wsUrl, params, callback);
|
|
15
|
-
};
|
|
16
|
-
OAuthHelper.refreshToken = (wsUrl, clientId, clientSecret, refreshToken, callback) => {
|
|
17
|
-
const params = new URLSearchParams();
|
|
18
|
-
params.append('client_id', clientId);
|
|
19
|
-
params.append('client_secret', clientSecret);
|
|
20
|
-
params.append('refresh_token', refreshToken);
|
|
21
|
-
params.append('grant_type', 'refresh_token');
|
|
22
|
-
OAuthHelper.callTokenEndpoint(wsUrl, params, callback);
|
|
23
|
-
};
|
|
24
|
-
OAuthHelper.getWebServiceUrl = (refreshToken) => {
|
|
25
|
-
const parts = refreshToken.split('.');
|
|
26
|
-
if (parts.length !== 2) {
|
|
27
|
-
throw new Error('Invalid token supplied');
|
|
28
|
-
}
|
|
29
|
-
return base64url.decode(parts[1]);
|
|
30
|
-
};
|
|
31
|
-
OAuthHelper.getUserName = (accessToken) => {
|
|
32
|
-
const parts = jwt_decode(accessToken);
|
|
33
|
-
return parts.username;
|
|
34
|
-
};
|
|
35
|
-
OAuthHelper.callTokenEndpoint = (wsUrl, params, callback) => {
|
|
36
|
-
Axios.post(wsUrl + '/auth/connect/token', params, {
|
|
37
|
-
headers: {
|
|
38
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
39
|
-
}
|
|
40
|
-
}).then((response) => {
|
|
41
|
-
callback(response.data);
|
|
42
|
-
}).catch((error) => {
|
|
43
|
-
if (error.response) {
|
|
44
|
-
if (error.response.status == 400) {
|
|
45
|
-
callback(error.response.data);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
throw new Error('Token request failed');
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
export { OAuthHelper };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { compare } from "compare-versions";
|
|
2
|
-
class VersionHelperBase {
|
|
3
|
-
}
|
|
4
|
-
VersionHelperBase.getIsDebug = (connection) => {
|
|
5
|
-
var _a;
|
|
6
|
-
return !!((_a = connection === null || connection === void 0 ? void 0 : connection.sessionHandler.lastSuccessfulLoginResponse) === null || _a === void 0 ? void 0 : _a.Debug);
|
|
7
|
-
};
|
|
8
|
-
VersionHelperBase.supportsFeaturesOf = (connection, version) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const wcfVersion = (_a = connection.sessionHandler.lastSuccessfulLoginResponse) === null || _a === void 0 ? void 0 : _a.WcfVersion;
|
|
11
|
-
if (!wcfVersion) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return compare(wcfVersion, version, ">=") || compare(wcfVersion, "1.0.0.0", "=");
|
|
15
|
-
};
|
|
16
|
-
export default VersionHelperBase;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TokenizedServiceConnection } from './TokenizedServiceConnection';
|
|
2
|
-
import { HttpMethod } from '../HttpMethod';
|
|
3
|
-
const obtainer = (result) => {
|
|
4
|
-
return { url: result.ServiceUrl, token: result.Token };
|
|
5
|
-
};
|
|
6
|
-
export class CommonDataConnection {
|
|
7
|
-
constructor(connection, errorCallback) {
|
|
8
|
-
this.isCommonDataApiEnabled = (enabledCallback, disabledCallback) => {
|
|
9
|
-
this.tokenizedConnection.isEnabled(enabledCallback, disabledCallback);
|
|
10
|
-
};
|
|
11
|
-
this.callCommonDataApi = (methodName, data, successCallback, unsuccessCallback) => {
|
|
12
|
-
this.tokenizedConnection.callTokenizedApi(methodName, data, successCallback, unsuccessCallback);
|
|
13
|
-
};
|
|
14
|
-
this.tokenizedConnection = new TokenizedServiceConnection('ObtainCommonDataApiAccessToken', HttpMethod.get, false, 'InvalidCommonDataToken', obtainer, connection, errorCallback);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import Axios from 'axios';
|
|
2
|
-
import { HttpRequestError } from '..';
|
|
3
|
-
export class TokenizedServiceConnection {
|
|
4
|
-
constructor(obtainTokenMethodName, obtainTokenMethodType, needsSession, invalidTokenReturnCode, urlAndTokenObtainer, connection, errorCallback) {
|
|
5
|
-
this.isEnabled = (enabledCallback, disabledCallback) => {
|
|
6
|
-
const check = () => {
|
|
7
|
-
if (!this.url || !this.token) {
|
|
8
|
-
disabledCallback();
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
enabledCallback(this.url, this.token);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
if (!this.url || !this.token) {
|
|
15
|
-
this.obtainToken(check);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
enabledCallback(this.url, this.token);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
this.callTokenizedApi = (methodName, data, successCallback, unsuccessCallback) => {
|
|
23
|
-
this.isEnabled((url, token) => {
|
|
24
|
-
data.token = token;
|
|
25
|
-
TokenizedServiceConnection.call(url, methodName, data, successCallback, (result) => {
|
|
26
|
-
if (result.ReturnCodeString === this.invalidTokenReturnCode) {
|
|
27
|
-
this.obtainToken(() => {
|
|
28
|
-
this.callTokenizedApi(methodName, data, successCallback, unsuccessCallback);
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (unsuccessCallback) {
|
|
33
|
-
unsuccessCallback(result);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
if (!!this.generalErrorCallback) {
|
|
37
|
-
const error = new Error('Unhandled tokenized service connection return code ' + result.ReturnCodeString + '.\nDescription: ' + result.Description);
|
|
38
|
-
this.generalErrorCallback(error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}, (error) => {
|
|
42
|
-
if (!!this.generalErrorCallback) {
|
|
43
|
-
const err = new Error('Unhandled tokenized service connection communication error: ' + JSON.stringify(error));
|
|
44
|
-
this.generalErrorCallback(err);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}, () => {
|
|
48
|
-
if (unsuccessCallback) {
|
|
49
|
-
unsuccessCallback(null);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
this.obtainToken = (callback) => {
|
|
54
|
-
if (!this.isActive) {
|
|
55
|
-
this.url = null;
|
|
56
|
-
this.token = null;
|
|
57
|
-
callback();
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const successClb = (result) => {
|
|
61
|
-
const obtainedResult = this.urlAndTokenObtainer(result);
|
|
62
|
-
if (!obtainedResult.url || !obtainedResult.token) {
|
|
63
|
-
this.url = null;
|
|
64
|
-
this.token = null;
|
|
65
|
-
this.isActive = false;
|
|
66
|
-
callback();
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
this.url = obtainedResult.url;
|
|
70
|
-
this.token = obtainedResult.token;
|
|
71
|
-
this.isActive = true;
|
|
72
|
-
callback();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const unsuccessClb = () => {
|
|
76
|
-
this.url = null;
|
|
77
|
-
this.token = null;
|
|
78
|
-
this.isActive = false;
|
|
79
|
-
callback();
|
|
80
|
-
};
|
|
81
|
-
if (this.needsSession) {
|
|
82
|
-
this.connection.callMethod(this.obtainTokenMethodName, {}, successClb, unsuccessClb, this.obtainTokenMethodType);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
this.connection.callWithoutSession(this.obtainTokenMethodName, null, successClb, unsuccessClb, null, this.obtainTokenMethodType);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
this.obtainTokenMethodName = obtainTokenMethodName;
|
|
89
|
-
this.obtainTokenMethodType = obtainTokenMethodType;
|
|
90
|
-
this.needsSession = needsSession;
|
|
91
|
-
this.invalidTokenReturnCode = invalidTokenReturnCode;
|
|
92
|
-
this.urlAndTokenObtainer = urlAndTokenObtainer;
|
|
93
|
-
this.connection = connection;
|
|
94
|
-
this.generalErrorCallback = errorCallback || null;
|
|
95
|
-
this.url = null;
|
|
96
|
-
this.token = null;
|
|
97
|
-
this.isActive = true;
|
|
98
|
-
}
|
|
99
|
-
static call(serviceUrl, methodName, data, successCallback, unsuccessCallback, errorCallback) {
|
|
100
|
-
// We count on that we are in Admin/Subdirectory.
|
|
101
|
-
const address = serviceUrl + '/' + methodName;
|
|
102
|
-
Axios.post(address, data)
|
|
103
|
-
.then((response) => {
|
|
104
|
-
if (response.status === 200) {
|
|
105
|
-
if (response.data.ReturnCodeString === 'Success') {
|
|
106
|
-
successCallback(response.data);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
unsuccessCallback(response.data);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
errorCallback(new HttpRequestError(response.status, response.statusText));
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
.catch((error) => {
|
|
117
|
-
if (error.response) {
|
|
118
|
-
errorCallback(new HttpRequestError(error.response.status, error.response.statusText));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
errorCallback(error);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|