@amp-labs/react 1.2.0 → 1.4.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.
Files changed (135) hide show
  1. package/build/generated-sources/api/src/apis/APIKeyApi.d.ts +158 -0
  2. package/build/generated-sources/api/src/apis/APIKeyApi.js +188 -0
  3. package/build/generated-sources/api/src/apis/DestinationApi.d.ts +86 -8
  4. package/build/generated-sources/api/src/apis/DestinationApi.js +86 -3
  5. package/build/generated-sources/api/src/apis/InstallationApi.d.ts +28 -0
  6. package/build/generated-sources/api/src/apis/InstallationApi.js +30 -0
  7. package/build/generated-sources/api/src/apis/IntegrationApi.js +1 -4
  8. package/build/generated-sources/api/src/apis/OperationApi.d.ts +27 -1
  9. package/build/generated-sources/api/src/apis/OperationApi.js +27 -0
  10. package/build/generated-sources/api/src/apis/OperationEventApi.d.ts +84 -0
  11. package/build/generated-sources/api/src/apis/OperationEventApi.js +110 -0
  12. package/build/generated-sources/api/src/apis/ProviderApi.d.ts +78 -0
  13. package/build/generated-sources/api/src/apis/{OperationLogApi.js → ProviderApi.js} +33 -17
  14. package/build/generated-sources/api/src/apis/index.d.ts +3 -1
  15. package/build/generated-sources/api/src/apis/index.js +3 -1
  16. package/build/generated-sources/api/src/models/ApiKey.d.ts +49 -0
  17. package/build/generated-sources/api/src/models/ApiKey.js +59 -0
  18. package/build/generated-sources/api/src/models/ApiKeyRequest.d.ts +31 -0
  19. package/build/generated-sources/api/src/models/ApiKeyRequest.js +50 -0
  20. package/build/generated-sources/api/src/models/AuthType.d.ts +22 -0
  21. package/build/generated-sources/api/src/models/AuthType.js +35 -0
  22. package/build/generated-sources/api/src/models/BaseConfigContent.d.ts +7 -0
  23. package/build/generated-sources/api/src/models/BaseConfigContent.js +3 -0
  24. package/build/generated-sources/api/src/models/BaseProxyConfig.d.ts +31 -0
  25. package/build/generated-sources/api/src/models/BaseProxyConfig.js +50 -0
  26. package/build/generated-sources/api/src/models/ConfigContent.d.ts +7 -0
  27. package/build/generated-sources/api/src/models/ConfigContent.js +3 -0
  28. package/build/generated-sources/api/src/models/CreateDestinationRequest.d.ts +44 -0
  29. package/build/generated-sources/api/src/models/CreateDestinationRequest.js +57 -0
  30. package/build/generated-sources/api/src/models/CreateDestinationRequestMetadata.d.ts +39 -0
  31. package/build/generated-sources/api/src/models/{DestinationMetadata.js → CreateDestinationRequestMetadata.js} +11 -11
  32. package/build/generated-sources/api/src/models/Destination.d.ts +22 -4
  33. package/build/generated-sources/api/src/models/Destination.js +12 -3
  34. package/build/generated-sources/api/src/models/HydratedIntegration.d.ts +7 -0
  35. package/build/generated-sources/api/src/models/HydratedIntegration.js +3 -0
  36. package/build/generated-sources/api/src/models/HydratedIntegrationProxy.d.ts +31 -0
  37. package/build/generated-sources/api/src/models/HydratedIntegrationProxy.js +50 -0
  38. package/build/generated-sources/api/src/models/ImportConnectionRequest.d.ts +1 -1
  39. package/build/generated-sources/api/src/models/Integration1.d.ts +7 -0
  40. package/build/generated-sources/api/src/models/Integration1.js +3 -0
  41. package/build/generated-sources/api/src/models/IntegrationProxy.d.ts +31 -0
  42. package/build/generated-sources/api/src/models/IntegrationProxy.js +50 -0
  43. package/build/generated-sources/api/src/models/{OperationLog.d.ts → Log.d.ts} +12 -12
  44. package/build/generated-sources/api/src/models/{OperationLog.js → Log.js} +11 -11
  45. package/build/generated-sources/api/src/models/OauthConnectRequest.d.ts +6 -6
  46. package/build/generated-sources/api/src/models/OauthConnectRequest.js +1 -2
  47. package/build/generated-sources/api/src/models/OauthOpts.d.ts +56 -0
  48. package/build/generated-sources/api/src/models/OauthOpts.js +63 -0
  49. package/build/generated-sources/api/src/models/Operation.d.ts +26 -9
  50. package/build/generated-sources/api/src/models/Operation.js +14 -7
  51. package/build/generated-sources/api/src/models/OperationEvent.d.ts +61 -0
  52. package/build/generated-sources/api/src/models/OperationEvent.js +64 -0
  53. package/build/generated-sources/api/src/models/PatchApiKeyRequest.d.ts +38 -0
  54. package/build/generated-sources/api/src/models/PatchApiKeyRequest.js +54 -0
  55. package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.d.ts +37 -0
  56. package/build/generated-sources/api/src/models/PatchApiKeyRequestApiKey.js +52 -0
  57. package/build/generated-sources/api/src/models/ProviderInfo.d.ts +60 -0
  58. package/build/generated-sources/api/src/models/ProviderInfo.js +65 -0
  59. package/build/generated-sources/api/src/models/Support.d.ts +55 -0
  60. package/build/generated-sources/api/src/models/Support.js +62 -0
  61. package/build/generated-sources/api/src/models/TokenMetadataFields.d.ts +43 -0
  62. package/build/generated-sources/api/src/models/TokenMetadataFields.js +54 -0
  63. package/build/generated-sources/api/src/models/UpdateDestinationRequest.d.ts +38 -0
  64. package/build/generated-sources/api/src/models/UpdateDestinationRequest.js +54 -0
  65. package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.d.ts +38 -0
  66. package/build/generated-sources/api/src/models/UpdateDestinationRequestDestination.js +53 -0
  67. package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.d.ts +7 -0
  68. package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.js +3 -0
  69. package/build/generated-sources/api/src/models/index.d.ts +18 -3
  70. package/build/generated-sources/api/src/models/index.js +18 -3
  71. package/build/src/assets/SuccessIcon.d.ts +1 -0
  72. package/build/src/assets/SuccessIcon.js +8 -0
  73. package/build/src/components/Configure/InstallIntegration.js +2 -1
  74. package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.d.ts +15 -0
  75. package/build/src/components/Configure/actions/mutateAndSetState/createInstallationAndSetState.js +30 -0
  76. package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.d.ts +15 -0
  77. package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js +33 -0
  78. package/build/src/components/Configure/actions/proxy/isProxyEnabled.d.ts +2 -0
  79. package/build/src/components/Configure/actions/proxy/isProxyEnabled.js +8 -0
  80. package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.d.ts +8 -0
  81. package/build/src/components/Configure/actions/proxy/onCreateInstallationProxyOnly.js +44 -0
  82. package/build/src/components/Configure/actions/{onSaveReadCreateInstallation.d.ts → read/onSaveReadCreateInstallation.d.ts} +2 -2
  83. package/build/src/components/Configure/actions/{onSaveReadCreateInstallation.js → read/onSaveReadCreateInstallation.js} +15 -22
  84. package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.d.ts +3 -0
  85. package/build/src/components/Configure/actions/{onSaveReadUpdateInstallation.js → read/onSaveReadUpdateInstallation.js} +20 -28
  86. package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +16 -22
  87. package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.d.ts +2 -2
  88. package/build/src/components/Configure/actions/write/onSaveWriteUpdateInstallation.js +11 -3
  89. package/build/src/components/Configure/content/CreateInstallation.js +1 -1
  90. package/build/src/components/Configure/content/UpdateInstallation.js +5 -5
  91. package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.d.ts +11 -0
  92. package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.js +67 -0
  93. package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.d.ts +5 -0
  94. package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.js +11 -0
  95. package/build/src/components/Configure/layout/ProtectedConnectionLayout.js +2 -7
  96. package/build/src/components/Configure/state/utils.js +5 -5
  97. package/build/src/components/Connect/ConnectedSuccessBox.js +3 -3
  98. package/build/src/components/Oauth/NoWorkspaceEntry/LandingContent.js +12 -0
  99. package/build/src/components/Oauth/{NoSubdomainEntry/NoSubdomainOauthFlow.d.ts → NoWorkspaceEntry/NoWorkspaceOauthFlow.d.ts} +4 -4
  100. package/build/src/components/Oauth/{NoSubdomainEntry/NoSubdomainOauthFlow.js → NoWorkspaceEntry/NoWorkspaceOauthFlow.js} +6 -8
  101. package/build/src/components/Oauth/OAuthPopup.js +1 -5
  102. package/build/src/components/Oauth/OauthCardLayout.d.ts +6 -0
  103. package/build/src/components/Oauth/OauthCardLayout.js +9 -0
  104. package/build/src/components/Oauth/OauthFlow/OauthFlow.d.ts +9 -0
  105. package/build/src/components/Oauth/OauthFlow/OauthFlow.js +33 -0
  106. package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.d.ts +13 -0
  107. package/build/src/components/Oauth/Salesforce/SalesforceSubdomainEntry.js +18 -0
  108. package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.d.ts +9 -0
  109. package/build/src/components/Oauth/WorkspaceEntry/WorkspaceEntry.js +12 -0
  110. package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.d.ts +14 -0
  111. package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.js +58 -0
  112. package/build/src/components/SuccessTextBox.d.ts +5 -0
  113. package/build/src/components/SuccessTextBox.js +10 -0
  114. package/build/src/components/ThemeProvider/Button/buttonTheme.js +3 -3
  115. package/build/src/components/ThemeProvider/index.js +6 -6
  116. package/build/src/services/ApiService.d.ts +2 -2
  117. package/build/src/services/ApiService.js +1 -1
  118. package/build/src/services/api.d.ts +2 -2
  119. package/build/src/services/api.js +28 -21
  120. package/build/src/services/version.d.ts +1 -0
  121. package/build/src/services/version.js +4 -0
  122. package/package.json +2 -2
  123. package/build/generated-sources/api/src/apis/OperationLogApi.d.ts +0 -55
  124. package/build/generated-sources/api/src/models/DestinationMetadata.d.ts +0 -39
  125. package/build/generated-sources/api/src/models/OperationError.d.ts +0 -49
  126. package/build/generated-sources/api/src/models/OperationError.js +0 -56
  127. package/build/src/components/Configure/actions/onSaveReadUpdateInstallation.d.ts +0 -3
  128. package/build/src/components/Oauth/NoSubdomainEntry/LandingContent.js +0 -11
  129. package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.d.ts +0 -16
  130. package/build/src/components/Oauth/Salesforce/SalesforceOauthFlow.js +0 -57
  131. package/build/src/components/Oauth/Salesforce/SubdomainEntry.d.ts +0 -8
  132. package/build/src/components/Oauth/Salesforce/SubdomainEntry.js +0 -12
  133. package/build/src/constants.d.ts +0 -2
  134. package/build/src/constants.js +0 -5
  135. /package/build/src/components/Oauth/{NoSubdomainEntry → NoWorkspaceEntry}/LandingContent.d.ts +0 -0
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SuccessTextBox = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("@chakra-ui/react");
6
+ const SuccessIcon_1 = require("../assets/SuccessIcon");
7
+ function SuccessTextBox({ text }) {
8
+ return ((0, jsx_runtime_1.jsx)(react_1.Container, { children: (0, jsx_runtime_1.jsxs)(react_1.Box, { p: 8, maxWidth: "600px", minHeight: "290px", borderWidth: 1, borderRadius: 8, boxShadow: "lg", margin: "auto", marginTop: "40px", bgColor: "white", paddingTop: "100px", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { width: "100%", display: "flex", alignContent: "center", justifyContent: "center", children: (0, jsx_runtime_1.jsx)(react_1.Box, { margin: "auto", children: (0, jsx_runtime_1.jsx)(SuccessIcon_1.SuccessCheckmarkIcon, {}) }) }), (0, jsx_runtime_1.jsx)(react_1.Box, { textAlign: "center", paddingTop: "25px", children: text })] }) }));
9
+ }
10
+ exports.SuccessTextBox = SuccessTextBox;
@@ -4,12 +4,12 @@ exports.buttonVariants = void 0;
4
4
  // define custom button variants
5
5
  exports.buttonVariants = {
6
6
  warning: {
7
- bg: 'red.50',
7
+ bg: 'red.50', // Background color
8
8
  outlineColor: 'red.800',
9
9
  outline: '2px solid',
10
10
  outlineOffset: '0',
11
- borderColor: 'red.800',
12
- color: 'red.800',
11
+ borderColor: 'red.800', // Border color
12
+ color: 'red.800', // Text color
13
13
  _hover: {
14
14
  bg: 'red.100', // Background color on hover
15
15
  },
@@ -15,9 +15,9 @@ const customTheme = (0, react_1.extendTheme)({
15
15
  bg: 'gray.300',
16
16
  },
17
17
  _selected: {
18
- color: 'black',
19
- fontWeight: '500',
20
- bg: 'gray.200',
18
+ color: 'black', // Set the color of the selected tab to 'black
19
+ fontWeight: '500', // Set the font weight of the selected tab
20
+ bg: 'gray.200', // Set the background color of the selected tab
21
21
  border: 'none',
22
22
  _hover: {
23
23
  bg: 'gray.300',
@@ -32,9 +32,9 @@ const customTheme = (0, react_1.extendTheme)({
32
32
  bg: 'red.200',
33
33
  },
34
34
  _selected: {
35
- color: 'red.800',
36
- fontWeight: '500',
37
- bg: 'red.100',
35
+ color: 'red.800', // Set the color of the selected tab
36
+ fontWeight: '500', // Set the font weight of the selected tab
37
+ bg: 'red.100', // Set the background color of the selected tab
38
38
  border: 'none',
39
39
  _hover: {
40
40
  bg: 'red.200',
@@ -1,4 +1,4 @@
1
- import { AllowedDomainApi, Configuration, ConnectionApi, ConsumerApi, DestinationApi, GroupApi, InstallationApi, IntegrationApi, OAuthApi, OperationApi, OperationLogApi, ProjectApi, ProjectMembershipApi, ProviderAppApi, RevisionApi, UploadURLApi } from '../../generated-sources/api/src';
1
+ import { AllowedDomainApi, Configuration, ConnectionApi, ConsumerApi, DestinationApi, GroupApi, InstallationApi, IntegrationApi, OAuthApi, OperationApi, ProjectApi, ProjectMembershipApi, ProviderApi, ProviderAppApi, RevisionApi, UploadURLApi } from '../../generated-sources/api/src';
2
2
  /**
3
3
  * ApiService is a wrapper around the generated API client, which exposes
4
4
  * all generated api services as properties.
@@ -17,9 +17,9 @@ export declare class ApiService {
17
17
  integrationApi: IntegrationApi;
18
18
  oAuthApi: OAuthApi;
19
19
  operationApi: OperationApi;
20
- operationLogApi: OperationLogApi;
21
20
  projectApi: ProjectApi;
22
21
  projectMembershipApi: ProjectMembershipApi;
22
+ providerApi: ProviderApi;
23
23
  providerAppApi: ProviderAppApi;
24
24
  revisionApi: RevisionApi;
25
25
  uploadURLApi: UploadURLApi;
@@ -23,9 +23,9 @@ class ApiService {
23
23
  this.integrationApi = new src_1.IntegrationApi(config);
24
24
  this.oAuthApi = new src_1.OAuthApi(config);
25
25
  this.operationApi = new src_1.OperationApi(config);
26
- this.operationLogApi = new src_1.OperationLogApi(config);
27
26
  this.projectApi = new src_1.ProjectApi(config);
28
27
  this.projectMembershipApi = new src_1.ProjectMembershipApi(config);
28
+ this.providerApi = new src_1.ProviderApi(config);
29
29
  this.providerAppApi = new src_1.ProviderAppApi(config);
30
30
  this.revisionApi = new src_1.RevisionApi(config);
31
31
  this.uploadURLApi = new src_1.UploadURLApi(config);
@@ -1,4 +1,4 @@
1
- import { Config, Connection, CreateInstallationOperationRequest, CreateInstallationRequestConfig, HydratedIntegrationField, HydratedIntegrationFieldExistent, HydratedIntegrationObject, HydratedIntegrationRead, HydratedIntegrationWrite, HydratedIntegrationWriteObject, HydratedRevision, Installation, Integration, IntegrationFieldMapping, Project, ProviderApp, UpdateInstallationOperationRequest, UpdateInstallationRequestInstallationConfig } from '../../generated-sources/api/src';
1
+ import { Config, Connection, CreateInstallationOperationRequest, CreateInstallationRequestConfig, HydratedIntegrationField, HydratedIntegrationFieldExistent, HydratedIntegrationObject, HydratedIntegrationRead, HydratedIntegrationWrite, HydratedIntegrationWriteObject, HydratedRevision, Installation, Integration, IntegrationFieldMapping, Project, ProviderApp, ProviderInfo, UpdateInstallationOperationRequest, UpdateInstallationRequestInstallationConfig } from '../../generated-sources/api/src';
2
2
  import { ApiService } from './ApiService';
3
3
  export declare const AMP_SERVER: string;
4
4
  export declare const AMP_API_ROOT: string;
@@ -7,4 +7,4 @@ export declare const api: () => ApiService;
7
7
  /**
8
8
  * Types exported from generated api
9
9
  */
10
- export type { Config, Connection, CreateInstallationOperationRequest, CreateInstallationRequestConfig, HydratedIntegrationRead, HydratedIntegrationWrite, HydratedIntegrationWriteObject, HydratedIntegrationObject, HydratedIntegrationField, HydratedRevision, Installation, Integration, HydratedIntegrationFieldExistent, IntegrationFieldMapping, Project, ProviderApp, UpdateInstallationOperationRequest, UpdateInstallationRequestInstallationConfig, };
10
+ export type { Config, Connection, CreateInstallationOperationRequest, CreateInstallationRequestConfig, HydratedIntegrationRead, HydratedIntegrationWrite, HydratedIntegrationWriteObject, HydratedIntegrationObject, HydratedIntegrationField, HydratedRevision, Installation, Integration, HydratedIntegrationFieldExistent, IntegrationFieldMapping, Project, ProviderApp, ProviderInfo, UpdateInstallationOperationRequest, UpdateInstallationRequestInstallationConfig, };
@@ -5,6 +5,7 @@ exports.api = exports.setApi = exports.AMP_API_ROOT = exports.AMP_SERVER = void
5
5
  // currently not using a bundler to support alias imports
6
6
  const src_1 = require("../../generated-sources/api/src");
7
7
  const ApiService_1 = require("./ApiService");
8
+ const version_1 = require("./version");
8
9
  /**
9
10
  * To update the api you need to
10
11
  * 1. git clone `https://github.com/amp-labs/server` into a sibling directory
@@ -17,29 +18,31 @@ const ApiService_1 = require("./ApiService");
17
18
  *
18
19
  * */
19
20
  const VERSION = 'v1';
21
+ const prodEndpoint = 'https://api.withampersand.com';
20
22
  function getApiEndpoint() {
21
- var _a, _b, _c;
22
- const prodEndpoint = 'https://api.withampersand.com';
23
- if (typeof process === 'undefined') {
24
- return prodEndpoint;
23
+ try {
24
+ const ENV_SERVER = process.env.REACT_APP_AMP_SERVER;
25
+ switch (ENV_SERVER) {
26
+ case 'local':
27
+ return 'http://localhost:8080';
28
+ case 'dev':
29
+ return 'https://dev-api.withampersand.com';
30
+ case 'staging':
31
+ return 'https://staging-api.withampersand.com';
32
+ case 'prod':
33
+ return prodEndpoint;
34
+ case 'mock':
35
+ return 'http://127.0.0.1:4010';
36
+ case '':
37
+ return prodEndpoint;
38
+ default:
39
+ // The user may provide an arbitrary URL here if they want to, or else the
40
+ // default prod url will be used.
41
+ return ENV_SERVER !== null && ENV_SERVER !== void 0 ? ENV_SERVER : prodEndpoint;
42
+ }
25
43
  }
26
- switch ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.REACT_APP_AMP_SERVER) {
27
- case 'local':
28
- return 'http://localhost:8080';
29
- case 'dev':
30
- return 'https://dev-api.withampersand.com';
31
- case 'staging':
32
- return 'https://staging-api.withampersand.com';
33
- case 'prod':
34
- return prodEndpoint;
35
- case 'mock':
36
- return 'http://127.0.0.1:4010';
37
- case '':
38
- return prodEndpoint;
39
- default:
40
- // The user may provide an arbitrary URL here if they want to, or else the
41
- // default prod url will be used.
42
- return (_c = (_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.REACT_APP_AMP_SERVER) !== null && _c !== void 0 ? _c : prodEndpoint;
44
+ catch (e) {
45
+ return prodEndpoint;
43
46
  }
44
47
  }
45
48
  const getApiRoot = (server, version) => `${server}/${version}`;
@@ -58,6 +61,10 @@ exports.AMP_API_ROOT = assignRoot();
58
61
  * */
59
62
  const config = new src_1.Configuration({
60
63
  basePath: exports.AMP_API_ROOT,
64
+ headers: {
65
+ 'X-Amp-Client': 'react',
66
+ 'X-Amp-Client-Version': version_1.LIB_VERSION,
67
+ },
61
68
  });
62
69
  let apiValue = new ApiService_1.ApiService(config);
63
70
  // For testing, etc. we may want to use a different API configuration than the default
@@ -0,0 +1 @@
1
+ export declare const LIB_VERSION = "1.4.0";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIB_VERSION = void 0;
4
+ exports.LIB_VERSION = '1.4.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amp-labs/react",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Ampersand React library.",
5
5
  "author": {
6
6
  "name": "Ampersand Labs",
@@ -24,7 +24,7 @@
24
24
  "test": "jest",
25
25
  "watch": "npm run prepbuild && tsc -p tsconfig.json --watch",
26
26
  "build": "npm run prepbuild && tsc -p tsconfig.json",
27
- "prepbuild": "npm run clean",
27
+ "prepbuild": "npm run clean && node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" | sed \"s|\\\"|'|g\" > src/services/version.ts",
28
28
  "clean": "rm -rf ./build/",
29
29
  "assets": "mkdir ./build/ && cp -R ./src/public/ ./build/public/",
30
30
  "lint": "eslint --ext .ts,.tsx -c .eslintrc.cjs src/ --fix",
@@ -1,55 +0,0 @@
1
- /**
2
- * Ampersand public API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import * as runtime from '../runtime';
13
- import type { OperationLog } from '../models';
14
- export interface ListOperationLogsRequest {
15
- projectId: string;
16
- operationId: string;
17
- }
18
- /**
19
- * OperationLogApi - interface
20
- *
21
- * @export
22
- * @interface OperationLogApiInterface
23
- */
24
- export interface OperationLogApiInterface {
25
- /**
26
- * List logs for an operation, earliest first.
27
- * @summary List logs for an operation
28
- * @param {string} projectId
29
- * @param {string} operationId
30
- * @param {*} [options] Override http request option.
31
- * @throws {RequiredError}
32
- * @memberof OperationLogApiInterface
33
- */
34
- listOperationLogsRaw(requestParameters: ListOperationLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OperationLog>>>;
35
- /**
36
- * List logs for an operation, earliest first.
37
- * List logs for an operation
38
- */
39
- listOperationLogs(requestParameters: ListOperationLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OperationLog>>;
40
- }
41
- /**
42
- *
43
- */
44
- export declare class OperationLogApi extends runtime.BaseAPI implements OperationLogApiInterface {
45
- /**
46
- * List logs for an operation, earliest first.
47
- * List logs for an operation
48
- */
49
- listOperationLogsRaw(requestParameters: ListOperationLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OperationLog>>>;
50
- /**
51
- * List logs for an operation, earliest first.
52
- * List logs for an operation
53
- */
54
- listOperationLogs(requestParameters: ListOperationLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OperationLog>>;
55
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Ampersand public API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- /**
13
- *
14
- * @export
15
- * @interface DestinationMetadata
16
- */
17
- export interface DestinationMetadata {
18
- /**
19
- * Webhook URL
20
- * @type {string}
21
- * @memberof DestinationMetadata
22
- */
23
- url?: string;
24
- /**
25
- * Webhook headers to add
26
- * @type {{ [key: string]: string; }}
27
- * @memberof DestinationMetadata
28
- */
29
- headers?: {
30
- [key: string]: string;
31
- } | null;
32
- }
33
- /**
34
- * Check if a given object implements the DestinationMetadata interface.
35
- */
36
- export declare function instanceOfDestinationMetadata(value: object): boolean;
37
- export declare function DestinationMetadataFromJSON(json: any): DestinationMetadata;
38
- export declare function DestinationMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): DestinationMetadata;
39
- export declare function DestinationMetadataToJSON(value?: DestinationMetadata | null): any;
@@ -1,49 +0,0 @@
1
- /**
2
- * Ampersand public API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- /**
13
- *
14
- * @export
15
- * @interface OperationError
16
- */
17
- export interface OperationError {
18
- /**
19
- * The attempt number.
20
- * @type {number}
21
- * @memberof OperationError
22
- */
23
- attempt?: number;
24
- /**
25
- * The time the error occurred.
26
- * @type {Date}
27
- * @memberof OperationError
28
- */
29
- timestamp?: Date;
30
- /**
31
- * The status of the operation.
32
- * @type {string}
33
- * @memberof OperationError
34
- */
35
- status?: string;
36
- /**
37
- * The error message.
38
- * @type {string}
39
- * @memberof OperationError
40
- */
41
- error?: string;
42
- }
43
- /**
44
- * Check if a given object implements the OperationError interface.
45
- */
46
- export declare function instanceOfOperationError(value: object): boolean;
47
- export declare function OperationErrorFromJSON(json: any): OperationError;
48
- export declare function OperationErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): OperationError;
49
- export declare function OperationErrorToJSON(value?: OperationError | null): any;
@@ -1,56 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Ampersand public API
6
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.OperationErrorToJSON = exports.OperationErrorFromJSONTyped = exports.OperationErrorFromJSON = exports.instanceOfOperationError = void 0;
17
- const runtime_1 = require("../runtime");
18
- /**
19
- * Check if a given object implements the OperationError interface.
20
- */
21
- function instanceOfOperationError(value) {
22
- let isInstance = true;
23
- return isInstance;
24
- }
25
- exports.instanceOfOperationError = instanceOfOperationError;
26
- function OperationErrorFromJSON(json) {
27
- return OperationErrorFromJSONTyped(json, false);
28
- }
29
- exports.OperationErrorFromJSON = OperationErrorFromJSON;
30
- function OperationErrorFromJSONTyped(json, ignoreDiscriminator) {
31
- if ((json === undefined) || (json === null)) {
32
- return json;
33
- }
34
- return {
35
- 'attempt': !(0, runtime_1.exists)(json, 'attempt') ? undefined : json['attempt'],
36
- 'timestamp': !(0, runtime_1.exists)(json, 'timestamp') ? undefined : (new Date(json['timestamp'])),
37
- 'status': !(0, runtime_1.exists)(json, 'status') ? undefined : json['status'],
38
- 'error': !(0, runtime_1.exists)(json, 'error') ? undefined : json['error'],
39
- };
40
- }
41
- exports.OperationErrorFromJSONTyped = OperationErrorFromJSONTyped;
42
- function OperationErrorToJSON(value) {
43
- if (value === undefined) {
44
- return undefined;
45
- }
46
- if (value === null) {
47
- return null;
48
- }
49
- return {
50
- 'attempt': value.attempt,
51
- 'timestamp': value.timestamp === undefined ? undefined : (value.timestamp.toISOString()),
52
- 'status': value.status,
53
- 'error': value.error,
54
- };
55
- }
56
- exports.OperationErrorToJSON = OperationErrorToJSON;
@@ -1,3 +0,0 @@
1
- import { Config, HydratedIntegrationObject, Installation } from '../../../services/api';
2
- import { ConfigureState } from '../types';
3
- export declare const onSaveReadUpdateInstallation: (projectId: string, integrationId: string, installationId: string, selectedObjectName: string, apiKey: string, configureState: ConfigureState, setInstallation: (installationObj: Installation) => void, hydratedObject: HydratedIntegrationObject, onUpdateSuccess?: ((installationId: string, config: Config) => void) | undefined) => Promise<void | null>;
@@ -1,11 +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 OAuthErrorAlert_1 = require("../OAuthErrorAlert");
8
- function LandingContent({ provider, handleSubmit, error, isButtonDisabled, }) {
9
- 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: `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" })] }) }) }));
10
- }
11
- exports.LandingContent = LandingContent;
@@ -1,16 +0,0 @@
1
- /**
2
- * Prompts customer to input their Salesforce subdomain, then creates an OAuth connection to
3
- * that Salesforce instance.
4
- */
5
- interface SalesforceOauthFlowProps {
6
- consumerRef: string;
7
- consumerName?: string;
8
- groupRef: string;
9
- groupName?: string;
10
- }
11
- /**
12
- * SalesforceOauthFlow first prompts user for their workspace ("subdomain" in Salesforce lingo),
13
- * then launches a popup with the OAuth flow.
14
- */
15
- export declare function SalesforceOauthFlow({ consumerRef, consumerName, groupRef, groupName, }: SalesforceOauthFlowProps): import("react/jsx-runtime").JSX.Element;
16
- export {};
@@ -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/articleView?id=domain_name_not_found.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;
@@ -1,2 +0,0 @@
1
- export declare const PROVIDER_SALESFORCE = "salesforce";
2
- export declare const PROVIDER_HUBSPOT = "hubspot";
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PROVIDER_HUBSPOT = exports.PROVIDER_SALESFORCE = void 0;
4
- exports.PROVIDER_SALESFORCE = 'salesforce';
5
- exports.PROVIDER_HUBSPOT = 'hubspot';