@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,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAmpersandProvider = exports.AmpersandContext = exports.AmpersandProvider = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
* AmpersandProvider.tsx
|
|
7
|
-
*
|
|
8
|
-
* Takes API key and project ID. Fetches source, making it available to all child components.
|
|
9
|
-
* Also optionally accepts theme styles object with CSS values.
|
|
10
|
-
*/
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const ThemeProvider_1 = require("../../components/ThemeProvider");
|
|
13
|
-
const ApiKeyContextProvider_1 = require("../ApiKeyContextProvider");
|
|
14
|
-
const ErrorContextProvider_1 = require("../ErrorContextProvider");
|
|
15
|
-
const IntegrationListContextProvider_1 = require("../IntegrationListContextProvider");
|
|
16
|
-
const ProjectContextProvider_1 = require("../ProjectContextProvider");
|
|
17
|
-
function AmpersandProvider(props) {
|
|
18
|
-
const { options: { apiKey, projectId }, children } = props;
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(ThemeProvider_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(ErrorContextProvider_1.ErrorStateProvider, { children: (0, jsx_runtime_1.jsx)(ApiKeyContextProvider_1.ApiKeyProvider, { value: apiKey, children: (0, jsx_runtime_1.jsx)(ProjectContextProvider_1.ProjectProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(IntegrationListContextProvider_1.IntegrationListProvider, { projectId: projectId, children: children }) }) }) }) }));
|
|
20
|
-
}
|
|
21
|
-
exports.AmpersandProvider = AmpersandProvider;
|
|
22
|
-
exports.AmpersandContext = (0, react_1.createContext)(null);
|
|
23
|
-
function useAmpersandProvider() {
|
|
24
|
-
const ampersandContext = (0, react_1.useContext)(exports.AmpersandContext);
|
|
25
|
-
if (!ampersandContext) {
|
|
26
|
-
throw new Error(`Cannot call useAmpersandProvider unless your
|
|
27
|
-
component is wrapped with AmpersandProvider`);
|
|
28
|
-
}
|
|
29
|
-
return ampersandContext;
|
|
30
|
-
}
|
|
31
|
-
exports.useAmpersandProvider = useAmpersandProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AmpersandContextProvider';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./AmpersandContextProvider"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useApiKey = exports.ApiKeyProvider = exports.ApiKeyContext = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
exports.ApiKeyContext = (0, react_1.createContext)(null);
|
|
6
|
-
exports.ApiKeyProvider = exports.ApiKeyContext.Provider;
|
|
7
|
-
const useApiKey = () => {
|
|
8
|
-
const apiKey = (0, react_1.useContext)(exports.ApiKeyContext);
|
|
9
|
-
if (apiKey === null) {
|
|
10
|
-
throw new Error('useApiKey must be used within an ApiKeyProvider');
|
|
11
|
-
}
|
|
12
|
-
return apiKey;
|
|
13
|
-
};
|
|
14
|
-
exports.useApiKey = useApiKey;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Connection } from '../services/api';
|
|
3
|
-
interface ConnectionsContextValue {
|
|
4
|
-
connections: Connection[] | null;
|
|
5
|
-
selectedConnection: Connection | null;
|
|
6
|
-
setConnections: React.Dispatch<React.SetStateAction<Connection[] | null>>;
|
|
7
|
-
setSelectedConnection: React.Dispatch<React.SetStateAction<Connection | null>>;
|
|
8
|
-
}
|
|
9
|
-
export declare const ConnectionsContext: import("react").Context<ConnectionsContextValue>;
|
|
10
|
-
export declare const useConnections: () => ConnectionsContextValue;
|
|
11
|
-
type ConnectionsProviderProps = {
|
|
12
|
-
provider?: string;
|
|
13
|
-
groupRef: string;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
};
|
|
16
|
-
export declare function ConnectionsProvider({ provider, groupRef, children, }: ConnectionsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConnectionsProvider = exports.useConnections = exports.ConnectionsContext = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const LoadingIcon_1 = require("../assets/LoadingIcon");
|
|
7
|
-
const ErrorTextBox_1 = require("../components/ErrorTextBox");
|
|
8
|
-
const api_1 = require("../services/api");
|
|
9
|
-
const ApiKeyContextProvider_1 = require("./ApiKeyContextProvider");
|
|
10
|
-
const ErrorContextProvider_1 = require("./ErrorContextProvider");
|
|
11
|
-
const InstallIntegrationContextProvider_1 = require("./InstallIntegrationContextProvider");
|
|
12
|
-
const ProjectContextProvider_1 = require("./ProjectContextProvider");
|
|
13
|
-
exports.ConnectionsContext = (0, react_1.createContext)({
|
|
14
|
-
connections: null,
|
|
15
|
-
selectedConnection: null,
|
|
16
|
-
setConnections: () => { },
|
|
17
|
-
setSelectedConnection: () => { },
|
|
18
|
-
});
|
|
19
|
-
const useConnections = () => {
|
|
20
|
-
const context = (0, react_1.useContext)(exports.ConnectionsContext);
|
|
21
|
-
if (!context) {
|
|
22
|
-
throw new Error('useConnections must be used within a ConnectionsProvider');
|
|
23
|
-
}
|
|
24
|
-
return context;
|
|
25
|
-
};
|
|
26
|
-
exports.useConnections = useConnections;
|
|
27
|
-
function ConnectionsProvider({ provider, groupRef, children, }) {
|
|
28
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
29
|
-
const { projectId } = (0, ProjectContextProvider_1.useProject)();
|
|
30
|
-
const [connections, setConnections] = (0, react_1.useState)(null);
|
|
31
|
-
const [selectedConnection, setSelectedConnection] = (0, react_1.useState)(null);
|
|
32
|
-
const [isLoading, setLoadingState] = (0, react_1.useState)(true);
|
|
33
|
-
const { setError, isError } = (0, ErrorContextProvider_1.useErrorState)();
|
|
34
|
-
const { provider: providerFromProps } = (0, InstallIntegrationContextProvider_1.useInstallIntegrationProps)();
|
|
35
|
-
if (!projectId) {
|
|
36
|
-
throw new Error('ConnectionsProvider must be used within AmpersandProvider');
|
|
37
|
-
}
|
|
38
|
-
const selectedProvider = provider || providerFromProps;
|
|
39
|
-
if (!selectedProvider) {
|
|
40
|
-
throw new Error('ConnectionsProvider must be given a provider prop or be used within InstallIntegrationProvider');
|
|
41
|
-
}
|
|
42
|
-
(0, react_1.useEffect)(() => {
|
|
43
|
-
(0, api_1.api)().connectionApi.listConnections({ projectId, groupRef, provider: selectedProvider }, {
|
|
44
|
-
headers: {
|
|
45
|
-
'X-Api-Key': apiKey !== null && apiKey !== void 0 ? apiKey : '',
|
|
46
|
-
},
|
|
47
|
-
}).then((_connections) => {
|
|
48
|
-
setLoadingState(false);
|
|
49
|
-
setConnections(_connections);
|
|
50
|
-
}).catch((err) => {
|
|
51
|
-
setLoadingState(false);
|
|
52
|
-
setError(ErrorContextProvider_1.ErrorBoundary.CONNECTION_LIST, projectId);
|
|
53
|
-
console.error(`Error retrieving existing OAuth connections for group ID ${groupRef}:`, err);
|
|
54
|
-
});
|
|
55
|
-
}, [projectId, apiKey, groupRef, selectedProvider, setError]);
|
|
56
|
-
const contextValue = (0, react_1.useMemo)(() => ({
|
|
57
|
-
connections,
|
|
58
|
-
selectedConnection,
|
|
59
|
-
setConnections,
|
|
60
|
-
setSelectedConnection,
|
|
61
|
-
}), [connections, selectedConnection, setConnections, setSelectedConnection]);
|
|
62
|
-
return (isError(ErrorContextProvider_1.ErrorBoundary.CONNECTION_LIST, projectId)
|
|
63
|
-
? (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: "Error retrieving existing connections" })
|
|
64
|
-
: ((0, jsx_runtime_1.jsx)(exports.ConnectionsContext.Provider, { value: contextValue, children: isLoading ? (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}) : children })));
|
|
65
|
-
}
|
|
66
|
-
exports.ConnectionsProvider = ConnectionsProvider;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare enum ErrorBoundary {
|
|
3
|
-
MAPPING = "mappingError",
|
|
4
|
-
INTEGRATION_LIST = "integrationListError",
|
|
5
|
-
PROJECT = "projectError",
|
|
6
|
-
CONNECTION_LIST = "connectionListError",
|
|
7
|
-
HYDRATED_REVISION = "hydratedRevisionError",
|
|
8
|
-
INSTALLATION_LIST = "installationListError"
|
|
9
|
-
}
|
|
10
|
-
export type ErrorState = {
|
|
11
|
-
[boundary in ErrorBoundary]: {
|
|
12
|
-
[key: string]: boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const ErrorContext: React.Context<{
|
|
16
|
-
errorState: ErrorState;
|
|
17
|
-
setErrorState: React.Dispatch<React.SetStateAction<ErrorState>>;
|
|
18
|
-
resetBoundary: (boundary: ErrorBoundary) => void;
|
|
19
|
-
setError: (boundary: ErrorBoundary, key: string) => void;
|
|
20
|
-
isError: (boundary: ErrorBoundary, key: string) => boolean;
|
|
21
|
-
removeError: (boundary: ErrorBoundary, key: string) => void;
|
|
22
|
-
setErrors: (boundary: ErrorBoundary, keys: string[]) => void;
|
|
23
|
-
} | undefined>;
|
|
24
|
-
export declare function useErrorState(): {
|
|
25
|
-
errorState: ErrorState;
|
|
26
|
-
setErrorState: React.Dispatch<React.SetStateAction<ErrorState>>;
|
|
27
|
-
resetBoundary: (boundary: ErrorBoundary) => void;
|
|
28
|
-
setError: (boundary: ErrorBoundary, key: string) => void;
|
|
29
|
-
isError: (boundary: ErrorBoundary, key: string) => boolean;
|
|
30
|
-
removeError: (boundary: ErrorBoundary, key: string) => void;
|
|
31
|
-
setErrors: (boundary: ErrorBoundary, keys: string[]) => void;
|
|
32
|
-
};
|
|
33
|
-
type ErrorProviderProps = {
|
|
34
|
-
children: React.ReactNode;
|
|
35
|
-
};
|
|
36
|
-
export declare function ErrorStateProvider({ children }: ErrorProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorStateProvider = exports.useErrorState = exports.ErrorContext = exports.ErrorBoundary = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
var ErrorBoundary;
|
|
7
|
-
(function (ErrorBoundary) {
|
|
8
|
-
ErrorBoundary["MAPPING"] = "mappingError";
|
|
9
|
-
ErrorBoundary["INTEGRATION_LIST"] = "integrationListError";
|
|
10
|
-
ErrorBoundary["PROJECT"] = "projectError";
|
|
11
|
-
ErrorBoundary["CONNECTION_LIST"] = "connectionListError";
|
|
12
|
-
ErrorBoundary["HYDRATED_REVISION"] = "hydratedRevisionError";
|
|
13
|
-
ErrorBoundary["INSTALLATION_LIST"] = "installationListError";
|
|
14
|
-
})(ErrorBoundary || (exports.ErrorBoundary = ErrorBoundary = {}));
|
|
15
|
-
exports.ErrorContext = (0, react_1.createContext)(undefined);
|
|
16
|
-
function useErrorState() {
|
|
17
|
-
const context = (0, react_1.useContext)(exports.ErrorContext);
|
|
18
|
-
if (!context) {
|
|
19
|
-
throw new Error('useErrorState must be used within a ErrorProvider');
|
|
20
|
-
}
|
|
21
|
-
return context;
|
|
22
|
-
}
|
|
23
|
-
exports.useErrorState = useErrorState;
|
|
24
|
-
const initialState = (() => {
|
|
25
|
-
const obj = {};
|
|
26
|
-
Object.values(ErrorBoundary).forEach((key) => {
|
|
27
|
-
obj[key] = {};
|
|
28
|
-
});
|
|
29
|
-
return obj;
|
|
30
|
-
})();
|
|
31
|
-
function ErrorStateProvider({ children }) {
|
|
32
|
-
const [errorState, setErrorState] = (0, react_1.useState)(initialState);
|
|
33
|
-
const setError = (0, react_1.useCallback)((boundary, key) => {
|
|
34
|
-
setErrorState((prevState) => {
|
|
35
|
-
const newErrorState = Object.assign({}, prevState);
|
|
36
|
-
newErrorState[boundary] = newErrorState[boundary] || {};
|
|
37
|
-
newErrorState[boundary][key] = true;
|
|
38
|
-
return newErrorState;
|
|
39
|
-
});
|
|
40
|
-
}, [setErrorState]);
|
|
41
|
-
const isError = (0, react_1.useCallback)((boundary, key) => { var _a; return !!((_a = errorState[boundary]) === null || _a === void 0 ? void 0 : _a[key]); }, [errorState]);
|
|
42
|
-
const removeError = (0, react_1.useCallback)((boundary, key) => {
|
|
43
|
-
setErrorState((prevState) => {
|
|
44
|
-
var _a;
|
|
45
|
-
const newErrorState = Object.assign({}, prevState);
|
|
46
|
-
(_a = newErrorState[boundary]) === null || _a === void 0 ? true : delete _a[key];
|
|
47
|
-
return newErrorState;
|
|
48
|
-
});
|
|
49
|
-
}, [setErrorState]);
|
|
50
|
-
const resetBoundary = (0, react_1.useCallback)((boundary) => {
|
|
51
|
-
setErrorState((prevState) => {
|
|
52
|
-
const newErrorState = Object.assign({}, prevState);
|
|
53
|
-
newErrorState[boundary] = {};
|
|
54
|
-
return newErrorState;
|
|
55
|
-
});
|
|
56
|
-
}, [setErrorState]);
|
|
57
|
-
const setErrors = (0, react_1.useCallback)((boundary, keys) => {
|
|
58
|
-
setErrorState((prevState) => {
|
|
59
|
-
const newErrorState = Object.assign({}, prevState);
|
|
60
|
-
newErrorState[boundary] = newErrorState[boundary] || {};
|
|
61
|
-
keys.forEach((key) => {
|
|
62
|
-
newErrorState[boundary][key] = true;
|
|
63
|
-
});
|
|
64
|
-
return newErrorState;
|
|
65
|
-
});
|
|
66
|
-
}, [setErrorState]);
|
|
67
|
-
const contextValue = (0, react_1.useMemo)(() => ({
|
|
68
|
-
errorState, setErrorState, setError, isError, removeError, resetBoundary, setErrors,
|
|
69
|
-
}), [errorState, setErrorState, setError, isError, removeError, resetBoundary, setErrors]);
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(exports.ErrorContext.Provider, { value: contextValue, children: children }));
|
|
71
|
-
}
|
|
72
|
-
exports.ErrorStateProvider = ErrorStateProvider;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Config, Installation, Integration } from '../services/api';
|
|
3
|
-
interface InstallIntegrationContextValue {
|
|
4
|
-
integrationId: string;
|
|
5
|
-
provider: string;
|
|
6
|
-
integrationObj?: Integration | null;
|
|
7
|
-
consumerRef: string;
|
|
8
|
-
consumerName?: string;
|
|
9
|
-
groupRef: string;
|
|
10
|
-
groupName?: string;
|
|
11
|
-
installation?: Installation;
|
|
12
|
-
setInstallation: (installationObj: Installation) => void;
|
|
13
|
-
resetInstallations: () => void;
|
|
14
|
-
onInstallSuccess?: (installationId: string, config: Config) => void;
|
|
15
|
-
onUpdateSuccess?: (installationId: string, config: Config) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const InstallIntegrationContext: import("react").Context<InstallIntegrationContextValue>;
|
|
18
|
-
export declare function useInstallIntegrationProps(): InstallIntegrationContextValue;
|
|
19
|
-
interface InstallIntegrationProviderProps {
|
|
20
|
-
integration: string;
|
|
21
|
-
consumerRef: string;
|
|
22
|
-
consumerName?: string;
|
|
23
|
-
groupRef: string;
|
|
24
|
-
groupName?: string;
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
onInstallSuccess?: (installationId: string, config: Config) => void;
|
|
27
|
-
onUpdateSuccess?: (installationId: string, config: Config) => void;
|
|
28
|
-
}
|
|
29
|
-
export declare function InstallIntegrationProvider({ children, integration, consumerRef, consumerName, groupRef, groupName, onInstallSuccess, onUpdateSuccess, }: InstallIntegrationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export {};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InstallIntegrationProvider = exports.useInstallIntegrationProps = exports.InstallIntegrationContext = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const LoadingIcon_1 = require("../assets/LoadingIcon");
|
|
7
|
-
const ErrorTextBox_1 = require("../components/ErrorTextBox");
|
|
8
|
-
const api_1 = require("../services/api");
|
|
9
|
-
const utils_1 = require("../utils");
|
|
10
|
-
const ApiKeyContextProvider_1 = require("./ApiKeyContextProvider");
|
|
11
|
-
const ErrorContextProvider_1 = require("./ErrorContextProvider");
|
|
12
|
-
const IntegrationListContextProvider_1 = require("./IntegrationListContextProvider");
|
|
13
|
-
const ProjectContextProvider_1 = require("./ProjectContextProvider");
|
|
14
|
-
// Create a context to pass down the props
|
|
15
|
-
exports.InstallIntegrationContext = (0, react_1.createContext)({
|
|
16
|
-
integrationId: '',
|
|
17
|
-
provider: '',
|
|
18
|
-
integrationObj: undefined,
|
|
19
|
-
consumerRef: '',
|
|
20
|
-
consumerName: '',
|
|
21
|
-
groupRef: '',
|
|
22
|
-
groupName: '',
|
|
23
|
-
installation: undefined,
|
|
24
|
-
setInstallation: () => { },
|
|
25
|
-
resetInstallations: () => { },
|
|
26
|
-
onInstallSuccess: undefined,
|
|
27
|
-
onUpdateSuccess: undefined,
|
|
28
|
-
});
|
|
29
|
-
// Create a custom hook to access the props
|
|
30
|
-
function useInstallIntegrationProps() {
|
|
31
|
-
const context = (0, react_1.useContext)(exports.InstallIntegrationContext);
|
|
32
|
-
if (!context) {
|
|
33
|
-
throw new Error('useInstallIntegrationProps must be used within an InstallIntegrationProvider');
|
|
34
|
-
}
|
|
35
|
-
return context;
|
|
36
|
-
}
|
|
37
|
-
exports.useInstallIntegrationProps = useInstallIntegrationProps;
|
|
38
|
-
// Wrap your parent component with the context provider
|
|
39
|
-
function InstallIntegrationProvider({ children, integration, consumerRef, consumerName, groupRef, groupName, onInstallSuccess, onUpdateSuccess, }) {
|
|
40
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
41
|
-
const { projectId } = (0, ProjectContextProvider_1.useProject)();
|
|
42
|
-
const { integrations } = (0, IntegrationListContextProvider_1.useIntegrationList)();
|
|
43
|
-
const [installations, setInstallations] = (0, react_1.useState)([]);
|
|
44
|
-
const [isLoading, setLoadingState] = (0, react_1.useState)(true);
|
|
45
|
-
const { setError, isError } = (0, ErrorContextProvider_1.useErrorState)();
|
|
46
|
-
const installation = (installations === null || installations === void 0 ? void 0 : installations[0]) || null; // there should only be one installation for mvp
|
|
47
|
-
const integrationObj = (0, react_1.useMemo)(() => (0, utils_1.findIntegrationFromList)(integration, integrations || []), [integration, integrations]);
|
|
48
|
-
(0, react_1.useEffect)(() => {
|
|
49
|
-
if (integrationObj === null && (integrations === null || integrations === void 0 ? void 0 : integrations.length)) {
|
|
50
|
-
console.error(`Integration "${integration}" not found in integration list`);
|
|
51
|
-
}
|
|
52
|
-
}, [integration, integrationObj, integrations]);
|
|
53
|
-
// default set the installations array with a single installation object
|
|
54
|
-
// may need to find and update the installation object in the future
|
|
55
|
-
const setInstallation = (0, react_1.useCallback)((installationObj) => {
|
|
56
|
-
setInstallations([installationObj]);
|
|
57
|
-
}, [setInstallations]);
|
|
58
|
-
const resetInstallations = (0, react_1.useCallback)(() => {
|
|
59
|
-
if (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.id) {
|
|
60
|
-
// check if installation exists on selected integration
|
|
61
|
-
(0, api_1.api)().installationApi.listInstallations({
|
|
62
|
-
projectId,
|
|
63
|
-
integrationId: integrationObj.id,
|
|
64
|
-
groupRef,
|
|
65
|
-
}, {
|
|
66
|
-
headers: {
|
|
67
|
-
'X-Api-Key': apiKey !== null && apiKey !== void 0 ? apiKey : '',
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
.then((_installations) => {
|
|
71
|
-
setLoadingState(false);
|
|
72
|
-
setInstallations(_installations || []);
|
|
73
|
-
})
|
|
74
|
-
.catch((err) => {
|
|
75
|
-
setError(ErrorContextProvider_1.ErrorBoundary.INSTALLATION_LIST, integrationObj.id);
|
|
76
|
-
setLoadingState(false);
|
|
77
|
-
console.error('Error retrieving installation information: ', err);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}, [integrationObj, projectId, apiKey, setError, groupRef]);
|
|
81
|
-
const integrationErrorKey = (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.id) || '';
|
|
82
|
-
// check if integration has been installed in AmpersandProvider
|
|
83
|
-
(0, react_1.useEffect)(() => {
|
|
84
|
-
resetInstallations();
|
|
85
|
-
}, [resetInstallations]);
|
|
86
|
-
const props = (0, react_1.useMemo)(() => ({
|
|
87
|
-
integrationId: (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.id) || '',
|
|
88
|
-
provider: (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.provider) || '',
|
|
89
|
-
integrationObj,
|
|
90
|
-
consumerRef,
|
|
91
|
-
consumerName,
|
|
92
|
-
groupRef,
|
|
93
|
-
groupName,
|
|
94
|
-
installation,
|
|
95
|
-
setInstallation,
|
|
96
|
-
resetInstallations,
|
|
97
|
-
onInstallSuccess,
|
|
98
|
-
onUpdateSuccess,
|
|
99
|
-
}), [integrationObj, consumerRef, consumerName, groupRef,
|
|
100
|
-
groupName, installation, setInstallation, resetInstallations, onInstallSuccess, onUpdateSuccess]);
|
|
101
|
-
if (integrationObj !== null) {
|
|
102
|
-
const errorMessage = 'Error retrieving installation information for integration '
|
|
103
|
-
+ `"${(integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.name) || 'unknown'}"`;
|
|
104
|
-
return (isError(ErrorContextProvider_1.ErrorBoundary.INSTALLATION_LIST, integrationErrorKey))
|
|
105
|
-
? (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: errorMessage }) : ((0, jsx_runtime_1.jsx)(exports.InstallIntegrationContext.Provider, { value: props, children: isLoading ? (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}) : children }));
|
|
106
|
-
}
|
|
107
|
-
// if integration not found, return error message
|
|
108
|
-
return (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: `Integration "${integration}" not found` });
|
|
109
|
-
}
|
|
110
|
-
exports.InstallIntegrationProvider = InstallIntegrationProvider;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Integration } from '../services/api';
|
|
3
|
-
interface IntegrationListContextValue {
|
|
4
|
-
integrations: Integration[] | null;
|
|
5
|
-
}
|
|
6
|
-
export declare const IntegrationListContext: import("react").Context<IntegrationListContextValue>;
|
|
7
|
-
export declare const useIntegrationList: () => IntegrationListContextValue;
|
|
8
|
-
type IntegrationListContextProviderProps = {
|
|
9
|
-
projectId: string;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
};
|
|
12
|
-
export declare function IntegrationListProvider({ projectId, children }: IntegrationListContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntegrationListProvider = exports.useIntegrationList = exports.IntegrationListContext = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const LoadingIcon_1 = require("../assets/LoadingIcon");
|
|
7
|
-
const ErrorTextBox_1 = require("../components/ErrorTextBox");
|
|
8
|
-
const api_1 = require("../services/api");
|
|
9
|
-
const ApiKeyContextProvider_1 = require("./ApiKeyContextProvider");
|
|
10
|
-
const ErrorContextProvider_1 = require("./ErrorContextProvider");
|
|
11
|
-
exports.IntegrationListContext = (0, react_1.createContext)({
|
|
12
|
-
integrations: null,
|
|
13
|
-
});
|
|
14
|
-
const useIntegrationList = () => {
|
|
15
|
-
const context = (0, react_1.useContext)(exports.IntegrationListContext);
|
|
16
|
-
if (!context) {
|
|
17
|
-
throw new Error('useIntegrationList must be used within a IntegrationListProvider');
|
|
18
|
-
}
|
|
19
|
-
return context;
|
|
20
|
-
};
|
|
21
|
-
exports.useIntegrationList = useIntegrationList;
|
|
22
|
-
function IntegrationListProvider({ projectId, children }) {
|
|
23
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
24
|
-
const { setError, isError } = (0, ErrorContextProvider_1.useErrorState)();
|
|
25
|
-
const [integrations, setIntegrations] = (0, react_1.useState)(null);
|
|
26
|
-
const [isLoading, setLoadingState] = (0, react_1.useState)(true);
|
|
27
|
-
(0, react_1.useEffect)(() => {
|
|
28
|
-
(0, api_1.api)().integrationApi.listIntegrations({ projectId }, {
|
|
29
|
-
headers: {
|
|
30
|
-
'X-Api-Key': apiKey !== null && apiKey !== void 0 ? apiKey : '',
|
|
31
|
-
},
|
|
32
|
-
}).then((_integrations) => {
|
|
33
|
-
setLoadingState(false);
|
|
34
|
-
setIntegrations(_integrations || []);
|
|
35
|
-
}).catch((err) => {
|
|
36
|
-
setLoadingState(false);
|
|
37
|
-
setError(ErrorContextProvider_1.ErrorBoundary.INTEGRATION_LIST, projectId);
|
|
38
|
-
console.error('Error retrieving integration information for : ', err);
|
|
39
|
-
});
|
|
40
|
-
}, [projectId, apiKey, setError]);
|
|
41
|
-
const contextValue = (0, react_1.useMemo)(() => ({
|
|
42
|
-
integrations,
|
|
43
|
-
}), [integrations]);
|
|
44
|
-
return (isError(ErrorContextProvider_1.ErrorBoundary.INTEGRATION_LIST, projectId)
|
|
45
|
-
? (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: "Error retrieving integrations for the project, double check the API key" })
|
|
46
|
-
: ((0, jsx_runtime_1.jsx)(exports.IntegrationListContext.Provider, { value: contextValue, children: isLoading ? (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}) : children })));
|
|
47
|
-
}
|
|
48
|
-
exports.IntegrationListProvider = IntegrationListProvider;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Project } from '../services/api';
|
|
3
|
-
interface ProjectContextValue {
|
|
4
|
-
project: Project | null;
|
|
5
|
-
appName: string;
|
|
6
|
-
projectId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const ProjectContext: import("react").Context<ProjectContextValue>;
|
|
9
|
-
export declare const useProject: () => ProjectContextValue;
|
|
10
|
-
type ProjectProviderProps = {
|
|
11
|
-
projectId: string;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
export declare function ProjectProvider({ projectId, children }: ProjectProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectProvider = exports.useProject = exports.ProjectContext = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const LoadingIcon_1 = require("../assets/LoadingIcon");
|
|
7
|
-
const ErrorTextBox_1 = require("../components/ErrorTextBox");
|
|
8
|
-
const api_1 = require("../services/api");
|
|
9
|
-
const ApiKeyContextProvider_1 = require("./ApiKeyContextProvider");
|
|
10
|
-
const ErrorContextProvider_1 = require("./ErrorContextProvider");
|
|
11
|
-
exports.ProjectContext = (0, react_1.createContext)({
|
|
12
|
-
project: null,
|
|
13
|
-
appName: '',
|
|
14
|
-
projectId: '',
|
|
15
|
-
});
|
|
16
|
-
const useProject = () => {
|
|
17
|
-
const context = (0, react_1.useContext)(exports.ProjectContext);
|
|
18
|
-
if (!context) {
|
|
19
|
-
throw new Error('useProject must be used within a ProjectProvider');
|
|
20
|
-
}
|
|
21
|
-
return context;
|
|
22
|
-
};
|
|
23
|
-
exports.useProject = useProject;
|
|
24
|
-
function ProjectProvider({ projectId, children }) {
|
|
25
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
26
|
-
const { isError, setError } = (0, ErrorContextProvider_1.useErrorState)();
|
|
27
|
-
const [project, setProject] = (0, react_1.useState)(null);
|
|
28
|
-
const [isLoading, setLoadingState] = (0, react_1.useState)(true);
|
|
29
|
-
(0, react_1.useEffect)(() => {
|
|
30
|
-
(0, api_1.api)().projectApi.getProject({ projectId }, {
|
|
31
|
-
headers: {
|
|
32
|
-
'X-Api-Key': apiKey !== null && apiKey !== void 0 ? apiKey : '',
|
|
33
|
-
},
|
|
34
|
-
}).then((_project) => {
|
|
35
|
-
setLoadingState(false);
|
|
36
|
-
setProject(_project);
|
|
37
|
-
}).catch((err) => {
|
|
38
|
-
setError(ErrorContextProvider_1.ErrorBoundary.PROJECT, projectId);
|
|
39
|
-
setLoadingState(false);
|
|
40
|
-
console.error('Error loading Ampersand project: ', err);
|
|
41
|
-
});
|
|
42
|
-
}, [projectId, apiKey, setLoadingState, setError]);
|
|
43
|
-
const contextValue = (0, react_1.useMemo)(() => ({
|
|
44
|
-
projectId, project, appName: (project === null || project === void 0 ? void 0 : project.appName) || '',
|
|
45
|
-
}), [projectId, project]);
|
|
46
|
-
return (isError(ErrorContextProvider_1.ErrorBoundary.PROJECT, projectId)
|
|
47
|
-
? (0, jsx_runtime_1.jsx)(ErrorTextBox_1.ErrorTextBox, { message: `Error loading project ${projectId}` })
|
|
48
|
-
: ((0, jsx_runtime_1.jsx)(exports.ProjectContext.Provider, { value: contextValue, children: isLoading ? (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}) : children })));
|
|
49
|
-
}
|
|
50
|
-
exports.ProjectProvider = ProjectProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useIsIntegrationInstalled';
|
package/build/src/hooks/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useIsIntegrationInstalled"), exports);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useIsIntegrationInstalled = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const ApiKeyContextProvider_1 = require("../context/ApiKeyContextProvider");
|
|
6
|
-
const IntegrationListContextProvider_1 = require("../context/IntegrationListContextProvider");
|
|
7
|
-
const ProjectContextProvider_1 = require("../context/ProjectContextProvider");
|
|
8
|
-
const api_1 = require("../services/api");
|
|
9
|
-
const useIsIntegrationInstalled = (integration, groupRef) => {
|
|
10
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
11
|
-
const { projectId } = (0, ProjectContextProvider_1.useProject)();
|
|
12
|
-
const { integrations } = (0, IntegrationListContextProvider_1.useIntegrationList)();
|
|
13
|
-
const [isLoaded, setIsLoaded] = (0, react_1.useState)(false);
|
|
14
|
-
const [isIntegrationInstalled, setIsIntegrationInstalled] = (0, react_1.useState)(null);
|
|
15
|
-
if (!apiKey || !projectId) {
|
|
16
|
-
throw new Error('useIsIntegrationInstalled must be used within AmpersandProvider');
|
|
17
|
-
}
|
|
18
|
-
if (!integration) {
|
|
19
|
-
throw new Error('useIsIntegrationInstalled requires an integration name');
|
|
20
|
-
}
|
|
21
|
-
if (!groupRef) {
|
|
22
|
-
throw new Error('useIsIntegrationInstalled requires a groupRef');
|
|
23
|
-
}
|
|
24
|
-
const integrationToCheck = (0, react_1.useMemo)(() => integrations === null || integrations === void 0 ? void 0 : integrations.reduce((acc, _integration) => ((_integration === null || _integration === void 0 ? void 0 : _integration.name) === integration
|
|
25
|
-
? _integration
|
|
26
|
-
: acc), {}), [integrations, integration]);
|
|
27
|
-
(0, react_1.useEffect)(() => {
|
|
28
|
-
if (!integrationToCheck)
|
|
29
|
-
return;
|
|
30
|
-
(0, api_1.api)().installationApi.listInstallations({
|
|
31
|
-
projectId,
|
|
32
|
-
integrationId: integrationToCheck.id,
|
|
33
|
-
groupRef,
|
|
34
|
-
}, {
|
|
35
|
-
headers: {
|
|
36
|
-
'x-api-key': apiKey,
|
|
37
|
-
},
|
|
38
|
-
}).then((installationList) => {
|
|
39
|
-
setIsLoaded(true);
|
|
40
|
-
setIsIntegrationInstalled(installationList.length > 0);
|
|
41
|
-
}).catch((err) => {
|
|
42
|
-
console.error('Error listing installations: ', err);
|
|
43
|
-
setIsLoaded(true);
|
|
44
|
-
});
|
|
45
|
-
}, [groupRef, apiKey, projectId, integrationToCheck]);
|
|
46
|
-
return { isLoaded, isIntegrationInstalled };
|
|
47
|
-
};
|
|
48
|
-
exports.useIsIntegrationInstalled = useIsIntegrationInstalled;
|
package/build/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './public';
|
package/build/src/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./public"), exports);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Contains all the features to be exported out of the library
|
|
3
|
-
*/
|
|
4
|
-
export * from '../context/AmpersandContextProvider';
|
|
5
|
-
export * from '../components/Configure';
|
|
6
|
-
export * from '../components/Connect/ConnectProvider';
|
|
7
|
-
export * from '../hooks/useIsIntegrationInstalled';
|