@nimee/api-clients 1.1.105 → 1.1.107

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.
@@ -1,4 +1,9 @@
1
1
  import { IMarketPlace } from "@nimee/shared-types";
2
2
  export declare class MarketplaceClient {
3
3
  getById(id: string): Promise<IMarketPlace>;
4
+ /**
5
+ * Marketplace ids differ per environment, so callers that need a fixed set of
6
+ * marketplaces reference them by domain and resolve the id at runtime.
7
+ */
8
+ getIdByDomain(domain: string): Promise<string>;
4
9
  }
@@ -26,6 +26,18 @@ class MarketplaceClient {
26
26
  return response.data;
27
27
  });
28
28
  }
29
+ /**
30
+ * Marketplace ids differ per environment, so callers that need a fixed set of
31
+ * marketplaces reference them by domain and resolve the id at runtime.
32
+ */
33
+ getIdByDomain(domain) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const response = yield axios_1.default.get(`${userUrl}/marketplace/getMarketplaceIdByDomainRegex`, {
36
+ params: { domain },
37
+ });
38
+ return (response.data || "");
39
+ });
40
+ }
29
41
  }
30
42
  exports.MarketplaceClient = MarketplaceClient;
31
43
  //# sourceMappingURL=marketplace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/marketplace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA0B;AAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;AACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AAC9F,MAAM,OAAO,GAAG,GAAG,QAAQ,OAAO,CAAC;AAEnC,MAAa,iBAAiB;IACtB,OAAO,CAAC,EAAU;;YACtB,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,OAAO,gBAAgB,EAAE,EAAE,EAAE;gBAC/D,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE;aAC7C,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAoB,CAAC;QACvC,CAAC;KAAA;CACF;AAPD,8CAOC"}
1
+ {"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/marketplace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA0B;AAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;AACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AAC9F,MAAM,OAAO,GAAG,GAAG,QAAQ,OAAO,CAAC;AAEnC,MAAa,iBAAiB;IACtB,OAAO,CAAC,EAAU;;YACtB,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,OAAO,gBAAgB,EAAE,EAAE,EAAE;gBAC/D,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE;aAC7C,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAoB,CAAC;QACvC,CAAC;KAAA;IAED;;;OAGG;IACG,aAAa,CAAC,MAAc;;YAChC,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,OAAO,4CAA4C,EAAE;gBACvF,MAAM,EAAE,EAAE,MAAM,EAAE;aACnB,CAAC,CAAC;YACH,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAW,CAAC;QACzC,CAAC;KAAA;CACF;AAlBD,8CAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimee/api-clients",
3
- "version": "1.1.105",
3
+ "version": "1.1.107",
4
4
  "description": "communication http for each ms",
5
5
  "main": "dist/src/index.js",
6
6
  "author": "dan goldberg",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@nimee/error-handler": "0.0.14",
40
40
  "@nimee/logger": "^1.0.27",
41
- "@nimee/shared-types": "^1.0.322",
41
+ "@nimee/shared-types": "^1.0.328",
42
42
  "axios": "1.2.1"
43
43
  }
44
44
  }
@@ -11,4 +11,15 @@ export class MarketplaceClient {
11
11
  });
12
12
  return response.data as IMarketPlace;
13
13
  }
14
+
15
+ /**
16
+ * Marketplace ids differ per environment, so callers that need a fixed set of
17
+ * marketplaces reference them by domain and resolve the id at runtime.
18
+ */
19
+ async getIdByDomain(domain: string) {
20
+ const response = await axios.get(`${userUrl}/marketplace/getMarketplaceIdByDomainRegex`, {
21
+ params: { domain },
22
+ });
23
+ return (response.data || "") as string;
24
+ }
14
25
  }