@amp-labs/react 1.4.4 → 1.5.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.
Files changed (46) hide show
  1. package/build/generated-sources/api/src/apis/index.d.ts +0 -2
  2. package/build/generated-sources/api/src/apis/index.js +0 -2
  3. package/build/generated-sources/api/src/models/BaseReadConfig.d.ts +4 -4
  4. package/build/generated-sources/api/src/models/BaseReadConfig.js +3 -3
  5. package/build/generated-sources/api/src/models/{BaseReadConfigStandardObject.d.ts → BaseReadConfigObject.d.ts} +12 -12
  6. package/build/generated-sources/api/src/models/{BaseReadConfigStandardObject.js → BaseReadConfigObject.js} +11 -11
  7. package/build/generated-sources/api/src/models/HydratedIntegrationRead.d.ts +1 -1
  8. package/build/generated-sources/api/src/models/HydratedIntegrationRead.js +2 -2
  9. package/build/generated-sources/api/src/models/IntegrationRead.d.ts +1 -1
  10. package/build/generated-sources/api/src/models/IntegrationRead.js +2 -2
  11. package/build/generated-sources/api/src/models/ProviderInfo.d.ts +12 -0
  12. package/build/generated-sources/api/src/models/ProviderInfo.js +5 -0
  13. package/build/generated-sources/api/src/models/index.d.ts +1 -2
  14. package/build/generated-sources/api/src/models/index.js +1 -2
  15. package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js +1 -1
  16. package/build/src/components/Configure/actions/read/onSaveReadCreateInstallation.js +3 -3
  17. package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.js +1 -1
  18. package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +2 -2
  19. package/build/src/components/Configure/content/UpdateInstallation.js +1 -1
  20. package/build/src/components/Configure/layout/ConditionalProxyLayout/ConditionalProxyLayout.js +2 -1
  21. package/build/src/components/Configure/state/utils.js +3 -3
  22. package/build/src/components/Configure/utils.d.ts +1 -1
  23. package/build/src/components/Configure/utils.js +7 -7
  24. package/build/src/components/Oauth/NoWorkspaceEntry/NoWorkspaceOauthFlow.js +8 -11
  25. package/build/src/components/Oauth/OAuthPopup.d.ts +7 -1
  26. package/build/src/components/Oauth/OAuthPopup.js +7 -1
  27. package/build/src/components/Oauth/OAuthWindow/OAuthWindow.d.ts +14 -0
  28. package/build/src/components/Oauth/OAuthWindow/OAuthWindow.js +65 -0
  29. package/build/src/components/Oauth/OAuthWindow/windowHelpers.d.ts +24 -0
  30. package/build/src/components/Oauth/OAuthWindow/windowHelpers.js +77 -0
  31. package/build/src/components/Oauth/WorkspaceEntry/WorkspaceOauthFlow.js +2 -2
  32. package/build/src/components/Oauth/fetchOAuthPopupURL.d.ts +1 -0
  33. package/build/src/components/Oauth/{fetchOAuthCallbackURL.js → fetchOAuthPopupURL.js} +6 -5
  34. package/build/src/services/ApiService.d.ts +1 -3
  35. package/build/src/services/ApiService.js +0 -2
  36. package/build/src/services/api.d.ts +2 -2
  37. package/build/src/services/version.d.ts +1 -1
  38. package/build/src/services/version.js +1 -1
  39. package/package.json +4 -4
  40. package/build/generated-sources/api/src/apis/AllowedDomainApi.d.ts +0 -79
  41. package/build/generated-sources/api/src/apis/AllowedDomainApi.js +0 -101
  42. package/build/generated-sources/api/src/apis/ProjectMembershipApi.d.ts +0 -126
  43. package/build/generated-sources/api/src/apis/ProjectMembershipApi.js +0 -154
  44. package/build/generated-sources/api/src/models/UpsertProjectMembershipRequest.d.ts +0 -37
  45. package/build/generated-sources/api/src/models/UpsertProjectMembershipRequest.js +0 -53
  46. package/build/src/components/Oauth/fetchOAuthCallbackURL.d.ts +0 -1
@@ -1,5 +1,4 @@
1
1
  export * from './APIKeyApi';
2
- export * from './AllowedDomainApi';
3
2
  export * from './ConnectionApi';
4
3
  export * from './ConsumerApi';
5
4
  export * from './DestinationApi';
@@ -11,7 +10,6 @@ export * from './OperationApi';
11
10
  export * from './OperationEventApi';
12
11
  export * from './OrgApi';
13
12
  export * from './ProjectApi';
14
- export * from './ProjectMembershipApi';
15
13
  export * from './ProviderApi';
16
14
  export * from './ProviderAppApi';
17
15
  export * from './RevisionApi';
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./APIKeyApi"), exports);
20
- __exportStar(require("./AllowedDomainApi"), exports);
21
20
  __exportStar(require("./ConnectionApi"), exports);
22
21
  __exportStar(require("./ConsumerApi"), exports);
23
22
  __exportStar(require("./DestinationApi"), exports);
@@ -29,7 +28,6 @@ __exportStar(require("./OperationApi"), exports);
29
28
  __exportStar(require("./OperationEventApi"), exports);
30
29
  __exportStar(require("./OrgApi"), exports);
31
30
  __exportStar(require("./ProjectApi"), exports);
32
- __exportStar(require("./ProjectMembershipApi"), exports);
33
31
  __exportStar(require("./ProviderApi"), exports);
34
32
  __exportStar(require("./ProviderAppApi"), exports);
35
33
  __exportStar(require("./RevisionApi"), exports);
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { BaseReadConfigStandardObject } from './BaseReadConfigStandardObject';
12
+ import type { BaseReadConfigObject } from './BaseReadConfigObject';
13
13
  /**
14
14
  *
15
15
  * @export
@@ -18,11 +18,11 @@ import type { BaseReadConfigStandardObject } from './BaseReadConfigStandardObjec
18
18
  export interface BaseReadConfig {
19
19
  /**
20
20
  * This is a map of object names to their configuration.
21
- * @type {{ [key: string]: BaseReadConfigStandardObject; }}
21
+ * @type {{ [key: string]: BaseReadConfigObject; }}
22
22
  * @memberof BaseReadConfig
23
23
  */
24
- standardObjects?: {
25
- [key: string]: BaseReadConfigStandardObject;
24
+ objects?: {
25
+ [key: string]: BaseReadConfigObject;
26
26
  };
27
27
  }
28
28
  /**
@@ -15,7 +15,7 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.BaseReadConfigToJSON = exports.BaseReadConfigFromJSONTyped = exports.BaseReadConfigFromJSON = exports.instanceOfBaseReadConfig = void 0;
17
17
  const runtime_1 = require("../runtime");
18
- const BaseReadConfigStandardObject_1 = require("./BaseReadConfigStandardObject");
18
+ const BaseReadConfigObject_1 = require("./BaseReadConfigObject");
19
19
  /**
20
20
  * Check if a given object implements the BaseReadConfig interface.
21
21
  */
@@ -33,7 +33,7 @@ function BaseReadConfigFromJSONTyped(json, ignoreDiscriminator) {
33
33
  return json;
34
34
  }
35
35
  return {
36
- 'standardObjects': !(0, runtime_1.exists)(json, 'standardObjects') ? undefined : ((0, runtime_1.mapValues)(json['standardObjects'], BaseReadConfigStandardObject_1.BaseReadConfigStandardObjectFromJSON)),
36
+ 'objects': !(0, runtime_1.exists)(json, 'objects') ? undefined : ((0, runtime_1.mapValues)(json['objects'], BaseReadConfigObject_1.BaseReadConfigObjectFromJSON)),
37
37
  };
38
38
  }
39
39
  exports.BaseReadConfigFromJSONTyped = BaseReadConfigFromJSONTyped;
@@ -45,7 +45,7 @@ function BaseReadConfigToJSON(value) {
45
45
  return null;
46
46
  }
47
47
  return {
48
- 'standardObjects': value.standardObjects === undefined ? undefined : ((0, runtime_1.mapValues)(value.standardObjects, BaseReadConfigStandardObject_1.BaseReadConfigStandardObjectToJSON)),
48
+ 'objects': value.objects === undefined ? undefined : ((0, runtime_1.mapValues)(value.objects, BaseReadConfigObject_1.BaseReadConfigObjectToJSON)),
49
49
  };
50
50
  }
51
51
  exports.BaseReadConfigToJSON = BaseReadConfigToJSON;
@@ -12,31 +12,31 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
- * @interface BaseReadConfigStandardObject
15
+ * @interface BaseReadConfigObject
16
16
  */
17
- export interface BaseReadConfigStandardObject {
17
+ export interface BaseReadConfigObject {
18
18
  /**
19
19
  * The name of the object to read from.
20
20
  * @type {string}
21
- * @memberof BaseReadConfigStandardObject
21
+ * @memberof BaseReadConfigObject
22
22
  */
23
23
  objectName?: string;
24
24
  /**
25
25
  * The schedule for reading the object, in cron syntax.
26
26
  * @type {string}
27
- * @memberof BaseReadConfigStandardObject
27
+ * @memberof BaseReadConfigObject
28
28
  */
29
29
  schedule?: string;
30
30
  /**
31
31
  * The name of the destination that the result should be sent to.
32
32
  * @type {string}
33
- * @memberof BaseReadConfigStandardObject
33
+ * @memberof BaseReadConfigObject
34
34
  */
35
35
  destination?: string;
36
36
  /**
37
37
  * This is a map of field names to booleans indicating whether they should be read.
38
38
  * @type {{ [key: string]: boolean; }}
39
- * @memberof BaseReadConfigStandardObject
39
+ * @memberof BaseReadConfigObject
40
40
  */
41
41
  selectedFields?: {
42
42
  [key: string]: boolean;
@@ -44,16 +44,16 @@ export interface BaseReadConfigStandardObject {
44
44
  /**
45
45
  * This is a map of mapToNames to field names. (A mapTo name is the name the builder wants to map a field to when it lands in their destination.)
46
46
  * @type {{ [key: string]: string; }}
47
- * @memberof BaseReadConfigStandardObject
47
+ * @memberof BaseReadConfigObject
48
48
  */
49
49
  selectedFieldMappings?: {
50
50
  [key: string]: string;
51
51
  };
52
52
  }
53
53
  /**
54
- * Check if a given object implements the BaseReadConfigStandardObject interface.
54
+ * Check if a given object implements the BaseReadConfigObject interface.
55
55
  */
56
- export declare function instanceOfBaseReadConfigStandardObject(value: object): boolean;
57
- export declare function BaseReadConfigStandardObjectFromJSON(json: any): BaseReadConfigStandardObject;
58
- export declare function BaseReadConfigStandardObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): BaseReadConfigStandardObject;
59
- export declare function BaseReadConfigStandardObjectToJSON(value?: BaseReadConfigStandardObject | null): any;
56
+ export declare function instanceOfBaseReadConfigObject(value: object): boolean;
57
+ export declare function BaseReadConfigObjectFromJSON(json: any): BaseReadConfigObject;
58
+ export declare function BaseReadConfigObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): BaseReadConfigObject;
59
+ export declare function BaseReadConfigObjectToJSON(value?: BaseReadConfigObject | null): any;
@@ -13,21 +13,21 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.BaseReadConfigStandardObjectToJSON = exports.BaseReadConfigStandardObjectFromJSONTyped = exports.BaseReadConfigStandardObjectFromJSON = exports.instanceOfBaseReadConfigStandardObject = void 0;
16
+ exports.BaseReadConfigObjectToJSON = exports.BaseReadConfigObjectFromJSONTyped = exports.BaseReadConfigObjectFromJSON = exports.instanceOfBaseReadConfigObject = void 0;
17
17
  const runtime_1 = require("../runtime");
18
18
  /**
19
- * Check if a given object implements the BaseReadConfigStandardObject interface.
19
+ * Check if a given object implements the BaseReadConfigObject interface.
20
20
  */
21
- function instanceOfBaseReadConfigStandardObject(value) {
21
+ function instanceOfBaseReadConfigObject(value) {
22
22
  let isInstance = true;
23
23
  return isInstance;
24
24
  }
25
- exports.instanceOfBaseReadConfigStandardObject = instanceOfBaseReadConfigStandardObject;
26
- function BaseReadConfigStandardObjectFromJSON(json) {
27
- return BaseReadConfigStandardObjectFromJSONTyped(json, false);
25
+ exports.instanceOfBaseReadConfigObject = instanceOfBaseReadConfigObject;
26
+ function BaseReadConfigObjectFromJSON(json) {
27
+ return BaseReadConfigObjectFromJSONTyped(json, false);
28
28
  }
29
- exports.BaseReadConfigStandardObjectFromJSON = BaseReadConfigStandardObjectFromJSON;
30
- function BaseReadConfigStandardObjectFromJSONTyped(json, ignoreDiscriminator) {
29
+ exports.BaseReadConfigObjectFromJSON = BaseReadConfigObjectFromJSON;
30
+ function BaseReadConfigObjectFromJSONTyped(json, ignoreDiscriminator) {
31
31
  if ((json === undefined) || (json === null)) {
32
32
  return json;
33
33
  }
@@ -39,8 +39,8 @@ function BaseReadConfigStandardObjectFromJSONTyped(json, ignoreDiscriminator) {
39
39
  'selectedFieldMappings': !(0, runtime_1.exists)(json, 'selectedFieldMappings') ? undefined : json['selectedFieldMappings'],
40
40
  };
41
41
  }
42
- exports.BaseReadConfigStandardObjectFromJSONTyped = BaseReadConfigStandardObjectFromJSONTyped;
43
- function BaseReadConfigStandardObjectToJSON(value) {
42
+ exports.BaseReadConfigObjectFromJSONTyped = BaseReadConfigObjectFromJSONTyped;
43
+ function BaseReadConfigObjectToJSON(value) {
44
44
  if (value === undefined) {
45
45
  return undefined;
46
46
  }
@@ -55,4 +55,4 @@ function BaseReadConfigStandardObjectToJSON(value) {
55
55
  'selectedFieldMappings': value.selectedFieldMappings,
56
56
  };
57
57
  }
58
- exports.BaseReadConfigStandardObjectToJSON = BaseReadConfigStandardObjectToJSON;
58
+ exports.BaseReadConfigObjectToJSON = BaseReadConfigObjectToJSON;
@@ -21,7 +21,7 @@ export interface HydratedIntegrationRead {
21
21
  * @type {Array<HydratedIntegrationObject>}
22
22
  * @memberof HydratedIntegrationRead
23
23
  */
24
- standardObjects?: Array<HydratedIntegrationObject>;
24
+ objects?: Array<HydratedIntegrationObject>;
25
25
  }
26
26
  /**
27
27
  * Check if a given object implements the HydratedIntegrationRead interface.
@@ -33,7 +33,7 @@ function HydratedIntegrationReadFromJSONTyped(json, ignoreDiscriminator) {
33
33
  return json;
34
34
  }
35
35
  return {
36
- 'standardObjects': !(0, runtime_1.exists)(json, 'standardObjects') ? undefined : (json['standardObjects'].map(HydratedIntegrationObject_1.HydratedIntegrationObjectFromJSON)),
36
+ 'objects': !(0, runtime_1.exists)(json, 'objects') ? undefined : (json['objects'].map(HydratedIntegrationObject_1.HydratedIntegrationObjectFromJSON)),
37
37
  };
38
38
  }
39
39
  exports.HydratedIntegrationReadFromJSONTyped = HydratedIntegrationReadFromJSONTyped;
@@ -45,7 +45,7 @@ function HydratedIntegrationReadToJSON(value) {
45
45
  return null;
46
46
  }
47
47
  return {
48
- 'standardObjects': value.standardObjects === undefined ? undefined : (value.standardObjects.map(HydratedIntegrationObject_1.HydratedIntegrationObjectToJSON)),
48
+ 'objects': value.objects === undefined ? undefined : (value.objects.map(HydratedIntegrationObject_1.HydratedIntegrationObjectToJSON)),
49
49
  };
50
50
  }
51
51
  exports.HydratedIntegrationReadToJSON = HydratedIntegrationReadToJSON;
@@ -21,7 +21,7 @@ export interface IntegrationRead {
21
21
  * @type {Array<IntegrationObject>}
22
22
  * @memberof IntegrationRead
23
23
  */
24
- standardObjects?: Array<IntegrationObject>;
24
+ objects?: Array<IntegrationObject>;
25
25
  }
26
26
  /**
27
27
  * Check if a given object implements the IntegrationRead interface.
@@ -33,7 +33,7 @@ function IntegrationReadFromJSONTyped(json, ignoreDiscriminator) {
33
33
  return json;
34
34
  }
35
35
  return {
36
- 'standardObjects': !(0, runtime_1.exists)(json, 'standardObjects') ? undefined : (json['standardObjects'].map(IntegrationObject_1.IntegrationObjectFromJSON)),
36
+ 'objects': !(0, runtime_1.exists)(json, 'objects') ? undefined : (json['objects'].map(IntegrationObject_1.IntegrationObjectFromJSON)),
37
37
  };
38
38
  }
39
39
  exports.IntegrationReadFromJSONTyped = IntegrationReadFromJSONTyped;
@@ -45,7 +45,7 @@ function IntegrationReadToJSON(value) {
45
45
  return null;
46
46
  }
47
47
  return {
48
- 'standardObjects': value.standardObjects === undefined ? undefined : (value.standardObjects.map(IntegrationObject_1.IntegrationObjectToJSON)),
48
+ 'objects': value.objects === undefined ? undefined : (value.objects.map(IntegrationObject_1.IntegrationObjectToJSON)),
49
49
  };
50
50
  }
51
51
  exports.IntegrationReadToJSON = IntegrationReadToJSON;
@@ -50,6 +50,18 @@ export interface ProviderInfo {
50
50
  providerOpts: {
51
51
  [key: string]: string;
52
52
  };
53
+ /**
54
+ * The display name of the provider, if omitted, defaults to provider name.
55
+ * @type {string}
56
+ * @memberof ProviderInfo
57
+ */
58
+ displayName?: string;
59
+ /**
60
+ * If true, we require additional information after auth to start making requests.
61
+ * @type {boolean}
62
+ * @memberof ProviderInfo
63
+ */
64
+ postAuthInfoNeeded?: boolean;
53
65
  }
54
66
  /**
55
67
  * Check if a given object implements the ProviderInfo interface.
@@ -14,6 +14,7 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ProviderInfoToJSON = exports.ProviderInfoFromJSONTyped = exports.ProviderInfoFromJSON = exports.instanceOfProviderInfo = void 0;
17
+ const runtime_1 = require("../runtime");
17
18
  const AuthType_1 = require("./AuthType");
18
19
  const OauthOpts_1 = require("./OauthOpts");
19
20
  const Support_1 = require("./Support");
@@ -44,6 +45,8 @@ function ProviderInfoFromJSONTyped(json, ignoreDiscriminator) {
44
45
  'oauthOpts': (0, OauthOpts_1.OauthOptsFromJSON)(json['oauthOpts']),
45
46
  'support': (0, Support_1.SupportFromJSON)(json['support']),
46
47
  'providerOpts': json['providerOpts'],
48
+ 'displayName': !(0, runtime_1.exists)(json, 'displayName') ? undefined : json['displayName'],
49
+ 'postAuthInfoNeeded': !(0, runtime_1.exists)(json, 'postAuthInfoNeeded') ? undefined : json['postAuthInfoNeeded'],
47
50
  };
48
51
  }
49
52
  exports.ProviderInfoFromJSONTyped = ProviderInfoFromJSONTyped;
@@ -60,6 +63,8 @@ function ProviderInfoToJSON(value) {
60
63
  'oauthOpts': (0, OauthOpts_1.OauthOptsToJSON)(value.oauthOpts),
61
64
  'support': (0, Support_1.SupportToJSON)(value.support),
62
65
  'providerOpts': value.providerOpts,
66
+ 'displayName': value.displayName,
67
+ 'postAuthInfoNeeded': value.postAuthInfoNeeded,
63
68
  };
64
69
  }
65
70
  exports.ProviderInfoToJSON = ProviderInfoToJSON;
@@ -6,7 +6,7 @@ export * from './AuthType';
6
6
  export * from './BaseConfigContent';
7
7
  export * from './BaseProxyConfig';
8
8
  export * from './BaseReadConfig';
9
- export * from './BaseReadConfigStandardObject';
9
+ export * from './BaseReadConfigObject';
10
10
  export * from './BaseWriteConfig';
11
11
  export * from './BaseWriteConfigObject';
12
12
  export * from './BatchUpsertIntegrationsRequest';
@@ -92,4 +92,3 @@ export * from './UpdateProjectRequest';
92
92
  export * from './UpdateProjectRequestProject';
93
93
  export * from './UpdateProviderAppRequest';
94
94
  export * from './UpdateProviderAppRequestProviderApp';
95
- export * from './UpsertProjectMembershipRequest';
@@ -24,7 +24,7 @@ __exportStar(require("./AuthType"), exports);
24
24
  __exportStar(require("./BaseConfigContent"), exports);
25
25
  __exportStar(require("./BaseProxyConfig"), exports);
26
26
  __exportStar(require("./BaseReadConfig"), exports);
27
- __exportStar(require("./BaseReadConfigStandardObject"), exports);
27
+ __exportStar(require("./BaseReadConfigObject"), exports);
28
28
  __exportStar(require("./BaseWriteConfig"), exports);
29
29
  __exportStar(require("./BaseWriteConfigObject"), exports);
30
30
  __exportStar(require("./BatchUpsertIntegrationsRequest"), exports);
@@ -110,4 +110,3 @@ __exportStar(require("./UpdateProjectRequest"), exports);
110
110
  __exportStar(require("./UpdateProjectRequestProject"), exports);
111
111
  __exportStar(require("./UpdateProviderAppRequest"), exports);
112
112
  __exportStar(require("./UpdateProviderAppRequestProviderApp"), exports);
113
- __exportStar(require("./UpsertProjectMembershipRequest"), exports);
@@ -10,7 +10,7 @@ function updateInstallationAndSetState({ updateConfig, projectId, integrationId,
10
10
  installationUpdate: {
11
11
  // update mask will recurse to the object path and replace the object at the object path
12
12
  // this example will replace the object at the object (i.e. accounts)
13
- updateMask: [`config.content.read.standardObjects.${selectedObjectName}`],
13
+ updateMask: [`config.content.read.objects.${selectedObjectName}`],
14
14
  installation: {
15
15
  config: updateConfig,
16
16
  },
@@ -12,8 +12,8 @@ const isProxyEnabled_1 = require("../proxy/isProxyEnabled");
12
12
  */
13
13
  const getObjectFromHydratedRevision = (hydratedRevision, objectName) => {
14
14
  const readAction = hydratedRevision.content.read;
15
- const standardObjects = readAction === null || readAction === void 0 ? void 0 : readAction.standardObjects;
16
- return standardObjects === null || standardObjects === void 0 ? void 0 : standardObjects.find((obj) => obj.objectName === objectName);
15
+ const objects = readAction === null || readAction === void 0 ? void 0 : readAction.objects;
16
+ return objects === null || objects === void 0 ? void 0 : objects.find((obj) => obj.objectName === objectName);
17
17
  };
18
18
  /**
19
19
  * given a configureState, objectName, hyrdatedRevision, and consumerRef
@@ -45,7 +45,7 @@ const generateCreateReadConfigFromConfigureState = (configureState, objectName,
45
45
  content: {
46
46
  provider: hydratedRevision.content.provider,
47
47
  read: {
48
- standardObjects: {
48
+ objects: {
49
49
  [objectName]: {
50
50
  objectName,
51
51
  schedule: obj.schedule,
@@ -27,7 +27,7 @@ const generateUpdateReadConfigFromConfigureState = (configureState, objectName,
27
27
  const updateConfigObject = {
28
28
  content: {
29
29
  read: {
30
- standardObjects: {
30
+ objects: {
31
31
  [objectName]: {
32
32
  objectName,
33
33
  // these two fields are copied from previous config, otherwise they will override null
@@ -42,10 +42,10 @@ const generateCreateWriteConfigFromConfigureState = (configureState, hydratedRev
42
42
  createdBy: `consumer:${consumerRef}`,
43
43
  content: {
44
44
  provider: hydratedRevision.content.provider,
45
- // hack: need empty read.standardObjects to be initialized for update read
45
+ // hack: need empty read.objects to be initialized for update read
46
46
  // https://linear.app/ampersand/issue/ENG-780/bug-write-createupdate-installation-without-read
47
47
  read: {
48
- standardObjects: {},
48
+ objects: {},
49
49
  },
50
50
  write: {
51
51
  objects: configWriteObjects,
@@ -41,7 +41,7 @@ function UpdateInstallation({ installation, integrationObj }) {
41
41
  }, [installation, resetState]);
42
42
  const hydratedObject = (0, react_1.useMemo)(() => {
43
43
  var _a, _b, _c;
44
- const hydrated = (_c = (_b = (_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.standardObjects) === null || _c === void 0 ? void 0 : _c.find((obj) => (obj === null || obj === void 0 ? void 0 : obj.objectName) === selectedObjectName);
44
+ const hydrated = (_c = (_b = (_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.find((obj) => (obj === null || obj === void 0 ? void 0 : obj.objectName) === selectedObjectName);
45
45
  return hydrated;
46
46
  }, [hydratedRevision, selectedObjectName]);
47
47
  const onSaveRead = () => {
@@ -36,7 +36,8 @@ function ConditionalProxyLayout({ children }) {
36
36
  const provider = (_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.provider;
37
37
  const isProxyOnly = getIsProxyOnly(hydratedRevision);
38
38
  (0, react_1.useEffect)(() => {
39
- if (!isLoading && hydratedRevision && isProxyOnly && !installation && selectedConnection && apiKey && (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.id)) {
39
+ if (!isLoading && hydratedRevision && isProxyOnly
40
+ && !installation && selectedConnection && apiKey && (integrationObj === null || integrationObj === void 0 ? void 0 : integrationObj.id)) {
40
41
  setCreateInstallLoading(true);
41
42
  (0, onCreateInstallationProxyOnly_1.onCreateInstallationProxyOnly)({
42
43
  apiKey,
@@ -17,15 +17,15 @@ const generateConfigurationStateRead = (readAction, objectName, config) => {
17
17
  return null;
18
18
  }
19
19
  // refactor this section to be immutable at hydrated revision level
20
- const object = (0, utils_1.getStandardObjectFromAction)(readAction, objectName);
20
+ const object = (0, utils_1.getObjectFromAction)(readAction, objectName);
21
21
  const requiredFields = object && (0, utils_1.getRequiredFieldsFromObject)(object);
22
22
  const optionalFields = object && (0, utils_1.getOptionalFieldsFromObject)(object);
23
23
  const requiredMapFields = object && (0, utils_1.getRequiredMapFieldsFromObject)(object);
24
24
  /// //////////////////////////////////////////////////////////////////////
25
25
  const allFields = (object === null || object === void 0 ? void 0 : object.allFields) || [];
26
26
  const content = config === null || config === void 0 ? void 0 : config.content;
27
- const readSelectedFields = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.read) === null || _a === void 0 ? void 0 : _a.standardObjects) === null || _b === void 0 ? void 0 : _b[objectName]) === null || _c === void 0 ? void 0 : _c.selectedFields) || {};
28
- const selectedFieldMappings = ((_f = (_e = (_d = content === null || content === void 0 ? void 0 : content.read) === null || _d === void 0 ? void 0 : _d.standardObjects) === null || _e === void 0 ? void 0 : _e[objectName]) === null || _f === void 0 ? void 0 : _f.selectedFieldMappings) || {};
27
+ const readSelectedFields = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.read) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b[objectName]) === null || _c === void 0 ? void 0 : _c.selectedFields) || {};
28
+ const selectedFieldMappings = ((_f = (_e = (_d = content === null || content === void 0 ? void 0 : content.read) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e[objectName]) === null || _f === void 0 ? void 0 : _f.selectedFieldMappings) || {};
29
29
  const optionalFieldsSaved = Object.assign({}, readSelectedFields);
30
30
  const requiredMapFieldsSaved = Object.assign({}, selectedFieldMappings);
31
31
  return {
@@ -14,7 +14,7 @@ export declare function isIntegrationFieldMapping(field: HydratedIntegrationFiel
14
14
  * @param objectName string (account, contact, etc...)
15
15
  * @returns HydratedIntegrationObject | null
16
16
  */
17
- export declare function getStandardObjectFromAction(action: HydratedIntegrationRead, objectName: string): HydratedIntegrationObject | null;
17
+ export declare function getObjectFromAction(action: HydratedIntegrationRead, objectName: string): HydratedIntegrationObject | null;
18
18
  export declare function getRequiredFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
19
19
  export declare function getRequiredMapFieldsFromObject(object: HydratedIntegrationObject): IntegrationFieldMapping[] | null;
20
20
  export declare function getOptionalFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateFieldMappings = exports.generateAllNavObjects = exports.generateOtherNavObject = exports.generateReadNavObjects = exports.getFieldKeyValue = exports.getReadObject = exports.getOptionalFieldsFromObject = exports.getRequiredMapFieldsFromObject = exports.getRequiredFieldsFromObject = exports.getStandardObjectFromAction = exports.isIntegrationFieldMapping = void 0;
3
+ exports.validateFieldMappings = exports.generateAllNavObjects = exports.generateOtherNavObject = exports.generateReadNavObjects = exports.getFieldKeyValue = exports.getReadObject = exports.getOptionalFieldsFromObject = exports.getRequiredMapFieldsFromObject = exports.getRequiredFieldsFromObject = exports.getObjectFromAction = exports.isIntegrationFieldMapping = void 0;
4
4
  const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
5
5
  const constant_1 = require("./nav/ObjectManagementNav/constant");
6
6
  /**
@@ -13,18 +13,18 @@ function isIntegrationFieldMapping(field) {
13
13
  return field.mapToName !== undefined;
14
14
  }
15
15
  exports.isIntegrationFieldMapping = isIntegrationFieldMapping;
16
- // 1. get standard object
16
+ // 1. get object
17
17
  /**
18
18
  *
19
19
  * @param action HydratedIntegrationAction
20
20
  * @param objectName string (account, contact, etc...)
21
21
  * @returns HydratedIntegrationObject | null
22
22
  */
23
- function getStandardObjectFromAction(action, objectName) {
23
+ function getObjectFromAction(action, objectName) {
24
24
  var _a;
25
- return ((_a = action === null || action === void 0 ? void 0 : action.standardObjects) === null || _a === void 0 ? void 0 : _a.find((object) => object.objectName === objectName)) || null;
25
+ return ((_a = action === null || action === void 0 ? void 0 : action.objects) === null || _a === void 0 ? void 0 : _a.find((object) => object.objectName === objectName)) || null;
26
26
  }
27
- exports.getStandardObjectFromAction = getStandardObjectFromAction;
27
+ exports.getObjectFromAction = getObjectFromAction;
28
28
  // 2a. get required fields
29
29
  function getRequiredFieldsFromObject(object) {
30
30
  var _a;
@@ -44,7 +44,7 @@ function getOptionalFieldsFromObject(object) {
44
44
  return ((_a = object === null || object === void 0 ? void 0 : object.optionalFields) === null || _a === void 0 ? void 0 : _a.filter((rf) => !isIntegrationFieldMapping(rf) && !!rf.fieldName)) || null;
45
45
  }
46
46
  exports.getOptionalFieldsFromObject = getOptionalFieldsFromObject;
47
- const getReadObject = (config, objectName) => { var _a, _b, _c; return (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.standardObjects) === null || _c === void 0 ? void 0 : _c[objectName]; };
47
+ const getReadObject = (config, objectName) => { var _a, _b, _c; return (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c[objectName]; };
48
48
  exports.getReadObject = getReadObject;
49
49
  // aux. get field value based on type guard
50
50
  function getFieldKeyValue(field) {
@@ -63,7 +63,7 @@ exports.getFieldKeyValue = getFieldKeyValue;
63
63
  const generateReadNavObjects = (config, hydratedRevision) => {
64
64
  var _a, _b, _c;
65
65
  const navObjects = [];
66
- (_c = (_b = (_a = hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.standardObjects) === null || _c === void 0 ? void 0 : _c.forEach((object) => {
66
+ (_c = (_b = (_a = hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.forEach((object) => {
67
67
  navObjects.push({
68
68
  name: object === null || object === void 0 ? void 0 : object.objectName,
69
69
  // if no config, object is not completed
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.NoWorkspaceOauthFlow = void 0;
7
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -12,8 +9,8 @@ const react_1 = require("react");
12
9
  const ApiKeyContextProvider_1 = require("../../../context/ApiKeyContextProvider");
13
10
  const ProjectContextProvider_1 = require("../../../context/ProjectContextProvider");
14
11
  const utils_1 = require("../../../utils");
15
- const fetchOAuthCallbackURL_1 = require("../fetchOAuthCallbackURL");
16
- const OAuthPopup_1 = __importDefault(require("../OAuthPopup"));
12
+ const fetchOAuthPopupURL_1 = require("../fetchOAuthPopupURL");
13
+ const OAuthWindow_1 = require("../OAuthWindow/OAuthWindow");
17
14
  const LandingContent_1 = require("./LandingContent");
18
15
  /**
19
16
  * NoWorkspaceOauthFlow first prompts user with a next button,
@@ -22,25 +19,25 @@ const LandingContent_1 = require("./LandingContent");
22
19
  function NoWorkspaceOauthFlow({ provider, consumerRef, consumerName, groupRef, groupName, }) {
23
20
  const { projectId } = (0, ProjectContextProvider_1.useProject)();
24
21
  const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
25
- const [oAuthCallbackURL, setOAuthCallbackURL] = (0, react_1.useState)(null);
22
+ const [oAuthPopupURL, setOAuthPopupURL] = (0, react_1.useState)(null);
26
23
  const [error, setError] = (0, react_1.useState)(null);
27
24
  // fetch OAuth callback URL from connection so that oath popup can be launched
28
25
  const handleSubmit = async () => {
29
26
  var _a;
30
27
  setError(null);
31
28
  try {
32
- const url = await (0, fetchOAuthCallbackURL_1.fetchOAuthCallbackURL)(projectId, consumerRef, groupRef, apiKey, provider, undefined, consumerName, groupName);
33
- setOAuthCallbackURL(url);
29
+ const url = await (0, fetchOAuthPopupURL_1.fetchOAuthPopupURL)(projectId, consumerRef, groupRef, apiKey, provider, undefined, consumerName, groupName);
30
+ setOAuthPopupURL(url);
34
31
  }
35
32
  catch (err) {
36
- console.error(err);
33
+ console.error('Could not fetch OAuth popup URL', { err });
37
34
  setError((_a = err.message) !== null && _a !== void 0 ? _a : 'Unexpected error');
38
35
  }
39
36
  };
40
37
  const onClose = (0, react_1.useCallback)((err) => {
41
38
  setError(err);
42
- setOAuthCallbackURL(null);
39
+ setOAuthPopupURL(null);
43
40
  }, []);
44
- return ((0, jsx_runtime_1.jsx)(OAuthPopup_1.default, { title: `Connect to ${(0, utils_1.capitalize)(provider)}`, url: oAuthCallbackURL, onClose: onClose, children: (0, jsx_runtime_1.jsx)(LandingContent_1.LandingContent, { provider: provider, handleSubmit: handleSubmit, error: error }) }));
41
+ return ((0, jsx_runtime_1.jsx)(OAuthWindow_1.OAuthWindow, { windowTitle: `Connect to ${(0, utils_1.capitalize)(provider)}`, oauthUrl: oAuthPopupURL, onClose: onClose, children: (0, jsx_runtime_1.jsx)(LandingContent_1.LandingContent, { provider: provider, handleSubmit: handleSubmit, error: error }) }));
45
42
  }
46
43
  exports.NoWorkspaceOauthFlow = NoWorkspaceOauthFlow;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * OAuthPopup.tsx
3
- *
3
+ * @deprecated - this page will be deleted in the future
4
4
  * Takes a URL and creates a popup showing that page.
5
5
  */
6
6
  import React from 'react';
@@ -10,5 +10,11 @@ type PopupProps = {
10
10
  onClose: (err: string | null) => void;
11
11
  children: React.ReactNode;
12
12
  };
13
+ /**
14
+ * v1 popup to manage oauth flow
15
+ * @deprecated
16
+ * @param param0
17
+ * @returns
18
+ */
13
19
  declare function OAuthPopup({ title, url, children, onClose, }: PopupProps): import("react/jsx-runtime").JSX.Element;
14
20
  export default OAuthPopup;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  /**
5
5
  * OAuthPopup.tsx
6
- *
6
+ * @deprecated - this page will be deleted in the future
7
7
  * Takes a URL and creates a popup showing that page.
8
8
  */
9
9
  const react_1 = require("react");
@@ -22,6 +22,12 @@ const createPopup = ({ url, title, }) => {
22
22
  const popup = window.open(url, title, `width=${DEFAULT_WIDTH},height=${DEFAULT_HEIGHT},left=${left},top=${top}`);
23
23
  return popup;
24
24
  };
25
+ /**
26
+ * v1 popup to manage oauth flow
27
+ * @deprecated
28
+ * @param param0
29
+ * @returns
30
+ */
25
31
  function OAuthPopup({ title = '', url, children, onClose, }) {
26
32
  const { projectId } = (0, ProjectContextProvider_1.useProject)();
27
33
  const apiKey = (0, ApiKeyContextProvider_1.useApiKey)();
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ type OAuthWindowProps = {
3
+ children: React.ReactNode;
4
+ windowTitle: string;
5
+ oauthUrl: string | null;
6
+ onClose: (err: string | null) => void;
7
+ };
8
+ /**
9
+ * v2 OAuth window to manage OAuth flow
10
+ * @param param0
11
+ * @returns
12
+ */
13
+ export declare function OAuthWindow({ children, oauthUrl, windowTitle, onClose, }: OAuthWindowProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};