@amp-labs/react 1.1.0 → 1.3.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/AllowedDomainApi.d.ts +79 -0
- package/build/generated-sources/api/src/apis/AllowedDomainApi.js +101 -0
- package/build/generated-sources/api/src/apis/ConnectionApi.d.ts +82 -0
- package/build/generated-sources/api/src/apis/ConnectionApi.js +107 -0
- package/build/generated-sources/api/src/apis/ConsumerApi.d.ts +52 -0
- package/build/generated-sources/api/src/apis/ConsumerApi.js +75 -0
- package/build/generated-sources/api/src/apis/DestinationApi.d.ts +102 -0
- package/build/generated-sources/api/src/apis/DestinationApi.js +126 -0
- package/build/generated-sources/api/src/apis/GroupApi.d.ts +52 -0
- package/build/generated-sources/api/src/apis/GroupApi.js +75 -0
- package/build/generated-sources/api/src/apis/InstallationApi.d.ts +196 -0
- package/build/generated-sources/api/src/apis/InstallationApi.js +235 -0
- package/build/generated-sources/api/src/apis/IntegrationApi.d.ts +128 -0
- package/build/generated-sources/api/src/apis/IntegrationApi.js +151 -0
- package/build/generated-sources/api/src/apis/OAuthApi.d.ts +76 -0
- package/build/generated-sources/api/src/apis/OAuthApi.js +102 -0
- package/build/generated-sources/api/src/apis/OperationApi.d.ts +80 -0
- package/build/generated-sources/api/src/apis/OperationApi.js +104 -0
- package/build/generated-sources/api/src/apis/OperationLogApi.d.ts +55 -0
- package/build/generated-sources/api/src/apis/OperationLogApi.js +76 -0
- package/build/generated-sources/api/src/apis/ProjectApi.d.ts +124 -0
- package/build/generated-sources/api/src/apis/ProjectApi.js +148 -0
- package/build/generated-sources/api/src/apis/ProjectMembershipApi.d.ts +126 -0
- package/build/generated-sources/api/src/apis/ProjectMembershipApi.js +154 -0
- package/build/generated-sources/api/src/apis/ProviderAppApi.d.ts +130 -0
- package/build/generated-sources/api/src/apis/ProviderAppApi.js +158 -0
- package/build/generated-sources/api/src/apis/RevisionApi.d.ts +87 -0
- package/build/generated-sources/api/src/apis/RevisionApi.js +113 -0
- package/build/generated-sources/api/src/apis/UploadURLApi.d.ts +46 -0
- package/build/generated-sources/api/src/apis/UploadURLApi.js +68 -0
- package/build/generated-sources/api/src/apis/index.d.ts +15 -1
- package/build/generated-sources/api/src/apis/index.js +15 -1
- 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/Destination.d.ts +44 -0
- package/build/generated-sources/api/src/models/Destination.js +57 -0
- package/build/generated-sources/api/src/models/DestinationMetadata.d.ts +39 -0
- package/build/generated-sources/api/src/models/{CreateDestinationRequestMetadata.js → DestinationMetadata.js} +11 -11
- 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/OauthConnectRequest.d.ts +6 -6
- package/build/generated-sources/api/src/models/OauthConnectRequest.js +1 -2
- 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/OperationLog.d.ts +43 -0
- package/build/generated-sources/api/src/models/OperationLog.js +56 -0
- package/build/generated-sources/api/src/models/ProviderApp.d.ts +6 -0
- package/build/generated-sources/api/src/models/ProviderApp.js +2 -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 +6 -3
- package/build/generated-sources/api/src/models/index.js +6 -3
- package/build/src/assets/SuccessIcon.d.ts +1 -0
- package/build/src/assets/SuccessIcon.js +8 -0
- package/build/src/assets/TrashIcon.js +3 -1
- package/build/src/components/Configure/InstallIntegration.d.ts +4 -1
- package/build/src/components/Configure/InstallIntegration.js +11 -23
- package/build/src/components/Configure/actions/createInstallationReducer.d.ts +15 -0
- package/build/src/components/Configure/actions/createInstallationReducer.js +30 -0
- package/build/src/components/Configure/actions/onSaveReadCreateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/{onSaveCreate.js → onSaveReadCreateInstallation.js} +13 -25
- package/build/src/components/Configure/actions/onSaveReadUpdateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/{onSaveUpdate.js → onSaveReadUpdateInstallation.js} +13 -8
- package/build/src/components/Configure/actions/proxy/createInstallationProxyOnly.d.ts +8 -0
- package/build/src/components/Configure/actions/proxy/createInstallationProxyOnly.js +44 -0
- package/build/src/components/Configure/actions/write/generateConfigWriteObjects.d.ts +26 -0
- package/build/src/components/Configure/actions/write/generateConfigWriteObjects.js +41 -0
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +72 -0
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.js +60 -0
- package/build/src/components/Configure/{ConfigureInstallationBase.d.ts → content/ConfigureInstallationBase.d.ts} +2 -1
- package/build/src/components/Configure/content/ConfigureInstallationBase.js +36 -0
- package/build/src/components/Configure/content/CreateInstallation.js +83 -0
- package/build/src/components/Configure/content/InstallationContent.d.ts +1 -0
- package/build/src/components/Configure/content/InstallationContent.js +20 -0
- package/build/src/components/Configure/{UninstallContent.js → content/UninstallContent.js} +10 -9
- package/build/src/components/Configure/{UpdateInstallation.d.ts → content/UpdateInstallation.d.ts} +1 -1
- package/build/src/components/Configure/{UpdateInstallation.js → content/UpdateInstallation.js} +42 -28
- package/build/src/components/Configure/{fields → content/fields}/FieldMappings/FieldMapping.d.ts +1 -1
- package/build/src/components/Configure/{fields → content/fields}/FieldMappings/FieldMapping.js +4 -7
- package/build/src/components/Configure/{fields → content/fields}/FieldMappings/RequiredFieldMappings.js +10 -11
- package/build/src/components/Configure/{fields → content/fields}/FieldMappings/setFieldMapping.d.ts +1 -1
- package/build/src/components/Configure/content/fields/FieldMappings/setFieldMapping.js +21 -0
- package/build/src/components/Configure/{fields → content/fields}/OptionalFields/OptionalFields.js +9 -14
- package/build/src/components/Configure/{fields → content/fields}/OptionalFields/setOptionalField.d.ts +1 -1
- package/build/src/components/Configure/content/fields/OptionalFields/setOptionalField.js +27 -0
- package/build/src/components/Configure/content/fields/ReadFields.d.ts +1 -0
- package/build/src/components/Configure/content/fields/ReadFields.js +11 -0
- package/build/src/components/Configure/content/fields/RequiredFields.js +23 -0
- package/build/src/components/Configure/content/fields/WriteFields/WriteFields.d.ts +1 -0
- package/build/src/components/Configure/content/fields/WriteFields/WriteFields.js +22 -0
- package/build/src/components/Configure/content/fields/WriteFields/index.d.ts +2 -0
- package/build/src/components/Configure/content/fields/WriteFields/index.js +5 -0
- package/build/src/components/Configure/content/fields/WriteFields/setNonConfigurableWriteField.d.ts +3 -0
- package/build/src/components/Configure/content/fields/WriteFields/setNonConfigurableWriteField.js +32 -0
- package/build/src/components/Configure/content/useMutateInstallation.d.ts +23 -0
- package/build/src/components/Configure/content/useMutateInstallation.js +47 -0
- package/build/src/components/Configure/content/useSelectedConfigureState.d.ts +72 -0
- package/build/src/components/Configure/content/useSelectedConfigureState.js +24 -0
- 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/{ProtectedConnectionLayout.d.ts → layout/ProtectedConnectionLayout.d.ts} +2 -1
- package/build/src/components/Configure/{ProtectedConnectionLayout.js → layout/ProtectedConnectionLayout.js} +13 -13
- package/build/src/components/Configure/{ObjectManagementNav → nav/ObjectManagementNav}/NavObjectItem.d.ts +1 -0
- package/build/src/components/Configure/{ObjectManagementNav → nav/ObjectManagementNav}/NavObjectItem.js +3 -3
- package/build/src/components/Configure/nav/ObjectManagementNav/OtherTab.d.ts +7 -0
- package/build/src/components/Configure/nav/ObjectManagementNav/OtherTab.js +11 -0
- package/build/src/components/Configure/{ObjectManagementNav → nav/ObjectManagementNav}/UninstallInstallation.d.ts +1 -1
- package/build/src/components/Configure/{ObjectManagementNav → nav/ObjectManagementNav}/UninstallInstallation.js +2 -2
- package/build/src/components/Configure/nav/ObjectManagementNav/constant.d.ts +1 -0
- package/build/src/components/Configure/nav/ObjectManagementNav/constant.js +4 -0
- package/build/src/components/Configure/{ObjectManagementNav → nav/ObjectManagementNav}/index.d.ts +1 -0
- package/build/src/components/Configure/nav/ObjectManagementNav/index.js +61 -0
- package/build/src/components/Configure/state/ConfigurationStateProvider.d.ts +70 -42
- package/build/src/components/Configure/state/ConfigurationStateProvider.js +39 -17
- package/build/src/components/Configure/state/HydratedRevisionContext.js +11 -9
- package/build/src/components/Configure/state/utils.d.ts +2 -2
- package/build/src/components/Configure/state/utils.js +44 -19
- package/build/src/components/Configure/types.d.ts +22 -6
- package/build/src/components/Configure/utils.d.ts +3 -2
- package/build/src/components/Configure/utils.js +25 -5
- package/build/src/components/Connect/ConnectProvider.d.ts +3 -1
- package/build/src/components/Connect/ConnectProvider.js +6 -12
- package/build/src/components/Connect/ConnectedSuccessBox.d.ts +5 -0
- package/build/src/components/Connect/ConnectedSuccessBox.js +13 -0
- package/build/src/components/Connect/useConnectionHandler.d.ts +10 -0
- package/build/src/components/Connect/useConnectionHandler.js +24 -0
- package/build/src/components/ErrorTextBox.js +11 -0
- package/build/src/components/Oauth/NoSubdomainEntry/LandingContent.d.ts +8 -0
- package/build/src/components/Oauth/{Hubspot/HubspotLandingContent.js → NoSubdomainEntry/LandingContent.js} +5 -4
- package/build/src/components/Oauth/NoSubdomainEntry/NoSubdomainOauthFlow.d.ts +16 -0
- package/build/src/components/Oauth/{Hubspot/HubspotOauthFlow.js → NoSubdomainEntry/NoSubdomainOauthFlow.js} +14 -14
- package/build/src/components/{Connect → Oauth}/OAuthPopup.js +8 -10
- package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.js +5 -5
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.js +1 -1
- package/build/src/components/Oauth/fetchOAuthCallbackURL.d.ts +1 -1
- package/build/src/components/Oauth/fetchOAuthCallbackURL.js +3 -4
- package/build/src/components/RedirectHandler/RedirectHandler.d.ts +15 -0
- package/build/src/components/RedirectHandler/RedirectHandler.js +31 -0
- package/build/src/components/RedirectHandler/index.d.ts +1 -0
- package/build/src/components/RedirectHandler/index.js +5 -0
- package/build/src/components/SuccessTextBox.d.ts +5 -0
- package/build/src/components/SuccessTextBox.js +10 -0
- package/build/src/{components/AmpersandProvider/AmpersandProvider.js → context/AmpersandContextProvider/AmpersandContextProvider.js} +6 -6
- package/build/src/context/AmpersandContextProvider/index.d.ts +1 -0
- package/build/src/{components/AmpersandProvider → context/AmpersandContextProvider}/index.js +1 -1
- package/build/src/context/{ConnectionsContext.js → ConnectionsContextProvider.js} +11 -10
- package/build/src/context/{InstallIntegrationContext.d.ts → InstallIntegrationContextProvider.d.ts} +7 -2
- package/build/src/context/{InstallIntegrationContext.js → InstallIntegrationContextProvider.js} +29 -14
- package/build/src/context/{IntegrationListContext.js → IntegrationListContextProvider.js} +4 -4
- package/build/src/context/{ProjectContext.js → ProjectContextProvider.js} +4 -4
- package/build/src/hooks/useIsIntegrationInstalled.js +7 -7
- package/build/src/index.d.ts +1 -2
- package/build/src/index.js +1 -2
- package/build/src/public/index.d.ts +7 -0
- package/build/src/{components → public}/index.js +7 -3
- package/build/src/services/ApiService.d.ts +27 -0
- package/build/src/services/ApiService.js +34 -0
- package/build/src/services/api.d.ts +5 -4
- package/build/src/services/api.js +26 -19
- package/package.json +2 -2
- package/build/generated-sources/api/src/apis/DefaultApi.d.ts +0 -930
- package/build/generated-sources/api/src/apis/DefaultApi.js +0 -1019
- package/build/generated-sources/api/src/models/CreateDestinationRequest.d.ts +0 -44
- package/build/generated-sources/api/src/models/CreateDestinationRequest.js +0 -57
- package/build/generated-sources/api/src/models/CreateDestinationRequestMetadata.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/AmpersandProvider/index.d.ts +0 -1
- package/build/src/components/CenteredTextBox/CenteredTextBox.d.ts +0 -5
- package/build/src/components/CenteredTextBox/CenteredTextBox.js +0 -8
- package/build/src/components/Configure/ConfigureInstallationBase.js +0 -29
- package/build/src/components/Configure/CreateInstallation.js +0 -70
- package/build/src/components/Configure/ErrorTextBox.js +0 -9
- package/build/src/components/Configure/ObjectManagementNav/index.js +0 -53
- package/build/src/components/Configure/actions/onSaveCreate.d.ts +0 -3
- package/build/src/components/Configure/actions/onSaveUpdate.d.ts +0 -3
- package/build/src/components/Configure/fields/FieldMappings/setFieldMapping.js +0 -18
- package/build/src/components/Configure/fields/OptionalFields/setOptionalField.js +0 -21
- package/build/src/components/Configure/fields/RequiredFields.js +0 -27
- package/build/src/components/Oauth/Hubspot/HubspotLandingContent.d.ts +0 -7
- package/build/src/components/Oauth/Hubspot/HubspotOauthFlow.d.ts +0 -15
- package/build/src/components/index.d.ts +0 -3
- /package/build/src/components/Configure/{CreateInstallation.d.ts → content/CreateInstallation.d.ts} +0 -0
- /package/build/src/components/Configure/{UninstallContent.d.ts → content/UninstallContent.d.ts} +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/FieldHeader.d.ts +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/FieldHeader.js +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/FieldMappings/RequiredFieldMappings.d.ts +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/FieldMappings/index.d.ts +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/FieldMappings/index.js +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/OptionalFields/OptionalFields.d.ts +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/OptionalFields/index.d.ts +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/OptionalFields/index.js +0 -0
- /package/build/src/components/Configure/{fields → content/fields}/RequiredFields.d.ts +0 -0
- /package/build/src/components/{Configure/ErrorTextBox.d.ts → ErrorTextBox.d.ts} +0 -0
- /package/build/src/components/{Connect → Oauth}/OAuthPopup.d.ts +0 -0
- /package/build/src/{components/AmpersandProvider/AmpersandProvider.d.ts → context/AmpersandContextProvider/AmpersandContextProvider.d.ts} +0 -0
- /package/build/src/context/{ApiKeyProvider.d.ts → ApiKeyContextProvider.d.ts} +0 -0
- /package/build/src/context/{ApiKeyProvider.js → ApiKeyContextProvider.js} +0 -0
- /package/build/src/context/{ConnectionsContext.d.ts → ConnectionsContextProvider.d.ts} +0 -0
- /package/build/src/context/{IntegrationListContext.d.ts → IntegrationListContextProvider.d.ts} +0 -0
- /package/build/src/context/{ProjectContext.d.ts → ProjectContextProvider.d.ts} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface OperationLog
|
|
16
|
+
*/
|
|
17
|
+
export interface OperationLog {
|
|
18
|
+
/**
|
|
19
|
+
* The time the log was created.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof OperationLog
|
|
22
|
+
*/
|
|
23
|
+
timestamp: string;
|
|
24
|
+
/**
|
|
25
|
+
* The log message.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof OperationLog
|
|
28
|
+
*/
|
|
29
|
+
message: string;
|
|
30
|
+
/**
|
|
31
|
+
* The severity of the log.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof OperationLog
|
|
34
|
+
*/
|
|
35
|
+
severity: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the OperationLog interface.
|
|
39
|
+
*/
|
|
40
|
+
export declare function instanceOfOperationLog(value: object): boolean;
|
|
41
|
+
export declare function OperationLogFromJSON(json: any): OperationLog;
|
|
42
|
+
export declare function OperationLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): OperationLog;
|
|
43
|
+
export declare function OperationLogToJSON(value?: OperationLog | null): any;
|
|
@@ -0,0 +1,56 @@
|
|
|
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.OperationLogToJSON = exports.OperationLogFromJSONTyped = exports.OperationLogFromJSON = exports.instanceOfOperationLog = void 0;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a given object implements the OperationLog interface.
|
|
19
|
+
*/
|
|
20
|
+
function instanceOfOperationLog(value) {
|
|
21
|
+
let isInstance = true;
|
|
22
|
+
isInstance = isInstance && "timestamp" in value;
|
|
23
|
+
isInstance = isInstance && "message" in value;
|
|
24
|
+
isInstance = isInstance && "severity" in value;
|
|
25
|
+
return isInstance;
|
|
26
|
+
}
|
|
27
|
+
exports.instanceOfOperationLog = instanceOfOperationLog;
|
|
28
|
+
function OperationLogFromJSON(json) {
|
|
29
|
+
return OperationLogFromJSONTyped(json, false);
|
|
30
|
+
}
|
|
31
|
+
exports.OperationLogFromJSON = OperationLogFromJSON;
|
|
32
|
+
function OperationLogFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if ((json === undefined) || (json === null)) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'timestamp': json['timestamp'],
|
|
38
|
+
'message': json['message'],
|
|
39
|
+
'severity': json['severity'],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.OperationLogFromJSONTyped = OperationLogFromJSONTyped;
|
|
43
|
+
function OperationLogToJSON(value) {
|
|
44
|
+
if (value === undefined) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
if (value === null) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'timestamp': value.timestamp,
|
|
52
|
+
'message': value.message,
|
|
53
|
+
'severity': value.severity,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.OperationLogToJSON = OperationLogToJSON;
|
|
@@ -45,6 +45,12 @@ export interface ProviderApp {
|
|
|
45
45
|
* @memberof ProviderApp
|
|
46
46
|
*/
|
|
47
47
|
clientId: string;
|
|
48
|
+
/**
|
|
49
|
+
* The OAuth scopes for this app.
|
|
50
|
+
* @type {Array<string>}
|
|
51
|
+
* @memberof ProviderApp
|
|
52
|
+
*/
|
|
53
|
+
scopes?: Array<string>;
|
|
48
54
|
/**
|
|
49
55
|
* The time the provider app was created.
|
|
50
56
|
* @type {Date}
|
|
@@ -42,6 +42,7 @@ function ProviderAppFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
42
42
|
'externalRef': !(0, runtime_1.exists)(json, 'externalRef') ? undefined : json['externalRef'],
|
|
43
43
|
'provider': json['provider'],
|
|
44
44
|
'clientId': json['clientId'],
|
|
45
|
+
'scopes': !(0, runtime_1.exists)(json, 'scopes') ? undefined : json['scopes'],
|
|
45
46
|
'createTime': (new Date(json['createTime'])),
|
|
46
47
|
'updateTime': !(0, runtime_1.exists)(json, 'updateTime') ? undefined : (new Date(json['updateTime'])),
|
|
47
48
|
};
|
|
@@ -60,6 +61,7 @@ function ProviderAppToJSON(value) {
|
|
|
60
61
|
'externalRef': value.externalRef,
|
|
61
62
|
'provider': value.provider,
|
|
62
63
|
'clientId': value.clientId,
|
|
64
|
+
'scopes': value.scopes,
|
|
63
65
|
'createTime': (value.createTime.toISOString()),
|
|
64
66
|
'updateTime': value.updateTime === undefined ? undefined : (value.updateTime.toISOString()),
|
|
65
67
|
};
|
|
@@ -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,5 @@
|
|
|
1
1
|
export * from './BaseConfigContent';
|
|
2
|
+
export * from './BaseProxyConfig';
|
|
2
3
|
export * from './BaseReadConfig';
|
|
3
4
|
export * from './BaseReadConfigStandardObject';
|
|
4
5
|
export * from './BaseWriteConfig';
|
|
@@ -10,8 +11,6 @@ export * from './ConfigContentAllOf';
|
|
|
10
11
|
export * from './Connection';
|
|
11
12
|
export * from './Consumer';
|
|
12
13
|
export * from './CreateConsumerRequest';
|
|
13
|
-
export * from './CreateDestinationRequest';
|
|
14
|
-
export * from './CreateDestinationRequestMetadata';
|
|
15
14
|
export * from './CreateGroupRequest';
|
|
16
15
|
export * from './CreateInstallationRequest';
|
|
17
16
|
export * from './CreateInstallationRequestConfig';
|
|
@@ -19,11 +18,14 @@ export * from './CreateIntegrationRequest';
|
|
|
19
18
|
export * from './CreateIntegrationRequestLatestRevision';
|
|
20
19
|
export * from './CreateProjectRequest';
|
|
21
20
|
export * from './CreateProviderAppRequest';
|
|
21
|
+
export * from './Destination';
|
|
22
|
+
export * from './DestinationMetadata';
|
|
22
23
|
export * from './Group';
|
|
23
24
|
export * from './HydratedIntegration';
|
|
24
25
|
export * from './HydratedIntegrationField';
|
|
25
26
|
export * from './HydratedIntegrationFieldExistent';
|
|
26
27
|
export * from './HydratedIntegrationObject';
|
|
28
|
+
export * from './HydratedIntegrationProxy';
|
|
27
29
|
export * from './HydratedIntegrationRead';
|
|
28
30
|
export * from './HydratedIntegrationWrite';
|
|
29
31
|
export * from './HydratedIntegrationWriteObject';
|
|
@@ -38,12 +40,13 @@ export * from './IntegrationField';
|
|
|
38
40
|
export * from './IntegrationFieldExistent';
|
|
39
41
|
export * from './IntegrationFieldMapping';
|
|
40
42
|
export * from './IntegrationObject';
|
|
43
|
+
export * from './IntegrationProxy';
|
|
41
44
|
export * from './IntegrationRead';
|
|
42
45
|
export * from './IntegrationWrite';
|
|
43
46
|
export * from './IntegrationWriteObject';
|
|
44
47
|
export * from './OauthConnectRequest';
|
|
45
48
|
export * from './Operation';
|
|
46
|
-
export * from './
|
|
49
|
+
export * from './OperationLog';
|
|
47
50
|
export * from './OptionalFieldsAutoOption';
|
|
48
51
|
export * from './Project';
|
|
49
52
|
export * from './ProjectMembership';
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
19
|
__exportStar(require("./BaseConfigContent"), exports);
|
|
20
|
+
__exportStar(require("./BaseProxyConfig"), exports);
|
|
20
21
|
__exportStar(require("./BaseReadConfig"), exports);
|
|
21
22
|
__exportStar(require("./BaseReadConfigStandardObject"), exports);
|
|
22
23
|
__exportStar(require("./BaseWriteConfig"), exports);
|
|
@@ -28,8 +29,6 @@ __exportStar(require("./ConfigContentAllOf"), exports);
|
|
|
28
29
|
__exportStar(require("./Connection"), exports);
|
|
29
30
|
__exportStar(require("./Consumer"), exports);
|
|
30
31
|
__exportStar(require("./CreateConsumerRequest"), exports);
|
|
31
|
-
__exportStar(require("./CreateDestinationRequest"), exports);
|
|
32
|
-
__exportStar(require("./CreateDestinationRequestMetadata"), exports);
|
|
33
32
|
__exportStar(require("./CreateGroupRequest"), exports);
|
|
34
33
|
__exportStar(require("./CreateInstallationRequest"), exports);
|
|
35
34
|
__exportStar(require("./CreateInstallationRequestConfig"), exports);
|
|
@@ -37,11 +36,14 @@ __exportStar(require("./CreateIntegrationRequest"), exports);
|
|
|
37
36
|
__exportStar(require("./CreateIntegrationRequestLatestRevision"), exports);
|
|
38
37
|
__exportStar(require("./CreateProjectRequest"), exports);
|
|
39
38
|
__exportStar(require("./CreateProviderAppRequest"), exports);
|
|
39
|
+
__exportStar(require("./Destination"), exports);
|
|
40
|
+
__exportStar(require("./DestinationMetadata"), exports);
|
|
40
41
|
__exportStar(require("./Group"), exports);
|
|
41
42
|
__exportStar(require("./HydratedIntegration"), exports);
|
|
42
43
|
__exportStar(require("./HydratedIntegrationField"), exports);
|
|
43
44
|
__exportStar(require("./HydratedIntegrationFieldExistent"), exports);
|
|
44
45
|
__exportStar(require("./HydratedIntegrationObject"), exports);
|
|
46
|
+
__exportStar(require("./HydratedIntegrationProxy"), exports);
|
|
45
47
|
__exportStar(require("./HydratedIntegrationRead"), exports);
|
|
46
48
|
__exportStar(require("./HydratedIntegrationWrite"), exports);
|
|
47
49
|
__exportStar(require("./HydratedIntegrationWriteObject"), exports);
|
|
@@ -56,12 +58,13 @@ __exportStar(require("./IntegrationField"), exports);
|
|
|
56
58
|
__exportStar(require("./IntegrationFieldExistent"), exports);
|
|
57
59
|
__exportStar(require("./IntegrationFieldMapping"), exports);
|
|
58
60
|
__exportStar(require("./IntegrationObject"), exports);
|
|
61
|
+
__exportStar(require("./IntegrationProxy"), exports);
|
|
59
62
|
__exportStar(require("./IntegrationRead"), exports);
|
|
60
63
|
__exportStar(require("./IntegrationWrite"), exports);
|
|
61
64
|
__exportStar(require("./IntegrationWriteObject"), exports);
|
|
62
65
|
__exportStar(require("./OauthConnectRequest"), exports);
|
|
63
66
|
__exportStar(require("./Operation"), exports);
|
|
64
|
-
__exportStar(require("./
|
|
67
|
+
__exportStar(require("./OperationLog"), exports);
|
|
65
68
|
__exportStar(require("./OptionalFieldsAutoOption"), exports);
|
|
66
69
|
__exportStar(require("./Project"), exports);
|
|
67
70
|
__exportStar(require("./ProjectMembership"), 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;
|
|
@@ -4,6 +4,8 @@ exports.TrashIcon = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
// red.800 trash icon
|
|
6
6
|
function TrashIcon() {
|
|
7
|
-
return ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.25 4.5H3.75H15.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.25 4.5H3.75H15.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", {
|
|
8
|
+
// eslint-disable-next-line max-len
|
|
9
|
+
d: "M14.25 4.5V15C14.25 15.3978 14.092 15.7794 13.8107 16.0607C13.5294 16.342 13.1478 16.5 12.75 16.5H5.25C4.85218 16.5 4.47064 16.342 4.18934 16.0607C3.90804 15.7794 3.75 15.3978 3.75 15V4.5M6 4.5V3C6 2.60218 6.15804 2.22064 6.43934 1.93934C6.72064 1.65804 7.10218 1.5 7.5 1.5H10.5C10.8978 1.5 11.2794 1.65804 11.5607 1.93934C11.842 2.22064 12 2.60218 12 3V4.5", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.5 8.25V12.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.5 8.25V12.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
8
10
|
}
|
|
9
11
|
exports.TrashIcon = TrashIcon;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Config } from '../../services/api';
|
|
1
2
|
interface InstallIntegrationProps {
|
|
2
3
|
integration: string;
|
|
3
4
|
consumerRef: string;
|
|
4
5
|
consumerName?: string;
|
|
5
6
|
groupRef: string;
|
|
6
7
|
groupName?: string;
|
|
8
|
+
onInstallSuccess?: (installationId: string, config: Config) => void;
|
|
9
|
+
onUpdateSuccess?: (installationId: string, config: Config) => void;
|
|
7
10
|
}
|
|
8
|
-
export declare function InstallIntegration({ integration, consumerRef, consumerName, groupRef, groupName, }: InstallIntegrationProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function InstallIntegration({ integration, consumerRef, consumerName, groupRef, groupName, onInstallSuccess, onUpdateSuccess, }: InstallIntegrationProps): import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
export {};
|
|
@@ -2,38 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InstallIntegration = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const ConnectionsContextProvider_1 = require("../../context/ConnectionsContextProvider");
|
|
6
6
|
const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const InstallIntegrationContextProvider_1 = require("../../context/InstallIntegrationContextProvider");
|
|
8
|
+
const ProjectContextProvider_1 = require("../../context/ProjectContextProvider");
|
|
9
|
+
const ErrorTextBox_1 = require("../ErrorTextBox");
|
|
10
|
+
const InstallationContent_1 = require("./content/InstallationContent");
|
|
11
|
+
const ConditionalProxyLayout_1 = require("./layout/ConditionalProxyLayout/ConditionalProxyLayout");
|
|
12
|
+
const ProtectedConnectionLayout_1 = require("./layout/ProtectedConnectionLayout");
|
|
13
|
+
const ObjectManagementNav_1 = require("./nav/ObjectManagementNav");
|
|
9
14
|
const ConfigurationStateProvider_1 = require("./state/ConfigurationStateProvider");
|
|
10
15
|
const HydratedRevisionContext_1 = require("./state/HydratedRevisionContext");
|
|
11
|
-
|
|
12
|
-
const ErrorTextBox_1 = require("./ErrorTextBox");
|
|
13
|
-
const ObjectManagementNav_1 = require("./ObjectManagementNav");
|
|
14
|
-
const ProtectedConnectionLayout_1 = require("./ProtectedConnectionLayout");
|
|
15
|
-
const UpdateInstallation_1 = require("./UpdateInstallation");
|
|
16
|
-
// todo : add the install integration provider to supply these properties
|
|
17
|
-
function InstallationContent() {
|
|
18
|
-
const { integrationObj, installation } = (0, InstallIntegrationContext_1.useInstallIntegrationProps)();
|
|
19
|
-
if (!integrationObj) {
|
|
20
|
-
return (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: "We can't load the integration" });
|
|
21
|
-
}
|
|
22
|
-
return installation && integrationObj ? (
|
|
23
|
-
// If installation exists, render update installation flow
|
|
24
|
-
(0, jsx_runtime_1.jsx)(UpdateInstallation_1.UpdateInstallation, { installation: installation, integrationObj: integrationObj })) : (
|
|
25
|
-
// No installation, render create installation flow
|
|
26
|
-
(0, jsx_runtime_1.jsx)(CreateInstallation_1.CreateInstallation, {}));
|
|
27
|
-
}
|
|
28
|
-
function InstallIntegration({ integration, consumerRef, consumerName, groupRef, groupName, }) {
|
|
16
|
+
function InstallIntegration({ integration, consumerRef, consumerName, groupRef, groupName, onInstallSuccess, onUpdateSuccess, }) {
|
|
29
17
|
var _a;
|
|
30
|
-
const { projectId } = (0,
|
|
18
|
+
const { projectId } = (0, ProjectContextProvider_1.useProject)();
|
|
31
19
|
const { errorState } = (0, ErrorContextProvider_1.useErrorState)();
|
|
32
20
|
if ((_a = errorState[ErrorContextProvider_1.ErrorBoundary.INTEGRATION_LIST]) === null || _a === void 0 ? void 0 : _a.apiError) {
|
|
33
21
|
return (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: "Something went wrong, couldn't find integration information" });
|
|
34
22
|
}
|
|
35
23
|
return (
|
|
36
24
|
// install integration provider provides all props, integrationObj and installation
|
|
37
|
-
(0, jsx_runtime_1.jsx)(
|
|
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, {}) }) }) }) }) }) }) }));
|
|
38
26
|
}
|
|
39
27
|
exports.InstallIntegration = InstallIntegration;
|
|
@@ -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 CreateInstallationReducer = CreateInstallationSharedProps & {
|
|
12
|
+
createConfig: CreateInstallationRequestConfig;
|
|
13
|
+
};
|
|
14
|
+
export declare function createInstallationReducer({ createConfig, projectId, integrationId, groupRef, connectionId, apiKey, setInstallation, onInstallSuccess, }: CreateInstallationReducer): Promise<void>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createInstallationReducer = void 0;
|
|
4
|
+
const api_1 = require("../../../services/api");
|
|
5
|
+
function createInstallationReducer({ 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.createInstallationReducer = createInstallationReducer;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Config, HydratedRevision, Installation } from '../../../services/api';
|
|
2
|
+
import { ConfigureState } from '../types';
|
|
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>;
|
package/build/src/components/Configure/actions/{onSaveCreate.js → onSaveReadCreateInstallation.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const api_1 = require("../../../services/api");
|
|
3
|
+
exports.onSaveReadCreateInstallation = void 0;
|
|
5
4
|
const utils_1 = require("../state/utils");
|
|
5
|
+
const createInstallationReducer_1 = require("./createInstallationReducer");
|
|
6
6
|
/**
|
|
7
7
|
* gets matching object from hydratedRevision
|
|
8
8
|
* @param hydratedRevision
|
|
@@ -29,7 +29,7 @@ const getObjectFromHydratedRevision = (hydratedRevision, objectName) => {
|
|
|
29
29
|
* @param consumerRef
|
|
30
30
|
* @returns
|
|
31
31
|
*/
|
|
32
|
-
const
|
|
32
|
+
const generateCreateReadConfigFromConfigureState = (configureState, objectName, hydratedRevision, consumerRef) => {
|
|
33
33
|
const selectedFields = (0, utils_1.generateSelectedFieldsFromConfigureState)(configureState);
|
|
34
34
|
const selectedFieldMappings = (0, utils_1.generateSelectedFieldMappingsFromConfigureState)(configureState);
|
|
35
35
|
const obj = getObjectFromHydratedRevision(hydratedRevision, objectName);
|
|
@@ -58,33 +58,21 @@ const generateCreateConfigFromConfigureState = (configureState, objectName, hydr
|
|
|
58
58
|
};
|
|
59
59
|
return createConfigObj;
|
|
60
60
|
};
|
|
61
|
-
const
|
|
62
|
-
const createConfig =
|
|
61
|
+
const onSaveReadCreateInstallation = (projectId, integrationId, groupRef, consumerRef, connectionId, objectName, apiKey, hydratedRevision, configureState, setInstallation, onInstallSuccess) => {
|
|
62
|
+
const createConfig = generateCreateReadConfigFromConfigureState(configureState, objectName, hydratedRevision, consumerRef);
|
|
63
63
|
if (!createConfig) {
|
|
64
64
|
console.error('Error when generating createConfig from configureState');
|
|
65
65
|
return Promise.resolve(null);
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
return (0, createInstallationReducer_1.createInstallationReducer)({
|
|
68
|
+
createConfig,
|
|
68
69
|
projectId,
|
|
69
70
|
integrationId,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
return (0, api_1.api)().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
|
-
})
|
|
86
|
-
.catch((err) => {
|
|
87
|
-
console.error('ERROR: ', err);
|
|
71
|
+
groupRef,
|
|
72
|
+
connectionId,
|
|
73
|
+
apiKey,
|
|
74
|
+
setInstallation,
|
|
75
|
+
onInstallSuccess,
|
|
88
76
|
});
|
|
89
77
|
};
|
|
90
|
-
exports.
|
|
78
|
+
exports.onSaveReadCreateInstallation = onSaveReadCreateInstallation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Config, HydratedIntegrationObject, 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, onUpdateSuccess?: ((installationId: string, config: Config) => void) | undefined) => Promise<void | null>;
|
package/build/src/components/Configure/actions/{onSaveUpdate.js → onSaveReadUpdateInstallation.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.onSaveReadUpdateInstallation = void 0;
|
|
4
4
|
const api_1 = require("../../../services/api");
|
|
5
5
|
const utils_1 = require("../state/utils");
|
|
6
6
|
/**
|
|
@@ -19,7 +19,7 @@ const utils_1 = require("../state/utils");
|
|
|
19
19
|
* @param schedule
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const generateUpdateReadConfigFromConfigureState = (configureState, objectName, hydratedObject, schedule) => {
|
|
23
23
|
const selectedFields = (0, utils_1.generateSelectedFieldsFromConfigureState)(configureState);
|
|
24
24
|
const selectedFieldMappings = (0, utils_1.generateSelectedFieldMappingsFromConfigureState)(configureState);
|
|
25
25
|
// config request object type needs to be fixed
|
|
@@ -41,10 +41,14 @@ const generateUpdateConfigFromConfigureState = (configureState, objectName, hydr
|
|
|
41
41
|
};
|
|
42
42
|
return updateConfigObject;
|
|
43
43
|
};
|
|
44
|
-
const
|
|
44
|
+
const onSaveReadUpdateInstallation = (projectId, integrationId, installationId, selectedObjectName, apiKey, configureState, setInstallation, hydratedObject, onUpdateSuccess) => {
|
|
45
45
|
// get configuration state
|
|
46
46
|
// transform configuration state to update shape
|
|
47
|
-
const updateConfig =
|
|
47
|
+
const updateConfig = generateUpdateReadConfigFromConfigureState(configureState, selectedObjectName || '', hydratedObject, hydratedObject.schedule);
|
|
48
|
+
if (!updateConfig) {
|
|
49
|
+
console.error('Error when generating updateConfig from configureState');
|
|
50
|
+
return Promise.resolve(null);
|
|
51
|
+
}
|
|
48
52
|
const updateInstallationRequest = {
|
|
49
53
|
projectId,
|
|
50
54
|
installationId,
|
|
@@ -59,16 +63,17 @@ const onSaveUpdate = (projectId, integrationId, installationId, selectedObjectNa
|
|
|
59
63
|
},
|
|
60
64
|
};
|
|
61
65
|
// call api.updateInstallation
|
|
62
|
-
return (0, api_1.api)().updateInstallation(updateInstallationRequest, {
|
|
66
|
+
return (0, api_1.api)().installationApi.updateInstallation(updateInstallationRequest, {
|
|
63
67
|
headers: {
|
|
64
68
|
'X-Api-Key': apiKey,
|
|
65
69
|
'Content-Type': 'application/json',
|
|
66
70
|
},
|
|
67
|
-
}).then((
|
|
71
|
+
}).then((installation) => {
|
|
68
72
|
// update local installation state
|
|
69
|
-
setInstallation(
|
|
73
|
+
setInstallation(installation);
|
|
74
|
+
onUpdateSuccess === null || onUpdateSuccess === void 0 ? void 0 : onUpdateSuccess(installation.id, installation.config);
|
|
70
75
|
}).catch((err) => {
|
|
71
76
|
console.error('ERROR: ', err);
|
|
72
77
|
});
|
|
73
78
|
};
|
|
74
|
-
exports.
|
|
79
|
+
exports.onSaveReadUpdateInstallation = onSaveReadUpdateInstallation;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HydratedRevision } from '../../../../services/api';
|
|
2
|
+
import { CreateInstallationSharedProps } from '../createInstallationReducer';
|
|
3
|
+
type CreateInstallationProxyOnlyProps = CreateInstallationSharedProps & {
|
|
4
|
+
hydratedRevision: HydratedRevision;
|
|
5
|
+
consumerRef: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function createInstallationProxyOnly({ 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.createInstallationProxyOnly = void 0;
|
|
4
|
+
const createInstallationReducer_1 = require("../createInstallationReducer");
|
|
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 createInstallationProxyOnly({ 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, createInstallationReducer_1.createInstallationReducer)({
|
|
34
|
+
createConfig,
|
|
35
|
+
projectId,
|
|
36
|
+
integrationId,
|
|
37
|
+
groupRef,
|
|
38
|
+
connectionId,
|
|
39
|
+
apiKey,
|
|
40
|
+
setInstallation,
|
|
41
|
+
onInstallSuccess,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.createInstallationProxyOnly = createInstallationProxyOnly;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ConfigureState } from '../../types';
|
|
2
|
+
type WriteObject = {
|
|
3
|
+
objectName: string;
|
|
4
|
+
};
|
|
5
|
+
type WriteObjects = {
|
|
6
|
+
[objectName: string]: WriteObject;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* example type
|
|
10
|
+
* "objects":
|
|
11
|
+
* {
|
|
12
|
+
objects: {
|
|
13
|
+
account: {
|
|
14
|
+
objectName: 'account',
|
|
15
|
+
},
|
|
16
|
+
contact: {
|
|
17
|
+
objectName: 'contact',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
* @param writeObjects
|
|
22
|
+
* @param configureState
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const generateConfigWriteObjects: (configureState: ConfigureState) => WriteObjects;
|
|
26
|
+
export {};
|