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

ci: make e2e worker child of fingerprint rule #48

Merged
merged 1 commit into from
Mar 13, 2024
Merged
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
16 changes: 8 additions & 8 deletions scripts/deployRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import {ORIGIN_DOMAIN} from "./utils/constants";
import rulePatch from '../assets/patch-body/patchBodyAddRule.json'
import {e2eRules} from "./e2eRules";

type PatchParameter = {
op: string;
value: {children: object[]};
path: string;
}

const getLatestVersion = async (propertyId: string) => {
const {body} = await akamaiRequest({
path: `/papi/v1/properties/${propertyId}/versions?contractId=${process.env.AK_CONTRACT_ID}&groupId=${process.env.AK_GROUP_ID}`,
Expand Down Expand Up @@ -62,10 +68,6 @@ const patchRemoveFingerprintRules = async (propertyId: string, version: string)
{
op: "remove",
path: "/rules/children/6",
},
{
op: "remove",
path: "/rules/children/7",
}
])
});
Expand Down Expand Up @@ -113,11 +115,9 @@ const activateVersion = async (propertyId: string, version: string) => {
})
}

const createE2ERules = () => ({...rulePatch, value: e2eRules})

import('../dist/patch-body/body.json').then((module) => {
const patchReqBody = module.default as object[];
patchReqBody.push(createE2ERules())
const patchReqBody = module.default as PatchParameter[];
patchReqBody[0].value.children.push(e2eRules)

const handler = async () => {
try {
Expand Down
Loading