@amp-labs/react 1.0.2 → 1.2.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/README.md +1 -1
- 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 +78 -0
- package/build/generated-sources/api/src/apis/DestinationApi.js +102 -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 +168 -0
- package/build/generated-sources/api/src/apis/InstallationApi.js +205 -0
- package/build/generated-sources/api/src/apis/IntegrationApi.d.ts +128 -0
- package/build/generated-sources/api/src/apis/IntegrationApi.js +154 -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/CreateInstallationRequest.d.ts +2 -2
- package/build/generated-sources/api/src/models/CreateInstallationRequest.js +2 -2
- package/build/generated-sources/api/src/models/CreateInstallationRequestConfig.d.ts +3 -3
- package/build/generated-sources/api/src/models/CreateInstallationRequestConfig.js +3 -4
- 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/OauthConnectRequest.d.ts +1 -1
- package/build/generated-sources/api/src/models/OauthConnectRequest.js +1 -2
- package/build/generated-sources/api/src/models/Operation.d.ts +6 -12
- package/build/generated-sources/api/src/models/Operation.js +3 -6
- 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/index.d.ts +3 -2
- package/build/generated-sources/api/src/models/index.js +3 -2
- 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 +10 -23
- package/build/src/components/Configure/actions/onSaveReadCreateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/{onSaveCreate.js → onSaveReadCreateInstallation.js} +7 -6
- 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/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 +85 -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} +15 -7
- 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/{ProtectedConnectionLayout.d.ts → layout/ProtectedConnectionLayout.d.ts} +2 -1
- package/build/src/components/Configure/layout/ProtectedConnectionLayout.js +34 -0
- 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/NoSubdomainEntry/LandingContent.js +11 -0
- package/build/src/components/Oauth/NoSubdomainEntry/NoSubdomainOauthFlow.d.ts +16 -0
- package/build/src/components/Oauth/NoSubdomainEntry/NoSubdomainOauthFlow.js +50 -0
- package/build/src/components/Oauth/OAuthErrorAlert.d.ts +5 -0
- package/build/src/components/Oauth/OAuthErrorAlert.js +12 -0
- package/build/src/components/{Connect → Oauth}/OAuthPopup.js +8 -10
- package/build/src/components/{Salesforce → Oauth/Salesforce}/SalesforceOauthFlow.d.ts +2 -2
- package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.js +57 -0
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.d.ts +8 -0
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.js +12 -0
- package/build/src/components/Oauth/fetchOAuthCallbackURL.d.ts +1 -0
- package/build/src/components/Oauth/fetchOAuthCallbackURL.js +28 -0
- 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/constants.d.ts +1 -0
- package/build/src/constants.js +2 -1
- 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 +11 -6
- package/package.json +3 -3
- package/build/generated-sources/api/src/apis/DefaultApi.d.ts +0 -904
- package/build/generated-sources/api/src/apis/DefaultApi.js +0 -992
- 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/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 -52
- package/build/src/components/Configure/ProtectedConnectionLayout.js +0 -33
- 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/Salesforce/SalesforceOauthFlow.js +0 -89
- 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
|
@@ -1,44 +0,0 @@
|
|
|
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 CreateDestinationRequest
|
|
17
|
-
*/
|
|
18
|
-
export interface CreateDestinationRequest {
|
|
19
|
-
/**
|
|
20
|
-
* User-friendly name for the destination
|
|
21
|
-
* @type {string}
|
|
22
|
-
* @memberof CreateDestinationRequest
|
|
23
|
-
*/
|
|
24
|
-
name: string;
|
|
25
|
-
/**
|
|
26
|
-
* The type of the destination
|
|
27
|
-
* @type {string}
|
|
28
|
-
* @memberof CreateDestinationRequest
|
|
29
|
-
*/
|
|
30
|
-
type: string;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @type {CreateDestinationRequestMetadata}
|
|
34
|
-
* @memberof CreateDestinationRequest
|
|
35
|
-
*/
|
|
36
|
-
metadata: CreateDestinationRequestMetadata;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Check if a given object implements the CreateDestinationRequest interface.
|
|
40
|
-
*/
|
|
41
|
-
export declare function instanceOfCreateDestinationRequest(value: object): boolean;
|
|
42
|
-
export declare function CreateDestinationRequestFromJSON(json: any): CreateDestinationRequest;
|
|
43
|
-
export declare function CreateDestinationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDestinationRequest;
|
|
44
|
-
export declare function CreateDestinationRequestToJSON(value?: CreateDestinationRequest | null): any;
|
|
@@ -1,57 +0,0 @@
|
|
|
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.CreateDestinationRequestToJSON = exports.CreateDestinationRequestFromJSONTyped = exports.CreateDestinationRequestFromJSON = exports.instanceOfCreateDestinationRequest = void 0;
|
|
17
|
-
const CreateDestinationRequestMetadata_1 = require("./CreateDestinationRequestMetadata");
|
|
18
|
-
/**
|
|
19
|
-
* Check if a given object implements the CreateDestinationRequest interface.
|
|
20
|
-
*/
|
|
21
|
-
function instanceOfCreateDestinationRequest(value) {
|
|
22
|
-
let isInstance = true;
|
|
23
|
-
isInstance = isInstance && "name" in value;
|
|
24
|
-
isInstance = isInstance && "type" in value;
|
|
25
|
-
isInstance = isInstance && "metadata" in value;
|
|
26
|
-
return isInstance;
|
|
27
|
-
}
|
|
28
|
-
exports.instanceOfCreateDestinationRequest = instanceOfCreateDestinationRequest;
|
|
29
|
-
function CreateDestinationRequestFromJSON(json) {
|
|
30
|
-
return CreateDestinationRequestFromJSONTyped(json, false);
|
|
31
|
-
}
|
|
32
|
-
exports.CreateDestinationRequestFromJSON = CreateDestinationRequestFromJSON;
|
|
33
|
-
function CreateDestinationRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
|
-
if ((json === undefined) || (json === null)) {
|
|
35
|
-
return json;
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
'name': json['name'],
|
|
39
|
-
'type': json['type'],
|
|
40
|
-
'metadata': (0, CreateDestinationRequestMetadata_1.CreateDestinationRequestMetadataFromJSON)(json['metadata']),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
exports.CreateDestinationRequestFromJSONTyped = CreateDestinationRequestFromJSONTyped;
|
|
44
|
-
function CreateDestinationRequestToJSON(value) {
|
|
45
|
-
if (value === undefined) {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
if (value === null) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
'name': value.name,
|
|
53
|
-
'type': value.type,
|
|
54
|
-
'metadata': (0, CreateDestinationRequestMetadata_1.CreateDestinationRequestMetadataToJSON)(value.metadata),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
exports.CreateDestinationRequestToJSON = CreateDestinationRequestToJSON;
|
|
@@ -1,39 +0,0 @@
|
|
|
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 CreateDestinationRequestMetadata
|
|
16
|
-
*/
|
|
17
|
-
export interface CreateDestinationRequestMetadata {
|
|
18
|
-
/**
|
|
19
|
-
* Webhook URL
|
|
20
|
-
* @type {string}
|
|
21
|
-
* @memberof CreateDestinationRequestMetadata
|
|
22
|
-
*/
|
|
23
|
-
url?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Webhook headers to add
|
|
26
|
-
* @type {{ [key: string]: string; }}
|
|
27
|
-
* @memberof CreateDestinationRequestMetadata
|
|
28
|
-
*/
|
|
29
|
-
headers?: {
|
|
30
|
-
[key: string]: string;
|
|
31
|
-
} | null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Check if a given object implements the CreateDestinationRequestMetadata interface.
|
|
35
|
-
*/
|
|
36
|
-
export declare function instanceOfCreateDestinationRequestMetadata(value: object): boolean;
|
|
37
|
-
export declare function CreateDestinationRequestMetadataFromJSON(json: any): CreateDestinationRequestMetadata;
|
|
38
|
-
export declare function CreateDestinationRequestMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDestinationRequestMetadata;
|
|
39
|
-
export declare function CreateDestinationRequestMetadataToJSON(value?: CreateDestinationRequestMetadata | null): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AmpersandProvider';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("@chakra-ui/react");
|
|
5
|
-
function CenteredTextBox({ text }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { margin: "auto", width: "100%", paddingTop: "30px", children: text }));
|
|
7
|
-
}
|
|
8
|
-
exports.default = CenteredTextBox;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigureInstallationBase = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("@chakra-ui/react");
|
|
6
|
-
const LoadingIcon_1 = require("../../assets/LoadingIcon");
|
|
7
|
-
const FieldMappings_1 = require("./fields/FieldMappings");
|
|
8
|
-
const OptionalFields_1 = require("./fields/OptionalFields");
|
|
9
|
-
const RequiredFields_1 = require("./fields/RequiredFields");
|
|
10
|
-
const UninstallInstallation_1 = require("./ObjectManagementNav/UninstallInstallation");
|
|
11
|
-
const ConfigurationStateProvider_1 = require("./state/ConfigurationStateProvider");
|
|
12
|
-
const HydratedRevisionContext_1 = require("./state/HydratedRevisionContext");
|
|
13
|
-
const utils_1 = require("./state/utils");
|
|
14
|
-
const ObjectManagementNav_1 = require("./ObjectManagementNav");
|
|
15
|
-
const UninstallContent_1 = require("./UninstallContent");
|
|
16
|
-
// Installation UI Base
|
|
17
|
-
function ConfigureInstallationBase({ onSave, onReset, isLoading }) {
|
|
18
|
-
const { hydratedRevision, loading } = (0, HydratedRevisionContext_1.useHydratedRevision)();
|
|
19
|
-
const { selectedObjectName } = (0, ObjectManagementNav_1.useSelectedObjectName)();
|
|
20
|
-
const { objectConfigurationsState } = (0, ConfigurationStateProvider_1.useConfigureState)();
|
|
21
|
-
const configureState = (0, utils_1.getConfigureState)(selectedObjectName || '', objectConfigurationsState);
|
|
22
|
-
const isPending = (configureState === null || configureState === void 0 ? void 0 : configureState.isOptionalFieldsModified)
|
|
23
|
-
|| (configureState === null || configureState === void 0 ? void 0 : configureState.isRequiredMapFieldsModified);
|
|
24
|
-
const isDisabled = loading || isLoading || !configureState || !selectedObjectName || !isPending;
|
|
25
|
-
const isUninstall = selectedObjectName === UninstallInstallation_1.UNINSTALL_INSTALLATION_CONST;
|
|
26
|
-
return (isLoading ? (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {})
|
|
27
|
-
: ((0, jsx_runtime_1.jsxs)("form", { style: { width: '100%', maxWidth: '50rem' }, onSubmit: onSave, children: [(0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", spacing: 4, marginBottom: "20px", flexDir: "row-reverse", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { backgroundColor: "gray.800", _hover: { backgroundColor: 'gray.600' }, type: "submit", isDisabled: isDisabled, children: "Save" }), (0, jsx_runtime_1.jsx)(react_1.Button, { backgroundColor: "gray.200", color: "blackAlpha.700", _hover: { backgroundColor: 'gray.300' }, isDisabled: isDisabled, onClick: onReset, children: "Reset" })] }), (0, jsx_runtime_1.jsxs)(react_1.Box, { p: 8, width: "100%", border: "1px solid #EFEFEF", borderRadius: 8, boxShadow: "md", textAlign: ['left'], margin: "auto", bgColor: "white", maxHeight: "100%", overflowY: "scroll", children: [loading && (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}), hydratedRevision && !isUninstall && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RequiredFields_1.RequiredFields, {}), (0, jsx_runtime_1.jsx)(FieldMappings_1.RequiredFieldMappings, {}), (0, jsx_runtime_1.jsx)(OptionalFields_1.OptionalFields, {})] })), !loading && isUninstall && (0, jsx_runtime_1.jsx)(UninstallContent_1.UninstallContent, {})] })] })));
|
|
28
|
-
}
|
|
29
|
-
exports.ConfigureInstallationBase = ConfigureInstallationBase;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateInstallation = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
* this page is wip: untested
|
|
7
|
-
*/
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ApiKeyProvider_1 = require("../../context/ApiKeyProvider");
|
|
10
|
-
const ConnectionsContext_1 = require("../../context/ConnectionsContext");
|
|
11
|
-
const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
|
|
12
|
-
const InstallIntegrationContext_1 = require("../../context/InstallIntegrationContext");
|
|
13
|
-
const ProjectContext_1 = require("../../context/ProjectContext");
|
|
14
|
-
const onSaveCreate_1 = require("./actions/onSaveCreate");
|
|
15
|
-
const ConfigurationStateProvider_1 = require("./state/ConfigurationStateProvider");
|
|
16
|
-
const HydratedRevisionContext_1 = require("./state/HydratedRevisionContext");
|
|
17
|
-
const utils_1 = require("./state/utils");
|
|
18
|
-
const ConfigureInstallationBase_1 = require("./ConfigureInstallationBase");
|
|
19
|
-
const ObjectManagementNav_1 = require("./ObjectManagementNav");
|
|
20
|
-
const utils_2 = require("./utils");
|
|
21
|
-
// the config should be undefined for create flow
|
|
22
|
-
const UNDEFINED_CONFIG = undefined;
|
|
23
|
-
// Create Installation Flow
|
|
24
|
-
function CreateInstallation() {
|
|
25
|
-
const { integrationId, groupRef, consumerRef, setInstallation, } = (0, InstallIntegrationContext_1.useInstallIntegrationProps)();
|
|
26
|
-
const { hydratedRevision, loading } = (0, HydratedRevisionContext_1.useHydratedRevision)();
|
|
27
|
-
const { selectedObjectName } = (0, ObjectManagementNav_1.useSelectedObjectName)();
|
|
28
|
-
const { selectedConnection } = (0, ConnectionsContext_1.useConnections)();
|
|
29
|
-
const apiKey = (0, ApiKeyProvider_1.useApiKey)();
|
|
30
|
-
const { projectId } = (0, ProjectContext_1.useProject)();
|
|
31
|
-
const { resetBoundary, setErrors } = (0, ErrorContextProvider_1.useErrorState)();
|
|
32
|
-
const { resetConfigureState, objectConfigurationsState, resetPendingConfigurationState, } = (0, ConfigurationStateProvider_1.useConfigureState)();
|
|
33
|
-
const configureState = (0, utils_1.getConfigureState)(selectedObjectName || '', objectConfigurationsState);
|
|
34
|
-
const [isLoading, setLoadingState] = (0, react_1.useState)(false);
|
|
35
|
-
const resetState = (0, react_1.useCallback)(() => {
|
|
36
|
-
resetBoundary(ErrorContextProvider_1.ErrorBoundary.MAPPING);
|
|
37
|
-
if ((hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) && !loading && selectedObjectName) {
|
|
38
|
-
(0, utils_1.setHydrateConfigState)(hydratedRevision, UNDEFINED_CONFIG, selectedObjectName, resetConfigureState);
|
|
39
|
-
}
|
|
40
|
-
}, [resetBoundary, hydratedRevision, loading, selectedObjectName, resetConfigureState]);
|
|
41
|
-
(0, react_1.useEffect)(() => {
|
|
42
|
-
// set configurationState when hydratedRevision is loaded
|
|
43
|
-
if (!configureState && (hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) && !loading) {
|
|
44
|
-
resetState();
|
|
45
|
-
}
|
|
46
|
-
}, [configureState, objectConfigurationsState, hydratedRevision, loading, resetState]);
|
|
47
|
-
const onSave = (e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
// check if fields with requirements are met
|
|
50
|
-
const { requiredMapFields, selectedFieldMappings } = configureState || {};
|
|
51
|
-
const { errorList } = (0, utils_2.validateFieldMappings)(requiredMapFields, selectedFieldMappings, setErrors);
|
|
52
|
-
if (errorList.length > 0) {
|
|
53
|
-
return;
|
|
54
|
-
} // skip if there are errors
|
|
55
|
-
if (selectedObjectName && (selectedConnection === null || selectedConnection === void 0 ? void 0 : selectedConnection.id) && apiKey && projectId
|
|
56
|
-
&& integrationId && groupRef && consumerRef && hydratedRevision) {
|
|
57
|
-
setLoadingState(true);
|
|
58
|
-
const res = (0, onSaveCreate_1.onSaveCreate)(projectId, integrationId, groupRef, consumerRef, selectedConnection.id, selectedObjectName, apiKey, hydratedRevision, configureState, setInstallation);
|
|
59
|
-
res.finally(() => {
|
|
60
|
-
setLoadingState(false);
|
|
61
|
-
resetPendingConfigurationState(selectedObjectName);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
console.error('OnSaveCreate: missing required props');
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(ConfigureInstallationBase_1.ConfigureInstallationBase, { isLoading: isLoading, onSave: onSave, onReset: resetState }));
|
|
69
|
-
}
|
|
70
|
-
exports.CreateInstallation = CreateInstallation;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorTextBox = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("@chakra-ui/react");
|
|
6
|
-
function ErrorTextBox({ message }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { minHeight: "300px", padding: "30px", display: "flex", flexDirection: "column", justifyContent: "space-evenly", alignItems: "center", children: [(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)("path", { d: "M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z", stroke: "#7F1D1D", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M24 18V26", stroke: "#7F1D1D", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M24 34H24.02", stroke: "#7F1D1D", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" })] }), (0, jsx_runtime_1.jsx)(react_1.Box, { boxSizing: "border-box", display: "flex", justifyContent: "center", alignItems: "center", "align-self": "stretch", padding: "12px 50px 12px 50px", borderRadius: "8px", border: "2px solid #FECACA", background: "#FEF2F2", children: (0, jsx_runtime_1.jsx)(react_1.Text, { color: "#991B1B", children: message }) })] }));
|
|
8
|
-
}
|
|
9
|
-
exports.ErrorTextBox = ErrorTextBox;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectManagementNav = exports.useSelectedObjectName = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const react_2 = require("@chakra-ui/react");
|
|
7
|
-
const InstallIntegrationContext_1 = require("../../../context/InstallIntegrationContext");
|
|
8
|
-
const ProjectContext_1 = require("../../../context/ProjectContext");
|
|
9
|
-
const ConfigurationStateProvider_1 = require("../state/ConfigurationStateProvider");
|
|
10
|
-
const HydratedRevisionContext_1 = require("../state/HydratedRevisionContext");
|
|
11
|
-
const utils_1 = require("../utils");
|
|
12
|
-
const NavObjectItem_1 = require("./NavObjectItem");
|
|
13
|
-
const UninstallInstallation_1 = require("./UninstallInstallation");
|
|
14
|
-
// Create a context for the selected navObject's name
|
|
15
|
-
const SelectedObjectNameContext = (0, react_1.createContext)(null);
|
|
16
|
-
// Custom hook to access the selected navObject's name
|
|
17
|
-
function useSelectedObjectName() {
|
|
18
|
-
const selectedNavObjectName = (0, react_1.useContext)(SelectedObjectNameContext);
|
|
19
|
-
if (selectedNavObjectName === null) {
|
|
20
|
-
throw new Error('useSelectedNavObjectName must be used within a SelectedNavObjectNameProvider');
|
|
21
|
-
}
|
|
22
|
-
return { selectedObjectName: selectedNavObjectName }; // Return as an object
|
|
23
|
-
}
|
|
24
|
-
exports.useSelectedObjectName = useSelectedObjectName;
|
|
25
|
-
function getSelectedObject(navObjects, tabIndex) {
|
|
26
|
-
if (navObjects === null || navObjects === void 0 ? void 0 : navObjects[tabIndex]) {
|
|
27
|
-
return navObjects[tabIndex];
|
|
28
|
-
}
|
|
29
|
-
if (tabIndex > navObjects.length - 1) {
|
|
30
|
-
return { name: UninstallInstallation_1.UNINSTALL_INSTALLATION_CONST, completed: false };
|
|
31
|
-
}
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
// note: when the object key exists in the config; the user has already completed the object before
|
|
35
|
-
function ObjectManagementNav({ children, }) {
|
|
36
|
-
const { installation } = (0, InstallIntegrationContext_1.useInstallIntegrationProps)();
|
|
37
|
-
const { hydratedRevision } = (0, HydratedRevisionContext_1.useHydratedRevision)();
|
|
38
|
-
const { objectConfigurationsState } = (0, ConfigurationStateProvider_1.useConfigureState)();
|
|
39
|
-
const config = installation === null || installation === void 0 ? void 0 : installation.config;
|
|
40
|
-
const navObjects = hydratedRevision && (0, utils_1.generateNavObjects)(config, hydratedRevision);
|
|
41
|
-
const [tabIndex, setTabIndex] = (0, react_1.useState)(0);
|
|
42
|
-
const handleTabsChange = (index) => { setTabIndex(index); };
|
|
43
|
-
const selectedObject = getSelectedObject(navObjects || [], tabIndex);
|
|
44
|
-
const { project } = (0, ProjectContext_1.useProject)();
|
|
45
|
-
const appName = (project === null || project === void 0 ? void 0 : project.appName) || '';
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(SelectedObjectNameContext.Provider, { value: selectedObject === null || selectedObject === void 0 ? void 0 : selectedObject.name, children: (0, jsx_runtime_1.jsxs)(react_2.Box, { p: 8, maxWidth: "55rem", border: "1px solid #EFEFEF", borderRadius: 6, boxShadow: "md", margin: "auto", bgColor: "whitesmoke", display: "flex", gap: "6", minHeight: "100%", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { width: "20rem", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { children: "Salesforce integration" }), (0, jsx_runtime_1.jsx)(react_2.Text, { marginBottom: "20px", fontSize: "1.125rem", fontWeight: "500", children: appName }), navObjects && ((0, jsx_runtime_1.jsxs)(react_2.Tabs, { index: tabIndex, onChange: handleTabsChange, orientation: "horizontal", children: [navObjects.map((object) => {
|
|
47
|
-
var _a, _b;
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(NavObjectItem_1.NavObjectItem, { objectName: object.name, completed: object.completed, pending: ((_a = objectConfigurationsState[object.name]) === null || _a === void 0 ? void 0 : _a.isOptionalFieldsModified)
|
|
49
|
-
|| ((_b = objectConfigurationsState[object.name]) === null || _b === void 0 ? void 0 : _b.isRequiredMapFieldsModified) }, object.name));
|
|
50
|
-
}), installation && ((0, jsx_runtime_1.jsx)(UninstallInstallation_1.UninstallInstallation, { text: "Uninstall" }, "uninstall-intallation"))] }))] }), children] }) }));
|
|
51
|
-
}
|
|
52
|
-
exports.ObjectManagementNav = ObjectManagementNav;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ProtectedConnectionLayout = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const constants_1 = require("../../constants");
|
|
10
|
-
const ConnectionsContext_1 = require("../../context/ConnectionsContext");
|
|
11
|
-
const InstallIntegrationContext_1 = require("../../context/InstallIntegrationContext");
|
|
12
|
-
const SalesforceOauthFlow_1 = __importDefault(require("../Salesforce/SalesforceOauthFlow"));
|
|
13
|
-
function ProtectedConnectionLayout({ provider, consumerRef, consumerName, groupRef, groupName, children, }) {
|
|
14
|
-
const { selectedConnection, setSelectedConnection, connections } = (0, ConnectionsContext_1.useConnections)();
|
|
15
|
-
(0, react_1.useEffect)(() => {
|
|
16
|
-
if (!selectedConnection && connections && connections.length > 0) {
|
|
17
|
-
const [connection] = connections;
|
|
18
|
-
setSelectedConnection(connection);
|
|
19
|
-
}
|
|
20
|
-
}, [connections, selectedConnection, setSelectedConnection]);
|
|
21
|
-
const { provider: providerFromProps } = (0, InstallIntegrationContext_1.useInstallIntegrationProps)();
|
|
22
|
-
if (!provider && !providerFromProps) {
|
|
23
|
-
throw new Error('ProtectedConnectionLayout must be given a provider prop or be used within InstallIntegrationProvider');
|
|
24
|
-
}
|
|
25
|
-
// a selected connection exists, render children
|
|
26
|
-
if (selectedConnection)
|
|
27
|
-
return children;
|
|
28
|
-
if (provider === constants_1.PROVIDER_SALESFORCE || providerFromProps === constants_1.PROVIDER_SALESFORCE) {
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(SalesforceOauthFlow_1.default, { consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName }));
|
|
30
|
-
}
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: "Unsupported provider" }));
|
|
32
|
-
}
|
|
33
|
-
exports.ProtectedConnectionLayout = ProtectedConnectionLayout;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { HydratedRevision, Installation } from '../../../services/api';
|
|
2
|
-
import { ConfigureState } from '../types';
|
|
3
|
-
export declare const onSaveCreate: (projectId: string, integrationId: string, groupRef: string, consumerRef: string, connectionId: string, objectName: string, apiKey: string, hydratedRevision: HydratedRevision, configureState: ConfigureState, setInstallation: (installationObj: Installation) => void) => Promise<any>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { HydratedIntegrationObject, Installation } from '../../../services/api';
|
|
2
|
-
import { ConfigureState } from '../types';
|
|
3
|
-
export declare const onSaveUpdate: (projectId: string, integrationId: string, installationId: string, selectedObjectName: string, apiKey: string, configureState: ConfigureState, setInstallation: (installationObj: Installation) => void, hydratedObject: HydratedIntegrationObject) => Promise<any>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setFieldMapping = void 0;
|
|
4
|
-
const utils_1 = require("../../state/utils");
|
|
5
|
-
function setFieldMappingProducer(draft, fieldKey, newValue) {
|
|
6
|
-
const draftRequiredMapFields = (draft === null || draft === void 0 ? void 0 : draft.selectedFieldMappings) || {};
|
|
7
|
-
draftRequiredMapFields[fieldKey] = newValue;
|
|
8
|
-
const savedFields = draft.savedConfig.requiredMapFields;
|
|
9
|
-
const updatedFields = draftRequiredMapFields;
|
|
10
|
-
const isModified = !(0, utils_1.isFieldObjectEqual)(savedFields, updatedFields);
|
|
11
|
-
// immer exception if we try to set a value
|
|
12
|
-
// eslint-disable-next-line no-param-reassign
|
|
13
|
-
draft.isRequiredMapFieldsModified = isModified;
|
|
14
|
-
}
|
|
15
|
-
function setFieldMapping(selectedObjectName, setConfigureState, fieldKey, newValue) {
|
|
16
|
-
setConfigureState(selectedObjectName, (draft) => setFieldMappingProducer(draft, fieldKey, newValue));
|
|
17
|
-
}
|
|
18
|
-
exports.setFieldMapping = setFieldMapping;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setOptionalField = void 0;
|
|
4
|
-
const utils_1 = require("../../state/utils");
|
|
5
|
-
function setOptionalFieldProducer(draft, fieldKey, checked) {
|
|
6
|
-
const draftSelectedOptionalFields = (draft === null || draft === void 0 ? void 0 : draft.selectedOptionalFields) || {};
|
|
7
|
-
draftSelectedOptionalFields[fieldKey] = checked;
|
|
8
|
-
if (!checked) {
|
|
9
|
-
delete draftSelectedOptionalFields[fieldKey];
|
|
10
|
-
}
|
|
11
|
-
const savedFields = draft.savedConfig.optionalFields;
|
|
12
|
-
const updatedFields = draftSelectedOptionalFields;
|
|
13
|
-
const isModified = !(0, utils_1.isFieldObjectEqual)(savedFields, updatedFields);
|
|
14
|
-
// immer exception if we try to set a value
|
|
15
|
-
// eslint-disable-next-line no-param-reassign
|
|
16
|
-
draft.isOptionalFieldsModified = isModified;
|
|
17
|
-
}
|
|
18
|
-
function setOptionalField(selectedObjectName, setConfigureState, fieldKey, checked) {
|
|
19
|
-
setConfigureState(selectedObjectName, (draft) => setOptionalFieldProducer(draft, fieldKey, checked));
|
|
20
|
-
}
|
|
21
|
-
exports.setOptionalField = setOptionalField;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequiredFields = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("@chakra-ui/react");
|
|
6
|
-
const ProjectContext_1 = require("../../../context/ProjectContext");
|
|
7
|
-
const ObjectManagementNav_1 = require("../ObjectManagementNav");
|
|
8
|
-
const ConfigurationStateProvider_1 = require("../state/ConfigurationStateProvider");
|
|
9
|
-
const utils_1 = require("../state/utils");
|
|
10
|
-
const utils_2 = require("../utils");
|
|
11
|
-
const FieldHeader_1 = require("./FieldHeader");
|
|
12
|
-
function RequiredFields() {
|
|
13
|
-
var _a;
|
|
14
|
-
const { selectedObjectName } = (0, ObjectManagementNav_1.useSelectedObjectName)();
|
|
15
|
-
const { objectConfigurationsState } = (0, ConfigurationStateProvider_1.useConfigureState)();
|
|
16
|
-
const configureState = (0, utils_1.getConfigureState)(selectedObjectName || '', objectConfigurationsState);
|
|
17
|
-
const { appName } = (0, ProjectContext_1.useProject)();
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FieldHeader_1.FieldHeader, { string: `${appName} reads the following ${selectedObjectName} fields` }), (0, jsx_runtime_1.jsx)(react_1.Box, { marginBottom: "20px", children: ((_a = configureState === null || configureState === void 0 ? void 0 : configureState.requiredFields) === null || _a === void 0 ? void 0 : _a.length)
|
|
19
|
-
? (configureState.requiredFields.map((field) => {
|
|
20
|
-
if (!(0, utils_2.isIntegrationFieldMapping)(field)) {
|
|
21
|
-
return (0, jsx_runtime_1.jsx)(react_1.Tag, { children: field.displayName }, field.fieldName);
|
|
22
|
-
}
|
|
23
|
-
return null; // fallback for customed mapped fields
|
|
24
|
-
}))
|
|
25
|
-
: 'There are no required fields.' })] }));
|
|
26
|
-
}
|
|
27
|
-
exports.RequiredFields = RequiredFields;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
/**
|
|
8
|
-
* Prompts customer to input their Salesforce subdomain, then creates an OAuth connection to
|
|
9
|
-
* that Salesforce instance.
|
|
10
|
-
*/
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const icons_1 = require("@chakra-ui/icons");
|
|
13
|
-
const react_2 = require("@chakra-ui/react");
|
|
14
|
-
const constants_1 = require("../../constants");
|
|
15
|
-
const ApiKeyProvider_1 = require("../../context/ApiKeyProvider");
|
|
16
|
-
const ProjectContext_1 = require("../../context/ProjectContext");
|
|
17
|
-
const api_1 = require("../../services/api");
|
|
18
|
-
const OAuthPopup_1 = __importDefault(require("../Connect/OAuthPopup"));
|
|
19
|
-
function OAuthErrorAlert({ error }) {
|
|
20
|
-
if (error) {
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Alert, { status: "error", marginTop: "2em", children: [(0, jsx_runtime_1.jsx)(react_2.AlertIcon, {}), (0, jsx_runtime_1.jsx)(react_2.AlertDescription, { children: error })] }));
|
|
22
|
-
}
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const SALESFORCE_HELP_URL = 'https://help.salesforce.com/articleView?id=domain_name_not_found.htm&type=5';
|
|
26
|
-
function SubdomainEntry({ handleSubmit, setWorkspace, error, isButtonDisabled, }) {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(react_2.Container, { children: (0, jsx_runtime_1.jsx)(react_2.Box, { p: 8, maxWidth: "600px", borderWidth: 1, borderRadius: 8, boxShadow: "lg", textAlign: ['left'], margin: "auto", marginTop: "40px", bgColor: "white", children: (0, jsx_runtime_1.jsxs)(react_2.FormControl, { children: [(0, jsx_runtime_1.jsx)(react_2.FormLabel, { marginTop: "16", marginBottom: "0", children: (0, jsx_runtime_1.jsx)(react_2.Heading, { as: "h4", size: "md", children: "Enter your Salesforce subdomain" }) }), (0, jsx_runtime_1.jsxs)(react_2.Link, { href: SALESFORCE_HELP_URL, color: "blackAlpha.600", isExternal: true, children: ["What is my Salesforce subdomain?", (0, jsx_runtime_1.jsx)(icons_1.ExternalLinkIcon, { mx: "2px" })] }), (0, jsx_runtime_1.jsx)(OAuthErrorAlert, { error: error }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { marginTop: "1em", children: [(0, jsx_runtime_1.jsx)(react_2.Input, { placeholder: "MyDomain", onChange: (event) => setWorkspace(event.currentTarget.value) }), (0, jsx_runtime_1.jsx)(react_2.Text, { lineHeight: "2.2em", marginLeft: "0.4em", children: ".my.salesforce.com" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_2.Button, { isDisabled: isButtonDisabled, width: "100%", type: "submit", onClick: handleSubmit, children: "Next" })] }) }) }));
|
|
28
|
-
}
|
|
29
|
-
const fetchOAuthCallbackURL = async (projectId, workspace, consumerRef, groupRef, consumerName, groupName, apiKey, provider = constants_1.PROVIDER_SALESFORCE) => {
|
|
30
|
-
const providerApps = await (0, api_1.api)().listProviderApps({ projectId }, {
|
|
31
|
-
headers: { 'X-Api-Key': apiKey !== null && apiKey !== void 0 ? apiKey : '' },
|
|
32
|
-
});
|
|
33
|
-
const app = providerApps.find((a) => a.provider === provider);
|
|
34
|
-
if (!app) {
|
|
35
|
-
throw new Error(`You must first set up a ${provider} Connected App using the Ampersand Console.`);
|
|
36
|
-
}
|
|
37
|
-
const url = await (0, api_1.api)().oauthConnect({
|
|
38
|
-
connectOAuthParams: {
|
|
39
|
-
providerWorkspaceRef: workspace,
|
|
40
|
-
projectId,
|
|
41
|
-
groupRef,
|
|
42
|
-
groupName,
|
|
43
|
-
consumerRef,
|
|
44
|
-
consumerName,
|
|
45
|
-
providerAppId: app.id,
|
|
46
|
-
provider,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
return url;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* SalesforceOauthFlow first prompts user for their workspace ("subdomain" in Salesforce lingo),
|
|
53
|
-
* then launches a popup with the OAuth flow.
|
|
54
|
-
*/
|
|
55
|
-
function SalesforceOauthFlow({ consumerRef, consumerName, groupRef, groupName, }) {
|
|
56
|
-
const { projectId } = (0, ProjectContext_1.useProject)();
|
|
57
|
-
const apiKey = (0, ApiKeyProvider_1.useApiKey)();
|
|
58
|
-
const [workspace, setWorkspace] = (0, react_1.useState)('');
|
|
59
|
-
const [oAuthCallbackURL, setOAuthCallbackURL] = (0, react_1.useState)(null);
|
|
60
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
61
|
-
const isButtonDisabled = workspace.length === 0;
|
|
62
|
-
const provider = constants_1.PROVIDER_SALESFORCE;
|
|
63
|
-
// 1. fetch provider apps
|
|
64
|
-
// 2. find matching app to provider
|
|
65
|
-
// 3. fetch OAuth callback URL from connection so that oath popup can be launched
|
|
66
|
-
const handleSubmit = async () => {
|
|
67
|
-
var _a;
|
|
68
|
-
setError(null);
|
|
69
|
-
if (workspace && consumerName && groupName && apiKey) {
|
|
70
|
-
try {
|
|
71
|
-
const url = await fetchOAuthCallbackURL(projectId, workspace, consumerRef, groupRef, consumerName, groupName, apiKey, provider);
|
|
72
|
-
setOAuthCallbackURL(url);
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
console.error(err);
|
|
76
|
-
setError((_a = err.message) !== null && _a !== void 0 ? _a : 'Unexpected error');
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
setError('missing required fields');
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const onClose = (0, react_1.useCallback)((err) => {
|
|
84
|
-
setError(err);
|
|
85
|
-
setOAuthCallbackURL(null);
|
|
86
|
-
}, []);
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(OAuthPopup_1.default, { title: "Connect to Salesforce", url: oAuthCallbackURL, onClose: onClose, children: (0, jsx_runtime_1.jsx)(SubdomainEntry, { handleSubmit: handleSubmit, setWorkspace: setWorkspace, error: error, isButtonDisabled: isButtonDisabled }) }));
|
|
88
|
-
}
|
|
89
|
-
exports.default = SalesforceOauthFlow;
|
/package/build/src/components/Configure/{CreateInstallation.d.ts → content/CreateInstallation.d.ts}
RENAMED
|
File without changes
|
/package/build/src/components/Configure/{UninstallContent.d.ts → content/UninstallContent.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/build/src/components/Configure/{fields → content/fields}/OptionalFields/OptionalFields.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/build/src/context/{IntegrationListContext.d.ts → IntegrationListContextProvider.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|