@amp-labs/react 1.2.0 → 1.4.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/generated-sources/api/src/apis/APIKeyApi.d.ts +158 -0
- package/build/generated-sources/api/src/apis/APIKeyApi.js +188 -0
- package/build/generated-sources/api/src/apis/DestinationApi.d.ts +86 -8
- package/build/generated-sources/api/src/apis/DestinationApi.js +86 -3
- package/build/generated-sources/api/src/apis/InstallationApi.d.ts +28 -0
- package/build/generated-sources/api/src/apis/InstallationApi.js +30 -0
- package/build/generated-sources/api/src/apis/IntegrationApi.js +1 -4
- package/build/generated-sources/api/src/apis/OperationApi.d.ts +27 -1
- package/build/generated-sources/api/src/apis/OperationApi.js +27 -0
- package/build/generated-sources/api/src/apis/OperationEventApi.d.ts +84 -0
- package/build/generated-sources/api/src/apis/OperationEventApi.js +110 -0
- package/build/generated-sources/api/src/apis/ProviderApi.d.ts +78 -0
- package/build/generated-sources/api/src/apis/{OperationLogApi.js → ProviderApi.js} +33 -17
- package/build/generated-sources/api/src/apis/index.d.ts +3 -1
- package/build/generated-sources/api/src/apis/index.js +3 -1
- package/build/generated-sources/api/src/models/ApiKey.d.ts +49 -0
- package/build/generated-sources/api/src/models/ApiKey.js +59 -0
- package/build/generated-sources/api/src/models/ApiKeyRequest.d.ts +31 -0
- package/build/generated-sources/api/src/models/ApiKeyRequest.js +50 -0
- package/build/generated-sources/api/src/models/AuthType.d.ts +22 -0
- package/build/generated-sources/api/src/models/AuthType.js +35 -0
- package/build/generated-sources/api/src/models/BaseConfigContent.d.ts +7 -0
- package/build/generated-sources/api/src/models/BaseConfigContent.js +3 -0
- package/build/generated-sources/api/src/models/BaseProxyConfig.d.ts +31 -0
- package/build/generated-sources/api/src/models/BaseProxyConfig.js +50 -0
- package/build/generated-sources/api/src/models/ConfigContent.d.ts +7 -0
- package/build/generated-sources/api/src/models/ConfigContent.js +3 -0
- package/build/generated-sources/api/src/models/CreateDestinationRequest.d.ts +44 -0
- package/build/generated-sources/api/src/models/CreateDestinationRequest.js +57 -0
- package/build/generated-sources/api/src/models/CreateDestinationRequestMetadata.d.ts +39 -0
- package/build/generated-sources/api/src/models/{DestinationMetadata.js → CreateDestinationRequestMetadata.js} +11 -11
- package/build/generated-sources/api/src/models/Destination.d.ts +22 -4
- package/build/generated-sources/api/src/models/Destination.js +12 -3
- package/build/generated-sources/api/src/models/HydratedIntegration.d.ts +7 -0
- package/build/generated-sources/api/src/models/HydratedIntegration.js +3 -0
- package/build/generated-sources/api/src/models/HydratedIntegrationProxy.d.ts +31 -0
- package/build/generated-sources/api/src/models/HydratedIntegrationProxy.js +50 -0
- package/build/generated-sources/api/src/models/ImportConnectionRequest.d.ts +1 -1
- package/build/generated-sources/api/src/models/Integration1.d.ts +7 -0
- package/build/generated-sources/api/src/models/Integration1.js +3 -0
- package/build/generated-sources/api/src/models/IntegrationProxy.d.ts +31 -0
- package/build/generated-sources/api/src/models/IntegrationProxy.js +50 -0
- package/build/generated-sources/api/src/models/{OperationLog.d.ts → Log.d.ts} +12 -12
- package/build/generated-sources/api/src/models/{OperationLog.js → Log.js} +11 -11
- package/build/generated-sources/api/src/models/OauthConnectRequest.d.ts +6 -6
- package/build/generated-sources/api/src/models/OauthConnectRequest.js +1 -2
- package/build/generated-sources/api/src/models/OauthOpts.d.ts +56 -0
- package/build/generated-sources/api/src/models/OauthOpts.js +63 -0
- package/build/generated-sources/api/src/models/Operation.d.ts +26 -9
- package/build/generated-sources/api/src/models/Operation.js +14 -7
- package/build/generated-sources/api/src/models/OperationEvent.d.ts +61 -0
- package/build/generated-sources/api/src/models/OperationEvent.js +64 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequest.d.ts +38 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequest.js +54 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.d.ts +37 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.js +52 -0
- package/build/generated-sources/api/src/models/ProviderInfo.d.ts +60 -0
- package/build/generated-sources/api/src/models/ProviderInfo.js +65 -0
- package/build/generated-sources/api/src/models/Support.d.ts +55 -0
- package/build/generated-sources/api/src/models/Support.js +62 -0
- package/build/generated-sources/api/src/models/TokenMetadataFields.d.ts +43 -0
- package/build/generated-sources/api/src/models/TokenMetadataFields.js +54 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequest.d.ts +38 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequest.js +54 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.d.ts +38 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.js +53 -0
- package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.d.ts +7 -0
- package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.js +3 -0
- package/build/generated-sources/api/src/models/index.d.ts +18 -3
- package/build/generated-sources/api/src/models/index.js +18 -3
- package/build/src/assets/SuccessIcon.d.ts +1 -0
- package/build/src/assets/SuccessIcon.js +8 -0
- package/build/src/components/Configure/InstallIntegration.js +2 -1
- package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.d.ts +15 -0
- package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.js +30 -0
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.d.ts +15 -0
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js +33 -0
- package/build/src/components/Configure/actions/proxy/isProxyEnabled.d.ts +2 -0
- package/build/src/components/Configure/actions/proxy/isProxyEnabled.js +8 -0
- package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.d.ts +8 -0
- package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.js +44 -0
- package/build/src/components/Configure/actions/{onSaveReadCreateInstallation.d.ts → read/onSaveReadCreateInstallation.d.ts} +2 -2
- package/build/src/components/Configure/actions/{onSaveReadCreateInstallation.js → read/onSaveReadCreateInstallation.js} +15 -22
- package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/{onSaveReadUpdateInstallation.js → read/onSaveReadUpdateInstallation.js} +20 -28
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +16 -22
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.d.ts +2 -2
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.js +11 -3
- package/build/src/components/Configure/content/CreateInstallation.js +1 -1
- package/build/src/components/Configure/content/UpdateInstallation.js +5 -5
- package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.d.ts +11 -0
- package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.js +67 -0
- package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.d.ts +5 -0
- package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.js +11 -0
- package/build/src/components/Configure/layout/ProtectedConnectionLayout.js +2 -7
- package/build/src/components/Configure/state/utils.js +5 -5
- package/build/src/components/Connect/ConnectedSuccessBox.js +3 -3
- package/build/src/components/Oauth/NoWorkspaceEntry/LandingContent.js +12 -0
- package/build/src/components/Oauth/{NoSubdomainEntry/NoSubdomainOauthFlow.d.ts → NoWorkspaceEntry/NoWorkspaceOauthFlow.d.ts} +4 -4
- package/build/src/components/Oauth/{NoSubdomainEntry/NoSubdomainOauthFlow.js → NoWorkspaceEntry/NoWorkspaceOauthFlow.js} +6 -8
- package/build/src/components/Oauth/OAuthPopup.js +1 -5
- package/build/src/components/Oauth/OauthCardLayout.d.ts +6 -0
- package/build/src/components/Oauth/OauthCardLayout.js +9 -0
- package/build/src/components/Oauth/OauthFlow/OauthFlow.d.ts +9 -0
- package/build/src/components/Oauth/OauthFlow/OauthFlow.js +33 -0
- package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.d.ts +13 -0
- package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.js +18 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.d.ts +9 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.js +12 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.d.ts +14 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.js +58 -0
- package/build/src/components/SuccessTextBox.d.ts +5 -0
- package/build/src/components/SuccessTextBox.js +10 -0
- package/build/src/components/ThemeProvider/Button/buttonTheme.js +3 -3
- package/build/src/components/ThemeProvider/index.js +6 -6
- package/build/src/services/ApiService.d.ts +2 -2
- package/build/src/services/ApiService.js +1 -1
- package/build/src/services/api.d.ts +2 -2
- package/build/src/services/api.js +28 -21
- package/build/src/services/version.d.ts +1 -0
- package/build/src/services/version.js +4 -0
- package/package.json +2 -2
- package/build/generated-sources/api/src/apis/OperationLogApi.d.ts +0 -55
- package/build/generated-sources/api/src/models/DestinationMetadata.d.ts +0 -39
- package/build/generated-sources/api/src/models/OperationError.d.ts +0 -49
- package/build/generated-sources/api/src/models/OperationError.js +0 -56
- package/build/src/components/Configure/actions/onSaveReadUpdateInstallation.d.ts +0 -3
- package/build/src/components/Oauth/NoSubdomainEntry/LandingContent.js +0 -11
- package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.d.ts +0 -16
- package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.js +0 -57
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.d.ts +0 -8
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.js +0 -12
- package/build/src/constants.d.ts +0 -2
- package/build/src/constants.js +0 -5
- /package/build/src/components/Oauth/{NoSubdomainEntry → NoWorkspaceEntry}/LandingContent.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ampersand public API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { CreateDestinationRequestMetadata } from './CreateDestinationRequestMetadata';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface UpdateDestinationRequestDestination
|
|
17
|
+
*/
|
|
18
|
+
export interface UpdateDestinationRequestDestination {
|
|
19
|
+
/**
|
|
20
|
+
* User-friendly name for the destination
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof UpdateDestinationRequestDestination
|
|
23
|
+
*/
|
|
24
|
+
name?: string;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {CreateDestinationRequestMetadata}
|
|
28
|
+
* @memberof UpdateDestinationRequestDestination
|
|
29
|
+
*/
|
|
30
|
+
metadata?: CreateDestinationRequestMetadata;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if a given object implements the UpdateDestinationRequestDestination interface.
|
|
34
|
+
*/
|
|
35
|
+
export declare function instanceOfUpdateDestinationRequestDestination(value: object): boolean;
|
|
36
|
+
export declare function UpdateDestinationRequestDestinationFromJSON(json: any): UpdateDestinationRequestDestination;
|
|
37
|
+
export declare function UpdateDestinationRequestDestinationFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDestinationRequestDestination;
|
|
38
|
+
export declare function UpdateDestinationRequestDestinationToJSON(value?: UpdateDestinationRequestDestination | null): any;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Ampersand public API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.UpdateDestinationRequestDestinationToJSON = exports.UpdateDestinationRequestDestinationFromJSONTyped = exports.UpdateDestinationRequestDestinationFromJSON = exports.instanceOfUpdateDestinationRequestDestination = void 0;
|
|
17
|
+
const runtime_1 = require("../runtime");
|
|
18
|
+
const CreateDestinationRequestMetadata_1 = require("./CreateDestinationRequestMetadata");
|
|
19
|
+
/**
|
|
20
|
+
* Check if a given object implements the UpdateDestinationRequestDestination interface.
|
|
21
|
+
*/
|
|
22
|
+
function instanceOfUpdateDestinationRequestDestination(value) {
|
|
23
|
+
let isInstance = true;
|
|
24
|
+
return isInstance;
|
|
25
|
+
}
|
|
26
|
+
exports.instanceOfUpdateDestinationRequestDestination = instanceOfUpdateDestinationRequestDestination;
|
|
27
|
+
function UpdateDestinationRequestDestinationFromJSON(json) {
|
|
28
|
+
return UpdateDestinationRequestDestinationFromJSONTyped(json, false);
|
|
29
|
+
}
|
|
30
|
+
exports.UpdateDestinationRequestDestinationFromJSON = UpdateDestinationRequestDestinationFromJSON;
|
|
31
|
+
function UpdateDestinationRequestDestinationFromJSONTyped(json, ignoreDiscriminator) {
|
|
32
|
+
if ((json === undefined) || (json === null)) {
|
|
33
|
+
return json;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'],
|
|
37
|
+
'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : (0, CreateDestinationRequestMetadata_1.CreateDestinationRequestMetadataFromJSON)(json['metadata']),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.UpdateDestinationRequestDestinationFromJSONTyped = UpdateDestinationRequestDestinationFromJSONTyped;
|
|
41
|
+
function UpdateDestinationRequestDestinationToJSON(value) {
|
|
42
|
+
if (value === undefined) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
if (value === null) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'name': value.name,
|
|
50
|
+
'metadata': (0, CreateDestinationRequestMetadata_1.CreateDestinationRequestMetadataToJSON)(value.metadata),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.UpdateDestinationRequestDestinationToJSON = UpdateDestinationRequestDestinationToJSON;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { BaseProxyConfig } from './BaseProxyConfig';
|
|
12
13
|
import type { BaseReadConfig } from './BaseReadConfig';
|
|
13
14
|
import type { BaseWriteConfig } from './BaseWriteConfig';
|
|
14
15
|
/**
|
|
@@ -35,6 +36,12 @@ export interface UpdateInstallationConfigContent {
|
|
|
35
36
|
* @memberof UpdateInstallationConfigContent
|
|
36
37
|
*/
|
|
37
38
|
write?: BaseWriteConfig;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {BaseProxyConfig}
|
|
42
|
+
* @memberof UpdateInstallationConfigContent
|
|
43
|
+
*/
|
|
44
|
+
proxy?: BaseProxyConfig;
|
|
38
45
|
}
|
|
39
46
|
/**
|
|
40
47
|
* Check if a given object implements the UpdateInstallationConfigContent interface.
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.UpdateInstallationConfigContentToJSON = exports.UpdateInstallationConfigContentFromJSONTyped = exports.UpdateInstallationConfigContentFromJSON = exports.instanceOfUpdateInstallationConfigContent = void 0;
|
|
17
17
|
const runtime_1 = require("../runtime");
|
|
18
|
+
const BaseProxyConfig_1 = require("./BaseProxyConfig");
|
|
18
19
|
const BaseReadConfig_1 = require("./BaseReadConfig");
|
|
19
20
|
const BaseWriteConfig_1 = require("./BaseWriteConfig");
|
|
20
21
|
/**
|
|
@@ -37,6 +38,7 @@ function UpdateInstallationConfigContentFromJSONTyped(json, ignoreDiscriminator)
|
|
|
37
38
|
'provider': !(0, runtime_1.exists)(json, 'provider') ? undefined : json['provider'],
|
|
38
39
|
'read': !(0, runtime_1.exists)(json, 'read') ? undefined : (0, BaseReadConfig_1.BaseReadConfigFromJSON)(json['read']),
|
|
39
40
|
'write': !(0, runtime_1.exists)(json, 'write') ? undefined : (0, BaseWriteConfig_1.BaseWriteConfigFromJSON)(json['write']),
|
|
41
|
+
'proxy': !(0, runtime_1.exists)(json, 'proxy') ? undefined : (0, BaseProxyConfig_1.BaseProxyConfigFromJSON)(json['proxy']),
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
exports.UpdateInstallationConfigContentFromJSONTyped = UpdateInstallationConfigContentFromJSONTyped;
|
|
@@ -51,6 +53,7 @@ function UpdateInstallationConfigContentToJSON(value) {
|
|
|
51
53
|
'provider': value.provider,
|
|
52
54
|
'read': (0, BaseReadConfig_1.BaseReadConfigToJSON)(value.read),
|
|
53
55
|
'write': (0, BaseWriteConfig_1.BaseWriteConfigToJSON)(value.write),
|
|
56
|
+
'proxy': (0, BaseProxyConfig_1.BaseProxyConfigToJSON)(value.proxy),
|
|
54
57
|
};
|
|
55
58
|
}
|
|
56
59
|
exports.UpdateInstallationConfigContentToJSON = UpdateInstallationConfigContentToJSON;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export * from './ApiKey';
|
|
2
|
+
export * from './ApiKeyRequest';
|
|
3
|
+
export * from './AuthType';
|
|
1
4
|
export * from './BaseConfigContent';
|
|
5
|
+
export * from './BaseProxyConfig';
|
|
2
6
|
export * from './BaseReadConfig';
|
|
3
7
|
export * from './BaseReadConfigStandardObject';
|
|
4
8
|
export * from './BaseWriteConfig';
|
|
@@ -10,6 +14,8 @@ export * from './ConfigContentAllOf';
|
|
|
10
14
|
export * from './Connection';
|
|
11
15
|
export * from './Consumer';
|
|
12
16
|
export * from './CreateConsumerRequest';
|
|
17
|
+
export * from './CreateDestinationRequest';
|
|
18
|
+
export * from './CreateDestinationRequestMetadata';
|
|
13
19
|
export * from './CreateGroupRequest';
|
|
14
20
|
export * from './CreateInstallationRequest';
|
|
15
21
|
export * from './CreateInstallationRequestConfig';
|
|
@@ -18,12 +24,12 @@ export * from './CreateIntegrationRequestLatestRevision';
|
|
|
18
24
|
export * from './CreateProjectRequest';
|
|
19
25
|
export * from './CreateProviderAppRequest';
|
|
20
26
|
export * from './Destination';
|
|
21
|
-
export * from './DestinationMetadata';
|
|
22
27
|
export * from './Group';
|
|
23
28
|
export * from './HydratedIntegration';
|
|
24
29
|
export * from './HydratedIntegrationField';
|
|
25
30
|
export * from './HydratedIntegrationFieldExistent';
|
|
26
31
|
export * from './HydratedIntegrationObject';
|
|
32
|
+
export * from './HydratedIntegrationProxy';
|
|
27
33
|
export * from './HydratedIntegrationRead';
|
|
28
34
|
export * from './HydratedIntegrationWrite';
|
|
29
35
|
export * from './HydratedIntegrationWriteObject';
|
|
@@ -38,19 +44,28 @@ export * from './IntegrationField';
|
|
|
38
44
|
export * from './IntegrationFieldExistent';
|
|
39
45
|
export * from './IntegrationFieldMapping';
|
|
40
46
|
export * from './IntegrationObject';
|
|
47
|
+
export * from './IntegrationProxy';
|
|
41
48
|
export * from './IntegrationRead';
|
|
42
49
|
export * from './IntegrationWrite';
|
|
43
50
|
export * from './IntegrationWriteObject';
|
|
51
|
+
export * from './Log';
|
|
44
52
|
export * from './OauthConnectRequest';
|
|
53
|
+
export * from './OauthOpts';
|
|
45
54
|
export * from './Operation';
|
|
46
|
-
export * from './
|
|
47
|
-
export * from './OperationLog';
|
|
55
|
+
export * from './OperationEvent';
|
|
48
56
|
export * from './OptionalFieldsAutoOption';
|
|
57
|
+
export * from './PatchApiKeyRequest';
|
|
58
|
+
export * from './PatchApiKeyRequestApiKey';
|
|
49
59
|
export * from './Project';
|
|
50
60
|
export * from './ProjectMembership';
|
|
51
61
|
export * from './ProviderApp';
|
|
62
|
+
export * from './ProviderInfo';
|
|
52
63
|
export * from './Revision';
|
|
53
64
|
export * from './SignedUrl';
|
|
65
|
+
export * from './Support';
|
|
66
|
+
export * from './TokenMetadataFields';
|
|
67
|
+
export * from './UpdateDestinationRequest';
|
|
68
|
+
export * from './UpdateDestinationRequestDestination';
|
|
54
69
|
export * from './UpdateInstallationConfigContent';
|
|
55
70
|
export * from './UpdateInstallationRequest';
|
|
56
71
|
export * from './UpdateInstallationRequestInstallation';
|
|
@@ -16,7 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./ApiKey"), exports);
|
|
20
|
+
__exportStar(require("./ApiKeyRequest"), exports);
|
|
21
|
+
__exportStar(require("./AuthType"), exports);
|
|
19
22
|
__exportStar(require("./BaseConfigContent"), exports);
|
|
23
|
+
__exportStar(require("./BaseProxyConfig"), exports);
|
|
20
24
|
__exportStar(require("./BaseReadConfig"), exports);
|
|
21
25
|
__exportStar(require("./BaseReadConfigStandardObject"), exports);
|
|
22
26
|
__exportStar(require("./BaseWriteConfig"), exports);
|
|
@@ -28,6 +32,8 @@ __exportStar(require("./ConfigContentAllOf"), exports);
|
|
|
28
32
|
__exportStar(require("./Connection"), exports);
|
|
29
33
|
__exportStar(require("./Consumer"), exports);
|
|
30
34
|
__exportStar(require("./CreateConsumerRequest"), exports);
|
|
35
|
+
__exportStar(require("./CreateDestinationRequest"), exports);
|
|
36
|
+
__exportStar(require("./CreateDestinationRequestMetadata"), exports);
|
|
31
37
|
__exportStar(require("./CreateGroupRequest"), exports);
|
|
32
38
|
__exportStar(require("./CreateInstallationRequest"), exports);
|
|
33
39
|
__exportStar(require("./CreateInstallationRequestConfig"), exports);
|
|
@@ -36,12 +42,12 @@ __exportStar(require("./CreateIntegrationRequestLatestRevision"), exports);
|
|
|
36
42
|
__exportStar(require("./CreateProjectRequest"), exports);
|
|
37
43
|
__exportStar(require("./CreateProviderAppRequest"), exports);
|
|
38
44
|
__exportStar(require("./Destination"), exports);
|
|
39
|
-
__exportStar(require("./DestinationMetadata"), exports);
|
|
40
45
|
__exportStar(require("./Group"), exports);
|
|
41
46
|
__exportStar(require("./HydratedIntegration"), exports);
|
|
42
47
|
__exportStar(require("./HydratedIntegrationField"), exports);
|
|
43
48
|
__exportStar(require("./HydratedIntegrationFieldExistent"), exports);
|
|
44
49
|
__exportStar(require("./HydratedIntegrationObject"), exports);
|
|
50
|
+
__exportStar(require("./HydratedIntegrationProxy"), exports);
|
|
45
51
|
__exportStar(require("./HydratedIntegrationRead"), exports);
|
|
46
52
|
__exportStar(require("./HydratedIntegrationWrite"), exports);
|
|
47
53
|
__exportStar(require("./HydratedIntegrationWriteObject"), exports);
|
|
@@ -56,19 +62,28 @@ __exportStar(require("./IntegrationField"), exports);
|
|
|
56
62
|
__exportStar(require("./IntegrationFieldExistent"), exports);
|
|
57
63
|
__exportStar(require("./IntegrationFieldMapping"), exports);
|
|
58
64
|
__exportStar(require("./IntegrationObject"), exports);
|
|
65
|
+
__exportStar(require("./IntegrationProxy"), exports);
|
|
59
66
|
__exportStar(require("./IntegrationRead"), exports);
|
|
60
67
|
__exportStar(require("./IntegrationWrite"), exports);
|
|
61
68
|
__exportStar(require("./IntegrationWriteObject"), exports);
|
|
69
|
+
__exportStar(require("./Log"), exports);
|
|
62
70
|
__exportStar(require("./OauthConnectRequest"), exports);
|
|
71
|
+
__exportStar(require("./OauthOpts"), exports);
|
|
63
72
|
__exportStar(require("./Operation"), exports);
|
|
64
|
-
__exportStar(require("./
|
|
65
|
-
__exportStar(require("./OperationLog"), exports);
|
|
73
|
+
__exportStar(require("./OperationEvent"), exports);
|
|
66
74
|
__exportStar(require("./OptionalFieldsAutoOption"), exports);
|
|
75
|
+
__exportStar(require("./PatchApiKeyRequest"), exports);
|
|
76
|
+
__exportStar(require("./PatchApiKeyRequestApiKey"), exports);
|
|
67
77
|
__exportStar(require("./Project"), exports);
|
|
68
78
|
__exportStar(require("./ProjectMembership"), exports);
|
|
69
79
|
__exportStar(require("./ProviderApp"), exports);
|
|
80
|
+
__exportStar(require("./ProviderInfo"), exports);
|
|
70
81
|
__exportStar(require("./Revision"), exports);
|
|
71
82
|
__exportStar(require("./SignedUrl"), exports);
|
|
83
|
+
__exportStar(require("./Support"), exports);
|
|
84
|
+
__exportStar(require("./TokenMetadataFields"), exports);
|
|
85
|
+
__exportStar(require("./UpdateDestinationRequest"), exports);
|
|
86
|
+
__exportStar(require("./UpdateDestinationRequestDestination"), exports);
|
|
72
87
|
__exportStar(require("./UpdateInstallationConfigContent"), exports);
|
|
73
88
|
__exportStar(require("./UpdateInstallationRequest"), exports);
|
|
74
89
|
__exportStar(require("./UpdateInstallationRequestInstallation"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SuccessCheckmarkIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuccessCheckmarkIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function SuccessCheckmarkIcon() {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "24", cy: "24", r: "24", fill: "#BBF7D0" }), (0, jsx_runtime_1.jsx)("path", { d: "M34.6666 18.6667L20 32.0001L13.3333 25.9395", stroke: "#16A34A", strokeWidth: "5.33333", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
7
|
+
}
|
|
8
|
+
exports.SuccessCheckmarkIcon = SuccessCheckmarkIcon;
|
|
@@ -8,6 +8,7 @@ const InstallIntegrationContextProvider_1 = require("../../context/InstallIntegr
|
|
|
8
8
|
const ProjectContextProvider_1 = require("../../context/ProjectContextProvider");
|
|
9
9
|
const ErrorTextBox_1 = require("../ErrorTextBox");
|
|
10
10
|
const InstallationContent_1 = require("./content/InstallationContent");
|
|
11
|
+
const ConditionalProxyLayout_1 = require("./layout/ConditionalProxyLayout/ConditionalProxyLayout");
|
|
11
12
|
const ProtectedConnectionLayout_1 = require("./layout/ProtectedConnectionLayout");
|
|
12
13
|
const ObjectManagementNav_1 = require("./nav/ObjectManagementNav");
|
|
13
14
|
const ConfigurationStateProvider_1 = require("./state/ConfigurationStateProvider");
|
|
@@ -21,6 +22,6 @@ function InstallIntegration({ integration, consumerRef, consumerName, groupRef,
|
|
|
21
22
|
}
|
|
22
23
|
return (
|
|
23
24
|
// install integration provider provides all props, integrationObj and installation
|
|
24
|
-
(0, jsx_runtime_1.jsx)(InstallIntegrationContextProvider_1.InstallIntegrationProvider, { integration: integration, consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, onInstallSuccess: onInstallSuccess, onUpdateSuccess: onUpdateSuccess, children: (0, jsx_runtime_1.jsx)(ConnectionsContextProvider_1.ConnectionsProvider, { groupRef: groupRef, children: (0, jsx_runtime_1.jsx)(ProtectedConnectionLayout_1.ProtectedConnectionLayout, { consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, children: (0, jsx_runtime_1.jsx)(HydratedRevisionContext_1.HydratedRevisionProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(ConfigurationStateProvider_1.ConfigurationProvider, { children: (0, jsx_runtime_1.jsx)(ObjectManagementNav_1.ObjectManagementNav, { children: (0, jsx_runtime_1.jsx)(InstallationContent_1.InstallationContent, {}) }) }) }) }) }) }));
|
|
25
|
+
(0, jsx_runtime_1.jsx)(InstallIntegrationContextProvider_1.InstallIntegrationProvider, { integration: integration, consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, onInstallSuccess: onInstallSuccess, onUpdateSuccess: onUpdateSuccess, children: (0, jsx_runtime_1.jsx)(ConnectionsContextProvider_1.ConnectionsProvider, { groupRef: groupRef, children: (0, jsx_runtime_1.jsx)(ProtectedConnectionLayout_1.ProtectedConnectionLayout, { consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, children: (0, jsx_runtime_1.jsx)(HydratedRevisionContext_1.HydratedRevisionProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(ConditionalProxyLayout_1.ConditionalProxyLayout, { children: (0, jsx_runtime_1.jsx)(ConfigurationStateProvider_1.ConfigurationProvider, { children: (0, jsx_runtime_1.jsx)(ObjectManagementNav_1.ObjectManagementNav, { children: (0, jsx_runtime_1.jsx)(InstallationContent_1.InstallationContent, {}) }) }) }) }) }) }) }));
|
|
25
26
|
}
|
|
26
27
|
exports.InstallIntegration = InstallIntegration;
|
package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Config, CreateInstallationRequestConfig, Installation } from '../../../../services/api';
|
|
2
|
+
export type CreateInstallationSharedProps = {
|
|
3
|
+
projectId: string;
|
|
4
|
+
integrationId: string;
|
|
5
|
+
groupRef: string;
|
|
6
|
+
connectionId: string;
|
|
7
|
+
apiKey: string;
|
|
8
|
+
setInstallation: (installationObj: Installation) => void;
|
|
9
|
+
onInstallSuccess?: (installationId: string, config: Config) => void;
|
|
10
|
+
};
|
|
11
|
+
type CreateInstallationAndSetStateProps = CreateInstallationSharedProps & {
|
|
12
|
+
createConfig: CreateInstallationRequestConfig;
|
|
13
|
+
};
|
|
14
|
+
export declare function createInstallationAndSetState({ createConfig, projectId, integrationId, groupRef, connectionId, apiKey, setInstallation, onInstallSuccess, }: CreateInstallationAndSetStateProps): Promise<void>;
|
|
15
|
+
export {};
|
package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createInstallationAndSetState = void 0;
|
|
4
|
+
const api_1 = require("../../../../services/api");
|
|
5
|
+
function createInstallationAndSetState({ createConfig, projectId, integrationId, groupRef, connectionId, apiKey, setInstallation, onInstallSuccess, }) {
|
|
6
|
+
const createInstallationRequest = {
|
|
7
|
+
projectId,
|
|
8
|
+
integrationId,
|
|
9
|
+
installation: {
|
|
10
|
+
groupRef,
|
|
11
|
+
connectionId,
|
|
12
|
+
config: createConfig,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return (0, api_1.api)().installationApi.createInstallation(createInstallationRequest, {
|
|
16
|
+
headers: {
|
|
17
|
+
'X-Api-Key': apiKey,
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
.then((installation) => {
|
|
22
|
+
// update local installation state
|
|
23
|
+
setInstallation(installation);
|
|
24
|
+
onInstallSuccess === null || onInstallSuccess === void 0 ? void 0 : onInstallSuccess(installation.id, installation.config);
|
|
25
|
+
})
|
|
26
|
+
.catch((err) => {
|
|
27
|
+
console.error('ERROR: ', err);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.createInstallationAndSetState = createInstallationAndSetState;
|
package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Config, Installation, UpdateInstallationRequestInstallationConfig } from '../../../../services/api';
|
|
2
|
+
type UpdateInstallationSharedProps = {
|
|
3
|
+
projectId: string;
|
|
4
|
+
integrationId: string;
|
|
5
|
+
installationId: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
selectedObjectName: string;
|
|
8
|
+
setInstallation: (installationObj: Installation) => void;
|
|
9
|
+
onUpdateSuccess?: (installationId: string, config: Config) => void;
|
|
10
|
+
};
|
|
11
|
+
type UpdateInstallationAndSetStateProps = UpdateInstallationSharedProps & {
|
|
12
|
+
updateConfig: UpdateInstallationRequestInstallationConfig;
|
|
13
|
+
};
|
|
14
|
+
export declare function updateInstallationAndSetState({ updateConfig, projectId, integrationId, installationId, apiKey, selectedObjectName, setInstallation, onUpdateSuccess, }: UpdateInstallationAndSetStateProps): Promise<void>;
|
|
15
|
+
export {};
|
package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateInstallationAndSetState = void 0;
|
|
4
|
+
const api_1 = require("../../../../services/api");
|
|
5
|
+
function updateInstallationAndSetState({ updateConfig, projectId, integrationId, installationId, apiKey, selectedObjectName, setInstallation, onUpdateSuccess, }) {
|
|
6
|
+
const updateInstallationRequest = {
|
|
7
|
+
projectId,
|
|
8
|
+
installationId,
|
|
9
|
+
integrationId,
|
|
10
|
+
installationUpdate: {
|
|
11
|
+
// update mask will recurse to the object path and replace the object at the object path
|
|
12
|
+
// this example will replace the object at the object (i.e. accounts)
|
|
13
|
+
updateMask: [`config.content.read.standardObjects.${selectedObjectName}`],
|
|
14
|
+
installation: {
|
|
15
|
+
config: updateConfig,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
// call api.updateInstallation
|
|
20
|
+
return (0, api_1.api)().installationApi.updateInstallation(updateInstallationRequest, {
|
|
21
|
+
headers: {
|
|
22
|
+
'X-Api-Key': apiKey,
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
},
|
|
25
|
+
}).then((installation) => {
|
|
26
|
+
// update local installation state
|
|
27
|
+
setInstallation(installation);
|
|
28
|
+
onUpdateSuccess === null || onUpdateSuccess === void 0 ? void 0 : onUpdateSuccess(installation.id, installation.config);
|
|
29
|
+
}).catch((err) => {
|
|
30
|
+
console.error('ERROR: ', err);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.updateInstallationAndSetState = updateInstallationAndSetState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIsProxyEnabled = void 0;
|
|
4
|
+
function getIsProxyEnabled(hydratedRevision) {
|
|
5
|
+
var _a;
|
|
6
|
+
return (_a = hydratedRevision.content.proxy) === null || _a === void 0 ? void 0 : _a.enabled;
|
|
7
|
+
}
|
|
8
|
+
exports.getIsProxyEnabled = getIsProxyEnabled;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HydratedRevision } from '../../../../services/api';
|
|
2
|
+
import { CreateInstallationSharedProps } from '../mutateAndSetState/createInstallationAndSetState';
|
|
3
|
+
type CreateInstallationProxyOnlyProps = CreateInstallationSharedProps & {
|
|
4
|
+
hydratedRevision: HydratedRevision;
|
|
5
|
+
consumerRef: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function onCreateInstallationProxyOnly({ projectId, integrationId, groupRef, consumerRef, connectionId, apiKey, hydratedRevision, setInstallation, onInstallSuccess, }: CreateInstallationProxyOnlyProps): Promise<void> | Promise<null>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onCreateInstallationProxyOnly = void 0;
|
|
4
|
+
const createInstallationAndSetState_1 = require("../mutateAndSetState/createInstallationAndSetState");
|
|
5
|
+
/**
|
|
6
|
+
* given a hydratedRevision and consumerRef,
|
|
7
|
+
* generate the config object that is need for create installation request with proxy only.
|
|
8
|
+
*
|
|
9
|
+
* @param hydratedRevision
|
|
10
|
+
* @param consumerRef
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
const generateProxyOnlyConfig = (hydratedRevision, consumerRef) => {
|
|
14
|
+
// create config request object
|
|
15
|
+
const createConfigObj = {
|
|
16
|
+
revisionId: hydratedRevision.id,
|
|
17
|
+
createdBy: `consumer:${consumerRef}`,
|
|
18
|
+
content: {
|
|
19
|
+
provider: hydratedRevision.content.provider,
|
|
20
|
+
proxy: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
return createConfigObj;
|
|
26
|
+
};
|
|
27
|
+
function onCreateInstallationProxyOnly({ projectId, integrationId, groupRef, consumerRef, connectionId, apiKey, hydratedRevision, setInstallation, onInstallSuccess, }) {
|
|
28
|
+
const createConfig = generateProxyOnlyConfig(hydratedRevision, consumerRef);
|
|
29
|
+
if (!createConfig) {
|
|
30
|
+
console.error('Error when generating createConfig from configureState');
|
|
31
|
+
return Promise.resolve(null);
|
|
32
|
+
}
|
|
33
|
+
return (0, createInstallationAndSetState_1.createInstallationAndSetState)({
|
|
34
|
+
createConfig,
|
|
35
|
+
projectId,
|
|
36
|
+
integrationId,
|
|
37
|
+
groupRef,
|
|
38
|
+
connectionId,
|
|
39
|
+
apiKey,
|
|
40
|
+
setInstallation,
|
|
41
|
+
onInstallSuccess,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.onCreateInstallationProxyOnly = onCreateInstallationProxyOnly;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Config, HydratedRevision, Installation } from '
|
|
2
|
-
import { ConfigureState } from '
|
|
1
|
+
import { Config, HydratedRevision, Installation } from '../../../../services/api';
|
|
2
|
+
import { ConfigureState } from '../../types';
|
|
3
3
|
export declare const onSaveReadCreateInstallation: (projectId: string, integrationId: string, groupRef: string, consumerRef: string, connectionId: string, objectName: string, apiKey: string, hydratedRevision: HydratedRevision, configureState: ConfigureState, setInstallation: (installationObj: Installation) => void, onInstallSuccess?: ((installationId: string, config: Config) => void) | undefined) => Promise<void | null>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onSaveReadCreateInstallation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const utils_1 = require("../../state/utils");
|
|
5
|
+
const createInstallationAndSetState_1 = require("../mutateAndSetState/createInstallationAndSetState");
|
|
6
|
+
const isProxyEnabled_1 = require("../proxy/isProxyEnabled");
|
|
6
7
|
/**
|
|
7
8
|
* gets matching object from hydratedRevision
|
|
8
9
|
* @param hydratedRevision
|
|
@@ -56,6 +57,11 @@ const generateCreateReadConfigFromConfigureState = (configureState, objectName,
|
|
|
56
57
|
},
|
|
57
58
|
},
|
|
58
59
|
};
|
|
60
|
+
// insert proxy into config if it is enabled
|
|
61
|
+
const isProxyEnabled = (0, isProxyEnabled_1.getIsProxyEnabled)(hydratedRevision);
|
|
62
|
+
if (isProxyEnabled) {
|
|
63
|
+
createConfigObj.content.proxy = { enabled: true };
|
|
64
|
+
}
|
|
59
65
|
return createConfigObj;
|
|
60
66
|
};
|
|
61
67
|
const onSaveReadCreateInstallation = (projectId, integrationId, groupRef, consumerRef, connectionId, objectName, apiKey, hydratedRevision, configureState, setInstallation, onInstallSuccess) => {
|
|
@@ -64,28 +70,15 @@ const onSaveReadCreateInstallation = (projectId, integrationId, groupRef, consum
|
|
|
64
70
|
console.error('Error when generating createConfig from configureState');
|
|
65
71
|
return Promise.resolve(null);
|
|
66
72
|
}
|
|
67
|
-
|
|
73
|
+
return (0, createInstallationAndSetState_1.createInstallationAndSetState)({
|
|
74
|
+
createConfig,
|
|
68
75
|
projectId,
|
|
69
76
|
integrationId,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
return (0, api_1.api)().installationApi.createInstallation(createInstallationRequest, {
|
|
77
|
-
headers: {
|
|
78
|
-
'X-Api-Key': apiKey,
|
|
79
|
-
'Content-Type': 'application/json',
|
|
80
|
-
},
|
|
81
|
-
})
|
|
82
|
-
.then((installation) => {
|
|
83
|
-
// update local installation state
|
|
84
|
-
setInstallation(installation);
|
|
85
|
-
onInstallSuccess === null || onInstallSuccess === void 0 ? void 0 : onInstallSuccess(installation.id, installation.config);
|
|
86
|
-
})
|
|
87
|
-
.catch((err) => {
|
|
88
|
-
console.error('ERROR: ', err);
|
|
77
|
+
groupRef,
|
|
78
|
+
connectionId,
|
|
79
|
+
apiKey,
|
|
80
|
+
setInstallation,
|
|
81
|
+
onInstallSuccess,
|
|
89
82
|
});
|
|
90
83
|
};
|
|
91
84
|
exports.onSaveReadCreateInstallation = onSaveReadCreateInstallation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Config, HydratedIntegrationObject, HydratedRevision, Installation } from '../../../../services/api';
|
|
2
|
+
import { ConfigureState } from '../../types';
|
|
3
|
+
export declare const onSaveReadUpdateInstallation: (projectId: string, integrationId: string, installationId: string, selectedObjectName: string, apiKey: string, configureState: ConfigureState, setInstallation: (installationObj: Installation) => void, hydratedObject: HydratedIntegrationObject, hydratedRevision: HydratedRevision, onUpdateSuccess?: ((installationId: string, config: Config) => void) | undefined) => Promise<void | null>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onSaveReadUpdateInstallation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const utils_1 = require("../../state/utils");
|
|
5
|
+
const updateInstallationAndSetState_1 = require("../mutateAndSetState/updateInstallationAndSetState");
|
|
6
|
+
const isProxyEnabled_1 = require("../proxy/isProxyEnabled");
|
|
6
7
|
/**
|
|
7
8
|
* given a configureState, config, and objectName, generate the config object that is need for
|
|
8
9
|
* update installation request.
|
|
@@ -19,7 +20,7 @@ const utils_1 = require("../state/utils");
|
|
|
19
20
|
* @param schedule
|
|
20
21
|
* @returns
|
|
21
22
|
*/
|
|
22
|
-
const generateUpdateReadConfigFromConfigureState = (configureState, objectName, hydratedObject, schedule) => {
|
|
23
|
+
const generateUpdateReadConfigFromConfigureState = (configureState, objectName, hydratedObject, schedule, hydratedRevision) => {
|
|
23
24
|
const selectedFields = (0, utils_1.generateSelectedFieldsFromConfigureState)(configureState);
|
|
24
25
|
const selectedFieldMappings = (0, utils_1.generateSelectedFieldMappingsFromConfigureState)(configureState);
|
|
25
26
|
// config request object type needs to be fixed
|
|
@@ -39,41 +40,32 @@ const generateUpdateReadConfigFromConfigureState = (configureState, objectName,
|
|
|
39
40
|
},
|
|
40
41
|
},
|
|
41
42
|
};
|
|
43
|
+
// insert proxy into config if it is enabled
|
|
44
|
+
const isProxyEnabled = (0, isProxyEnabled_1.getIsProxyEnabled)(hydratedRevision);
|
|
45
|
+
if (isProxyEnabled) {
|
|
46
|
+
if (!updateConfigObject.content)
|
|
47
|
+
updateConfigObject.content = {};
|
|
48
|
+
updateConfigObject.content.proxy = { enabled: true };
|
|
49
|
+
}
|
|
42
50
|
return updateConfigObject;
|
|
43
51
|
};
|
|
44
|
-
const onSaveReadUpdateInstallation = (projectId, integrationId, installationId, selectedObjectName, apiKey, configureState, setInstallation, hydratedObject, onUpdateSuccess) => {
|
|
52
|
+
const onSaveReadUpdateInstallation = (projectId, integrationId, installationId, selectedObjectName, apiKey, configureState, setInstallation, hydratedObject, hydratedRevision, onUpdateSuccess) => {
|
|
45
53
|
// get configuration state
|
|
46
54
|
// transform configuration state to update shape
|
|
47
|
-
const updateConfig = generateUpdateReadConfigFromConfigureState(configureState, selectedObjectName || '', hydratedObject, hydratedObject.schedule);
|
|
55
|
+
const updateConfig = generateUpdateReadConfigFromConfigureState(configureState, selectedObjectName || '', hydratedObject, hydratedObject.schedule, hydratedRevision);
|
|
48
56
|
if (!updateConfig) {
|
|
49
57
|
console.error('Error when generating updateConfig from configureState');
|
|
50
58
|
return Promise.resolve(null);
|
|
51
59
|
}
|
|
52
|
-
|
|
60
|
+
return (0, updateInstallationAndSetState_1.updateInstallationAndSetState)({
|
|
61
|
+
updateConfig,
|
|
53
62
|
projectId,
|
|
54
|
-
installationId,
|
|
55
63
|
integrationId,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
config: updateConfig,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
// call api.updateInstallation
|
|
66
|
-
return (0, api_1.api)().installationApi.updateInstallation(updateInstallationRequest, {
|
|
67
|
-
headers: {
|
|
68
|
-
'X-Api-Key': apiKey,
|
|
69
|
-
'Content-Type': 'application/json',
|
|
70
|
-
},
|
|
71
|
-
}).then((installation) => {
|
|
72
|
-
// update local installation state
|
|
73
|
-
setInstallation(installation);
|
|
74
|
-
onUpdateSuccess === null || onUpdateSuccess === void 0 ? void 0 : onUpdateSuccess(installation.id, installation.config);
|
|
75
|
-
}).catch((err) => {
|
|
76
|
-
console.error('ERROR: ', err);
|
|
64
|
+
installationId,
|
|
65
|
+
apiKey,
|
|
66
|
+
selectedObjectName,
|
|
67
|
+
setInstallation,
|
|
68
|
+
onUpdateSuccess,
|
|
77
69
|
});
|
|
78
70
|
};
|
|
79
71
|
exports.onSaveReadUpdateInstallation = onSaveReadUpdateInstallation;
|