@swan-admin/swan-ai-measurements 1.1.78 → 1.1.79

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/dist/esm/utils.js CHANGED
@@ -12,7 +12,7 @@ import { APP_AUTH_BASE_URL, URLS, requiredMetaData } from "./constants.js";
12
12
  import { URLType } from "./enum.js";
13
13
  export function fetchData(options) {
14
14
  return __awaiter(this, void 0, void 0, function* () {
15
- const { path, body, queryParams, baseUrl = APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = URLType.STAGING, } = options;
15
+ const { path, body, queryParams, baseUrl = APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = URLType.PROD, } = options;
16
16
  const apiUrl = `${getUrl({ urlName: baseUrl, urlType })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
17
17
  try {
18
18
  const res = yield axios.post(apiUrl, body, { headers });
@@ -95,7 +95,7 @@ export function getFileChunks(file, chunkSize = 5 * 1024 * 1024) {
95
95
  }
96
96
  return chunks;
97
97
  }
98
- export const getUrl = ({ urlName, urlType = URLType.STAGING }) => {
98
+ export const getUrl = ({ urlName, urlType = URLType.PROD }) => {
99
99
  return URLS[urlType][urlName];
100
100
  };
101
101
  export const isValidEmail = (email) => {
package/dist/utils.js CHANGED
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
8
8
  const constants_js_1 = require("./constants.js");
9
9
  const enum_js_1 = require("./enum.js");
10
10
  async function fetchData(options) {
11
- const { path, body, queryParams, baseUrl = constants_js_1.APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = enum_js_1.URLType.STAGING, } = options;
11
+ const { path, body, queryParams, baseUrl = constants_js_1.APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = enum_js_1.URLType.PROD, } = options;
12
12
  const apiUrl = `${(0, exports.getUrl)({ urlName: baseUrl, urlType })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
13
13
  try {
14
14
  const res = await axios_1.default.post(apiUrl, body, { headers });
@@ -96,7 +96,7 @@ function getFileChunks(file, chunkSize = 5 * 1024 * 1024) {
96
96
  return chunks;
97
97
  }
98
98
  exports.getFileChunks = getFileChunks;
99
- const getUrl = ({ urlName, urlType = enum_js_1.URLType.STAGING }) => {
99
+ const getUrl = ({ urlName, urlType = enum_js_1.URLType.PROD }) => {
100
100
  return constants_js_1.URLS[urlType][urlName];
101
101
  };
102
102
  exports.getUrl = getUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.1.78",
3
+ "version": "1.1.79",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/utils.ts CHANGED
@@ -22,7 +22,7 @@ export async function fetchData(options: FetchDataOptions): Promise<any> {
22
22
  apiKey = "",
23
23
  throwError = false,
24
24
  headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" },
25
- urlType = URLType.STAGING,
25
+ urlType = URLType.PROD,
26
26
  } = options;
27
27
 
28
28
  const apiUrl = `${getUrl({ urlName: baseUrl, urlType })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
@@ -113,7 +113,7 @@ export function getFileChunks(file: File, chunkSize = 5 * 1024 * 1024): Blob[] {
113
113
  return chunks;
114
114
  }
115
115
 
116
- export const getUrl = ({ urlName, urlType = URLType.STAGING }: { urlName: string; urlType: URLType }) => {
116
+ export const getUrl = ({ urlName, urlType = URLType.PROD }: { urlName: string; urlType: URLType }) => {
117
117
  return URLS[urlType][urlName]
118
118
 
119
119
  };