@amp-labs/react 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/generated-sources/api/src/apis/APIKeyApi.d.ts +158 -0
- package/build/generated-sources/api/src/apis/APIKeyApi.js +188 -0
- package/build/generated-sources/api/src/apis/DestinationApi.d.ts +62 -8
- package/build/generated-sources/api/src/apis/DestinationApi.js +62 -3
- package/build/generated-sources/api/src/apis/OperationApi.d.ts +27 -1
- package/build/generated-sources/api/src/apis/OperationApi.js +27 -0
- package/build/generated-sources/api/src/apis/OperationEventApi.d.ts +84 -0
- package/build/generated-sources/api/src/apis/OperationEventApi.js +110 -0
- package/build/generated-sources/api/src/apis/ProviderApi.d.ts +78 -0
- package/build/generated-sources/api/src/apis/{OperationLogApi.js → ProviderApi.js} +33 -17
- package/build/generated-sources/api/src/apis/index.d.ts +3 -1
- package/build/generated-sources/api/src/apis/index.js +3 -1
- package/build/generated-sources/api/src/models/ApiKey.d.ts +49 -0
- package/build/generated-sources/api/src/models/ApiKey.js +59 -0
- package/build/generated-sources/api/src/models/ApiKeyRequest.d.ts +31 -0
- package/build/generated-sources/api/src/models/ApiKeyRequest.js +50 -0
- package/build/generated-sources/api/src/models/AuthType.d.ts +22 -0
- package/build/generated-sources/api/src/models/AuthType.js +35 -0
- package/build/generated-sources/api/src/models/CreateDestinationRequest.d.ts +44 -0
- package/build/generated-sources/api/src/models/CreateDestinationRequest.js +57 -0
- package/build/generated-sources/api/src/models/CreateDestinationRequestMetadata.d.ts +39 -0
- package/build/generated-sources/api/src/models/{DestinationMetadata.js → CreateDestinationRequestMetadata.js} +11 -11
- package/build/generated-sources/api/src/models/Destination.d.ts +22 -4
- package/build/generated-sources/api/src/models/Destination.js +12 -3
- package/build/generated-sources/api/src/models/{OperationLog.d.ts → Log.d.ts} +12 -12
- package/build/generated-sources/api/src/models/{OperationLog.js → Log.js} +11 -11
- package/build/generated-sources/api/src/models/OauthOpts.d.ts +56 -0
- package/build/generated-sources/api/src/models/OauthOpts.js +63 -0
- package/build/generated-sources/api/src/models/OperationEvent.d.ts +61 -0
- package/build/generated-sources/api/src/models/OperationEvent.js +64 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequest.d.ts +38 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequest.js +54 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.d.ts +37 -0
- package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.js +52 -0
- package/build/generated-sources/api/src/models/ProviderInfo.d.ts +60 -0
- package/build/generated-sources/api/src/models/ProviderInfo.js +65 -0
- package/build/generated-sources/api/src/models/Support.d.ts +55 -0
- package/build/generated-sources/api/src/models/Support.js +62 -0
- package/build/generated-sources/api/src/models/TokenMetadataFields.d.ts +43 -0
- package/build/generated-sources/api/src/models/TokenMetadataFields.js +54 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequest.d.ts +38 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequest.js +54 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.d.ts +38 -0
- package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.js +53 -0
- package/build/generated-sources/api/src/models/index.d.ts +15 -2
- package/build/generated-sources/api/src/models/index.js +15 -2
- package/build/src/components/Configure/actions/{createInstallationReducer.d.ts → mutateAndSetState/createInstallationAndSetState.d.ts} +3 -3
- package/build/src/components/Configure/actions/{createInstallationReducer.js → mutateAndSetState/createInstallationAndSetState.js} +4 -4
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.d.ts +15 -0
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js +33 -0
- package/build/src/components/Configure/actions/proxy/isProxyEnabled.d.ts +2 -0
- package/build/src/components/Configure/actions/proxy/isProxyEnabled.js +8 -0
- package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.d.ts +8 -0
- package/build/src/components/Configure/actions/proxy/{createInstallationProxyOnly.js → onCreateInstallationProxyOnly.js} +5 -5
- package/build/src/components/Configure/actions/{onSaveReadCreateInstallation.d.ts → read/onSaveReadCreateInstallation.d.ts} +2 -2
- package/build/src/components/Configure/actions/{onSaveReadCreateInstallation.js → read/onSaveReadCreateInstallation.js} +9 -3
- package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.d.ts +3 -0
- package/build/src/components/Configure/actions/{onSaveReadUpdateInstallation.js → read/onSaveReadUpdateInstallation.js} +20 -28
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +10 -3
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.d.ts +2 -2
- package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.js +11 -3
- package/build/src/components/Configure/content/CreateInstallation.js +1 -1
- package/build/src/components/Configure/content/UpdateInstallation.js +5 -5
- package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.js +2 -2
- package/build/src/components/Configure/layout/ProtectedConnectionLayout.js +2 -7
- package/build/src/components/Configure/nav/ObjectManagementNav/index.js +1 -1
- package/build/src/components/Configure/state/utils.js +5 -5
- package/build/src/components/ErrorTextBox.js +1 -1
- package/build/src/components/Oauth/NoWorkspaceEntry/LandingContent.js +12 -0
- package/build/src/components/Oauth/{NoSubdomainEntry/NoSubdomainOauthFlow.d.ts → NoWorkspaceEntry/NoWorkspaceOauthFlow.d.ts} +4 -4
- package/build/src/components/Oauth/{NoSubdomainEntry/NoSubdomainOauthFlow.js → NoWorkspaceEntry/NoWorkspaceOauthFlow.js} +13 -17
- package/build/src/components/Oauth/OAuthPopup.js +1 -5
- package/build/src/components/Oauth/OauthCardLayout.d.ts +6 -0
- package/build/src/components/Oauth/OauthCardLayout.js +9 -0
- package/build/src/components/Oauth/OauthFlow/OauthFlow.d.ts +9 -0
- package/build/src/components/Oauth/OauthFlow/OauthFlow.js +33 -0
- package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.d.ts +13 -0
- package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.js +18 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.d.ts +9 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.js +12 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.d.ts +14 -0
- package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.js +56 -0
- package/build/src/components/Oauth/fetchOAuthCallbackURL.d.ts +1 -1
- package/build/src/components/Oauth/fetchOAuthCallbackURL.js +1 -1
- package/build/src/components/SuccessTextBox.js +1 -1
- package/build/src/components/ThemeProvider/Button/buttonTheme.js +3 -3
- package/build/src/components/ThemeProvider/index.js +6 -6
- package/build/src/services/ApiService.d.ts +2 -2
- package/build/src/services/ApiService.js +1 -1
- package/build/src/services/api.d.ts +2 -2
- package/build/src/services/api.js +5 -0
- package/build/src/services/version.d.ts +1 -0
- package/build/src/services/version.js +4 -0
- package/package.json +3 -3
- package/build/generated-sources/api/src/apis/OperationLogApi.d.ts +0 -55
- package/build/generated-sources/api/src/models/DestinationMetadata.d.ts +0 -39
- package/build/src/components/Configure/actions/onSaveReadUpdateInstallation.d.ts +0 -3
- package/build/src/components/Configure/actions/proxy/createInstallationProxyOnly.d.ts +0 -8
- package/build/src/components/Oauth/NoSubdomainEntry/LandingContent.js +0 -11
- package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.d.ts +0 -16
- package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.js +0 -57
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.d.ts +0 -8
- package/build/src/components/Oauth/Salesforce/SubdomainEntry.js +0 -12
- package/build/src/constants.d.ts +0 -2
- package/build/src/constants.js +0 -5
- /package/build/src/components/Oauth/{NoSubdomainEntry → NoWorkspaceEntry}/LandingContent.d.ts +0 -0
|
@@ -1,57 +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.SalesforceOauthFlow = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
/**
|
|
9
|
-
* Prompts customer to input their Salesforce subdomain, then creates an OAuth connection to
|
|
10
|
-
* that Salesforce instance.
|
|
11
|
-
*/
|
|
12
|
-
const react_1 = require("react");
|
|
13
|
-
const constants_1 = require("../../../constants");
|
|
14
|
-
const ApiKeyContextProvider_1 = require("../../../context/ApiKeyContextProvider");
|
|
15
|
-
const ProjectContextProvider_1 = require("../../../context/ProjectContextProvider");
|
|
16
|
-
const fetchOAuthCallbackURL_1 = require("../fetchOAuthCallbackURL");
|
|
17
|
-
const OAuthPopup_1 = __importDefault(require("../OAuthPopup"));
|
|
18
|
-
const SubdomainEntry_1 = require("./SubdomainEntry");
|
|
19
|
-
/**
|
|
20
|
-
* SalesforceOauthFlow first prompts user for their workspace ("subdomain" in Salesforce lingo),
|
|
21
|
-
* then launches a popup with the OAuth flow.
|
|
22
|
-
*/
|
|
23
|
-
function SalesforceOauthFlow({ consumerRef, consumerName, groupRef, groupName, }) {
|
|
24
|
-
const { projectId } = (0, ProjectContextProvider_1.useProject)();
|
|
25
|
-
const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
|
|
26
|
-
const [workspace, setWorkspace] = (0, react_1.useState)('');
|
|
27
|
-
const [oAuthCallbackURL, setOAuthCallbackURL] = (0, react_1.useState)(null);
|
|
28
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
29
|
-
const isButtonDisabled = workspace.length === 0;
|
|
30
|
-
const provider = constants_1.PROVIDER_SALESFORCE;
|
|
31
|
-
// 1. fetch provider apps
|
|
32
|
-
// 2. find matching app to provider
|
|
33
|
-
// 3. fetch OAuth callback URL from connection so that oath popup can be launched
|
|
34
|
-
const handleSubmit = async () => {
|
|
35
|
-
var _a;
|
|
36
|
-
setError(null);
|
|
37
|
-
if (workspace && consumerName && groupName && apiKey) {
|
|
38
|
-
try {
|
|
39
|
-
const url = await (0, fetchOAuthCallbackURL_1.fetchOAuthCallbackURL)(projectId, consumerRef, groupRef, consumerName, groupName, apiKey, provider, workspace);
|
|
40
|
-
setOAuthCallbackURL(url);
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
console.error(err);
|
|
44
|
-
setError((_a = err.message) !== null && _a !== void 0 ? _a : 'Unexpected error');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
setError('missing required fields');
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const onClose = (0, react_1.useCallback)((err) => {
|
|
52
|
-
setError(err);
|
|
53
|
-
setOAuthCallbackURL(null);
|
|
54
|
-
}, []);
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(OAuthPopup_1.default, { title: "Connect to Salesforce", url: oAuthCallbackURL, onClose: onClose, children: (0, jsx_runtime_1.jsx)(SubdomainEntry_1.SubdomainEntry, { handleSubmit: handleSubmit, setWorkspace: setWorkspace, error: error, isButtonDisabled: isButtonDisabled }) }));
|
|
56
|
-
}
|
|
57
|
-
exports.SalesforceOauthFlow = SalesforceOauthFlow;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type SubdomainEntryProps = {
|
|
2
|
-
handleSubmit: () => void;
|
|
3
|
-
setWorkspace: (workspace: string) => void;
|
|
4
|
-
error: string | null;
|
|
5
|
-
isButtonDisabled?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function SubdomainEntry({ handleSubmit, setWorkspace, error, isButtonDisabled, }: SubdomainEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubdomainEntry = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const icons_1 = require("@chakra-ui/icons");
|
|
6
|
-
const react_1 = require("@chakra-ui/react");
|
|
7
|
-
const OAuthErrorAlert_1 = require("../OAuthErrorAlert");
|
|
8
|
-
const SALESFORCE_HELP_URL = 'https://help.salesforce.com/s/articleView?id=sf.faq_domain_name_what.htm&type=5';
|
|
9
|
-
function SubdomainEntry({ handleSubmit, setWorkspace, error, isButtonDisabled, }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Container, { children: (0, jsx_runtime_1.jsx)(react_1.Box, { p: 8, maxWidth: "600px", borderWidth: 1, borderRadius: 8, boxShadow: "lg", textAlign: ['left'], margin: "auto", marginTop: "40px", bgColor: "white", children: (0, jsx_runtime_1.jsxs)(react_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: "Enter your Salesforce subdomain" }) }), (0, jsx_runtime_1.jsxs)(react_1.Link, { href: SALESFORCE_HELP_URL, color: "blackAlpha.600", isExternal: true, children: ["What is my Salesforce subdomain?", (0, jsx_runtime_1.jsx)(icons_1.ExternalLinkIcon, { mx: "2px" })] }), (0, jsx_runtime_1.jsx)(OAuthErrorAlert_1.OAuthErrorAlert, { error: error }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { marginTop: "1em", children: [(0, jsx_runtime_1.jsx)(react_1.Input, { placeholder: "MyDomain", onChange: (event) => setWorkspace(event.currentTarget.value) }), (0, jsx_runtime_1.jsx)(react_1.Text, { lineHeight: "2.2em", marginLeft: "0.4em", children: ".my.salesforce.com" })] }), (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.SubdomainEntry = SubdomainEntry;
|
package/build/src/constants.d.ts
DELETED
package/build/src/constants.js
DELETED
/package/build/src/components/Oauth/{NoSubdomainEntry → NoWorkspaceEntry}/LandingContent.d.ts
RENAMED
|
File without changes
|