mirror of
https://github.com/Sea-Haven-Industries/seahaven-door-unlock-api.git
synced 2026-09-30 07:03:12 +00:00
Some checks failed
Deploy / deploy (push) Has been cancelled
* feat(3cx): sync office department BLFs via XAPI Keep unlock and lockdown keys in the templates and write colleague plus shared-parking BLFs per extension so phones skip their own line. * fix(3cx): preserve parking BLF IDs and fail the job on PATCH errors
21 lines
704 B
JavaScript
21 lines
704 B
JavaScript
#!/usr/bin/env node
|
|
import { handler, type BlfSyncEvent } from "../lambda/blf-sync/blf-sync-handler";
|
|
|
|
process.env.THREE_CX_DOMAIN_SECRET ??= "afterhours-shift-manager/3cx-domain";
|
|
process.env.THREE_CX_CLIENT_ID_SECRET ??= "afterhours-shift-manager/3cx-client-id";
|
|
process.env.THREE_CX_CLIENT_SECRET_SECRET ??= "afterhours-shift-manager/3cx-client-secret";
|
|
|
|
const args = process.argv.slice(2);
|
|
const event: BlfSyncEvent = {
|
|
dryRun: !args.includes("--write"),
|
|
smokeExtension: args.find((a) => a.startsWith("--smoke="))?.slice("--smoke=".length),
|
|
};
|
|
|
|
if (event.dryRun === false) {
|
|
process.env.DRY_RUN = "false";
|
|
}
|
|
|
|
handler(event).catch((err) => {
|
|
console.error(String(err));
|
|
process.exit(1);
|
|
});
|