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

Commit

Permalink
chore: 🔧 move uc-irvine-api
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0nia committed Sep 8, 2023
1 parent 4161dc0 commit f9574ba
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 64 deletions.
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"@aws-sdk/client-lambda": "3.398.0",
"@libs/db": "workspace:^",
"@libs/lambda": "workspace:^",
"@libs/uc-irvine-api": "workspace:^",
"@libs/websoc-utils": "workspace:^",
"@peterportal-api/types": "workspace:^",
"@services/websoc-proxy": "workspace:^",
"@uc-irvine/api": "workspace:^",
"aws-cdk-lib": "2.93.0",
"cheerio": "1.0.0-rc.12",
"cross-fetch": "4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/v1/rest/calendar/+endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PrismaClient } from "@libs/db";
import { createOKResult, createErrorResult } from "@libs/lambda";
import { getTermDateData } from "@libs/uc-irvine-api/registrar";
import type { Quarter, QuarterDates } from "@peterportal-api/types";
import { getTermDateData } from "@uc-irvine/api/registrar";
import type { APIGatewayProxyHandler } from "aws-lambda";
import { ZodError } from "zod";

Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/v1/rest/websoc/+endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ApiPropsOverride } from "@bronya.js/api-construct";
import { PrismaClient } from "@libs/db";
import { createErrorResult, createOKResult } from "@libs/lambda";
import type { WebsocAPIResponse } from "@libs/uc-irvine-api/websoc";
import { combineAndNormalizeResponses, notNull, sortResponse } from "@libs/websoc-utils";
import type { WebsocAPIResponse } from "@uc-irvine/api/websoc";
import {
Effect,
ManagedPolicy,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InvokeCommand, LambdaClient, LambdaClientConfig } from "@aws-sdk/client-lambda";
import { zeroUUID } from "@libs/lambda";
import type { WebsocAPIResponse } from "@libs/uc-irvine-api/websoc";
import type { Department, TermData } from "@peterportal-api/types";
import type { WebsocAPIResponse } from "@uc-irvine/api/websoc";
import type { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from "aws-lambda";

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/v1/rest/websoc/lib.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Prisma } from "@libs/db";
import { WebsocAPIOptions } from "@uc-irvine/api/websoc";
import { WebsocAPIOptions } from "@libs/uc-irvine-api/websoc";

import type { Query } from "./schema";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@uc-irvine/api",
"name": "@libs/uc-irvine-api",
"version": "0.10.8",
"private": true,
"description": "SDK for various UC Irvine services",
Expand All @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"url": "https://github.com/icssc/peterportal-api-next",
"directory": "packages/uci-api"
"directory": "libs/uc-irvine-api"
},
"license": "MIT",
"type": "module",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions libs/websoc-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "src/index.ts",
"types": "src/index.ts",
"dependencies": {
"@peterportal-api/types": "workspace:^",
"@uc-irvine/api": "workspace:^"
"@libs/uc-irvine-api": "workspace:^",
"@peterportal-api/types": "workspace:^"
}
}
16 changes: 8 additions & 8 deletions libs/websoc-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import type {
WebsocAPIResponse,
WebsocCourse,
WebsocDepartment,
WebsocSchool,
WebsocSection,
WebsocSectionMeeting,
} from "@libs/uc-irvine-api/websoc";
import type {
DayOfWeek,
WebsocAPIResponse as NormalizedResponse,
Expand All @@ -8,14 +16,6 @@ import type {
WebsocSection as NormalizedSection,
WebsocSectionMeeting as NormalizedMeeting,
} from "@peterportal-api/types";
import type {
WebsocAPIResponse,
WebsocCourse,
WebsocDepartment,
WebsocSchool,
WebsocSection,
WebsocSectionMeeting,
} from "@uc-irvine/api/websoc";

export type EnhancedSection = {
school: WebsocSchool;
Expand Down
84 changes: 58 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions services/websoc-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"dependencies": {
"@libs/lambda": "workspace:^",
"@libs/websoc-utils": "workspace:^",
"@uc-irvine/api": "workspace:^"
"@libs/uc-irvine-api": "workspace:^",
"@libs/websoc-utils": "workspace:^"
},
"devDependencies": {
"@peterportal-api/types": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions services/websoc-proxy/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createErrorResult, createOKResult, logger } from "@libs/lambda";
import { callWebSocAPI, getDepts, getTerms } from "@libs/uc-irvine-api/websoc";
import type { WebsocAPIResponse, WebsocAPIOptions } from "@libs/uc-irvine-api/websoc";
import { combineAndNormalizeResponses, fulfilled, sleep, sortResponse } from "@libs/websoc-utils";
import { callWebSocAPI, getDepts, getTerms } from "@uc-irvine/api/websoc";
import type { WebsocAPIResponse, WebsocAPIOptions } from "@uc-irvine/api/websoc";
import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from "aws-lambda";

export const handler = async (
Expand Down
12 changes: 9 additions & 3 deletions services/websoc-scraper-v2/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrismaClient } from "@libs/db";
import { getTermDateData } from "@uc-irvine/api/registrar";
import { getTermDateData } from "@libs/uc-irvine-api/registrar";
import type {
GE,
Quarter,
Expand All @@ -10,8 +10,14 @@ import type {
WebsocSchool,
WebsocSection,
WebsocSectionMeeting,
} from "@uc-irvine/api/websoc";
import { callWebSocAPI, getDepts, getTerms, geCodes, sectionTypes } from "@uc-irvine/api/websoc";
} from "@libs/uc-irvine-api/websoc";
import {
callWebSocAPI,
getDepts,
getTerms,
geCodes,
sectionTypes,
} from "@libs/uc-irvine-api/websoc";
import { createLogger, format, transports } from "winston";

/**
Expand Down
2 changes: 1 addition & 1 deletion services/websoc-scraper-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"@libs/db": "workspace:^",
"@libs/uc-irvine-api": "workspace:^",
"@peterportal-api/types": "workspace:^",
"@uc-irvine/api": "workspace:^",
"winston": "3.10.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tools/grades-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@libs/db": "workspace:^",
"@libs/lambda": "workspace:^",
"@uc-irvine/api": "workspace:^",
"@libs/uc-irvine-api": "workspace:^",
"csv-parse": "5.5.0",
"csv-stringify": "6.4.2",
"winston": "3.10.0",
Expand Down
4 changes: 2 additions & 2 deletions tools/grades-updater/src/sanitize-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import fs from "fs";
import { basename, resolve } from "node:path";
import { EOL } from "os";

import { callWebSocAPI } from "@libs/uc-irvine-api/websoc";
import type { WebsocAPIResponse, WebsocSection } from "@libs/uc-irvine-api/websoc";
import type { Quarter } from "@peterportal-api/types";
import { callWebSocAPI } from "@uc-irvine/api/websoc";
import type { WebsocAPIResponse, WebsocSection } from "@uc-irvine/api/websoc";
import type { CastingContext, Parser } from "csv-parse";
import { parse } from "csv-parse";
import { stringify } from "csv-stringify/sync";
Expand Down
11 changes: 1 addition & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,12 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
},
"include": [
"*.ts",
"api/**/*",
"apps/**/*",
"libs/**/*",
"packages/**/*",
"services/**/*",
"tools/**/*"
],
"include": ["*.ts", "apps/**/*", "libs/**/*", "packages/**/*", "services/**/*", "tools/**/*"],
"exclude": [
"**/build/**/*",
"**/cdk.out/**/*",
"**/dist/**/*",
"**/node_modules/**/*",
"**/*.template.ts",
"apps/docs/**/*"
]
}

0 comments on commit f9574ba

Please sign in to comment.