Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wk source zips #6

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true

WORKDIR /home/site/wwwroot
ENV PNPM_HOME=/usr/local/bin

COPY ./package.json /home/site/wwwroot
RUN pnpm install
RUN pnpm add --global azure-functions-core-tools@^4.0.5455
COPY . .
# I have no clue why, but when I included azure core tools as part of the controller dependencies using the core tools node package, the func command reliably broke, but not when installed globally
# Enable `pnpm add --global` on Alpine Linux by setting
# home location environment variable to a location already in $PATH
# https://github.com/pnpm/pnpm/issues/784#issuecomment-1518582235



RUN apt-get update && \
Expand All @@ -20,12 +30,6 @@ RUN apt-get update && \


ARG DATABASE_URL
# I have no clue why, but when I included azure core tools as part of the controller dependencies using the core tools node package, the func command reliably broke, but not when installed globally
# Enable `pnpm add --global` on Alpine Linux by setting
# home location environment variable to a location already in $PATH
# https://github.com/pnpm/pnpm/issues/784#issuecomment-1518582235
ENV PNPM_HOME=/usr/local/bin

RUN pnpm add --global azure-functions-core-tools@^4.0.5455
RUN pnpm install && \
pnpm run build

RUN pnpm run build
16 changes: 16 additions & 0 deletions controller/drizzle/0021_first_ink.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE OR REPLACE VIEW source_zips AS
SELECT c.*, CONCAT(g.repo_url, '/archive/master.zip') AS zip_url, COUNT(DISTINCT srm.book_slug) AS unique_book_slugs_count,
m.show_on_biel, m.status AS meta_status, l.national_name, l.english_name

FROM content c
JOIN rendering r ON r.content_id = c.id
JOIN scriptural_rendering_metadata srm ON srm.rendering_id = r.id
JOIN git_repo g ON g.id = c.git_id
JOIN wa_content_meta m ON m.content_id = c.id
JOIN language l on c.language_id = l.ietf_code
WHERE c.domain = 'scripture'
AND m.show_on_biel = false
AND m.status = 'Active'
AND c.git_id IS NOT NULL
GROUP BY c.id, CONCAT(g.repo_url, '/archive/master.zip'), m.id, l.national_name, l.english_name
HAVING COUNT(DISTINCT srm.book_slug) > 26
12 changes: 12 additions & 0 deletions controller/drizzle/0022_stiff_raider.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS "localization" (
"ietf_code" varchar NOT NULL,
"key" varchar NOT NULL,
"value" text NOT NULL,
CONSTRAINT "localization_pkey" PRIMARY KEY("ietf_code","key")
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "localization" ADD CONSTRAINT "localization_ietf_code_language_ietf_code_fk" FOREIGN KEY ("ietf_code") REFERENCES "language"("ietf_code") ON DELETE cascade ON UPDATE cascade;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
5 changes: 5 additions & 0 deletions controller/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion controller/src/db/utils/getMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function getMockedContent() {
// scripture" | "gloss" | "parascriptural" | "peripheral
const fakeIdWord = faker.word.words(1);
const mockedContent: apiKeys = {
id: fakeIdWord,
// id: fakeIdWord,
namespace: "wacs",
domain: faker.helpers.arrayElement([
"scripture",
Expand Down
5 changes: 2 additions & 3 deletions controller/src/docs/openApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ registry.registerPath({
// apiValidators.langDelete
request: {
body: {
description: "A list of ietfCodes corresponding to languages to delete",
description: "",
content: {
"applications/json": {
schema: apiValidators.countryDelete,
Expand Down Expand Up @@ -292,8 +292,7 @@ registry.registerPath({
// apiValidators.langDelete
request: {
body: {
description:
"A list of ietfCodes corresponding to languages to delete. Whereas inserts are namespaced, as: namespace-id, the client is expected to namespace (lowered, trimmed) to delete its ids",
description: "",
content: {
"applications/json": {
schema: apiValidators.contentDelete,
Expand Down
118 changes: 61 additions & 57 deletions controller/src/docs/open_api_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"parameters": [
{
"description": "A list of ietfCodes corresponding to languages to delete. Whereas inserts are namespaced, as: namespace-id, the client is expected to namespace (lowered, trimmed) to delete its ids",
"description": "",
"in": "body",
"name": "body",
"schema": {
Expand Down Expand Up @@ -198,7 +198,7 @@
],
"parameters": [
{
"description": "A list of ietfCodes corresponding to languages to delete",
"description": "",
"in": "body",
"name": "body",
"schema": {
Expand Down Expand Up @@ -1007,25 +1007,24 @@
"content": {
"example": [
{
"createdOn": "2024-09-07T16:34:28.186Z",
"createdOn": "2025-03-24T21:09:44.194Z",
"domain": "peripheral",
"gitEntry": {
"namespace": "wacs",
"repoName": "violet",
"repoUrl": "https://blind-committee.name/",
"username": "Christ_Kozey82"
"repoName": "clipper",
"repoUrl": "https://knotty-headquarters.net/",
"username": "Ebba_Morissette"
},
"id": "yowza",
"languageId": "urs",
"languageId": "kht",
"level": "medium",
"meta": {
"showOnBiel": true,
"showOnBiel": false,
"status": "not approved"
},
"modifiedOn": "2024-02-10T08:11:54.917Z",
"name": "notes",
"modifiedOn": "2025-03-28T14:29:04.763Z",
"name": "ulb",
"namespace": "wacs",
"resourceType": "reg",
"resourceType": "tq",
"type": "text"
}
],
Expand Down Expand Up @@ -1133,13 +1132,13 @@
"country": {
"example": [
{
"alpha2": "BM",
"alpha3": "BRN",
"createdOn": "2023-05-24T02:59:32.846Z",
"modifiedOn": "2024-04-15T06:49:17.349Z",
"name": "Switzerland",
"population": 1712482197,
"regionName": "Asia"
"alpha2": "BN",
"alpha3": "CRI",
"createdOn": "2023-12-13T01:16:56.564Z",
"modifiedOn": "2023-08-19T09:35:29.012Z",
"name": "Samoa",
"population": 461394755,
"regionName": "Austrailia"
}
],
"items": {
Expand Down Expand Up @@ -1186,9 +1185,9 @@
"example": [
{
"contentId": "wacs-user-repo",
"repoName": "yuck",
"repoUrl": "https://confused-plaintiff.info",
"username": "Deborah34"
"repoName": "readily",
"repoUrl": "https://gummy-waveform.biz/",
"username": "Esta_Bayer"
}
],
"items": {
Expand Down Expand Up @@ -1222,22 +1221,27 @@
"language": {
"example": [
{
"allCountryAlpha2": [],
"allCountryAlpha2": [
"SS",
"CR"
],
"alternateNames": [
"flaky"
"inside",
"consequently",
"offbeat"
],
"createdOn": "2024-10-15T14:47:18.418Z",
"direction": "rtl",
"englishName": "finally",
"homeCountryAlpha2": "GQ",
"id": "WVpTRyrzAg",
"ietfCode": "rrj",
"isOralLanguage": false,
"iso6393": "cspejjbojt",
"nationalName": "leak",
"createdOn": "2025-03-12T15:30:57.764Z",
"direction": "ltr",
"englishName": "unless",
"homeCountryAlpha2": "LA",
"id": "fqcyKyFEoH",
"ietfCode": "ats",
"isOralLanguage": true,
"iso6393": "nwhornsr",
"nationalName": "wisdom",
"waLangMeta": {
"isGateway": false,
"showOnBiel": true
"isGateway": true,
"showOnBiel": false
}
}
],
Expand Down Expand Up @@ -1342,9 +1346,9 @@
"region": {
"example": [
{
"createdOn": "2023-05-17T02:58:14.426Z",
"modifiedOn": "2024-12-20T05:48:25.914Z",
"name": "Asia"
"createdOn": "2023-07-27T23:47:58.068Z",
"modifiedOn": "2025-01-20T19:09:33.551Z",
"name": "Africa"
}
],
"items": {
Expand Down Expand Up @@ -1376,46 +1380,46 @@
[
{
"contentId": "user-repo",
"createdAt": "2023-11-06T13:25:33.395Z",
"fileSizeBytes": 1344618048258048,
"fileType": "zip",
"modifiedOn": "2025-01-20T10:22:31.513Z",
"createdAt": "2024-01-25T13:36:54.975Z",
"fileSizeBytes": 7289338714914816,
"fileType": "mp3",
"modifiedOn": "2023-08-09T17:50:58.948Z",
"namespace": "wacs",
"scripturalMeta": {
"bookName": "1 Jean",
"bookSlug": "1JN",
"chapter": 0,
"chapter": 1,
"isWholeBook": true,
"isWholeProject": false,
"tempId": "8419730d-55ac-463c-9bea-a42565eb746c"
"tempId": "yxznk9pe8qq53w5g97yiken1"
},
"tempId": "8419730d-55ac-463c-9bea-a42565eb746c",
"url": "https://imperturbable-bog.info/"
"tempId": "yxznk9pe8qq53w5g97yiken1",
"url": "https://embarrassed-frog.info"
}
],
[
{
"contentId": "user-repo",
"createdAt": "2023-05-14T14:55:35.579Z",
"fileSizeBytes": 4763748757667840,
"fileType": "web",
"modifiedOn": "2023-09-16T18:28:07.168Z",
"createdAt": "2024-12-14T00:21:21.892Z",
"fileSizeBytes": 2049820787212288,
"fileType": "zip",
"modifiedOn": "2023-12-23T20:12:25.204Z",
"namespace": "wacs",
"nonScripturalMeta": {
"additionalData": "A json field",
"name": "nonScripturalName",
"tempId": "6c0a0baf-268e-4c4c-803a-48c0bf665fca"
"tempId": "n9bei7lcw4ey9gvcnu51rcrb"
},
"scripturalMeta": {
"bookName": "1 Jean",
"bookSlug": "1JN",
"chapter": 2,
"isWholeBook": true,
"isWholeProject": true,
"tempId": "6c0a0baf-268e-4c4c-803a-48c0bf665fca"
"chapter": 4,
"isWholeBook": false,
"isWholeProject": false,
"tempId": "n9bei7lcw4ey9gvcnu51rcrb"
},
"tempId": "6c0a0baf-268e-4c4c-803a-48c0bf665fca",
"url": "https://demanding-frenzy.org/"
"tempId": "n9bei7lcw4ey9gvcnu51rcrb",
"url": "https://creative-identity.net/"
}
]
],
Expand Down
2 changes: 1 addition & 1 deletion controller/src/docs/open_api_v3.json

Large diffs are not rendered by default.

Loading