@forge/cli-shared 2.1.5-next.8 → 2.1.6-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @forge/cli-shared
2
2
 
3
+ ## 2.1.6-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [06209fc]
8
+ - @forge/manifest@2.5.1-next.0
9
+
10
+ ## 2.1.6-next.0
11
+
12
+ ### Patch Changes
13
+
14
+ - 2338be5: Handle the manifest case of remotes found in the egress permissions section when installing an app
15
+
16
+ ## 2.1.5
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [4de9850]
21
+ - Updated dependencies [70e9c8c]
22
+ - Updated dependencies [fde4ba7]
23
+ - Updated dependencies [601527b]
24
+ - Updated dependencies [755e35e]
25
+ - Updated dependencies [a5656f6]
26
+ - Updated dependencies [cc8799c]
27
+ - Updated dependencies [f5eb8e0]
28
+ - Updated dependencies [f013199]
29
+ - Updated dependencies [78d682f]
30
+ - Updated dependencies [70e9c8c]
31
+ - Updated dependencies [dec8066]
32
+ - Updated dependencies [0e82242]
33
+ - @forge/manifest@2.5.0
34
+
35
+ ## 2.1.5-next.10
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [fde4ba7]
40
+ - @forge/manifest@2.5.0-next.10
41
+
42
+ ## 2.1.5-next.9
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [601527b]
47
+ - @forge/manifest@2.5.0-next.9
48
+
3
49
  ## 2.1.5-next.8
4
50
 
5
51
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import { Document } from 'yaml';
2
2
  import { FileSystemReader, FileSystemWriter } from '../file-system';
3
3
  import { ConfigReader, ConfigWriter } from './';
4
- import { ManifestSchema, Resources } from '@forge/manifest';
4
+ import { ManifestSchema, Resources } from '@forge/manifest/out/schema/manifest';
5
5
  export declare class ResourceDefinitionMissingError extends Error {
6
6
  constructor(resources: string[]);
7
7
  }
@@ -27,6 +27,8 @@ export declare class ConfigFile implements ConfigReader, ConfigWriter, ConfigInt
27
27
  writeToConfigFile<K extends string, V>(configKey: K, config: V): Promise<void>;
28
28
  private getHostedResourceKeys;
29
29
  private findMissingResources;
30
+ private getRemoteFromEgressPermission;
31
+ private instanceOfRemote;
30
32
  getEgressPermissions(): Promise<{
31
33
  type: string;
32
34
  domains: string[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAAA,OAAa,EAAwB,QAAQ,EAAE,MAAM,MAAM,CAAC;AAI5D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EAAW,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGrE,qBAAa,8BAA+B,SAAQ,KAAK;gBAC3C,SAAS,EAAE,MAAM,EAAE;CAGhC;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC;AAED,oBAAY,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AACpC,oBAAY,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;AAClD,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,qBAAa,UAAW,YAAW,YAAY,EAAE,YAAY,EAAE,gBAAgB;IACjE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAAoB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAzD,UAAU,EAAE,gBAAgB,EAAmB,UAAU,EAAE,gBAAgB;IAE3F,cAAc,IAAI,OAAO,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gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAe1E,YAAY,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IA0B1C,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAI1D"}
@@ -112,8 +112,22 @@ class ConfigFile {
112
112
  const missing = resourceKeys.filter((resourceKey) => !resources.some(({ key }) => resourceKey === key));
113
113
  return missing;
114
114
  }
115
+ getRemoteFromEgressPermission(remoteEgressPermission, remotes) {
116
+ if (!remotes) {
117
+ return remoteEgressPermission;
118
+ }
119
+ for (const remote of remotes) {
120
+ if (remote.key === remoteEgressPermission) {
121
+ return new url_1.URL(remote.baseUrl).hostname;
122
+ }
123
+ }
124
+ return remoteEgressPermission;
125
+ }
126
+ instanceOfRemote(remote) {
127
+ return typeof remote !== 'string' && 'remote' in remote;
128
+ }
115
129
  async getEgressPermissions() {
116
- const { permissions } = await this.readConfig();
130
+ const { permissions, remotes } = await this.readConfig();
117
131
  const egressPermissions = permissions === null || permissions === void 0 ? void 0 : permissions.external;
118
132
  if (!egressPermissions) {
119
133
  return [];
@@ -126,9 +140,11 @@ class ConfigFile {
126
140
  return ({
127
141
  type: typePrefix ? `${typePrefix}_${entry[0]}` : entry[0],
128
142
  domains: (_a = entry[1]) === null || _a === void 0 ? void 0 : _a.map((url) => {
129
- let domain = url;
143
+ let domain = this.instanceOfRemote(url) ? url.remote : url;
130
144
  try {
131
- domain = new url_1.URL(url).hostname;
145
+ domain = this.instanceOfRemote(url)
146
+ ? this.getRemoteFromEgressPermission(url.remote, remotes)
147
+ : new url_1.URL(url).hostname;
132
148
  }
133
149
  catch (e) {
134
150
  }
@@ -137,9 +153,7 @@ class ConfigFile {
137
153
  });
138
154
  });
139
155
  const egressUrls = getDomainsFromPermissions(otherEgress);
140
- const fetchUrls = fetchEgress
141
- ? getDomainsFromPermissions(fetchEgress, 'fetch')
142
- : [];
156
+ const fetchUrls = fetchEgress ? getDomainsFromPermissions(fetchEgress, 'fetch') : [];
143
157
  return [...egressUrls, ...fetchUrls];
144
158
  }
145
159
  async getAuthProviders() {
@@ -1696,6 +1696,7 @@ export declare type CompassCreateMetricDefinitionInput = {
1696
1696
  cloudId: Scalars['ID'];
1697
1697
  name: Scalars['String'];
1698
1698
  description?: Maybe<Scalars['String']>;
1699
+ format?: Maybe<CompassMetricDefinitionFormatInput>;
1699
1700
  };
1700
1701
  export declare type CompassCreateMetricDefinitionPayload = Payload & {
1701
1702
  __typename?: 'CompassCreateMetricDefinitionPayload';
@@ -1948,7 +1949,6 @@ export declare type CompassHasMetricValueScorecardCriteria = CompassScorecardCri
1948
1949
  weight: Scalars['Int'];
1949
1950
  comparatorValue: Scalars['Float'];
1950
1951
  metricDefinitionId: Scalars['ID'];
1951
- metricDefinitionName?: Maybe<Scalars['String']>;
1952
1952
  comparator: CompassCriteriaNumberComparatorOptions;
1953
1953
  scorecardCriteriaScore?: Maybe<CompassScorecardCriteriaScore>;
1954
1954
  };
@@ -1995,12 +1995,24 @@ export declare type CompassMetricDefinition = {
1995
1995
  id: Scalars['ID'];
1996
1996
  name?: Maybe<Scalars['String']>;
1997
1997
  description?: Maybe<Scalars['String']>;
1998
+ format?: Maybe<CompassMetricDefinitionFormat>;
1998
1999
  };
1999
2000
  export declare type CompassMetricDefinitionEdge = {
2000
2001
  __typename?: 'CompassMetricDefinitionEdge';
2001
2002
  cursor: Scalars['String'];
2002
2003
  node?: Maybe<CompassMetricDefinition>;
2003
2004
  };
2005
+ export declare type CompassMetricDefinitionFormat = CompassMetricDefinitionFormatSuffix;
2006
+ export declare type CompassMetricDefinitionFormatInput = {
2007
+ suffix?: Maybe<CompassMetricDefinitionFormatSuffixInput>;
2008
+ };
2009
+ export declare type CompassMetricDefinitionFormatSuffix = {
2010
+ __typename?: 'CompassMetricDefinitionFormatSuffix';
2011
+ suffix?: Maybe<Scalars['String']>;
2012
+ };
2013
+ export declare type CompassMetricDefinitionFormatSuffixInput = {
2014
+ suffix: Scalars['String'];
2015
+ };
2004
2016
  export declare type CompassMetricDefinitionsConnection = {
2005
2017
  __typename?: 'CompassMetricDefinitionsConnection';
2006
2018
  edges?: Maybe<Array<CompassMetricDefinitionEdge>>;
@@ -2011,7 +2023,6 @@ export declare type CompassMetricDefinitionsQuery = {
2011
2023
  cloudId: Scalars['ID'];
2012
2024
  first?: Maybe<Scalars['Int']>;
2013
2025
  after?: Maybe<Scalars['String']>;
2014
- names?: Maybe<Array<Scalars['String']>>;
2015
2026
  };
2016
2027
  export declare type CompassMetricDefinitionsQueryResult = CompassMetricDefinitionsConnection | QueryError;
2017
2028
  export declare type CompassMetricSource = {
@@ -2303,6 +2314,7 @@ export declare type CompassUpdateMetricDefinitionInput = {
2303
2314
  id: Scalars['ID'];
2304
2315
  name?: Maybe<Scalars['String']>;
2305
2316
  description?: Maybe<Scalars['String']>;
2317
+ format?: Maybe<CompassMetricDefinitionFormatInput>;
2306
2318
  };
2307
2319
  export declare type CompassUpdateMetricDefinitionPayload = Payload & {
2308
2320
  __typename?: 'CompassUpdateMetricDefinitionPayload';
@@ -2676,7 +2688,6 @@ export declare type CreateCompassHasLinkScorecardCriteriaInput = {
2676
2688
  export declare type CreateCompassHasMetricValueCriteriaInput = {
2677
2689
  weight: Scalars['Int'];
2678
2690
  metricDefinitionId: Scalars['ID'];
2679
- metricDefinitionName?: Maybe<Scalars['String']>;
2680
2691
  comparatorValue: Scalars['Float'];
2681
2692
  comparator: CompassCriteriaNumberComparatorOptions;
2682
2693
  };
@@ -4108,6 +4119,7 @@ export declare type EventSource = {
4108
4119
  id: Scalars['ID'];
4109
4120
  externalEventSourceId: Scalars['ID'];
4110
4121
  eventType: CompassEventType;
4122
+ forgeAppId?: Maybe<Scalars['ID']>;
4111
4123
  };
4112
4124
  export declare type Extension = {
4113
4125
  __typename?: 'Extension';
@@ -10191,8 +10203,8 @@ export declare type PolarisIssueLinkType = {
10191
10203
  };
10192
10204
  export declare type PolarisMatrixAxis = {
10193
10205
  __typename?: 'PolarisMatrixAxis';
10194
- dimension?: Maybe<Scalars['String']>;
10195
- field?: Maybe<PolarisIdeaField>;
10206
+ dimension: Scalars['String'];
10207
+ field: PolarisIdeaField;
10196
10208
  };
10197
10209
  export declare type PolarisMatrixConfig = {
10198
10210
  __typename?: 'PolarisMatrixConfig';
@@ -10384,7 +10396,7 @@ export declare type PolarisTimelineConfig = {
10384
10396
  __typename?: 'PolarisTimelineConfig';
10385
10397
  startDateField?: Maybe<PolarisIdeaField>;
10386
10398
  dueDateField?: Maybe<PolarisIdeaField>;
10387
- mode?: Maybe<PolarisTimelineMode>;
10399
+ mode: PolarisTimelineMode;
10388
10400
  };
10389
10401
  export declare enum PolarisTimelineMode {
10390
10402
  Months = "MONTHS",
@@ -10922,7 +10934,8 @@ export declare type RankColumnOutput = MutationResponse & {
10922
10934
  };
10923
10935
  export declare enum RateLimitingCurrency {
10924
10936
  TestingService = "TESTING_SERVICE",
10925
- ForgeMetricsCurrency = "FORGE_METRICS_CURRENCY"
10937
+ ForgeMetricsCurrency = "FORGE_METRICS_CURRENCY",
10938
+ CompassInsertMetricValueCurrency = "COMPASS_INSERT_METRIC_VALUE_CURRENCY"
10926
10939
  }
10927
10940
  export declare type RawStatus = {
10928
10941
  __typename?: 'RawStatus';
@@ -12305,7 +12318,6 @@ export declare type UpdateCompassHasMetricValueCriteriaInput = {
12305
12318
  id: Scalars['ID'];
12306
12319
  weight?: Maybe<Scalars['Int']>;
12307
12320
  metricDefinitionId?: Maybe<Scalars['ID']>;
12308
- metricDefinitionName?: Maybe<Scalars['String']>;
12309
12321
  comparatorValue?: Maybe<Scalars['Float']>;
12310
12322
  comparator?: Maybe<CompassCriteriaNumberComparatorOptions>;
12311
12323
  };