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

refactor: add missing project reference #3389

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ describe('analytic lambda', () => {
function setupEnv(t: TestContext): void {
t.mock.method(Env, 'get', (key: string): string => {
switch (key) {
case Env.Analytics.ElasticIndexName:
return 'basemaps-history';
case Env.Analytics.CacheBucket:
return 'mem://cache/';
case Env.Analytics.CloudFrontSourceBucket:
Expand All @@ -68,8 +70,7 @@ describe('analytic lambda', () => {
} as unknown as Client;

const YesterDay = getYesterday();
const shortDate = YesterDay.toISOString().slice(0, 13).replace('T', '-');

const shortDate = YesterDay.toISOString().slice(0, 10) + '-23';
await fsa.write(new URL(`mem://source/cfid.${shortDate}/data.txt.gz`), gzipSync(LogData));

await main(new FakeLambdaRequest());
Expand Down Expand Up @@ -114,8 +115,7 @@ describe('analytic lambda', () => {
} as unknown as Client;

const YesterDay = getYesterday();
const shortDate = YesterDay.toISOString().slice(0, 13).replace('T', '-');

const shortDate = YesterDay.toISOString().slice(0, 10) + '-23';
await fsa.write(new URL(`mem://source/cfid.${shortDate}/data.txt.gz`), gzipSync(LogData));

const ret = await main(new FakeLambdaRequest()).catch((e: Error) => e);
Expand Down
1 change: 1 addition & 0 deletions packages/lambda-analytic-cloudfront/src/date.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function getYesterday(): Date {
// Process up to about a day ago
const maxDate = new Date();
maxDate.setUTCHours(0);
maxDate.setUTCMinutes(0);
maxDate.setUTCSeconds(0);
maxDate.setUTCMilliseconds(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { isValidOs, UserAgentOs, UserAgentParser } from '../parser.types.js';
function guessQgisOs(ua: string): UserAgentOs | undefined {
if (ua.includes('/windows')) return 'windows';
if (ua.includes('/mac')) return 'macos';
return;
}

const ArcGis: Record<string, UserAgentParser> = {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{ "path": "./packages/shared/tsconfig.json" },
{ "path": "./packages/lambda-tiler/tsconfig.json" },
{ "path": "./packages/lambda-analytics/tsconfig.json" },
{ "path": "./packages/lambda-analytic-cloudfront/tsconfig.json" },
{ "path": "./packages/attribution/tsconfig.json" },
{ "path": "./packages/landing/tsconfig.json" },
{ "path": "./packages/server/tsconfig.json" },
Expand Down
Loading