Skip to content

Commit

Permalink
feat(OY-26537): OS changelog package activity
Browse files Browse the repository at this point in the history
  • Loading branch information
pkim-gswell committed Dec 15, 2023
1 parent aea472d commit 044e60a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
19 changes: 16 additions & 3 deletions src/services/data/handlers/sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,15 @@ export const seatool: Handler<Event> = async (event) => {
}
};

export const onemac: Handler<Event> = async (event) => {
/**
* {
* authority: sd,
* actionType: One | seatol | onemac.new
* data: OncmacTransform | One
* }
*/

export const onemac_base = async (event: Event) => {
const oneMacRecords: (
| OnemacTransform
| OnemacRecordsToDelete
Expand Down Expand Up @@ -300,7 +308,7 @@ export const onemac: Handler<Event> = async (event) => {
* }
*/

export const changelog: Handler<Event> = async (event) => {
export const onemac_changelog = async (event: Event) => {
const data = Object.values(event.records).reduce((ACC, RECORDS) => {
RECORDS.forEach((REC) => {
//TODO: handle delete
Expand All @@ -318,8 +326,13 @@ export const changelog: Handler<Event> = async (event) => {
}, [] as any[]);

Check warning on line 326 in src/services/data/handlers/sink.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

try {
await os.bulkUpdateData(osDomain, "main", data);
await os.bulkUpdateData(osDomain, "changelog", data);
} catch (error) {
console.error(error);
}
};

export const onemac: Handler<Event> = async (event) => {
await onemac_base(event);
await onemac_changelog(event);
};
13 changes: 0 additions & 13 deletions src/services/data/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,6 @@ functions:
- Ref: SecurityGroup
subnetIds: >-
${self:custom.vpc.privateSubnets}
sinkChangelog:
handler: handlers/changelog.onemac
environment:
region: ${self:provider.region}
osDomain: !Sub https://${OpenSearch.DomainEndpoint}
maximumRetryAttempts: 0
timeout: 60
memorySize: 1024
vpc:
securityGroupIds:
- Ref: SecurityGroup
subnetIds: >-
${self:custom.vpc.privateSubnets}
disableTriggers:
handler: handlers/reindex.toggleTriggers
timeout: 60
Expand Down

0 comments on commit 044e60a

Please sign in to comment.