@amp-labs/react 1.5.2 → 1.6.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/amp-react.cjs.js +2 -0
- package/build/amp-react.es.js +7816 -0
- package/build/index.d.ts +51 -0
- package/package.json +22 -9
- package/build/generated-sources/api/src/apis/APIKeyApi.d.ts +0 -158
- package/build/generated-sources/api/src/apis/APIKeyApi.js +0 -188
- package/build/generated-sources/api/src/apis/ConnectionApi.d.ts +0 -82
- package/build/generated-sources/api/src/apis/ConnectionApi.js +0 -107
- package/build/generated-sources/api/src/apis/ConsumerApi.d.ts +0 -52
- package/build/generated-sources/api/src/apis/ConsumerApi.js +0 -75
- package/build/generated-sources/api/src/apis/DestinationApi.d.ts +0 -156
- package/build/generated-sources/api/src/apis/DestinationApi.js +0 -185
- package/build/generated-sources/api/src/apis/GroupApi.d.ts +0 -52
- package/build/generated-sources/api/src/apis/GroupApi.js +0 -75
- package/build/generated-sources/api/src/apis/InstallationApi.d.ts +0 -196
- package/build/generated-sources/api/src/apis/InstallationApi.js +0 -235
- package/build/generated-sources/api/src/apis/IntegrationApi.d.ts +0 -128
- package/build/generated-sources/api/src/apis/IntegrationApi.js +0 -151
- package/build/generated-sources/api/src/apis/OAuthApi.d.ts +0 -76
- package/build/generated-sources/api/src/apis/OAuthApi.js +0 -102
- package/build/generated-sources/api/src/apis/OperationApi.d.ts +0 -106
- package/build/generated-sources/api/src/apis/OperationApi.js +0 -131
- package/build/generated-sources/api/src/apis/OperationEventApi.d.ts +0 -112
- package/build/generated-sources/api/src/apis/OperationEventApi.js +0 -140
- package/build/generated-sources/api/src/apis/OrgApi.d.ts +0 -226
- package/build/generated-sources/api/src/apis/OrgApi.js +0 -253
- package/build/generated-sources/api/src/apis/ProjectApi.d.ts +0 -124
- package/build/generated-sources/api/src/apis/ProjectApi.js +0 -149
- package/build/generated-sources/api/src/apis/ProviderApi.d.ts +0 -78
- package/build/generated-sources/api/src/apis/ProviderApi.js +0 -92
- package/build/generated-sources/api/src/apis/ProviderAppApi.d.ts +0 -130
- package/build/generated-sources/api/src/apis/ProviderAppApi.js +0 -158
- package/build/generated-sources/api/src/apis/RevisionApi.d.ts +0 -87
- package/build/generated-sources/api/src/apis/RevisionApi.js +0 -113
- package/build/generated-sources/api/src/apis/UploadURLApi.d.ts +0 -46
- package/build/generated-sources/api/src/apis/UploadURLApi.js +0 -68
- package/build/generated-sources/api/src/apis/UserApi.d.ts +0 -70
- package/build/generated-sources/api/src/apis/UserApi.js +0 -94
- package/build/generated-sources/api/src/apis/index.d.ts +0 -17
- package/build/generated-sources/api/src/apis/index.js +0 -35
- package/build/generated-sources/api/src/index.d.ts +0 -3
- package/build/generated-sources/api/src/index.js +0 -21
- package/build/generated-sources/api/src/models/AcceptInviteRequest.d.ts +0 -31
- package/build/generated-sources/api/src/models/AcceptInviteRequest.js +0 -50
- package/build/generated-sources/api/src/models/ApiKey.d.ts +0 -49
- package/build/generated-sources/api/src/models/ApiKey.js +0 -59
- package/build/generated-sources/api/src/models/ApiKeyRequest.d.ts +0 -31
- package/build/generated-sources/api/src/models/ApiKeyRequest.js +0 -50
- package/build/generated-sources/api/src/models/ApiProblem.d.ts +0 -130
- package/build/generated-sources/api/src/models/ApiProblem.js +0 -82
- package/build/generated-sources/api/src/models/AuthType.d.ts +0 -23
- package/build/generated-sources/api/src/models/AuthType.js +0 -36
- package/build/generated-sources/api/src/models/BaseConfigContent.d.ts +0 -52
- package/build/generated-sources/api/src/models/BaseConfigContent.js +0 -59
- package/build/generated-sources/api/src/models/BaseProxyConfig.d.ts +0 -31
- package/build/generated-sources/api/src/models/BaseProxyConfig.js +0 -50
- package/build/generated-sources/api/src/models/BaseReadConfig.d.ts +0 -34
- package/build/generated-sources/api/src/models/BaseReadConfig.js +0 -51
- package/build/generated-sources/api/src/models/BaseReadConfigObject.d.ts +0 -59
- package/build/generated-sources/api/src/models/BaseReadConfigObject.js +0 -58
- package/build/generated-sources/api/src/models/BaseWriteConfig.d.ts +0 -34
- package/build/generated-sources/api/src/models/BaseWriteConfig.js +0 -51
- package/build/generated-sources/api/src/models/BaseWriteConfigObject.d.ts +0 -31
- package/build/generated-sources/api/src/models/BaseWriteConfigObject.js +0 -50
- package/build/generated-sources/api/src/models/BatchUpsertIntegrationsRequest.d.ts +0 -31
- package/build/generated-sources/api/src/models/BatchUpsertIntegrationsRequest.js +0 -50
- package/build/generated-sources/api/src/models/Builder.d.ts +0 -73
- package/build/generated-sources/api/src/models/Builder.js +0 -68
- package/build/generated-sources/api/src/models/BuilderInfo.d.ts +0 -48
- package/build/generated-sources/api/src/models/BuilderInfo.js +0 -59
- package/build/generated-sources/api/src/models/BuilderInfoOrgRole.d.ts +0 -58
- package/build/generated-sources/api/src/models/BuilderInfoOrgRole.js +0 -67
- package/build/generated-sources/api/src/models/BuilderInfoProjectRolesValue.d.ts +0 -58
- package/build/generated-sources/api/src/models/BuilderInfoProjectRolesValue.js +0 -67
- package/build/generated-sources/api/src/models/BulkWriteSupport.d.ts +0 -49
- package/build/generated-sources/api/src/models/BulkWriteSupport.js +0 -59
- package/build/generated-sources/api/src/models/Config.d.ts +0 -56
- package/build/generated-sources/api/src/models/Config.js +0 -63
- package/build/generated-sources/api/src/models/ConfigContent.d.ts +0 -50
- package/build/generated-sources/api/src/models/ConfigContent.js +0 -58
- package/build/generated-sources/api/src/models/ConfigContentAllOf.d.ts +0 -37
- package/build/generated-sources/api/src/models/ConfigContentAllOf.js +0 -52
- package/build/generated-sources/api/src/models/Connection.d.ts +0 -82
- package/build/generated-sources/api/src/models/Connection.js +0 -76
- package/build/generated-sources/api/src/models/Consumer.d.ts +0 -55
- package/build/generated-sources/api/src/models/Consumer.js +0 -62
- package/build/generated-sources/api/src/models/CreateConsumerRequest.d.ts +0 -37
- package/build/generated-sources/api/src/models/CreateConsumerRequest.js +0 -53
- 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/CreateDestinationRequestMetadata.js +0 -52
- package/build/generated-sources/api/src/models/CreateGroupRequest.d.ts +0 -37
- package/build/generated-sources/api/src/models/CreateGroupRequest.js +0 -53
- package/build/generated-sources/api/src/models/CreateInstallationRequest.d.ts +0 -44
- package/build/generated-sources/api/src/models/CreateInstallationRequest.js +0 -57
- package/build/generated-sources/api/src/models/CreateInstallationRequestConfig.d.ts +0 -44
- package/build/generated-sources/api/src/models/CreateInstallationRequestConfig.js +0 -56
- package/build/generated-sources/api/src/models/CreateIntegrationRequest.d.ts +0 -44
- package/build/generated-sources/api/src/models/CreateIntegrationRequest.js +0 -57
- package/build/generated-sources/api/src/models/CreateIntegrationRequestLatestRevision.d.ts +0 -31
- package/build/generated-sources/api/src/models/CreateIntegrationRequestLatestRevision.js +0 -50
- package/build/generated-sources/api/src/models/CreateOrgInviteRequest.d.ts +0 -31
- package/build/generated-sources/api/src/models/CreateOrgInviteRequest.js +0 -50
- package/build/generated-sources/api/src/models/CreateOrgRequest.d.ts +0 -31
- package/build/generated-sources/api/src/models/CreateOrgRequest.js +0 -50
- package/build/generated-sources/api/src/models/CreateProjectRequest.d.ts +0 -43
- package/build/generated-sources/api/src/models/CreateProjectRequest.js +0 -56
- package/build/generated-sources/api/src/models/CreateProviderAppRequest.d.ts +0 -55
- package/build/generated-sources/api/src/models/CreateProviderAppRequest.js +0 -61
- package/build/generated-sources/api/src/models/Destination.d.ts +0 -62
- package/build/generated-sources/api/src/models/Destination.js +0 -66
- package/build/generated-sources/api/src/models/Group.d.ts +0 -55
- package/build/generated-sources/api/src/models/Group.js +0 -62
- package/build/generated-sources/api/src/models/HydratedIntegration.d.ts +0 -64
- package/build/generated-sources/api/src/models/HydratedIntegration.js +0 -65
- package/build/generated-sources/api/src/models/HydratedIntegrationField.d.ts +0 -22
- package/build/generated-sources/api/src/models/HydratedIntegrationField.js +0 -45
- package/build/generated-sources/api/src/models/HydratedIntegrationFieldExistent.d.ts +0 -37
- package/build/generated-sources/api/src/models/HydratedIntegrationFieldExistent.js +0 -53
- package/build/generated-sources/api/src/models/HydratedIntegrationObject.d.ts +0 -75
- package/build/generated-sources/api/src/models/HydratedIntegrationObject.js +0 -70
- package/build/generated-sources/api/src/models/HydratedIntegrationProxy.d.ts +0 -31
- package/build/generated-sources/api/src/models/HydratedIntegrationProxy.js +0 -50
- package/build/generated-sources/api/src/models/HydratedIntegrationRead.d.ts +0 -32
- package/build/generated-sources/api/src/models/HydratedIntegrationRead.js +0 -51
- package/build/generated-sources/api/src/models/HydratedIntegrationWrite.d.ts +0 -32
- package/build/generated-sources/api/src/models/HydratedIntegrationWrite.js +0 -51
- package/build/generated-sources/api/src/models/HydratedIntegrationWriteObject.d.ts +0 -37
- package/build/generated-sources/api/src/models/HydratedIntegrationWriteObject.js +0 -53
- package/build/generated-sources/api/src/models/HydratedRevision.d.ts +0 -50
- package/build/generated-sources/api/src/models/HydratedRevision.js +0 -60
- package/build/generated-sources/api/src/models/ImportConnectionRequest.d.ts +0 -79
- package/build/generated-sources/api/src/models/ImportConnectionRequest.js +0 -72
- package/build/generated-sources/api/src/models/ImportInstallationRequest.d.ts +0 -45
- package/build/generated-sources/api/src/models/ImportInstallationRequest.js +0 -58
- package/build/generated-sources/api/src/models/ImportInstallationRequestConfig.d.ts +0 -38
- package/build/generated-sources/api/src/models/ImportInstallationRequestConfig.js +0 -54
- package/build/generated-sources/api/src/models/InputValidationIssue.d.ts +0 -89
- package/build/generated-sources/api/src/models/InputValidationIssue.js +0 -75
- package/build/generated-sources/api/src/models/InputValidationProblem.d.ts +0 -68
- package/build/generated-sources/api/src/models/InputValidationProblem.js +0 -63
- package/build/generated-sources/api/src/models/Installation.d.ts +0 -88
- package/build/generated-sources/api/src/models/Installation.js +0 -79
- package/build/generated-sources/api/src/models/Integration.d.ts +0 -68
- package/build/generated-sources/api/src/models/Integration.js +0 -69
- package/build/generated-sources/api/src/models/Integration1.d.ts +0 -64
- package/build/generated-sources/api/src/models/Integration1.js +0 -65
- package/build/generated-sources/api/src/models/IntegrationField.d.ts +0 -22
- package/build/generated-sources/api/src/models/IntegrationField.js +0 -45
- package/build/generated-sources/api/src/models/IntegrationFieldExistent.d.ts +0 -31
- package/build/generated-sources/api/src/models/IntegrationFieldExistent.js +0 -50
- package/build/generated-sources/api/src/models/IntegrationFieldMapping.d.ts +0 -49
- package/build/generated-sources/api/src/models/IntegrationFieldMapping.js +0 -57
- package/build/generated-sources/api/src/models/IntegrationObject.d.ts +0 -63
- package/build/generated-sources/api/src/models/IntegrationObject.js +0 -65
- package/build/generated-sources/api/src/models/IntegrationProxy.d.ts +0 -31
- package/build/generated-sources/api/src/models/IntegrationProxy.js +0 -50
- package/build/generated-sources/api/src/models/IntegrationRead.d.ts +0 -32
- package/build/generated-sources/api/src/models/IntegrationRead.js +0 -51
- package/build/generated-sources/api/src/models/IntegrationWrite.d.ts +0 -32
- package/build/generated-sources/api/src/models/IntegrationWrite.js +0 -51
- package/build/generated-sources/api/src/models/IntegrationWriteObject.d.ts +0 -31
- package/build/generated-sources/api/src/models/IntegrationWriteObject.js +0 -50
- package/build/generated-sources/api/src/models/Invite.d.ts +0 -84
- package/build/generated-sources/api/src/models/Invite.js +0 -83
- package/build/generated-sources/api/src/models/Log.d.ts +0 -44
- package/build/generated-sources/api/src/models/Log.js +0 -57
- package/build/generated-sources/api/src/models/LogMessage.d.ts +0 -43
- package/build/generated-sources/api/src/models/LogMessage.js +0 -55
- package/build/generated-sources/api/src/models/OauthConnectRequest.d.ts +0 -73
- package/build/generated-sources/api/src/models/OauthConnectRequest.js +0 -68
- package/build/generated-sources/api/src/models/OauthOpts.d.ts +0 -71
- package/build/generated-sources/api/src/models/OauthOpts.js +0 -74
- package/build/generated-sources/api/src/models/Operation.d.ts +0 -91
- package/build/generated-sources/api/src/models/Operation.js +0 -77
- package/build/generated-sources/api/src/models/OperationEvent.d.ts +0 -61
- package/build/generated-sources/api/src/models/OperationEvent.js +0 -64
- package/build/generated-sources/api/src/models/OptionalFieldsAutoOption.d.ts +0 -22
- package/build/generated-sources/api/src/models/OptionalFieldsAutoOption.js +0 -35
- package/build/generated-sources/api/src/models/Org.d.ts +0 -55
- package/build/generated-sources/api/src/models/Org.js +0 -62
- package/build/generated-sources/api/src/models/PatchApiKeyRequest.d.ts +0 -38
- package/build/generated-sources/api/src/models/PatchApiKeyRequest.js +0 -54
- package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.d.ts +0 -37
- package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.js +0 -52
- package/build/generated-sources/api/src/models/Problem.d.ts +0 -63
- package/build/generated-sources/api/src/models/Problem.js +0 -60
- package/build/generated-sources/api/src/models/Project.d.ts +0 -61
- package/build/generated-sources/api/src/models/Project.js +0 -64
- package/build/generated-sources/api/src/models/ProjectMembership.d.ts +0 -56
- package/build/generated-sources/api/src/models/ProjectMembership.js +0 -63
- package/build/generated-sources/api/src/models/ProviderApp.d.ts +0 -73
- package/build/generated-sources/api/src/models/ProviderApp.js +0 -69
- package/build/generated-sources/api/src/models/ProviderInfo.d.ts +0 -72
- package/build/generated-sources/api/src/models/ProviderInfo.js +0 -70
- package/build/generated-sources/api/src/models/Revision.d.ts +0 -50
- package/build/generated-sources/api/src/models/Revision.js +0 -60
- package/build/generated-sources/api/src/models/SignedUrl.d.ts +0 -43
- package/build/generated-sources/api/src/models/SignedUrl.js +0 -56
- package/build/generated-sources/api/src/models/Support.d.ts +0 -56
- package/build/generated-sources/api/src/models/Support.js +0 -63
- package/build/generated-sources/api/src/models/TokenMetadataFields.d.ts +0 -43
- package/build/generated-sources/api/src/models/TokenMetadataFields.js +0 -54
- package/build/generated-sources/api/src/models/UpdateDestinationRequest.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateDestinationRequest.js +0 -54
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.js +0 -53
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestinationMetadata.d.ts +0 -39
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestinationMetadata.js +0 -52
- package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.d.ts +0 -52
- package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.js +0 -59
- package/build/generated-sources/api/src/models/UpdateInstallationRequest.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateInstallationRequest.js +0 -54
- package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallation.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallation.js +0 -53
- package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallationConfig.d.ts +0 -44
- package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallationConfig.js +0 -55
- package/build/generated-sources/api/src/models/UpdateOrgRequest.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateOrgRequest.js +0 -54
- package/build/generated-sources/api/src/models/UpdateOrgRequestOrg.d.ts +0 -31
- package/build/generated-sources/api/src/models/UpdateOrgRequestOrg.js +0 -50
- package/build/generated-sources/api/src/models/UpdateProjectRequest.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateProjectRequest.js +0 -54
- package/build/generated-sources/api/src/models/UpdateProjectRequestProject.d.ts +0 -37
- package/build/generated-sources/api/src/models/UpdateProjectRequestProject.js +0 -52
- package/build/generated-sources/api/src/models/UpdateProviderAppRequest.d.ts +0 -38
- package/build/generated-sources/api/src/models/UpdateProviderAppRequest.js +0 -54
- package/build/generated-sources/api/src/models/UpdateProviderAppRequestProviderApp.d.ts +0 -55
- package/build/generated-sources/api/src/models/UpdateProviderAppRequestProviderApp.js +0 -58
- package/build/generated-sources/api/src/models/index.d.ts +0 -94
- package/build/generated-sources/api/src/models/index.js +0 -112
- package/build/generated-sources/api/src/runtime.d.ts +0 -182
- package/build/generated-sources/api/src/runtime.js +0 -317
- package/build/src/assets/LoadingIcon.d.ts +0 -5
- package/build/src/assets/LoadingIcon.js +0 -9
- package/build/src/assets/NavIcon.d.ts +0 -2
- package/build/src/assets/NavIcon.js +0 -24
- package/build/src/assets/SuccessIcon.d.ts +0 -1
- package/build/src/assets/SuccessIcon.js +0 -8
- package/build/src/assets/TrashIcon.d.ts +0 -1
- package/build/src/assets/TrashIcon.js +0 -11
- package/build/src/components/Configure/InstallIntegration.d.ts +0 -12
- package/build/src/components/Configure/InstallIntegration.js +0 -27
- package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.d.ts +0 -15
- package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.js +0 -30
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.d.ts +0 -15
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js +0 -33
- package/build/src/components/Configure/actions/proxy/isProxyEnabled.d.ts +0 -2
- package/build/src/components/Configure/actions/proxy/isProxyEnabled.js +0 -8
- package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.d.ts +0 -8
- package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.js +0 -44
- package/build/src/components/Configure/actions/read/onSaveReadCreateInstallation.d.ts +0 -3
- package/build/src/components/Configure/actions/read/onSaveReadCreateInstallation.js +0 -84
- package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.d.ts +0 -3
- package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.js +0 -71
- package/build/src/components/Configure/actions/write/generateConfigWriteObjects.d.ts +0 -26
- package/build/src/components/Configure/actions/write/generateConfigWriteObjects.js +0 -41
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.d.ts +0 -3
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +0 -79
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.d.ts +0 -3
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.js +0 -68
- package/build/src/components/Configure/content/ConfigureInstallationBase.d.ts +0 -9
- package/build/src/components/Configure/content/ConfigureInstallationBase.js +0 -36
- package/build/src/components/Configure/content/CreateInstallation.d.ts +0 -1
- package/build/src/components/Configure/content/CreateInstallation.js +0 -83
- package/build/src/components/Configure/content/InstallationContent.d.ts +0 -1
- package/build/src/components/Configure/content/InstallationContent.js +0 -20
- package/build/src/components/Configure/content/UninstallContent.d.ts +0 -1
- package/build/src/components/Configure/content/UninstallContent.js +0 -45
- package/build/src/components/Configure/content/UpdateInstallation.d.ts +0 -7
- package/build/src/components/Configure/content/UpdateInstallation.js +0 -90
- package/build/src/components/Configure/content/fields/FieldHeader.d.ts +0 -5
- package/build/src/components/Configure/content/fields/FieldHeader.js +0 -9
- package/build/src/components/Configure/content/fields/FieldMappings/FieldMapping.d.ts +0 -9
- package/build/src/components/Configure/content/fields/FieldMappings/FieldMapping.js +0 -26
- package/build/src/components/Configure/content/fields/FieldMappings/RequiredFieldMappings.d.ts +0 -1
- package/build/src/components/Configure/content/fields/FieldMappings/RequiredFieldMappings.js +0 -39
- package/build/src/components/Configure/content/fields/FieldMappings/index.d.ts +0 -3
- package/build/src/components/Configure/content/fields/FieldMappings/index.js +0 -7
- package/build/src/components/Configure/content/fields/FieldMappings/setFieldMapping.d.ts +0 -3
- package/build/src/components/Configure/content/fields/FieldMappings/setFieldMapping.js +0 -21
- package/build/src/components/Configure/content/fields/OptionalFields/OptionalFields.d.ts +0 -1
- package/build/src/components/Configure/content/fields/OptionalFields/OptionalFields.js +0 -41
- package/build/src/components/Configure/content/fields/OptionalFields/index.d.ts +0 -2
- package/build/src/components/Configure/content/fields/OptionalFields/index.js +0 -5
- package/build/src/components/Configure/content/fields/OptionalFields/setOptionalField.d.ts +0 -3
- package/build/src/components/Configure/content/fields/OptionalFields/setOptionalField.js +0 -27
- package/build/src/components/Configure/content/fields/ReadFields.d.ts +0 -1
- package/build/src/components/Configure/content/fields/ReadFields.js +0 -11
- package/build/src/components/Configure/content/fields/RequiredFields.d.ts +0 -1
- package/build/src/components/Configure/content/fields/RequiredFields.js +0 -23
- package/build/src/components/Configure/content/fields/WriteFields/WriteFields.d.ts +0 -1
- package/build/src/components/Configure/content/fields/WriteFields/WriteFields.js +0 -34
- package/build/src/components/Configure/content/fields/WriteFields/index.d.ts +0 -2
- package/build/src/components/Configure/content/fields/WriteFields/index.js +0 -5
- package/build/src/components/Configure/content/fields/WriteFields/setNonConfigurableWriteField.d.ts +0 -3
- package/build/src/components/Configure/content/fields/WriteFields/setNonConfigurableWriteField.js +0 -32
- package/build/src/components/Configure/content/useMutateInstallation.d.ts +0 -23
- package/build/src/components/Configure/content/useMutateInstallation.js +0 -47
- package/build/src/components/Configure/content/useSelectedConfigureState.d.ts +0 -72
- package/build/src/components/Configure/content/useSelectedConfigureState.js +0 -24
- package/build/src/components/Configure/index.d.ts +0 -1
- package/build/src/components/Configure/index.js +0 -5
- package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.d.ts +0 -11
- package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.js +0 -68
- package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.d.ts +0 -5
- package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.js +0 -11
- package/build/src/components/Configure/layout/ProtectedConnectionLayout.d.ts +0 -12
- package/build/src/components/Configure/layout/ProtectedConnectionLayout.js +0 -29
- package/build/src/components/Configure/nav/ObjectManagementNav/NavObjectItem.d.ts +0 -9
- package/build/src/components/Configure/nav/ObjectManagementNav/NavObjectItem.js +0 -14
- package/build/src/components/Configure/nav/ObjectManagementNav/OtherTab.d.ts +0 -7
- package/build/src/components/Configure/nav/ObjectManagementNav/OtherTab.js +0 -11
- package/build/src/components/Configure/nav/ObjectManagementNav/UninstallInstallation.d.ts +0 -7
- package/build/src/components/Configure/nav/ObjectManagementNav/UninstallInstallation.js +0 -15
- package/build/src/components/Configure/nav/ObjectManagementNav/constant.d.ts +0 -1
- package/build/src/components/Configure/nav/ObjectManagementNav/constant.js +0 -4
- package/build/src/components/Configure/nav/ObjectManagementNav/index.d.ts +0 -10
- package/build/src/components/Configure/nav/ObjectManagementNav/index.js +0 -61
- package/build/src/components/Configure/state/ConfigurationStateProvider.d.ts +0 -87
- package/build/src/components/Configure/state/ConfigurationStateProvider.js +0 -98
- package/build/src/components/Configure/state/HydratedRevisionContext.d.ts +0 -14
- package/build/src/components/Configure/state/HydratedRevisionContext.js +0 -81
- package/build/src/components/Configure/state/utils.d.ts +0 -22
- package/build/src/components/Configure/state/utils.js +0 -137
- package/build/src/components/Configure/types.d.ts +0 -44
- package/build/src/components/Configure/types.js +0 -2
- package/build/src/components/Configure/utils.d.ts +0 -34
- package/build/src/components/Configure/utils.js +0 -110
- package/build/src/components/Connect/ConnectProvider.d.ts +0 -11
- package/build/src/components/Connect/ConnectProvider.js +0 -12
- package/build/src/components/Connect/ConnectedSuccessBox.d.ts +0 -5
- package/build/src/components/Connect/ConnectedSuccessBox.js +0 -13
- package/build/src/components/Connect/useConnectionHandler.d.ts +0 -10
- package/build/src/components/Connect/useConnectionHandler.js +0 -24
- package/build/src/components/ErrorTextBox.d.ts +0 -5
- package/build/src/components/ErrorTextBox.js +0 -11
- package/build/src/components/Oauth/NoWorkspaceEntry/LandingContent.d.ts +0 -8
- package/build/src/components/Oauth/NoWorkspaceEntry/LandingContent.js +0 -12
- package/build/src/components/Oauth/NoWorkspaceEntry/NoWorkspaceOauthFlow.d.ts +0 -16
- package/build/src/components/Oauth/NoWorkspaceEntry/NoWorkspaceOauthFlow.js +0 -43
- package/build/src/components/Oauth/OAuthErrorAlert.d.ts +0 -5
- package/build/src/components/Oauth/OAuthErrorAlert.js +0 -12
- package/build/src/components/Oauth/OAuthWindow/OAuthWindow.d.ts +0 -14
- package/build/src/components/Oauth/OAuthWindow/OAuthWindow.js +0 -65
- package/build/src/components/Oauth/OAuthWindow/windowHelpers.d.ts +0 -24
- package/build/src/components/Oauth/OAuthWindow/windowHelpers.js +0 -77
- package/build/src/components/Oauth/OauthCardLayout.d.ts +0 -6
- package/build/src/components/Oauth/OauthCardLayout.js +0 -9
- package/build/src/components/Oauth/OauthFlow/OauthFlow.d.ts +0 -9
- package/build/src/components/Oauth/OauthFlow/OauthFlow.js +0 -33
- package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.d.ts +0 -13
- package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.js +0 -18
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.d.ts +0 -9
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.js +0 -12
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.d.ts +0 -14
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.js +0 -53
- package/build/src/components/Oauth/fetchOAuthPopupURL.d.ts +0 -1
- package/build/src/components/Oauth/fetchOAuthPopupURL.js +0 -29
- package/build/src/components/RedirectHandler/RedirectHandler.d.ts +0 -15
- package/build/src/components/RedirectHandler/RedirectHandler.js +0 -31
- package/build/src/components/RedirectHandler/index.d.ts +0 -1
- package/build/src/components/RedirectHandler/index.js +0 -5
- package/build/src/components/SuccessTextBox.d.ts +0 -5
- package/build/src/components/SuccessTextBox.js +0 -10
- package/build/src/components/ThemeProvider/Button/buttonTheme.d.ts +0 -13
- package/build/src/components/ThemeProvider/Button/buttonTheme.js +0 -17
- package/build/src/components/ThemeProvider/Button/index.d.ts +0 -2
- package/build/src/components/ThemeProvider/Button/index.js +0 -5
- package/build/src/components/ThemeProvider/index.d.ts +0 -6
- package/build/src/components/ThemeProvider/index.js +0 -58
- package/build/src/context/AmpersandContextProvider/AmpersandContextProvider.d.ts +0 -19
- package/build/src/context/AmpersandContextProvider/AmpersandContextProvider.js +0 -31
- package/build/src/context/AmpersandContextProvider/index.d.ts +0 -1
- package/build/src/context/AmpersandContextProvider/index.js +0 -17
- package/build/src/context/ApiKeyContextProvider.d.ts +0 -4
- package/build/src/context/ApiKeyContextProvider.js +0 -14
- package/build/src/context/ConnectionsContextProvider.d.ts +0 -17
- package/build/src/context/ConnectionsContextProvider.js +0 -66
- package/build/src/context/ErrorContextProvider.d.ts +0 -37
- package/build/src/context/ErrorContextProvider.js +0 -72
- package/build/src/context/InstallIntegrationContextProvider.d.ts +0 -30
- package/build/src/context/InstallIntegrationContextProvider.js +0 -110
- package/build/src/context/IntegrationListContextProvider.d.ts +0 -13
- package/build/src/context/IntegrationListContextProvider.js +0 -48
- package/build/src/context/ProjectContextProvider.d.ts +0 -15
- package/build/src/context/ProjectContextProvider.js +0 -50
- package/build/src/hooks/index.d.ts +0 -1
- package/build/src/hooks/index.js +0 -17
- package/build/src/hooks/useIsIntegrationInstalled.d.ts +0 -6
- package/build/src/hooks/useIsIntegrationInstalled.js +0 -48
- package/build/src/index.d.ts +0 -1
- package/build/src/index.js +0 -17
- package/build/src/public/index.d.ts +0 -7
- package/build/src/public/index.js +0 -23
- package/build/src/services/ApiService.d.ts +0 -25
- package/build/src/services/ApiService.js +0 -32
- package/build/src/services/api.d.ts +0 -10
- package/build/src/services/api.js +0 -76
- package/build/src/services/version.d.ts +0 -1
- package/build/src/services/version.js +0 -4
- package/build/src/utils/index.d.ts +0 -10
- package/build/src/utils/index.js +0 -21
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HydratedRevisionProvider = exports.useHydratedRevision = exports.HydratedRevisionContext = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const ApiKeyContextProvider_1 = require("../../../context/ApiKeyContextProvider");
|
|
7
|
-
const ConnectionsContextProvider_1 = require("../../../context/ConnectionsContextProvider");
|
|
8
|
-
const ErrorContextProvider_1 = require("../../../context/ErrorContextProvider");
|
|
9
|
-
const InstallIntegrationContextProvider_1 = require("../../../context/InstallIntegrationContextProvider");
|
|
10
|
-
const api_1 = require("../../../services/api");
|
|
11
|
-
const ErrorTextBox_1 = require("../../ErrorTextBox");
|
|
12
|
-
exports.HydratedRevisionContext = (0, react_1.createContext)({
|
|
13
|
-
hydratedRevision: null,
|
|
14
|
-
loading: false,
|
|
15
|
-
});
|
|
16
|
-
const useHydratedRevision = () => {
|
|
17
|
-
const context = (0, react_1.useContext)(exports.HydratedRevisionContext);
|
|
18
|
-
if (!context) {
|
|
19
|
-
throw new Error('useHydratedRevision must be used within a HydratedRevisionProvider');
|
|
20
|
-
}
|
|
21
|
-
return context;
|
|
22
|
-
};
|
|
23
|
-
exports.useHydratedRevision = useHydratedRevision;
|
|
24
|
-
function HydratedRevisionProvider({ projectId, children, }) {
|
|
25
|
-
var _a;
|
|
26
|
-
const { selectedConnection } = (0, ConnectionsContextProvider_1.useConnections)();
|
|
27
|
-
const { integrationId, integrationObj } = (0, InstallIntegrationContextProvider_1.useInstallIntegrationProps)();
|
|
28
|
-
const [hydratedRevision, setHydratedRevision] = (0, react_1.useState)(null);
|
|
29
|
-
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
30
|
-
const { isError, removeError, setError } = (0, ErrorContextProvider_1.useErrorState)();
|
|
31
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
32
|
-
const connectionId = selectedConnection === null || selectedConnection === void 0 ? void 0 : selectedConnection.id;
|
|
33
|
-
const revisionId = (_a = integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.latestRevision) === null || _a === void 0 ? void 0 : _a.id;
|
|
34
|
-
const errorIntegrationIdentifier = (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.name) || integrationId;
|
|
35
|
-
(0, react_1.useEffect)(() => {
|
|
36
|
-
// Fetch the hydrated revision data using your API call
|
|
37
|
-
if (projectId
|
|
38
|
-
&& integrationId
|
|
39
|
-
&& revisionId
|
|
40
|
-
&& connectionId
|
|
41
|
-
&& apiKey) {
|
|
42
|
-
(0, api_1.api)().revisionApi.getHydratedRevision({
|
|
43
|
-
projectId,
|
|
44
|
-
integrationId,
|
|
45
|
-
revisionId,
|
|
46
|
-
connectionId,
|
|
47
|
-
}, {
|
|
48
|
-
headers: {
|
|
49
|
-
'X-Api-Key': apiKey !== null && apiKey !== void 0 ? apiKey : '',
|
|
50
|
-
},
|
|
51
|
-
})
|
|
52
|
-
.then((data) => {
|
|
53
|
-
setHydratedRevision(data);
|
|
54
|
-
setLoading(false);
|
|
55
|
-
removeError(ErrorContextProvider_1.ErrorBoundary.HYDRATED_REVISION, errorIntegrationIdentifier);
|
|
56
|
-
})
|
|
57
|
-
.catch((err) => {
|
|
58
|
-
console.error(`Error loading integration ${errorIntegrationIdentifier}`, err);
|
|
59
|
-
setLoading(false);
|
|
60
|
-
setError(ErrorContextProvider_1.ErrorBoundary.HYDRATED_REVISION, errorIntegrationIdentifier);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}, [
|
|
64
|
-
projectId,
|
|
65
|
-
integrationId,
|
|
66
|
-
revisionId,
|
|
67
|
-
connectionId,
|
|
68
|
-
apiKey,
|
|
69
|
-
removeError,
|
|
70
|
-
setError,
|
|
71
|
-
errorIntegrationIdentifier
|
|
72
|
-
]);
|
|
73
|
-
const contextValue = (0, react_1.useMemo)(() => ({
|
|
74
|
-
hydratedRevision,
|
|
75
|
-
loading,
|
|
76
|
-
}), [hydratedRevision, loading]);
|
|
77
|
-
const errorMsg = `Error retrieving integration details for '${(integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.name) || integrationId || 'unknown integration'}. This is sometimes caused by insufficient permissions with your credentials'`;
|
|
78
|
-
return ((0, jsx_runtime_1.jsx)(exports.HydratedRevisionContext.Provider, { value: contextValue, children: isError(ErrorContextProvider_1.ErrorBoundary.HYDRATED_REVISION, errorIntegrationIdentifier)
|
|
79
|
-
? (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: errorMsg }) : children }));
|
|
80
|
-
}
|
|
81
|
-
exports.HydratedRevisionProvider = HydratedRevisionProvider;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Config, HydratedRevision } from '../../../services/api';
|
|
2
|
-
import { ConfigureState, ObjectConfigurationsState, SelectMappingFields, SelectOptionalFields } from '../types';
|
|
3
|
-
export declare function isFieldObjectEqual(prevFields: SelectMappingFields | SelectOptionalFields, currentFields: SelectMappingFields | SelectOptionalFields): boolean;
|
|
4
|
-
export declare function generateConfigurationState(hydratedRevision: HydratedRevision, objectName: string, config?: Config): ConfigureState;
|
|
5
|
-
export declare const setHydrateConfigState: (hydratedRevision: HydratedRevision, config: Config | undefined, selectedObjectName: string, setConfigureState: (objectName: string, configureState: ConfigureState) => void) => void;
|
|
6
|
-
/**
|
|
7
|
-
* resets configure state for all objects in hydrated revision to hydrated revision values
|
|
8
|
-
*/
|
|
9
|
-
export declare const resetAllObjectsConfigurationState: (hydratedRevision: HydratedRevision, config: Config | undefined, setObjectConfiguresState: React.Dispatch<React.SetStateAction<ObjectConfigurationsState>>) => void;
|
|
10
|
-
/**
|
|
11
|
-
* generates selectedFields object for Config from configureState
|
|
12
|
-
* @param configureState
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare const generateSelectedFieldsFromConfigureState: (configureState: ConfigureState) => {};
|
|
16
|
-
/**
|
|
17
|
-
* generates selectedFieldMappings object for Config from configureState
|
|
18
|
-
* @param configureState
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
export declare const generateSelectedFieldMappingsFromConfigureState: (configureState: ConfigureState) => Record<string, string>;
|
|
22
|
-
export declare function getConfigureState(objectName: string, objectConfigurationsState: ObjectConfigurationsState): ConfigureState;
|
|
@@ -1,137 +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.getConfigureState = exports.generateSelectedFieldMappingsFromConfigureState = exports.generateSelectedFieldsFromConfigureState = exports.resetAllObjectsConfigurationState = exports.setHydrateConfigState = exports.generateConfigurationState = exports.isFieldObjectEqual = void 0;
|
|
7
|
-
const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
|
|
8
|
-
const utils_1 = require("../utils");
|
|
9
|
-
// uses lodash deep equality check to compare two saved fields objects
|
|
10
|
-
function isFieldObjectEqual(prevFields, currentFields) {
|
|
11
|
-
return (0, lodash_isequal_1.default)(prevFields, currentFields);
|
|
12
|
-
}
|
|
13
|
-
exports.isFieldObjectEqual = isFieldObjectEqual;
|
|
14
|
-
const generateConfigurationStateRead = (readAction, objectName, config) => {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f;
|
|
16
|
-
if (!readAction) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
// refactor this section to be immutable at hydrated revision level
|
|
20
|
-
const object = (0, utils_1.getObjectFromAction)(readAction, objectName);
|
|
21
|
-
const requiredFields = object && (0, utils_1.getRequiredFieldsFromObject)(object);
|
|
22
|
-
const optionalFields = object && (0, utils_1.getOptionalFieldsFromObject)(object);
|
|
23
|
-
const requiredMapFields = object && (0, utils_1.getRequiredMapFieldsFromObject)(object);
|
|
24
|
-
/// //////////////////////////////////////////////////////////////////////
|
|
25
|
-
const allFields = (object === null || object === void 0 ? void 0 : object.allFields) || [];
|
|
26
|
-
const content = config === null || config === void 0 ? void 0 : config.content;
|
|
27
|
-
const readSelectedFields = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.read) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b[objectName]) === null || _c === void 0 ? void 0 : _c.selectedFields) || {};
|
|
28
|
-
const selectedFieldMappings = ((_f = (_e = (_d = content === null || content === void 0 ? void 0 : content.read) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e[objectName]) === null || _f === void 0 ? void 0 : _f.selectedFieldMappings) || {};
|
|
29
|
-
const optionalFieldsSaved = Object.assign({}, readSelectedFields);
|
|
30
|
-
const requiredMapFieldsSaved = Object.assign({}, selectedFieldMappings);
|
|
31
|
-
return {
|
|
32
|
-
allFields, // from hydrated revision
|
|
33
|
-
requiredFields, // from hydrated revision
|
|
34
|
-
optionalFields, // from hydrated revision
|
|
35
|
-
requiredMapFields, // from hydrated revision
|
|
36
|
-
// selected state
|
|
37
|
-
selectedOptionalFields: readSelectedFields,
|
|
38
|
-
selectedFieldMappings,
|
|
39
|
-
isOptionalFieldsModified: false,
|
|
40
|
-
isRequiredMapFieldsModified: false,
|
|
41
|
-
savedConfig: {
|
|
42
|
-
optionalFields: optionalFieldsSaved, // from config
|
|
43
|
-
requiredMapFields: requiredMapFieldsSaved, // from config
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const generateConfigurationStateWrite = (writeAction, config) => {
|
|
48
|
-
var _a, _b;
|
|
49
|
-
if (!writeAction) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const writeObjects = (_b = (_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.write) === null || _b === void 0 ? void 0 : _b.objects;
|
|
53
|
-
const fields = Object.keys(writeObjects || {});
|
|
54
|
-
const selectedWriteFields = {};
|
|
55
|
-
fields.forEach((field) => { selectedWriteFields[field] = true; });
|
|
56
|
-
const savedFields = Object.assign({}, selectedWriteFields);
|
|
57
|
-
return {
|
|
58
|
-
writeObjects: (writeAction === null || writeAction === void 0 ? void 0 : writeAction.objects) || [],
|
|
59
|
-
selectedNonConfigurableWriteFields: selectedWriteFields,
|
|
60
|
-
isWriteModified: false,
|
|
61
|
-
savedConfig: {
|
|
62
|
-
selectedNonConfigurableWriteFields: savedFields,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
function generateConfigurationState(hydratedRevision, objectName, config) {
|
|
67
|
-
var _a, _b;
|
|
68
|
-
const readAction = (_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read;
|
|
69
|
-
const writeAction = (_b = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _b === void 0 ? void 0 : _b.write;
|
|
70
|
-
return {
|
|
71
|
-
read: generateConfigurationStateRead(readAction, objectName, config),
|
|
72
|
-
write: generateConfigurationStateWrite(writeAction, config),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
exports.generateConfigurationState = generateConfigurationState;
|
|
76
|
-
// resets configure state for single object to hydrated revision values
|
|
77
|
-
const setHydrateConfigState = (hydratedRevision, config, selectedObjectName, setConfigureState) => {
|
|
78
|
-
const state = generateConfigurationState(hydratedRevision, selectedObjectName, config);
|
|
79
|
-
setConfigureState(selectedObjectName, state);
|
|
80
|
-
};
|
|
81
|
-
exports.setHydrateConfigState = setHydrateConfigState;
|
|
82
|
-
/**
|
|
83
|
-
* resets configure state for all objects in hydrated revision to hydrated revision values
|
|
84
|
-
*/
|
|
85
|
-
const resetAllObjectsConfigurationState = (hydratedRevision, config, setObjectConfiguresState) => {
|
|
86
|
-
// read nav objects from hydrated revision
|
|
87
|
-
const navObjects = (0, utils_1.generateAllNavObjects)(config, hydratedRevision);
|
|
88
|
-
const objectConfigurationsState = {};
|
|
89
|
-
navObjects.forEach(({ name, completed }) => {
|
|
90
|
-
if (completed) {
|
|
91
|
-
objectConfigurationsState[name] = generateConfigurationState(hydratedRevision, name, config);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
setObjectConfiguresState(objectConfigurationsState);
|
|
95
|
-
};
|
|
96
|
-
exports.resetAllObjectsConfigurationState = resetAllObjectsConfigurationState;
|
|
97
|
-
/**
|
|
98
|
-
* generates selectedFields object for Config from configureState
|
|
99
|
-
* @param configureState
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
const generateSelectedFieldsFromConfigureState = (configureState) => {
|
|
103
|
-
const { requiredFields, selectedOptionalFields } = (configureState === null || configureState === void 0 ? void 0 : configureState.read) || {};
|
|
104
|
-
const fields = new Set();
|
|
105
|
-
requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.forEach((field) => fields.add((0, utils_1.getFieldKeyValue)(field)));
|
|
106
|
-
// convert set to object for config
|
|
107
|
-
const selectedFields = Array.from(fields).reduce((acc, field) => (Object.assign(Object.assign({}, acc), { [field]: true })), {});
|
|
108
|
-
return Object.assign(Object.assign({}, selectedFields), (selectedOptionalFields || {}));
|
|
109
|
-
};
|
|
110
|
-
exports.generateSelectedFieldsFromConfigureState = generateSelectedFieldsFromConfigureState;
|
|
111
|
-
/**
|
|
112
|
-
* generates selectedFieldMappings object for Config from configureState
|
|
113
|
-
* @param configureState
|
|
114
|
-
* @returns
|
|
115
|
-
*/
|
|
116
|
-
const generateSelectedFieldMappingsFromConfigureState = (configureState) => {
|
|
117
|
-
const { selectedFieldMappings: selectedRequiredMapFields } = (configureState === null || configureState === void 0 ? void 0 : configureState.read) || {};
|
|
118
|
-
// filter out undefined values of selectedRequiredMapFields
|
|
119
|
-
const selectedRequiredMapFieldsSubmit = {};
|
|
120
|
-
if (selectedRequiredMapFields) {
|
|
121
|
-
Object.keys(selectedRequiredMapFields).forEach((key) => {
|
|
122
|
-
if (selectedRequiredMapFields[key] !== undefined) {
|
|
123
|
-
selectedRequiredMapFieldsSubmit[key] = selectedRequiredMapFields[key] || '';
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
console.warn(`Error undefined when generating selectedRequiredMapFieldsSubmit for key: ${key}`);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
return selectedRequiredMapFieldsSubmit;
|
|
131
|
-
};
|
|
132
|
-
exports.generateSelectedFieldMappingsFromConfigureState = generateSelectedFieldMappingsFromConfigureState;
|
|
133
|
-
// get configure state of single object
|
|
134
|
-
function getConfigureState(objectName, objectConfigurationsState) {
|
|
135
|
-
return objectConfigurationsState[objectName] || undefined;
|
|
136
|
-
}
|
|
137
|
-
exports.getConfigureState = getConfigureState;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { HydratedIntegrationField, HydratedIntegrationFieldExistent, HydratedIntegrationWriteObject, IntegrationFieldMapping } from '../../services/api';
|
|
2
|
-
export type SelectedNonConfigurableWriteFields = {
|
|
3
|
-
[key: string]: boolean;
|
|
4
|
-
};
|
|
5
|
-
type SavedWriteConfigureState = {
|
|
6
|
-
selectedNonConfigurableWriteFields: SelectedNonConfigurableWriteFields;
|
|
7
|
-
};
|
|
8
|
-
export type ConfigureStateWrite = {
|
|
9
|
-
writeObjects: HydratedIntegrationWriteObject[] | null;
|
|
10
|
-
selectedNonConfigurableWriteFields: SelectedNonConfigurableWriteFields | null;
|
|
11
|
-
isWriteModified: boolean;
|
|
12
|
-
savedConfig: SavedWriteConfigureState;
|
|
13
|
-
};
|
|
14
|
-
export type SelectOptionalFields = {
|
|
15
|
-
[key: string]: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type SelectMappingFields = {
|
|
18
|
-
[key: string]: string | undefined;
|
|
19
|
-
};
|
|
20
|
-
export type ConfigureStateRead = {
|
|
21
|
-
allFields: HydratedIntegrationFieldExistent[] | null;
|
|
22
|
-
requiredFields: HydratedIntegrationField[] | null;
|
|
23
|
-
optionalFields: HydratedIntegrationField[] | null;
|
|
24
|
-
requiredMapFields: IntegrationFieldMapping[] | null;
|
|
25
|
-
selectedOptionalFields: SelectOptionalFields | null;
|
|
26
|
-
selectedFieldMappings: SelectMappingFields | null;
|
|
27
|
-
isOptionalFieldsModified: boolean;
|
|
28
|
-
isRequiredMapFieldsModified: boolean;
|
|
29
|
-
savedConfig: SavedConfigureState;
|
|
30
|
-
};
|
|
31
|
-
type SavedConfigureState = {
|
|
32
|
-
optionalFields: SelectOptionalFields;
|
|
33
|
-
requiredMapFields: SelectMappingFields;
|
|
34
|
-
};
|
|
35
|
-
export type ConfigureState = {
|
|
36
|
-
read: ConfigureStateRead | null;
|
|
37
|
-
write: ConfigureStateWrite | null;
|
|
38
|
-
};
|
|
39
|
-
export type ObjectConfigurationsState = Record<string, ConfigureState>;
|
|
40
|
-
export type NavObject = {
|
|
41
|
-
name: string;
|
|
42
|
-
completed: boolean;
|
|
43
|
-
};
|
|
44
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ErrorBoundary } from '../../context/ErrorContextProvider';
|
|
2
|
-
import { Config, HydratedIntegrationField, HydratedIntegrationObject, HydratedIntegrationRead, HydratedRevision, IntegrationFieldMapping } from '../../services/api';
|
|
3
|
-
import { NavObject, SelectMappingFields } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* type guard for IntegrationFieldMapping | IntegrationFieldExistent
|
|
6
|
-
*
|
|
7
|
-
* @param field HydratedIntegrationField
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare function isIntegrationFieldMapping(field: HydratedIntegrationField): field is IntegrationFieldMapping;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param action HydratedIntegrationAction
|
|
14
|
-
* @param objectName string (account, contact, etc...)
|
|
15
|
-
* @returns HydratedIntegrationObject | null
|
|
16
|
-
*/
|
|
17
|
-
export declare function getObjectFromAction(action: HydratedIntegrationRead, objectName: string): HydratedIntegrationObject | null;
|
|
18
|
-
export declare function getRequiredFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
|
|
19
|
-
export declare function getRequiredMapFieldsFromObject(object: HydratedIntegrationObject): IntegrationFieldMapping[] | null;
|
|
20
|
-
export declare function getOptionalFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
|
|
21
|
-
export declare const getReadObject: (config: Config, objectName: string) => any;
|
|
22
|
-
export declare function getFieldKeyValue(field: HydratedIntegrationField): string;
|
|
23
|
-
/**
|
|
24
|
-
* generates Nav Objects for read action
|
|
25
|
-
* @param config
|
|
26
|
-
* @param hydratedRevision
|
|
27
|
-
* @returns NavObject[]
|
|
28
|
-
*/
|
|
29
|
-
export declare const generateReadNavObjects: (config: Config | undefined, hydratedRevision: HydratedRevision) => NavObject[];
|
|
30
|
-
export declare const generateOtherNavObject: (config: Config | undefined) => NavObject;
|
|
31
|
-
export declare function generateAllNavObjects(config: Config | undefined, hydratedRevision: HydratedRevision): NavObject[];
|
|
32
|
-
export declare function validateFieldMappings(requiredMapFields: IntegrationFieldMapping[] | null | undefined, selectedRequiredMapFields: SelectMappingFields | null | undefined, setErrors: (boundary: ErrorBoundary, errors: string[]) => void): {
|
|
33
|
-
errorList: string[];
|
|
34
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFieldMappings = exports.generateAllNavObjects = exports.generateOtherNavObject = exports.generateReadNavObjects = exports.getFieldKeyValue = exports.getReadObject = exports.getOptionalFieldsFromObject = exports.getRequiredMapFieldsFromObject = exports.getRequiredFieldsFromObject = exports.getObjectFromAction = exports.isIntegrationFieldMapping = void 0;
|
|
4
|
-
const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
|
|
5
|
-
const constant_1 = require("./nav/ObjectManagementNav/constant");
|
|
6
|
-
/**
|
|
7
|
-
* type guard for IntegrationFieldMapping | IntegrationFieldExistent
|
|
8
|
-
*
|
|
9
|
-
* @param field HydratedIntegrationField
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
function isIntegrationFieldMapping(field) {
|
|
13
|
-
return field.mapToName !== undefined;
|
|
14
|
-
}
|
|
15
|
-
exports.isIntegrationFieldMapping = isIntegrationFieldMapping;
|
|
16
|
-
// 1. get object
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param action HydratedIntegrationAction
|
|
20
|
-
* @param objectName string (account, contact, etc...)
|
|
21
|
-
* @returns HydratedIntegrationObject | null
|
|
22
|
-
*/
|
|
23
|
-
function getObjectFromAction(action, objectName) {
|
|
24
|
-
var _a;
|
|
25
|
-
return ((_a = action === null || action === void 0 ? void 0 : action.objects) === null || _a === void 0 ? void 0 : _a.find((object) => object.objectName === objectName)) || null;
|
|
26
|
-
}
|
|
27
|
-
exports.getObjectFromAction = getObjectFromAction;
|
|
28
|
-
// 2a. get required fields
|
|
29
|
-
function getRequiredFieldsFromObject(object) {
|
|
30
|
-
var _a;
|
|
31
|
-
return ((_a = object === null || object === void 0 ? void 0 : object.requiredFields) === null || _a === void 0 ? void 0 : _a.filter((rf) => !isIntegrationFieldMapping(rf) && !!rf.fieldName)) || null;
|
|
32
|
-
}
|
|
33
|
-
exports.getRequiredFieldsFromObject = getRequiredFieldsFromObject;
|
|
34
|
-
// 2b. get required custom mapping fields
|
|
35
|
-
function getRequiredMapFieldsFromObject(object) {
|
|
36
|
-
var _a;
|
|
37
|
-
const requiredMapFields = ((_a = object === null || object === void 0 ? void 0 : object.requiredFields) === null || _a === void 0 ? void 0 : _a.filter((rf) => isIntegrationFieldMapping(rf) && !!rf.mapToName)) || [];
|
|
38
|
-
return requiredMapFields; // type hack
|
|
39
|
-
}
|
|
40
|
-
exports.getRequiredMapFieldsFromObject = getRequiredMapFieldsFromObject;
|
|
41
|
-
// 3. get optional fields
|
|
42
|
-
function getOptionalFieldsFromObject(object) {
|
|
43
|
-
var _a;
|
|
44
|
-
return ((_a = object === null || object === void 0 ? void 0 : object.optionalFields) === null || _a === void 0 ? void 0 : _a.filter((rf) => !isIntegrationFieldMapping(rf) && !!rf.fieldName)) || null;
|
|
45
|
-
}
|
|
46
|
-
exports.getOptionalFieldsFromObject = getOptionalFieldsFromObject;
|
|
47
|
-
const getReadObject = (config, objectName) => { var _a, _b, _c; return (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c[objectName]; };
|
|
48
|
-
exports.getReadObject = getReadObject;
|
|
49
|
-
// aux. get field value based on type guard
|
|
50
|
-
function getFieldKeyValue(field) {
|
|
51
|
-
if (isIntegrationFieldMapping(field)) {
|
|
52
|
-
return field.mapToName; // custom mapping
|
|
53
|
-
}
|
|
54
|
-
return field.fieldName; // existent field
|
|
55
|
-
}
|
|
56
|
-
exports.getFieldKeyValue = getFieldKeyValue;
|
|
57
|
-
/**
|
|
58
|
-
* generates Nav Objects for read action
|
|
59
|
-
* @param config
|
|
60
|
-
* @param hydratedRevision
|
|
61
|
-
* @returns NavObject[]
|
|
62
|
-
*/
|
|
63
|
-
const generateReadNavObjects = (config, hydratedRevision) => {
|
|
64
|
-
var _a, _b, _c;
|
|
65
|
-
const navObjects = [];
|
|
66
|
-
(_c = (_b = (_a = hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.forEach((object) => {
|
|
67
|
-
navObjects.push({
|
|
68
|
-
name: object === null || object === void 0 ? void 0 : object.objectName,
|
|
69
|
-
// if no config, object is not completed
|
|
70
|
-
// object is completed if the key exists in the config
|
|
71
|
-
completed: config ? !!(0, exports.getReadObject)(config, object.objectName) : false,
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
return navObjects;
|
|
75
|
-
};
|
|
76
|
-
exports.generateReadNavObjects = generateReadNavObjects;
|
|
77
|
-
const generateOtherNavObject = (config) => {
|
|
78
|
-
var _a;
|
|
79
|
-
const navObject = {
|
|
80
|
-
name: constant_1.OTHER_CONST,
|
|
81
|
-
completed: config ? !!((_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.write) : false,
|
|
82
|
-
};
|
|
83
|
-
return navObject;
|
|
84
|
-
};
|
|
85
|
-
exports.generateOtherNavObject = generateOtherNavObject;
|
|
86
|
-
// generates standard objects and whether they are complete based on config and hydrated revision
|
|
87
|
-
function generateAllNavObjects(config, hydratedRevision) {
|
|
88
|
-
var _a;
|
|
89
|
-
const navObjects = (0, exports.generateReadNavObjects)(config, hydratedRevision);
|
|
90
|
-
const isWriteSupported = !!((_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.write);
|
|
91
|
-
const otherNavObject = isWriteSupported ? (0, exports.generateOtherNavObject)(config) : undefined;
|
|
92
|
-
if (otherNavObject) {
|
|
93
|
-
navObjects.push(otherNavObject);
|
|
94
|
-
}
|
|
95
|
-
return navObjects;
|
|
96
|
-
}
|
|
97
|
-
exports.generateAllNavObjects = generateAllNavObjects;
|
|
98
|
-
// validates whether required fields are filled out or throws error
|
|
99
|
-
function validateFieldMappings(requiredMapFields, selectedRequiredMapFields, setErrors) {
|
|
100
|
-
// check if fields with requirements are met
|
|
101
|
-
const fieldsWithRequirementsNotMet = (requiredMapFields === null || requiredMapFields === void 0 ? void 0 : requiredMapFields.filter((field) => !(selectedRequiredMapFields === null || selectedRequiredMapFields === void 0 ? void 0 : selectedRequiredMapFields[field === null || field === void 0 ? void 0 : field.mapToName]))) || [];
|
|
102
|
-
const errorList = fieldsWithRequirementsNotMet.map((field) => field.mapToName);
|
|
103
|
-
setErrors(ErrorContextProvider_1.ErrorBoundary.MAPPING, errorList);
|
|
104
|
-
// if requires fields are not met, set error fields and return
|
|
105
|
-
if (fieldsWithRequirementsNotMet === null || fieldsWithRequirementsNotMet === void 0 ? void 0 : fieldsWithRequirementsNotMet.length) {
|
|
106
|
-
console.error('required fields not met', fieldsWithRequirementsNotMet.map((field) => field.mapToDisplayName));
|
|
107
|
-
}
|
|
108
|
-
return { errorList };
|
|
109
|
-
}
|
|
110
|
-
exports.validateFieldMappings = validateFieldMappings;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface ConnectProviderProps {
|
|
2
|
-
provider: string;
|
|
3
|
-
consumerRef: string;
|
|
4
|
-
consumerName?: string;
|
|
5
|
-
groupRef: string;
|
|
6
|
-
groupName?: string;
|
|
7
|
-
redirectUrl?: string;
|
|
8
|
-
onSuccess?: (connectionID: string) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare function ConnectProvider({ provider, consumerRef, consumerName, groupRef, groupName, redirectUrl, onSuccess, }: ConnectProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConnectProvider = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ConnectionsContextProvider_1 = require("../../context/ConnectionsContextProvider");
|
|
6
|
-
const ProtectedConnectionLayout_1 = require("../Configure/layout/ProtectedConnectionLayout");
|
|
7
|
-
const RedirectHandler_1 = require("../RedirectHandler");
|
|
8
|
-
const ConnectedSuccessBox_1 = require("./ConnectedSuccessBox");
|
|
9
|
-
function ConnectProvider({ provider, consumerRef, consumerName, groupRef, groupName, redirectUrl, onSuccess, }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(ConnectionsContextProvider_1.ConnectionsProvider, { provider: provider, groupRef: groupRef, children: (0, jsx_runtime_1.jsx)(ProtectedConnectionLayout_1.ProtectedConnectionLayout, { provider: provider, consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, onSuccess: onSuccess, children: (0, jsx_runtime_1.jsx)(RedirectHandler_1.RedirectHandler, { redirectURL: redirectUrl, children: (0, jsx_runtime_1.jsx)(ConnectedSuccessBox_1.ConnectedSuccessBox, { provider: provider }) }) }) }));
|
|
11
|
-
}
|
|
12
|
-
exports.ConnectProvider = ConnectProvider;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConnectedSuccessBox = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ProjectContextProvider_1 = require("../../context/ProjectContextProvider");
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
7
|
-
const SuccessTextBox_1 = require("../SuccessTextBox");
|
|
8
|
-
function ConnectedSuccessBox({ provider }) {
|
|
9
|
-
const { appName } = (0, ProjectContextProvider_1.useProject)();
|
|
10
|
-
const text = `You have successfully connected your ${(0, utils_1.capitalize)(provider)} account to ${appName}.`;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(SuccessTextBox_1.SuccessTextBox, { text: text }));
|
|
12
|
-
}
|
|
13
|
-
exports.ConnectedSuccessBox = ConnectedSuccessBox;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type ConnectionHandlerPropsProps = {
|
|
2
|
-
onSuccess?: (connectionID: string) => void;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* ConnectionHandler is a component that handles onSuccess and onError callbacks
|
|
6
|
-
* @param onSuccess - callback function to be called when a connection is successful
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function useConnectionHandler({ onSuccess }: ConnectionHandlerPropsProps): void;
|
|
10
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useConnectionHandler = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const ConnectionsContextProvider_1 = require("../../context/ConnectionsContextProvider");
|
|
6
|
-
function useOnSuccessHandler(onSuccess) {
|
|
7
|
-
const { selectedConnection } = (0, ConnectionsContextProvider_1.useConnections)();
|
|
8
|
-
(0, react_1.useEffect)(() => {
|
|
9
|
-
// Check if a onSuccess callback is present
|
|
10
|
-
if (onSuccess && selectedConnection) {
|
|
11
|
-
// call callback when connection is selected
|
|
12
|
-
onSuccess(selectedConnection.id);
|
|
13
|
-
}
|
|
14
|
-
}, [onSuccess, selectedConnection]);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* ConnectionHandler is a component that handles onSuccess and onError callbacks
|
|
18
|
-
* @param onSuccess - callback function to be called when a connection is successful
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
function useConnectionHandler({ onSuccess }) {
|
|
22
|
-
useOnSuccessHandler(onSuccess);
|
|
23
|
-
}
|
|
24
|
-
exports.useConnectionHandler = useConnectionHandler;
|
|
@@ -1,11 +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", {
|
|
8
|
-
// eslint-disable-next-line max-len
|
|
9
|
-
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", fontSize: "md", children: message }) })] }));
|
|
10
|
-
}
|
|
11
|
-
exports.ErrorTextBox = ErrorTextBox;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type LandingContentProps = {
|
|
2
|
-
provider: string;
|
|
3
|
-
handleSubmit: () => void;
|
|
4
|
-
error: string | null;
|
|
5
|
-
isButtonDisabled?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function LandingContent({ provider, handleSubmit, error, isButtonDisabled, }: LandingContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LandingContent = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("@chakra-ui/react");
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
const OauthCardLayout_1 = require("../OauthCardLayout");
|
|
8
|
-
const OAuthErrorAlert_1 = require("../OAuthErrorAlert");
|
|
9
|
-
function LandingContent({ provider, handleSubmit, error, isButtonDisabled, }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(OauthCardLayout_1.OauthCardLayout, { children: (0, jsx_runtime_1.jsxs)(react_1.FormControl, { children: [(0, jsx_runtime_1.jsx)(react_1.FormLabel, { marginTop: "16", marginBottom: "0", children: (0, jsx_runtime_1.jsx)(react_1.Heading, { as: "h4", size: "md", children: `Set up ${(0, utils_1.capitalize)(provider)} integration` }) }), (0, jsx_runtime_1.jsx)(OAuthErrorAlert_1.OAuthErrorAlert, { error: error }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.Button, { isDisabled: isButtonDisabled, width: "100%", type: "submit", onClick: handleSubmit, children: "Next" })] }) }));
|
|
11
|
-
}
|
|
12
|
-
exports.LandingContent = LandingContent;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OAuth flow for any providers that do not require the consumer to enter a workspace first.
|
|
3
|
-
*/
|
|
4
|
-
interface NoWorkspaceOauthFlowProps {
|
|
5
|
-
provider: string;
|
|
6
|
-
consumerRef: string;
|
|
7
|
-
consumerName?: string;
|
|
8
|
-
groupRef: string;
|
|
9
|
-
groupName?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* NoWorkspaceOauthFlow first prompts user with a next button,
|
|
13
|
-
* then launches a popup with the OAuth flow.
|
|
14
|
-
*/
|
|
15
|
-
export declare function NoWorkspaceOauthFlow({ provider, consumerRef, consumerName, groupRef, groupName, }: NoWorkspaceOauthFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NoWorkspaceOauthFlow = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
* OAuth flow for any providers that do not require the consumer to enter a workspace first.
|
|
7
|
-
*/
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ApiKeyContextProvider_1 = require("../../../context/ApiKeyContextProvider");
|
|
10
|
-
const ProjectContextProvider_1 = require("../../../context/ProjectContextProvider");
|
|
11
|
-
const utils_1 = require("../../../utils");
|
|
12
|
-
const fetchOAuthPopupURL_1 = require("../fetchOAuthPopupURL");
|
|
13
|
-
const OAuthWindow_1 = require("../OAuthWindow/OAuthWindow");
|
|
14
|
-
const LandingContent_1 = require("./LandingContent");
|
|
15
|
-
/**
|
|
16
|
-
* NoWorkspaceOauthFlow first prompts user with a next button,
|
|
17
|
-
* then launches a popup with the OAuth flow.
|
|
18
|
-
*/
|
|
19
|
-
function NoWorkspaceOauthFlow({ provider, consumerRef, consumerName, groupRef, groupName, }) {
|
|
20
|
-
const { projectId } = (0, ProjectContextProvider_1.useProject)();
|
|
21
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
22
|
-
const [oAuthPopupURL, setOAuthPopupURL] = (0, react_1.useState)(null);
|
|
23
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
24
|
-
// fetch OAuth callback URL from connection so that oath popup can be launched
|
|
25
|
-
const handleSubmit = async () => {
|
|
26
|
-
var _a;
|
|
27
|
-
setError(null);
|
|
28
|
-
try {
|
|
29
|
-
const url = await (0, fetchOAuthPopupURL_1.fetchOAuthPopupURL)(projectId, consumerRef, groupRef, apiKey, provider, undefined, consumerName, groupName);
|
|
30
|
-
setOAuthPopupURL(url);
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
console.error('Could not fetch OAuth popup URL', { err });
|
|
34
|
-
setError((_a = err.message) !== null && _a !== void 0 ? _a : 'Unexpected error');
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const onClose = (0, react_1.useCallback)((err) => {
|
|
38
|
-
setError(err);
|
|
39
|
-
setOAuthPopupURL(null);
|
|
40
|
-
}, []);
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(OAuthWindow_1.OAuthWindow, { windowTitle: `Connect to ${(0, utils_1.capitalize)(provider)}`, oauthUrl: oAuthPopupURL, onClose: onClose, children: (0, jsx_runtime_1.jsx)(LandingContent_1.LandingContent, { provider: provider, handleSubmit: handleSubmit, error: error }) }));
|
|
42
|
-
}
|
|
43
|
-
exports.NoWorkspaceOauthFlow = NoWorkspaceOauthFlow;
|