Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Regenerate dist
Browse files Browse the repository at this point in the history
Signed-off-by: Sirbu Nicolae-Cezar <sirbunicolaecezar@gmail.com>
  • Loading branch information
sarbull committed Oct 13, 2022
1 parent 3530108 commit 7db03cf
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dist/esm/api/assets/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ import { API_ASSETS_SEARCH_PATH } from '../../routes';
import { QUERY_MIN_LENGTH, TYPES_MIN_SELECTED } from '../../../commons/constants';
import { fetchData } from '../../egeria-fetch';
import { getQueryParamsPath } from '../../../commons/helpers';
/**
*
* @param formData should contain all the query params from the URL
* @param apiUrl is an optional parameter but it is used if API is deployed
* in a different location
* @returns empty array if conditions aren't met otherwise it will fetch data
* from the API
*
* This function is used to fetch data for Asset Catalog.
*
*/
const fetchRawData = (formData, apiUrl) => __awaiter(void 0, void 0, void 0, function* () {
const { q, types } = formData;
if (q.length >= QUERY_MIN_LENGTH && types.length >= TYPES_MIN_SELECTED) {
Expand Down
7 changes: 7 additions & 0 deletions dist/esm/api/assets/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
import { API_ASSETS_TYPES_PATH } from '../../routes';
import { fetchData } from '../../egeria-fetch';
/**
* @param apiUrl is an optional parameter but it is used if API is deployed
* in a different location
*
* This function is used to fetch Asset Types.
*
*/
const fetchTypes = (apiUrl) => __awaiter(void 0, void 0, void 0, function* () {
let typesData = yield fetchData(`${apiUrl || ''}${API_ASSETS_TYPES_PATH}`, 'GET');
typesData = [
Expand Down
8 changes: 8 additions & 0 deletions dist/esm/api/egeria-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ const egeriaFetch = (endpoint, method, headers, options) => {
const apiUrl = process.env.REACT_APP_API_URL || '';
return fetch(`${apiUrl}${endpoint}`, requestOptions).then(handleResponse);
};
/*
* @param uri is the full URL
* @param method usual fetch methods such as 'GET', 'POST', etc.
* @param callback this is an optional callback function that can be used
* in a different context to get the response and manage it
* in a custom manner
* @returns
*/
const fetchData = (uri, method, callback) => __awaiter(void 0, void 0, void 0, function* () {
const res = yield egeriaFetch(uri, method, Object.assign({}, authHeader()), {});
const data = yield res.json();
Expand Down
3 changes: 3 additions & 0 deletions dist/esm/api/routes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* CONSTANTS used for API URLs
*/
const API_ASSETS_SEARCH_PATH = '/api/assets/search';
const API_ASSETS_TYPES_PATH = '/api/assets/types';
export { API_ASSETS_SEARCH_PATH, API_ASSETS_TYPES_PATH };
3 changes: 3 additions & 0 deletions dist/esm/commons/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* CONSTANTS used through the entire application.
*/
const QUERY_MIN_LENGTH = 3;
const TYPES_MIN_SELECTED = 1;
const PAGE_SIZE_INCREASE_VALUE = 25;
Expand Down
12 changes: 12 additions & 0 deletions dist/esm/commons/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { PAGE_SIZE_INCREASE_VALUE } from './constants';
/**
*
* @param formData should contain all the query params from the URL
* @returns an array of query params prepared to be concatenated in order to
* form a valid URL path
*/
const getQueryParamsPath = (formData) => {
const { q, exactMatch, caseSensitive, types, pageSize } = formData;
let queryParams = [];
Expand All @@ -13,6 +19,12 @@ const getQueryParamsPath = (formData) => {
queryParams.push(`pageSize=${pageSize}`);
return queryParams;
};
/**
*
* @param searchParams react-router-dom object that contains and object with all
* query params
* @returns a new object with validated query params input for Asset Catalog
*/
const getQueryParams = (searchParams) => {
var _a;
return {
Expand Down
3 changes: 3 additions & 0 deletions dist/esm/commons/paths.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/**
* CONSTANTS used for main application paths (deep linking).
*/
const ASSET_CATALOG_PATH = '/assets/catalog';
export { ASSET_CATALOG_PATH };
11 changes: 11 additions & 0 deletions dist/types/api/assets/search/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
import { formData } from '../../../types/formData';
/**
*
* @param formData should contain all the query params from the URL
* @param apiUrl is an optional parameter but it is used if API is deployed
* in a different location
* @returns empty array if conditions aren't met otherwise it will fetch data
* from the API
*
* This function is used to fetch data for Asset Catalog.
*
*/
declare const fetchRawData: (formData: formData, apiUrl?: string) => Promise<any>;
export { fetchRawData };
7 changes: 7 additions & 0 deletions dist/types/api/assets/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* @param apiUrl is an optional parameter but it is used if API is deployed
* in a different location
*
* This function is used to fetch Asset Types.
*
*/
declare const fetchTypes: (apiUrl?: string) => Promise<any>;
export { fetchTypes };
3 changes: 3 additions & 0 deletions dist/types/api/routes.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* CONSTANTS used for API URLs
*/
declare const API_ASSETS_SEARCH_PATH = "/api/assets/search";
declare const API_ASSETS_TYPES_PATH = "/api/assets/types";
export { API_ASSETS_SEARCH_PATH, API_ASSETS_TYPES_PATH };
3 changes: 3 additions & 0 deletions dist/types/commons/constants.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* CONSTANTS used through the entire application.
*/
declare const QUERY_MIN_LENGTH = 3;
declare const TYPES_MIN_SELECTED = 1;
declare const PAGE_SIZE_INCREASE_VALUE = 25;
Expand Down
12 changes: 12 additions & 0 deletions dist/types/commons/helpers.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { formData } from '../types/formData';
/**
*
* @param formData should contain all the query params from the URL
* @returns an array of query params prepared to be concatenated in order to
* form a valid URL path
*/
declare const getQueryParamsPath: (formData: formData) => any;
/**
*
* @param searchParams react-router-dom object that contains and object with all
* query params
* @returns a new object with validated query params input for Asset Catalog
*/
declare const getQueryParams: (searchParams: any) => {
q: any;
types: any;
Expand Down
3 changes: 3 additions & 0 deletions dist/types/commons/paths.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/**
* CONSTANTS used for main application paths (deep linking).
*/
declare const ASSET_CATALOG_PATH = "/assets/catalog";
export { ASSET_CATALOG_PATH };
4 changes: 4 additions & 0 deletions dist/types/types/formData.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Interface used for the Asset Catalog form.
* It's describing the attributes types used.
*/
interface formData {
caseSensitive: boolean;
exactMatch: boolean;
Expand Down

0 comments on commit 7db03cf

Please sign in to comment.