@plusscommunities/pluss-core-aws 2.0.1 → 2.0.2-beta.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.
@@ -1,19 +1,11 @@
1
1
  const axios = require("axios");
2
+ const { getConfig } = require("../../config");
2
3
 
3
4
  module.exports = async (url) => {
4
5
  return new Promise(async (resolve, reject) => {
5
6
  const request = {
6
7
  method: "GET",
7
- url: `https://opengraph-io.p.rapidapi.com/api/1.1/sites?url=${decodeURI(
8
- url
9
- ).replace(
10
- "%3A",
11
- ":"
12
- )}&accept_lang=en-US,en;q=0.9&max_cache_age=432000000`,
13
- headers: {
14
- "x-rapidapi-host": "opengraph-io.p.rapidapi.com",
15
- "x-rapidapi-key": "3941bc0a39msh60f09652e936b3dp1afe26jsn4163bac965cc",
16
- },
8
+ url: `https://opengraph.io/api/1.1/site/${url}?app_id=${getConfig().thirdPartyAPIKeys.openGraph}`,
17
9
  };
18
10
 
19
11
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-aws",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-beta.0",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "scripts": {
6
6
  "betapatch": "npm version prepatch --preid=beta",
@@ -1,25 +0,0 @@
1
- const _ = require("lodash");
2
- const getRef = require("../common/getRef");
3
-
4
- module.exports = async (id, defaultSite) => {
5
- return new Promise((resolve) => {
6
- getRef("strings", "RowId", id)
7
- .then((ev) => {
8
- return resolve(ev.Value);
9
- })
10
- .catch(() => {
11
- if (defaultSite) {
12
- const defaultId = `${defaultSite}_${id.split("_")[1]}`;
13
- getRef("strings", "RowId", defaultId)
14
- .then((ev) => {
15
- return resolve(ev.Value);
16
- })
17
- .catch(() => {
18
- return resolve(null);
19
- });
20
- } else {
21
- return resolve(null);
22
- }
23
- });
24
- });
25
- };