Skip to content

Commit

Permalink
Rename providers to services
Browse files Browse the repository at this point in the history
  • Loading branch information
Redm4x committed Jan 30, 2024
1 parent 3911ca6 commit 28f5d6a
Show file tree
Hide file tree
Showing 44 changed files with 44 additions and 44 deletions.
6 changes: 3 additions & 3 deletions api/src/routers/userRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getUserByUsername,
checkUsernameAvailable,
subscribeToNewsletter
} from "@src/providers/userDataProvider";
} from "@src/services/db/userDataService";
import { isValidBech32Address } from "@src/utils/addresses";
import * as uuid from "uuid";
import {
Expand All @@ -19,8 +19,8 @@ import {
saveTemplateDesc,
removeTemplateFavorite,
addTemplateFavorite
} from "@src/db/templateProvider";
import { getBillingPortalUrl, getCheckoutUrl } from "@src/providers/stripeProvider";
} from "@src/services/db/templateService";
import { getBillingPortalUrl, getCheckoutUrl } from "@src/services/external/stripeService";
import { Hono } from "hono";
import { getCurrentUserId, optionalUserMiddleware, requiredUserMiddleware } from "@src/middlewares/userMiddleware";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routers/web3indexRouter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getWeb3IndexRevenue } from "@src/db/networkRevenueProvider";
import { getWeb3IndexRevenue } from "@src/services/db/networkRevenueService";
import { cacheKeys, cacheResponse } from "@src/caching/helpers";
import { Hono } from "hono";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/addresses/address.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getAddressBalance } from "@src/providers/apiNodeProvider";
import { getAddressBalance } from "@src/services/external/apiNodeService";
import { isValidBech32Address } from "@src/utils/addresses";
import { openApiExampleAddress } from "@src/utils/constants";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/addresses/deployments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getAddressDeployments } from "@src/providers/apiNodeProvider";
import { getAddressDeployments } from "@src/services/external/apiNodeService";
import { openApiExampleAddress } from "@src/utils/constants";

const route = createRoute({
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/addresses/transactions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getTransactionByAddress } from "@src/db/transactionsProvider";
import { getTransactionByAddress } from "@src/services/db/transactionsService";
import { isValidBech32Address } from "@src/utils/addresses";
import { openApiExampleAddress } from "@src/utils/constants";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/auditors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getAuditors } from "@src/providers/githubProvider";
import { getAuditors } from "@src/services/external/githubService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/blocks/byHeight.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getBlock } from "@src/db/blocksProvider";
import { getBlock } from "@src/services/db/blocksService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/blocks/list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getBlocks } from "@src/db/blocksProvider";
import { getBlocks } from "@src/services/db/blocksService";

const defaultLimit = 20;

Expand Down
10 changes: 5 additions & 5 deletions api/src/routes/v1/dashboardData.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getBlocks } from "@src/db/blocksProvider";
import { getDashboardData, getProviderGraphData } from "@src/db/statsProvider";
import { getTransactions } from "@src/db/transactionsProvider";
import { getChainStats } from "@src/providers/apiNodeProvider";
import { getNetworkCapacity } from "@src/providers/providerStatusProvider";
import { getBlocks } from "@src/services/db/blocksService";
import { getDashboardData, getProviderGraphData } from "@src/services/db/statsService";
import { getTransactions } from "@src/services/db/transactionsService";
import { getChainStats } from "@src/services/external/apiNodeService";
import { getNetworkCapacity } from "@src/services/db/providerStatusService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/deployments/byOwnerDseq.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getDeployment } from "@src/providers/apiNodeProvider";
import { getDeployment } from "@src/services/external/apiNodeService";
import { isValidBech32Address } from "@src/utils/addresses";
import { openApiExampleAddress } from "@src/utils/constants";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/graphData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getGraphData } from "@src/db/statsProvider";
import { getGraphData } from "@src/services/db/statsService";

const authorizedDataNames = [
"dailyUAktSpent",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/marketData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { cacheKeys, cacheResponse } from "@src/caching/helpers";
import { getMarketData } from "@src/providers/marketDataProvider";
import { getMarketData } from "@src/services/external/marketDataService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/networkCapacity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getNetworkCapacity } from "@src/providers/providerStatusProvider";
import { getNetworkCapacity } from "@src/services/db/providerStatusService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/predictedBlockDate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
import { getPredictedBlockDate } from "@src/db/blocksProvider";
import { getPredictedBlockDate } from "@src/services/db/blocksService";
import { z } from "zod";

const defaultBlockWindow = 10_000;
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/predictedDateHeight.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
import { getPredictedDateHeight } from "@src/db/blocksProvider";
import { getPredictedDateHeight } from "@src/services/db/blocksService";
import { z } from "zod";

const defaultBlockWindow = 10_000;
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/proposals/byId.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProposal } from "@src/providers/apiNodeProvider";
import { getProposal } from "@src/services/external/apiNodeService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/proposals/list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProposals } from "@src/providers/apiNodeProvider";
import { getProposals } from "@src/services/external/apiNodeService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providerActiveLeasesGraphData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProviderActiveLeasesGraphData } from "@src/db/statsProvider";
import { getProviderActiveLeasesGraphData } from "@src/services/db/statsService";
import { isValidBech32Address } from "@src/utils/addresses";
import { openApiExampleProviderAddress } from "@src/utils/constants";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providerAttributesSchema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProviderAttributesSchema } from "@src/providers/githubProvider";
import { getProviderAttributesSchema } from "@src/services/external/githubService";

const attributeSChemaType = z.object({
key: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providerGraphData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProviderGraphData } from "@src/db/statsProvider";
import { getProviderGraphData } from "@src/services/db/statsService";
import { ProviderStatsKey } from "@src/types";

const authorizedDataNames = ["count", "cpu", "gpu", "memory", "storage"];
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providerRegions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { cacheKeys, cacheResponse } from "@src/caching/helpers";
import { getProviderRegions } from "@src/db/providerDataProvider";
import { getProviderRegions } from "@src/services/db/providerDataService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providers/byAddress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProviderDetail } from "@src/providers/providerStatusProvider";
import { getProviderDetail } from "@src/services/db/providerStatusService";
import { openApiExampleProviderAddress } from "@src/utils/constants";

const route = createRoute({
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providers/deployments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getProviderDeployments, getProviderDeploymentsCount } from "@src/db/deploymentProvider";
import { getProviderDeployments, getProviderDeploymentsCount } from "@src/services/db/deploymentService";
import { openApiExampleProviderAddress } from "@src/utils/constants";

const route = createRoute({
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/providers/list.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { cacheKeys, cacheResponse } from "@src/caching/helpers";
import { getProviderList } from "@src/providers/providerStatusProvider";
import { getProviderList } from "@src/services/db/providerStatusService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/templates.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { cacheKeys, cacheResponse } from "@src/caching/helpers";
import { getTemplateGallery } from "@src/providers/templateReposProvider";
import { getTemplateGallery } from "@src/services/external/templateReposService";

const route = createRoute({
method: "get",
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/transactions/byHash.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getTransaction } from "@src/db/transactionsProvider";
import { getTransaction } from "@src/services/db/transactionsService";
import { openApiExampleTransactionHash } from "@src/utils/constants";

const route = createRoute({
Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/transactions/list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getTransactions } from "@src/db/transactionsProvider";
import { getTransactions } from "@src/services/db/transactionsService";

const defaultLimit = 20;

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/validators/byAddress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getValidator } from "@src/providers/apiNodeProvider";
import { getValidator } from "@src/services/external/apiNodeService";
import { isValidBech32Address } from "@src/utils/addresses";
import { openApiExampleValidatorAddress } from "@src/utils/constants";

Expand Down
2 changes: 1 addition & 1 deletion api/src/routes/v1/validators/list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { getValidators } from "@src/providers/apiNodeProvider";
import { getValidators } from "@src/services/external/apiNodeService";

const route = createRoute({
method: "get",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Provider, ProviderAttribute } from "@shared/dbSchemas/akash";
import { getProviderAttributesSchema } from "@src/providers/githubProvider";
import { getProviderAttributesSchema } from "@src/services/external/githubService";

export async function getProviderRegions() {
const providerAttributesSchema = await getProviderAttributesSchema();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { toUTC } from "@src/utils/date";
import { add } from "date-fns";
import { Op } from "sequelize";
import { mapProviderToList } from "@src/utils/map/provider";
import { getAuditors, getProviderAttributesSchema } from "./githubProvider";
import { getAuditors, getProviderAttributesSchema } from "../external/githubService";
import { ProviderDetail } from "@src/types/provider";

export async function getNetworkCapacity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Day } from "@shared/dbSchemas/base";
import { AkashBlock as Block } from "@shared/dbSchemas/akash";
import { subHours } from "date-fns";
import { Op, QueryTypes } from "sequelize";
import { chainDb } from "./dbConnection";
import { chainDb } from "@src/db/dbConnection";
import { ProviderActiveLeasesStats, ProviderStats, ProviderStatsKey } from "@src/types/graph";
import { cacheKeys, cacheResponse } from "@src/caching/helpers";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Transaction, AddressReference } from "@shared/dbSchemas/base";
import { AkashBlock as Block, AkashMessage as Message } from "@shared/dbSchemas/akash";
import { msgToJSON } from "@src/utils/protobuf";
import { QueryTypes } from "sequelize";
import { chainDb } from "./dbConnection";
import { chainDb } from "@src/db/dbConnection";

export async function getTransactions(limit: number) {
const _limit = Math.min(limit, 100);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UserAddressName, UserSetting } from "@shared/dbSchemas/user";
import { Transaction } from "sequelize/types";
import { getUserPlan } from "./stripeProvider";
import { getUserPlan } from "../external/stripeService";

function randomIntFromInterval(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1) + min);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fetch from "node-fetch";
import { getDeploymentRelatedMessages } from "../db/deploymentProvider";
import { getDeploymentRelatedMessages } from "../db/deploymentService";
import { averageBlockCountInAMonth } from "@src/utils/constants";
import { coinToAsset } from "@src/utils/coin";
import { getTransactionByAddress } from "@src/db/transactionsProvider";
import { getTransactionByAddress } from "@src/services/db/transactionsService";
import axios from "axios";
import { Validator } from "@shared/dbSchemas/base";
import { Op } from "sequelize";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import fetch from "node-fetch";
import { markdownToTxt } from "markdown-to-txt";
import path from "path";
import { getOctokit } from "./githubProvider";
import { getOctokit } from "./githubService";
import { isUrlAbsolute } from "@src/utils/urls";
import * as fs from "fs";
import { Octokit } from "@octokit/rest";
import { getLogoFromPath } from "./templateReposLogos";
import { dataFolderPath } from "@src/utils/constants";
import { GithubChainRegistryAssetListResponse } from "@src/types";
import { GithubDirectoryItem } from "@src/types/github";
import { getLogoFromPath } from "@src/utils/templateReposLogos";

const generatingTasks = {};
let lastServedData = null;
Expand Down
File renamed without changes.

0 comments on commit 28f5d6a

Please sign in to comment.