# Features — theear_transcode

Evidence date: 2026-10-01.

Source: `git@bitbucket.org:overdrive/theear_transcode.git`, `master` at `fda49df` (2022-05-04).

"Current" means present in the active `serverless.yml` for that region. "Unwired" means the source is on `master` and is not a function in the current template. There is no issue tracker or features list in the source repository.

## Current (wired)

| Feature | Where | Since |
|---|---|---|
| Elastic Transcoder job for `.mxf` uploaded to `the-ear-prod-transcode` | `region_ireland/transcode_process.js`, function `transcode_process` | Regional split `8fdb690` (2022-05-04). Job creation existed in the single-tree `transcode.js` from `6a52440` / `ace0778` |
| MP4 Generic 1080p, HLS v3 at 2 Mb/s, 1 Mb/s, and 600 kb/s, playlist, thumbnails, 2-second segments | Same file, `Outputs` and `Playlists` | Same |
| MySQL `resources` insert when a known object is created in `the-ear-prod-resources` | `region_south_africa/transcode.js`, function `transcode` | `8fdb690` |
| Catalog types `m3u8`, `mxf`, `pdf`, `midi`, `png`, `mp3`, `mp4` with `duration` `"0"` | Same file | `8fdb690`. `mp4` is only on this South Africa handler |
| HTTP backfill `GET /sort_files` against `the-ear-staging-resources`, insert if `name`+`type` is missing | `region_south_africa/sort_files.js` | `8fdb690` |
| `POST /create` notes item in DynamoDB, IAM authorizer, CORS | `region_*/create.js` | Starter, `6a52440`. Still declared on both current services |
| API Gateway default 4XX and 5XX CORS headers | `region_*/resources/api-gateway-errors.yml` | Starter. Still included |
| South Africa VPC, MySQL env, DynamoDB env `tableName: loging` | `region_south_africa/serverless.yml` | Production form in `8fdb690`. An earlier `dev` form is under `archived/old/serverless.yml` |
| Individual Webpack packages via `serverless-bundle` | Both `serverless.yml`, `package.json` | Starter |

## Current source, not wired to a function

| Feature | Where | Notes |
|---|---|---|
| Second job creator using `Records[0]` and URI-decoded keys | `region_ireland/index.js` | Exports `handler`, not `main` |
| Cross-region copy of one key from `the-ear-prod-transcode` to `the-ear-prod-resources` | `region_ireland/lambda_move_transcode_to_resources.js` | No Serverless event |
| Job plus MySQL insert, AWS region hardcoded `af-south-1`, pipeline `1635987395753-iukgee` | `region_ireland/transcode.js` | Not listed under Ireland `functions` |
| Ireland copies of `sort_files.js` and `global.js` | `region_ireland/` | Same bytes as South Africa. Not in the Ireland template |
| Staging transcode job, pipeline `1634634986727-4ij4ha`, SQL commented out | `region_south_africa/transcode_process.js` | Function block commented in `serverless.yml` |
| Previous catalog implementation | `region_south_africa/transcode_old.js` | Not a handler entry |
| Log S3 content type; unused signed JPEG upload URL | `region_south_africa/upload.js` | Not in `serverless.yml`. `UploadBucket` is not defined |
| Generic SQL `s` / `u` / `i` builder and DynamoDB query log | `global.js`, `logging.js` | Not in either `functions` map |
| Starter `hello` | `handler.js` | Not in `functions`. Jest test archived |
| Empty image helper | `libs/images-lib.js` | 0 lines |
| DynamoDB promise wrapper | `libs/dynamodb-lib.js` | Not imported by active handlers. `create.js` and `logging.js` construct their own client |
| S3 copy IAM for transcode to resources, and resources to video-upload | `policy/*.json` | Not referenced by Serverless |
| Static Bootstrap table "Saskia Test" | `test.html` | Fetches jsonplaceholder. No Serverless route |
| Permission and user HTTP mocks | `region_*/mocks/*.json` | Not loaded by handlers |

## Completed historical

These were replaced or relocated. They are not what the current templates deploy.

| Feature | Evidence |
|---|---|
| Single-tree service before the regional split | Commits `6a52440` and `ace0778`. Root `transcode.js` removed in `8fdb690` |
| Stage `dev`, profile `unity`, bucket `the-ear-transcode-video`, service `theear-transcode` | `region_ireland/archived/old/serverless.yml` |
| Service `theear-resources`, stage `dev`, region `eu-west-1`, bucket `the-ear-resources`, profile `unity` | `region_ireland/archived/old2/serverless.yml` |
| `updateuser.js` | Moved to `archived/old/updateuser.js` in `ace0778`, still only under `archived/` |
| Empty `generic_transcode.js` | `archived/old/generic_transcode.js` |
| Jest test of `hello` on the active tree | Moved to `archived/tests/handler.test.js` in `fda49df` |
| Root `README.md` as a one-line file, then overwritten with the starter guide | `6a52440` added a one-line README. `ace0778` replaced it. Current README is the starter guide |

`fda49df` only moved files under `archived/`. It did not change handler behaviour.

## Planned

No roadmap, ticket, or TODO file exists.

Commented code shows work that was started and left inactive. That is not a commitment to build it:

- AES-128 HLS in the job definitions.
- Copy of `.m3u8` objects to `the-ear-prod-video-upload`.
- South Africa `transcode_process` on `the-ear-staging-transcode`.
- Ireland VPC.
- MySQL insert inside `region_south_africa/transcode_process.js` (the statements are commented).

## In development

Nothing. `master` is the only branch. The last commit is 2022-05-04.

## Recently changed

Relative to the 2021 single tree, the 2022-05-04 split (`8fdb690`) is the last behaviour change:

- Production service names `the-ear-production-transcode` and `theear-resources`.
- Regions `eu-west-1` and `af-south-1`.
- Profile `theear_prod`, stage `production`.
- Ireland trigger bucket `the-ear-prod-transcode`. South Africa trigger bucket `the-ear-prod-resources`.
- Catalog handler stopped calling Elastic Transcoder (the client construction is commented in `region_south_africa/transcode.js`).
- Added `sort_files`, `upload.js`, `index.js`, the copy Lambda, the two policy documents, and `test.html`.

## Deprecated or removed

| Item | Status |
|---|---|
| Deploying from the repository root | Removed. Services live under the two region directories |
| Profile `unity` and stage `dev` in the active templates | Replaced. Still visible under `archived/` |
| Bucket `the-ear-transcode-video` as the active trigger | Archived template only |
| Active Jest test path | File moved under `archived/tests/`. `npm test` still runs `serverless-bundle test` |
| `updateuser.js` on the active path | Archived only |

## Not features of this repository

- Playback, user accounts, and permissions. The mocks describe those requests for some other API. No handler implements them.
- SonarQube. No `sonar-project.properties` in git.
- A scheduled job or queue consumer.
