# Features — ear_lambdas

Evidence date: 2026-10-16.

Source: `git@bitbucket.org:overdrive/ear_lambdas.git`, `master` at `1539c1d` (2023-09-27).

"Current" means present in `master` as a yaml/zip pair. There is no features list, changelog, or issue tracker in the source repository. Nothing has been removed in git history. The only feature added after the first export is `VideoDurationOnPut`.

## Current (in the export)

| Feature | Where | Since |
|---|---|---|
| Daily HTTPS GET of 18 Ear Academy admin paths at `cron(0 6 * * ? *)` | `phpCronEveryDay.yaml`, zip `phpCronEveryDay-151a474c-22fb-4c0e-9995-32a124a6b05a.zip` `index.js` | `cc029a4` (2023-09-14) |
| Hourly HTTPS GET of `/admin/run_cron_hourly`, `GetPayfastDailyTransactions`, and `GenerateInvoices` | `phpCronTrigger.yaml` and its zip | `cc029a4` |
| Invocable GET of `GetPayfastDailyTransactions`. No schedule in the template | `phpCronEveryDay2am.yaml` and its zip | `cc029a4` |
| Invocable GET of `GenerateInvoices` and `SendUserPurchases`. No schedule in the template | `phpCronEveryDay6am.yaml` and its zip | `cc029a4` |
| Invocable GET of `run_ear_cron/SendUserPurchases`. The URL string has a leading space. No schedule in the template. Role ARN is `phpCronEveryDay-role-o7rgabdc` | `phpCronEveryDay8am.yaml` and its zip | `cc029a4` |
| MySQL `resources` insert for `.m3u8`, `.mxf`, `.pdf`, `.mid`, `.png`, `.mp3`, `.mp4` on S3 object create. URL prefix `s3://the-ear-prod-resources/`. `duration` `"0"`. No duplicate check | `theear-resources-production-transcode.yaml`, `transcode.js` in its zip | `cc029a4`. Bundle source map: `region_south_africa/transcode.js` |
| `GET /sort_files` lists `the-ear-staging-resources` and inserts when `name` and `type` are absent. A `.m3u8` key is stored as type `mxf` with URL `s3://the-ear-staging-resources/transcode/{stem}/{file}.m3u8` | `theear-resources-production-sort_files.yaml`, `sort_files.js` | `cc029a4` |
| `POST /create` DynamoDB note (`userId`, `noteId`, `content`, `attachment`, `createdAt`) in table `loging` | `theear-resources-production-create.yaml`, `create.js` | `cc029a4` |
| Serverless custom resource: Lambda permission and existing-bucket notification | `theear-resources-production-custom-resource-existing-s3.yaml`, `s3/handler.js` | `cc029a4` |
| Copy one key from `the-ear-prod-resources` to `the-ear-prod-video-upload` with an `eu-west-1` client. No event in the template | `the-ear-resources-to-upload.yaml` and its zip | `cc029a4` |
| Scheduled HLS duration update for active `m3u8` rows whose duration is `0` or `5`, excluding URLs that contain `ts.m3u8` | `videoDuration.yaml`, `lambda_function.py` | `cc029a4` |
| On-put HLS duration update. Matches `url LIKE '%{key}%'`, type `m3u8`, status `active`. Timeout 3 seconds | `VideoDurationOnPut.yaml` and its zip | `1539c1d` (2023-09-27) |
| SonarQube scan on `master` | `bitbucket-pipelines.yml`, `sonar-project.properties` | `d9921eb`, `731d7c9` (2023-09-13) |

## Packaged but not the handler entry

| Piece | Where | Notes |
|---|---|---|
| Cognito user-pool custom resource | `cognitoUserPool/` inside the custom-resource zip | Not `s3/handler.handler` |
| EventBridge custom resource | `eventBridge/` in the same zip | Not the entry point |
| API Gateway CloudWatch role custom resource | `apiGatewayCloudWatchRole/handler.js` | Not the entry point |
| Copy of the OnPut template | `VideoDurationOnPut.yaml` inside the OnPut zip | Same content role as the root yaml. Not executed |
| Commented Elastic Transcoder client and commented copy to `the-ear-prod-video-upload` | End of `transcode.js` | Not active in the bundle |
| Commented S3 website URL for duration | Both Python files | Active URL is CloudFront `d1ogvodmq23438.cloudfront.net` |

## Not in this repository (related work lives elsewhere)

These are in `silicon_ark/theear_transcode`, not in `ear_lambdas`:

- Elastic Transcoder job for `.mxf` in `eu-west-1`.
- The Serverless source, `serverless.yml`, IAM policy JSON, and archived trees.
- Ireland function `lambda_move_transcode_to_resources.js`.

The Cape Town catalog, backfill, and notes handlers are the overlap. Duration and the PHP cron pings are only in this export.

## Changed

| Change | Evidence |
|---|---|
| `VideoDurationOnPut` added | `1539c1d` adds the yaml and a 2111-byte zip. No other files change in that commit |

No commit message describes a behaviour change inside an existing zip. The eleven functions from `cc029a4` are unchanged after that commit.

## Planned

No TODO, roadmap, or commented future feature states an intention. `videoDuration` `lambda_function.py` contains the comment `# TODO implement` above a function that is implemented. Provenance: **Implemented** leftover comment. It is not a plan.

`phpCronEveryDay` and `phpCronTrigger` and `theearresourcestoupload` are tagged `lambda-console:blueprint: hello-world`. The handlers are not the hello-world blueprint. Provenance: **Inferred** console default tag.

## Deprecated / removed

Nothing in git history deletes a function. The templates still name `nodejs12.x`, `nodejs14.x`, and `nodejs16.x`. Those strings are the configured runtimes. Current AWS Lambda support for them was not verified on this evidence date. **Unknown / Requires Confirmation.**

## Empty or starter descriptions

| Template | `Description` property |
|---|---|
| `phpCronEveryDay`, `phpCronTrigger`, `the-ear-resources-to-upload` | "A starter AWS Lambda function." |
| The other nine | Empty string or omitted meaningful text (`Description: ''`) |

The descriptions do not match the handlers.
