@forge/cli-shared 6.6.1-next.15 → 6.6.1-next.16

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.
@@ -3064,6 +3064,7 @@ var ExternalWorkItemSubtype;
3064
3064
  ExternalWorkItemSubtype["DefaultTask"] = "DEFAULT_TASK";
3065
3065
  ExternalWorkItemSubtype["Epic"] = "EPIC";
3066
3066
  ExternalWorkItemSubtype["Incident"] = "INCIDENT";
3067
+ ExternalWorkItemSubtype["Issue"] = "ISSUE";
3067
3068
  ExternalWorkItemSubtype["Milestone"] = "MILESTONE";
3068
3069
  ExternalWorkItemSubtype["Other"] = "OTHER";
3069
3070
  ExternalWorkItemSubtype["Problem"] = "PROBLEM";
@@ -20,10 +20,10 @@ declare class SupportedProductEntry {
20
20
  }
21
21
  declare function resolveEnabledProducts(statsigService: StatsigService): Promise<SupportedProductEntry[]>;
22
22
  export declare class SupportedProductsService {
23
- private supportedProducts?;
24
- constructor(supportedProducts?: SupportedProductEntry[] | undefined);
23
+ private supportedProductEntriesHolder;
24
+ constructor(supportedProductEntries?: SupportedProductEntry[]);
25
25
  initializeWithSupportedProducts(statsigService: StatsigService): Promise<void>;
26
- private getSupportedProductsNames;
26
+ private getFilteredSupportedProducts;
27
27
  getSupportedProducts(): SupportedProduct[];
28
28
  getSupportedSecondaryProductsForXPA(requiredProducts: string[]): SupportedProduct[];
29
29
  validateSupportedProduct(productNameInput: string): SupportedProduct;
@@ -1 +1 @@
1
- {"version":3,"file":"supported-products-service.d.ts","sourceRoot":"","sources":["../../src/service/supported-products-service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAuC,MAAM,WAAW,CAAC;AAKpF,oBAAY,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,gBAAgB,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,OAAO,EAAE,MAAM,GAAG,OAAO;IAO5C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,GAAG;CAqBhF;AAID,eAAO,MAAM,kBAAkB,YAAa,MAAM,KAAG,OAEpD,CAAC;AAGF,eAAO,MAAM,iBAAiB;;CAE7B,CAAC"}
@@ -68,29 +68,44 @@ async function resolveEnabledProducts(statsigService) {
68
68
  return new SupportedProductEntry(pd.name, pd.productType, pd.special?.supportedByCrossProductApps ?? false);
69
69
  });
70
70
  }
71
- class SupportedProductsService {
72
- supportedProducts;
73
- constructor(supportedProducts) {
74
- this.supportedProducts = supportedProducts;
71
+ class SupportedProductEntriesHolder {
72
+ value;
73
+ constructor(value) {
74
+ this.value = value;
75
75
  }
76
- async initializeWithSupportedProducts(statsigService) {
77
- if (this.supportedProducts) {
78
- throw new Error('SupportedProductsService is already initialized');
76
+ async initialize(valueProvider) {
77
+ if (this.value) {
78
+ throw new Error('SupportedProductsService was already initialized - is initialization called multiple times?');
79
79
  }
80
- this.supportedProducts = await resolveEnabledProducts(statsigService);
80
+ this.value = await valueProvider();
81
81
  }
82
- getSupportedProductsNames(filter = () => true) {
83
- if (!this.supportedProducts) {
84
- throw new Error('SupportedProductsService is not initialized, are you calling it from some constructor?');
82
+ get() {
83
+ if (!this.value) {
84
+ throw new Error('SupportedProductsService is not initialized - are you calling it from some constructor?');
85
85
  }
86
- return this.supportedProducts.filter((p) => filter(p)).map((p) => p.productName);
86
+ return this.value;
87
+ }
88
+ }
89
+ class SupportedProductsService {
90
+ supportedProductEntriesHolder;
91
+ constructor(supportedProductEntries) {
92
+ this.supportedProductEntriesHolder = new SupportedProductEntriesHolder(supportedProductEntries);
93
+ }
94
+ async initializeWithSupportedProducts(statsigService) {
95
+ await this.supportedProductEntriesHolder.initialize(async () => await resolveEnabledProducts(statsigService));
96
+ }
97
+ getFilteredSupportedProducts(filter) {
98
+ return this.supportedProductEntriesHolder
99
+ .get()
100
+ .filter((p) => filter(p))
101
+ .map((p) => p.productName);
87
102
  }
88
103
  getSupportedProducts() {
89
- return this.getSupportedProductsNames();
104
+ return this.supportedProductEntriesHolder.get().map((p) => p.productName);
90
105
  }
91
106
  getSupportedSecondaryProductsForXPA(requiredProducts) {
92
107
  const requiredProductsNames = requiredProducts.map((p) => (0, shared_1.productDisplayName)(p));
93
- return this.getSupportedProductsNames((p) => p.supportedByCrossProductApps && !requiredProductsNames.includes(p.productName));
108
+ return this.getFilteredSupportedProducts((p) => p.supportedByCrossProductApps && !requiredProductsNames.includes(p.productName));
94
109
  }
95
110
  validateSupportedProduct(productNameInput) {
96
111
  const productName = (0, shared_1.productDisplayName)(productNameInput);
@@ -103,7 +118,7 @@ class SupportedProductsService {
103
118
  }
104
119
  }
105
120
  isWorkspaceProduct(product) {
106
- return this.getSupportedProductsNames((p) => p.productType === 'workspace').includes((0, shared_1.productDisplayName)(product));
121
+ return this.getFilteredSupportedProducts((p) => p.productType === 'workspace').includes((0, shared_1.productDisplayName)(product));
107
122
  }
108
123
  validateSite(site, product) {
109
124
  const trySites = [site, `https://${site}`];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/cli-shared",
3
- "version": "6.6.1-next.15",
3
+ "version": "6.6.1-next.16",
4
4
  "description": "Common functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",