@amp-labs/react 1.2.0 → 1.3.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 (49) hide show
  1. package/build/generated-sources/api/src/apis/DestinationApi.d.ts +24 -0
  2. package/build/generated-sources/api/src/apis/DestinationApi.js +24 -0
  3. package/build/generated-sources/api/src/apis/InstallationApi.d.ts +28 -0
  4. package/build/generated-sources/api/src/apis/InstallationApi.js +30 -0
  5. package/build/generated-sources/api/src/apis/IntegrationApi.js +1 -4
  6. package/build/generated-sources/api/src/models/BaseConfigContent.d.ts +7 -0
  7. package/build/generated-sources/api/src/models/BaseConfigContent.js +3 -0
  8. package/build/generated-sources/api/src/models/BaseProxyConfig.d.ts +31 -0
  9. package/build/generated-sources/api/src/models/BaseProxyConfig.js +50 -0
  10. package/build/generated-sources/api/src/models/ConfigContent.d.ts +7 -0
  11. package/build/generated-sources/api/src/models/ConfigContent.js +3 -0
  12. package/build/generated-sources/api/src/models/HydratedIntegration.d.ts +7 -0
  13. package/build/generated-sources/api/src/models/HydratedIntegration.js +3 -0
  14. package/build/generated-sources/api/src/models/HydratedIntegrationProxy.d.ts +31 -0
  15. package/build/generated-sources/api/src/models/HydratedIntegrationProxy.js +50 -0
  16. package/build/generated-sources/api/src/models/ImportConnectionRequest.d.ts +1 -1
  17. package/build/generated-sources/api/src/models/Integration1.d.ts +7 -0
  18. package/build/generated-sources/api/src/models/Integration1.js +3 -0
  19. package/build/generated-sources/api/src/models/IntegrationProxy.d.ts +31 -0
  20. package/build/generated-sources/api/src/models/IntegrationProxy.js +50 -0
  21. package/build/generated-sources/api/src/models/OauthConnectRequest.d.ts +6 -6
  22. package/build/generated-sources/api/src/models/OauthConnectRequest.js +1 -2
  23. package/build/generated-sources/api/src/models/Operation.d.ts +26 -9
  24. package/build/generated-sources/api/src/models/Operation.js +14 -7
  25. package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.d.ts +7 -0
  26. package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.js +3 -0
  27. package/build/generated-sources/api/src/models/index.d.ts +3 -1
  28. package/build/generated-sources/api/src/models/index.js +3 -1
  29. package/build/src/assets/SuccessIcon.d.ts +1 -0
  30. package/build/src/assets/SuccessIcon.js +8 -0
  31. package/build/src/components/Configure/InstallIntegration.js +2 -1
  32. package/build/src/components/Configure/actions/createInstallationReducer.d.ts +15 -0
  33. package/build/src/components/Configure/actions/createInstallationReducer.js +30 -0
  34. package/build/src/components/Configure/actions/onSaveReadCreateInstallation.js +8 -21
  35. package/build/src/components/Configure/actions/proxy/createInstallationProxyOnly.d.ts +8 -0
  36. package/build/src/components/Configure/actions/proxy/createInstallationProxyOnly.js +44 -0
  37. package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +8 -21
  38. package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.d.ts +11 -0
  39. package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.js +67 -0
  40. package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.d.ts +5 -0
  41. package/build/src/components/Configure/layout/ConditionalProxyLayout/InstalledSuccessBox.js +11 -0
  42. package/build/src/components/Connect/ConnectedSuccessBox.js +3 -3
  43. package/build/src/components/Oauth/Salesforce/SubdomainEntry.js +1 -1
  44. package/build/src/components/SuccessTextBox.d.ts +5 -0
  45. package/build/src/components/SuccessTextBox.js +10 -0
  46. package/build/src/services/api.js +23 -21
  47. package/package.json +1 -1
  48. package/build/generated-sources/api/src/models/OperationError.d.ts +0 -49
  49. package/build/generated-sources/api/src/models/OperationError.js +0 -56
@@ -17,29 +17,31 @@ const ApiService_1 = require("./ApiService");
17
17
  *
18
18
  * */
19
19
  const VERSION = 'v1';
20
+ const prodEndpoint = 'https://api.withampersand.com';
20
21
  function getApiEndpoint() {
21
- var _a, _b, _c;
22
- const prodEndpoint = 'https://api.withampersand.com';
23
- if (typeof process === 'undefined') {
24
- return prodEndpoint;
22
+ try {
23
+ const ENV_SERVER = process.env.REACT_APP_AMP_SERVER;
24
+ switch (ENV_SERVER) {
25
+ case 'local':
26
+ return 'http://localhost:8080';
27
+ case 'dev':
28
+ return 'https://dev-api.withampersand.com';
29
+ case 'staging':
30
+ return 'https://staging-api.withampersand.com';
31
+ case 'prod':
32
+ return prodEndpoint;
33
+ case 'mock':
34
+ return 'http://127.0.0.1:4010';
35
+ case '':
36
+ return prodEndpoint;
37
+ default:
38
+ // The user may provide an arbitrary URL here if they want to, or else the
39
+ // default prod url will be used.
40
+ return ENV_SERVER !== null && ENV_SERVER !== void 0 ? ENV_SERVER : prodEndpoint;
41
+ }
25
42
  }
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;
43
+ catch (e) {
44
+ return prodEndpoint;
43
45
  }
44
46
  }
45
47
  const getApiRoot = (server, version) => `${server}/${version}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amp-labs/react",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Ampersand React library.",
5
5
  "author": {
6
6
  "name": "Ampersand Labs",
@@ -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;