diff --git a/apps/api/package.json b/apps/api/package.json index fea72178..d319392b 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -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", diff --git a/apps/api/src/routes/v1/rest/calendar/+endpoint.ts b/apps/api/src/routes/v1/rest/calendar/+endpoint.ts index f6283295..e4657b34 100644 --- a/apps/api/src/routes/v1/rest/calendar/+endpoint.ts +++ b/apps/api/src/routes/v1/rest/calendar/+endpoint.ts @@ -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"; diff --git a/apps/api/src/routes/v1/rest/websoc/+endpoint.ts b/apps/api/src/routes/v1/rest/websoc/+endpoint.ts index 52294698..9cfda5be 100644 --- a/apps/api/src/routes/v1/rest/websoc/+endpoint.ts +++ b/apps/api/src/routes/v1/rest/websoc/+endpoint.ts @@ -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, diff --git a/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts b/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts index c142abbc..30ba7fbb 100644 --- a/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts +++ b/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts @@ -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"; /** diff --git a/apps/api/src/routes/v1/rest/websoc/lib.ts b/apps/api/src/routes/v1/rest/websoc/lib.ts index f5bb4db1..b15c3cda 100644 --- a/apps/api/src/routes/v1/rest/websoc/lib.ts +++ b/apps/api/src/routes/v1/rest/websoc/lib.ts @@ -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"; diff --git a/packages/uci-api/package.json b/libs/uc-irvine-api/package.json similarity index 95% rename from packages/uci-api/package.json rename to libs/uc-irvine-api/package.json index 6fa0c91b..83df8fd6 100644 --- a/packages/uci-api/package.json +++ b/libs/uc-irvine-api/package.json @@ -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", @@ -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", diff --git a/packages/uci-api/src/registrar/index.ts b/libs/uc-irvine-api/src/registrar/index.ts similarity index 100% rename from packages/uci-api/src/registrar/index.ts rename to libs/uc-irvine-api/src/registrar/index.ts diff --git a/packages/uci-api/src/websoc/index.ts b/libs/uc-irvine-api/src/websoc/index.ts similarity index 100% rename from packages/uci-api/src/websoc/index.ts rename to libs/uc-irvine-api/src/websoc/index.ts diff --git a/packages/uci-api/tsconfig.json b/libs/uc-irvine-api/tsconfig.json similarity index 100% rename from packages/uci-api/tsconfig.json rename to libs/uc-irvine-api/tsconfig.json diff --git a/libs/websoc-utils/package.json b/libs/websoc-utils/package.json index 8473ef46..9d414cc9 100644 --- a/libs/websoc-utils/package.json +++ b/libs/websoc-utils/package.json @@ -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:^" } } diff --git a/libs/websoc-utils/src/index.ts b/libs/websoc-utils/src/index.ts index b96dc0b0..2b4bc2f7 100644 --- a/libs/websoc-utils/src/index.ts +++ b/libs/websoc-utils/src/index.ts @@ -1,3 +1,11 @@ +import type { + WebsocAPIResponse, + WebsocCourse, + WebsocDepartment, + WebsocSchool, + WebsocSection, + WebsocSectionMeeting, +} from "@libs/uc-irvine-api/websoc"; import type { DayOfWeek, WebsocAPIResponse as NormalizedResponse, @@ -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; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 44242fd7..4af494d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,6 +92,9 @@ importers: '@libs/lambda': specifier: workspace:^ version: link:../../libs/lambda + '@libs/uc-irvine-api': + specifier: workspace:^ + version: link:../../libs/uc-irvine-api '@libs/websoc-utils': specifier: workspace:^ version: link:../../libs/websoc-utils @@ -101,9 +104,6 @@ importers: '@services/websoc-proxy': specifier: workspace:^ version: link:../../services/websoc-proxy - '@uc-irvine/api': - specifier: workspace:^ - version: link:../../packages/uci-api aws-cdk-lib: specifier: 2.93.0 version: 2.93.0(constructs@10.2.69) @@ -217,25 +217,14 @@ importers: specifier: 8.10.119 version: 8.10.119 - libs/websoc-utils: - dependencies: - '@peterportal-api/types': - specifier: workspace:^ - version: link:../../packages/types - '@uc-irvine/api': - specifier: workspace:^ - version: link:../../packages/uci-api - - packages/types: {} - - packages/uci-api: + libs/uc-irvine-api: dependencies: '@ap0nia/camaro': specifier: 6.2.5 version: 6.2.5 '@peterportal-api/types': specifier: workspace:^ - version: link:../types + version: link:../../packages/types cheerio: specifier: 1.0.0-rc.12 version: 1.0.0-rc.12 @@ -243,6 +232,17 @@ importers: specifier: 4.0.0 version: 4.0.0 + libs/websoc-utils: + dependencies: + '@libs/uc-irvine-api': + specifier: workspace:^ + version: link:../uc-irvine-api + '@peterportal-api/types': + specifier: workspace:^ + version: link:../../packages/types + + packages/types: {} + packages/websoc-fuzzy-search: dependencies: base64-arraybuffer: @@ -276,12 +276,12 @@ importers: '@libs/lambda': specifier: workspace:^ version: link:../../libs/lambda + '@libs/uc-irvine-api': + specifier: workspace:^ + version: link:../../libs/uc-irvine-api '@libs/websoc-utils': specifier: workspace:^ version: link:../../libs/websoc-utils - '@uc-irvine/api': - specifier: workspace:^ - version: link:../../packages/uci-api devDependencies: '@peterportal-api/types': specifier: workspace:^ @@ -301,12 +301,12 @@ importers: '@libs/db': specifier: workspace:^ version: link:../../libs/db + '@libs/uc-irvine-api': + specifier: workspace:^ + version: link:../../libs/uc-irvine-api '@peterportal-api/types': specifier: workspace:^ version: link:../../packages/types - '@uc-irvine/api': - specifier: workspace:^ - version: link:../../packages/uci-api winston: specifier: 3.10.0 version: 3.10.0 @@ -345,9 +345,9 @@ importers: '@libs/lambda': specifier: workspace:^ version: link:../../libs/lambda - '@uc-irvine/api': + '@libs/uc-irvine-api': specifier: workspace:^ - version: link:../../packages/uci-api + version: link:../../libs/uc-irvine-api csv-parse: specifier: 5.5.0 version: 5.5.0 @@ -2938,7 +2938,7 @@ packages: lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@18.17.12)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@20.4.7)(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' @@ -6990,7 +6990,7 @@ packages: dependencies: '@types/node': 20.4.7 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@types/node@18.17.12)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@20.4.7)(typescript@5.2.2) typescript: 5.2.2 dev: true @@ -12735,6 +12735,38 @@ packages: yn: 3.1.1 dev: true + /ts-node@10.9.1(@types/node@20.4.7)(typescript@5.2.2): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + requiresBuild: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.4.7 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.2.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} dependencies: diff --git a/services/websoc-proxy/package.json b/services/websoc-proxy/package.json index debb80d0..1755cb04 100644 --- a/services/websoc-proxy/package.json +++ b/services/websoc-proxy/package.json @@ -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:^", diff --git a/services/websoc-proxy/src/index.ts b/services/websoc-proxy/src/index.ts index 7abad10d..51c9f473 100644 --- a/services/websoc-proxy/src/index.ts +++ b/services/websoc-proxy/src/index.ts @@ -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 ( diff --git a/services/websoc-scraper-v2/index.ts b/services/websoc-scraper-v2/index.ts index 54821f06..989f3f19 100644 --- a/services/websoc-scraper-v2/index.ts +++ b/services/websoc-scraper-v2/index.ts @@ -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, @@ -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"; /** diff --git a/services/websoc-scraper-v2/package.json b/services/websoc-scraper-v2/package.json index 117d5b35..89b623df 100644 --- a/services/websoc-scraper-v2/package.json +++ b/services/websoc-scraper-v2/package.json @@ -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": { diff --git a/tools/grades-updater/package.json b/tools/grades-updater/package.json index 28467ce1..aa343628 100644 --- a/tools/grades-updater/package.json +++ b/tools/grades-updater/package.json @@ -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", diff --git a/tools/grades-updater/src/sanitize-data.ts b/tools/grades-updater/src/sanitize-data.ts index 7e47f0af..cc9278aa 100644 --- a/tools/grades-updater/src/sanitize-data.ts +++ b/tools/grades-updater/src/sanitize-data.ts @@ -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"; diff --git a/tsconfig.json b/tsconfig.json index 178cdd4a..648d3ad0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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/**/*" ] }